From: Laszlo T. <ave...@us...> - 2005-12-04 23:12:50
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5391/GUIScripts/bg1 Modified Files: GUICommonWindows.py GUIWORLD.py MessageWindow.py Log Message: brought bg1 ActionsWindow up to the common level too Index: MessageWindow.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/MessageWindow.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MessageWindow.py 29 Nov 2005 22:40:36 -0000 1.18 --- MessageWindow.py 4 Dec 2005 23:12:41 -0000 1.19 *************** *** 63,68 **** GemRB.SetVar("TopPosition", 5) #Inactivating ! SetupActionsWindowControls (ActionsWindow) ! SetupMenuWindowControls (OptionsWindow) UpdateControlStatus() --- 63,68 ---- GemRB.SetVar("TopPosition", 5) #Inactivating ! OpenActionsWindowControls (ActionsWindow) ! SetupMenuWindowControls (OptionsWindow, 1, "ReturnToGame") UpdateControlStatus() Index: GUICommonWindows.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/GUICommonWindows.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GUICommonWindows.py 29 Nov 2005 22:40:36 -0000 1.5 --- GUICommonWindows.py 4 Dec 2005 23:12:41 -0000 1.6 *************** *** 26,30 **** import GemRB from GUIDefines import * - from GUICommon import CloseOtherWindow from ie_stats import * --- 26,29 ---- *************** *** 45,49 **** # 10 TXTE ! def SetupMenuWindowControls (Window): # FIXME: add "(key)" to tooltips! --- 44,51 ---- # 10 TXTE ! def ReturnToGame (): ! print "returntogame" ! ! def SetupMenuWindowControls (Window, Gears, ReturnToGame): # FIXME: add "(key)" to tooltips! *************** *** 51,56 **** Button = GemRB.GetControl (Window, 0) GemRB.SetTooltip (Window, Button, 16313) ! #GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc(Window, Button, "SelectedWindow", 0) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ReturnToGame") --- 53,58 ---- Button = GemRB.GetControl (Window, 0) GemRB.SetTooltip (Window, Button, 16313) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc (Window, Button, "SelectedWindow", 0) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ReturnToGame") *************** *** 58,63 **** Button = GemRB.GetControl (Window, 1) GemRB.SetTooltip (Window, Button, 16310) ! #GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc(Window, Button, "SelectedWindow", 1) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMapWindow") --- 60,65 ---- Button = GemRB.GetControl (Window, 1) GemRB.SetTooltip (Window, Button, 16310) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc (Window, Button, "SelectedWindow", 1) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMapWindow") *************** *** 65,76 **** Button = GemRB.GetControl (Window, 2) GemRB.SetTooltip (Window, Button, 16308) ! #GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc(Window, Button, "SelectedWindow", 2) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenJournalWindow") # Inventory Button = GemRB.GetControl (Window, 3) GemRB.SetTooltip (Window, Button, 16307) ! #GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc(Window, Button, "SelectedWindow", 3) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenInventoryWindow") --- 67,78 ---- Button = GemRB.GetControl (Window, 2) GemRB.SetTooltip (Window, Button, 16308) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc (Window, Button, "SelectedWindow", 2) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenJournalWindow") # Inventory Button = GemRB.GetControl (Window, 3) GemRB.SetTooltip (Window, Button, 16307) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc (Window, Button, "SelectedWindow", 3) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenInventoryWindow") *************** *** 78,83 **** Button = GemRB.GetControl (Window, 4) GemRB.SetTooltip (Window, Button, 16306) ! #GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc(Window, Button, "SelectedWindow", 4) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenRecordsWindow") --- 80,85 ---- Button = GemRB.GetControl (Window, 4) GemRB.SetTooltip (Window, Button, 16306) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc (Window, Button, "SelectedWindow", 4) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenRecordsWindow") *************** *** 85,96 **** Button = GemRB.GetControl (Window, 5) GemRB.SetTooltip (Window, Button, 16309) ! #GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc(Window, Button, "SelectedWindow", 5) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageWindow") # Priest Button = GemRB.GetControl (Window, 6) GemRB.SetTooltip (Window, Button, 14930) ! #GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc(Window, Button, "SelectedWindow", 6) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestWindow") --- 87,98 ---- Button = GemRB.GetControl (Window, 5) GemRB.SetTooltip (Window, Button, 16309) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc (Window, Button, "SelectedWindow", 5) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageWindow") # Priest Button = GemRB.GetControl (Window, 6) GemRB.SetTooltip (Window, Button, 14930) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc (Window, Button, "SelectedWindow", 6) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestWindow") *************** *** 98,103 **** Button = GemRB.GetControl (Window, 7) GemRB.SetTooltip (Window, Button, 16311) ! #GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc(Window, Button, "SelectedWindow", 7) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenOptionsWindow") --- 100,105 ---- Button = GemRB.GetControl (Window, 7) GemRB.SetTooltip (Window, Button, 16311) ! #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_RADIOBUTTON, OP_OR) ! GemRB.SetVarAssoc (Window, Button, "SelectedWindow", 7) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenOptionsWindow") *************** *** 118,148 **** return - def ReturnToGame (): - print "ReturnToGame" - CloseOtherWindow (None) def AIPress (): print "AIPress" ! def RestPress (): print "RestPress" ! def SetupActionsWindowControls (Window): ! # 41627 - Return to the Game World ! # Select all characters ! Button = GemRB.GetControl (Window, 1) ! GemRB.SetTooltip (Window, Button, 41659) ! # Abort current action ! Button = GemRB.GetControl (Window, 3) ! GemRB.SetTooltip (Window, Button, 41655) ! # Formations Button = GemRB.GetControl (Window, 4) ! GemRB.SetTooltip (Window, Button, 44945) def GetActorClassTitle (actor): --- 120,232 ---- return def AIPress (): print "AIPress" ! return def RestPress (): print "RestPress" + return + def EmptyControls (): + global ActionsWindow ! Window = ActionsWindow ! for i in range (12): ! Button = GemRB.GetControl (Window, i) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) ! GemRB.SetButtonPicture (Window, Button, "") ! return ! def SelectFormationPreset (): ! GemRB.GameSetFormation (GemRB.GetVar ("Value"), GemRB.GetVar ("Formation") ) ! GroupControls () ! return ! def SetupFormation (): ! global ActionsWindow ! Window = ActionsWindow ! for i in range(12): ! Button = GemRB.GetControl (Window, i) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) ! GemRB.SetButtonSprites (Window, Button, "GUIBTBUT",0,0,1,2,3) ! GemRB.SetButtonBAM (Window, Button, "FORM%x"%i,0,0,-1) ! GemRB.SetVarAssoc (Window, Button, "Value", i) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SelectFormationPreset") ! return ! ! def SelectFormation (): ! GemRB.GameSetFormation ( GemRB.GetVar ("Formation") ) ! return ! ! def GroupControls (): ! global ActionsWindow ! ! Window = ActionsWindow ! Button = GemRB.GetControl (Window, 0) ! GemRB.SetActionIcon (Window, Button, 7) ! Button = GemRB.GetControl (Window, 1) ! GemRB.SetActionIcon (Window, Button, 14) ! Button = GemRB.GetControl (Window, 2) ! GemRB.SetActionIcon (Window, Button, 16) ! Button = GemRB.GetControl (Window, 3) ! GemRB.SetActionIcon (Window, Button, -1) Button = GemRB.GetControl (Window, 4) ! GemRB.SetActionIcon (Window, Button, -1) ! Button = GemRB.GetControl (Window, 5) ! GemRB.SetActionIcon (Window, Button, -1) ! Button = GemRB.GetControl (Window, 6) ! GemRB.SetActionIcon (Window, Button, -1) ! GemRB.SetVar ("Formation", GemRB.GameGetFormation ()) ! for i in range (5): ! Button = GemRB.GetControl (Window, 7+i) ! idx = GemRB.GameGetFormation (i) ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_RADIOBUTTON|IE_GUI_BUTTON_NORMAL, OP_SET) ! GemRB.SetButtonSprites (Window, Button, "GUIBTBUT",0,0,1,2,3) ! GemRB.SetButtonBAM (Window, Button, "FORM%x"%idx,0,0,-1) ! GemRB.SetVarAssoc (Window, Button, "Formation", i) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SelectFormation") ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "SetupFormation") ! str = GemRB.GetString (4935) ! GemRB.SetTooltip (Window, Button, "F%d - %s"%(8+i,str) ) ! return + def SetupControls (pc): + EmptyControls() + return + + def OpenActionsWindowControls (Window): + global ActionsWindow + + ActionsWindow = Window + # Gears (time) when options pane is down + #Button = GemRB.GetControl (Window, 62) + #GemRB.SetAnimation (Window, Button, "CGEAR") + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE | IE_GUI_BUTTON_ANIMATED, OP_SET) + #GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + UpdateActionsWindow () + return + + def UpdateActionsWindow (): + global ActionsWindow + + pc = 0 + for i in range (PARTY_SIZE): + if GemRB.GameIsPCSelected (i+1): + if pc == 0: + pc = i+1 + else: + pc = -1 + break + + if pc == 0: + EmptyControls () + return + if pc == -1: + GroupControls () + return + SetupControls (pc) + return def GetActorClassTitle (actor): *************** *** 152,163 **** Class = GemRB.GetPlayerStat (actor, IE_CLASS) ClassTable = GemRB.LoadTable ("classes") ! Class = GemRB.FindTableValue( ClassTable, 5, Class ) #KitTable = GemRB.LoadTable ("kitlist") if ClassTitle==0: if KitIndex == 0: ! ClassTitle=GemRB.GetTableValue(ClassTable, Class, 2) #else: ! # ClassTitle=GemRB.GetTableValue(KitTable, KitIndex, 2) if ClassTitle == "*": --- 236,247 ---- Class = GemRB.GetPlayerStat (actor, IE_CLASS) ClassTable = GemRB.LoadTable ("classes") ! Class = GemRB.FindTableValue ( ClassTable, 5, Class ) #KitTable = GemRB.LoadTable ("kitlist") if ClassTitle==0: if KitIndex == 0: ! ClassTitle=GemRB.GetTableValue (ClassTable, Class, 2) #else: ! # ClassTitle=GemRB.GetTableValue (KitTable, KitIndex, 2) if ClassTitle == "*": *************** *** 229,235 **** sel = GemRB.GameGetSelectedPCSingle () == i + 1 ! GemRB.SetButtonPicture(Window, Button, pic, "NOPORTSM") ! GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_PICTURE | IE_GUI_BUTTON_ALIGN_TOP | IE_GUI_BUTTON_ALIGN_LEFT, OP_SET) GemRB.SetButtonFont (Window, Button, 'TOOLFONT') --- 313,319 ---- sel = GemRB.GameGetSelectedPCSingle () == i + 1 ! GemRB.SetButtonPicture (Window, Button, pic, "NOPORTSM") ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE | IE_GUI_BUTTON_ALIGN_TOP | IE_GUI_BUTTON_ALIGN_LEFT, OP_SET) GemRB.SetButtonFont (Window, Button, 'TOOLFONT') *************** *** 242,250 **** GemRB.SetTooltip (Window, Button, GemRB.GetPlayerName (i+1, 1) + "\n%d/%d" %(hp, hp_max)) if sel: ! #GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_SELECTED) ! GemRB.EnableButtonBorder(Window, Button, FRAME_PC_SELECTED, 1) else: ! #GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_UNPRESSED) ! GemRB.EnableButtonBorder(Window, Button, FRAME_PC_SELECTED, 0) --- 326,334 ---- GemRB.SetTooltip (Window, Button, GemRB.GetPlayerName (i+1, 1) + "\n%d/%d" %(hp, hp_max)) if sel: ! #GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SELECTED) ! GemRB.EnableButtonBorder (Window, Button, FRAME_PC_SELECTED, 1) else: ! #GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_UNPRESSED) ! GemRB.EnableButtonBorder (Window, Button, FRAME_PC_SELECTED, 0) *************** *** 279,290 **** # Run by Game class when selection was changed def SelectionChanged (): # FIXME: hack. If defined, display single selection if (not SelectionChangeHandler): ! for i in range (6): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, GemRB.GameIsPCSelected (i + 1)) else: sel = GemRB.GameGetSelectedPCSingle () ! for i in range (6): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, i + 1 == sel) --- 363,378 ---- # Run by Game class when selection was changed def SelectionChanged (): + global ActionsWindow + # FIXME: hack. If defined, display single selection if (not SelectionChangeHandler): ! if (ActionsWindow!=-1): ! UpdateActionsWindow () ! for i in range (PARTY_SIZE): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, GemRB.GameIsPCSelected (i + 1)) else: sel = GemRB.GameGetSelectedPCSingle () ! for i in range (PARTY_SIZE): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, i + 1 == sel) *************** *** 339,343 **** print "SaveName1", SaveName1 ! for row in range(5): tmp1 = GetSavingThrow (SaveName1, row, level1) if Multi: --- 427,431 ---- print "SaveName1", SaveName1 ! for row in range (5): tmp1 = GetSavingThrow (SaveName1, row, level1) if Multi: *************** *** 352,369 **** # encumbrance # Loading tables of modifications ! Table = GemRB.LoadTable("strmod") ! TableEx = GemRB.LoadTable("strmodex") # Getting the character's strength sstr = GemRB.GetPlayerStat (pc, IE_STR) ext_str = GemRB.GetPlayerStat (pc, IE_STREXTRA) ! max_encumb = GemRB.GetTableValue(Table, sstr, 3) + GemRB.GetTableValue(TableEx, ext_str, 3) encumbrance = GemRB.GetPlayerStat (pc, IE_ENCUMBRANCE) Label = GemRB.GetControl (Window, 0x10000043) ! GemRB.SetText (Window, Label, str(encumbrance) + ":") Label2 = GemRB.GetControl (Window, 0x10000044) ! GemRB.SetText (Window, Label2, str(max_encumb) + ":") ratio = (0.0 + encumbrance) / max_encumb if ratio > 1.0: --- 440,457 ---- # encumbrance # Loading tables of modifications ! Table = GemRB.LoadTable ("strmod") ! TableEx = GemRB.LoadTable ("strmodex") # Getting the character's strength sstr = GemRB.GetPlayerStat (pc, IE_STR) ext_str = GemRB.GetPlayerStat (pc, IE_STREXTRA) ! max_encumb = GemRB.GetTableValue (Table, sstr, 3) + GemRB.GetTableValue (TableEx, ext_str, 3) encumbrance = GemRB.GetPlayerStat (pc, IE_ENCUMBRANCE) Label = GemRB.GetControl (Window, 0x10000043) ! GemRB.SetText (Window, Label, str (encumbrance) + ":") Label2 = GemRB.GetControl (Window, 0x10000044) ! GemRB.SetText (Window, Label2, str (max_encumb) + ":") ratio = (0.0 + encumbrance) / max_encumb if ratio > 1.0: Index: GUIWORLD.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg1/GUIWORLD.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GUIWORLD.py 1 Dec 2005 20:15:47 -0000 1.9 --- GUIWORLD.py 4 Dec 2005 23:12:41 -0000 1.10 *************** *** 27,31 **** from GUIDefines import * from GUICommon import CloseOtherWindow ! from GUICommonWindows import SetEncumbranceLabels FRAME_PC_SELECTED = 0 --- 27,31 ---- from GUIDefines import * from GUICommon import CloseOtherWindow ! from GUICommonWindows import * FRAME_PC_SELECTED = 0 *************** *** 34,38 **** ContainerWindow = None ContinueWindow = None - FormationWindow = None ReformPartyWindow = None OldActionsWindow = None --- 34,37 ---- *************** *** 345,348 **** --- 344,348 ---- GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_ALIGN_BOTTOM|IE_GUI_BUTTON_ALIGN_LEFT, OP_SET) GemRB.SetButtonPicture (Window, Button, pic, "NOPORTSM") + UpdatePortraitWindow () return *************** *** 446,517 **** return - last_formation = None - - def OpenFormationWindow (): - global FormationWindow - - hideflag = GemRB.HideGUI () - if CloseOtherWindow (OpenFormationWindow): - GemRB.UnloadWindow (FormationWindow) - FormationWindow = None - - GemRB.GameSetFormation (last_formation) - GemRB.SetVar ("OtherWindow", -1) - if hideflag: - GemRB.UnhideGUI () - return - - GemRB.LoadWindowPack (GetWindowPack()) - FormationWindow = Window = GemRB.LoadWindow (27) - GemRB.SetVar ("OtherWindow", Window) - - # Done - Button = GemRB.GetControl (Window, 13) - GemRB.SetText (Window, Button, 1403) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenFormationWindow") - - tooltips = ( - 44957, # Follow - 44958, # T - 44959, # Gather - 44960, # 4 and 2 - 44961, # 3 by 2 - 44962, # Protect - 48152, # 2 by 3 - 44964, # Rank - 44965, # V - 44966, # Wedge - 44967, # S - 44968, # Line - 44969, # None - ) - - for i in range (13): - Button = GemRB.GetControl (Window, i) - GemRB.SetVarAssoc (Window, Button, "SelectedFormation", i) - GemRB.SetTooltip (Window, Button, tooltips[i]) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SelectFormation") - - GemRB.SetVar ("SelectedFormation", GemRB.GameGetFormation ()) - SelectFormation () - - if hideflag: - GemRB.UnhideGUI () - - def SelectFormation (): - global last_formation - Window = FormationWindow - - formation = GemRB.GetVar ("SelectedFormation") - if last_formation != None and last_formation != formation: - Button = GemRB.GetControl (Window, last_formation) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_UNPRESSED) - - Button = GemRB.GetControl (Window, formation) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SELECTED) - - last_formation = formation - return - def DeathWindow() : #playing death movie before continuing --- 446,449 ---- |