2 # GemRB - Infinity Engine Emulator
3 # Copyright (C) 2003 The GemRB Project
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 # GUICommonWindows.py - functions to open common
22 # windows in lower part of the screen
23 ###################################################
26 from GUIDefines
import *
27 from ie_stats
import *
28 from ie_modal
import *
29 from GUICommon
import *
30 from LUCommon
import *
38 DraggedPortrait
= None
40 def SetupMenuWindowControls (Window
, Gears
, ReturnToGame
):
41 """Sets up all of the basic control windows."""
44 OptionsWindow
= Window
45 # FIXME: add "(key)" to tooltips!
48 Button
= Window
.GetControl (0)
49 Button
.SetTooltip (16313)
50 #Button.SetFlags (IE_GUI_BUTTON_RADIOBUTTON, OP_OR)
51 # enabled BAM isn't present in .chu, defining it here
52 Button
.SetSprites ("GUILSOP", 0,16,17,28,16)
53 Button
.SetVarAssoc ("SelectedWindow", 0)
54 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, ReturnToGame
)
55 Button
.SetFlags (IE_GUI_BUTTON_CANCEL
, OP_OR
)
58 Button
= Window
.GetControl (1)
59 Button
.SetTooltip (16310)
60 #Button.SetFlags (IE_GUI_BUTTON_RADIOBUTTON, OP_OR)
61 Button
.SetSprites ("GUILSOP", 0,0,1,20,0)
62 Button
.SetVarAssoc ("SelectedWindow", 1)
63 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "OpenMapWindow")
66 Button
= Window
.GetControl (2)
67 Button
.SetTooltip (16308)
68 #Button.SetFlags (IE_GUI_BUTTON_RADIOBUTTON, OP_OR)
69 Button
.SetSprites ("GUILSOP", 0,4,5,22,4)
70 Button
.SetVarAssoc ("SelectedWindow", 2)
71 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "OpenJournalWindow")
74 Button
= Window
.GetControl (3)
75 Button
.SetTooltip (16307)
76 #Button.SetFlags (IE_GUI_BUTTON_RADIOBUTTON, OP_OR)
77 Button
.SetSprites ("GUILSOP", 0,2,3,21,2)
78 Button
.SetVarAssoc ("SelectedWindow", 3)
79 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "OpenInventoryWindow")
82 Button
= Window
.GetControl (4)
83 Button
.SetTooltip (16306)
84 #Button.SetFlags (IE_GUI_BUTTON_RADIOBUTTON, OP_OR)
85 Button
.SetSprites ("GUILSOP", 0,6,7,23,6)
86 Button
.SetVarAssoc ("SelectedWindow", 4)
87 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "OpenRecordsWindow")
90 Button
= Window
.GetControl (5)
91 Button
.SetTooltip (16309)
92 #Button.SetFlags (IE_GUI_BUTTON_RADIOBUTTON, OP_OR)
93 Button
.SetSprites ("GUILSOP", 0,8,9,24,8)
94 Button
.SetVarAssoc ("SelectedWindow", 5)
95 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "OpenMageWindow")
98 Button
= Window
.GetControl (6)
99 Button
.SetTooltip (14930)
100 #Button.SetFlags (IE_GUI_BUTTON_RADIOBUTTON, OP_OR)
101 Button
.SetSprites ("GUILSOP", 0,10,11,25,10)
102 Button
.SetVarAssoc ("SelectedWindow", 6)
103 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "OpenPriestWindow")
106 Button
= Window
.GetControl (7)
107 Button
.SetTooltip (16311)
108 #Button.SetFlags (IE_GUI_BUTTON_RADIOBUTTON, OP_OR)
109 Button
.SetSprites ("GUILSOP", 0,12,13,26,12)
110 Button
.SetVarAssoc ("SelectedWindow", 7)
111 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "OpenOptionsWindow")
114 Button
= Window
.GetControl (8)
115 Button
.SetTooltip (16312)
116 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "OpenPartyWindow")
120 # Pendulum, gears, sun/moon dial (time)
121 # FIXME: display all animations: CPEN, CGEAR, CDIAL
122 Button
= Window
.GetControl (9)
123 Button
.SetAnimation ("CGEAR")
124 Button
.SetState (IE_GUI_BUTTON_ENABLED
)
125 Button
.SetFlags (IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_ANIMATED|IE_GUI_BUTTON_NORMAL
, OP_SET
)
126 Button
.SetEventByName(IE_GUI_BUTTON_ON_PRESS
, "GearsClicked")
127 SetGamedaysAndHourToken()
128 Button
.SetTooltip(16041)
130 MarkMenuButton (Window
)
134 def MarkMenuButton (WindowIndex
):
135 Pressed
= WindowIndex
.GetControl( GemRB
.GetVar ("SelectedWindow") )
137 for button
in range (9):
138 Button
= WindowIndex
.GetControl (button
)
139 Button
.SetState (IE_GUI_BUTTON_ENABLED
)
143 else: # highlight return to game
144 Button
= WindowIndex
.GetControl (0)
146 Button
.SetState (IE_GUI_BUTTON_SELECTED
)
149 Button
= PortraitWindow
.GetControl (6)
150 AI
= GemRB
.GetMessageWindowSize () & GS_PARTYAI
153 GemRB
.GameSetScreenFlags (GS_PARTYAI
, OP_NAND
)
154 Button
.SetTooltip (15918)
156 GemRB
.GameSetScreenFlags (GS_PARTYAI
, OP_OR
)
157 Button
.SetTooltip (15917)
160 def EmptyControls ():
163 GemRB
.SetVar ("ActionLevel", 0)
164 Window
= ActionsWindow
166 Button
= Window
.GetControl (i
)
167 Button
.SetFlags (IE_GUI_BUTTON_NO_IMAGE
, OP_SET
)
168 Button
.SetPicture ("")
171 def SelectFormationPreset ():
172 GemRB
.GameSetFormation (GemRB
.GetVar ("Value"), GemRB
.GetVar ("Formation") )
176 def SetupFormation ():
179 Window
= ActionsWindow
181 Button
= Window
.GetControl (i
)
182 Button
.SetFlags (IE_GUI_BUTTON_NORMAL
, OP_SET
)
183 Button
.SetSprites ("GUIBTBUT",0,0,1,2,3)
184 Button
.SetBAM ("FORM%x"%i,0,0,-1)
185 Button
.SetVarAssoc ("Value", i
)
186 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "SelectFormationPreset")
189 def GroupControls ():
192 GemRB
.SetVar ("ActionLevel", 0)
193 Window
= ActionsWindow
194 Button
= Window
.GetControl (0)
195 Button
.SetActionIcon (7)
196 Button
= Window
.GetControl (1)
197 Button
.SetActionIcon (15)
198 Button
= Window
.GetControl (2)
199 Button
.SetActionIcon (21)
200 Button
= Window
.GetControl (3)
201 Button
.SetActionIcon (-1)
202 Button
= Window
.GetControl (4)
203 Button
.SetActionIcon (-1)
204 Button
= Window
.GetControl (5)
205 Button
.SetActionIcon (-1)
206 Button
= Window
.GetControl (6)
207 Button
.SetActionIcon (-1)
208 GemRB
.SetVar ("Formation", GemRB
.GameGetFormation ())
210 Button
= Window
.GetControl (7+i
)
211 Button
.SetState (IE_GUI_BUTTON_ENABLED
)
212 idx
= GemRB
.GameGetFormation (i
)
213 Button
.SetFlags (IE_GUI_BUTTON_RADIOBUTTON|IE_GUI_BUTTON_NORMAL
, OP_SET
)
214 Button
.SetSprites ("GUIBTBUT",0,0,1,2,3)
215 Button
.SetBAM ("FORM%x"%idx,0,0,-1)
216 Button
.SetVarAssoc ("Formation", i
)
217 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "SelectFormation")
218 Button
.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS
, "SetupFormation")
219 str = GemRB
.GetString (4935)
220 Button
.SetTooltip ("F%d - %s"%(8+i
,str) )
223 def OpenActionsWindowControls (Window
):
226 ActionsWindow
= Window
227 # Gears (time) when options pane is down
228 #Button = Window.GetControl (62)
229 #Button.SetAnimation ("CGEAR")
230 #Button.SetFlags (IE_GUI_BUTTON_PICTURE | IE_GUI_BUTTON_ANIMATED, OP_SET)
231 #Button.SetState (IE_GUI_BUTTON_LOCKED)
232 UpdateActionsWindow ()
235 def UpdateActionsWindow ():
237 global level
, TopIndex
239 if ActionsWindow
== -1:
242 if ActionsWindow
== None:
246 for i
in range (PARTY_SIZE
):
247 if GemRB
.GameIsPCSelected (i
+1):
254 #setting up the disabled button overlay (using the second border slot)
256 Button
= ActionsWindow
.GetControl (i
)
257 Button
.SetBorder (0,6,6,4,4,0,254,0,255)
258 Button
.SetBorder (1, 0, 0, 0, 0, 50,30,10,120, 0, 1)
259 Button
.SetFont ("NUMBER")
268 #this is based on class
270 level
= GemRB
.GetVar ("ActionLevel")
271 TopIndex
= GemRB
.GetVar ("TopIndex")
273 ActionsWindow
.SetupControls (pc
)
275 ActionsWindow
.SetupEquipmentIcons(pc
, TopIndex
)
276 elif level
== 2: #spells
277 GemRB
.SetVar ("Type", 3)
278 ActionsWindow
.SetupSpellIcons(pc
, 3, TopIndex
)
279 elif level
== 3: #innates
280 GemRB
.SetVar ("Type", 4)
281 ActionsWindow
.SetupSpellIcons(pc
, 4, TopIndex
)
284 def ActionQWeaponPressed (which
):
285 pc
= GemRB
.GameGetFirstSelectedPC ()
287 if GemRB
.GetEquippedQuickSlot (pc
,1)==which
and GemRB
.GameControlGetTargetMode() != TARGET_MODE_ATTACK
:
288 GemRB
.GameControlSetTargetMode (TARGET_MODE_ATTACK
)
290 GemRB
.GameControlSetTargetMode (TARGET_MODE_NONE
)
291 GemRB
.SetEquippedQuickSlot (pc
, which
)
293 ActionsWindow
.SetupControls (pc
)
294 UpdateActionsWindow ()
297 def ActionQWeapon1Pressed ():
298 ActionQWeaponPressed(0)
300 def ActionQWeapon2Pressed ():
301 ActionQWeaponPressed(1)
303 def ActionQWeapon3Pressed ():
304 ActionQWeaponPressed(2)
306 def ActionQWeapon4Pressed ():
307 ActionQWeaponPressed(3)
309 #no check needed because the button wouldn't be drawn if illegal
310 def ActionLeftPressed ():
311 TopIndex
= GemRB
.GetVar ("TopIndex")
316 GemRB
.SetVar ("TopIndex", TopIndex
)
317 UpdateActionsWindow ()
320 #no check needed because the button wouldn't be drawn if illegal
321 def ActionRightPressed ():
322 pc
= GemRB
.GameGetFirstSelectedPC ()
323 TopIndex
= GemRB
.GetVar ("TopIndex")
324 Type
= GemRB
.GetVar ("Type")
325 Max
= GemRB
.GetMemorizedSpellsCount(pc
, Type
)
327 if TopIndex
> Max
- 10:
333 GemRB
.SetVar ("TopIndex", TopIndex
)
334 UpdateActionsWindow ()
337 def ActionBardSongPressed ():
338 """Toggles the battle song."""
339 pc
= GemRB
.GameGetFirstSelectedPC ()
340 GemRB
.SetModalState (pc
, MS_BATTLESONG
)
341 GemRB
.PlaySound ("act_01")
342 UpdateActionsWindow ()
345 def ActionSearchPressed ():
346 pc
= GemRB
.GameGetFirstSelectedPC ()
347 GemRB
.SetModalState (pc
, MS_DETECTTRAPS
)
348 UpdateActionsWindow ()
351 def ActionStealthPressed ():
352 pc
= GemRB
.GameGetFirstSelectedPC ()
353 GemRB
.SetModalState (pc
, MS_STEALTH
)
354 GemRB
.PlaySound ("act_07")
355 UpdateActionsWindow ()
358 def ActionTurnPressed ():
359 pc
= GemRB
.GameGetFirstSelectedPC ()
360 GemRB
.SetModalState (pc
, MS_TURNUNDEAD
)
361 GemRB
.PlaySound ("act_06")
362 UpdateActionsWindow ()
365 def ActionUseItemPressed ():
366 GemRB
.SetVar ("TopIndex", 0)
367 GemRB
.SetVar ("ActionLevel", 1)
368 UpdateActionsWindow ()
371 def ActionCastPressed ():
372 GemRB
.SetVar ("TopIndex", 0)
373 GemRB
.SetVar ("ActionLevel", 2)
374 UpdateActionsWindow ()
377 def ActionInnatePressed ():
378 GemRB
.SetVar ("TopIndex", 0)
379 GemRB
.SetVar ("ActionLevel", 3)
380 UpdateActionsWindow ()
384 pc
= GemRB
.GameGetFirstSelectedPC ()
386 GemRB
.GameControlSetTargetMode (TARGET_MODE_CAST
)
387 Spell
= GemRB
.GetVar ("Spell")
388 Type
= GemRB
.GetVar ("Type")
389 GemRB
.SpellCast (pc
, Type
, Spell
)
390 GemRB
.SetVar ("ActionLevel", 0)
391 UpdateActionsWindow ()
394 def EquipmentPressed ():
395 pc
= GemRB
.GameGetFirstSelectedPC ()
397 GemRB
.GameControlSetTargetMode (TARGET_MODE_CAST
)
398 Item
= GemRB
.GetVar ("Equipment")
400 GemRB
.UseItem (pc
, -1, Item
)
401 GemRB
.SetVar ("ActionLevel", 0)
402 UpdateActionsWindow ()
405 SelectionChangeHandler
= None
407 def SetSelectionChangeHandler (handler
):
408 global SelectionChangeHandler
410 # Switching from walking to non-walking environment:
411 # set the first selected PC in walking env as a selected
413 if (not SelectionChangeHandler
) and handler
:
414 sel
= GemRB
.GameGetFirstSelectedPC ()
417 GemRB
.GameSelectPCSingle (sel
)
419 SelectionChangeHandler
= handler
421 # redraw selection on change main selection | single selection
424 def RunSelectionChangeHandler ():
425 if SelectionChangeHandler
:
426 SelectionChangeHandler ()
428 def OpenPortraitWindow (needcontrols
):
429 global PortraitWindow
431 PortraitWindow
= Window
= GemRB
.LoadWindow (1)
434 #Button=Window.GetControl (8)
435 #Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "MinimizePortraits")
438 Button
= Window
.GetControl (6)
439 GSFlags
= GemRB
.GetMessageWindowSize ()&GS_PARTYAI
440 Button
.SetFlags (IE_GUI_BUTTON_CHECKBOX
, OP_OR
)
441 #this control is crippled
442 Button
.SetSprites ("GUIBTACT", 0, 46, 47, 48, 49)
443 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "AIPress")
444 Button
.SetVarAssoc ("", GSFlags
)
446 Button
.SetTooltip (15917)
448 Button
.SetTooltip (15918)
451 Button
= Window
.GetControl (7)
452 Button
.SetTooltip (10485)
453 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "SelectAllOnPress")
456 Button
= Window
.GetControl (6)
457 Button
.SetTooltip (11942)
458 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "RestPress")
460 for i
in range (PARTY_SIZE
):
461 Button
= Window
.GetControl (i
)
462 Button
.SetFont ("STATES2")
463 Button
.SetVarAssoc ("PressedPortrait", i
+1)
466 Button
.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS
, "OpenInventoryWindowClick")
468 Button
.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS
, "PortraitButtonOnPress")
470 Button
.SetEventByName (IE_GUI_BUTTON_ON_PRESS
, "PortraitButtonOnPress")
471 Button
.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS
, "PortraitButtonOnShiftPress")
472 Button
.SetEventByName (IE_GUI_BUTTON_ON_DRAG_DROP
, "OnDropItemToPC")
473 Button
.SetEventByName (IE_GUI_BUTTON_ON_DRAG_DROP_PORTRAIT
, "OnDropPortraitToPC")
474 Button
.SetEventByName (IE_GUI_BUTTON_ON_DRAG
, "PortraitButtonOnDrag")
475 Button
.SetEventByName (IE_GUI_MOUSE_ENTER_BUTTON
, "PortraitButtonOnMouseEnter")
476 Button
.SetEventByName (IE_GUI_MOUSE_LEAVE_BUTTON
, "PortraitButtonOnMouseLeave")
478 Button
.SetBorder (FRAME_PC_SELECTED
, 1, 1, 2, 2, 0, 255, 0, 255)
479 Button
.SetBorder (FRAME_PC_TARGET
, 3, 3, 4, 4, 255, 255, 0, 255)
481 UpdatePortraitWindow ()
485 def UpdatePortraitWindow ():
486 """Updates all of the portraits."""
488 Window
= PortraitWindow
490 pc
= GemRB
.GameGetSelectedPCSingle ()
491 Inventory
= GemRB
.GetVar ("Inventory")
493 for portid
in range (PARTY_SIZE
):
494 Button
= Window
.GetControl (portid
)
495 pic
= GemRB
.GetPlayerPortrait (portid
+1, 1)
496 if Inventory
and pc
!= portid
+1:
500 Button
.SetFlags (IE_GUI_BUTTON_NO_IMAGE
, OP_SET
)
501 Button
.SetState (IE_GUI_BUTTON_DISABLED
)
503 Button
.SetTooltip ("")
506 Button
.SetFlags (IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_ALIGN_BOTTOM|IE_GUI_BUTTON_ALIGN_LEFT|IE_GUI_BUTTON_HORIZONTAL|IE_GUI_BUTTON_DRAGGABLE
, OP_SET
)
507 Button
.SetState (IE_GUI_BUTTON_ENABLED
)
508 Button
.SetPicture (pic
, "NOPORTSM")
509 hp
= GemRB
.GetPlayerStat (portid
+1, IE_HITPOINTS
)
510 hp_max
= GemRB
.GetPlayerStat (portid
+1, IE_MAXHITPOINTS
)
511 state
= GemRB
.GetPlayerStat (portid
+1, IE_STATE_ID
)
516 ratio
= (hp
+0.0) / hp_max
518 if hp
<1 or (state
& STATE_DEAD
):
519 Button
.SetOverlay (ratio
, 64,64,64,200, 64,64,64,200)
521 Button
.SetOverlay (ratio
, 255,0,0,200, 128,0,0,200)
522 Button
.SetTooltip (GemRB
.GetPlayerName (portid
+1, 1) + "\n%d/%d" %(hp
, hp_max
))
524 #add effects on the portrait
525 effects
= GemRB
.GetPlayerStates (portid
+1)
527 for col
in range(len(effects
)):
528 states
= effects
[col
:col
+1] + states
529 if col
% 3 == 2: states
= "\n" + states
530 for x
in range(3 - (len(effects
)/3)):
531 states
= "\n" + states
532 states
= "\n" + states
539 if GemRB
.GetStore()!=None:
542 if GemRB
.GameGetSelectedPCSingle(1)==portid
+1:
545 if CanLevelUp (portid
+1):
546 states
= flag
+chr(238)+chr(39) + states
548 states
= flag
+chr(238)+chr(238) + states
549 Button
.SetText(states
)
552 def PortraitButtonOnDrag ():
553 global DraggedPortrait
556 DraggedPortrait
= GemRB
.GetVar ("PressedPortrait")
557 GemRB
.DragItem (DraggedPortrait
, -1, "")
560 def PortraitButtonOnPress ():
561 i
= GemRB
.GetVar ("PressedPortrait")
566 if GemRB
.GameControlGetTargetMode() != TARGET_MODE_NONE
:
570 if (not SelectionChangeHandler
):
571 if GemRB
.GameIsPCSelected (i
):
572 GemRB
.GameControlSetScreenFlags (SF_CENTERONACTOR
, OP_OR
)
573 GemRB
.GameSelectPC (i
, True, SELECT_REPLACE
)
575 GemRB
.GameSelectPCSingle (i
)
577 RunSelectionChangeHandler ()
580 def PortraitButtonOnShiftPress ():
581 i
= GemRB
.GetVar ("PressedPortrait")
586 if (not SelectionChangeHandler
):
587 sel
= GemRB
.GameIsPCSelected (i
)
589 GemRB
.GameSelectPC (i
, sel
)
591 GemRB
.GameSelectPCSingle (i
)
593 RunSelectionChangeHandler ()
596 # Run by Game class when selection was changed
597 def SelectionChanged ():
598 global PortraitWindow
600 GemRB
.SetVar ("ActionLevel", 0)
601 if (not SelectionChangeHandler
):
602 UpdateActionsWindow ()
603 for i
in range (PARTY_SIZE
):
604 Button
= PortraitWindow
.GetControl (i
)
605 Button
.EnableBorder (FRAME_PC_SELECTED
, GemRB
.GameIsPCSelected (i
+ 1))
607 sel
= GemRB
.GameGetSelectedPCSingle ()
609 for i
in range (PARTY_SIZE
):
610 Button
= PortraitWindow
.GetControl (i
)
611 Button
.EnableBorder (FRAME_PC_SELECTED
, i
+ 1 == sel
)
614 def PortraitButtonOnMouseEnter ():
615 global DraggedPortrait
617 i
= GemRB
.GetVar ("PressedPortrait")
618 if GemRB
.IsDraggingItem()==2:
619 if DraggedPortrait
!= None:
620 GemRB
.SwapPCs (DraggedPortrait
, i
)
621 GemRB
.SetVar ("PressedPortrait", DraggedPortrait
)
623 GemRB
.SetTimedEventByName ("CheckDragging",1)
628 if GemRB
.IsDraggingItem ():
629 Button
= PortraitWindow
.GetControl (i
)
630 Button
.EnableBorder (FRAME_PC_TARGET
, 1)
633 def OnDropPortraitToPC ():
634 GemRB
.SetVar ("PressedPortrait",0)
635 GemRB
.DragItem (0, -1, "")
636 DraggedPortrait
= None
640 """Contains portrait dragging in case of mouse out-of-range."""
642 global DraggedPortrait
644 i
= GemRB
.GetVar ("PressedPortrait")
646 GemRB
.DragItem (0, -1, "")
648 if GemRB
.IsDraggingItem()!=2:
649 DraggedPortrait
= None
652 def PortraitButtonOnMouseLeave ():
653 i
= GemRB
.GetVar ("PressedPortrait")
657 Button
= PortraitWindow
.GetControl (i
-1)
658 Button
.EnableBorder (FRAME_PC_TARGET
, 0)
659 GemRB
.SetVar ("PressedPortrait", 0)
660 GemRB
.SetTimedEventByName ("CheckDragging",1)
663 def OpenWaitForDiscWindow ():
670 GemRB
.SetVar ("OtherWindow", -1)
671 # ...LoadWindowPack()
672 EnableAnimatedWindows ()
682 GemRB
.LoadWindowPack ("GUIID")
683 DiscWindow
= Window
= GemRB
.LoadWindow (0)
684 GemRB
.SetVar ("OtherWindow", Window
.ID
)
685 label
= DiscWindow
.GetControl (0)
687 disc_num
= GemRB
.GetVar ("WaitForDisc")
688 #disc_path = GemRB.GetVar ("WaitForDiscPath")
691 text
= GemRB
.GetString (31483) + " " + str (disc_num
) + " " + GemRB
.GetString (31569) + " " + disc_path
+ "\n" + GemRB
.GetString (49152)
693 DisableAnimatedWindows ()
694 # 31483 - Please place PS:T disc number
695 # 31568 - Please place the PS:T DVD
697 # 31570 - Wrong disc in drive
698 # 31571 - There is no disc in drive
699 # 31578 - No disc could be found in drive. Please place Disc 1 in drive.
700 # 49152 - To quit the game, press Alt-F4
705 DiscWindow
.SetVisible (WINDOW_VISIBLE
)
707 def CheckLevelUp(pc
):
708 GemRB
.SetVar ("CheckLevelUp"+str(pc
), CanLevelUp (pc
))