home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00412_PWINSCRIPTS.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  5.3 KB  |  175 lines

  1. global gTheName, gTheNewWinht, gTheNewWinwd, gtheHeight, gTheWidth, gAssetPath, gPDL, gWinListNum, gWindowNum1, gMyWinTracker, gtheLockList, gtheSearchWord, gtheWord, gImageList, gActiveWin, gWinType, gNewCaption, gPath, gPicWinNum, gComputerTypeK, gWinTypeList, gModeState, gLastWinLeft, gLastWinTop, gWinOffSet, gWinLocRootT, gWinLocRootL, gWinLocCounter
  2.  
  3. on birth me
  4.   return me
  5. end
  6.  
  7. on mFixMe me
  8.   set LtheHeight to the height of cast "BlankPict"
  9.   set LtheWidth to the width of cast "BlankPict"
  10.   if not (the puppet of sprite 2) then
  11.     puppetSprite(2, 1)
  12.   end if
  13.   set the locH of sprite 2 to 7 + (LtheWidth / 2)
  14.   set the locV of sprite 2 to 19 + (LtheHeight / 2)
  15.   updateStage()
  16. end
  17.  
  18. on mStartUp me
  19.   setAt(gImageList, gWinListNum, gTheName)
  20.   setAt(gWinTypeList, gWinListNum, gModeState)
  21.   setAt(gMyWinTracker, gWinListNum, 1)
  22.   if not (the puppet of sprite 2) then
  23.     puppetSprite(2, 1)
  24.   end if
  25.   set the text of cast "caption" to string(gNewCaption)
  26.   go(2)
  27.   mMoveTextField(me)
  28.   set vTrekCursor to the number of cast "trekcursFG"
  29.   cursor([vTrekCursor, vTrekCursor + 1])
  30. end
  31.  
  32. on mSetBlankCast me
  33.   set the fileName of cast "BlankPict" to the pathName & "BLMPC\" & "BlankR.pic"
  34. end
  35.  
  36. on mDoCloseWindow me
  37.   set gPicWinNum to chars(the movieName, 1, 2)
  38.   if char 2 of string(gPicWinNum) = "P" then
  39.     set gPicWinNum to char 1 of string(gPicWinNum)
  40.   else
  41.     set gPicWinNum to char 1 to 2 of string(gPicWinNum)
  42.   end if
  43.   set gActiveWin to the pathName & the movieName
  44.   tell the stage
  45.     hRestorePicon(1)
  46.   end tell
  47.   set vWinToClose to getaProp(gMyWinList, gPicWinNum)
  48.   if the shiftDown then
  49.     set gLastWinLeft to getAt(the rect of window gActiveWin, 1)
  50.     set gLastWinTop to getAt(the rect of window gActiveWin, 2)
  51.     set gWinLocRootL to getAt(the rect of window gActiveWin, 1)
  52.     set gWinLocRootT to getAt(the rect of window gActiveWin, 2)
  53.     set gWinLocCounter to 1
  54.   end if
  55.   setAt(gImageList, integer(gPicWinNum), EMPTY)
  56.   setAt(gWinTypeList, integer(gPicWinNum), #CLOSED)
  57.   setAt(gMyWinList, integer(gPicWinNum), EMPTY)
  58.   setAt(gMyWinTracker, integer(gPicWinNum), 0)
  59.   setAt(gtheLockList, integer(gPicWinNum), 0)
  60.   forget(window vWinToClose)
  61. end
  62.  
  63. on mKeyVoiceClose me
  64.   tell the stage
  65.     hRestorePicon(1)
  66.   end tell
  67.   set vWinToClose to getaProp(gMyWinList, gPicWinNum)
  68.   if the shiftDown then
  69.     set gLastWinLeft to getAt(the rect of window gActiveWin, 1)
  70.     set gLastWinTop to getAt(the rect of window gActiveWin, 2)
  71.     set gWinLocRootL to getAt(the rect of window gActiveWin, 1)
  72.     set gWinLocRootT to getAt(the rect of window gActiveWin, 2)
  73.     set gWinLocCounter to 1
  74.   end if
  75.   setAt(gImageList, integer(gPicWinNum), EMPTY)
  76.   setAt(gWinTypeList, integer(gPicWinNum), #CLOSED)
  77.   setAt(gMyWinList, integer(gPicWinNum), EMPTY)
  78.   setAt(gMyWinTracker, integer(gPicWinNum), 0)
  79.   setAt(gtheLockList, integer(gPicWinNum), 0)
  80.   forget(window vWinToClose)
  81. end
  82.  
  83. on mDisplayPict me
  84.   mGetthePICT(me)
  85.   mSizetheWindow(me)
  86.   if not (the puppet of sprite 2) then
  87.     puppetSprite(2, 1)
  88.   end if
  89.   set the locH of sprite 2 to 7 + (gTheWidth / 2)
  90.   set the locV of sprite 2 to 19 + (gtheHeight / 2)
  91.   updateStage()
  92. end
  93.  
  94. on mGetthePICT me
  95.   set LFirstChar to char 1 of string(gTheName)
  96.   set gPath to gAssetPath
  97.   set the fileName of cast "BlankPict" to gPath & LFirstChar & gPDL & gTheName & "R.PIC"
  98. end
  99.  
  100. on mMoveTextField me
  101.   if not (the puppet of sprite 4) then
  102.     puppetSprite(4, 1)
  103.   end if
  104.   set the locH of sprite 4 to the right of sprite 2 - 234
  105.   updateStage()
  106.   set x to the movieName
  107.   set vNum to value(char 1 of x)
  108.   if char 2 of x = "0" then
  109.     set vNum to 10
  110.   end if
  111.   if getAt(gtheLockList, vNum) = 1 then
  112.     mForceLockMe(me)
  113.   end if
  114. end
  115.  
  116. on mSizetheWindow me
  117.   set gtheHeight to the height of cast "BlankPict"
  118.   set gTheWidth to the width of cast "BlankPict"
  119.   set the regPoint of cast "BlankPict" to point(gTheWidth / 2, gtheHeight / 2)
  120.   set gTheNewWinht to gtheHeight + 19
  121.   set gTheNewWinwd to gTheWidth + 7
  122. end
  123.  
  124. on mForceLockMe me
  125.   puppetSprite(7, 1)
  126.   set the castNum of sprite 7 to the number of cast "Lock" + 1
  127.   updateStage()
  128.   setAt(gtheLockList, integer(gPicWinNum), 1)
  129. end
  130.  
  131. on mLockMe me
  132.   if gActiveWin <> (the pathName & the movieName) then
  133.     exit
  134.   end if
  135.   if getaProp(gtheLockList, integer(gPicWinNum)) = 0 then
  136.     puppetSprite(7, 1)
  137.     set the castNum of sprite 7 to the number of cast (the castNum of sprite 7 + 1)
  138.     updateStage()
  139.     setAt(gtheLockList, integer(gPicWinNum), 1)
  140.   else
  141.     puppetSprite(7, 0)
  142.     updateStage()
  143.     setAt(gtheLockList, integer(gPicWinNum), 0)
  144.   end if
  145. end
  146.  
  147. on mGetWord me
  148.   global gtheWord
  149.   set x to the mouseCast
  150.   set y to the mouseWord
  151.   if (x > 0) and (y > 0) then
  152.     set gtheWord to word y of field x
  153.     tell the stage
  154.       hFindCaptionWord()
  155.     end tell
  156.   end if
  157. end
  158.  
  159. on mDoActivateWindow me
  160.   set gPicWinNum to chars(the movieName, 1, 2)
  161.   if char 2 of string(gPicWinNum) = "P" then
  162.     set gPicWinNum to char 1 of string(gPicWinNum)
  163.   else
  164.     set gPicWinNum to char 1 to 2 of string(gPicWinNum)
  165.   end if
  166.   set gActiveWin to the pathName & the movieName
  167.   if the shiftDown then
  168.     set gLastWinLeft to getAt(the rect of window gActiveWin, 1) + gWinOffSet
  169.     set gLastWinTop to getAt(the rect of window gActiveWin, 2) + gWinOffSet
  170.     set gWinLocRootL to getAt(the rect of window gActiveWin, 1)
  171.     set gWinLocRootT to getAt(the rect of window gActiveWin, 2)
  172.     set gWinLocCounter to 1
  173.   end if
  174. end
  175.