From: <ave...@us...> - 2007-03-03 13:28:19
|
Revision: 4522 http://gemrb.svn.sourceforge.net/gemrb/?rev=4522&view=rev Author: avenger_teambg Date: 2007-03-03 05:28:19 -0800 (Sat, 03 Mar 2007) Log Message: ----------- bg2/tob: containers are now openable (double clicks don't work, only right click+open container button) fixed window darkening in journal window Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/bg2/GUIINV.py gemrb/trunk/gemrb/GUIScripts/bg2/GUIJRNL.py gemrb/trunk/gemrb/GUIScripts/bg2/GUISTORE.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUIINV.py gemrb/trunk/gemrb/GUIScripts/tob/GUIJRNL.py gemrb/trunk/gemrb/GUIScripts/tob/GUISTORE.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-03-03 13:22:00 UTC (rev 4521) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-03-03 13:28:19 UTC (rev 4522) @@ -490,6 +490,9 @@ GemRB.SetTooltip (Window, Button, 10485) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SelectAllOnPress") + pc = GemRB.GameGetSelectedPCSingle () + Inventory = GemRB.GetVar ("Inventory") + for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) GemRB.SetVarAssoc (Window, Button, "PressedPortrait", i) @@ -504,6 +507,12 @@ GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_ENTER_BUTTON, "PortraitButtonOnMouseEnter") GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_LEAVE_BUTTON, "PortraitButtonOnMouseLeave") + if Inventory and pc !=i+1: + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) + GemRB.SetText (Window, Button, "") + GemRB.SetTooltip (Window, Button, "") + GemRB.SetButtonBorder (Window, Button, FRAME_PC_SELECTED, 1, 1, 2, 2, 0, 255, 0, 255) GemRB.SetButtonBorder (Window, Button, FRAME_PC_TARGET, 3, 3, 4, 4, 255, 255, 0, 255) #GemRB.SetButtonFont (Window, Button, "NORMAL") @@ -515,9 +524,15 @@ def UpdatePortraitWindow (): Window = PortraitWindow + pc = GemRB.GameGetSelectedPCSingle () + Inventory = GemRB.GetVar ("Inventory") + for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) pic = GemRB.GetPlayerPortrait (i+1, 1) + if Inventory and pc!=i+1: + pic = None + if not pic: GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIINV.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIINV.py 2007-03-03 13:22:00 UTC (rev 4521) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIINV.py 2007-03-03 13:28:19 UTC (rev 4522) @@ -26,6 +26,7 @@ import string import GemRB import GUICommonWindows +from GUISTORE import * from GUIDefines import * from ie_stats import * from ie_slots import * @@ -68,13 +69,15 @@ InventoryWindow = None GemRB.SetVar ("OtherWindow", -1) GemRB.SetVar ("MessageLabel", -1) - GemRB.SetVisible (0,1) - GemRB.UnhideGUI () GUICommonWindows.PortraitWindow = OldPortraitWindow OldPortraitWindow = None GUICommonWindows.OptionsWindow = OldOptionsWindow OldOptionsWindow = None - SetSelectionChangeHandler (None) + #don't go back to multi selection mode when going to the store screen + if not GemRB.GetVar("Inventory"): + GemRB.SetVisible (0,1) + GemRB.UnhideGUI () + SetSelectionChangeHandler (None) return GemRB.HideGUI () @@ -538,6 +541,19 @@ UpdateInventoryWindow () return +def OpenItemWindow (): + #close inventory + GemRB.SetVar ("Inventory", 1) + GemRB.UnloadWindow (ItemInfoWindow) + OpenInventoryWindow () + pc = GemRB.GameGetSelectedPCSingle () + slot = GemRB.GetVar ("ItemButton") + slot_item = GemRB.GetSlotItem (pc, slot) + ResRef = slot_item['ItemResRef'] + #the store will have to reopen the inventory + GemRB.EnterStore (ResRef) + return + def DialogItemWindow (): GemRB.UnloadWindow (ItemInfoWindow) OpenInventoryWindow () @@ -547,7 +563,7 @@ ResRef = slot_item['ItemResRef'] item = GemRB.GetItem (ResRef) dialog=item["Dialog"] - GemRB.ExecuteString("StartDialog(\""+dialog+"\",Myself)", pc) + GemRB.ExecuteString ("StartDialog(\""+dialog+"\",Myself)", pc) return def IdentifyUseSpell (): @@ -606,7 +622,7 @@ def CloseItemInfoWindow (): GemRB.UnloadWindow (ItemInfoWindow) - UpdateInventoryWindow () + UpdateInventoryWindow() return def DisplayItem (itemresref, type): Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIJRNL.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIJRNL.py 2007-03-03 13:22:00 UTC (rev 4521) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIJRNL.py 2007-03-03 13:28:19 UTC (rev 4522) @@ -61,6 +61,7 @@ OldPortraitWindow = None GUICommonWindows.OptionsWindow = OldOptionsWindow OldOptionsWindow = None + SetSelectionChangeHandler (None) return Table = GemRB.LoadTable("YEARS") @@ -126,9 +127,10 @@ #GemRB.SetEvent (JournalWindow, Button, IE_GUI_BUTTON_ON_PRESS, "OpenJournalWindow") Chapter = GemRB.GetGameVar("chapter") + SetSelectionChangeHandler (UpdateLogWindow) UpdateLogWindow () GemRB.SetVisible (OptionsWindow, 1) - GemRB.SetVisible (Window, 1) + GemRB.SetVisible (Window, 3) GemRB.SetVisible (PortraitWindow, 1) return @@ -174,6 +176,7 @@ GemRB.TextAreaAppend (Window, Text, je['Text'], 3*i+1) GemRB.TextAreaAppend (Window, Text, "", 3*i + 2) + GemRB.SetVisible (Window, 1) return ################################################### Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUISTORE.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUISTORE.py 2007-03-03 13:22:00 UTC (rev 4521) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUISTORE.py 2007-03-03 13:28:19 UTC (rev 4522) @@ -51,6 +51,7 @@ ITEM_PC = 0 ITEM_STORE = 1 +Inventory = None RentIndex = -1 Store = None Buttons = [-1,-1,-1,-1] @@ -95,23 +96,28 @@ global StoreWindow, ActionWindow, PortraitWindow global OldPortraitWindow + GemRB.SetVar ("Inventory", 0) CloseWindows () GemRB.UnloadWindow (StoreWindow) GemRB.UnloadWindow (ActionWindow) GemRB.UnloadWindow (PortraitWindow) StoreWindow = None GemRB.LeaveStore () - GemRB.SetVisible (0,1) #enabling the game control screen - GemRB.UnhideGUI () #enabling the other windows GUICommonWindows.PortraitWindow = OldPortraitWindow - SetSelectionChangeHandler( None ) + if Inventory: + GemRB.RunEventHandler("OpenInventoryWindow") + else: + GemRB.SetVisible (0,1) #enabling the game control screen + GemRB.UnhideGUI () #enabling the other windows + SetSelectionChangeHandler( None ) + return - def OpenStoreWindow (): global Store global StoreWindow, ActionWindow, PortraitWindow global OldPortraitWindow global store_update_funcs + global Inventory #these are function pointers, not strings #can't put this in global init, doh! @@ -123,6 +129,11 @@ GemRB.HideGUI () GemRB.SetVisible (0,0) #removing the game control screen + if GemRB.GetVar ("Inventory"): + Inventory = 1 + else: + Inventory = None + GemRB.SetVar ("Action", 0) GemRB.LoadWindowPack ("GUISTORE", 640, 480) StoreWindow = Window = GemRB.LoadWindow (3) @@ -166,6 +177,7 @@ GemRB.SetVisible (Window, 1) store_update_funcs[store_buttons[0]] () GemRB.SetVisible (PortraitWindow, 1) + #GemRB.SetVar ("Inventory", 0) def OpenStoreShoppingWindow (): @@ -195,12 +207,19 @@ # Buy LeftButton = Button = GemRB.GetControl (Window, 2) - GemRB.SetText (Window, Button, 13703) + if Inventory: + GemRB.SetText (Window, Button, 51882) + else: + GemRB.SetText (Window, Button, 13703) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "BuyPressed") # Sell RightButton = Button = GemRB.GetControl (Window, 3) - GemRB.SetText (Window, Button, 13704) + if Inventory: + GemRB.SetText (Window, Button, 51883) + else: + GemRB.SetText (Window, Button, 13704) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SellPressed") # inactive button Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-03-03 13:22:00 UTC (rev 4521) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-03-03 13:28:19 UTC (rev 4522) @@ -490,6 +490,9 @@ GemRB.SetTooltip (Window, Button, 10485) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SelectAllOnPress") + pc = GemRB.GameGetSelectedPCSingle () + Inventory = GemRB.GetVar ("Inventory") + for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) GemRB.SetVarAssoc (Window, Button, "PressedPortrait", i) @@ -504,6 +507,12 @@ GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_ENTER_BUTTON, "PortraitButtonOnMouseEnter") GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_LEAVE_BUTTON, "PortraitButtonOnMouseLeave") + if Inventory and pc !=i+1: + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) + GemRB.SetText (Window, Button, "") + GemRB.SetTooltip (Window, Button, "") + GemRB.SetButtonBorder (Window, Button, FRAME_PC_SELECTED, 1, 1, 2, 2, 0, 255, 0, 255) GemRB.SetButtonBorder (Window, Button, FRAME_PC_TARGET, 3, 3, 4, 4, 255, 255, 0, 255) #GemRB.SetButtonFont (Window, Button, "NORMAL") @@ -515,9 +524,15 @@ def UpdatePortraitWindow (): Window = PortraitWindow + pc = GemRB.GameGetSelectedPCSingle () + Inventory = GemRB.GetVar ("Inventory") + for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) pic = GemRB.GetPlayerPortrait (i+1, 1) + if Inventory and pc!=i+1: + pic = None + if not pic: GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIINV.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIINV.py 2007-03-03 13:22:00 UTC (rev 4521) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIINV.py 2007-03-03 13:28:19 UTC (rev 4522) @@ -26,6 +26,7 @@ import string import GemRB import GUICommonWindows +from GUISTORE import * from GUIDefines import * from ie_stats import * from ie_slots import * @@ -68,13 +69,15 @@ InventoryWindow = None GemRB.SetVar ("OtherWindow", -1) GemRB.SetVar ("MessageLabel", -1) - GemRB.SetVisible (0,1) - GemRB.UnhideGUI () GUICommonWindows.PortraitWindow = OldPortraitWindow OldPortraitWindow = None GUICommonWindows.OptionsWindow = OldOptionsWindow OldOptionsWindow = None - SetSelectionChangeHandler (None) + #don't go back to multi selection mode when going to the store screen + if not GemRB.GetVar("Inventory"): + GemRB.SetVisible (0,1) + GemRB.UnhideGUI () + SetSelectionChangeHandler (None) return GemRB.HideGUI () @@ -538,6 +541,19 @@ UpdateInventoryWindow () return +def OpenItemWindow (): + #close inventory + GemRB.SetVar ("Inventory", 1) + GemRB.UnloadWindow (ItemInfoWindow) + OpenInventoryWindow () + pc = GemRB.GameGetSelectedPCSingle () + slot = GemRB.GetVar ("ItemButton") + slot_item = GemRB.GetSlotItem (pc, slot) + ResRef = slot_item['ItemResRef'] + #the store will have to reopen the inventory + GemRB.EnterStore (ResRef) + return + def DialogItemWindow (): GemRB.UnloadWindow (ItemInfoWindow) OpenInventoryWindow () @@ -547,7 +563,7 @@ ResRef = slot_item['ItemResRef'] item = GemRB.GetItem (ResRef) dialog=item["Dialog"] - GemRB.ExecuteString("StartDialog(\""+dialog+"\",Myself)", pc) + GemRB.ExecuteString ("StartDialog(\""+dialog+"\",Myself)", pc) return def IdentifyUseSpell (): @@ -606,7 +622,7 @@ def CloseItemInfoWindow (): GemRB.UnloadWindow (ItemInfoWindow) - UpdateInventoryWindow () + UpdateInventoryWindow() return def DisplayItem (itemresref, type): Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIJRNL.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIJRNL.py 2007-03-03 13:22:00 UTC (rev 4521) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIJRNL.py 2007-03-03 13:28:19 UTC (rev 4522) @@ -61,6 +61,7 @@ OldPortraitWindow = None GUICommonWindows.OptionsWindow = OldOptionsWindow OldOptionsWindow = None + SetSelectionChangeHandler (None) return Table = GemRB.LoadTable("YEARS") @@ -126,9 +127,10 @@ #GemRB.SetEvent (JournalWindow, Button, IE_GUI_BUTTON_ON_PRESS, "OpenJournalWindow") Chapter = GemRB.GetGameVar("chapter") + SetSelectionChangeHandler (UpdateLogWindow) UpdateLogWindow () GemRB.SetVisible (OptionsWindow, 1) - GemRB.SetVisible (Window, 1) + GemRB.SetVisible (Window, 3) GemRB.SetVisible (PortraitWindow, 1) return @@ -174,6 +176,7 @@ GemRB.TextAreaAppend (Window, Text, je['Text'], 3*i+1) GemRB.TextAreaAppend (Window, Text, "", 3*i + 2) + GemRB.SetVisible (Window, 1) return ################################################### Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUISTORE.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUISTORE.py 2007-03-03 13:22:00 UTC (rev 4521) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUISTORE.py 2007-03-03 13:28:19 UTC (rev 4522) @@ -51,6 +51,7 @@ ITEM_PC = 0 ITEM_STORE = 1 +Inventory = None RentIndex = -1 Store = None Buttons = [-1,-1,-1,-1] @@ -95,23 +96,28 @@ global StoreWindow, ActionWindow, PortraitWindow global OldPortraitWindow + GemRB.SetVar ("Inventory", 0) CloseWindows () GemRB.UnloadWindow (StoreWindow) GemRB.UnloadWindow (ActionWindow) GemRB.UnloadWindow (PortraitWindow) StoreWindow = None GemRB.LeaveStore () - GemRB.SetVisible (0,1) #enabling the game control screen - GemRB.UnhideGUI () #enabling the other windows GUICommonWindows.PortraitWindow = OldPortraitWindow - SetSelectionChangeHandler( None ) + if Inventory: + GemRB.RunEventHandler("OpenInventoryWindow") + else: + GemRB.SetVisible (0,1) #enabling the game control screen + GemRB.UnhideGUI () #enabling the other windows + SetSelectionChangeHandler( None ) + return - def OpenStoreWindow (): global Store global StoreWindow, ActionWindow, PortraitWindow global OldPortraitWindow global store_update_funcs + global Inventory #these are function pointers, not strings #can't put this in global init, doh! @@ -123,6 +129,11 @@ GemRB.HideGUI () GemRB.SetVisible (0,0) #removing the game control screen + if GemRB.GetVar ("Inventory"): + Inventory = 1 + else: + Inventory = None + GemRB.SetVar ("Action", 0) GemRB.LoadWindowPack ("GUISTORE", 640, 480) StoreWindow = Window = GemRB.LoadWindow (3) @@ -166,6 +177,7 @@ GemRB.SetVisible (Window, 1) store_update_funcs[store_buttons[0]] () GemRB.SetVisible (PortraitWindow, 1) + #GemRB.SetVar ("Inventory", 0) def OpenStoreShoppingWindow (): @@ -195,12 +207,19 @@ # Buy LeftButton = Button = GemRB.GetControl (Window, 2) - GemRB.SetText (Window, Button, 13703) + if Inventory: + GemRB.SetText (Window, Button, 51882) + else: + GemRB.SetText (Window, Button, 13703) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "BuyPressed") # Sell RightButton = Button = GemRB.GetControl (Window, 3) - GemRB.SetText (Window, Button, 13704) + if Inventory: + GemRB.SetText (Window, Button, 51883) + else: + GemRB.SetText (Window, Button, 13704) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SellPressed") # inactive button This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-03-03 19:09:18
|
Revision: 4528 http://gemrb.svn.sourceforge.net/gemrb/?rev=4528&view=rev Author: avenger_teambg Date: 2007-03-03 11:09:19 -0800 (Sat, 03 Mar 2007) Log Message: ----------- fixed usage of quick items Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-03-03 18:53:47 UTC (rev 4527) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-03-03 19:09:19 UTC (rev 4528) @@ -27,6 +27,7 @@ from GUIDefines import * from ie_stats import * from ie_modal import * +from ie_action import * FRAME_PC_SELECTED = 0 FRAME_PC_TARGET = 1 @@ -375,23 +376,23 @@ return def ActionQItem1Pressed (): - ActionQItemPressed (0) + ActionQItemPressed (ACT_QSLOT1) return def ActionQItem2Pressed (): - ActionQItemPressed (1) + ActionQItemPressed (ACT_QSLOT2) return def ActionQItem3Pressed (): - ActionQItemPressed (2) + ActionQItemPressed (ACT_QSLOT3) return def ActionQItem4Pressed (): - ActionQItemPressed (3) + ActionQItemPressed (ACT_QSLOT4) return def ActionQItem5Pressed (): - ActionQItemPressed (4) + ActionQItemPressed (ACT_QSLOT5) return def ActionInnatePressed (): Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-03-03 18:53:47 UTC (rev 4527) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-03-03 19:09:19 UTC (rev 4528) @@ -27,6 +27,7 @@ from GUIDefines import * from ie_stats import * from ie_modal import * +from ie_action import * FRAME_PC_SELECTED = 0 FRAME_PC_TARGET = 1 @@ -375,23 +376,23 @@ return def ActionQItem1Pressed (): - ActionQItemPressed (0) + ActionQItemPressed (ACT_QSLOT1) return def ActionQItem2Pressed (): - ActionQItemPressed (1) + ActionQItemPressed (ACT_QSLOT2) return def ActionQItem3Pressed (): - ActionQItemPressed (2) + ActionQItemPressed (ACT_QSLOT3) return def ActionQItem4Pressed (): - ActionQItemPressed (3) + ActionQItemPressed (ACT_QSLOT4) return def ActionQItem5Pressed (): - ActionQItemPressed (4) + ActionQItemPressed (ACT_QSLOT5) return def ActionInnatePressed (): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-03-11 15:47:28
|
Revision: 4544 http://gemrb.svn.sourceforge.net/gemrb/?rev=4544&view=rev Author: avenger_teambg Date: 2007-03-11 08:47:27 -0700 (Sun, 11 Mar 2007) Log Message: ----------- guiscript updates Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/GUIDefines.py gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/bg1/MessageWindow.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd2/GUIOPT.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/GUIDefines.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/GUIDefines.py 2007-03-11 14:44:54 UTC (rev 4543) +++ gemrb/trunk/gemrb/GUIScripts/GUIDefines.py 2007-03-11 15:47:27 UTC (rev 4544) @@ -159,6 +159,7 @@ TARGET_MODE_TALK = 0x01 TARGET_MODE_ATTACK = 0x02 TARGET_MODE_CAST = 0x04 +TARGET_MODE_DEFEND = 0x08 TARGET_MODE_ALLY = 0x10 TARGET_MODE_ENEMY = 0x20 Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-03-11 14:44:54 UTC (rev 4543) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-03-11 15:47:27 UTC (rev 4544) @@ -27,6 +27,7 @@ from GUIDefines import * from ie_stats import * from ie_modal import * +from ie_action import * FRAME_PC_SELECTED = 0 FRAME_PC_TARGET = 1 @@ -104,7 +105,7 @@ def AIPress (): Button = GemRB.GetControl (PortraitWindow, 6) - AI = GemRB.GetMessageWindowSize() & GS_PARTYAI + AI = GemRB.GetMessageWindowSize () & GS_PARTYAI if AI: GemRB.GameSetScreenFlags(GS_PARTYAI, OP_NAND) @@ -138,7 +139,7 @@ global ActionsWindow Window = ActionsWindow - for i in range (12): + 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) @@ -254,6 +255,9 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) +def ActionDefendpressed (): + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) + def ActionQWeaponPressed (which): pc = GemRB.GameGetFirstSelectedPC () @@ -293,7 +297,7 @@ else: TopIndex = 0 GemRB.SetVar ("TopIndex", TopIndex) - UpdateActionsWindow () + UpdateActionsWindow () return #no check needed because the button wouldn't be drawn if illegal @@ -312,7 +316,7 @@ else: TopIndex = 0 - GemRB.SetVar ("TopIndex", TopIndex) + GemRB.SetVar ("TopIndex", TopIndex) UpdateActionsWindow () return @@ -354,27 +358,28 @@ def ActionQItemPressed (action): pc = GemRB.GameGetFirstSelectedPC () - GemRB.UseItem(pc, action) + #quick slot + GemRB.UseItem(pc, -2, action) return def ActionQItem1Pressed (): - ActionQItemPressed (9) + ActionQItemPressed (ACT_QSLOT1) return def ActionQItem2Pressed (): - ActionQItemPressed (11) + ActionQItemPressed (ACT_QSLOT2) return def ActionQItem3Pressed (): - ActionQItemPressed (12) + ActionQItemPressed (ACT_QSLOT3) return def ActionQItem4Pressed (): - ActionQItemPressed (10) + ActionQItemPressed (ACT_QSLOT4) return def ActionQItem5Pressed (): - ActionQItemPressed (31) + ActionQItemPressed (ACT_QSLOT5) return def ActionInnatePressed (): @@ -397,7 +402,7 @@ Item = GemRB.GetVar("Equipment") GemRB.UseItem(pc, -1, Item) return - + def GetActorClassTitle (actor): ClassTitle = GemRB.GetPlayerStat (actor, IE_TITLE1) KitIndex = GemRB.GetPlayerStat (actor, IE_KIT) & 0xfff @@ -450,12 +455,12 @@ def OpenPortraitWindow (needcontrols): global PortraitWindow - PortraitWindow = Window = GemRB.LoadWindow(1) + PortraitWindow = Window = GemRB.LoadWindow (1) # AI if needcontrols: Button = GemRB.GetControl (Window, 6) - GSFlags = GemRB.GetMessageWindowSize()&GS_PARTYAI + GSFlags = GemRB.GetMessageWindowSize ()&GS_PARTYAI GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX,OP_OR) #this control is crippled GemRB.SetButtonSprites (Window, Button, "GUIBTACT", 0, 46, 47, 48, 49) @@ -470,6 +475,8 @@ Button = GemRB.GetControl (Window, 7) GemRB.SetTooltip (Window, Button, 10485) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SelectAllOnPress") + pc = GemRB.GameGetSelectedPCSingle () + Inventory = GemRB.GetVar ("Inventory") for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) @@ -484,6 +491,11 @@ GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_DRAG_DROP, "OnDropItemToPC") GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_ENTER_BUTTON, "PortraitButtonOnMouseEnter") GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_LEAVE_BUTTON, "PortraitButtonOnMouseLeave") + if Inventory and pc !=i+1: + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) + GemRB.SetText (Window, Button, "") + GemRB.SetTooltip (Window, Button, "") GemRB.SetButtonBorder (Window, Button, FRAME_PC_SELECTED, 1, 1, 2, 2, 0, 255, 0, 255) GemRB.SetButtonBorder (Window, Button, FRAME_PC_TARGET, 3, 3, 4, 4, 255, 255, 0, 255) @@ -512,8 +524,8 @@ hp_max = GemRB.GetPlayerStat (i+1, IE_MAXHITPOINTS) GemRB.SetTooltip (Window, Button, GemRB.GetPlayerName (i+1, 1) + "\n%d/%d" %(hp, hp_max)) - + def PortraitButtonOnPress (): i = GemRB.GetVar ("PressedPortrait") Modified: gemrb/trunk/gemrb/GUIScripts/bg1/MessageWindow.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/MessageWindow.py 2007-03-11 14:44:54 UTC (rev 4543) +++ gemrb/trunk/gemrb/GUIScripts/bg1/MessageWindow.py 2007-03-11 15:47:27 UTC (rev 4544) @@ -156,7 +156,7 @@ GemRB.SetVar("MessageWindow", TMessageWindow) GemRB.SetVar("MessageTextArea", TMessageTA) if Override: - GemRB.SetControlStatus (MessageWindow,MessageTA,IE_GUI_CONTROL_FOCUSED) + GemRB.SetControlStatus (TMessageWindow,TMessageTA,IE_GUI_CONTROL_FOCUSED) else: GemRB.SetControlStatus (0,0,IE_GUI_CONTROL_FOCUSED) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-03-11 14:44:54 UTC (rev 4543) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-03-11 15:47:27 UTC (rev 4544) @@ -114,7 +114,7 @@ def AIPress (): Button = GemRB.GetControl (PortraitWindow, 6) - AI = GemRB.GetMessageWindowSize() & GS_PARTYAI + AI = GemRB.GetMessageWindowSize () & GS_PARTYAI if AI: GemRB.GameSetScreenFlags(GS_PARTYAI, OP_NAND) @@ -140,7 +140,7 @@ return def SelectFormationPreset (): - GemRB.GameSetFormation ( GemRB.GetVar ("Value"), GemRB.GetVar ("Formation") ) + GemRB.GameSetFormation (GemRB.GetVar ("Value"), GemRB.GetVar ("Formation") ) GroupControls () return @@ -271,14 +271,17 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) +def ActionDefendpressed (): + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) + def ActionQWeaponPressed (which): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () - if GemRB.GetEquippedQuickSlot(pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): + if GemRB.GetEquippedQuickSlot (pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) else: GemRB.GameControlSetTargetMode (TARGET_MODE_ALL) - GemRB.SetEquippedQuickSlot(pc, which) + GemRB.SetEquippedQuickSlot (pc, which) GemRB.SetupControls (ActionsWindow, pc) UpdateActionsWindow () @@ -315,7 +318,7 @@ #no check needed because the button wouldn't be drawn if illegal def ActionRightPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () TopIndex = GemRB.GetVar ("TopIndex") Type = GemRB.GetVar ("Type") if Type == 3: @@ -334,25 +337,25 @@ return def ActionSongPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_BATTLESONG) UpdateActionsWindow () return def ActionSearchPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_DETECTTRAPS) UpdateActionsWindow () return def ActionStealthPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_STEALTH) UpdateActionsWindow () return def ActionTurnPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_TURNUNDEAD) UpdateActionsWindow () return @@ -370,7 +373,7 @@ return def ActionQItemPressed (action): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () #quick slot GemRB.UseItem(pc, -2, action) return @@ -402,7 +405,7 @@ return def SpellPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) Spell = GemRB.GetVar("Spell") @@ -411,7 +414,7 @@ return def EquipmentPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) Item = GemRB.GetVar("Equipment") @@ -480,7 +483,7 @@ # AI Button = GemRB.GetControl (Window, 6) - GSFlags = GemRB.GetMessageWindowSize()&GS_PARTYAI + GSFlags = GemRB.GetMessageWindowSize ()&GS_PARTYAI GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "AIPress") GemRB.SetVarAssoc (Window, Button, "", GSFlags) if GSFlags: Modified: gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-03-11 14:44:54 UTC (rev 4543) +++ gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-03-11 15:47:27 UTC (rev 4544) @@ -227,6 +227,8 @@ for i in range (12): Button = GemRB.GetControl (ActionsWindow, i) GemRB.SetButtonBorder (ActionsWindow, Button, 1, 0, 0, 0, 0, 50,30,10,120, 0, 1) + GemRB.SetButtonFont (ActionsWindow, Button, "NUMBER") + GemRB.SetText (ActionsWindow, Button, "") if pc == 0: EmptyControls () @@ -259,6 +261,9 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) +def ActionDefendpressed (): + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) + def ActionQWeaponPressed (which): pc = GemRB.GameGetFirstSelectedPC() Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-03-11 14:44:54 UTC (rev 4543) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-03-11 15:47:27 UTC (rev 4544) @@ -225,7 +225,10 @@ for i in range (12): Button = GemRB.GetControl (ActionsWindow, i) GemRB.SetButtonBorder (ActionsWindow, Button, 1, 0, 0, 0, 0, 50,30,10,120, 0, 1) + GemRB.SetButtonFont (ActionsWindow, Button, "NUMBER") + GemRB.SetText (ActionsWindow, Button, "") + if pc == 0: EmptyControls () return @@ -257,6 +260,9 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) +def ActionDefendpressed (): + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) + def ActionQWeaponPressed (which): pc = GemRB.GameGetFirstSelectedPC() Modified: gemrb/trunk/gemrb/GUIScripts/iwd2/GUIOPT.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd2/GUIOPT.py 2007-03-11 14:44:54 UTC (rev 4543) +++ gemrb/trunk/gemrb/GUIScripts/iwd2/GUIOPT.py 2007-03-11 15:47:27 UTC (rev 4544) @@ -111,10 +111,10 @@ def SaveGamePress(): OpenOptionsWindow () - GemRB.SetVar("QuitAfterSave",0) - OpenSaveWindow () - #save the game without quitting - return + GemRB.SetVar("QuitAfterSave",0) + OpenSaveWindow () + #save the game without quitting + return def QuitGamePress(): OpenOptionsWindow () Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-03-11 14:44:54 UTC (rev 4543) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-03-11 15:47:27 UTC (rev 4544) @@ -114,7 +114,7 @@ def AIPress (): Button = GemRB.GetControl (PortraitWindow, 6) - AI = GemRB.GetMessageWindowSize() & GS_PARTYAI + AI = GemRB.GetMessageWindowSize () & GS_PARTYAI if AI: GemRB.GameSetScreenFlags(GS_PARTYAI, OP_NAND) @@ -140,7 +140,7 @@ return def SelectFormationPreset (): - GemRB.GameSetFormation ( GemRB.GetVar ("Value"), GemRB.GetVar ("Formation") ) + GemRB.GameSetFormation (GemRB.GetVar ("Value"), GemRB.GetVar ("Formation") ) GroupControls () return @@ -271,14 +271,17 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) +def ActionDefendpressed (): + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) + def ActionQWeaponPressed (which): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () - if GemRB.GetEquippedQuickSlot(pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): + if GemRB.GetEquippedQuickSlot (pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) else: GemRB.GameControlSetTargetMode (TARGET_MODE_ALL) - GemRB.SetEquippedQuickSlot(pc, which) + GemRB.SetEquippedQuickSlot (pc, which) GemRB.SetupControls (ActionsWindow, pc) UpdateActionsWindow () @@ -315,7 +318,7 @@ #no check needed because the button wouldn't be drawn if illegal def ActionRightPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () TopIndex = GemRB.GetVar ("TopIndex") Type = GemRB.GetVar ("Type") if Type == 3: @@ -334,25 +337,25 @@ return def ActionSongPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_BATTLESONG) UpdateActionsWindow () return def ActionSearchPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_DETECTTRAPS) UpdateActionsWindow () return def ActionStealthPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_STEALTH) UpdateActionsWindow () return def ActionTurnPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_TURNUNDEAD) UpdateActionsWindow () return @@ -370,7 +373,7 @@ return def ActionQItemPressed (action): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () #quick slot GemRB.UseItem(pc, -2, action) return @@ -402,7 +405,7 @@ return def SpellPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) Spell = GemRB.GetVar("Spell") @@ -411,7 +414,7 @@ return def EquipmentPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) Item = GemRB.GetVar("Equipment") @@ -480,7 +483,7 @@ # AI Button = GemRB.GetControl (Window, 6) - GSFlags = GemRB.GetMessageWindowSize()&GS_PARTYAI + GSFlags = GemRB.GetMessageWindowSize ()&GS_PARTYAI GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "AIPress") GemRB.SetVarAssoc (Window, Button, "", GSFlags) if GSFlags: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-03-11 23:20:22
|
Revision: 4546 http://gemrb.svn.sourceforge.net/gemrb/?rev=4546&view=rev Author: avenger_teambg Date: 2007-03-11 16:20:14 -0700 (Sun, 11 Mar 2007) Log Message: ----------- fixed typo in ActionDefendPressed Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-03-11 23:18:38 UTC (rev 4545) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-03-11 23:20:14 UTC (rev 4546) @@ -255,7 +255,7 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) -def ActionDefendpressed (): +def ActionDefendPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) def ActionQWeaponPressed (which): Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-03-11 23:18:38 UTC (rev 4545) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-03-11 23:20:14 UTC (rev 4546) @@ -271,7 +271,7 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) -def ActionDefendpressed (): +def ActionDefendPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) def ActionQWeaponPressed (which): Modified: gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-03-11 23:18:38 UTC (rev 4545) +++ gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-03-11 23:20:14 UTC (rev 4546) @@ -261,7 +261,7 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) -def ActionDefendpressed (): +def ActionDefendPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) def ActionQWeaponPressed (which): @@ -520,7 +520,7 @@ GemRB.SetText (Window, Button, "") GemRB.SetTooltip (Window, Button, "") continue - + 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) Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-03-11 23:18:38 UTC (rev 4545) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-03-11 23:20:14 UTC (rev 4546) @@ -260,7 +260,7 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) -def ActionDefendpressed (): +def ActionDefendPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) def ActionQWeaponPressed (which): Modified: gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py 2007-03-11 23:18:38 UTC (rev 4545) +++ gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py 2007-03-11 23:20:14 UTC (rev 4546) @@ -214,6 +214,9 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) +def ActionDefendPressed (): + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) + def ActionStopPressed (): for i in range (PARTY_SIZE): if GemRB.GameIsPCSelected(i + 1): @@ -237,19 +240,15 @@ Kit = GemRB.GetPlayerStat (actor, IE_KIT) Class = GemRB.GetPlayerStat (actor, IE_CLASS) ClassTable = GemRB.LoadTable ("classes") - print "Kit:",Kit if Kit==0x4000 or Kit==0: #pure class ClassIndex = Class else: #bad, because kit clashes with classid ClassIndex = GemRB.FindTableValue (ClassTable, 2, Kit) - print "ClassIndex",ClassIndex if ClassTitle==0: ClassTitle=GemRB.GetTableValue (ClassTable, ClassIndex, 0) - print "ClassTitle",ClassTitle GemRB.UnloadTable (ClassTable) - print "ClassTitle", ClassTitle return ClassTitle def GetActorPaperDoll (actor): @@ -293,6 +292,9 @@ Button = GemRB.GetControl (Window, i) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "PortraitButtonOnPress") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_SHIFT_PRESS, "PortraitButtonOnShiftPress") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_DRAG_DROP, "OnDropItemToPC") + GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_ENTER_BUTTON, "PortraitButtonOnMouseEnter") + GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_LEAVE_BUTTON, "PortraitButtonOnMouseLeave") GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_ALIGN_TOP|IE_GUI_BUTTON_ALIGN_LEFT|IE_GUI_BUTTON_PICTURE, OP_SET) @@ -305,7 +307,7 @@ UpdatePortraitWindow () SelectionChanged () return Window - + def UpdatePortraitWindow (): Window = PortraitWindow @@ -369,6 +371,17 @@ Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, i + 1 == sel) +def PortraitButtonOnMouseEnter (): + i = GemRB.GetVar ("PressedPortrait") + if GemRB.IsDraggingItem (): + Button = GemRB.GetControl (PortraitWindow, i) + GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 1) + +def PortraitButtonOnMouseLeave (): + i = GemRB.GetVar ("PressedPortrait") + Button = GemRB.GetControl (PortraitWindow, i) + GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 0) + def GetSavingThrow (SaveName, row, level): SaveTable = GemRB.LoadTable (SaveName) tmp = GemRB.GetTableValue (SaveTable, level) @@ -395,10 +408,8 @@ Class = GemRB.FindTableValue (ClassTable, 5, 4) SaveName2 = GemRB.GetTableValue (ClassTable, Class, 3) Class = 0 #fighter - print "SaveName2", SaveName2 SaveName1 = GemRB.GetTableValue (ClassTable, Class, 3) - print "SaveName1", SaveName1 for row in range(5): tmp1 = GetSavingThrow (SaveName1, row, level1) @@ -407,19 +418,18 @@ if tmp2<tmp1: tmp1=tmp2 GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) - print "Savingthrow:", tmp1 return def SetEncumbranceLabels (Window, Label, Label2, pc): # encumbrance # Loading tables of modifications - Table = GemRB.LoadTable("strmod") - TableEx = GemRB.LoadTable("strmodex") + 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) + max_encumb = GemRB.GetTableValue (Table, sstr, 3) + GemRB.GetTableValue (TableEx, ext_str, 3) encumbrance = GemRB.GetPlayerStat (pc, IE_ENCUMBRANCE) Label = GemRB.GetControl (Window, 0x10000043) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-03-11 23:18:38 UTC (rev 4545) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-03-11 23:20:14 UTC (rev 4546) @@ -271,7 +271,7 @@ def ActionAttackPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) -def ActionDefendpressed (): +def ActionDefendPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) def ActionQWeaponPressed (which): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-04-22 17:33:14
|
Revision: 4609 http://gemrb.svn.sourceforge.net/gemrb/?rev=4609&view=rev Author: avenger_teambg Date: 2007-04-22 10:33:15 -0700 (Sun, 22 Apr 2007) Log Message: ----------- updated guiscripts according to the recent changes Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-04-22 17:30:06 UTC (rev 4608) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-04-22 17:33:15 UTC (rev 4609) @@ -305,10 +305,7 @@ pc = GemRB.GameGetFirstSelectedPC () TopIndex = GemRB.GetVar ("TopIndex") Type = GemRB.GetVar ("Type") - if Type == 3: - Max = GemRB.GetMemorizedSpellsCount(pc,0)+GemRB.GetMemorizedSpellsCount(pc,1) - else: - Max = GemRB.GetMemorizedSpellsCount(pc,2) + Max = GemRB.GetMemorizedSpellsCount(pc, Type) TopIndex += 10 if TopIndex > Max - 10: if Max>10: @@ -394,6 +391,8 @@ Spell = GemRB.GetVar("Spell") Type = GemRB.GetVar("Type") GemRB.SpellCast(pc, Type, Spell) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def EquipmentPressed (): @@ -401,6 +400,8 @@ Item = GemRB.GetVar("Equipment") GemRB.UseItem(pc, -1, Item) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def GetActorClassTitle (actor): Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-04-22 17:30:06 UTC (rev 4608) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-04-22 17:33:15 UTC (rev 4609) @@ -321,10 +321,7 @@ pc = GemRB.GameGetFirstSelectedPC () TopIndex = GemRB.GetVar ("TopIndex") Type = GemRB.GetVar ("Type") - if Type == 3: - Max = GemRB.GetMemorizedSpellsCount(pc,0)+GemRB.GetMemorizedSpellsCount(pc,1) - else: - Max = GemRB.GetMemorizedSpellsCount(pc,2) + Max = GemRB.GetMemorizedSpellsCount(pc, Type) TopIndex += 10 if TopIndex > Max - 10: if Max>10: @@ -411,6 +408,8 @@ Spell = GemRB.GetVar("Spell") Type = GemRB.GetVar("Type") GemRB.SpellCast(pc, Type, Spell) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def EquipmentPressed (): @@ -420,6 +419,8 @@ Item = GemRB.GetVar("Equipment") #equipment index GemRB.UseItem(pc, -1, Item) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def GetActorClassTitle (actor): Modified: gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-04-22 17:30:06 UTC (rev 4608) +++ gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-04-22 17:33:15 UTC (rev 4609) @@ -311,10 +311,7 @@ pc = GemRB.GameGetFirstSelectedPC() TopIndex = GemRB.GetVar ("TopIndex") Type = GemRB.GetVar ("Type") - if Type == 3: - Max = GemRB.GetMemorizedSpellsCount(pc,0)+GemRB.GetMemorizedSpellsCount(pc,1) - else: - Max = GemRB.GetMemorizedSpellsCount(pc,2) + Max = GemRB.GetMemorizedSpellsCount(pc, Type) TopIndex += 10 if TopIndex > Max - 10: if Max>10: @@ -401,6 +398,8 @@ Spell = GemRB.GetVar("Spell") Type = GemRB.GetVar("Type") GemRB.SpellCast(pc, Type, Spell) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def EquipmentPressed (): @@ -410,6 +409,8 @@ Item = GemRB.GetVar("Equipment") #equipment index GemRB.UseItem(pc, -1, Item) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def GetActorClassTitle (actor): Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-04-22 17:30:06 UTC (rev 4608) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-04-22 17:33:15 UTC (rev 4609) @@ -310,10 +310,7 @@ pc = GemRB.GameGetFirstSelectedPC() TopIndex = GemRB.GetVar ("TopIndex") Type = GemRB.GetVar ("Type") - if Type == 3: - Max = GemRB.GetMemorizedSpellsCount(pc,0)+GemRB.GetMemorizedSpellsCount(pc,1) - else: - Max = GemRB.GetMemorizedSpellsCount(pc,2) + Max = GemRB.GetMemorizedSpellsCount(pc, Type) TopIndex += 10 if TopIndex > Max - 10: if Max>10: @@ -400,6 +397,8 @@ Spell = GemRB.GetVar("Spell") Type = GemRB.GetVar("Type") GemRB.SpellCast(pc, Type, Spell) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def EquipmentPressed (): @@ -409,6 +408,8 @@ Item = GemRB.GetVar("Equipment") #equipment index GemRB.UseItem(pc, -1, Item) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def GetActorClassTitle (actor): Modified: gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py 2007-04-22 17:30:06 UTC (rev 4608) +++ gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py 2007-04-22 17:33:15 UTC (rev 4609) @@ -223,6 +223,33 @@ GemRB.ClearAction(i + 1) return +#no check needed because the button wouldn't be drawn if illegal +def ActionLeftPressed (): + TopIndex = GemRB.GetVar ("TopIndex") + if TopIndex>10: + TopIndex -= 10 + else: + TopIndex = 0 + GemRB.SetVar ("TopIndex", TopIndex) + UpdateActionsWindow () + return + +def ActionRightPressed (): + pc = GemRB.GameGetFirstSelectedPC() + TopIndex = GemRB.GetVar ("TopIndex") + Type = GemRB.GetVar ("Type") + Max = GemRB.GetMemorizedSpellsCount(pc, Type) + TopIndex += 10 + if TopIndex > Max - 10: + if Max>10: + TopIndex = Max-10 + else: + TopIndex = 0 + + GemRB.SetVar ("TopIndex", TopIndex) + UpdateActionsWindow () + return + def GetActorRaceTitle (actor): Table = GemRB.LoadTable ("races") RaceID = GemRB.GetPlayerStat (actor, IE_SUBRACE) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-04-22 17:30:06 UTC (rev 4608) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-04-22 17:33:15 UTC (rev 4609) @@ -321,10 +321,7 @@ pc = GemRB.GameGetFirstSelectedPC () TopIndex = GemRB.GetVar ("TopIndex") Type = GemRB.GetVar ("Type") - if Type == 3: - Max = GemRB.GetMemorizedSpellsCount(pc,0)+GemRB.GetMemorizedSpellsCount(pc,1) - else: - Max = GemRB.GetMemorizedSpellsCount(pc,2) + Max = GemRB.GetMemorizedSpellsCount(pc, Type) TopIndex += 10 if TopIndex > Max - 10: if Max>10: @@ -411,6 +408,8 @@ Spell = GemRB.GetVar("Spell") Type = GemRB.GetVar("Type") GemRB.SpellCast(pc, Type, Spell) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def EquipmentPressed (): @@ -420,6 +419,8 @@ Item = GemRB.GetVar("Equipment") #equipment index GemRB.UseItem(pc, -1, Item) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () return def GetActorClassTitle (actor): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-04-30 21:43:18
|
Revision: 4627 http://gemrb.svn.sourceforge.net/gemrb/?rev=4627&view=rev Author: avenger_teambg Date: 2007-04-30 14:43:16 -0700 (Mon, 30 Apr 2007) Log Message: ----------- updated mage/priest spellbook gui Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/GUIMG.py gemrb/trunk/gemrb/GUIScripts/bg2/GUIPR.py gemrb/trunk/gemrb/GUIScripts/tob/GUIMG.py gemrb/trunk/gemrb/GUIScripts/tob/GUIPR.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIMG.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIMG.py 2007-04-30 19:24:59 UTC (rev 4626) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIMG.py 2007-04-30 21:43:16 UTC (rev 4627) @@ -81,7 +81,7 @@ #unknown usage Button = GemRB.GetControl (Window, 55) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) #setup level buttons for i in range (9): @@ -93,19 +93,18 @@ Button = GemRB.GetControl (Window, 56 + i) GemRB.SetVarAssoc (Window, Button, "MageSpellLevel", i) - # Setup memorized spells buttons for i in range (12): Button = GemRB.GetControl (Window, 3 + i) - GemRB.SetButtonBorder (Window, Button, 0,0,0,0,0,0,0,0,160,0,1) + GemRB.SetButtonBorder (Window, Button, 0,0,0,0,0,0,0,0,64,0,1) GemRB.SetButtonSprites (Window, Button, "SPELFRAM",0,0,0,0,0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) # Setup book spells buttons for i in range (24): Button = GemRB.GetControl (Window, 27 + i) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) SetSelectionChangeHandler (UpdateMageWindow) @@ -135,12 +134,13 @@ Name = GemRB.GetPlayerName (pc, 0) Label = GemRB.GetControl (Window, 0x10000035) GemRB.SetText (Window, Label, Name) + mem_cnt = GemRB.GetMemorizedSpellsCount (pc, type, level) for i in range (12): Button = GemRB.GetControl (Window, 3 + i) if i < mem_cnt: ms = GemRB.GetMemorizedSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ms['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ms['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) if ms['Flags']: @@ -155,13 +155,14 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"") + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS,"") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) @@ -172,20 +173,17 @@ Button = GemRB.GetControl (Window, 27 + i) if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ks['SpellResRef']) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"OnMageMemorizeSpell") + GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS,"OnMageMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenMageSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) GemRB.SetTooltip (Window, Button, spell['SpellName']) MageKnownSpellList.append (ks['SpellResRef']) - GemRB.SetVarAssoc (Window, Button, "SpellButton", 100 + -i) + GemRB.SetVarAssoc (Window, Button, "SpellButton", 100 + i) else: GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) @@ -221,5 +219,148 @@ UpdateMageWindow () return +def OnMageMemorizeSpell (): + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") - 100 + + if GemRB.MemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def OpenMageSpellInfoWindow (): + global MageSpellInfoWindow + + if MageSpellInfoWindow != None: + GemRB.UnloadWindow (MageSpellInfoWindow) + MageSpellInfoWindow = None + return + + MageSpellInfoWindow = Window = GemRB.LoadWindow (3) + + #back + Button = GemRB.GetControl (Window, 5) + GemRB.SetText (Window, Button, 15416) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellInfoWindow") + + #erase + Button = GemRB.GetControl (Window, 6) + index = GemRB.GetVar ("SpellButton") + if index < 100: + ResRef = MageMemorizedSpellList[index] + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + else: + ResRef = MageKnownSpellList[index - 100] + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellRemoveWindow") + GemRB.SetText (Window, Button, 63668) + + spell = GemRB.GetSpell (ResRef) + + Label = GemRB.GetControl (Window, 0x0fffffff) + GemRB.SetText (Window, Label, spell['SpellName']) + + Button = GemRB.GetControl (Window, 2) + GemRB.SetSpellIcon (Window, Button, ResRef, 1) + + Text = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, Text, spell['SpellDesc']) + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OnMageMemorizeSpell (): + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") - 100 + + if GemRB.MemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def CloseMageSpellUnmemorizeWindow (): + global MageSpellUnmemorizeWindow + + GemRB.UnloadWindow (MageSpellUnmemorizeWindow) + MageSpellUnmemorizeWindow = None + return + +def OpenMageSpellRemoveWindow (): + global MageSpellUnmemorizeWindow + + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (101) + + # "Are you sure you want to ....?" + TextArea = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, TextArea, 63745) + + # Remove + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 17507) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageRemoveSpell") + + # Cancel + Button = GemRB.GetControl (Window, 1) + GemRB.SetText (Window, Button, 13727) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseMageSpellUnmemorizeWindow") + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OpenMageSpellUnmemorizeWindow (): + global MageSpellUnmemorizeWindow + + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (101) + + # "Are you sure you want to ....?" + TextArea = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, TextArea, 11824) + + # Remove + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 17507) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageUnmemorizeSpell") + + # Cancel + Button = GemRB.GetControl (Window, 1) + GemRB.SetText (Window, Button, 13727) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseMageSpellUnmemorizeWindow") + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OnMageUnmemorizeSpell (): + if MageSpellUnmemorizeWindow: + CloseMageSpellUnmemorizeWindow() + + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") + + if GemRB.UnmemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def OnMageRemoveSpell (): + CloseMageSpellUnmemorizeWindow() + OpenMageSpellInfoWindow() + + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton")-100 + + #remove spell from book + GemRB.RemoveSpell (pc, type, level, index) + UpdateMageWindow () + return + ################################################### # End of file GUIMG.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIPR.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIPR.py 2007-04-30 19:24:59 UTC (rev 4626) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIPR.py 2007-04-30 21:43:16 UTC (rev 4627) @@ -92,15 +92,16 @@ # Setup memorized spells buttons for i in range (12): Button = GemRB.GetControl (Window, 3 + i) - GemRB.SetButtonBorder (Window, Button, 0,0,0,0,0,0,0,0,160,0,1) - GemRB.SetButtonBAM (Window, Button, "SPELFRAM",0,0,0) + GemRB.SetButtonBorder (Window, Button, 0,0,0,0,0,0,0,0,64,0,1) + GemRB.SetButtonSprites (Window, Button, "SPELFRAM",0,0,0,0,0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) # Setup book spells buttons for i in range (24): Button = GemRB.GetControl (Window, 27 + i) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) SetSelectionChangeHandler (UpdatePriestWindow) UpdatePriestWindow () @@ -108,8 +109,8 @@ #bringing window front GemRB.SetVisible (Window, 3) GemRB.SetVisible (PortraitWindow, 1) + return - def UpdatePriestWindow (): global PriestMemorizedSpellList, PriestKnownSpellList @@ -135,7 +136,7 @@ Button = GemRB.GetControl (Window, 3 + i) if i < mem_cnt: ms = GemRB.GetMemorizedSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ms['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ms['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) if ms['Flags']: @@ -150,11 +151,13 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') @@ -166,8 +169,8 @@ Button = GemRB.GetControl (Window, 27 + i) if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ks['SpellResRef']) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) + GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnPriestMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenPriestSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) @@ -241,16 +244,11 @@ GemRB.SetText (Window, Label, spell['SpellName']) Button = GemRB.GetControl (Window, 2) - GemRB.SetSpellIcon (Window, Button, ResRef) + GemRB.SetSpellIcon (Window, Button, ResRef, 1) Text = GemRB.GetControl (Window, 3) GemRB.SetText (Window, Text, spell['SpellDesc']) - #IconResRef = 'SPL' + spell['SpellbookIcon'][2:] - - #Button = GemRB.GetControl (Window, 5) - #GemRB.SetButtonSprites (Window, Button, IconResRef, 0, 0, 0, 0, 0) - GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return @@ -269,17 +267,11 @@ def OpenPriestSpellRemoveWindow (): global PriestSpellUnmemorizeWindow - if PriestSpellUnmemorizeWindow != None: - GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) - PriestSpellUnmemorizeWindow = None - - return - PriestSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) # "Are you sure you want to ....?" TextArea = GemRB.GetControl (Window, 3) - GemRB.SetText (Window, TextArea, 63745) + GemRB.SetText (Window, TextArea, 11824) # Remove Button = GemRB.GetControl (Window, 0) @@ -294,15 +286,16 @@ GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return +def ClosePriestSpellUnmemorizeWindow (): + global PriestSpellUnmemorizeWindow + + GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) + PriestSpellUnmemorizeWindow = None + return + def OpenPriestSpellUnmemorizeWindow (): global PriestSpellUnmemorizeWindow - - if PriestSpellUnmemorizeWindow != None: - GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) - PriestSpellUnmemorizeWindow = None - - return - + PriestSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) # "Are you sure you want to ....?" @@ -317,14 +310,14 @@ # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestSpellUnmemorizeWindow") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ClosePriestSpellUnmemorizeWindow") GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return def OnPriestUnmemorizeSpell (): if PriestSpellUnmemorizeWindow: - OpenPriestSpellUnmemorizeWindow () + ClosePriestSpellUnmemorizeWindow () pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel @@ -338,19 +331,17 @@ def OnPriestRemoveSpell (): - if PriestSpellUnmemorizeWindow: - OpenPriestSpellRemoveWindow () + ClosePriestSpellUnmemorizeWindow() + OpenPriestSpellInfoWindow() pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel type = IE_SPELL_TYPE_PRIEST - index = GemRB.GetVar ("SpellButton") + index = GemRB.GetVar ("SpellButton")-100 #remove spell from memory - #GemRB.UnmemorizeSpell (pc, type, level, index) - #remove spell from book - #GemRB.RemoveSpell (pc, type, level, index) + GemRB.RemoveSpell (pc, type, level, index) UpdatePriestWindow () return Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIMG.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIMG.py 2007-04-30 19:24:59 UTC (rev 4626) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIMG.py 2007-04-30 21:43:16 UTC (rev 4627) @@ -81,7 +81,7 @@ #unknown usage Button = GemRB.GetControl (Window, 55) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) #setup level buttons for i in range (9): @@ -93,19 +93,18 @@ Button = GemRB.GetControl (Window, 56 + i) GemRB.SetVarAssoc (Window, Button, "MageSpellLevel", i) - # Setup memorized spells buttons for i in range (12): Button = GemRB.GetControl (Window, 3 + i) - GemRB.SetButtonBorder (Window, Button, 0,0,0,0,0,0,0,0,160,0,1) + GemRB.SetButtonBorder (Window, Button, 0,0,0,0,0,0,0,0,64,0,1) GemRB.SetButtonSprites (Window, Button, "SPELFRAM",0,0,0,0,0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) # Setup book spells buttons for i in range (24): Button = GemRB.GetControl (Window, 27 + i) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) SetSelectionChangeHandler (UpdateMageWindow) @@ -135,12 +134,13 @@ Name = GemRB.GetPlayerName (pc, 0) Label = GemRB.GetControl (Window, 0x10000035) GemRB.SetText (Window, Label, Name) + mem_cnt = GemRB.GetMemorizedSpellsCount (pc, type, level) for i in range (12): Button = GemRB.GetControl (Window, 3 + i) if i < mem_cnt: ms = GemRB.GetMemorizedSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ms['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ms['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) if ms['Flags']: @@ -155,13 +155,14 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"") + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS,"") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) @@ -172,20 +173,17 @@ Button = GemRB.GetControl (Window, 27 + i) if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ks['SpellResRef']) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"OnMageMemorizeSpell") + GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS,"OnMageMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenMageSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) GemRB.SetTooltip (Window, Button, spell['SpellName']) MageKnownSpellList.append (ks['SpellResRef']) - GemRB.SetVarAssoc (Window, Button, "SpellButton", 100 + -i) + GemRB.SetVarAssoc (Window, Button, "SpellButton", 100 + i) else: GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) @@ -221,5 +219,148 @@ UpdateMageWindow () return +def OnMageMemorizeSpell (): + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") - 100 + + if GemRB.MemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def OpenMageSpellInfoWindow (): + global MageSpellInfoWindow + + if MageSpellInfoWindow != None: + GemRB.UnloadWindow (MageSpellInfoWindow) + MageSpellInfoWindow = None + return + + MageSpellInfoWindow = Window = GemRB.LoadWindow (3) + + #back + Button = GemRB.GetControl (Window, 5) + GemRB.SetText (Window, Button, 15416) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellInfoWindow") + + #erase + Button = GemRB.GetControl (Window, 6) + index = GemRB.GetVar ("SpellButton") + if index < 100: + ResRef = MageMemorizedSpellList[index] + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + else: + ResRef = MageKnownSpellList[index - 100] + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellRemoveWindow") + GemRB.SetText (Window, Button, 63668) + + spell = GemRB.GetSpell (ResRef) + + Label = GemRB.GetControl (Window, 0x0fffffff) + GemRB.SetText (Window, Label, spell['SpellName']) + + Button = GemRB.GetControl (Window, 2) + GemRB.SetSpellIcon (Window, Button, ResRef, 1) + + Text = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, Text, spell['SpellDesc']) + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OnMageMemorizeSpell (): + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") - 100 + + if GemRB.MemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def CloseMageSpellUnmemorizeWindow (): + global MageSpellUnmemorizeWindow + + GemRB.UnloadWindow (MageSpellUnmemorizeWindow) + MageSpellUnmemorizeWindow = None + return + +def OpenMageSpellRemoveWindow (): + global MageSpellUnmemorizeWindow + + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (101) + + # "Are you sure you want to ....?" + TextArea = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, TextArea, 63745) + + # Remove + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 17507) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageRemoveSpell") + + # Cancel + Button = GemRB.GetControl (Window, 1) + GemRB.SetText (Window, Button, 13727) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseMageSpellUnmemorizeWindow") + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OpenMageSpellUnmemorizeWindow (): + global MageSpellUnmemorizeWindow + + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (101) + + # "Are you sure you want to ....?" + TextArea = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, TextArea, 11824) + + # Remove + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 17507) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageUnmemorizeSpell") + + # Cancel + Button = GemRB.GetControl (Window, 1) + GemRB.SetText (Window, Button, 13727) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseMageSpellUnmemorizeWindow") + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OnMageUnmemorizeSpell (): + if MageSpellUnmemorizeWindow: + CloseMageSpellUnmemorizeWindow() + + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") + + if GemRB.UnmemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def OnMageRemoveSpell (): + CloseMageSpellUnmemorizeWindow() + OpenMageSpellInfoWindow() + + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton")-100 + + #remove spell from book + GemRB.RemoveSpell (pc, type, level, index) + UpdateMageWindow () + return + ################################################### # End of file GUIMG.py Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIPR.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIPR.py 2007-04-30 19:24:59 UTC (rev 4626) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIPR.py 2007-04-30 21:43:16 UTC (rev 4627) @@ -92,15 +92,16 @@ # Setup memorized spells buttons for i in range (12): Button = GemRB.GetControl (Window, 3 + i) - GemRB.SetButtonBorder (Window, Button, 0,0,0,0,0,0,0,0,160,0,1) - GemRB.SetButtonBAM (Window, Button, "SPELFRAM",0,0,0) + GemRB.SetButtonBorder (Window, Button, 0,0,0,0,0,0,0,0,64,0,1) + GemRB.SetButtonSprites (Window, Button, "SPELFRAM",0,0,0,0,0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) # Setup book spells buttons for i in range (24): Button = GemRB.GetControl (Window, 27 + i) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) + GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_SECOND) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) SetSelectionChangeHandler (UpdatePriestWindow) UpdatePriestWindow () @@ -108,8 +109,8 @@ #bringing window front GemRB.SetVisible (Window, 3) GemRB.SetVisible (PortraitWindow, 1) + return - def UpdatePriestWindow (): global PriestMemorizedSpellList, PriestKnownSpellList @@ -135,7 +136,7 @@ Button = GemRB.GetControl (Window, 3 + i) if i < mem_cnt: ms = GemRB.GetMemorizedSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ms['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ms['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) if ms['Flags']: @@ -150,11 +151,13 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') @@ -166,8 +169,8 @@ Button = GemRB.GetControl (Window, 27 + i) if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ks['SpellResRef']) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) + GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnPriestMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenPriestSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) @@ -241,16 +244,11 @@ GemRB.SetText (Window, Label, spell['SpellName']) Button = GemRB.GetControl (Window, 2) - GemRB.SetSpellIcon (Window, Button, ResRef) + GemRB.SetSpellIcon (Window, Button, ResRef, 1) Text = GemRB.GetControl (Window, 3) GemRB.SetText (Window, Text, spell['SpellDesc']) - #IconResRef = 'SPL' + spell['SpellbookIcon'][2:] - - #Button = GemRB.GetControl (Window, 5) - #GemRB.SetButtonSprites (Window, Button, IconResRef, 0, 0, 0, 0, 0) - GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return @@ -269,17 +267,11 @@ def OpenPriestSpellRemoveWindow (): global PriestSpellUnmemorizeWindow - if PriestSpellUnmemorizeWindow != None: - GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) - PriestSpellUnmemorizeWindow = None - - return - PriestSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) # "Are you sure you want to ....?" TextArea = GemRB.GetControl (Window, 3) - GemRB.SetText (Window, TextArea, 63745) + GemRB.SetText (Window, TextArea, 11824) # Remove Button = GemRB.GetControl (Window, 0) @@ -294,15 +286,16 @@ GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return +def ClosePriestSpellUnmemorizeWindow (): + global PriestSpellUnmemorizeWindow + + GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) + PriestSpellUnmemorizeWindow = None + return + def OpenPriestSpellUnmemorizeWindow (): global PriestSpellUnmemorizeWindow - - if PriestSpellUnmemorizeWindow != None: - GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) - PriestSpellUnmemorizeWindow = None - - return - + PriestSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) # "Are you sure you want to ....?" @@ -317,14 +310,14 @@ # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestSpellUnmemorizeWindow") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ClosePriestSpellUnmemorizeWindow") GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return def OnPriestUnmemorizeSpell (): if PriestSpellUnmemorizeWindow: - OpenPriestSpellUnmemorizeWindow () + ClosePriestSpellUnmemorizeWindow () pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel @@ -338,19 +331,17 @@ def OnPriestRemoveSpell (): - if PriestSpellUnmemorizeWindow: - OpenPriestSpellRemoveWindow () + ClosePriestSpellUnmemorizeWindow() + OpenPriestSpellInfoWindow() pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel type = IE_SPELL_TYPE_PRIEST - index = GemRB.GetVar ("SpellButton") + index = GemRB.GetVar ("SpellButton")-100 #remove spell from memory - #GemRB.UnmemorizeSpell (pc, type, level, index) - #remove spell from book - #GemRB.RemoveSpell (pc, type, level, index) + GemRB.RemoveSpell (pc, type, level, index) UpdatePriestWindow () return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-05-03 20:53:58
|
Revision: 4635 http://gemrb.svn.sourceforge.net/gemrb/?rev=4635&view=rev Author: avenger_teambg Date: 2007-05-03 13:53:55 -0700 (Thu, 03 May 2007) Log Message: ----------- more spellbook guiscript updates Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUIMG.py gemrb/trunk/gemrb/GUIScripts/bg1/GUIPR.py gemrb/trunk/gemrb/GUIScripts/bg2/GUIMG.py gemrb/trunk/gemrb/GUIScripts/bg2/GUIPR.py gemrb/trunk/gemrb/GUIScripts/how/GUIMG.py gemrb/trunk/gemrb/GUIScripts/how/GUIPR.py gemrb/trunk/gemrb/GUIScripts/iwd/GUIMG.py gemrb/trunk/gemrb/GUIScripts/iwd/GUIPR.py gemrb/trunk/gemrb/GUIScripts/tob/GUIMG.py gemrb/trunk/gemrb/GUIScripts/tob/GUIPR.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUIMG.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUIMG.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUIMG.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -225,12 +225,8 @@ index = GemRB.GetVar ("SpellButton") if index < 100: ResRef = MageMemorizedSpellList[index] - # GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") - # GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) else: ResRef = MageKnownSpellList[index - 100] - # GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellRemoveWindow") - # GemRB.SetText (Window, Button, 63668) spell = GemRB.GetSpell (ResRef) Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUIPR.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUIPR.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUIPR.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -229,7 +229,6 @@ GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return - def OnPriestMemorizeSpell (): pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel @@ -306,7 +305,6 @@ UpdatePriestWindow () return - def OnPriestRemoveSpell (): ClosePriestSpellUnmemorizeWindow() OpenPriestSpellInfoWindow() Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIMG.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIMG.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIMG.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -158,7 +158,7 @@ GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS,"") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) @@ -170,7 +170,7 @@ if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS,"OnMageMemorizeSpell") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenMageSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) GemRB.SetTooltip (Window, Button, spell['SpellName']) @@ -232,7 +232,7 @@ GemRB.UnloadWindow (MageSpellInfoWindow) MageSpellInfoWindow = None return - + MageSpellInfoWindow = Window = GemRB.LoadWindow (3) #back @@ -286,7 +286,7 @@ def OpenMageSpellRemoveWindow (): global MageSpellUnmemorizeWindow - + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (101) # "Are you sure you want to ....?" Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIPR.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIPR.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIPR.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -151,12 +151,8 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") @@ -170,7 +166,6 @@ if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnPriestMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenPriestSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) @@ -251,7 +246,6 @@ GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return - def OnPriestMemorizeSpell (): pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel @@ -280,7 +274,7 @@ # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestSpellRemoveWindow") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ClosePriestSpellUnmemorizeWindow") GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return @@ -328,7 +322,6 @@ UpdatePriestWindow () return - def OnPriestRemoveSpell (): ClosePriestSpellUnmemorizeWindow() OpenPriestSpellInfoWindow() @@ -337,9 +330,9 @@ level = PriestSpellLevel type = IE_SPELL_TYPE_PRIEST - index = GemRB.GetVar ("SpellButton")-100 + index = GemRB.GetVar ("SpellButton") - 100 - #remove spell from memory + #remove spell from book GemRB.RemoveSpell (pc, type, level, index) UpdatePriestWindow () return Modified: gemrb/trunk/gemrb/GUIScripts/how/GUIMG.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUIMG.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/how/GUIMG.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -39,9 +39,8 @@ OldPortraitWindow = None OldOptionsWindow = None - def OpenMageWindow (): - global MageWindow, PortraitWindow, OptionsWindow + global MageWindow, OptionsWindow, PortraitWindow global OldPortraitWindow, OldOptionsWindow if CloseOtherWindow (OpenMageWindow): @@ -59,9 +58,10 @@ OldOptionsWindow = None SetSelectionChangeHandler (None) return - + GemRB.HideGUI () GemRB.SetVisible (0,0) + GemRB.LoadWindowPack ("GUIMG", 640, 480) MageWindow = Window = GemRB.LoadWindow (2) GemRB.SetVar ("OtherWindow", MageWindow) @@ -113,10 +113,11 @@ SetSelectionChangeHandler (UpdateMageWindow) UpdateMageWindow () GemRB.SetVisible (OptionsWindow, 1) + #bringing the window front GemRB.SetVisible (Window, 3) GemRB.SetVisible (PortraitWindow, 1) + return - def UpdateMageWindow (): global MageMemorizedSpellList, MageKnownSpellList @@ -127,9 +128,8 @@ pc = GemRB.GameGetSelectedPCSingle () type = IE_SPELL_TYPE_WIZARD level = MageSpellLevel - #max_mem_cnt = GemRB.GetMemorizableSpellsCount (pc, type, level) - max_mem_cnt = 0 - + max_mem_cnt = GemRB.GetMemorizableSpellsCount (pc, type, level) + Label = GemRB.GetControl (Window, 0x10000032) GemRB.SetToken ('LEVEL', str (level + 1)) GemRB.SetText (Window, Label, 12137 ) @@ -142,7 +142,7 @@ Button = GemRB.GetControl (Window, 3 + i) if i < mem_cnt: ms = GemRB.GetMemorizedSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ms['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ms['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) if ms['Flags']: @@ -157,13 +157,10 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"") + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) @@ -174,54 +171,193 @@ Button = GemRB.GetControl (Window, 27 + i) if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ks['SpellResRef']) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"OnMageMemorizeSpell") + GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenMageSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) GemRB.SetTooltip (Window, Button, spell['SpellName']) MageKnownSpellList.append (ks['SpellResRef']) - GemRB.SetVarAssoc (Window, Button, "SpellButton", 100 + -i) + GemRB.SetVarAssoc (Window, Button, "SpellButton", 100 + i) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) + Table = GemRB.LoadTable ("clskills") if (GemRB.GetTableValue (Table, GemRB.GetPlayerStat( GemRB.GameGetSelectedPCSingle(), IE_CLASS), 2)=="*"): GemRB.SetVisible (Window, 2) else: GemRB.SetVisible (Window, 1) + return - def MagePrevLevelPress (): global MageSpellLevel if MageSpellLevel > 0: MageSpellLevel = MageSpellLevel - 1 UpdateMageWindow () + return - def MageNextLevelPress (): global MageSpellLevel if MageSpellLevel < 8: MageSpellLevel = MageSpellLevel + 1 UpdateMageWindow () + return - def RefreshMageLevel (): global MageSpellLevel MageSpellLevel = GemRB.GetVar ("MageSpellLevel") UpdateMageWindow () + return +def OnMageMemorizeSpell (): + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + index = GemRB.GetVar ("SpellButton") - 100 + + if GemRB.MemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def OpenMageSpellInfoWindow (): + global MageSpellInfoWindow + + if MageSpellInfoWindow != None: + GemRB.UnloadWindow (MageSpellInfoWindow) + MageSpellInfoWindow = None + return + + MageSpellInfoWindow = Window = GemRB.LoadWindow (3) + + #back + Button = GemRB.GetControl (Window, 5) + GemRB.SetText (Window, Button, 15416) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellInfoWindow") + + #erase + #Button = GemRB.GetControl (Window, 6) + index = GemRB.GetVar ("SpellButton") + if index < 100: + ResRef = MageMemorizedSpellList[index] + #GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + else: + ResRef = MageKnownSpellList[index - 100] + #GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellRemoveWindow") + #GemRB.SetText (Window, Button, 63668) + + spell = GemRB.GetSpell (ResRef) + + Label = GemRB.GetControl (Window, 0x0fffffff) + GemRB.SetText (Window, Label, spell['SpellName']) + + Button = GemRB.GetControl (Window, 2) + GemRB.SetSpellIcon (Window, Button, ResRef, 1) + + Text = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, Text, spell['SpellDesc']) + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OnMageMemorizeSpell (): + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") - 100 + + if GemRB.MemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def CloseMageSpellUnmemorizeWindow (): + global MageSpellUnmemorizeWindow + + GemRB.UnloadWindow (MageSpellUnmemorizeWindow) + MageSpellUnmemorizeWindow = None + return + +def OpenMageSpellRemoveWindow (): + global MageSpellUnmemorizeWindow + + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) + + # "Are you sure you want to ....?" + TextArea = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, TextArea, 63745) + + # Remove + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 17507) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageRemoveSpell") + + # Cancel + Button = GemRB.GetControl (Window, 1) + GemRB.SetText (Window, Button, 13727) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseMageSpellUnmemorizeWindow") + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OpenMageSpellUnmemorizeWindow (): + global MageSpellUnmemorizeWindow + + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) + + # "Are you sure you want to ....?" + TextArea = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, TextArea, 11824) + + # Remove + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 17507) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageUnmemorizeSpell") + + # Cancel + Button = GemRB.GetControl (Window, 1) + GemRB.SetText (Window, Button, 13727) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseMageSpellUnmemorizeWindow") + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OnMageUnmemorizeSpell (): + if MageSpellUnmemorizeWindow: + CloseMageSpellUnmemorizeWindow() + + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") + + if GemRB.UnmemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def OnMageRemoveSpell (): + CloseMageSpellUnmemorizeWindow() + OpenMageSpellInfoWindow() + + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton")-100 + + #remove spell from book + GemRB.RemoveSpell (pc, type, level, index) + UpdateMageWindow () + return + ################################################### # End of file GUIMG.py Modified: gemrb/trunk/gemrb/GUIScripts/how/GUIPR.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUIPR.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/how/GUIPR.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -39,29 +39,29 @@ OldPortraitWindow = None OldOptionsWindow = None - def OpenPriestWindow (): - global PriestWindow, PortraitWindow, OptionsWindow + global PriestWindow, OptionsWindow, PortraitWindow global OldPortraitWindow, OldOptionsWindow - + if CloseOtherWindow (OpenPriestWindow): GemRB.UnloadWindow (PriestWindow) GemRB.UnloadWindow (OptionsWindow) GemRB.UnloadWindow (PortraitWindow) PriestWindow = None - GemRB.SetVar ("OtherWindow", -1) - GemRB.SetVisible (0,1) - GemRB.UnhideGUI () - GUICommonWindows.PortraitWindow = OldPortraitWindow - OldPortraitWindow = None - GUICommonWindows.OptionsWindow = OldOptionsWindow - OldOptionsWindow = None - SetSelectionChangeHandler (None) + GemRB.SetVar ("OtherWindow", -1) + GemRB.SetVisible (0,1) + GemRB.UnhideGUI () + GUICommonWindows.PortraitWindow = OldPortraitWindow + OldPortraitWindow = None + GUICommonWindows.OptionsWindow = OldOptionsWindow + OldOptionsWindow = None + SetSelectionChangeHandler (None) return - + GemRB.HideGUI () GemRB.SetVisible (0,0) + GemRB.LoadWindowPack ("GUIPR", 640, 480) PriestWindow = Window = GemRB.LoadWindow (2) GemRB.SetVar ("OtherWindow", PriestWindow) @@ -96,10 +96,11 @@ SetSelectionChangeHandler (UpdatePriestWindow) UpdatePriestWindow () GemRB.SetVisible (OptionsWindow, 1) + #bringing window front GemRB.SetVisible (Window, 3) GemRB.SetVisible (PortraitWindow, 1) + return - def UpdatePriestWindow (): global PriestMemorizedSpellList, PriestKnownSpellList @@ -110,9 +111,8 @@ pc = GemRB.GameGetSelectedPCSingle () type = IE_SPELL_TYPE_PRIEST level = PriestSpellLevel - ###max_mem_cnt = GemRB.GetMemorizableSpellsCount (pc, type, level) - max_mem_cnt = 2 - + max_mem_cnt = GemRB.GetMemorizableSpellsCount (pc, type, level) + Label = GemRB.GetControl (Window, 0x10000032) GemRB.SetToken ('LEVEL', str (level + 1)) GemRB.SetText (Window, Label, 12137) @@ -126,7 +126,7 @@ Button = GemRB.GetControl (Window, 3 + i) if i < mem_cnt: ms = GemRB.GetMemorizedSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ms['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ms['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) if ms['Flags']: @@ -141,11 +141,9 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') @@ -157,7 +155,7 @@ Button = GemRB.GetControl (Window, 27 + i) if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ks['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnPriestMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenPriestSpellInfoWindow") @@ -178,47 +176,40 @@ GemRB.SetVisible (Window, 2) else: GemRB.SetVisible (Window, 1) + return - - def PriestPrevLevelPress (): global PriestSpellLevel if PriestSpellLevel > 0: PriestSpellLevel = PriestSpellLevel - 1 UpdatePriestWindow () + return - def PriestNextLevelPress (): global PriestSpellLevel if PriestSpellLevel < 6: PriestSpellLevel = PriestSpellLevel + 1 UpdatePriestWindow () + return - def RefreshPriestLevel (): global PriestSpellLevel PriestSpellLevel = GemRB.GetVar ("PriestSpellLevel") UpdatePriestWindow () + return - def OpenPriestSpellInfoWindow (): global PriestSpellInfoWindow - GemRB.HideGUI () - if PriestSpellInfoWindow != None: GemRB.UnloadWindow (PriestSpellInfoWindow) PriestSpellInfoWindow = None - GemRB.SetVar ("FloatWindow", -1) - - GemRB.UnhideGUI () return - + PriestSpellInfoWindow = Window = GemRB.LoadWindow (3) - GemRB.SetVar ("FloatWindow", PriestSpellInfoWindow) #back Button = GemRB.GetControl (Window, 5) @@ -240,15 +231,14 @@ GemRB.SetText (Window, Label, spell['SpellName']) Button = GemRB.GetControl (Window, 2) - GemRB.SetSpellIcon (Window, Button, ResRef) + GemRB.SetSpellIcon (Window, Button, ResRef, 1) Text = GemRB.GetControl (Window, 3) GemRB.SetText (Window, Text, spell['SpellDesc']) - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return - def OnPriestMemorizeSpell (): pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel @@ -258,23 +248,12 @@ if GemRB.MemorizeSpell (pc, type, level, index): UpdatePriestWindow () + return - def OpenPriestSpellRemoveWindow (): global PriestSpellUnmemorizeWindow - - GemRB.HideGUI () - - if PriestSpellUnmemorizeWindow != None: - GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) - PriestSpellUnmemorizeWindow = None - GemRB.SetVar ("FloatWindow", -1) - - GemRB.UnhideGUI () - return - + PriestSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) - GemRB.SetVar ("FloatWindow", PriestSpellUnmemorizeWindow) # "Are you sure you want to ....?" TextArea = GemRB.GetControl (Window, 3) @@ -288,27 +267,22 @@ # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestSpellRemoveWindow") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ClosePriestSpelliUnmemorizeWindow") - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return +def ClosePriestSpellUnmemorizeWindow (): + global PriestSpellUnmemorizeWindow + GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) + PriestSpellUnmemorizeWindow = None + return + def OpenPriestSpellUnmemorizeWindow (): global PriestSpellUnmemorizeWindow - - GemRB.HideGUI () - - if PriestSpellUnmemorizeWindow != None: - GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) - PriestSpellUnmemorizeWindow = None - GemRB.SetVar ("FloatWindow", -1) - - GemRB.UnhideGUI () - return - + PriestSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) - GemRB.SetVar ("FloatWindow", PriestSpellUnmemorizeWindow) # "Are you sure you want to ....?" TextArea = GemRB.GetControl (Window, 3) @@ -322,15 +296,14 @@ # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestSpellUnmemorizeWindow") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ClosePriestSpellUnmemorizeWindow") - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return - def OnPriestUnmemorizeSpell (): if PriestSpellUnmemorizeWindow: - OpenPriestSpellUnmemorizeWindow () + ClosePriestSpellUnmemorizeWindow () pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel @@ -340,24 +313,22 @@ if GemRB.UnmemorizeSpell (pc, type, level, index): UpdatePriestWindow () + return - def OnPriestRemoveSpell (): if PriestSpellUnmemorizeWindow: - OpenPriestSpellRemoveWindow () + ClosePriestSpellRemoveWindow () pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel type = IE_SPELL_TYPE_PRIEST - index = GemRB.GetVar ("SpellButton") + index = GemRB.GetVar ("SpellButton") - 100 - #remove spell from memory - #GemRB.UnmemorizeSpell (pc, type, level, index) #remove spell from book - #GemRB.RemoveSpell (pc, type, level, index) + GemRB.RemoveSpell (pc, type, level, index) UpdatePriestWindow () + return - ################################################### # End of file GUIPR.py Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUIMG.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUIMG.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUIMG.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -39,9 +39,8 @@ OldPortraitWindow = None OldOptionsWindow = None - def OpenMageWindow (): - global MageWindow, PortraitWindow, OptionsWindow + global MageWindow, OptionsWindow, PortraitWindow global OldPortraitWindow, OldOptionsWindow if CloseOtherWindow (OpenMageWindow): @@ -59,9 +58,10 @@ OldOptionsWindow = None SetSelectionChangeHandler (None) return - + GemRB.HideGUI () GemRB.SetVisible (0,0) + GemRB.LoadWindowPack ("GUIMG", 640, 480) MageWindow = Window = GemRB.LoadWindow (2) GemRB.SetVar ("OtherWindow", MageWindow) @@ -105,7 +105,7 @@ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) # Setup book spells buttons - for i in range (20): + for i in range (24): Button = GemRB.GetControl (Window, 27 + i) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) @@ -113,10 +113,11 @@ SetSelectionChangeHandler (UpdateMageWindow) UpdateMageWindow () GemRB.SetVisible (OptionsWindow, 1) + #bringing the window front GemRB.SetVisible (Window, 3) GemRB.SetVisible (PortraitWindow, 1) + return - def UpdateMageWindow (): global MageMemorizedSpellList, MageKnownSpellList @@ -127,9 +128,8 @@ pc = GemRB.GameGetSelectedPCSingle () type = IE_SPELL_TYPE_WIZARD level = MageSpellLevel - #max_mem_cnt = GemRB.GetMemorizableSpellsCount (pc, type, level) - max_mem_cnt = 0 - + max_mem_cnt = GemRB.GetMemorizableSpellsCount (pc, type, level) + Label = GemRB.GetControl (Window, 0x10000032) GemRB.SetToken ('LEVEL', str (level + 1)) GemRB.SetText (Window, Label, 12137 ) @@ -142,7 +142,7 @@ Button = GemRB.GetControl (Window, 3 + i) if i < mem_cnt: ms = GemRB.GetMemorizedSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ms['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ms['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) if ms['Flags']: @@ -157,71 +157,207 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"") + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) known_cnt = GemRB.GetKnownSpellsCount (pc, type, level) - for i in range (20): + for i in range (24): Button = GemRB.GetControl (Window, 27 + i) if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ks['SpellResRef']) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"OnMageMemorizeSpell") + GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenMageSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) GemRB.SetTooltip (Window, Button, spell['SpellName']) MageKnownSpellList.append (ks['SpellResRef']) - GemRB.SetVarAssoc (Window, Button, "SpellButton", 100 + -i) + GemRB.SetVarAssoc (Window, Button, "SpellButton", 100 + i) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, -"") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) + Table = GemRB.LoadTable ("clskills") if (GemRB.GetTableValue (Table, GemRB.GetPlayerStat( GemRB.GameGetSelectedPCSingle(), IE_CLASS), 2)=="*"): GemRB.SetVisible (Window, 2) else: GemRB.SetVisible (Window, 1) + return - def MagePrevLevelPress (): global MageSpellLevel if MageSpellLevel > 0: MageSpellLevel = MageSpellLevel - 1 UpdateMageWindow () + return - def MageNextLevelPress (): global MageSpellLevel if MageSpellLevel < 8: MageSpellLevel = MageSpellLevel + 1 UpdateMageWindow () + return - def RefreshMageLevel (): global MageSpellLevel MageSpellLevel = GemRB.GetVar ("MageSpellLevel") UpdateMageWindow () + return +def OnMageMemorizeSpell (): + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + index = GemRB.GetVar ("SpellButton") - 100 + + if GemRB.MemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def OpenMageSpellInfoWindow (): + global MageSpellInfoWindow + + if MageSpellInfoWindow != None: + GemRB.UnloadWindow (MageSpellInfoWindow) + MageSpellInfoWindow = None + return + + MageSpellInfoWindow = Window = GemRB.LoadWindow (3) + + #back + Button = GemRB.GetControl (Window, 5) + GemRB.SetText (Window, Button, 15416) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellInfoWindow") + + #erase + #Button = GemRB.GetControl (Window, 6) + index = GemRB.GetVar ("SpellButton") + if index < 100: + ResRef = MageMemorizedSpellList[index] + #GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") + #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) + else: + ResRef = MageKnownSpellList[index - 100] + #GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellRemoveWindow") + #GemRB.SetText (Window, Button, 63668) + + spell = GemRB.GetSpell (ResRef) + + Label = GemRB.GetControl (Window, 0x0fffffff) + GemRB.SetText (Window, Label, spell['SpellName']) + + Button = GemRB.GetControl (Window, 2) + GemRB.SetSpellIcon (Window, Button, ResRef, 1) + + Text = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, Text, spell['SpellDesc']) + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OnMageMemorizeSpell (): + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") - 100 + + if GemRB.MemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def CloseMageSpellUnmemorizeWindow (): + global MageSpellUnmemorizeWindow + + GemRB.UnloadWindow (MageSpellUnmemorizeWindow) + MageSpellUnmemorizeWindow = None + return + +def OpenMageSpellRemoveWindow (): + global MageSpellUnmemorizeWindow + + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) + + # "Are you sure you want to ....?" + TextArea = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, TextArea, 63745) + + # Remove + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 17507) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageRemoveSpell") + + # Cancel + Button = GemRB.GetControl (Window, 1) + GemRB.SetText (Window, Button, 13727) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseMageSpellUnmemorizeWindow") + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OpenMageSpellUnmemorizeWindow (): + global MageSpellUnmemorizeWindow + + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) + + # "Are you sure you want to ....?" + TextArea = GemRB.GetControl (Window, 3) + GemRB.SetText (Window, TextArea, 11824) + + # Remove + Button = GemRB.GetControl (Window, 0) + GemRB.SetText (Window, Button, 17507) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageUnmemorizeSpell") + + # Cancel + Button = GemRB.GetControl (Window, 1) + GemRB.SetText (Window, Button, 13727) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseMageSpellUnmemorizeWindow") + + GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return + +def OnMageUnmemorizeSpell (): + if MageSpellUnmemorizeWindow: + CloseMageSpellUnmemorizeWindow() + + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton") + + if GemRB.UnmemorizeSpell (pc, type, level, index): + UpdateMageWindow () + return + +def OnMageRemoveSpell (): + CloseMageSpellUnmemorizeWindow() + OpenMageSpellInfoWindow() + + pc = GemRB.GameGetSelectedPCSingle () + level = MageSpellLevel + type = IE_SPELL_TYPE_WIZARD + + index = GemRB.GetVar ("SpellButton")-100 + + #remove spell from book + GemRB.RemoveSpell (pc, type, level, index) + UpdateMageWindow () + return + ################################################### # End of file GUIMG.py Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUIPR.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUIPR.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUIPR.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -39,29 +39,29 @@ OldPortraitWindow = None OldOptionsWindow = None - def OpenPriestWindow (): - global PriestWindow, PortraitWindow, OptionsWindow + global PriestWindow, OptionsWindow, PortraitWindow global OldPortraitWindow, OldOptionsWindow - + if CloseOtherWindow (OpenPriestWindow): GemRB.UnloadWindow (PriestWindow) GemRB.UnloadWindow (OptionsWindow) GemRB.UnloadWindow (PortraitWindow) PriestWindow = None - GemRB.SetVar ("OtherWindow", -1) - GemRB.SetVisible (0,1) - GemRB.UnhideGUI () - GUICommonWindows.PortraitWindow = OldPortraitWindow - OldPortraitWindow = None - GUICommonWindows.OptionsWindow = OldOptionsWindow - OldOptionsWindow = None - SetSelectionChangeHandler (None) + GemRB.SetVar ("OtherWindow", -1) + GemRB.SetVisible (0,1) + GemRB.UnhideGUI () + GUICommonWindows.PortraitWindow = OldPortraitWindow + OldPortraitWindow = None + GUICommonWindows.OptionsWindow = OldOptionsWindow + OldOptionsWindow = None + SetSelectionChangeHandler (None) return - + GemRB.HideGUI () GemRB.SetVisible (0,0) + GemRB.LoadWindowPack ("GUIPR", 640, 480) PriestWindow = Window = GemRB.LoadWindow (2) GemRB.SetVar ("OtherWindow", PriestWindow) @@ -88,7 +88,7 @@ GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) # Setup book spells buttons - for i in range (20): + for i in range (24): Button = GemRB.GetControl (Window, 27 + i) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) @@ -96,10 +96,11 @@ SetSelectionChangeHandler (UpdatePriestWindow) UpdatePriestWindow () GemRB.SetVisible (OptionsWindow, 1) + #bringing window front GemRB.SetVisible (Window, 3) GemRB.SetVisible (PortraitWindow, 1) + return - def UpdatePriestWindow (): global PriestMemorizedSpellList, PriestKnownSpellList @@ -110,9 +111,8 @@ pc = GemRB.GameGetSelectedPCSingle () type = IE_SPELL_TYPE_PRIEST level = PriestSpellLevel - ###max_mem_cnt = GemRB.GetMemorizableSpellsCount (pc, type, level) - max_mem_cnt = 2 - + max_mem_cnt = GemRB.GetMemorizableSpellsCount (pc, type, level) + Label = GemRB.GetControl (Window, 0x10000032) GemRB.SetToken ('LEVEL', str (level + 1)) GemRB.SetText (Window, Label, 12137) @@ -126,7 +126,7 @@ Button = GemRB.GetControl (Window, 3 + i) if i < mem_cnt: ms = GemRB.GetMemorizedSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ms['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ms['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) if ms['Flags']: @@ -141,11 +141,9 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') @@ -153,11 +151,11 @@ known_cnt = GemRB.GetKnownSpellsCount (pc, type, level) - for i in range (20): + for i in range (24): Button = GemRB.GetControl (Window, 27 + i) if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) - GemRB.SetSpellIcon (Window, Button, ks['SpellResRef']) + GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnPriestMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenPriestSpellInfoWindow") @@ -178,47 +176,40 @@ GemRB.SetVisible (Window, 2) else: GemRB.SetVisible (Window, 1) + return - - def PriestPrevLevelPress (): global PriestSpellLevel if PriestSpellLevel > 0: PriestSpellLevel = PriestSpellLevel - 1 UpdatePriestWindow () + return - def PriestNextLevelPress (): global PriestSpellLevel if PriestSpellLevel < 6: PriestSpellLevel = PriestSpellLevel + 1 UpdatePriestWindow () + return - def RefreshPriestLevel (): global PriestSpellLevel PriestSpellLevel = GemRB.GetVar ("PriestSpellLevel") UpdatePriestWindow () + return - def OpenPriestSpellInfoWindow (): global PriestSpellInfoWindow - GemRB.HideGUI () - if PriestSpellInfoWindow != None: GemRB.UnloadWindow (PriestSpellInfoWindow) PriestSpellInfoWindow = None - GemRB.SetVar ("FloatWindow", -1) - - GemRB.UnhideGUI () return - + PriestSpellInfoWindow = Window = GemRB.LoadWindow (3) - GemRB.SetVar ("FloatWindow", PriestSpellInfoWindow) #back Button = GemRB.GetControl (Window, 5) @@ -240,15 +231,14 @@ GemRB.SetText (Window, Label, spell['SpellName']) Button = GemRB.GetControl (Window, 2) - GemRB.SetSpellIcon (Window, Button, ResRef) + GemRB.SetSpellIcon (Window, Button, ResRef, 1) Text = GemRB.GetControl (Window, 3) GemRB.SetText (Window, Text, spell['SpellDesc']) - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return - def OnPriestMemorizeSpell (): pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel @@ -258,23 +248,12 @@ if GemRB.MemorizeSpell (pc, type, level, index): UpdatePriestWindow () + return - def OpenPriestSpellRemoveWindow (): global PriestSpellUnmemorizeWindow - - GemRB.HideGUI () - - if PriestSpellUnmemorizeWindow != None: - GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) - PriestSpellUnmemorizeWindow = None - GemRB.SetVar ("FloatWindow", -1) - - GemRB.UnhideGUI () - return - + PriestSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) - GemRB.SetVar ("FloatWindow", PriestSpellUnmemorizeWindow) # "Are you sure you want to ....?" TextArea = GemRB.GetControl (Window, 3) @@ -288,27 +267,22 @@ # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestSpellRemoveWindow") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ClosePriestSpelliUnmemorizeWindow") - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return +def ClosePriestSpellUnmemorizeWindow (): + global PriestSpellUnmemorizeWindow + GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) + PriestSpellUnmemorizeWindow = None + return + def OpenPriestSpellUnmemorizeWindow (): global PriestSpellUnmemorizeWindow - - GemRB.HideGUI () - - if PriestSpellUnmemorizeWindow != None: - GemRB.UnloadWindow (PriestSpellUnmemorizeWindow) - PriestSpellUnmemorizeWindow = None - GemRB.SetVar ("FloatWindow", -1) - - GemRB.UnhideGUI () - return - + PriestSpellUnmemorizeWindow = Window = GemRB.LoadWindow (5) - GemRB.SetVar ("FloatWindow", PriestSpellUnmemorizeWindow) # "Are you sure you want to ....?" TextArea = GemRB.GetControl (Window, 3) @@ -322,15 +296,14 @@ # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestSpellUnmemorizeWindow") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ClosePriestSpellUnmemorizeWindow") - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) + return - def OnPriestUnmemorizeSpell (): if PriestSpellUnmemorizeWindow: - OpenPriestSpellUnmemorizeWindow () + ClosePriestSpellUnmemorizeWindow () pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel @@ -340,24 +313,22 @@ if GemRB.UnmemorizeSpell (pc, type, level, index): UpdatePriestWindow () + return - def OnPriestRemoveSpell (): if PriestSpellUnmemorizeWindow: - OpenPriestSpellRemoveWindow () + ClosePriestSpellRemoveWindow () pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel type = IE_SPELL_TYPE_PRIEST - index = GemRB.GetVar ("SpellButton") + index = GemRB.GetVar ("SpellButton") - 100 - #remove spell from memory - #GemRB.UnmemorizeSpell (pc, type, level, index) #remove spell from book - #GemRB.RemoveSpell (pc, type, level, index) + GemRB.RemoveSpell (pc, type, level, index) UpdatePriestWindow () + return - ################################################### # End of file GUIPR.py Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIMG.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIMG.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIMG.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -158,7 +158,7 @@ GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS,"") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetTooltip (Window, Button, '') GemRB.EnableButtonBorder (Window, Button, 0, 0) @@ -170,7 +170,7 @@ if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS,"OnMageMemorizeSpell") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnMageMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenMageSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) GemRB.SetTooltip (Window, Button, spell['SpellName']) @@ -232,7 +232,7 @@ GemRB.UnloadWindow (MageSpellInfoWindow) MageSpellInfoWindow = None return - + MageSpellInfoWindow = Window = GemRB.LoadWindow (3) #back @@ -286,7 +286,7 @@ def OpenMageSpellRemoveWindow (): global MageSpellUnmemorizeWindow - + MageSpellUnmemorizeWindow = Window = GemRB.LoadWindow (101) # "Are you sure you want to ....?" Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIPR.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIPR.py 2007-05-03 17:51:09 UTC (rev 4634) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIPR.py 2007-05-03 20:53:55 UTC (rev 4635) @@ -151,12 +151,8 @@ GemRB.EnableButtonBorder (Window, Button, 0, ms['Flags'] == 0) else: if i < max_mem_cnt: - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NORMAL, OP_SET) else: - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") @@ -170,7 +166,6 @@ if i < known_cnt: ks = GemRB.GetKnownSpell (pc, type, level, i) GemRB.SetSpellIcon (Window, Button, ks['SpellResRef'], 0) - #GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OnPriestMemorizeSpell") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenPriestSpellInfoWindow") spell = GemRB.GetSpell (ks['SpellResRef']) @@ -251,7 +246,6 @@ GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return - def OnPriestMemorizeSpell (): pc = GemRB.GameGetSelectedPCSingle () level = PriestSpellLevel @@ -280,7 +274,7 @@ # Cancel Button = GemRB.GetControl (Window, 1) GemRB.SetText (Window, Button, 13727) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenPriestSpellRemoveWindow") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ClosePriestSpellUnmemorizeWindow") GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) return @@ -328,7 +322,6 @@ UpdatePriestWindow () return - def OnPriestRemoveSpell (): ClosePriestSpellUnmemorizeWindow() OpenPriestSpellInfoWindow() @@ -337,9 +330,9 @@ level = PriestSpellLevel type = IE_SPELL_TYPE_PRIEST - index = GemRB.GetVar ("SpellButton")-100 + index = GemRB.GetVar ("SpellButton") - 100 - #remove spell from memory + #remove spell from book GemRB.RemoveSpell (pc, type, level, index) UpdatePriestWindow () return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-05-06 08:12:16
|
Revision: 4643 http://gemrb.svn.sourceforge.net/gemrb/?rev=4643&view=rev Author: avenger_teambg Date: 2007-05-06 01:12:17 -0700 (Sun, 06 May 2007) Log Message: ----------- fixed kit display in BG2 guiscripts Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-05-06 07:21:49 UTC (rev 4642) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-05-06 08:12:17 UTC (rev 4643) @@ -425,13 +425,24 @@ def GetActorClassTitle (actor): ClassTitle = GemRB.GetPlayerStat (actor, IE_TITLE1) - KitIndex = GemRB.GetPlayerStat (actor, IE_KIT) & 0xfff + Kit = GemRB.GetPlayerStat (actor, IE_KIT) + KitIndex = 0 + if Kit&0xc000ffff == 0x40000000: + KitIndex = Kit>>16 & 0xfff Class = GemRB.GetPlayerStat (actor, IE_CLASS) ClassTable = GemRB.LoadTable ("classes") Class = GemRB.FindTableValue ( ClassTable, 5, Class ) KitTable = GemRB.LoadTable ("kitlist") - if ClassTitle==0: + #looking for kit by the usability flag + if KitIndex == 0: + KitIndex = GemRB.FindTableValue (KitTable, Kit, 6) + if KitIndex == -1: + KitIndex = 0 + elif Class != GemRB.GetTableValue (KitTable, KitIndex, 5): + KitIndex = 0 + + if ClassTitle == 0: if KitIndex == 0: ClassTitle=GemRB.GetTableValue (ClassTable, Class, 2) else: Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-05-06 07:21:49 UTC (rev 4642) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-05-06 08:12:17 UTC (rev 4643) @@ -425,13 +425,24 @@ def GetActorClassTitle (actor): ClassTitle = GemRB.GetPlayerStat (actor, IE_TITLE1) - KitIndex = GemRB.GetPlayerStat (actor, IE_KIT) & 0xfff + Kit = GemRB.GetPlayerStat (actor, IE_KIT) + KitIndex = 0 + if Kit&0xc000ffff == 0x40000000: + KitIndex = Kit>>16 & 0xfff Class = GemRB.GetPlayerStat (actor, IE_CLASS) ClassTable = GemRB.LoadTable ("classes") Class = GemRB.FindTableValue ( ClassTable, 5, Class ) KitTable = GemRB.LoadTable ("kitlist") - if ClassTitle==0: + #looking for kit by the usability flag + if KitIndex == 0: + KitIndex = GemRB.FindTableValue (KitTable, Kit, 6) + if KitIndex == -1: + KitIndex = 0 + elif Class != GemRB.GetTableValue (KitTable, KitIndex, 5): + KitIndex = 0 + + if ClassTitle == 0: if KitIndex == 0: ClassTitle=GemRB.GetTableValue (ClassTable, Class, 2) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-05-28 09:17:44
|
Revision: 4668 http://gemrb.svn.sourceforge.net/gemrb/?rev=4668&view=rev Author: avenger_teambg Date: 2007-05-28 02:17:07 -0700 (Mon, 28 May 2007) Log Message: ----------- synced bg1 damage feedback on portrait windows, fixed transparency Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-05-26 21:41:00 UTC (rev 4667) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-05-28 09:17:07 UTC (rev 4668) @@ -523,7 +523,12 @@ GemRB.SetButtonPicture (Window, Button, pic, "NOPORTSM") hp = GemRB.GetPlayerStat (i+1, IE_HITPOINTS) hp_max = GemRB.GetPlayerStat (i+1, IE_MAXHITPOINTS) + state = GemRB.GetPlayerStat (i+1, IE_STATE_ID) + if hp<1 or (state & STATE_DEAD): + GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 64,64,64,200, 64,64,64,200) + else: + GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 255,0,0,200, 128,0,0,200) GemRB.SetTooltip (Window, Button, GemRB.GetPlayerName (i+1, 1) + "\n%d/%d" %(hp, hp_max)) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-05-26 21:41:00 UTC (rev 4667) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-05-28 09:17:07 UTC (rev 4668) @@ -255,10 +255,10 @@ elif level == 1: GemRB.SetupEquipmentIcons(ActionsWindow, pc, TopIndex) elif level == 2: #spells - GemRB.SetVar("Type", 3) + GemRB.SetVar ("Type", 3) GemRB.SetupSpellIcons(ActionsWindow, pc, 3, TopIndex) elif level == 3: #innates - GemRB.SetVar("Type", 4) + GemRB.SetVar ("Type", 4) GemRB.SetupSpellIcons(ActionsWindow, pc, 4, TopIndex) return @@ -405,9 +405,9 @@ pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) - Spell = GemRB.GetVar("Spell") - Type = GemRB.GetVar("Type") - GemRB.SpellCast(pc, Type, Spell) + Spell = GemRB.GetVar ("Spell") + Type = GemRB.GetVar ("Type") + GemRB.SpellCast (pc, Type, Spell) GemRB.SetVar ("ActionLevel", 0) UpdateActionsWindow () return @@ -416,9 +416,9 @@ pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) - Item = GemRB.GetVar("Equipment") + Item = GemRB.GetVar ("Equipment") #equipment index - GemRB.UseItem(pc, -1, Item) + GemRB.UseItem (pc, -1, Item) GemRB.SetVar ("ActionLevel", 0) UpdateActionsWindow () return @@ -568,7 +568,7 @@ if hp<1 or (state & STATE_DEAD): GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 64,64,64,200, 64,64,64,200) else: - GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 255,0,0,200, 128,0,0,64) + GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 255,0,0,200, 128,0,0,200) #GemRB.SetText (Window, Button, "%d/%d" %(hp, hp_max)) GemRB.SetTooltip (Window, Button, GemRB.GetPlayerName (i+1, 1) + "\n%d/%d" %(hp, hp_max)) @@ -624,11 +624,13 @@ if GemRB.IsDraggingItem (): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 1) + return def PortraitButtonOnMouseLeave (): i = GemRB.GetVar ("PressedPortrait") Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 0) + return def GetSavingThrow (SaveName, row, level): SaveTable = GemRB.LoadTable (SaveName) @@ -645,8 +647,17 @@ level2 = 20 Class = GemRB.GetPlayerStat (pc, IE_CLASS) ClassTable = GemRB.LoadTable ("classes") + + Race = GemRB.GetPlayerStat (pc, IE_RACE) + RaceTable = GemRB.LoadTable ("races") + Class = GemRB.FindTableValue (ClassTable, 5, Class) - Multi = GemRB.GetTableValue (ClassTable, 4, Class) + Multi = GemRB.GetTableValue (ClassTable, Class, 4) + + Race = GemRB.FindTableValue (RaceTable, 3, Race) + RaceSaveTableName = GemRB.GetTableValue (RaceTable, Race, 4) + + #todo fix multi class if Multi: if Class == 7: #fighter/mage @@ -666,6 +677,14 @@ if tmp2<tmp1: tmp1=tmp2 GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) + if RaceSaveTableName!="*": + Con = GemRB.GetPlayerStat (pc, IE_CON) + RaceSaveTable = GemRB.LoadTable (RaceSaveTableName) + for row in range (5): + tmp1 = GemRB.GetPlayerStat (pc, IE_SAVEVSDEATH+row) + tmp1 += GemRB.GetTableValue (RaceSaveTable, row, Con) + GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) + GemRB.UnloadTable (RaceSaveTable) return def SetEncumbranceLabels (Window, Label, Label2, pc): Modified: gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-05-26 21:41:00 UTC (rev 4667) +++ gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-05-28 09:17:07 UTC (rev 4668) @@ -245,10 +245,10 @@ elif level == 1: GemRB.SetupEquipmentIcons(ActionsWindow, pc, TopIndex) elif level == 2: #spells - GemRB.SetVar("Type", 3) + GemRB.SetVar ("Type", 3) GemRB.SetupSpellIcons(ActionsWindow, pc, 3, TopIndex) elif level == 3: #innates - GemRB.SetVar("Type", 4) + GemRB.SetVar ("Type", 4) GemRB.SetupSpellIcons(ActionsWindow, pc, 4, TopIndex) return @@ -265,7 +265,7 @@ GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_DEFEND) def ActionQWeaponPressed (which): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () if GemRB.GetEquippedQuickSlot (pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) @@ -308,7 +308,7 @@ #no check needed because the button wouldn't be drawn if illegal def ActionRightPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () TopIndex = GemRB.GetVar ("TopIndex") Type = GemRB.GetVar ("Type") Max = GemRB.GetMemorizedSpellsCount(pc, Type) @@ -324,25 +324,25 @@ return def ActionSongPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_BATTLESONG) UpdateActionsWindow () return def ActionSearchPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_DETECTTRAPS) UpdateActionsWindow () return def ActionStealthPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_STEALTH) UpdateActionsWindow () return def ActionTurnPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_TURNUNDEAD) UpdateActionsWindow () return @@ -360,7 +360,7 @@ return def ActionQItemPressed (action): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () #quick slot GemRB.UseItem(pc, -2, action) return @@ -392,23 +392,23 @@ return def SpellPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) - Spell = GemRB.GetVar("Spell") - Type = GemRB.GetVar("Type") - GemRB.SpellCast(pc, Type, Spell) + Spell = GemRB.GetVar ("Spell") + Type = GemRB.GetVar ("Type") + GemRB.SpellCast (pc, Type, Spell) GemRB.SetVar ("ActionLevel", 0) UpdateActionsWindow () return def EquipmentPressed (): - pc = GemRB.GameGetFirstSelectedPC() + pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) - Item = GemRB.GetVar("Equipment") + Item = GemRB.GetVar ("Equipment") #equipment index - GemRB.UseItem(pc, -1, Item) + GemRB.UseItem (pc, -1, Item) GemRB.SetVar ("ActionLevel", 0) UpdateActionsWindow () return @@ -537,7 +537,7 @@ if hp<1 or (state & STATE_DEAD): GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 64,64,64,200, 64,64,64,200) else: - GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 255,0,0,200, 128,0,0,64) + GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 255,0,0,200, 128,0,0,200) #GemRB.SetText (Window, Button, "%d/%d" %(hp, hp_max)) GemRB.SetTooltip (Window, Button, GemRB.GetPlayerName (i+1, 1) + "\n%d/%d" %(hp, hp_max)) @@ -545,8 +545,8 @@ GemRB.EnableButtonBorder (Window, Button, FRAME_PC_SELECTED, 1) else: GemRB.EnableButtonBorder (Window, Button, FRAME_PC_SELECTED, 0) + return - def PortraitButtonOnPress (): i = GemRB.GetVar ("PressedPortrait") @@ -556,8 +556,8 @@ GemRB.GameSelectPCSingle (i + 1) SelectionChanged () RunSelectionChangeHandler () + return - def PortraitButtonOnShiftPress (): i = GemRB.GetVar ("PressedPortrait") @@ -569,12 +569,12 @@ GemRB.GameSelectPCSingle (i + 1) SelectionChanged () RunSelectionChangeHandler () + return - def SelectAllOnPress (): GemRB.GameSelectPC (0, 1) + return - # Run by Game class when selection was changed def SelectionChanged (): global PortraitWindow @@ -598,11 +598,13 @@ if GemRB.IsDraggingItem (): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 1) + return def PortraitButtonOnMouseLeave (): i = GemRB.GetVar ("PressedPortrait") Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 0) + return def GetSavingThrow (SaveName, row, level): SaveTable = GemRB.LoadTable (SaveName) @@ -619,8 +621,17 @@ level2 = 20 Class = GemRB.GetPlayerStat (pc, IE_CLASS) ClassTable = GemRB.LoadTable ("classes") + + Race = GemRB.GetPlayerStat (pc, IE_RACE) + RaceTable = GemRB.LoadTable ("races") + Class = GemRB.FindTableValue (ClassTable, 5, Class) - Multi = GemRB.GetTableValue (ClassTable, 4, Class) + Multi = GemRB.GetTableValue (ClassTable, Class, 4) + + Race = GemRB.FindTableValue (RaceTable, 3, Race) + RaceSaveTableName = GemRB.GetTableValue (RaceTable, Race, 4) + + #todo fix multi class if Multi: if Class == 7: #fighter/mage @@ -640,6 +651,14 @@ if tmp2<tmp1: tmp1=tmp2 GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) + if RaceSaveTableName!="*": + Con = GemRB.GetPlayerStat (pc, IE_CON) + RaceSaveTable = GemRB.LoadTable (RaceSaveTableName) + for row in range (5): + tmp1 = GemRB.GetPlayerStat (pc, IE_SAVEVSDEATH+row) + tmp1 += GemRB.GetTableValue (RaceSaveTable, row, Con) + GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) + GemRB.UnloadTable (RaceSaveTable) return def SetEncumbranceLabels (Window, Label, Label2, pc): Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-05-26 21:41:00 UTC (rev 4667) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-05-28 09:17:07 UTC (rev 4668) @@ -515,7 +515,6 @@ 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.SetButtonState (Window, Button, IE_GUI_BUTTON_ENABLED) GemRB.SetButtonFont (Window, Button, 'NUMFONT') @@ -529,7 +528,7 @@ if hp<1 or (state & STATE_DEAD): GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 64,64,64,200, 64,64,64,200) else: - GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 255,0,0,200, 128,0,0,64) + GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 255,0,0,200, 128,0,0,200) #GemRB.SetText (Window, Button, "%d/%d" %(hp, hp_max)) GemRB.SetTooltip (Window, Button, GemRB.GetPlayerName (i+1, 1) + "\n%d/%d" %(hp, hp_max)) @@ -537,8 +536,8 @@ GemRB.EnableButtonBorder (Window, Button, FRAME_PC_SELECTED, 1) else: GemRB.EnableButtonBorder (Window, Button, FRAME_PC_SELECTED, 0) + return - def PortraitButtonOnPress (): i = GemRB.GetVar ("PressedPortrait") @@ -548,8 +547,8 @@ GemRB.GameSelectPCSingle (i + 1) SelectionChanged () RunSelectionChangeHandler () + return - def PortraitButtonOnShiftPress (): i = GemRB.GetVar ("PressedPortrait") @@ -561,12 +560,12 @@ GemRB.GameSelectPCSingle (i + 1) SelectionChanged () RunSelectionChangeHandler () + return - def SelectAllOnPress (): GemRB.GameSelectPC (0, 1) + return - # Run by Game class when selection was changed def SelectionChanged (): global PortraitWindow @@ -590,11 +589,13 @@ if GemRB.IsDraggingItem (): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 1) + return def PortraitButtonOnMouseLeave (): i = GemRB.GetVar ("PressedPortrait") Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 0) + return def GetSavingThrow (SaveName, row, level): SaveTable = GemRB.LoadTable (SaveName) @@ -611,8 +612,17 @@ level2 = 20 Class = GemRB.GetPlayerStat (pc, IE_CLASS) ClassTable = GemRB.LoadTable ("classes") + + Race = GemRB.GetPlayerStat (pc, IE_RACE) + RaceTable = GemRB.LoadTable ("races") + Class = GemRB.FindTableValue (ClassTable, 5, Class) - Multi = GemRB.GetTableValue (ClassTable, 4, Class) + Multi = GemRB.GetTableValue (ClassTable, Class, 4) + + Race = GemRB.FindTableValue (RaceTable, 3, Race) + RaceSaveTableName = GemRB.GetTableValue (RaceTable, Race, 4) + + #todo fix multi class if Multi: if Class == 7: #fighter/mage @@ -632,6 +642,14 @@ if tmp2<tmp1: tmp1=tmp2 GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) + if RaceSaveTableName!="*": + Con = GemRB.GetPlayerStat (pc, IE_CON) + RaceSaveTable = GemRB.LoadTable (RaceSaveTableName) + for row in range (5): + tmp1 = GemRB.GetPlayerStat (pc, IE_SAVEVSDEATH+row) + tmp1 += GemRB.GetTableValue (RaceSaveTable, row, Con) + GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) + GemRB.UnloadTable (RaceSaveTable) return def SetEncumbranceLabels (Window, Label, Label2, pc): Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-05-26 21:41:00 UTC (rev 4667) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-05-28 09:17:07 UTC (rev 4668) @@ -255,10 +255,10 @@ elif level == 1: GemRB.SetupEquipmentIcons(ActionsWindow, pc, TopIndex) elif level == 2: #spells - GemRB.SetVar("Type", 3) + GemRB.SetVar ("Type", 3) GemRB.SetupSpellIcons(ActionsWindow, pc, 3, TopIndex) elif level == 3: #innates - GemRB.SetVar("Type", 4) + GemRB.SetVar ("Type", 4) GemRB.SetupSpellIcons(ActionsWindow, pc, 4, TopIndex) return @@ -405,9 +405,9 @@ pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) - Spell = GemRB.GetVar("Spell") - Type = GemRB.GetVar("Type") - GemRB.SpellCast(pc, Type, Spell) + Spell = GemRB.GetVar ("Spell") + Type = GemRB.GetVar ("Type") + GemRB.SpellCast (pc, Type, Spell) GemRB.SetVar ("ActionLevel", 0) UpdateActionsWindow () return @@ -416,9 +416,9 @@ pc = GemRB.GameGetFirstSelectedPC () GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) - Item = GemRB.GetVar("Equipment") + Item = GemRB.GetVar ("Equipment") #equipment index - GemRB.UseItem(pc, -1, Item) + GemRB.UseItem (pc, -1, Item) GemRB.SetVar ("ActionLevel", 0) UpdateActionsWindow () return @@ -565,11 +565,10 @@ hp_max = GemRB.GetPlayerStat (i+1, IE_MAXHITPOINTS) state = GemRB.GetPlayerStat (i+1, IE_STATE_ID) - print i, ": ",state,", ", hp if hp<1 or (state & STATE_DEAD): GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 64,64,64,200, 64,64,64,200) else: - GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 255,0,0,200, 128,0,0,64) + GemRB.SetButtonOverlay (Window, Button, hp_max, hp, 255,0,0,200, 128,0,0,200) #GemRB.SetText (Window, Button, "%d/%d" %(hp, hp_max)) GemRB.SetTooltip (Window, Button, GemRB.GetPlayerName (i+1, 1) + "\n%d/%d" %(hp, hp_max)) @@ -625,11 +624,13 @@ if GemRB.IsDraggingItem (): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 1) + return def PortraitButtonOnMouseLeave (): i = GemRB.GetVar ("PressedPortrait") Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 0) + return def GetSavingThrow (SaveName, row, level): SaveTable = GemRB.LoadTable (SaveName) @@ -646,8 +647,17 @@ level2 = 20 Class = GemRB.GetPlayerStat (pc, IE_CLASS) ClassTable = GemRB.LoadTable ("classes") + + Race = GemRB.GetPlayerStat (pc, IE_RACE) + RaceTable = GemRB.LoadTable ("races") + Class = GemRB.FindTableValue (ClassTable, 5, Class) - Multi = GemRB.GetTableValue (ClassTable, 4, Class) + Multi = GemRB.GetTableValue (ClassTable, Class, 4) + + Race = GemRB.FindTableValue (RaceTable, 3, Race) + RaceSaveTableName = GemRB.GetTableValue (RaceTable, Race, 4) + + #todo fix multi class if Multi: if Class == 7: #fighter/mage @@ -667,6 +677,14 @@ if tmp2<tmp1: tmp1=tmp2 GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) + if RaceSaveTableName!="*": + Con = GemRB.GetPlayerStat (pc, IE_CON) + RaceSaveTable = GemRB.LoadTable (RaceSaveTableName) + for row in range (5): + tmp1 = GemRB.GetPlayerStat (pc, IE_SAVEVSDEATH+row) + tmp1 += GemRB.GetTableValue (RaceSaveTable, row, Con) + GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) + GemRB.UnloadTable (RaceSaveTable) return def SetEncumbranceLabels (Window, Label, Label2, pc): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-05-28 14:48:44
|
Revision: 4673 http://gemrb.svn.sourceforge.net/gemrb/?rev=4673&view=rev Author: avenger_teambg Date: 2007-05-28 07:48:44 -0700 (Mon, 28 May 2007) Log Message: ----------- fixed clicking on equipped weapon (should switch to attack mode) Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-05-28 13:53:41 UTC (rev 4672) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-05-28 14:48:44 UTC (rev 4673) @@ -261,7 +261,7 @@ def ActionQWeaponPressed (which): pc = GemRB.GameGetFirstSelectedPC () - if GemRB.GetEquippedQuickSlot (pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): + if GemRB.GetEquippedQuickSlot (pc,1)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) else: GemRB.GameControlSetTargetMode (TARGET_MODE_ALL) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-05-28 13:53:41 UTC (rev 4672) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-05-28 14:48:44 UTC (rev 4673) @@ -277,7 +277,7 @@ def ActionQWeaponPressed (which): pc = GemRB.GameGetFirstSelectedPC () - if GemRB.GetEquippedQuickSlot (pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): + if GemRB.GetEquippedQuickSlot (pc,1)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) else: GemRB.GameControlSetTargetMode (TARGET_MODE_ALL) Modified: gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-05-28 13:53:41 UTC (rev 4672) +++ gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-05-28 14:48:44 UTC (rev 4673) @@ -267,7 +267,7 @@ def ActionQWeaponPressed (which): pc = GemRB.GameGetFirstSelectedPC () - if GemRB.GetEquippedQuickSlot (pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): + if GemRB.GetEquippedQuickSlot (pc,1)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) else: GemRB.GameControlSetTargetMode (TARGET_MODE_ALL) Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-05-28 13:53:41 UTC (rev 4672) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-05-28 14:48:44 UTC (rev 4673) @@ -265,7 +265,7 @@ def ActionQWeaponPressed (which): pc = GemRB.GameGetFirstSelectedPC () - if GemRB.GetEquippedQuickSlot (pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): + if GemRB.GetEquippedQuickSlot (pc,1)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) else: GemRB.GameControlSetTargetMode (TARGET_MODE_ALL) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-05-28 13:53:41 UTC (rev 4672) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-05-28 14:48:44 UTC (rev 4673) @@ -277,7 +277,7 @@ def ActionQWeaponPressed (which): pc = GemRB.GameGetFirstSelectedPC () - if GemRB.GetEquippedQuickSlot (pc)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): + if GemRB.GetEquippedQuickSlot (pc,1)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) else: GemRB.GameControlSetTargetMode (TARGET_MODE_ALL) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-06-03 14:01:39
|
Revision: 4680 http://gemrb.svn.sourceforge.net/gemrb/?rev=4680&view=rev Author: avenger_teambg Date: 2007-06-03 07:01:40 -0700 (Sun, 03 Jun 2007) Log Message: ----------- fixed pst portrait window (stunned should draw the petrified portrait) Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/ie_stats.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/ie_stats.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/ie_stats.py 2007-06-03 14:00:21 UTC (rev 4679) +++ gemrb/trunk/gemrb/GUIScripts/ie_stats.py 2007-06-03 14:01:40 UTC (rev 4680) @@ -43,8 +43,8 @@ # state bits (IE_STATE) STATE_PANIC = 4 -STATE_HELPLESS = 1+ 8 + 32 -STATE_PETRIFIED = 64 + 128 +STATE_HELPLESS = 1 + 32 +STATE_PETRIFIED = 8 + 64 + 128 STATE_DEAD = 2048 STATE_POISONED = 0x4000 Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-06-03 14:00:21 UTC (rev 4679) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-06-03 14:01:40 UTC (rev 4680) @@ -508,9 +508,6 @@ GemRB.SetTooltip (Window, Button, 10485) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SelectAllOnPress") - pc = GemRB.GameGetSelectedPCSingle () - Inventory = GemRB.GetVar ("Inventory") - for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) GemRB.SetVarAssoc (Window, Button, "PressedPortrait", i) @@ -525,12 +522,6 @@ GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_ENTER_BUTTON, "PortraitButtonOnMouseEnter") GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_LEAVE_BUTTON, "PortraitButtonOnMouseLeave") - if Inventory and pc !=i+1: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) - GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) - GemRB.SetText (Window, Button, "") - GemRB.SetTooltip (Window, Button, "") - GemRB.SetButtonBorder (Window, Button, FRAME_PC_SELECTED, 1, 1, 2, 2, 0, 255, 0, 255) GemRB.SetButtonBorder (Window, Button, FRAME_PC_TARGET, 3, 3, 4, 4, 255, 255, 0, 255) @@ -558,6 +549,7 @@ continue GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_ALIGN_BOTTOM|IE_GUI_BUTTON_ALIGN_LEFT, OP_SET) + #GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_LOCKED) GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_ENABLED) GemRB.SetButtonPicture (Window, Button, pic, "NOPORTSM") hp = GemRB.GetPlayerStat (i+1, IE_HITPOINTS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-08-11 22:45:42
|
Revision: 4762 http://gemrb.svn.sourceforge.net/gemrb/?rev=4762&view=rev Author: avenger_teambg Date: 2007-08-11 15:45:43 -0700 (Sat, 11 Aug 2007) Log Message: ----------- updated scripts Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py gemrb/trunk/gemrb/GUIScripts/iwd2/GUIREC.py gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py 2007-08-11 21:57:45 UTC (rev 4761) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py 2007-08-11 22:45:43 UTC (rev 4762) @@ -121,7 +121,14 @@ GemRB.SetVisible (PortraitWindow, 1) return +def GetNextLevelExp (Level, Class): + NextLevelTable = GemRB.LoadTable ("XPLEVEL") + if Level < GemRB.GetTableColumnCount (NextLevelTable, Class): + return str(GemRB.GetTableValue (NextLevelTable, Class, Level) ) + + return 0; + def UpdateRecordsWindow (): global stats_overview, alignment_help @@ -223,13 +230,6 @@ else: GemRB.SetText (Window, Label, 7199) - #collecting tokens for stat overview - ClassTitle = GemRB.GetString (GetActorClassTitle (pc) ) - - GemRB.SetToken("CLASS", ClassTitle) - GemRB.SetToken("LEVEL", str (GemRB.GetPlayerStat (pc, IE_LEVEL) ) ) - GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP) ) ) - # help, info textarea stats_overview = GetStatOverview (pc) Text = GemRB.GetControl (Window, 45) @@ -254,17 +254,29 @@ # Experience: <EXPERIENCE> # Next Level: <NEXTLEVEL> - Main = GemRB.GetString (16480) - stats.append (None) + #todo: multiclasses + #collecting tokens for stat overview + Class = 0 + ClassTitle = GemRB.GetString (GetActorClassTitle (pc) ) + GemRB.SetToken("CLASS", ClassTitle) + Level = GemRB.GetPlayerStat (pc, IE_LEVEL) + GemRB.SetToken("LEVEL", str (Level) ) + GemRB.SetToken("NEXTLEVEL", GetNextLevelExp (Level, Class) ) + GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP) ) ) + stats.append ( (16480,1,'c') ) + effects = GemRB.GetPlayerStates (pc) - for c in effects: - tmp = GemRB.GetTableValue (StateTable, ord(c)-65, 0) - print c, GemRB.GetString(tmp) - stats.append (tmp) + if len(effects): + stats.append (None) + for c in effects: + tmp = GemRB.GetTableValue (StateTable, ord(c)-66, 0) + print c, GemRB.GetString(tmp) + stats.append ( (tmp,c,'a') ) stats.append (None) - stats.append (8442) + stats.append ( (8442,1,'c') ) + stats.append ( (61932, GS (IE_THAC0), '') ) stats.append ( (9457, GS (IE_THAC0), '') ) tmp = GS (IE_NUMBEROFATTACKS) @@ -395,6 +407,10 @@ res.append (GemRB.GetString (strref) + ' '+ '+' * val) elif type == 'x': res.append (GemRB.GetString (strref)+': x' + str (val) ) + elif type == 'a': + res.append ("[capital=2]"+val+" "+GemRB.GetString (strref)+"[/capital]") + elif type == 'c': + res.append ("[capital=0]"+GemRB.GetString (strref) ) else: res.append (GemRB.GetString (strref) + ': ' + str (val) + type) lines = 1 @@ -408,7 +424,7 @@ res.append ("") lines = 0 - return Main + string.join (res, "\n") + return string.join (res, "\n") def GetReputation (repvalue): Modified: gemrb/trunk/gemrb/GUIScripts/iwd2/GUIREC.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd2/GUIREC.py 2007-08-11 21:57:45 UTC (rev 4761) +++ gemrb/trunk/gemrb/GUIScripts/iwd2/GUIREC.py 2007-08-11 22:45:43 UTC (rev 4762) @@ -280,9 +280,7 @@ GemRB.TextAreaAppend (Window, RecordsTextArea, "[/color][/capital][capital=2]") StateTable = GemRB.LoadTable ("statdesc") for c in effects: - print "State:",c tmp = GemRB.GetTableValue (StateTable, ord(c)-66, 0) - print tmp GemRB.TextAreaAppend (Window, RecordsTextArea, c+" ", -1) GemRB.TextAreaAppend (Window, RecordsTextArea, tmp) GemRB.UnloadTable (StateTable) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py 2007-08-11 21:57:45 UTC (rev 4761) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py 2007-08-11 22:45:43 UTC (rev 4762) @@ -121,7 +121,14 @@ GemRB.SetVisible (PortraitWindow, 1) return +def GetNextLevelExp (Level, Class): + NextLevelTable = GemRB.LoadTable ("XPLEVEL") + if Level < GemRB.GetTableColumnCount (NextLevelTable, Class): + return str(GemRB.GetTableValue (NextLevelTable, Class, Level) ) + + return 0; + def UpdateRecordsWindow (): global stats_overview, alignment_help @@ -223,13 +230,6 @@ else: GemRB.SetText (Window, Label, 7199) - #collecting tokens for stat overview - ClassTitle = GemRB.GetString (GetActorClassTitle (pc) ) - - GemRB.SetToken("CLASS", ClassTitle) - GemRB.SetToken("LEVEL", str (GemRB.GetPlayerStat (pc, IE_LEVEL) ) ) - GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP) ) ) - # help, info textarea stats_overview = GetStatOverview (pc) Text = GemRB.GetControl (Window, 45) @@ -254,17 +254,29 @@ # Experience: <EXPERIENCE> # Next Level: <NEXTLEVEL> - Main = GemRB.GetString (16480) - stats.append (None) + #todo: multiclasses + #collecting tokens for stat overview + Class = 0 + ClassTitle = GemRB.GetString (GetActorClassTitle (pc) ) + GemRB.SetToken("CLASS", ClassTitle) + Level = GemRB.GetPlayerStat (pc, IE_LEVEL) + GemRB.SetToken("LEVEL", str (Level) ) + GemRB.SetToken("NEXTLEVEL", GetNextLevelExp (Level, Class) ) + GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP) ) ) + stats.append ( (16480,1,'c') ) + effects = GemRB.GetPlayerStates (pc) - for c in effects: - tmp = GemRB.GetTableValue (StateTable, ord(c)-65, 0) - print c, GemRB.GetString(tmp) - stats.append (tmp) + if len(effects): + stats.append (None) + for c in effects: + tmp = GemRB.GetTableValue (StateTable, ord(c)-66, 0) + print c, GemRB.GetString(tmp) + stats.append ( (tmp,c,'a') ) stats.append (None) - stats.append (8442) + stats.append ( (8442,1,'c') ) + stats.append ( (61932, GS (IE_THAC0), '') ) stats.append ( (9457, GS (IE_THAC0), '') ) tmp = GS (IE_NUMBEROFATTACKS) @@ -395,6 +407,10 @@ res.append (GemRB.GetString (strref) + ' '+ '+' * val) elif type == 'x': res.append (GemRB.GetString (strref)+': x' + str (val) ) + elif type == 'a': + res.append ("[capital=2]"+val+" "+GemRB.GetString (strref)+"[/capital]") + elif type == 'c': + res.append ("[capital=0]"+GemRB.GetString (strref) ) else: res.append (GemRB.GetString (strref) + ': ' + str (val) + type) lines = 1 @@ -408,7 +424,7 @@ res.append ("") lines = 0 - return Main + string.join (res, "\n") + return string.join (res, "\n") def GetReputation (repvalue): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-08-13 22:06:56
|
Revision: 4766 http://gemrb.svn.sourceforge.net/gemrb/?rev=4766&view=rev Author: avenger_teambg Date: 2007-08-13 15:06:50 -0700 (Mon, 13 Aug 2007) Log Message: ----------- bg: improved multi class listing Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUIREC.py gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUIREC.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUIREC.py 2007-08-12 19:52:41 UTC (rev 4765) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUIREC.py 2007-08-13 22:06:50 UTC (rev 4766) @@ -42,15 +42,15 @@ if CloseOtherWindow (OpenRecordsWindow): if InformationWindow: OpenInformationWindow () - + GemRB.HideGUI () GemRB.UnloadWindow (RecordsWindow) RecordsWindow = None GemRB.SetVar ("OtherWindow", -1) SetSelectionChangeHandler (None) - + GemRB.UnhideGUI () - return + return GemRB.HideGUI () GemRB.LoadWindowPack ("GUIREC") @@ -108,14 +108,14 @@ def UpdateRecordsWindow (): global stats_overview, alignment_help - + Window = RecordsWindow if not RecordsWindow: print "SelectionChange handler points to non existing window\n" return pc = GemRB.GameGetSelectedPCSingle () - + # exportable Button = GemRB.GetControl (Window, 36) if GemRB.GetPlayerStat (pc, IE_MC_FLAGS)&MC_EXPORTABLE: @@ -190,7 +190,7 @@ Table = GemRB.LoadTable ("races") text = GemRB.GetTableValue (Table, GemRB.GetPlayerStat (pc, IE_RACE) - 1, 0) GemRB.UnloadTable (Table) - + Label = GemRB.GetControl (Window, 0x1000000f) GemRB.SetText (Window, Label, text) @@ -219,7 +219,6 @@ stats = [] # class levels - #todo: multiclasses # 16480 <CLASS>: Level <LEVEL> # Experience: <EXPERIENCE> # Next Level: <NEXTLEVEL> @@ -236,7 +235,7 @@ Levels = [IE_LEVEL, IE_LEVEL2, IE_LEVEL3] Classes = [0,0,0] MultiCount = 0 - stats.append ( (11993,1,'c') ) + stats.append ( (19721,1,'c') ) Mask = 1 for i in range (16): if Multi&Mask: @@ -366,7 +365,7 @@ count = GemRB.GetMemorizableSpellsCount (pc, IE_SPELL_TYPE_PRIEST, level) stats.append ( (GemRB.GetString(10345), count-base, 'b') ) stats.append (None) - + res = [] lines = 0 for s in stats: @@ -410,16 +409,16 @@ def OpenInformationWindow (): global InformationWindow - + GemRB.HideGUI () - + if InformationWindow != None: if BiographyWindow: OpenBiographyWindow () GemRB.UnloadWindow (InformationWindow) InformationWindow = None GemRB.SetVar ("FloatWindow", -1) - + GemRB.UnhideGUI() return @@ -445,12 +444,12 @@ global BiographyWindow GemRB.HideGUI () - + if BiographyWindow != None: GemRB.UnloadWindow (BiographyWindow) BiographyWindow = None GemRB.SetVar ("FloatWindow", InformationWindow) - + GemRB.UnhideGUI() GemRB.ShowModal (InformationWindow, MODAL_SHADOW_GRAY) return @@ -461,7 +460,6 @@ TextArea = GemRB.GetControl (Window, 0) GemRB.SetText (Window, TextArea, 39424) - # Done Button = GemRB.GetControl (Window, 2) GemRB.SetText (Window, Button, 11973) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py 2007-08-12 19:52:41 UTC (rev 4765) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py 2007-08-13 22:06:50 UTC (rev 4766) @@ -49,7 +49,7 @@ if CloseOtherWindow (OpenRecordsWindow): if InformationWindow: OpenInformationWindow () - + GemRB.UnloadWindow (RecordsWindow) GemRB.UnloadWindow (OptionsWindow) GemRB.UnloadWindow (PortraitWindow) @@ -123,10 +123,10 @@ def GetNextLevelExp (Level, Class): NextLevelTable = GemRB.LoadTable ("XPLEVEL") + Row = GemRB.GetTableRowIndex (NextLevelTable, Class) + if Level < GemRB.GetTableColumnCount (NextLevelTable, Row): + return str(GemRB.GetTableValue (NextLevelTable, Row, Level) ) - if Level < GemRB.GetTableColumnCount (NextLevelTable, Class): - return str(GemRB.GetTableValue (NextLevelTable, Class, Level) ) - return 0; def UpdateRecordsWindow (): @@ -243,33 +243,64 @@ str_None = GemRB.GetString (61560) GS = lambda s, pc=pc: GemRB.GetPlayerStat (pc, s) - GA = lambda s, col, pc=pc: GemRB.GetAbilityBonus (s, col, GS (s) ) + GA = lambda s, col, pc=pc: GemRB.GetAbilityBonus (s, col, GS (s) ) stats = [] + # class levels # 16480 <CLASS>: Level <LEVEL> # Experience: <EXPERIENCE> # Next Level: <NEXTLEVEL> - #todo: multiclasses #collecting tokens for stat overview - Class = 0 ClassTitle = GemRB.GetString (GetActorClassTitle (pc) ) - GemRB.SetToken("CLASS", ClassTitle) - Level = GemRB.GetPlayerStat (pc, IE_LEVEL) - GemRB.SetToken("LEVEL", str (Level) ) - GemRB.SetToken("NEXTLEVEL", GetNextLevelExp (Level, Class) ) - GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP) ) ) - stats.append ( (16480,1,'c') ) + Class = GemRB.GetPlayerStat (pc, IE_CLASS) + ClassTable = GemRB.LoadTable ("classes") + Class = GemRB.FindTableValue (ClassTable, 5, Class) + Multi = GemRB.GetTableValue (ClassTable, Class, 4) + Class = GemRB.GetTableRowName (ClassTable, Class) + if Multi: + Levels = [IE_LEVEL, IE_LEVEL2, IE_LEVEL3] + Classes = [0,0,0] + MultiCount = 0 + stats.append ( (19721,1,'c') ) + Mask = 1 + for i in range (16): + if Multi&Mask: + Classes[MultiCount] = GemRB.FindTableValue (ClassTable, 5, i+1) + MultiCount += 1 + Mask += Mask + for i in range (MultiCount): + #todo get classtitle for this class + Class = Classes[i] + ClassTitle = GemRB.GetString(GemRB.GetTableValue (ClassTable, Class, 2)) + GemRB.SetToken("CLASS", ClassTitle) + Class = GemRB.GetTableRowName (ClassTable, i) + Level = GemRB.GetPlayerStat (pc, Levels[i]) + GemRB.SetToken("LEVEL", str (Level) ) + GemRB.SetToken("NEXTLEVEL", GetNextLevelExp (Level, Class) ) + GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP)/MultiCount ) ) + #resolve string immediately + stats.append ( (GemRB.GetString(16480),"",'b') ) + stats.append (None) + + else: + Level = GemRB.GetPlayerStat (pc, IE_LEVEL) + GemRB.SetToken("LEVEL", str (Level) ) + GemRB.SetToken("NEXTLEVEL", GetNextLevelExp (Level, Class) ) + GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP) ) ) + stats.append ( (16480,1,'c') ) + stats.append (None) + GemRB.UnloadTable (ClassTable) + effects = GemRB.GetPlayerStates (pc) if len(effects): - stats.append (None) for c in effects: tmp = GemRB.GetTableValue (StateTable, ord(c)-66, 0) stats.append ( (tmp,c,'a') ) + stats.append (None) - stats.append (None) stats.append ( (8442,1,'c') ) stats.append ( (61932, GS (IE_THAC0), '') ) @@ -303,7 +334,7 @@ stats.append (17379) # 17380 Death stats.append ( (17380, GS (IE_SAVEVSDEATH), '') ) - # 17381 + # 17381 stats.append ( (17381, GS (IE_SAVEVSWANDS), '') ) # 17382 AC vs. Crushing stats.append ( (17382, GS (IE_SAVEVSPOLY), '') ) @@ -461,7 +492,7 @@ GemRB.SetVisible (RecordsWindow, 3) GemRB.SetVisible (PortraitWindow, 3) InformationWindow = None - + return InformationWindow = Window = GemRB.LoadWindow (4) @@ -534,7 +565,7 @@ #are they used? GemRB.SetText (Window, Label, stat['FavouriteWeapon']) - #total xp + #total xp Label = GemRB.GetControl (Window, 0x1000000f) if TotalPartyExp != 0: PartyExp = int ((stat['KillsTotalXP'] * 100) / TotalPartyExp) @@ -549,7 +580,7 @@ else: GemRB.SetText (Window, Label, "0%") - #total xp + #total xp Label = GemRB.GetControl (Window, 0x10000010) if TotalCount != 0: PartyExp = int ((stat['KillsTotalCount'] * 100) / TotalCount) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py 2007-08-12 19:52:41 UTC (rev 4765) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py 2007-08-13 22:06:50 UTC (rev 4766) @@ -49,7 +49,7 @@ if CloseOtherWindow (OpenRecordsWindow): if InformationWindow: OpenInformationWindow () - + GemRB.UnloadWindow (RecordsWindow) GemRB.UnloadWindow (OptionsWindow) GemRB.UnloadWindow (PortraitWindow) @@ -243,43 +243,64 @@ str_None = GemRB.GetString (61560) GS = lambda s, pc=pc: GemRB.GetPlayerStat (pc, s) - GA = lambda s, col, pc=pc: GemRB.GetAbilityBonus (s, col, GS (s) ) + GA = lambda s, col, pc=pc: GemRB.GetAbilityBonus (s, col, GS (s) ) stats = [] + # class levels # 16480 <CLASS>: Level <LEVEL> # Experience: <EXPERIENCE> # Next Level: <NEXTLEVEL> - #todo: multiclasses #collecting tokens for stat overview - Class = 0 ClassTitle = GemRB.GetString (GetActorClassTitle (pc) ) - GemRB.SetToken("CLASS", ClassTitle) - Level = GemRB.GetPlayerStat (pc, IE_LEVEL) - GemRB.SetToken("LEVEL", str (Level) ) - Class = GemRB.GetPlayerStat (pc, IE_CLASS) - print "L:",Level, "class: ", Class - ClassTable = GemRB.LoadTable ("classes") - Class = GemRB.FindTableValue (ClassTable, 5, Class) - print "Row: ", Class - Multi = GemRB.GetTableValue (ClassTable, Class, 4) - print "Multi: ", Multi - Class = GemRB.GetTableRowName (ClassTable, Class) - print "Class name: ", Class - GemRB.UnloadTable (ClassTable) - GemRB.SetToken("NEXTLEVEL", GetNextLevelExp (Level, Class) ) - GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP) ) ) - stats.append ( (16480,1,'c') ) + Class = GemRB.GetPlayerStat (pc, IE_CLASS) + ClassTable = GemRB.LoadTable ("classes") + Class = GemRB.FindTableValue (ClassTable, 5, Class) + Multi = GemRB.GetTableValue (ClassTable, Class, 4) + Class = GemRB.GetTableRowName (ClassTable, Class) + if Multi: + Levels = [IE_LEVEL, IE_LEVEL2, IE_LEVEL3] + Classes = [0,0,0] + MultiCount = 0 + stats.append ( (19721,1,'c') ) + Mask = 1 + for i in range (16): + if Multi&Mask: + Classes[MultiCount] = GemRB.FindTableValue (ClassTable, 5, i+1) + MultiCount += 1 + Mask += Mask + for i in range (MultiCount): + #todo get classtitle for this class + Class = Classes[i] + ClassTitle = GemRB.GetString(GemRB.GetTableValue (ClassTable, Class, 2)) + GemRB.SetToken("CLASS", ClassTitle) + Class = GemRB.GetTableRowName (ClassTable, i) + Level = GemRB.GetPlayerStat (pc, Levels[i]) + GemRB.SetToken("LEVEL", str (Level) ) + GemRB.SetToken("NEXTLEVEL", GetNextLevelExp (Level, Class) ) + GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP)/MultiCount ) ) + #resolve string immediately + stats.append ( (GemRB.GetString(16480),"",'b') ) + stats.append (None) + + else: + Level = GemRB.GetPlayerStat (pc, IE_LEVEL) + GemRB.SetToken("LEVEL", str (Level) ) + GemRB.SetToken("NEXTLEVEL", GetNextLevelExp (Level, Class) ) + GemRB.SetToken("EXPERIENCE", str (GemRB.GetPlayerStat (pc, IE_XP) ) ) + stats.append ( (16480,1,'c') ) + stats.append (None) + GemRB.UnloadTable (ClassTable) + effects = GemRB.GetPlayerStates (pc) if len(effects): - stats.append (None) for c in effects: tmp = GemRB.GetTableValue (StateTable, ord(c)-66, 0) stats.append ( (tmp,c,'a') ) + stats.append (None) - stats.append (None) stats.append ( (8442,1,'c') ) stats.append ( (61932, GS (IE_THAC0), '') ) @@ -313,7 +334,7 @@ stats.append (17379) # 17380 Death stats.append ( (17380, GS (IE_SAVEVSDEATH), '') ) - # 17381 + # 17381 stats.append ( (17381, GS (IE_SAVEVSWANDS), '') ) # 17382 AC vs. Crushing stats.append ( (17382, GS (IE_SAVEVSPOLY), '') ) @@ -471,7 +492,7 @@ GemRB.SetVisible (RecordsWindow, 3) GemRB.SetVisible (PortraitWindow, 3) InformationWindow = None - + return InformationWindow = Window = GemRB.LoadWindow (4) @@ -544,7 +565,7 @@ #are they used? GemRB.SetText (Window, Label, stat['FavouriteWeapon']) - #total xp + #total xp Label = GemRB.GetControl (Window, 0x1000000f) if TotalPartyExp != 0: PartyExp = int ((stat['KillsTotalXP'] * 100) / TotalPartyExp) @@ -559,7 +580,7 @@ else: GemRB.SetText (Window, Label, "0%") - #total xp + #total xp Label = GemRB.GetControl (Window, 0x10000010) if TotalCount != 0: PartyExp = int ((stat['KillsTotalCount'] * 100) / TotalCount) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-09-02 15:52:54
|
Revision: 4794 http://gemrb.svn.sourceforge.net/gemrb/?rev=4794&view=rev Author: avenger_teambg Date: 2007-09-02 08:52:47 -0700 (Sun, 02 Sep 2007) Log Message: ----------- guiinv: display correct text when inventory is full and passing items between PCs Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUIINV.py gemrb/trunk/gemrb/GUIScripts/bg2/GUIINV.py gemrb/trunk/gemrb/GUIScripts/how/GUIINV.py gemrb/trunk/gemrb/GUIScripts/iwd/GUIINV.py gemrb/trunk/gemrb/GUIScripts/iwd2/GUIINV.py gemrb/trunk/gemrb/GUIScripts/tob/GUIINV.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUIINV.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUIINV.py 2007-08-30 20:07:47 UTC (rev 4793) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUIINV.py 2007-09-02 15:52:47 UTC (rev 4794) @@ -9,12 +9,12 @@ # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software -#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #$Id$ @@ -506,7 +506,7 @@ GemRB.DropDraggedItem (pc, -1) if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip + GemRB.PlaySound ("GAM_47") #failed equip UpdateInventoryWindow () return @@ -523,8 +523,6 @@ SlotType = GemRB.GetSlotType (slot, pc) if SlotType["ResRef"]!="": GemRB.DropDraggedItem (pc, slot) - if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip UpdateInventoryWindow () return @@ -535,7 +533,7 @@ #-3 : drop stuff in inventory (but not equippable slots) GemRB.DropDraggedItem (pc, -3) if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip + GemRB.DisplayString(17999,0xffffff) UpdateInventoryWindow () return Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIINV.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIINV.py 2007-08-30 20:07:47 UTC (rev 4793) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIINV.py 2007-09-02 15:52:47 UTC (rev 4794) @@ -9,12 +9,12 @@ # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software -#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #$Id$ @@ -52,7 +52,7 @@ def OpenInventoryWindow (): global InventoryWindow, OptionsWindow, PortraitWindow global OldPortraitWindow, OldOptionsWindow - + if CloseOtherWindow (OpenInventoryWindow): if GemRB.IsDraggingItem (): pc = GemRB.GameGetSelectedPCSingle () @@ -167,7 +167,7 @@ GemRB.SetButtonBorder (Window, Button, 1,2,2,5,5,32,32,255,0,0,0) GemRB.SetButtonBorder (Window, Button, 2,0,0,0,0,255,128,128,64,0,1) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_ALIGN_RIGHT | IE_GUI_BUTTON_ALIGN_TOP | IE_GUI_BUTTON_PICTURE, OP_OR) - + GemRB.SetVar ("TopIndex", 0) SetSelectionChangeHandler (UpdateInventoryWindow) UpdateInventoryWindow () @@ -289,7 +289,7 @@ item = GemRB.GetItem (slot_item["ItemResRef"]) if (item['AnimationType'] != ''): GemRB.SetButtonPLT(Window, Button, "WP" + size + item['AnimationType'] + "INV", Color1, Color2, Color3, Color4, Color5, Color6, Color7, 0, 1) - + #Shield slot_item = GemRB.GetSlotItem (pc, 3) if slot_item: @@ -367,7 +367,7 @@ GemRB.SetTooltip (Window, Button, item["ItemName"]) GemRB.EnableButtonBorder (Window, Button, 0, 1) GemRB.EnableButtonBorder (Window, Button, 1, 0) - + else: GemRB.SetTooltip (Window, Button, item["ItemNameIdentified"]) GemRB.EnableButtonBorder (Window, Button, 0, 0) @@ -509,7 +509,7 @@ GemRB.DropDraggedItem (pc, -1) if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip + GemRB.PlaySound ("GAM_47") #failed equip UpdateInventoryWindow () return @@ -533,8 +533,6 @@ if SlotType["ResRef"]!="": GemRB.DropDraggedItem (pc, slot) - if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip UpdateInventoryWindow () return @@ -545,7 +543,7 @@ #-3 : drop stuff in inventory (but not equippable slots) GemRB.DropDraggedItem (pc, -3) if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip + GemRB.DisplayString(17999,0xffffff) UpdateInventoryWindow () return Modified: gemrb/trunk/gemrb/GUIScripts/how/GUIINV.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUIINV.py 2007-08-30 20:07:47 UTC (rev 4793) +++ gemrb/trunk/gemrb/GUIScripts/how/GUIINV.py 2007-09-02 15:52:47 UTC (rev 4794) @@ -9,12 +9,12 @@ # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software -#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #$Id$ @@ -506,7 +506,7 @@ GemRB.DropDraggedItem (pc, -1) if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip + GemRB.PlaySound ("GAM_47") #failed equip UpdateInventoryWindow () return @@ -523,8 +523,6 @@ SlotType = GemRB.GetSlotType (slot, pc) if SlotType["ResRef"]!="": GemRB.DropDraggedItem (pc, slot) - if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip UpdateInventoryWindow () return @@ -535,7 +533,7 @@ #-3 : drop stuff in inventory (but not equippable slots) GemRB.DropDraggedItem (pc, -3) if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip + GemRB.DisplayString(17999,0xffffff) UpdateInventoryWindow () return Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUIINV.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUIINV.py 2007-08-30 20:07:47 UTC (rev 4793) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUIINV.py 2007-09-02 15:52:47 UTC (rev 4794) @@ -9,12 +9,12 @@ # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software -#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #$Id$ @@ -506,7 +506,7 @@ GemRB.DropDraggedItem (pc, -1) if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip + GemRB.PlaySound ("GAM_47") #failed equip UpdateInventoryWindow () return @@ -523,8 +523,6 @@ SlotType = GemRB.GetSlotType (slot, pc) if SlotType["ResRef"]!="": GemRB.DropDraggedItem (pc, slot) - if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip UpdateInventoryWindow () return @@ -535,7 +533,7 @@ #-3 : drop stuff in inventory (but not equippable slots) GemRB.DropDraggedItem (pc, -3) if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip + GemRB.DisplayString(17999,0xffffff) UpdateInventoryWindow () return Modified: gemrb/trunk/gemrb/GUIScripts/iwd2/GUIINV.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd2/GUIINV.py 2007-08-30 20:07:47 UTC (rev 4793) +++ gemrb/trunk/gemrb/GUIScripts/iwd2/GUIINV.py 2007-09-02 15:52:47 UTC (rev 4794) @@ -9,12 +9,12 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id$ @@ -443,7 +443,7 @@ GemRB.DropDraggedItem (pc, -1) if GemRB.IsDraggingItem (): - GemRB.PlaySound("GAM_47") #failed equip + GemRB.PlaySound("GAM_47") #failed equip UpdateInventoryWindow () return @@ -458,8 +458,6 @@ GemRB.DragItem (pc, slot, item["ItemIcon"], 0, 0) else: GemRB.DropDraggedItem (pc, slot) - if GemRB.IsDraggingItem (): - GemRB.PlaySound("GAM_47") #failed equip UpdateInventoryWindow () return @@ -469,7 +467,7 @@ GemRB.DropDraggedItem (pc, -3) if GemRB.IsDraggingItem (): - GemRB.PlaySound("GAM_47") #failed equip + GemRB.DisplayString(17999,0xffffff) UpdateInventoryWindow () return @@ -603,7 +601,7 @@ value = 0 else: value = 2 - DisplayItem(slot_item["ItemResRef"], value) #the ground items are only displayable + DisplayItem(slot_item["ItemResRef"], value) #the ground items are only displayable return Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIINV.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIINV.py 2007-08-30 20:07:47 UTC (rev 4793) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIINV.py 2007-09-02 15:52:47 UTC (rev 4794) @@ -9,12 +9,12 @@ # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software -#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # #$Id$ @@ -52,7 +52,7 @@ def OpenInventoryWindow (): global InventoryWindow, OptionsWindow, PortraitWindow global OldPortraitWindow, OldOptionsWindow - + if CloseOtherWindow (OpenInventoryWindow): if GemRB.IsDraggingItem (): pc = GemRB.GameGetSelectedPCSingle () @@ -167,7 +167,7 @@ GemRB.SetButtonBorder (Window, Button, 1,2,2,5,5,32,32,255,0,0,0) GemRB.SetButtonBorder (Window, Button, 2,0,0,0,0,255,128,128,64,0,1) GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_ALIGN_RIGHT | IE_GUI_BUTTON_ALIGN_TOP | IE_GUI_BUTTON_PICTURE, OP_OR) - + GemRB.SetVar ("TopIndex", 0) SetSelectionChangeHandler (UpdateInventoryWindow) UpdateInventoryWindow () @@ -289,7 +289,7 @@ item = GemRB.GetItem (slot_item["ItemResRef"]) if (item['AnimationType'] != ''): GemRB.SetButtonPLT(Window, Button, "WP" + size + item['AnimationType'] + "INV", Color1, Color2, Color3, Color4, Color5, Color6, Color7, 0, 1) - + #Shield slot_item = GemRB.GetSlotItem (pc, 3) if slot_item: @@ -367,7 +367,7 @@ GemRB.SetTooltip (Window, Button, item["ItemName"]) GemRB.EnableButtonBorder (Window, Button, 0, 1) GemRB.EnableButtonBorder (Window, Button, 1, 0) - + else: GemRB.SetTooltip (Window, Button, item["ItemNameIdentified"]) GemRB.EnableButtonBorder (Window, Button, 0, 0) @@ -508,9 +508,6 @@ #-1 : drop stuff in equipable slots (but not inventory) GemRB.DropDraggedItem (pc, -1) - if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip - UpdateInventoryWindow () return @@ -533,8 +530,6 @@ if SlotType["ResRef"]!="": GemRB.DropDraggedItem (pc, slot) - if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip UpdateInventoryWindow () return @@ -545,7 +540,7 @@ #-3 : drop stuff in inventory (but not equippable slots) GemRB.DropDraggedItem (pc, -3) if GemRB.IsDraggingItem (): - GemRB.PlaySound ("GAM_47") #failed equip + GemRB.DisplayString (61794,0xfffffff) UpdateInventoryWindow () return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-09-28 20:06:52
|
Revision: 4802 http://gemrb.svn.sourceforge.net/gemrb/?rev=4802&view=rev Author: avenger_teambg Date: 2007-09-28 13:06:50 -0700 (Fri, 28 Sep 2007) Log Message: ----------- fixed bug #1802086 Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUICG4.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICG4.py gemrb/trunk/gemrb/GUIScripts/how/CharGen.py gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py gemrb/trunk/gemrb/GUIScripts/tob/GUICG4.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUICG4.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUICG4.py 2007-09-26 22:17:16 UTC (rev 4801) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUICG4.py 2007-09-28 20:06:50 UTC (rev 4802) @@ -56,7 +56,6 @@ GemRB.SetVar("Ability",0) GemRB.SetVar("Ability -1",0) PointsLeft = 0 - GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_ENABLED) SumLabel = GemRB.GetControl(AbilityWindow, 0x10000002) GemRB.SetText(AbilityWindow, SumLabel, "0") GemRB.SetLabelUseRGB(AbilityWindow, SumLabel, 1) @@ -74,6 +73,7 @@ Label = GemRB.GetControl(AbilityWindow, 0x10000003+i) GemRB.SetText(AbilityWindow, Label, str(v) ) GemRB.SetLabelUseRGB(AbilityWindow, Label, 1) + GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_ENABLED) return def OnLoad(): @@ -81,7 +81,7 @@ global PointsLeft global AbilityTable global KitIndex, Minimum, Maximum - + #Kit = GemRB.GetVar("Class Kit") #if Kit == 0: ClassTable = GemRB.LoadTable("classes") @@ -95,10 +95,23 @@ Abclasrq = GemRB.LoadTable("ABCLASRQ") KitIndex = GemRB.GetTableRowIndex(Abclasrq, KitName) - GemRB.LoadWindowPack("GUICG") + GemRB.LoadWindowPack("GUICG", 640, 480) AbilityTable = GemRB.LoadTable("ability") AbilityWindow = GemRB.LoadWindow(4) + RerollButton = GemRB.GetControl(AbilityWindow,2) + GemRB.SetText(AbilityWindow,RerollButton,11982) + StoreButton = GemRB.GetControl(AbilityWindow,37) + GemRB.SetText(AbilityWindow,StoreButton,17373) + RecallButton = GemRB.GetControl(AbilityWindow,38) + GemRB.SetText(AbilityWindow,RecallButton,17374) + + BackButton = GemRB.GetControl(AbilityWindow,36) + GemRB.SetText(AbilityWindow,BackButton,15416) + DoneButton = GemRB.GetControl(AbilityWindow,0) + GemRB.SetText(AbilityWindow,DoneButton,11973) + GemRB.SetButtonFlags(AbilityWindow, DoneButton, IE_GUI_BUTTON_DEFAULT,OP_OR) + RollPress() StorePress() for i in range(6): @@ -114,19 +127,6 @@ GemRB.SetEvent(AbilityWindow, Button, IE_GUI_BUTTON_ON_PRESS, "RightPress") GemRB.SetVarAssoc(AbilityWindow, Button, "Ability", i ) - RerollButton = GemRB.GetControl(AbilityWindow,2) - GemRB.SetText(AbilityWindow,RerollButton,11982) - StoreButton = GemRB.GetControl(AbilityWindow,37) - GemRB.SetText(AbilityWindow,StoreButton,17373) - RecallButton = GemRB.GetControl(AbilityWindow,38) - GemRB.SetText(AbilityWindow,RecallButton,17374) - - BackButton = GemRB.GetControl(AbilityWindow,36) - GemRB.SetText(AbilityWindow,BackButton,15416) - DoneButton = GemRB.GetControl(AbilityWindow,0) - GemRB.SetText(AbilityWindow,DoneButton,11973) - GemRB.SetButtonFlags(AbilityWindow, DoneButton, IE_GUI_BUTTON_DEFAULT,OP_OR) - TextAreaControl = GemRB.GetControl(AbilityWindow, 29) GemRB.SetText(AbilityWindow,TextAreaControl,17247) @@ -199,18 +199,31 @@ GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_ENABLED) return +def EmptyPress(): + TextAreaControl = GemRB.GetControl(AbilityWindow, 29) + GemRB.SetText(AbilityWindow,TextAreaControl,17247) + return + def StorePress(): for i in range(-1,6): GemRB.SetVar("Stored "+str(i),GemRB.GetVar("Ability "+str(i) ) ) return def RecallPress(): + global PointsLeft + GemRB.InvalidateWindow(AbilityWindow) for i in range(-1,6): v = GemRB.GetVar("Stored "+str(i) ) GemRB.SetVar("Ability "+str(i), v) Label = GemRB.GetControl(AbilityWindow, 0x10000003+i) GemRB.SetText(AbilityWindow, Label, str(v) ) + + PointsLeft = GemRB.GetVar("Ability -1") + if PointsLeft == 0: + GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_ENABLED) + else: + GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_DISABLED) return def BackPress(): Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICG4.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICG4.py 2007-09-26 22:17:16 UTC (rev 4801) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICG4.py 2007-09-28 20:06:50 UTC (rev 4802) @@ -51,11 +51,12 @@ return def RollPress(): - global Minimum, Maximum, Add, HasStrExtra + global Minimum, Maximum, Add, HasStrExtra, PointsLeft GemRB.InvalidateWindow(AbilityWindow) GemRB.SetVar("Ability",0) GemRB.SetVar("Ability -1",0) + PointsLeft = 0 SumLabel = GemRB.GetControl(AbilityWindow, 0x10000002) GemRB.SetText(AbilityWindow, SumLabel, "0") GemRB.SetLabelUseRGB(AbilityWindow, SumLabel, 1) @@ -65,7 +66,7 @@ else: e = 0 GemRB.SetVar("StrExtra", e) - for i in range(0,6): + for i in range(6): dice = 3 size = 5 CalcLimits(i) @@ -81,6 +82,7 @@ else: GemRB.SetText(AbilityWindow, Label, str(v) ) GemRB.SetLabelUseRGB(AbilityWindow, Label, 1) + GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_ENABLED) return def OnLoad(): @@ -111,9 +113,22 @@ AbilityTable = GemRB.LoadTable("ability") AbilityWindow = GemRB.LoadWindow(4) + RerollButton = GemRB.GetControl(AbilityWindow,2) + GemRB.SetText(AbilityWindow,RerollButton,11982) + StoreButton = GemRB.GetControl(AbilityWindow,37) + GemRB.SetText(AbilityWindow,StoreButton,17373) + RecallButton = GemRB.GetControl(AbilityWindow,38) + GemRB.SetText(AbilityWindow,RecallButton,17374) + + BackButton = GemRB.GetControl(AbilityWindow,36) + GemRB.SetText(AbilityWindow,BackButton,15416) + DoneButton = GemRB.GetControl(AbilityWindow,0) + GemRB.SetText(AbilityWindow,DoneButton,11973) + GemRB.SetButtonFlags(AbilityWindow, DoneButton, IE_GUI_BUTTON_DEFAULT,OP_OR) + RollPress() StorePress() - for i in range(0,6): + for i in range(6): Label = GemRB.GetControl(AbilityWindow, i+0x10000009) GemRB.SetEvent(AbilityWindow, Label, IE_GUI_LABEL_ON_PRESS, "OverPress"+str(i) ) Button = GemRB.GetControl(AbilityWindow, i+30) @@ -129,19 +144,6 @@ GemRB.SetEvent(AbilityWindow, Button, IE_GUI_BUTTON_ON_PRESS, "RightPress") GemRB.SetVarAssoc(AbilityWindow, Button, "Ability", i ) - RerollButton = GemRB.GetControl(AbilityWindow,2) - GemRB.SetText(AbilityWindow,RerollButton,11982) - StoreButton = GemRB.GetControl(AbilityWindow,37) - GemRB.SetText(AbilityWindow,StoreButton,17373) - RecallButton = GemRB.GetControl(AbilityWindow,38) - GemRB.SetText(AbilityWindow,RecallButton,17374) - - BackButton = GemRB.GetControl(AbilityWindow,36) - GemRB.SetText(AbilityWindow,BackButton,15416) - DoneButton = GemRB.GetControl(AbilityWindow,0) - GemRB.SetText(AbilityWindow,DoneButton,11973) - GemRB.SetButtonFlags(AbilityWindow, DoneButton, IE_GUI_BUTTON_DEFAULT,OP_OR) - TextAreaControl = GemRB.GetControl(AbilityWindow, 29) GemRB.SetText(AbilityWindow,TextAreaControl,17247) @@ -232,6 +234,8 @@ return def RecallPress(): + global PointsLeft + GemRB.InvalidateWindow(AbilityWindow) e=GemRB.GetVar("StoredStrExtra") GemRB.SetVar("StrExtra",e) @@ -243,6 +247,12 @@ GemRB.SetText(AbilityWindow, Label, "18/"+str(e) ) else: GemRB.SetText(AbilityWindow, Label, str(v) ) + + PointsLeft = GemRB.GetVar("Ability -1") + if PointsLeft == 0: + GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_ENABLED) + else: + GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_DISABLED) return def BackPress(): Modified: gemrb/trunk/gemrb/GUIScripts/how/CharGen.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/CharGen.py 2007-09-26 22:17:16 UTC (rev 4801) +++ gemrb/trunk/gemrb/GUIScripts/how/CharGen.py 2007-09-28 20:06:50 UTC (rev 4802) @@ -283,6 +283,7 @@ def CancelPress(): global CharGenWindow + GemRB.UnloadWindow (CharGenWindow) GemRB.SetNextScript("PartyFormation") return @@ -519,6 +520,7 @@ def GenderPress(): global CharGenWindow, GenderWindow, GenderDoneButton, GenderTextArea + GemRB.SetVisible (CharGenWindow, 0) GenderWindow = GemRB.LoadWindow (1) GemRB.SetVar ("Gender", 0) @@ -555,18 +557,21 @@ def MalePress(): global GenderWindow, GenderDoneButton, GenderTextArea + GemRB.SetText (GenderWindow, GenderTextArea, 13083) GemRB.SetButtonState (GenderWindow, GenderDoneButton, IE_GUI_BUTTON_ENABLED) return def FemalePress(): global GenderWindow, GenderDoneButton, GenderTextArea + GemRB.SetText (GenderWindow, GenderTextArea, 13084) GemRB.SetButtonState (GenderWindow, GenderDoneButton, IE_GUI_BUTTON_ENABLED) return def GenderDonePress(): global CharGenWindow, GenderWindow + GemRB.UnloadWindow (GenderWindow) GemRB.SetVisible (CharGenWindow, 1) PortraitSelect() @@ -574,6 +579,7 @@ def GenderCancelPress(): global CharGenWindow, GenderWindow, Gender + GemRB.SetVar ("Gender", 0) GemRB.UnloadWindow (GenderWindow) GemRB.SetVisible (CharGenWindow, 1) @@ -581,6 +587,7 @@ def PortraitSelect(): global CharGenWindow, PortraitWindow, Portrait, PortraitPortraitButton, PortraitTable + GemRB.SetVisible (CharGenWindow, 0) PortraitWindow = GemRB.LoadWindow (11) @@ -626,6 +633,7 @@ def PortraitLeftPress(): global PortraitWindow, Portrait, PortraitTable, PortraitPortraitButton + while True: Portrait = Portrait - 1 if Portrait < 0: @@ -636,6 +644,7 @@ def PortraitRightPress(): global PortraitWindow, Portrait, PortraitTable, PortraitPortraitButton + while True: Portrait = Portrait + 1 if Portrait == GemRB.GetTableRowCount (PortraitTable): @@ -649,6 +658,7 @@ def PortraitDonePress(): global CharGenWindow, CharGenState, PortraitWindow, PortraitButton, PortraitTable, Portrait, GenderButton, RaceButton + GemRB.UnloadWindow (PortraitWindow) GemRB.SetButtonPicture(CharGenWindow, PortraitButton, GemRB.GetTableRowName (PortraitTable, Portrait) + "L") GemRB.SetButtonState (CharGenWindow, GenderButton, IE_GUI_BUTTON_DISABLED) @@ -662,15 +672,16 @@ def PortraitCancelPress(): global CharGenWindow, PortraitWindow + GemRB.UnloadWindow (PortraitWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Race Selection def RacePress(): global CharGenWindow, RaceWindow, RaceDoneButton, RaceTable, RaceTextArea + GemRB.SetVisible (CharGenWindow, 0) RaceWindow = GemRB.LoadWindow (8) RaceTable = GemRB.LoadTable ("RACES") @@ -706,6 +717,7 @@ def RaceSelectPress(): global RaceWindow, RaceDoneButton, RaceTable, RaceTextArea + Race = GemRB.GetVar ("Race") - 1 GemRB.SetText (RaceWindow, RaceTextArea, GemRB.GetTableValue (RaceTable, Race, 1) ) GemRB.SetButtonState (RaceWindow, RaceDoneButton, IE_GUI_BUTTON_ENABLED) @@ -713,6 +725,7 @@ def RaceDonePress(): global CharGenWindow, CharGenState, RaceWindow, RaceButton, ClassButton + GemRB.UnloadWindow (RaceWindow) GemRB.SetButtonState (CharGenWindow, RaceButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonFlags (CharGenWindow, RaceButton, IE_GUI_BUTTON_DEFAULT, OP_NAND) @@ -725,6 +738,7 @@ def RaceCancelPress(): global CharGenWindow, RaceWindow + GemRB.UnloadWindow (RaceWindow) GemRB.SetVisible (CharGenWindow, 1) return @@ -803,6 +817,7 @@ def ClassSelectPress(): global ClassWindow, ClassTable, ClassTextArea, ClassDoneButton + Class = GemRB.GetVar ("Class") - 1 GemRB.SetText (ClassWindow, ClassTextArea, GemRB.GetTableValue (ClassTable, Class, 1) ) GemRB.SetButtonState (ClassWindow, ClassDoneButton, IE_GUI_BUTTON_ENABLED) @@ -810,6 +825,7 @@ def ClassMultiPress(): global ClassWindow, ClassTable, ClassMultiWindow, ClassMultiTextArea, ClassMultiDoneButton + GemRB.SetVisible (ClassWindow, 0) ClassMultiWindow = GemRB.LoadWindow (10) ClassCount = GemRB.GetTableRowCount (ClassTable) @@ -852,6 +868,7 @@ def ClassMultiSelectPress(): global ClassMultiWindow, ClassTable, ClassMultiTextArea, ClassMultiDoneButton + Class = GemRB.GetVar ("Class") - 1 GemRB.SetText (ClassMultiWindow, ClassMultiTextArea, GemRB.GetTableValue (ClassTable, Class, 1) ) GemRB.SetButtonState (ClassMultiWindow, ClassMultiDoneButton, IE_GUI_BUTTON_ENABLED) @@ -859,12 +876,14 @@ def ClassMultiDonePress(): global ClassMultiWindow + GemRB.UnloadWindow (ClassMultiWindow) ClassDonePress() return def ClassMultiCancelPress(): global ClassWindow, ClassMultiWindow + GemRB.UnloadWindow (ClassMultiWindow) GemRB.SetVisible (ClassWindow, 1) return @@ -924,12 +943,14 @@ def KitCancelPress(): global ClassWindow, KitWindow + GemRB.UnloadWindow (KitWindow) GemRB.SetVisible (ClassWindow, 1) return def ClassDonePress(): global CharGenWindow, CharGenState, ClassWindow, ClassButton, AlignmentButton + GemRB.UnloadWindow (ClassWindow) GemRB.SetButtonState (CharGenWindow, ClassButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonFlags (CharGenWindow, ClassButton, IE_GUI_BUTTON_DEFAULT, OP_NAND) @@ -942,15 +963,16 @@ def ClassCancelPress(): global CharGenWindow, ClassWindow + GemRB.UnloadWindow (ClassWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Alignment Selection def AlignmentPress(): global CharGenWindow, AlignmentWindow, AlignmentTable, AlignmentTextArea, AlignmentDoneButton + GemRB.SetVisible (CharGenWindow, 0) AlignmentWindow = GemRB.LoadWindow (3) AlignmentTable = GemRB.LoadTable ("aligns") @@ -989,9 +1011,9 @@ GemRB.SetVisible (AlignmentWindow, 1) return - def AlignmentSelectPress(): global AlignmentWindow, AlignmentTable, AlignmentTextArea, AlignmentDoneButton + Alignment = GemRB.GetVar ("Alignment") - 1 GemRB.SetText (AlignmentWindow, AlignmentTextArea, GemRB.GetTableValue (AlignmentTable, Alignment, 1)) GemRB.SetButtonState (AlignmentWindow, AlignmentDoneButton, IE_GUI_BUTTON_ENABLED) @@ -999,6 +1021,7 @@ def AlignmentDonePress(): global CharGenWindow, CharGenState, AlignmentWindow, AlignmentButton, AbilitiesButton + GemRB.UnloadWindow (AlignmentWindow) GemRB.SetButtonState (CharGenWindow, AlignmentButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonFlags (CharGenWindow, AlignmentButton, IE_GUI_BUTTON_DEFAULT, OP_NAND) @@ -1011,15 +1034,16 @@ def AlignmentCancelPress(): global CharGenWindow, AlignmentWindow + GemRB.UnloadWindow (AlignmentWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Abilities Selection def AbilitiesPress(): global CharGenWindow, AbilitiesWindow, AbilitiesTable, AbilitiesRaceAddTable, AbilitiesRaceReqTable, AbilitiesClassReqTable, AbilitiesTextArea, AbilitiesRecallButton, AbilitiesDoneButton + GemRB.SetVisible (CharGenWindow, 0) AbilitiesWindow = GemRB.LoadWindow (4) AbilitiesTable = GemRB.LoadTable ("ABILITY") @@ -1049,8 +1073,6 @@ AbilityLabel = GemRB.GetControl (AbilitiesWindow, 0x10000003 + i) GemRB.SetLabelUseRGB (AbilitiesWindow, AbilityLabel, 1) - AbilitiesRerollPress() - AbilitiesStoreButton = GemRB.GetControl (AbilitiesWindow, 37) GemRB.SetButtonState (AbilitiesWindow, AbilitiesStoreButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent (AbilitiesWindow, AbilitiesStoreButton, IE_GUI_BUTTON_ON_PRESS, "AbilitiesStorePress") @@ -1080,12 +1102,15 @@ GemRB.SetEvent (AbilitiesWindow, AbilitiesCancelButton, IE_GUI_BUTTON_ON_PRESS, "AbilitiesCancelPress") GemRB.SetText (AbilitiesWindow, AbilitiesCancelButton, 13727) + AbilitiesRerollPress() + GemRB.SetVisible (AbilitiesWindow, 1) return def AbilitiesCalcLimits(Index): global RaceTable, AbilitiesRaceReqTable, AbilitiesRaceAddTable, ClassTable, AbilitiesClassReqTable global AbilitiesMinimum, AbilitiesMaximum, AbilitiesModifier + RaceName = GemRB.GetTableRowName (RaceTable, GemRB.GetVar ("Race") - 1) Race = GemRB.GetTableRowIndex (AbilitiesRaceReqTable, RaceName) AbilitiesMinimum = GemRB.GetTableValue (AbilitiesRaceReqTable, Race, Index * 2) @@ -1104,6 +1129,7 @@ def AbilitiesLabelPress(): global AbilitiesWindow, AbilitiesTable, AbilitiesTextArea + AbilityIndex = GemRB.GetVar ("AbilityIndex") - 1 AbilitiesCalcLimits(AbilityIndex) GemRB.SetToken ("MINIMUM", str(AbilitiesMinimum) ) @@ -1113,6 +1139,7 @@ def AbilitiesPlusPress(): global AbilitiesWindow, AbilitiesTable, AbilitiesTextArea, AbilitiesMinimum, AbilitiesMaximum + AbilityIndex = GemRB.GetVar ("AbilityIndex") - 1 AbilitiesCalcLimits(AbilityIndex) GemRB.SetToken ("MINIMUM", str(AbilitiesMinimum) ) @@ -1135,6 +1162,7 @@ def AbilitiesMinusPress(): global AbilitiesWindow, AbilitiesTable, AbilitiesTextArea, AbilitiesMinimum, AbilitiesMaximum + AbilityIndex = GemRB.GetVar ("AbilityIndex") - 1 AbilitiesCalcLimits(AbilityIndex) GemRB.SetToken ("MINIMUM", str(AbilitiesMinimum) ) @@ -1152,11 +1180,12 @@ GemRB.SetVar ("Ability0", PointsLeft) PointsLeftLabel = GemRB.GetControl (AbilitiesWindow, 0x10000002) GemRB.SetText (AbilitiesWindow, PointsLeftLabel, str(PointsLeft) ) - GemRB.SetButtonState (AlignmentWindow, AbilitiesDoneButton, IE_GUI_BUTTON_DISABLED) + GemRB.SetButtonState (AbilitiesWindow, AbilitiesDoneButton, IE_GUI_BUTTON_DISABLED) return def AbilitiesStorePress(): global AbilitiesWindow, AbilitiesRecallButton + for i in range (7): GemRB.SetVar ("Stored" + str(i), GemRB.GetVar ("Ability" + str(i))) GemRB.SetButtonState (AbilitiesWindow, AbilitiesRecallButton, IE_GUI_BUTTON_ENABLED) @@ -1164,15 +1193,22 @@ def AbilitiesRecallPress(): global AbilitiesWindow + GemRB.InvalidateWindow (AbilitiesWindow) for i in range (7): GemRB.SetVar ("Ability" + str(i), GemRB.GetVar ("Stored" + str(i)) ) AbilityLabel = GemRB.GetControl (AbilitiesWindow, 0x10000002 + i) GemRB.SetText (AbilitiesWindow, AbilityLabel, str(GemRB.GetVar ("Ability" + str(i))) ) + PointsLeft = GemRB.GetVar("Ability0") + if PointsLeft == 0: + GemRB.SetButtonState(AbilitiesWindow, AbilitiesDoneButton,IE_GUI_BUTTON_ENABLED) + else: + GemRB.SetButtonState(AbilitiesWindow, AbilitiesDoneButton,IE_GUI_BUTTON_DISABLED) return def AbilitiesRerollPress(): global AbilitiesWindow, AbilitiesMinimum, AbilitiesMaximum, AbilitiesModifier + GemRB.InvalidateWindow (AbilitiesWindow) GemRB.SetVar ("Ability0", 0) PointsLeftLabel = GemRB.GetControl (AbilitiesWindow, 0x10000002) @@ -1189,6 +1225,7 @@ GemRB.SetVar ("Ability" + str(i + 1), Value) AbilityLabel = GemRB.GetControl (AbilitiesWindow, 0x10000003 + i) GemRB.SetText (AbilitiesWindow, AbilityLabel, str(Value) ) + GemRB.SetButtonState(AbilitiesWindow, AbilitiesDoneButton,IE_GUI_BUTTON_ENABLED) return def AbilitiesDonePress(): @@ -1207,11 +1244,11 @@ def AbilitiesCancelPress(): global CharGenWindow, AbilitiesWindow + GemRB.UnloadWindow (AbilitiesWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Skills Selection def SkillsPress(): @@ -1290,6 +1327,7 @@ def SkillsSelect(): global CharGenWindow, SkillsWindow, SkillsTextArea, SkillsTable, SkillsDoneButton, RaceTable, SkillsPointsLeft + GemRB.SetVisible (CharGenWindow, 0) SkillsWindow = GemRB.LoadWindow (6) RaceName = GemRB.GetTableRowName (RaceTable, GemRB.GetVar ("Race") - 1) @@ -1348,12 +1386,14 @@ def SkillsLabelPress(): global SkillsWindow, SkillsTextArea, SkillsTable + SkillIndex = GemRB.GetVar ("SkillIndex") GemRB.SetText (SkillsWindow, SkillsTextArea, GemRB.GetTableValue (SkillsTable, SkillIndex, 1) ) return def SkillsPlusPress(): global SkillsWindow, SkillsTextArea, SkillsTable, SkillsPointsLeft + SkillIndex = GemRB.GetVar ("SkillIndex") SkillValue = GemRB.GetVar ("Skill" + str(SkillIndex)) GemRB.SetText (SkillsWindow, SkillsTextArea, GemRB.GetTableValue (SkillsTable, SkillIndex, 1) ) @@ -1371,6 +1411,7 @@ def SkillsMinusPress(): global SkillsWindow, SkillsTextArea, SkillsTable, SkillsPointsLeft + SkillIndex = GemRB.GetVar ("SkillIndex") SkillValue = GemRB.GetVar ("Skill" + str(SkillIndex)) GemRB.SetText (SkillsWindow, SkillsTextArea, GemRB.GetTableValue (SkillsTable, SkillIndex, 1) ) @@ -1387,6 +1428,7 @@ def SkillsDonePress(): global CharGenWindow, SkillsWindow, SkillsState + GemRB.UnloadWindow (SkillsWindow) SkillsState = 1 GemRB.SetVisible (CharGenWindow, 1) @@ -1395,16 +1437,17 @@ def SkillsCancelPress(): global CharGenWindow, SkillsWindow, SkillsState + GemRB.UnloadWindow (SkillsWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) return - # Racial Enemy Selection def RacialEnemySelect(): global CharGenWindow, RacialEnemyWindow, RacialEnemyTable, RacialEnemyTextArea, RacialEnemyDoneButton + GemRB.SetVisible (CharGenWindow, 0) RacialEnemyWindow = GemRB.LoadWindow (15) RacialEnemyTable = GemRB.LoadTable ("ENEMIES") @@ -1446,6 +1489,7 @@ def DisplayRacialEnemies(): global RacialEnemyWindow, RacialEnemyTable + RacialEnemyIndex = GemRB.GetVar ("RacialEnemyIndex") for i in range (2, 8): RacialEnemySelectButton = GemRB.GetControl (RacialEnemyWindow, i) @@ -1454,6 +1498,7 @@ def RacialEnemySelectPress(): global RacialEnemyWindow, RacialEnemyDoneButton, RacialEnemyTable, RacialEnemyTextArea + RacialEnemy = GemRB.GetVar ("RacialEnemyIndex") + GemRB.GetVar ("RacialEnemy") - 1 GemRB.SetText (RacialEnemyWindow, RacialEnemyTextArea, GemRB.GetTableValue (RacialEnemyTable, RacialEnemy, 1) ) GemRB.SetVar ("HatedRace", GemRB.GetTableValue (RacialEnemyTable, RacialEnemy, 3) ) @@ -1462,6 +1507,7 @@ def RacialEnemyDonePress(): global CharGenWindow, RacialEnemyWindow, SkillsState + GemRB.UnloadWindow (RacialEnemyWindow) SkillsState = 1 GemRB.SetVisible (CharGenWindow, 1) @@ -1470,6 +1516,7 @@ def RacialEnemyCancelPress(): global CharGenWindow, RacialEnemyWindow, SkillsState + GemRB.UnloadWindow (RacialEnemyWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) @@ -1480,6 +1527,7 @@ def ProficienciesSelect(): global CharGenWindow, ProficienciesWindow, ProficienciesTable, ProficienciesTextArea, ProficienciesPointsLeft, ProficienciesDoneButton, ClassTable, ProfsMaxTable + GemRB.SetVisible (CharGenWindow, 0) ProficienciesWindow = GemRB.LoadWindow (9) ClassName = GemRB.GetTableRowName (ClassTable, GemRB.GetVar ("Class") - 1) @@ -1539,7 +1587,7 @@ GemRB.SetButtonFlags (ProficienciesWindow, ProficienciesMark, IE_GUI_BUTTON_NO_IMAGE, OP_OR) Allowed = GemRB.GetTableValue (ClassWeaponsTable, ClassName, GemRB.GetTableRowName (ProficienciesTable, i + 8)) - + ProficienciesPlusButton = GemRB.GetControl (ProficienciesWindow, 127 + i * 2) if Allowed == 0: GemRB.SetButtonState (ProficienciesWindow, ProficienciesPlusButton, IE_GUI_BUTTON_DISABLED) @@ -1581,6 +1629,7 @@ def ProficienciesLabelPress(): global ProficienciesWindow, ProficienciesTable, ProficienciesTextArea + ProficienciesIndex = GemRB.GetVar ("ProficienciesIndex") - 1 GemRB.SetText (ProficienciesWindow, ProficienciesTextArea, GemRB.GetTableValue (ProficienciesTable, ProficienciesIndex, 2) ) return @@ -1598,7 +1647,7 @@ GemRB.SetText (ProficienciesWindow, PointsLeftLabel, str(ProficienciesPointsLeft)) if ProficienciesPointsLeft == 0: GemRB.SetButtonState (ProficienciesWindow, ProficienciesDoneButton, IE_GUI_BUTTON_ENABLED) - + ProficienciesValue = ProficienciesValue + 1 GemRB.SetVar ("Proficiency" + str(ProficienciesIndex), ProficienciesValue) if ProficienciesIndex < 8: @@ -1607,7 +1656,7 @@ ControlID = 51 + ProficienciesIndex * 5 + ProficienciesValue ProficienciesMark = GemRB.GetControl (ProficienciesWindow, ControlID) GemRB.SetButtonFlags (ProficienciesWindow, ProficienciesMark, IE_GUI_BUTTON_NO_IMAGE, OP_NAND) - + GemRB.SetText (ProficienciesWindow, ProficienciesTextArea, GemRB.GetTableValue (ProficienciesTable, ProficienciesIndex, 2) ) return @@ -1625,17 +1674,18 @@ ControlID = 52 + ProficienciesIndex * 5 + ProficienciesValue ProficienciesMark = GemRB.GetControl (ProficienciesWindow, ControlID) GemRB.SetButtonFlags (ProficienciesWindow, ProficienciesMark, IE_GUI_BUTTON_NO_IMAGE, OP_OR) - + ProficienciesPointsLeft = ProficienciesPointsLeft + 1 PointsLeftLabel = GemRB.GetControl (ProficienciesWindow, 0x10000009) GemRB.SetText (ProficienciesWindow, PointsLeftLabel, str(ProficienciesPointsLeft)) GemRB.SetButtonState (ProficienciesWindow, ProficienciesDoneButton, IE_GUI_BUTTON_DISABLED) - + GemRB.SetText (ProficienciesWindow, ProficienciesTextArea, GemRB.GetTableValue (ProficienciesTable, ProficienciesIndex, 2) ) return def ProficienciesDonePress(): global CharGenWindow, ProficienciesWindow, SkillsState + GemRB.UnloadWindow (ProficienciesWindow) SkillsState = 2 GemRB.SetVisible (CharGenWindow, 1) @@ -1644,12 +1694,12 @@ def ProficienciesCancelPress(): global CharGenWindow, ProficienciesWindow, SkillsState + GemRB.UnloadWindow (ProficienciesWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) return - # Spells Selection def MageSpellsSelect(SpellTable, Level, SpellLevel): @@ -1749,6 +1799,7 @@ def MageSpellsDonePress(): global CharGenWindow, MageSpellsWindow, SkillsState + GemRB.UnloadWindow (MageSpellsWindow) SkillsState = 3 GemRB.SetVisible (CharGenWindow, 1) @@ -1757,6 +1808,7 @@ def MageSpellsCancelPress(): global CharGenWindow, MageSpellsWindow, SkillsState + GemRB.UnloadWindow (MageSpellsWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) @@ -1867,6 +1919,7 @@ def MageMemorizeDonePress(): global CharGenWindow, MageMemorizeWindow, SkillsState + GemRB.UnloadWindow (MageMemorizeWindow) SkillsState = 4 GemRB.SetVisible (CharGenWindow, 1) @@ -1875,12 +1928,12 @@ def MageMemorizeCancelPress(): global CharGenWindow, MageMemorizeWindow, SkillsState + GemRB.UnloadWindow (MageMemorizeWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) return - # Priest Spells Memorize def PriestSpellsMemorize(SpellTable, Level, SpellLevel): @@ -1938,6 +1991,7 @@ def PriestMemorizeSelectPress(): global PriestMemorizeWindow, Learnable, PriestMemorizeTextArea, PriestMemorizeDoneButton, PriestMemorizePointsLeft + PriestMemorized = GemRB.GetVar ("PriestMemorized") SpellMask = GemRB.GetVar ("SpellMask") Spell = abs(PriestMemorized - SpellMask) @@ -1973,6 +2027,7 @@ def PriestMemorizeDonePress(): global CharGenWindow, PriestMemorizeWindow, SkillsState + GemRB.UnloadWindow (PriestMemorizeWindow) SkillsState = 5 GemRB.SetVisible (CharGenWindow, 1) @@ -1981,12 +2036,12 @@ def PriestMemorizeCancelPress(): global CharGenWindow, PriestMemorizeWindow, SkillsState + GemRB.UnloadWindow (PriestMemorizeWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) return - # Appearance Selection def AppearancePress(): @@ -2054,6 +2109,7 @@ def DrawAvatar(): global AppearanceAvatarButton, RaceTable, ClassTable + AppearanceAvatarTable = GemRB.LoadTable ("pdolls") AvatarID = 0x6000 table = GemRB.LoadTable ("avprefr") @@ -2092,6 +2148,7 @@ def AppearanceColorChoice (CurrentColor): global AppearanceWindow, AppearanceColorWindow + GemRB.SetVisible (AppearanceWindow, 0) AppearanceColorWindow = GemRB.LoadWindow (14) AppearanceColorTable = GemRB.LoadTable ("clowncol") @@ -2144,6 +2201,7 @@ def AppearanceDonePress(): global CharGenWindow, AppearanceWindow + GemRB.UnloadWindow (AppearanceWindow) GemRB.SetVisible (CharGenWindow, 1) CharSoundSelect() @@ -2151,11 +2209,11 @@ def AppearanceCancelPress(): global CharGenWindow, AppearanceWindow + GemRB.UnloadWindow (AppearanceWindow) GemRB.SetVisible (CharGenWindow, 1) return - def CharSoundSelect(): global CharGenWindow, CharSoundWindow, CharSoundTable, CharSoundStrings global CharSoundVoiceList @@ -2202,6 +2260,7 @@ def CharSoundDonePress(): global CharGenWindow, CharSoundWindow, AppearanceButton, BiographyButton, NameButton, CharGenState + GemRB.UnloadWindow (CharSoundWindow) GemRB.SetButtonState (CharGenWindow, AppearanceButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonFlags (CharGenWindow, AppearanceButton, IE_GUI_BUTTON_DEFAULT, OP_NAND) @@ -2214,15 +2273,16 @@ def CharSoundCancelPress(): global CharGenWindow, CharSoundWindow + GemRB.UnloadWindow (CharSoundWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Biography Selection def BiographyPress(): global CharGenWindow, BiographyWindow, BiographyField + GemRB.SetVisible (CharGenWindow, 0) BiographyWindow = GemRB.LoadWindow (51) @@ -2250,27 +2310,30 @@ def BiographyClearPress(): global BiographyWindow, BiographyField + GemRB.SetText (BiographyWindow, BiographyField, "") return def BiographyCancelPress(): global CharGenWindow, BiographyWindow + GemRB.UnloadWindow (BiographyWindow) GemRB.SetVisible (CharGenWindow, 1) return def BiographyDonePress(): global CharGenWindow, BiographyWindow, BiographyField + GemRB.SetToken ("Biography", GemRB.QueryText (BiographyWindow, BiographyField) ) GemRB.UnloadWindow (BiographyWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Name Selection def NamePress(): global CharGenWindow, NameWindow, NameDoneButton, NameField + GemRB.SetVisible (CharGenWindow, 0) NameWindow = GemRB.LoadWindow (5) @@ -2294,6 +2357,7 @@ def NameEditChange(): global NameField + if GemRB.QueryText (NameWindow, NameField) == "": GemRB.SetButtonState (NameWindow, NameDoneButton, IE_GUI_BUTTON_DISABLED) else: @@ -2302,6 +2366,7 @@ def NameDonePress(): global CharGenWindow, CharGenState, NameWindow, NameField, AcceptButton + GemRB.SetToken ("CHARNAME", GemRB.QueryText (NameWindow, NameField) ) GemRB.UnloadWindow (NameWindow) CharGenState = 8 @@ -2323,6 +2388,7 @@ def ImportPress(): global CharGenWindow, ImportWindow + GemRB.SetVisible (CharGenWindow, 0) ImportWindow = GemRB.LoadWindow (20) @@ -2352,7 +2418,7 @@ def ImportCancelPress(): global CharGenWindow, ImportWindow + GemRB.UnloadWindow (ImportWindow) GemRB.SetVisible (CharGenWindow, 1) return - Modified: gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py 2007-09-26 22:17:16 UTC (rev 4801) +++ gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py 2007-09-28 20:06:50 UTC (rev 4802) @@ -283,6 +283,7 @@ def CancelPress(): global CharGenWindow + GemRB.UnloadWindow (CharGenWindow) GemRB.SetNextScript("PartyFormation") return @@ -303,7 +304,7 @@ t = GemRB.GetTableValue ( AlignmentTable, GemRB.GetVar ("Alignment")-1, 3) GemRB.SetPlayerStat (MyChar, IE_ALIGNMENT, t) - TmpTable = GemRB.LoadTable ("clskills") + TmpTable = GemRB.LoadTable ("clskills") #mage spells TableName = GemRB.GetTableValue (TmpTable, Class, 2, 0) if TableName != "*": @@ -371,7 +372,7 @@ StatID = GemRB.GetTableValue (TmpTable, i, 0) Value = GemRB.GetVar ("Proficiency"+str(i) ) GemRB.SetPlayerStat (MyChar, StatID, Value ) - GemRB.UnloadTable (TmpTable) + GemRB.UnloadTable (TmpTable) SetColorStat (MyChar, IE_SKIN_COLOR, GemRB.GetVar ("SkinColor") ) SetColorStat (MyChar, IE_HAIR_COLOR, GemRB.GetVar ("HairColor") ) @@ -519,6 +520,7 @@ def GenderPress(): global CharGenWindow, GenderWindow, GenderDoneButton, GenderTextArea + GemRB.SetVisible (CharGenWindow, 0) GenderWindow = GemRB.LoadWindow (1) GemRB.SetVar ("Gender", 0) @@ -555,18 +557,21 @@ def MalePress(): global GenderWindow, GenderDoneButton, GenderTextArea + GemRB.SetText (GenderWindow, GenderTextArea, 13083) GemRB.SetButtonState (GenderWindow, GenderDoneButton, IE_GUI_BUTTON_ENABLED) return def FemalePress(): global GenderWindow, GenderDoneButton, GenderTextArea + GemRB.SetText (GenderWindow, GenderTextArea, 13084) GemRB.SetButtonState (GenderWindow, GenderDoneButton, IE_GUI_BUTTON_ENABLED) return def GenderDonePress(): global CharGenWindow, GenderWindow + GemRB.UnloadWindow (GenderWindow) GemRB.SetVisible (CharGenWindow, 1) PortraitSelect() @@ -574,6 +579,7 @@ def GenderCancelPress(): global CharGenWindow, GenderWindow, Gender + GemRB.SetVar ("Gender", 0) GemRB.UnloadWindow (GenderWindow) GemRB.SetVisible (CharGenWindow, 1) @@ -581,6 +587,7 @@ def PortraitSelect(): global CharGenWindow, PortraitWindow, Portrait, PortraitPortraitButton, PortraitTable + GemRB.SetVisible (CharGenWindow, 0) PortraitWindow = GemRB.LoadWindow (11) @@ -626,6 +633,7 @@ def PortraitLeftPress(): global PortraitWindow, Portrait, PortraitTable, PortraitPortraitButton + while True: Portrait = Portrait - 1 if Portrait < 0: @@ -636,6 +644,7 @@ def PortraitRightPress(): global PortraitWindow, Portrait, PortraitTable, PortraitPortraitButton + while True: Portrait = Portrait + 1 if Portrait == GemRB.GetTableRowCount (PortraitTable): @@ -649,6 +658,7 @@ def PortraitDonePress(): global CharGenWindow, CharGenState, PortraitWindow, PortraitButton, PortraitTable, Portrait, GenderButton, RaceButton + GemRB.UnloadWindow (PortraitWindow) GemRB.SetButtonPicture(CharGenWindow, PortraitButton, GemRB.GetTableRowName (PortraitTable, Portrait) + "L") GemRB.SetButtonState (CharGenWindow, GenderButton, IE_GUI_BUTTON_DISABLED) @@ -662,15 +672,16 @@ def PortraitCancelPress(): global CharGenWindow, PortraitWindow + GemRB.UnloadWindow (PortraitWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Race Selection def RacePress(): global CharGenWindow, RaceWindow, RaceDoneButton, RaceTable, RaceTextArea + GemRB.SetVisible (CharGenWindow, 0) RaceWindow = GemRB.LoadWindow (8) RaceTable = GemRB.LoadTable ("RACES") @@ -706,6 +717,7 @@ def RaceSelectPress(): global RaceWindow, RaceDoneButton, RaceTable, RaceTextArea + Race = GemRB.GetVar ("Race") - 1 GemRB.SetText (RaceWindow, RaceTextArea, GemRB.GetTableValue (RaceTable, Race, 1) ) GemRB.SetButtonState (RaceWindow, RaceDoneButton, IE_GUI_BUTTON_ENABLED) @@ -713,6 +725,7 @@ def RaceDonePress(): global CharGenWindow, CharGenState, RaceWindow, RaceButton, ClassButton + GemRB.UnloadWindow (RaceWindow) GemRB.SetButtonState (CharGenWindow, RaceButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonFlags (CharGenWindow, RaceButton, IE_GUI_BUTTON_DEFAULT, OP_NAND) @@ -725,6 +738,7 @@ def RaceCancelPress(): global CharGenWindow, RaceWindow + GemRB.UnloadWindow (RaceWindow) GemRB.SetVisible (CharGenWindow, 1) return @@ -775,7 +789,7 @@ GemRB.SetText (ClassWindow, ClassMultiButton, 11993) KitButton = GemRB.GetControl (ClassWindow, 11) - #only the mage class has schools + #only the mage class has schools Allowed = GemRB.GetTableValue (ClassTable, "MAGE", RaceName) if Allowed: GemRB.SetButtonState (ClassWindow, KitButton, IE_GUI_BUTTON_ENABLED) @@ -803,6 +817,7 @@ def ClassSelectPress(): global ClassWindow, ClassTable, ClassTextArea, ClassDoneButton + Class = GemRB.GetVar ("Class") - 1 GemRB.SetText (ClassWindow, ClassTextArea, GemRB.GetTableValue (ClassTable, Class, 1) ) GemRB.SetButtonState (ClassWindow, ClassDoneButton, IE_GUI_BUTTON_ENABLED) @@ -810,6 +825,7 @@ def ClassMultiPress(): global ClassWindow, ClassTable, ClassMultiWindow, ClassMultiTextArea, ClassMultiDoneButton + GemRB.SetVisible (ClassWindow, 0) ClassMultiWindow = GemRB.LoadWindow (10) ClassCount = GemRB.GetTableRowCount (ClassTable) @@ -852,6 +868,7 @@ def ClassMultiSelectPress(): global ClassMultiWindow, ClassTable, ClassMultiTextArea, ClassMultiDoneButton + Class = GemRB.GetVar ("Class") - 1 GemRB.SetText (ClassMultiWindow, ClassMultiTextArea, GemRB.GetTableValue (ClassTable, Class, 1) ) GemRB.SetButtonState (ClassMultiWindow, ClassMultiDoneButton, IE_GUI_BUTTON_ENABLED) @@ -859,12 +876,14 @@ def ClassMultiDonePress(): global ClassMultiWindow + GemRB.UnloadWindow (ClassMultiWindow) ClassDonePress() return def ClassMultiCancelPress(): global ClassWindow, ClassMultiWindow + GemRB.UnloadWindow (ClassMultiWindow) GemRB.SetVisible (ClassWindow, 1) return @@ -924,12 +943,14 @@ def KitCancelPress(): global ClassWindow, KitWindow + GemRB.UnloadWindow (KitWindow) GemRB.SetVisible (ClassWindow, 1) return def ClassDonePress(): global CharGenWindow, CharGenState, ClassWindow, ClassButton, AlignmentButton + GemRB.UnloadWindow (ClassWindow) GemRB.SetButtonState (CharGenWindow, ClassButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonFlags (CharGenWindow, ClassButton, IE_GUI_BUTTON_DEFAULT, OP_NAND) @@ -942,15 +963,16 @@ def ClassCancelPress(): global CharGenWindow, ClassWindow + GemRB.UnloadWindow (ClassWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Alignment Selection def AlignmentPress(): global CharGenWindow, AlignmentWindow, AlignmentTable, AlignmentTextArea, AlignmentDoneButton + GemRB.SetVisible (CharGenWindow, 0) AlignmentWindow = GemRB.LoadWindow (3) AlignmentTable = GemRB.LoadTable ("aligns") @@ -989,16 +1011,17 @@ GemRB.SetVisible (AlignmentWindow, 1) return - def AlignmentSelectPress(): global AlignmentWindow, AlignmentTable, AlignmentTextArea, AlignmentDoneButton - Alignment = GemRB.GetVar ("Alignment") - 1 + + Alignment = GemRB.GetVar ("Alignment") - 1 GemRB.SetText (AlignmentWindow, AlignmentTextArea, GemRB.GetTableValue (AlignmentTable, Alignment, 1)) GemRB.SetButtonState (AlignmentWindow, AlignmentDoneButton, IE_GUI_BUTTON_ENABLED) return def AlignmentDonePress(): global CharGenWindow, CharGenState, AlignmentWindow, AlignmentButton, AbilitiesButton + GemRB.UnloadWindow (AlignmentWindow) GemRB.SetButtonState (CharGenWindow, AlignmentButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonFlags (CharGenWindow, AlignmentButton, IE_GUI_BUTTON_DEFAULT, OP_NAND) @@ -1011,15 +1034,16 @@ def AlignmentCancelPress(): global CharGenWindow, AlignmentWindow + GemRB.UnloadWindow (AlignmentWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Abilities Selection def AbilitiesPress(): global CharGenWindow, AbilitiesWindow, AbilitiesTable, AbilitiesRaceAddTable, AbilitiesRaceReqTable, AbilitiesClassReqTable, AbilitiesTextArea, AbilitiesRecallButton, AbilitiesDoneButton + GemRB.SetVisible (CharGenWindow, 0) AbilitiesWindow = GemRB.LoadWindow (4) AbilitiesTable = GemRB.LoadTable ("ABILITY") @@ -1049,8 +1073,6 @@ AbilityLabel = GemRB.GetControl (AbilitiesWindow, 0x10000003 + i) GemRB.SetLabelUseRGB (AbilitiesWindow, AbilityLabel, 1) - AbilitiesRerollPress() - AbilitiesStoreButton = GemRB.GetControl (AbilitiesWindow, 37) GemRB.SetButtonState (AbilitiesWindow, AbilitiesStoreButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent (AbilitiesWindow, AbilitiesStoreButton, IE_GUI_BUTTON_ON_PRESS, "AbilitiesStorePress") @@ -1080,12 +1102,15 @@ GemRB.SetEvent (AbilitiesWindow, AbilitiesCancelButton, IE_GUI_BUTTON_ON_PRESS, "AbilitiesCancelPress") GemRB.SetText (AbilitiesWindow, AbilitiesCancelButton, 13727) + AbilitiesRerollPress() + GemRB.SetVisible (AbilitiesWindow, 1) return def AbilitiesCalcLimits(Index): global RaceTable, AbilitiesRaceReqTable, AbilitiesRaceAddTable, ClassTable, AbilitiesClassReqTable global AbilitiesMinimum, AbilitiesMaximum, AbilitiesModifier + RaceName = GemRB.GetTableRowName (RaceTable, GemRB.GetVar ("Race") - 1) Race = GemRB.GetTableRowIndex (AbilitiesRaceReqTable, RaceName) AbilitiesMinimum = GemRB.GetTableValue (AbilitiesRaceReqTable, Race, Index * 2) @@ -1104,6 +1129,7 @@ def AbilitiesLabelPress(): global AbilitiesWindow, AbilitiesTable, AbilitiesTextArea + AbilityIndex = GemRB.GetVar ("AbilityIndex") - 1 AbilitiesCalcLimits(AbilityIndex) GemRB.SetToken ("MINIMUM", str(AbilitiesMinimum) ) @@ -1113,6 +1139,7 @@ def AbilitiesPlusPress(): global AbilitiesWindow, AbilitiesTable, AbilitiesTextArea, AbilitiesMinimum, AbilitiesMaximum + AbilityIndex = GemRB.GetVar ("AbilityIndex") - 1 AbilitiesCalcLimits(AbilityIndex) GemRB.SetToken ("MINIMUM", str(AbilitiesMinimum) ) @@ -1135,6 +1162,7 @@ def AbilitiesMinusPress(): global AbilitiesWindow, AbilitiesTable, AbilitiesTextArea, AbilitiesMinimum, AbilitiesMaximum + AbilityIndex = GemRB.GetVar ("AbilityIndex") - 1 AbilitiesCalcLimits(AbilityIndex) GemRB.SetToken ("MINIMUM", str(AbilitiesMinimum) ) @@ -1152,11 +1180,12 @@ GemRB.SetVar ("Ability0", PointsLeft) PointsLeftLabel = GemRB.GetControl (AbilitiesWindow, 0x10000002) GemRB.SetText (AbilitiesWindow, PointsLeftLabel, str(PointsLeft) ) - GemRB.SetButtonState (AlignmentWindow, AbilitiesDoneButton, IE_GUI_BUTTON_DISABLED) + GemRB.SetButtonState (AbilitiesWindow, AbilitiesDoneButton, IE_GUI_BUTTON_DISABLED) return def AbilitiesStorePress(): global AbilitiesWindow, AbilitiesRecallButton + for i in range (7): GemRB.SetVar ("Stored" + str(i), GemRB.GetVar ("Ability" + str(i))) GemRB.SetButtonState (AbilitiesWindow, AbilitiesRecallButton, IE_GUI_BUTTON_ENABLED) @@ -1164,15 +1193,22 @@ def AbilitiesRecallPress(): global AbilitiesWindow + GemRB.InvalidateWindow (AbilitiesWindow) for i in range (7): GemRB.SetVar ("Ability" + str(i), GemRB.GetVar ("Stored" + str(i)) ) AbilityLabel = GemRB.GetControl (AbilitiesWindow, 0x10000002 + i) GemRB.SetText (AbilitiesWindow, AbilityLabel, str(GemRB.GetVar ("Ability" + str(i))) ) + PointsLeft = GemRB.GetVar("Ability0") + if PointsLeft == 0: + GemRB.SetButtonState(AbilitiesWindow, AbilitiesDoneButton,IE_GUI_BUTTON_ENABLED) + else: + GemRB.SetButtonState(AbilitiesWindow, AbilitiesDoneButton,IE_GUI_BUTTON_DISABLED) return def AbilitiesRerollPress(): global AbilitiesWindow, AbilitiesMinimum, AbilitiesMaximum, AbilitiesModifier + GemRB.InvalidateWindow (AbilitiesWindow) GemRB.SetVar ("Ability0", 0) PointsLeftLabel = GemRB.GetControl (AbilitiesWindow, 0x10000002) @@ -1189,6 +1225,7 @@ GemRB.SetVar ("Ability" + str(i + 1), Value) AbilityLabel = GemRB.GetControl (AbilitiesWindow, 0x10000003 + i) GemRB.SetText (AbilitiesWindow, AbilityLabel, str(Value) ) + GemRB.SetButtonState(AbilitiesWindow, AbilitiesDoneButton,IE_GUI_BUTTON_ENABLED) return def AbilitiesDonePress(): @@ -1207,11 +1244,11 @@ def AbilitiesCancelPress(): global CharGenWindow, AbilitiesWindow + GemRB.UnloadWindow (AbilitiesWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Skills Selection def SkillsPress(): @@ -1290,6 +1327,7 @@ def SkillsSelect(): global CharGenWindow, SkillsWindow, SkillsTextArea, SkillsTable, SkillsDoneButton, RaceTable, SkillsPointsLeft + GemRB.SetVisible (CharGenWindow, 0) SkillsWindow = GemRB.LoadWindow (6) RaceName = GemRB.GetTableRowName (RaceTable, GemRB.GetVar ("Race") - 1) @@ -1348,12 +1386,14 @@ def SkillsLabelPress(): global SkillsWindow, SkillsTextArea, SkillsTable + SkillIndex = GemRB.GetVar ("SkillIndex") GemRB.SetText (SkillsWindow, SkillsTextArea, GemRB.GetTableValue (SkillsTable, SkillIndex, 1) ) return def SkillsPlusPress(): global SkillsWindow, SkillsTextArea, SkillsTable, SkillsPointsLeft + SkillIndex = GemRB.GetVar ("SkillIndex") SkillValue = GemRB.GetVar ("Skill" + str(SkillIndex)) GemRB.SetText (SkillsWindow, SkillsTextArea, GemRB.GetTableValue (SkillsTable, SkillIndex, 1) ) @@ -1371,6 +1411,7 @@ def SkillsMinusPress(): global SkillsWindow, SkillsTextArea, SkillsTable, SkillsPointsLeft + SkillIndex = GemRB.GetVar ("SkillIndex") SkillValue = GemRB.GetVar ("Skill" + str(SkillIndex)) GemRB.SetText (SkillsWindow, SkillsTextArea, GemRB.GetTableValue (SkillsTable, SkillIndex, 1) ) @@ -1387,6 +1428,7 @@ def SkillsDonePress(): global CharGenWindow, SkillsWindow, SkillsState + GemRB.UnloadWindow (SkillsWindow) SkillsState = 1 GemRB.SetVisible (CharGenWindow, 1) @@ -1395,16 +1437,17 @@ def SkillsCancelPress(): global CharGenWindow, SkillsWindow, SkillsState + GemRB.UnloadWindow (SkillsWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) return - # Racial Enemy Selection def RacialEnemySelect(): global CharGenWindow, RacialEnemyWindow, RacialEnemyTable, RacialEnemyTextArea, RacialEnemyDoneButton + GemRB.SetVisible (CharGenWindow, 0) RacialEnemyWindow = GemRB.LoadWindow (15) RacialEnemyTable = GemRB.LoadTable ("ENEMIES") @@ -1446,6 +1489,7 @@ def DisplayRacialEnemies(): global RacialEnemyWindow, RacialEnemyTable + RacialEnemyIndex = GemRB.GetVar ("RacialEnemyIndex") for i in range (2, 8): RacialEnemySelectButton = GemRB.GetControl (RacialEnemyWindow, i) @@ -1454,6 +1498,7 @@ def RacialEnemySelectPress(): global RacialEnemyWindow, RacialEnemyDoneButton, RacialEnemyTable, RacialEnemyTextArea + RacialEnemy = GemRB.GetVar ("RacialEnemyIndex") + GemRB.GetVar ("RacialEnemy") - 1 GemRB.SetText (RacialEnemyWindow, RacialEnemyTextArea, GemRB.GetTableValue (RacialEnemyTable, RacialEnemy, 1) ) GemRB.SetVar ("HatedRace", GemRB.GetTableValue (RacialEnemyTable, RacialEnemy, 3) ) @@ -1462,6 +1507,7 @@ def RacialEnemyDonePress(): global CharGenWindow, RacialEnemyWindow, SkillsState + GemRB.UnloadWindow (RacialEnemyWindow) SkillsState = 1 GemRB.SetVisible (CharGenWindow, 1) @@ -1470,6 +1516,7 @@ def RacialEnemyCancelPress(): global CharGenWindow, RacialEnemyWindow, SkillsState + GemRB.UnloadWindow (RacialEnemyWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) @@ -1480,6 +1527,7 @@ def ProficienciesSelect(): global CharGenWindow, ProficienciesWindow, ProficienciesTable, ProficienciesTextArea, ProficienciesPointsLeft, ProficienciesDoneButton, ClassTable, ProfsMaxTable + GemRB.SetVisible (CharGenWindow, 0) ProficienciesWindow = GemRB.LoadWindow (9) ClassName = GemRB.GetTableRowName (ClassTable, GemRB.GetVar ("Class") - 1) @@ -1581,6 +1629,7 @@ def ProficienciesLabelPress(): global ProficienciesWindow, ProficienciesTable, ProficienciesTextArea + ProficienciesIndex = GemRB.GetVar ("ProficienciesIndex") - 1 GemRB.SetText (ProficienciesWindow, ProficienciesTextArea, GemRB.GetTableValue (ProficienciesTable, ProficienciesIndex, 2) ) return @@ -1636,6 +1685,7 @@ def ProficienciesDonePress(): global CharGenWindow, ProficienciesWindow, SkillsState + GemRB.UnloadWindow (ProficienciesWindow) SkillsState = 2 GemRB.SetVisible (CharGenWindow, 1) @@ -1644,12 +1694,12 @@ def ProficienciesCancelPress(): global CharGenWindow, ProficienciesWindow, SkillsState + GemRB.UnloadWindow (ProficienciesWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) return - # Spells Selection def MageSpellsSelect(SpellTable, Level, SpellLevel): @@ -1749,6 +1799,7 @@ def MageSpellsDonePress(): global CharGenWindow, MageSpellsWindow, SkillsState + GemRB.UnloadWindow (MageSpellsWindow) SkillsState = 3 GemRB.SetVisible (CharGenWindow, 1) @@ -1757,6 +1808,7 @@ def MageSpellsCancelPress(): global CharGenWindow, MageSpellsWindow, SkillsState + GemRB.UnloadWindow (MageSpellsWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) @@ -1867,6 +1919,7 @@ def MageMemorizeDonePress(): global CharGenWindow, MageMemorizeWindow, SkillsState + GemRB.UnloadWindow (MageMemorizeWindow) SkillsState = 4 GemRB.SetVisible (CharGenWindow, 1) @@ -1875,12 +1928,12 @@ def MageMemorizeCancelPress(): global CharGenWindow, MageMemorizeWindow, SkillsState + GemRB.UnloadWindow (MageMemorizeWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) return - # Priest Spells Memorize def PriestSpellsMemorize(SpellTable, Level, SpellLevel): @@ -1938,6 +1991,7 @@ def PriestMemorizeSelectPress(): global PriestMemorizeWindow, Learnable, PriestMemorizeTextArea, PriestMemorizeDoneButton, PriestMemorizePointsLeft + PriestMemorized = GemRB.GetVar ("PriestMemorized") SpellMask = GemRB.GetVar ("SpellMask") Spell = abs(PriestMemorized - SpellMask) @@ -1973,6 +2027,7 @@ def PriestMemorizeDonePress(): global CharGenWindow, PriestMemorizeWindow, SkillsState + GemRB.UnloadWindow (PriestMemorizeWindow) SkillsState = 5 GemRB.SetVisible (CharGenWindow, 1) @@ -1981,12 +2036,12 @@ def PriestMemorizeCancelPress(): global CharGenWindow, PriestMemorizeWindow, SkillsState + GemRB.UnloadWindow (PriestMemorizeWindow) SkillsState = 0 GemRB.SetVisible (CharGenWindow, 1) return - # Appearance Selection def AppearancePress(): @@ -2054,6 +2109,7 @@ def DrawAvatar(): global AppearanceAvatarButton, RaceTable, ClassTable + AppearanceAvatarTable = GemRB.LoadTable ("pdolls") AvatarID = 0x6000 table = GemRB.LoadTable ("avprefr") @@ -2092,6 +2148,7 @@ def AppearanceColorChoice (CurrentColor): global AppearanceWindow, AppearanceColorWindow + GemRB.SetVisible (AppearanceWindow, 0) AppearanceColorWindow = GemRB.LoadWindow (14) AppearanceColorTable = GemRB.LoadTable ("clowncol") @@ -2144,6 +2201,7 @@ def AppearanceDonePress(): global CharGenWindow, AppearanceWindow + GemRB.UnloadWindow (AppearanceWindow) GemRB.SetVisible (CharGenWindow, 1) CharSoundSelect() @@ -2151,11 +2209,11 @@ def AppearanceCancelPress(): global CharGenWindow, AppearanceWindow + GemRB.UnloadWindow (AppearanceWindow) GemRB.SetVisible (CharGenWindow, 1) return - def CharSoundSelect(): global CharGenWindow, CharSoundWindow, CharSoundTable, CharSoundStrings global CharSoundVoiceList @@ -2202,6 +2260,7 @@ def CharSoundDonePress(): global CharGenWindow, CharSoundWindow, AppearanceButton, BiographyButton, NameButton, CharGenState + GemRB.UnloadWindow (CharSoundWindow) GemRB.SetButtonState (CharGenWindow, AppearanceButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonFlags (CharGenWindow, AppearanceButton, IE_GUI_BUTTON_DEFAULT, OP_NAND) @@ -2214,15 +2273,16 @@ def CharSoundCancelPress(): global CharGenWindow, CharSoundWindow + GemRB.UnloadWindow (CharSoundWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Biography Selection def BiographyPress(): global CharGenWindow, BiographyWindow, BiographyField + GemRB.SetVisible (CharGenWindow, 0) BiographyWindow = GemRB.LoadWindow (51) @@ -2250,27 +2310,30 @@ def BiographyClearPress(): global BiographyWindow, BiographyField + GemRB.SetText (BiographyWindow, BiographyField, "") return def BiographyCancelPress(): global CharGenWindow, BiographyWindow + GemRB.UnloadWindow (BiographyWindow) GemRB.SetVisible (CharGenWindow, 1) return def BiographyDonePress(): global CharGenWindow, BiographyWindow, BiographyField + GemRB.SetToken ("Biography", GemRB.QueryText (BiographyWindow, BiographyField) ) GemRB.UnloadWindow (BiographyWindow) GemRB.SetVisible (CharGenWindow, 1) return - # Name Selection def NamePress(): global CharGenWindow, NameWindow, NameDoneButton, NameField + GemRB.SetVisible (CharGenWindow, 0) NameWindow = GemRB.LoadWindow (5) @@ -2294,6 +2357,7 @@ def NameEditChange(): global NameField + if GemRB.QueryText (NameWindow, NameField) == "": GemRB.SetButtonState (NameWindow, NameDoneButton, IE_GUI_BUTTON_DISABLED) else: @@ -2302,6 +2366,7 @@ def NameDonePress(): global CharGenWindow, CharGenState, NameWindow, NameField, AcceptButton + GemRB.SetToken ("CHARNAME", GemRB.QueryText (NameWindow, NameField) ) GemRB.UnloadWindow (NameWindow) CharGenState = 8 @@ -2323,6 +2388,7 @@ def ImportPress(): global CharGenWindow, ImportWindow + GemRB.SetVisible (CharGenWindow, 0) ImportWindow = GemRB.LoadWindow (20) @@ -2352,7 +2418,7 @@ def ImportCancelPress(): global CharGenWindow, ImportWindow + GemRB.UnloadWindow (ImportWindow) GemRB.SetVisible (CharGenWindow, 1) return - Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICG4.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICG4.py 2007-09-26 22:17:16 UTC (rev 4801) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICG4.py 2007-09-28 20:06:50 UTC (rev 4802) @@ -51,11 +51,12 @@ return def RollPress(): - global Minimum, Maximum, Add, HasStrExtra + global Minimum, Maximum, Add, HasStrExtra, PointsLeft GemRB.InvalidateWindow(AbilityWindow) GemRB.SetVar("Ability",0) GemRB.SetVar("Ability -1",0) + PointsLeft = 0 SumLabel = GemRB.GetControl(AbilityWindow, 0x10000002) GemRB.SetText(AbilityWindow, SumLabel, "0") GemRB.SetLabelUseRGB(AbilityWindow, SumLabel, 1) @@ -65,7 +66,7 @@ else: e = 0 GemRB.SetVar("StrExtra", e) - for i in range(0,6): + for i in range(6): dice = 3 size = 5 CalcLimits(i) @@ -81,6 +82,7 @@ else: GemRB.SetText(AbilityWindow, Label, str(v) ) GemRB.SetLabelUseRGB(AbilityWindow, Label, 1) + GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_ENABLED) return def OnLoad(): @@ -111,9 +113,22 @@ AbilityTable = GemRB.LoadTable("ability") AbilityWindow = GemRB.LoadWindow(4) + RerollButton = GemRB.GetControl(AbilityWindow,2) + GemRB.SetText(AbilityWindow,RerollButton,11982) + StoreButton = GemRB.GetControl(AbilityWindow,37) + GemRB.SetText(AbilityWindow,StoreButton,17373) + RecallButton = GemRB.GetControl(AbilityWindow,38) + GemRB.SetText(AbilityWindow,RecallButton,17374) + + BackButton = GemRB.GetControl(AbilityWindow,36) + GemRB.SetText(AbilityWindow,BackButton,15416) + DoneButton = GemRB.GetControl(AbilityWindow,0) + GemRB.SetText(AbilityWindow,DoneButton,11973) + GemRB.SetButtonFlags(AbilityWindow, DoneButton, IE_GUI_BUTTON_DEFAULT,OP_OR) + RollPress() StorePress() - for i in range(0,6): + for i in range(6): Label = GemRB.GetControl(AbilityWindow, i+0x10000009) GemRB.SetEvent(AbilityWindow, Label, IE_GUI_LABEL_ON_PRESS, "OverPress"+str(i) ) Button = GemRB.GetControl(AbilityWindow, i+30) @@ -129,19 +144,6 @@ GemRB.SetEvent(AbilityWindow, Button, IE_GUI_BUTTON_ON_PRESS, "RightPress") GemRB.SetVarAssoc(AbilityWindow, Button, "Ability", i ) - RerollButton = GemRB.GetControl(AbilityWindow,2) - GemRB.SetText(AbilityWindow,RerollButton,11982) - StoreButton = GemRB.GetControl(AbilityWindow,37) - GemRB.SetText(AbilityWindow,StoreButton,17373) - RecallButton = GemRB.GetControl(AbilityWindow,38) - GemRB.SetText(AbilityWindow,RecallButton,17374) - - BackButton = GemRB.GetControl(AbilityWindow,36) - GemRB.SetText(AbilityWindow,BackButton,15416) - DoneButton = GemRB.GetControl(AbilityWindow,0) - GemRB.SetText(AbilityWindow,DoneButton,11973) - GemRB.SetButtonFlags(AbilityWindow, DoneButton, IE_GUI_BUTTON_DEFAULT,OP_OR) - TextAreaControl = GemRB.GetControl(AbilityWindow, 29) GemRB.SetText(AbilityWindow,TextAreaControl,17247) @@ -232,6 +234,8 @@ return def RecallPress(): + global PointsLeft + GemRB.InvalidateWindow(AbilityWindow) e=GemRB.GetVar("StoredStrExtra") GemRB.SetVar("StrExtra",e) @@ -243,6 +247,12 @@ GemRB.SetText(AbilityWindow, Label, "18/"+str(e) ) else: GemRB.SetText(AbilityWindow, Label, str(v) ) + + PointsLeft = GemRB.GetVar("Ability -1") + if PointsLeft == 0: + GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_ENABLED) + else: + GemRB.SetButtonState(AbilityWindow, DoneButton,IE_GUI_BUTTON_DISABLED) return def BackPress(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-11-05 23:23:25
|
Revision: 4812 http://gemrb.svn.sourceforge.net/gemrb/?rev=4812&view=rev Author: avenger_teambg Date: 2007-11-05 15:23:19 -0800 (Mon, 05 Nov 2007) Log Message: ----------- bg2: fixed guiscript for the party AI button Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-11-04 17:24:05 UTC (rev 4811) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-11-05 23:23:19 UTC (rev 4812) @@ -118,10 +118,12 @@ if AI: GemRB.GameSetScreenFlags(GS_PARTYAI, OP_NAND) - GemRB.SetTooltip (PortraitWindow, Button, 15917) + GemRB.SetTooltip (PortraitWindow, Button, 15918) + GemRB.SetVar ("AI", 0) else: GemRB.GameSetScreenFlags(GS_PARTYAI, OP_OR) - GemRB.SetTooltip (PortraitWindow, Button, 15918) + GemRB.SetTooltip (PortraitWindow, Button, 15917) + GemRB.SetVar ("AI", GS_PARTYAI) return def RestPress (): @@ -498,9 +500,14 @@ # AI Button = GemRB.GetControl (Window, 6) + #fixing a gui bug, and while we are at it, hacking it to be easier + GemRB.SetButtonSprites (Window, Button, "GUIBTACT",0,48,47,46,49) GSFlags = GemRB.GetMessageWindowSize ()&GS_PARTYAI + + GemRB.SetVar ("AI", GSFlags) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "AIPress") - GemRB.SetVarAssoc (Window, Button, "", GSFlags) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) + GemRB.SetVarAssoc (Window, Button, "AI", 1) if GSFlags: GemRB.SetTooltip (PortraitWindow, Button, 15917) else: Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-11-04 17:24:05 UTC (rev 4811) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-11-05 23:23:19 UTC (rev 4812) @@ -118,10 +118,12 @@ if AI: GemRB.GameSetScreenFlags(GS_PARTYAI, OP_NAND) - GemRB.SetTooltip (PortraitWindow, Button, 15917) + GemRB.SetTooltip (PortraitWindow, Button, 15918) + GemRB.SetVar ("AI", 0) else: GemRB.GameSetScreenFlags(GS_PARTYAI, OP_OR) - GemRB.SetTooltip (PortraitWindow, Button, 15918) + GemRB.SetTooltip (PortraitWindow, Button, 15917) + GemRB.SetVar ("AI", GS_PARTYAI) return def RestPress (): @@ -498,9 +500,14 @@ # AI Button = GemRB.GetControl (Window, 6) + #fixing a gui bug, and while we are at it, hacking it to be easier + GemRB.SetButtonSprites (Window, Button, "GUIBTACT",0,48,47,46,49) GSFlags = GemRB.GetMessageWindowSize ()&GS_PARTYAI + + GemRB.SetVar ("AI", GSFlags) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "AIPress") - GemRB.SetVarAssoc (Window, Button, "", GSFlags) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_CHECKBOX, OP_OR) + GemRB.SetVarAssoc (Window, Button, "AI", 1) if GSFlags: GemRB.SetTooltip (PortraitWindow, Button, 15917) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-11-11 11:06:24
|
Revision: 4818 http://gemrb.svn.sourceforge.net/gemrb/?rev=4818&view=rev Author: avenger_teambg Date: 2007-11-11 02:07:08 -0800 (Sun, 11 Nov 2007) Log Message: ----------- Fixed ability order in character generation Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/CharGen9.py gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py gemrb/trunk/gemrb/GUIScripts/how/CharGen.py gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py gemrb/trunk/gemrb/GUIScripts/iwd2/CharGen9.py gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/CharGen9.py 2007-11-08 20:36:07 UTC (rev 4817) +++ gemrb/trunk/gemrb/GUIScripts/bg1/CharGen9.py 2007-11-11 10:07:08 UTC (rev 4818) @@ -193,10 +193,10 @@ else: GemRB.SetPlayerStat (MyChar, IE_STREXTRA,0) - GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability 1")) - GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability 2")) - GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability 3")) - GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability 4")) + GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability 1")) + GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability 2")) + GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability 3")) + GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability 4")) GemRB.SetPlayerStat (MyChar, IE_CHR, GemRB.GetVar ("Ability 5")) #setting skills (thieving/ranger) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-11-08 20:36:07 UTC (rev 4817) +++ gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-11-11 10:07:08 UTC (rev 4818) @@ -209,10 +209,10 @@ else: GemRB.SetPlayerStat (MyChar, IE_STREXTRA,0) - GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability 1")) - GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability 2")) - GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability 3")) - GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability 4")) + GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability 1")) + GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability 2")) + GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability 3")) + GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability 4")) GemRB.SetPlayerStat (MyChar, IE_CHR, GemRB.GetVar ("Ability 5")) #setting skills (thieving/ranger) Modified: gemrb/trunk/gemrb/GUIScripts/how/CharGen.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/CharGen.py 2007-11-08 20:36:07 UTC (rev 4817) +++ gemrb/trunk/gemrb/GUIScripts/how/CharGen.py 2007-11-11 10:07:08 UTC (rev 4818) @@ -355,10 +355,10 @@ else: GemRB.SetPlayerStat (MyChar, IE_STREXTRA, 0) - GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability2")) - GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability3")) - GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability4")) - GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability5")) + GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability2")) + GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability3")) + GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability4")) + GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability5")) GemRB.SetPlayerStat (MyChar, IE_CHR, GemRB.GetVar ("Ability6")) GemRB.SetPlayerName (MyChar, GemRB.GetToken ("CHARNAME"), 0) Modified: gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py 2007-11-08 20:36:07 UTC (rev 4817) +++ gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py 2007-11-11 10:07:08 UTC (rev 4818) @@ -355,10 +355,10 @@ else: GemRB.SetPlayerStat (MyChar, IE_STREXTRA, 0) - GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability2")) - GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability3")) - GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability4")) - GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability5")) + GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability2")) + GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability3")) + GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability4")) + GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability5")) GemRB.SetPlayerStat (MyChar, IE_CHR, GemRB.GetVar ("Ability6")) GemRB.SetPlayerName (MyChar, GemRB.GetToken ("CHARNAME"), 0) Modified: gemrb/trunk/gemrb/GUIScripts/iwd2/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd2/CharGen9.py 2007-11-08 20:36:07 UTC (rev 4817) +++ gemrb/trunk/gemrb/GUIScripts/iwd2/CharGen9.py 2007-11-11 10:07:08 UTC (rev 4818) @@ -320,10 +320,10 @@ else: GemRB.SetPlayerStat (MyChar, IE_STREXTRA,0) - GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability 2")) - GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability 3")) - GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability 4")) - GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability 5")) + GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability 2")) + GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability 3")) + GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability 4")) + GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability 5")) GemRB.SetPlayerStat (MyChar, IE_CHR, GemRB.GetVar ("Ability 6")) GemRB.SetPlayerName (MyChar, GemRB.GetToken ("CHARNAME"), 0) Modified: gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-11-08 20:36:07 UTC (rev 4817) +++ gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-11-11 10:07:08 UTC (rev 4818) @@ -209,10 +209,10 @@ else: GemRB.SetPlayerStat (MyChar, IE_STREXTRA,0) - GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability 1")) - GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability 2")) - GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability 3")) - GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability 4")) + GemRB.SetPlayerStat (MyChar, IE_DEX, GemRB.GetVar ("Ability 1")) + GemRB.SetPlayerStat (MyChar, IE_CON, GemRB.GetVar ("Ability 2")) + GemRB.SetPlayerStat (MyChar, IE_INT, GemRB.GetVar ("Ability 3")) + GemRB.SetPlayerStat (MyChar, IE_WIS, GemRB.GetVar ("Ability 4")) GemRB.SetPlayerStat (MyChar, IE_CHR, GemRB.GetVar ("Ability 5")) #setting skills (thieving/ranger) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-11-16 20:01:59
|
Revision: 4831 http://gemrb.svn.sourceforge.net/gemrb/?rev=4831&view=rev Author: avenger_teambg Date: 2007-11-16 12:02:02 -0800 (Fri, 16 Nov 2007) Log Message: ----------- repeatedly pressing the pc icons will center on them Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-11-15 21:55:18 UTC (rev 4830) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-11-16 20:02:02 UTC (rev 4831) @@ -553,6 +553,8 @@ i = GemRB.GetVar ("PressedPortrait") if (not SelectionChangeHandler): + if GemRB.GameIsPCSelected (i+1): + GemRB.GameControlSetScreenFlags (SF_CENTERONACTOR, OP_OR) GemRB.GameSelectPC (i + 1, True, SELECT_REPLACE) else: GemRB.GameSelectPCSingle (i + 1) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-11-15 21:55:18 UTC (rev 4830) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-11-16 20:02:02 UTC (rev 4831) @@ -582,6 +582,8 @@ i = GemRB.GetVar ("PressedPortrait") if (not SelectionChangeHandler): + if GemRB.GameIsPCSelected (i+1): + GemRB.GameControlSetScreenFlags (SF_CENTERONACTOR, OP_OR) GemRB.GameSelectPC (i + 1, True, SELECT_REPLACE) else: GemRB.GameSelectPCSingle (i + 1) Modified: gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-11-15 21:55:18 UTC (rev 4830) +++ gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-11-16 20:02:02 UTC (rev 4831) @@ -560,6 +560,8 @@ i = GemRB.GetVar ("PressedPortrait") if (not SelectionChangeHandler): + if GemRB.GameIsPCSelected (i+1): + GemRB.GameControlSetScreenFlags (SF_CENTERONACTOR, OP_OR) GemRB.GameSelectPC (i + 1, True, SELECT_REPLACE) else: GemRB.GameSelectPCSingle (i + 1) Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-11-15 21:55:18 UTC (rev 4830) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-11-16 20:02:02 UTC (rev 4831) @@ -551,6 +551,8 @@ i = GemRB.GetVar ("PressedPortrait") if (not SelectionChangeHandler): + if GemRB.GameIsPCSelected (i+1): + GemRB.GameControlSetScreenFlags (SF_CENTERONACTOR, OP_OR) GemRB.GameSelectPC (i + 1, True, SELECT_REPLACE) else: GemRB.GameSelectPCSingle (i + 1) Modified: gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py 2007-11-15 21:55:18 UTC (rev 4830) +++ gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py 2007-11-16 20:02:02 UTC (rev 4831) @@ -369,6 +369,8 @@ i = GemRB.GetVar ("PressedPortrait") if (not SelectionChangeHandler): + if GemRB.GameIsPCSelected (i+1): + GemRB.GameControlSetScreenFlags (SF_CENTERONACTOR, OP_OR) GemRB.GameSelectPC (i + 1, True, SELECT_REPLACE) else: GemRB.GameSelectPCSingle (i + 1) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-11-15 21:55:18 UTC (rev 4830) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-11-16 20:02:02 UTC (rev 4831) @@ -582,6 +582,8 @@ i = GemRB.GetVar ("PressedPortrait") if (not SelectionChangeHandler): + if GemRB.GameIsPCSelected (i+1): + GemRB.GameControlSetScreenFlags (SF_CENTERONACTOR, OP_OR) GemRB.GameSelectPC (i + 1, True, SELECT_REPLACE) else: GemRB.GameSelectPCSingle (i + 1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-11-18 13:48:53
|
Revision: 4835 http://gemrb.svn.sourceforge.net/gemrb/?rev=4835&view=rev Author: avenger_teambg Date: 2007-11-18 05:48:48 -0800 (Sun, 18 Nov 2007) Log Message: ----------- iwd/bg2:fixed spell buttons at character generation Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py gemrb/trunk/gemrb/GUIScripts/how/CharGen.py gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py 2007-11-18 13:44:45 UTC (rev 4834) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py 2007-11-18 13:48:48 UTC (rev 4835) @@ -58,7 +58,8 @@ GemRB.SetButtonFlags(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_CHECKBOX, OP_OR) if i < len(Learnable): Spell = GemRB.GetSpell(Learnable[i]) - GemRB.SetSpellIcon(MageSpellsWindow, SpellButton, Learnable[i]) + GemRB.SetButtonSprites(MageSpellsWindow, SpellButton, "GUIBTBUT", 0,0,1,2,3) + GemRB.SetSpellIcon(MageSpellsWindow, SpellButton, Learnable[i], 1) GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ON_PRESS, "MageSpellsSelectPress") GemRB.SetVarAssoc(MageSpellsWindow, SpellButton, "SpellMask", 1 << i) Modified: gemrb/trunk/gemrb/GUIScripts/how/CharGen.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/CharGen.py 2007-11-18 13:44:45 UTC (rev 4834) +++ gemrb/trunk/gemrb/GUIScripts/how/CharGen.py 2007-11-18 13:48:48 UTC (rev 4835) @@ -1731,7 +1731,7 @@ GemRB.SetButtonFlags (MageSpellsWindow, SpellButton, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_CHECKBOX, OP_OR) if i < len(Learnable): Spell = GemRB.GetSpell (Learnable[i]) - GemRB.SetSpellIcon(MageSpellsWindow, SpellButton, Learnable[i]) + GemRB.SetSpellIcon(MageSpellsWindow, SpellButton, Learnable[i], 1) GemRB.SetButtonState (MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent (MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ON_PRESS, "MageSpellsSelectPress") GemRB.SetVarAssoc (MageSpellsWindow, SpellButton, "SpellMask", 1 << i) Modified: gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py 2007-11-18 13:44:45 UTC (rev 4834) +++ gemrb/trunk/gemrb/GUIScripts/iwd/CharGen.py 2007-11-18 13:48:48 UTC (rev 4835) @@ -1731,7 +1731,7 @@ GemRB.SetButtonFlags (MageSpellsWindow, SpellButton, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_CHECKBOX, OP_OR) if i < len(Learnable): Spell = GemRB.GetSpell (Learnable[i]) - GemRB.SetSpellIcon(MageSpellsWindow, SpellButton, Learnable[i]) + GemRB.SetSpellIcon(MageSpellsWindow, SpellButton, Learnable[i], 1) GemRB.SetButtonState (MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent (MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ON_PRESS, "MageSpellsSelectPress") GemRB.SetVarAssoc (MageSpellsWindow, SpellButton, "SpellMask", 1 << i) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py 2007-11-18 13:44:45 UTC (rev 4834) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py 2007-11-18 13:48:48 UTC (rev 4835) @@ -58,7 +58,8 @@ GemRB.SetButtonFlags(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_PICTURE|IE_GUI_BUTTON_CHECKBOX, OP_OR) if i < len(Learnable): Spell = GemRB.GetSpell(Learnable[i]) - GemRB.SetSpellIcon(MageSpellsWindow, SpellButton, Learnable[i]) + GemRB.SetButtonSprites(MageSpellsWindow, SpellButton, "GUIBTBUT", 0,0,1,2,3) + GemRB.SetSpellIcon(MageSpellsWindow, SpellButton, Learnable[i], 1) GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ENABLED) GemRB.SetEvent(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ON_PRESS, "MageSpellsSelectPress") GemRB.SetVarAssoc(MageSpellsWindow, SpellButton, "SpellMask", 1 << i) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-11-23 18:18:12
|
Revision: 4840 http://gemrb.svn.sourceforge.net/gemrb/?rev=4840&view=rev Author: avenger_teambg Date: 2007-11-23 10:18:16 -0800 (Fri, 23 Nov 2007) Log Message: ----------- fixed getlearnablespells for mage schools Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-11-23 16:22:51 UTC (rev 4839) +++ gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-11-23 18:18:16 UTC (rev 4840) @@ -122,6 +122,7 @@ MyChar = GemRB.GetVar ("Slot") GemRB.CreatePlayer ("charbase", MyChar ) GemRB.SetPlayerStat (MyChar, IE_SEX, GemRB.GetVar ("Gender") ) + KitTable = GemRB.LoadTable ("kitlist") RaceTable = GemRB.LoadTable ("races") Race = GemRB.GetVar ("Race")-1 GemRB.SetPlayerStat (MyChar, IE_RACE, GemRB.GetTableValue (RaceTable, Race, 3) ) @@ -130,7 +131,8 @@ Class = GemRB.GetTableValue (ClassTable, ClassIndex, 5) GemRB.SetPlayerStat (MyChar, IE_CLASS, Class) KitIndex = GemRB.GetVar ("Class Kit") - GemRB.SetPlayerStat (MyChar, IE_KIT, KitIndex) + KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) + GemRB.SetPlayerStat (MyChar, IE_KIT, KitValue) t = GemRB.GetVar ("Alignment") GemRB.SetPlayerStat (MyChar, IE_ALIGNMENT, t) @@ -139,7 +141,7 @@ TableName = GemRB.GetTableValue (TmpTable, Class, 1, 0) if TableName != "*": SetupSpellLevels(MyChar, TableName, IE_SPELL_TYPE_WIZARD, 1) - Learnable = GetLearnableMageSpells( KitIndex, t, 1) + Learnable = GetLearnableMageSpells( KitValue, t, 1) SpellBook = GemRB.GetVar ("MageSpellBook") j=1 for i in range(len(Learnable) ): Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py 2007-11-23 16:22:51 UTC (rev 4839) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py 2007-11-23 18:18:16 UTC (rev 4840) @@ -53,25 +53,21 @@ Button = GemRB.GetControl(KitWindow, i+1) else: Button = GemRB.GetControl(KitWindow, i+5) + if KitTable == -1: if ClassID == 1: Kit=GemRB.GetVar("MAGESCHOOL") KitName = GemRB.GetTableValue(SchoolList, i, 0) + Kit = GemRB.GetTableValue (SchoolList, Kit, 3) else: - Kit = 0 KitName = GemRB.GetTableValue(ClassList, GemRB.GetVar("Class")-1, 0) else: Kit = GemRB.GetTableValue(KitTable,i,0) - if ClassID == 1: - if Kit: - Kit = Kit - 21 - KitName = GemRB.GetTableValue(SchoolList, Kit, 0) + if Kit: + KitName = GemRB.GetTableValue(KitList, Kit, 1) else: - if Kit: - KitName = GemRB.GetTableValue(KitList, Kit, 1) - else: - KitName = GemRB.GetTableValue(ClassList, GemRB.GetVar("Class")-1, 0) + KitName = GemRB.GetTableValue(ClassList, GemRB.GetVar("Class")-1, 0) GemRB.SetButtonState(KitWindow, Button, IE_GUI_BUTTON_ENABLED) GemRB.SetText(KitWindow, Button, KitName) @@ -100,10 +96,7 @@ if Kit == 0: KitName = GemRB.GetTableValue(ClassList, GemRB.GetVar("Class")-1, 1) else: - if ClassID==1: - KitName = GemRB.GetTableValue(SchoolList, Kit, 1) - else: - KitName = GemRB.GetTableValue(KitList, Kit, 3) + KitName = GemRB.GetTableValue(KitList, Kit, 3) GemRB.SetText(KitWindow, TextAreaControl, KitName) GemRB.SetButtonState(KitWindow, DoneButton, IE_GUI_BUTTON_ENABLED) return Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py 2007-11-23 16:22:51 UTC (rev 4839) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py 2007-11-23 18:18:16 UTC (rev 4840) @@ -33,6 +33,7 @@ AlignmentTable = GemRB.LoadTable("aligns") ClassTable = GemRB.LoadTable("classes") + KitTable = GemRB.LoadTable("kitlist") ClassRow = GemRB.GetVar("Class")-1 Class = GemRB.GetTableValue(ClassTable, ClassRow, 5) TmpTable = GemRB.LoadTable("clskills") @@ -44,7 +45,11 @@ GemRB.LoadWindowPack("GUICG", 640, 480) MageSpellsWindow = GemRB.LoadWindow(7) v = GemRB.GetVar("Alignment") - Learnable = GetLearnableMageSpells( GemRB.GetVar("Class Kit"), v, 1) + KitIndex = GemRB.GetVar("Class Kit") + print "KitIndex",KitIndex + KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) + print "KitValue",KitValue + Learnable = GetLearnableMageSpells( KitValue, v, 1) GemRB.SetVar("MageSpellBook", 0) GemRB.SetVar("SpellMask", 0) Modified: gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-11-23 16:22:51 UTC (rev 4839) +++ gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-11-23 18:18:16 UTC (rev 4840) @@ -122,6 +122,7 @@ MyChar = GemRB.GetVar ("Slot") GemRB.CreatePlayer ("charbase", MyChar ) GemRB.SetPlayerStat (MyChar, IE_SEX, GemRB.GetVar ("Gender") ) + KitTable = GemRB.LoadTable ("kitlist") RaceTable = GemRB.LoadTable ("races") Race = GemRB.GetVar ("Race")-1 GemRB.SetPlayerStat (MyChar, IE_RACE, GemRB.GetTableValue (RaceTable, Race, 3) ) @@ -130,7 +131,8 @@ Class = GemRB.GetTableValue (ClassTable, ClassIndex, 5) GemRB.SetPlayerStat (MyChar, IE_CLASS, Class) KitIndex = GemRB.GetVar ("Class Kit") - GemRB.SetPlayerStat (MyChar, IE_KIT, KitIndex) + KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) + GemRB.SetPlayerStat (MyChar, IE_KIT, KitValue) t = GemRB.GetVar ("Alignment") GemRB.SetPlayerStat (MyChar, IE_ALIGNMENT, t) @@ -139,7 +141,7 @@ TableName = GemRB.GetTableValue (TmpTable, Class, 1, 0) if TableName != "*": SetupSpellLevels(MyChar, TableName, IE_SPELL_TYPE_WIZARD, 1) - Learnable = GetLearnableMageSpells( KitIndex, t, 1) + Learnable = GetLearnableMageSpells( KitValue, t, 1) SpellBook = GemRB.GetVar ("MageSpellBook") j=1 for i in range(len(Learnable) ): Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py 2007-11-23 16:22:51 UTC (rev 4839) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py 2007-11-23 18:18:16 UTC (rev 4840) @@ -53,21 +53,17 @@ Button = GemRB.GetControl(KitWindow, i+1) else: Button = GemRB.GetControl(KitWindow, i+5) + if KitTable == -1: if ClassID == 1: Kit=GemRB.GetVar("MAGESCHOOL") KitName = GemRB.GetTableValue(SchoolList, i, 0) + Kit = GemRB.GetTableValue (SchoolList, Kit, 3) else: - Kit = 0 KitName = GemRB.GetTableValue(ClassList, GemRB.GetVar("Class")-1, 0) else: Kit = GemRB.GetTableValue(KitTable,i,0) - #if ClassID == 1: - # if Kit: - # Kit = Kit - 21 - # KitName = GemRB.GetTableValue(SchoolList, Kit, 0) - #else: if Kit: KitName = GemRB.GetTableValue(KitList, Kit, 1) else: @@ -100,9 +96,6 @@ if Kit == 0: KitName = GemRB.GetTableValue(ClassList, GemRB.GetVar("Class")-1, 1) else: - #if ClassID==1: - # KitName = GemRB.GetTableValue(SchoolList, Kit, 1) - #else: KitName = GemRB.GetTableValue(KitList, Kit, 3) GemRB.SetText(KitWindow, TextAreaControl, KitName) GemRB.SetButtonState(KitWindow, DoneButton, IE_GUI_BUTTON_ENABLED) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py 2007-11-23 16:22:51 UTC (rev 4839) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py 2007-11-23 18:18:16 UTC (rev 4840) @@ -33,6 +33,7 @@ AlignmentTable = GemRB.LoadTable("aligns") ClassTable = GemRB.LoadTable("classes") + KitTable = GemRB.LoadTable("kitlist") ClassRow = GemRB.GetVar("Class")-1 Class = GemRB.GetTableValue(ClassTable, ClassRow, 5) TmpTable = GemRB.LoadTable("clskills") @@ -44,7 +45,11 @@ GemRB.LoadWindowPack("GUICG", 640, 480) MageSpellsWindow = GemRB.LoadWindow(7) v = GemRB.GetVar("Alignment") - Learnable = GetLearnableMageSpells( GemRB.GetVar("Class Kit"), v, 1) + KitIndex = GemRB.GetVar("Class Kit") + print "KitIndex",KitIndex + KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) + print "KitValue",KitValue + Learnable = GetLearnableMageSpells( KitValue, v, 1) GemRB.SetVar("MageSpellBook", 0) GemRB.SetVar("SpellMask", 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-11-24 14:07:06
|
Revision: 4842 http://gemrb.svn.sourceforge.net/gemrb/?rev=4842&view=rev Author: avenger_teambg Date: 2007-11-24 06:07:10 -0800 (Sat, 24 Nov 2007) Log Message: ----------- bg2/tob:fixed kit selection (hopefully) fixed import script added export script Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py gemrb/trunk/gemrb/GUIScripts/bg2/ImportFile.py gemrb/trunk/gemrb/GUIScripts/bg2/Start.py gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py gemrb/trunk/gemrb/GUIScripts/tob/ImportFile.py gemrb/trunk/gemrb/GUIScripts/tob/Start2.py Added Paths: ----------- gemrb/trunk/gemrb/GUIScripts/bg2/ExportFile.py gemrb/trunk/gemrb/GUIScripts/tob/ExportFile.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-11-23 18:18:50 UTC (rev 4841) +++ gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -60,7 +60,11 @@ GemRB.SetButtonState (CharGenWindow,BackButton,IE_GUI_BUTTON_ENABLED) AcceptButton = GemRB.GetControl (CharGenWindow, 8) - GemRB.SetText (CharGenWindow, AcceptButton, 11962) + playmode = GemRB.GetVar ("PlayMode") + if playmode>=0: + GemRB.SetText (CharGenWindow, AcceptButton, 11962) + else: + GemRB.SetText (CharGenWindow, AcceptButton, 13956) GemRB.SetButtonState (CharGenWindow,AcceptButton,IE_GUI_BUTTON_ENABLED) GemRB.SetButtonFlags(CharGenWindow,AcceptButton, IE_GUI_BUTTON_DEFAULT,OP_OR) @@ -110,7 +114,10 @@ GemRB.SetEvent (CharGenWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") GemRB.SetEvent (CharGenWindow, BackButton, IE_GUI_BUTTON_ON_PRESS, "BackPress") - GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") + if playmode>=0: + GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") + else: + GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "ExportPress") GemRB.SetEvent (CharGenWindow, ImportButton, IE_GUI_BUTTON_ON_PRESS, "ImportPress") GemRB.SetVisible (CharGenWindow,1) return @@ -126,20 +133,31 @@ RaceTable = GemRB.LoadTable ("races") Race = GemRB.GetVar ("Race")-1 GemRB.SetPlayerStat (MyChar, IE_RACE, GemRB.GetTableValue (RaceTable, Race, 3) ) + t = GemRB.GetVar ("Alignment") + GemRB.SetPlayerStat (MyChar, IE_ALIGNMENT, t) + + #a little explanation for the different handling of mage kit values: + #Originally, the IE had only mage schools, and the kit field + #was simply an unusability field (with a single bit set) + #then BG2 crammed in a lot more kits, and 32 bits were not enough. + #They solved this by making the generalist value 0x4000 to hold + #the kit index in the lower portions. + #When you see 0x4000 in a kit value, you need to translate + #the kit index to unusability value, using the kitlist + #So, for mages, the kit equals to the unusability value + #but for others there is an additional mapping by kitlist.2da + ClassTable = GemRB.LoadTable ("classes") ClassIndex = GemRB.GetVar ("Class")-1 Class = GemRB.GetTableValue (ClassTable, ClassIndex, 5) GemRB.SetPlayerStat (MyChar, IE_CLASS, Class) KitIndex = GemRB.GetVar ("Class Kit") - KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) - GemRB.SetPlayerStat (MyChar, IE_KIT, KitValue) - t = GemRB.GetVar ("Alignment") - GemRB.SetPlayerStat (MyChar, IE_ALIGNMENT, t) - TmpTable = GemRB.LoadTable ("clskills") #mage spells - TableName = GemRB.GetTableValue (TmpTable, Class, 1, 0) + TableName = GemRB.GetTableValue (TmpTable, Class, 2, 0) + if TableName != "*": + KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) SetupSpellLevels(MyChar, TableName, IE_SPELL_TYPE_WIZARD, 1) Learnable = GetLearnableMageSpells( KitValue, t, 1) SpellBook = GemRB.GetVar ("MageSpellBook") @@ -148,7 +166,12 @@ if SpellBook & j: GemRB.LearnSpell (MyChar, Learnable[i], 0) j=j<<1 + else: + KitValue = 0x4000 + KitIndex + print "KitValue**********:",KitValue + GemRB.SetPlayerStat (MyChar, IE_KIT, KitValue) + #priest spells TableName = GemRB.GetTableValue (TmpTable, Class, 1, 0) if TableName != "*": @@ -237,13 +260,15 @@ SmallPortrait = GemRB.GetToken ("SmallPortrait") GemRB.FillPlayerInfo (MyChar, LargePortrait, SmallPortrait) - #LETS PLAY!! playmode = GemRB.GetVar ("PlayMode") if playmode >=0: + #LETS PLAY!! GemRB.EnterGame() else: #leaving multi player pregen GemRB.UnloadWindow (CharGenWindow) + #FIXME: + #i think this should go to the party creation screen GemRB.SetNextScript ("Start") return @@ -263,3 +288,9 @@ GemRB.SetNextScript ("ImportFile") #import return +def ExportPress(): + GemRB.UnloadWindow (CharGenWindow) + GemRB.SetToken ("Start2","CharGen9") #when export done, go to start2 + GemRB.SetNextScript ("ExportFile") #export + return + Added: gemrb/trunk/gemrb/GUIScripts/bg2/ExportFile.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/ExportFile.py (rev 0) +++ gemrb/trunk/gemrb/GUIScripts/bg2/ExportFile.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -0,0 +1,50 @@ +#character generation, import (GUICG24) +import GemRB + +#import from a character sheet +ImportWindow = 0 +TextAreaControl = 0 + +def OnLoad(): + global ImportWindow, TextAreaControl + + GemRB.LoadWindowPack("GUICG",640,480) + ImportWindow = GemRB.LoadWindow(21) + + TextAreaControl = GemRB.GetControl(ImportWindow, 4) + GemRB.SetText(ImportWindow, TextAreaControl, 10962) + + TextAreaControl = GemRB.GetControl(ImportWindow,2) + GemRB.SetTextAreaFlags (ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_SELECTABLE) + GemRB.GetCharacters(ImportWindow, TextAreaControl) + + DoneButton = GemRB.GetControl(ImportWindow, 0) + GemRB.SetText(ImportWindow, DoneButton, 2610) + GemRB.SetButtonState(ImportWindow, DoneButton, IE_GUI_BUTTON_DISABLED) + + CancelButton = GemRB.GetControl(ImportWindow,1) + GemRB.SetText(ImportWindow, CancelButton, 15416) + + GemRB.SetEvent(ImportWindow, DoneButton, IE_GUI_BUTTON_ON_PRESS, "DonePress") + GemRB.SetEvent(ImportWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") + GemRB.SetEvent(ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_ON_CHANGE, "SelectPress") + GemRB.SetVisible(ImportWindow,1) + return + +def SelectPress(): + DoneButton = GemRB.GetControl(ImportWindow, 0) + GemRB.SetButtonState(ImportWindow, DoneButton, IE_GUI_BUTTON_ENABLED) + return + +def DonePress(): + FileName = GemRB.QueryText(ImportWindow, TextAreaControl) + Slot = GemRB.GetVar("Slot") + GemRB.ExportPlayer(FileName, Slot| 0x8000, 1) + GemRB.UnloadWindow(ImportWindow) + GemRB.SetNextScript(GemRB.GetToken("NextScript")) + return + +def CancelPress(): + GemRB.UnloadWindow(ImportWindow) + GemRB.SetNextScript(GemRB.GetToken("NextScript")) + return Property changes on: gemrb/trunk/gemrb/GUIScripts/bg2/ExportFile.py ___________________________________________________________________ Name: svn:eol-style + native Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py 2007-11-23 18:18:50 UTC (rev 4841) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -1,4 +1,24 @@ +# -*-python-*- +# GemRB - Infinity Engine Emulator +# Copyright (C) 2003-2007 The GemRB Project +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# $Id$ #character generation, class kit (GUICG22) + import GemRB KitWindow = 0 Modified: gemrb/trunk/gemrb/GUIScripts/bg2/ImportFile.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/ImportFile.py 2007-11-23 18:18:50 UTC (rev 4841) +++ gemrb/trunk/gemrb/GUIScripts/bg2/ImportFile.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -46,5 +46,5 @@ def CancelPress(): GemRB.UnloadWindow(ImportWindow) - GemRB.SetNextScript("CharGen") - return + GemRB.SetNextScript(GemRB.GetToken("NextScript")) + return Modified: gemrb/trunk/gemrb/GUIScripts/bg2/Start.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/Start.py 2007-11-23 18:18:50 UTC (rev 4841) +++ gemrb/trunk/gemrb/GUIScripts/bg2/Start.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -83,7 +83,7 @@ GemRB.SetVisible(QuitWindow, 0) GemRB.SetVisible(TutorialWindow, 0) GemRB.SetVisible(StartWindow, 1) - GemRB.LoadMusicPL("Theme.mus") + GemRB.LoadMusicPL("Theme.mus",1) return def SinglePlayerPress(): @@ -127,6 +127,7 @@ #do not start game after chargen GemRB.SetVar("PlayMode",-1) #will return to pregen screen GemRB.SetVar("Slot",0) + GemRB.LoadGame(-1) GemRB.SetNextScript("CharGen") #should be pregen screen return Modified: gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-11-23 18:18:50 UTC (rev 4841) +++ gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -60,7 +60,11 @@ GemRB.SetButtonState (CharGenWindow,BackButton,IE_GUI_BUTTON_ENABLED) AcceptButton = GemRB.GetControl (CharGenWindow, 8) - GemRB.SetText (CharGenWindow, AcceptButton, 11962) + playmode = GemRB.GetVar ("PlayMode") + if playmode>=0: + GemRB.SetText (CharGenWindow, AcceptButton, 11962) + else: + GemRB.SetText (CharGenWindow, AcceptButton, 13956) GemRB.SetButtonState (CharGenWindow,AcceptButton,IE_GUI_BUTTON_ENABLED) GemRB.SetButtonFlags(CharGenWindow,AcceptButton, IE_GUI_BUTTON_DEFAULT,OP_OR) @@ -110,7 +114,10 @@ GemRB.SetEvent (CharGenWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") GemRB.SetEvent (CharGenWindow, BackButton, IE_GUI_BUTTON_ON_PRESS, "BackPress") - GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") + if playmode>=0: + GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") + else: + GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "ExportPress") GemRB.SetEvent (CharGenWindow, ImportButton, IE_GUI_BUTTON_ON_PRESS, "ImportPress") GemRB.SetVisible (CharGenWindow,1) return @@ -126,20 +133,31 @@ RaceTable = GemRB.LoadTable ("races") Race = GemRB.GetVar ("Race")-1 GemRB.SetPlayerStat (MyChar, IE_RACE, GemRB.GetTableValue (RaceTable, Race, 3) ) + t = GemRB.GetVar ("Alignment") + GemRB.SetPlayerStat (MyChar, IE_ALIGNMENT, t) + + #a little explanation for the different handling of mage kit values: + #Originally, the IE had only mage schools, and the kit field + #was simply an unusability field (with a single bit set) + #then BG2 crammed in a lot more kits, and 32 bits were not enough. + #They solved this by making the generalist value 0x4000 to hold + #the kit index in the lower portions. + #When you see 0x4000 in a kit value, you need to translate + #the kit index to unusability value, using the kitlist + #So, for mages, the kit equals to the unusability value + #but for others there is an additional mapping by kitlist.2da + ClassTable = GemRB.LoadTable ("classes") ClassIndex = GemRB.GetVar ("Class")-1 Class = GemRB.GetTableValue (ClassTable, ClassIndex, 5) GemRB.SetPlayerStat (MyChar, IE_CLASS, Class) KitIndex = GemRB.GetVar ("Class Kit") - KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) - GemRB.SetPlayerStat (MyChar, IE_KIT, KitValue) - t = GemRB.GetVar ("Alignment") - GemRB.SetPlayerStat (MyChar, IE_ALIGNMENT, t) - TmpTable = GemRB.LoadTable ("clskills") #mage spells - TableName = GemRB.GetTableValue (TmpTable, Class, 1, 0) + TableName = GemRB.GetTableValue (TmpTable, Class, 2, 0) + if TableName != "*": + KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) SetupSpellLevels(MyChar, TableName, IE_SPELL_TYPE_WIZARD, 1) Learnable = GetLearnableMageSpells( KitValue, t, 1) SpellBook = GemRB.GetVar ("MageSpellBook") @@ -148,7 +166,12 @@ if SpellBook & j: GemRB.LearnSpell (MyChar, Learnable[i], 0) j=j<<1 + else: + KitValue = 0x4000 + KitIndex + print "KitValue**********:",KitValue + GemRB.SetPlayerStat (MyChar, IE_KIT, KitValue) + #priest spells TableName = GemRB.GetTableValue (TmpTable, Class, 1, 0) if TableName != "*": @@ -237,13 +260,15 @@ SmallPortrait = GemRB.GetToken ("SmallPortrait") GemRB.FillPlayerInfo (MyChar, LargePortrait, SmallPortrait) - #LETS PLAY!! playmode = GemRB.GetVar ("PlayMode") if playmode >=0: + #LETS PLAY!! GemRB.EnterGame() else: #leaving multi player pregen GemRB.UnloadWindow (CharGenWindow) + #FIXME: + #i think this should go to the party creation screen GemRB.SetNextScript ("Start") return @@ -263,3 +288,9 @@ GemRB.SetNextScript ("ImportFile") #import return +def ExportPress(): + GemRB.UnloadWindow (CharGenWindow) + GemRB.SetToken ("Start2","CharGen9") #when export done, go to start2 + GemRB.SetNextScript ("ExportFile") #export + return + Added: gemrb/trunk/gemrb/GUIScripts/tob/ExportFile.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/ExportFile.py (rev 0) +++ gemrb/trunk/gemrb/GUIScripts/tob/ExportFile.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -0,0 +1,50 @@ +#character generation, import (GUICG24) +import GemRB + +#import from a character sheet +ImportWindow = 0 +TextAreaControl = 0 + +def OnLoad(): + global ImportWindow, TextAreaControl + + GemRB.LoadWindowPack("GUICG",640,480) + ImportWindow = GemRB.LoadWindow(21) + + TextAreaControl = GemRB.GetControl(ImportWindow, 4) + GemRB.SetText(ImportWindow, TextAreaControl, 10962) + + TextAreaControl = GemRB.GetControl(ImportWindow,2) + GemRB.SetTextAreaFlags (ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_SELECTABLE) + GemRB.GetCharacters(ImportWindow, TextAreaControl) + + DoneButton = GemRB.GetControl(ImportWindow, 0) + GemRB.SetText(ImportWindow, DoneButton, 2610) + GemRB.SetButtonState(ImportWindow, DoneButton, IE_GUI_BUTTON_DISABLED) + + CancelButton = GemRB.GetControl(ImportWindow,1) + GemRB.SetText(ImportWindow, CancelButton, 15416) + + GemRB.SetEvent(ImportWindow, DoneButton, IE_GUI_BUTTON_ON_PRESS, "DonePress") + GemRB.SetEvent(ImportWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") + GemRB.SetEvent(ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_ON_CHANGE, "SelectPress") + GemRB.SetVisible(ImportWindow,1) + return + +def SelectPress(): + DoneButton = GemRB.GetControl(ImportWindow, 0) + GemRB.SetButtonState(ImportWindow, DoneButton, IE_GUI_BUTTON_ENABLED) + return + +def DonePress(): + FileName = GemRB.QueryText(ImportWindow, TextAreaControl) + Slot = GemRB.GetVar("Slot") + GemRB.ExportPlayer(FileName, Slot| 0x8000, 1) + GemRB.UnloadWindow(ImportWindow) + GemRB.SetNextScript(GemRB.GetToken("NextScript")) + return + +def CancelPress(): + GemRB.UnloadWindow(ImportWindow) + GemRB.SetNextScript(GemRB.GetToken("NextScript")) + return Property changes on: gemrb/trunk/gemrb/GUIScripts/tob/ExportFile.py ___________________________________________________________________ Name: svn:eol-style + native Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py 2007-11-23 18:18:50 UTC (rev 4841) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -1,4 +1,24 @@ +# -*-python-*- +# GemRB - Infinity Engine Emulator +# Copyright (C) 2003-2007 The GemRB Project +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# $Id$ #character generation, class kit (GUICG22) + import GemRB KitWindow = 0 Modified: gemrb/trunk/gemrb/GUIScripts/tob/ImportFile.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/ImportFile.py 2007-11-23 18:18:50 UTC (rev 4841) +++ gemrb/trunk/gemrb/GUIScripts/tob/ImportFile.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -46,5 +46,5 @@ def CancelPress(): GemRB.UnloadWindow(ImportWindow) - GemRB.SetNextScript("CharGen") - return + GemRB.SetNextScript(GemRB.GetToken("NextScript")) + return Modified: gemrb/trunk/gemrb/GUIScripts/tob/Start2.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/Start2.py 2007-11-23 18:18:50 UTC (rev 4841) +++ gemrb/trunk/gemrb/GUIScripts/tob/Start2.py 2007-11-24 14:07:10 UTC (rev 4842) @@ -120,9 +120,10 @@ GemRB.UnloadWindow(QuitWindow) GemRB.UnloadWindow(TutorialWindow) #do not start game after chargen - GemRB.SetVar("PlayMode",-1) #will return to pregen screen + GemRB.SetVar("PlayMode",-1) #will allow export GemRB.SetVar("Slot",0) - GemRB.SetNextScript("CharGen") #should be pregen screen + GemRB.LoadGame(-1) + GemRB.SetNextScript("CharGen") return def LoadSingle(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-11-24 15:16:20
|
Revision: 4843 http://gemrb.svn.sourceforge.net/gemrb/?rev=4843&view=rev Author: avenger_teambg Date: 2007-11-24 07:16:21 -0800 (Sat, 24 Nov 2007) Log Message: ----------- more work on spell selection/export Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py gemrb/trunk/gemrb/GUIScripts/bg2/ExportFile.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py gemrb/trunk/gemrb/GUIScripts/tob/ExportFile.py gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -114,10 +114,7 @@ GemRB.SetEvent (CharGenWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") GemRB.SetEvent (CharGenWindow, BackButton, IE_GUI_BUTTON_ON_PRESS, "BackPress") - if playmode>=0: - GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") - else: - GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "ExportPress") + GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") GemRB.SetEvent (CharGenWindow, ImportButton, IE_GUI_BUTTON_ON_PRESS, "ImportPress") GemRB.SetVisible (CharGenWindow,1) return @@ -267,9 +264,9 @@ else: #leaving multi player pregen GemRB.UnloadWindow (CharGenWindow) - #FIXME: - #i think this should go to the party creation screen - GemRB.SetNextScript ("Start") + #when export is done, go to start + GemRB.SetToken ("NextScript","Start") + GemRB.SetNextScript ("ExportFile") #export return def CancelPress(): @@ -287,10 +284,3 @@ GemRB.SetToken ("NextScript","CharGen9") GemRB.SetNextScript ("ImportFile") #import return - -def ExportPress(): - GemRB.UnloadWindow (CharGenWindow) - GemRB.SetToken ("Start2","CharGen9") #when export done, go to start2 - GemRB.SetNextScript ("ExportFile") #export - return - Modified: gemrb/trunk/gemrb/GUIScripts/bg2/ExportFile.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/ExportFile.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/bg2/ExportFile.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -8,43 +8,43 @@ def OnLoad(): global ImportWindow, TextAreaControl - GemRB.LoadWindowPack("GUICG",640,480) - ImportWindow = GemRB.LoadWindow(21) + GemRB.LoadWindowPack ("GUICG",640,480) + ImportWindow = GemRB.LoadWindow (21) - TextAreaControl = GemRB.GetControl(ImportWindow, 4) - GemRB.SetText(ImportWindow, TextAreaControl, 10962) + TextAreaControl = GemRB.GetControl (ImportWindow, 4) + GemRB.SetText (ImportWindow, TextAreaControl, 10962) - TextAreaControl = GemRB.GetControl(ImportWindow,2) + TextAreaControl = GemRB.GetControl (ImportWindow,2) GemRB.SetTextAreaFlags (ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_SELECTABLE) - GemRB.GetCharacters(ImportWindow, TextAreaControl) + GemRB.GetCharacters (ImportWindow, TextAreaControl) - DoneButton = GemRB.GetControl(ImportWindow, 0) - GemRB.SetText(ImportWindow, DoneButton, 2610) - GemRB.SetButtonState(ImportWindow, DoneButton, IE_GUI_BUTTON_DISABLED) + DoneButton = GemRB.GetControl (ImportWindow, 0) + GemRB.SetText (ImportWindow, DoneButton, 2610) + GemRB.SetButtonState (ImportWindow, DoneButton, IE_GUI_BUTTON_DISABLED) - CancelButton = GemRB.GetControl(ImportWindow,1) - GemRB.SetText(ImportWindow, CancelButton, 15416) + CancelButton = GemRB.GetControl (ImportWindow,1) + GemRB.SetText (ImportWindow, CancelButton, 15416) - GemRB.SetEvent(ImportWindow, DoneButton, IE_GUI_BUTTON_ON_PRESS, "DonePress") - GemRB.SetEvent(ImportWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") - GemRB.SetEvent(ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_ON_CHANGE, "SelectPress") - GemRB.SetVisible(ImportWindow,1) + GemRB.SetEvent (ImportWindow, DoneButton, IE_GUI_BUTTON_ON_PRESS, "DonePress") + GemRB.SetEvent (ImportWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") + GemRB.SetEvent (ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_ON_CHANGE, "SelectPress") + GemRB.SetVisible (ImportWindow,1) return -def SelectPress(): - DoneButton = GemRB.GetControl(ImportWindow, 0) - GemRB.SetButtonState(ImportWindow, DoneButton, IE_GUI_BUTTON_ENABLED) +def SelectPress (): + DoneButton = GemRB.GetControl (ImportWindow, 0) + GemRB.SetButtonState (ImportWindow, DoneButton, IE_GUI_BUTTON_ENABLED) return -def DonePress(): - FileName = GemRB.QueryText(ImportWindow, TextAreaControl) - Slot = GemRB.GetVar("Slot") - GemRB.ExportPlayer(FileName, Slot| 0x8000, 1) - GemRB.UnloadWindow(ImportWindow) - GemRB.SetNextScript(GemRB.GetToken("NextScript")) +def DonePress (): + FileName = GemRB.QueryText (ImportWindow, TextAreaControl) + Slot = GemRB.GetVar ("Slot") + GemRB.SaveCharacter (Slot, FileName) + GemRB.UnloadWindow (ImportWindow) + GemRB.SetNextScript (GemRB.GetToken("NextScript")) return -def CancelPress(): - GemRB.UnloadWindow(ImportWindow) - GemRB.SetNextScript(GemRB.GetToken("NextScript")) +def CancelPress (): + GemRB.UnloadWindow (ImportWindow) + GemRB.SetNextScript (GemRB.GetToken("NextScript")) return Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICG22.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -76,10 +76,11 @@ if KitTable == -1: if ClassID == 1: - Kit=GemRB.GetVar("MAGESCHOOL") + Kit = GemRB.GetVar("MAGESCHOOL") KitName = GemRB.GetTableValue(SchoolList, i, 0) Kit = GemRB.GetTableValue (SchoolList, Kit, 3) else: + Kit = 0 KitName = GemRB.GetTableValue(ClassList, GemRB.GetVar("Class")-1, 0) else: Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICG7.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -25,6 +25,8 @@ MageSpellsWindow = 0 MageSpellsTextArea = 0 DoneButton = 0 +SpellMask = 0 +Random = 1 Learnable = [] def OnLoad(): @@ -46,11 +48,14 @@ MageSpellsWindow = GemRB.LoadWindow(7) v = GemRB.GetVar("Alignment") KitIndex = GemRB.GetVar("Class Kit") - print "KitIndex",KitIndex - KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) - print "KitValue",KitValue + if KitIndex: + KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) + else: + KitValue = 0x4000 + Learnable = GetLearnableMageSpells( KitValue, v, 1) GemRB.SetVar("MageSpellBook", 0) + SpellMask = 0 GemRB.SetVar("SpellMask", 0) MageSpellsSelectPointsLeft = 2 @@ -96,7 +101,6 @@ return def MageSpellsSelectPress(): - global MageSpellsWindow, MageSpellsTextArea, DoneButton global MageSpellsSelectPointsLeft, Learnable MageSpellBook = GemRB.GetVar("MageSpellBook") @@ -112,25 +116,35 @@ GemRB.SetText(MageSpellsWindow, MageSpellsTextArea, Spell["SpellDesc"]) if SpellMask < MageSpellBook: MageSpellsSelectPointsLeft = MageSpellsSelectPointsLeft + 1 - for i in range (len(Learnable)): - SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) - if (((1 << i) & SpellMask) == 0): - GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ENABLED) GemRB.SetButtonState(MageSpellsWindow, DoneButton, IE_GUI_BUTTON_DISABLED) else: + if MageSpellsSelectPointsLeft == 0: + GemRB.SetVar("SpellMask", MageSpellBook) + MarkButton(i) + return + MageSpellsSelectPointsLeft = MageSpellsSelectPointsLeft - 1 if MageSpellsSelectPointsLeft == 0: - for i in range (len(Learnable)): - SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) - if ((1 << i) & SpellMask) == 0: - GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonState(MageSpellsWindow, DoneButton, IE_GUI_BUTTON_ENABLED) + for i in range (len(Learnable)): + SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) + if (((1 << i) & SpellMask) == 0): + MarkButton(i) + PointsLeftLabel = GemRB.GetControl(MageSpellsWindow, 0x1000001b) GemRB.SetText(MageSpellsWindow, PointsLeftLabel, str(MageSpellsSelectPointsLeft)) GemRB.SetVar("MageSpellBook", SpellMask) return +def MarkButton(i): + print "IIII:::",i + type = IE_GUI_BUTTON_ENABLED + #if the spell is specialist spell then type = IE_GUI_BUTTON_THIRD + SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) + GemRB.SetButtonState(MageSpellsWindow, SpellButton, type) + return + def MageSpellsCancelPress(): GemRB.UnloadWindow(MageSpellsWindow) GemRB.SetNextScript("CharGen6") #haterace @@ -142,20 +156,33 @@ return def MageSpellsPickPress(): - global MageSpellsSelectPointsLeft, Learnable + global MageSpellsSelectPointsLeft, Learnable, SpellMask SpellMask = 0 Range = len(Learnable) if MageSpellsSelectPointsLeft > Range: MageSpellsSelectPointsLeft = Range if MageSpellsSelectPointsLeft: - #make this less ugly without ruining Learnable for i in range(MageSpellsSelectPointsLeft): - j = GemRB.Roll(1,Range,-1) - if SpellMask & (1<<j): - continue + if Random: + j = RandomPick(Range) + else: + j = AutoPick(Range) SpellMask = SpellMask | (1<<j) GemRB.SetVar("MageSpellBook", SpellMask) MageSpellsDonePress() return +def RandomPick (Range): + global SpellMask + + j = GemRB.Roll(1,Range,-1) + while SpellMask & (1<<j): + j = j - 1 + if j<0: + j=Range-1 + return j + +def AutoPick (Range): + return j + Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUIREC.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -127,7 +127,7 @@ if Level < GemRB.GetTableColumnCount (NextLevelTable, Row): return str(GemRB.GetTableValue (NextLevelTable, Row, Level) ) - return 0; + return 0 def UpdateRecordsWindow (): global stats_overview, alignment_help Modified: gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -114,10 +114,7 @@ GemRB.SetEvent (CharGenWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") GemRB.SetEvent (CharGenWindow, BackButton, IE_GUI_BUTTON_ON_PRESS, "BackPress") - if playmode>=0: - GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") - else: - GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "ExportPress") + GemRB.SetEvent (CharGenWindow, AcceptButton, IE_GUI_BUTTON_ON_PRESS, "NextPress") GemRB.SetEvent (CharGenWindow, ImportButton, IE_GUI_BUTTON_ON_PRESS, "ImportPress") GemRB.SetVisible (CharGenWindow,1) return @@ -267,9 +264,9 @@ else: #leaving multi player pregen GemRB.UnloadWindow (CharGenWindow) - #FIXME: - #i think this should go to the party creation screen - GemRB.SetNextScript ("Start") + #when export is done, go to start2 + GemRB.SetToken ("NextScript","Start2") + GemRB.SetNextScript ("ExportFile") #export return def CancelPress(): @@ -287,10 +284,3 @@ GemRB.SetToken ("NextScript","CharGen9") GemRB.SetNextScript ("ImportFile") #import return - -def ExportPress(): - GemRB.UnloadWindow (CharGenWindow) - GemRB.SetToken ("Start2","CharGen9") #when export done, go to start2 - GemRB.SetNextScript ("ExportFile") #export - return - Modified: gemrb/trunk/gemrb/GUIScripts/tob/ExportFile.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/ExportFile.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/tob/ExportFile.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -8,43 +8,43 @@ def OnLoad(): global ImportWindow, TextAreaControl - GemRB.LoadWindowPack("GUICG",640,480) - ImportWindow = GemRB.LoadWindow(21) + GemRB.LoadWindowPack ("GUICG",640,480) + ImportWindow = GemRB.LoadWindow (21) - TextAreaControl = GemRB.GetControl(ImportWindow, 4) - GemRB.SetText(ImportWindow, TextAreaControl, 10962) + TextAreaControl = GemRB.GetControl (ImportWindow, 4) + GemRB.SetText (ImportWindow, TextAreaControl, 10962) - TextAreaControl = GemRB.GetControl(ImportWindow,2) + TextAreaControl = GemRB.GetControl (ImportWindow,2) GemRB.SetTextAreaFlags (ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_SELECTABLE) - GemRB.GetCharacters(ImportWindow, TextAreaControl) + GemRB.GetCharacters (ImportWindow, TextAreaControl) - DoneButton = GemRB.GetControl(ImportWindow, 0) - GemRB.SetText(ImportWindow, DoneButton, 2610) - GemRB.SetButtonState(ImportWindow, DoneButton, IE_GUI_BUTTON_DISABLED) + DoneButton = GemRB.GetControl (ImportWindow, 0) + GemRB.SetText (ImportWindow, DoneButton, 2610) + GemRB.SetButtonState (ImportWindow, DoneButton, IE_GUI_BUTTON_DISABLED) - CancelButton = GemRB.GetControl(ImportWindow,1) - GemRB.SetText(ImportWindow, CancelButton, 15416) + CancelButton = GemRB.GetControl (ImportWindow,1) + GemRB.SetText (ImportWindow, CancelButton, 15416) - GemRB.SetEvent(ImportWindow, DoneButton, IE_GUI_BUTTON_ON_PRESS, "DonePress") - GemRB.SetEvent(ImportWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") - GemRB.SetEvent(ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_ON_CHANGE, "SelectPress") - GemRB.SetVisible(ImportWindow,1) + GemRB.SetEvent (ImportWindow, DoneButton, IE_GUI_BUTTON_ON_PRESS, "DonePress") + GemRB.SetEvent (ImportWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelPress") + GemRB.SetEvent (ImportWindow, TextAreaControl, IE_GUI_TEXTAREA_ON_CHANGE, "SelectPress") + GemRB.SetVisible (ImportWindow,1) return -def SelectPress(): - DoneButton = GemRB.GetControl(ImportWindow, 0) - GemRB.SetButtonState(ImportWindow, DoneButton, IE_GUI_BUTTON_ENABLED) +def SelectPress (): + DoneButton = GemRB.GetControl (ImportWindow, 0) + GemRB.SetButtonState (ImportWindow, DoneButton, IE_GUI_BUTTON_ENABLED) return -def DonePress(): - FileName = GemRB.QueryText(ImportWindow, TextAreaControl) - Slot = GemRB.GetVar("Slot") - GemRB.ExportPlayer(FileName, Slot| 0x8000, 1) - GemRB.UnloadWindow(ImportWindow) - GemRB.SetNextScript(GemRB.GetToken("NextScript")) +def DonePress (): + FileName = GemRB.QueryText (ImportWindow, TextAreaControl) + Slot = GemRB.GetVar ("Slot") + GemRB.SaveCharacter (Slot, FileName) + GemRB.UnloadWindow (ImportWindow) + GemRB.SetNextScript (GemRB.GetToken("NextScript")) return -def CancelPress(): - GemRB.UnloadWindow(ImportWindow) - GemRB.SetNextScript(GemRB.GetToken("NextScript")) +def CancelPress (): + GemRB.UnloadWindow (ImportWindow) + GemRB.SetNextScript (GemRB.GetToken("NextScript")) return Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICG22.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -76,10 +76,11 @@ if KitTable == -1: if ClassID == 1: - Kit=GemRB.GetVar("MAGESCHOOL") + Kit = GemRB.GetVar("MAGESCHOOL") KitName = GemRB.GetTableValue(SchoolList, i, 0) Kit = GemRB.GetTableValue (SchoolList, Kit, 3) else: + Kit = 0 KitName = GemRB.GetTableValue(ClassList, GemRB.GetVar("Class")-1, 0) else: Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -25,6 +25,8 @@ MageSpellsWindow = 0 MageSpellsTextArea = 0 DoneButton = 0 +SpellMask = 0 +Random = 1 Learnable = [] def OnLoad(): @@ -46,11 +48,14 @@ MageSpellsWindow = GemRB.LoadWindow(7) v = GemRB.GetVar("Alignment") KitIndex = GemRB.GetVar("Class Kit") - print "KitIndex",KitIndex - KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) - print "KitValue",KitValue + if KitIndex: + KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) + else: + KitValue = 0x4000 + Learnable = GetLearnableMageSpells( KitValue, v, 1) GemRB.SetVar("MageSpellBook", 0) + SpellMask = 0 GemRB.SetVar("SpellMask", 0) MageSpellsSelectPointsLeft = 2 @@ -96,7 +101,6 @@ return def MageSpellsSelectPress(): - global MageSpellsWindow, MageSpellsTextArea, DoneButton global MageSpellsSelectPointsLeft, Learnable MageSpellBook = GemRB.GetVar("MageSpellBook") @@ -112,25 +116,35 @@ GemRB.SetText(MageSpellsWindow, MageSpellsTextArea, Spell["SpellDesc"]) if SpellMask < MageSpellBook: MageSpellsSelectPointsLeft = MageSpellsSelectPointsLeft + 1 - for i in range (len(Learnable)): - SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) - if (((1 << i) & SpellMask) == 0): - GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_ENABLED) GemRB.SetButtonState(MageSpellsWindow, DoneButton, IE_GUI_BUTTON_DISABLED) else: + if MageSpellsSelectPointsLeft == 0: + GemRB.SetVar("SpellMask", MageSpellBook) + MarkButton(i) + return + MageSpellsSelectPointsLeft = MageSpellsSelectPointsLeft - 1 if MageSpellsSelectPointsLeft == 0: - for i in range (len(Learnable)): - SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) - if ((1 << i) & SpellMask) == 0: - GemRB.SetButtonState(MageSpellsWindow, SpellButton, IE_GUI_BUTTON_DISABLED) GemRB.SetButtonState(MageSpellsWindow, DoneButton, IE_GUI_BUTTON_ENABLED) + for i in range (len(Learnable)): + SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) + if (((1 << i) & SpellMask) == 0): + MarkButton(i) + PointsLeftLabel = GemRB.GetControl(MageSpellsWindow, 0x1000001b) GemRB.SetText(MageSpellsWindow, PointsLeftLabel, str(MageSpellsSelectPointsLeft)) GemRB.SetVar("MageSpellBook", SpellMask) return +def MarkButton(i): + print "IIII:::",i + type = IE_GUI_BUTTON_ENABLED + #if the spell is specialist spell then type = IE_GUI_BUTTON_THIRD + SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) + GemRB.SetButtonState(MageSpellsWindow, SpellButton, type) + return + def MageSpellsCancelPress(): GemRB.UnloadWindow(MageSpellsWindow) GemRB.SetNextScript("CharGen6") #haterace @@ -142,20 +156,33 @@ return def MageSpellsPickPress(): - global MageSpellsSelectPointsLeft, Learnable + global MageSpellsSelectPointsLeft, Learnable, SpellMask SpellMask = 0 Range = len(Learnable) if MageSpellsSelectPointsLeft > Range: MageSpellsSelectPointsLeft = Range if MageSpellsSelectPointsLeft: - #make this less ugly without ruining Learnable for i in range(MageSpellsSelectPointsLeft): - j = GemRB.Roll(1,Range,-1) - if SpellMask & (1<<j): - continue + if Random: + j = RandomPick(Range) + else: + j = AutoPick(Range) SpellMask = SpellMask | (1<<j) GemRB.SetVar("MageSpellBook", SpellMask) MageSpellsDonePress() return +def RandomPick (Range): + global SpellMask + + j = GemRB.Roll(1,Range,-1) + while SpellMask & (1<<j): + j = j - 1 + if j<0: + j=Range-1 + return j + +def AutoPick (Range): + return j + Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py 2007-11-24 14:07:10 UTC (rev 4842) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUIREC.py 2007-11-24 15:16:21 UTC (rev 4843) @@ -127,7 +127,7 @@ if Level < GemRB.GetTableColumnCount (NextLevelTable, Row): return str(GemRB.GetTableValue (NextLevelTable, Row, Level) ) - return 0; + return 0 def UpdateRecordsWindow (): global stats_overview, alignment_help This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-11-25 17:09:52
|
Revision: 4850 http://gemrb.svn.sourceforge.net/gemrb/?rev=4850&view=rev Author: avenger_teambg Date: 2007-11-25 09:09:29 -0800 (Sun, 25 Nov 2007) Log Message: ----------- fixed expansion handling fixed SpellSchool vs SpellExclusion Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/GUICommon.py gemrb/trunk/gemrb/GUIScripts/bg2/CharGen.py gemrb/trunk/gemrb/GUIScripts/bg2/GUILOAD.py gemrb/trunk/gemrb/GUIScripts/bg2/Start.py gemrb/trunk/gemrb/GUIScripts/tob/CharGen.py gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py gemrb/trunk/gemrb/GUIScripts/tob/GUILOAD.py gemrb/trunk/gemrb/GUIScripts/tob/Start.py Added Paths: ----------- gemrb/trunk/gemrb/GUIScripts/bg2/Start2.py Modified: gemrb/trunk/gemrb/GUIScripts/GUICommon.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/GUICommon.py 2007-11-25 17:05:39 UTC (rev 4849) +++ gemrb/trunk/gemrb/GUIScripts/GUICommon.py 2007-11-25 17:09:29 UTC (rev 4850) @@ -54,7 +54,7 @@ ms = GemRB.GetSpell(SpellName) if ms == None: continue - if Usability & ms['SpellSchool']: + if Usability & ms['SpellExclusion']: continue Learnable.append (SpellName) return Learnable @@ -74,7 +74,7 @@ continue if Class & ms['SpellDivine']: continue - if Usability & ms['SpellSchool']: + if Usability & ms['SpellExclusion']: continue Learnable.append (SpellName) return Learnable Modified: gemrb/trunk/gemrb/GUIScripts/bg2/CharGen.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen.py 2007-11-25 17:05:39 UTC (rev 4849) +++ gemrb/trunk/gemrb/GUIScripts/bg2/CharGen.py 2007-11-25 17:09:29 UTC (rev 4850) @@ -9,6 +9,14 @@ def OnLoad(): global CharGenWindow, TextAreaControl, ImportButton, CancelButton + #this is tob specific code! + if GemRB.GetVar("oldgame")==0: + GemRB.GameSetExpansion(1) + GemRB.SetVar ("PlayMode",2) + else: + GemRB.GameSetExpansion(0) + GemRB.SetVar ("PlayMode",0) + GemRB.SetVar("Gender",0) #gender GemRB.SetVar("Race",0) #race GemRB.SetVar("Class",0) #class Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUILOAD.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUILOAD.py 2007-11-25 17:05:39 UTC (rev 4849) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUILOAD.py 2007-11-25 17:09:29 UTC (rev 4850) @@ -10,6 +10,11 @@ def OnLoad(): global LoadWindow, TextAreaControl, GameCount, ScrollBar + if GemRB.GetVar("oldgame")==0: + GemRB.GameSetExpansion(1) + else: + GemRB.GameSetExpansion(0) + GemRB.LoadWindowPack("GUILOAD", 640, 480) LoadWindow = GemRB.LoadWindow(0) GemRB.SetWindowFrame (LoadWindow) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/Start.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/Start.py 2007-11-25 17:05:39 UTC (rev 4849) +++ gemrb/trunk/gemrb/GUIScripts/bg2/Start.py 2007-11-25 17:09:29 UTC (rev 4850) @@ -1,24 +1,20 @@ +#ToB start window, precedes the SoA window import GemRB StartWindow = 0 -TutorialWindow = 0 -QuitWindow = 0 -ExitButton = 0 -SinglePlayerButton = 0 -OptionsButton = 0 -MultiPlayerButton = 0 -MoviesButton = 0 +#the worldmap resource indicator +IE_WMP_CLASS_ID = 0x000003F7 + def OnLoad(): - global StartWindow, TutorialWindow, QuitWindow - global ExitButton, OptionsButton, MultiPlayerButton, MoviesButton + global StartWindow, skip_videos + GemRB.EnableCheatKeys(1) skip_videos = GemRB.GetVar ("SkipIntroVideos") if not skip_videos: GemRB.PlayMovie ("BISLOGO") GemRB.PlayMovie ("BWDRAGON") GemRB.PlayMovie ("WOTC") - GemRB.PlayMovie ("INTRO15F") # Find proper window border for higher resolutions screen_width = GemRB.GetSystemVariable (SV_WIDTH) @@ -27,192 +23,56 @@ GemRB.LoadWindowFrame("STON08L", "STON08R", "STON08T", "STON08B") elif screen_width == 1024: GemRB.LoadWindowFrame("STON10L", "STON10R", "STON10T", "STON10B") - + + #if not detected tob, we go right to the main menu + if not GemRB.HasResource("worldm25",IE_WMP_CLASS_ID): + GemRB.SetMasterScript("BALDUR","WORLDMAP") + GemRB.SetVar("oldgame",1) + GemRB.SetNextScript("Start2") + return + GemRB.LoadWindowPack("START", 640, 480) -#tutorial subwindow - TutorialWindow = GemRB.LoadWindow(5) - TextAreaControl = GemRB.GetControl(TutorialWindow, 1) - CancelButton = GemRB.GetControl(TutorialWindow, 11) - PlayButton = GemRB.GetControl(TutorialWindow, 10) - GemRB.SetText(TutorialWindow, TextAreaControl, 44200) - GemRB.SetText(TutorialWindow, CancelButton, 13727) - GemRB.SetText(TutorialWindow, PlayButton, 33093) - GemRB.SetEvent(TutorialWindow, PlayButton, IE_GUI_BUTTON_ON_PRESS, "PlayPress") - GemRB.SetEvent(TutorialWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelTut") -#quit subwindow - QuitWindow = GemRB.LoadWindow(3) - QuitTextArea = GemRB.GetControl(QuitWindow,0) - CancelButton = GemRB.GetControl(QuitWindow, 2) - ConfirmButton = GemRB.GetControl(QuitWindow, 1) - GemRB.SetText(QuitWindow, QuitTextArea, 19532) - GemRB.SetText(QuitWindow, CancelButton, 13727) - GemRB.SetText(QuitWindow, ConfirmButton, 15417) - GemRB.SetEvent(QuitWindow, ConfirmButton, 0, "ExitConfirmed") - GemRB.SetEvent(QuitWindow, CancelButton, 0, "ExitCancelled") -#main window - StartWindow = GemRB.LoadWindow(0) + StartWindow = GemRB.LoadWindow(7) GemRB.SetWindowFrame (StartWindow) - - SinglePlayerButton = GemRB.GetControl(StartWindow, 0) - ExitButton = GemRB.GetControl(StartWindow, 3) - OptionsButton = GemRB.GetControl(StartWindow, 4) - MultiPlayerButton = GemRB.GetControl(StartWindow, 1) - MoviesButton = GemRB.GetControl(StartWindow, 2) - DisabledButton = GemRB.GetControl(StartWindow, 5) - GemRB.CreateLabel(StartWindow, 0x0fff0000, 0,450,640,30, "REALMS", "", 1) + GemRB.CreateLabel(StartWindow, 0x0fff0000, 0,0,640,30, "REALMS", "", 1) Label=GemRB.GetControl(StartWindow, 0x0fff0000) GemRB.SetText(StartWindow, Label,GEMRB_VERSION) - GemRB.SetButtonState(StartWindow, DisabledButton, IE_GUI_BUTTON_DISABLED) - GemRB.SetButtonState(StartWindow, SinglePlayerButton, IE_GUI_BUTTON_ENABLED) - GemRB.SetButtonState(StartWindow, ExitButton, IE_GUI_BUTTON_ENABLED) - GemRB.SetButtonState(StartWindow, OptionsButton, IE_GUI_BUTTON_ENABLED) - GemRB.SetButtonState(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_ENABLED) - GemRB.SetButtonState(StartWindow, MoviesButton, IE_GUI_BUTTON_ENABLED) - GemRB.SetText(StartWindow, SinglePlayerButton, 15413) - GemRB.SetText(StartWindow, ExitButton, 15417) - GemRB.SetText(StartWindow, OptionsButton, 13905) - GemRB.SetText(StartWindow, MultiPlayerButton, 15414) - GemRB.SetText(StartWindow, MoviesButton, 15415) - GemRB.SetText(StartWindow, DisabledButton, "") - GemRB.SetEvent(StartWindow, SinglePlayerButton, IE_GUI_BUTTON_ON_PRESS, "SinglePlayerPress") + + TextArea = GemRB.GetControl(StartWindow, 0) + GemRB.SetText(StartWindow, TextArea, 73245) + TextArea = GemRB.GetControl(StartWindow, 1) + GemRB.SetText(StartWindow, TextArea, 73246) + SoAButton = GemRB.GetControl(StartWindow, 2) + GemRB.SetText(StartWindow, SoAButton, 73247) + ToBButton = GemRB.GetControl(StartWindow, 3) + GemRB.SetText(StartWindow, ToBButton, 73248) + ExitButton = GemRB.GetControl(StartWindow, 4) + GemRB.SetText(StartWindow, ExitButton, 13731) + GemRB.SetEvent(StartWindow, SoAButton, IE_GUI_BUTTON_ON_PRESS, "SoAPress") + GemRB.SetEvent(StartWindow, ToBButton, IE_GUI_BUTTON_ON_PRESS, "ToBPress") GemRB.SetEvent(StartWindow, ExitButton, IE_GUI_BUTTON_ON_PRESS, "ExitPress") - GemRB.SetEvent(StartWindow, OptionsButton, IE_GUI_BUTTON_ON_PRESS, "OptionsPress") - GemRB.SetEvent(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_ON_PRESS, "MultiPlayerPress") - GemRB.SetEvent(StartWindow, MoviesButton, IE_GUI_BUTTON_ON_PRESS, "MoviesPress") - GemRB.SetEvent(StartWindow, DisabledButton, IE_GUI_BUTTON_ON_PRESS, "") - GemRB.SetVisible(QuitWindow, 0) - GemRB.SetVisible(TutorialWindow, 0) GemRB.SetVisible(StartWindow, 1) - GemRB.LoadMusicPL("Theme.mus",1) + GemRB.LoadMusicPL("Cred.mus") return -def SinglePlayerPress(): - - GemRB.SetText(StartWindow, OptionsButton, "") - GemRB.SetText(StartWindow, SinglePlayerButton, 13728) - GemRB.SetText(StartWindow, ExitButton, 15416) - GemRB.SetText(StartWindow, MultiPlayerButton, 13729) - GemRB.SetText(StartWindow, MoviesButton, 33093) - GemRB.SetEvent(StartWindow, MultiPlayerButton, 0, "LoadSingle") - GemRB.SetEvent(StartWindow, SinglePlayerButton, 0, "NewSingle") - GemRB.SetEvent(StartWindow, MoviesButton, 0, "Tutorial") - GemRB.SetEvent(StartWindow, ExitButton, 0, "BackToMain") - GemRB.SetButtonState(StartWindow, OptionsButton, IE_GUI_BUTTON_DISABLED) - return - -def MultiPlayerPress(): - - GemRB.SetText(StartWindow, OptionsButton, "") - GemRB.SetText(StartWindow, SinglePlayerButton, 20642) - GemRB.SetText(StartWindow, ExitButton, 15416) - GemRB.SetText(StartWindow, MultiPlayerButton, "") - GemRB.SetText(StartWindow, MoviesButton, 11825) - GemRB.SetEvent(StartWindow, MultiPlayerButton, 0, "") - GemRB.SetEvent(StartWindow, SinglePlayerButton, 0, "ConnectPress") - GemRB.SetEvent(StartWindow, MoviesButton, 0, "PregenPress") - GemRB.SetEvent(StartWindow, ExitButton, 0, "BackToMain") - GemRB.SetButtonState(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_DISABLED) - GemRB.SetButtonState(StartWindow, OptionsButton, IE_GUI_BUTTON_DISABLED) - return - -def ConnectPress(): -#well... - #GemRB.SetVar("PlayMode",2) - return - -def PregenPress(): +def SoAPress(): GemRB.UnloadWindow(StartWindow) - GemRB.UnloadWindow(QuitWindow) - GemRB.UnloadWindow(TutorialWindow) - #do not start game after chargen - GemRB.SetVar("PlayMode",-1) #will return to pregen screen - GemRB.SetVar("Slot",0) - GemRB.LoadGame(-1) - GemRB.SetNextScript("CharGen") #should be pregen screen + GemRB.SetMasterScript("BALDUR","WORLDMAP") + GemRB.SetVar("oldgame",1) + GemRB.SetNextScript("Start2") + if not skip_videos: + GemRB.PlayMovie ("INTRO15F") return -def LoadSingle(): +def ToBPress(): + GemRB.SetMasterScript("BALDUR25","WORLDM25") + GemRB.SetVar("oldgame",0) GemRB.UnloadWindow(StartWindow) - GemRB.UnloadWindow(QuitWindow) - GemRB.UnloadWindow(TutorialWindow) - GemRB.SetVar("PlayMode",0) - GemRB.SetNextScript("GUILOAD") + GemRB.SetNextScript("Start2") + if not skip_videos: + GemRB.PlayMovie ("INTRO") return -def NewSingle(): - GemRB.UnloadWindow(StartWindow) - GemRB.UnloadWindow(QuitWindow) - GemRB.UnloadWindow(TutorialWindow) - GemRB.SetVar("PlayMode",0) - GemRB.SetVar("Slot",1) - GemRB.LoadGame(-1) - GemRB.SetNextScript("CharGen") - return - -def Tutorial(): - GemRB.SetVisible(StartWindow,0) - GemRB.SetVisible(TutorialWindow,1) - return - -def PlayPress(): - GemRB.UnloadWindow(StartWindow) - GemRB.UnloadWindow(QuitWindow) - GemRB.UnloadWindow(TutorialWindow) - GemRB.SetVar("PlayMode",1) #tutorial - GemRB.SetVar("Slot",1) - GemRB.LoadGame(-1) - GemRB.SetNextScript("CharGen") - return - -def CancelTut(): - GemRB.SetVisible(TutorialWindow,0) - GemRB.SetVisible(StartWindow,1) - return - def ExitPress(): - GemRB.SetVisible(StartWindow,0) - GemRB.SetVisible(QuitWindow,1) - return - -def ExitConfirmed(): GemRB.Quit() return - -def OptionsPress(): -#apparently the order is important - GemRB.UnloadWindow(StartWindow) - GemRB.UnloadWindow(QuitWindow) - GemRB.UnloadWindow(TutorialWindow) - GemRB.SetNextScript("StartOpt") - return - -def MoviesPress(): -#apparently the order is important - GemRB.UnloadWindow(StartWindow) - GemRB.UnloadWindow(QuitWindow) - GemRB.UnloadWindow(TutorialWindow) - GemRB.SetNextScript("GUIMOVIE") - return - -def ExitCancelled(): - GemRB.SetVisible(QuitWindow, 0) - GemRB.SetVisible(StartWindow, 1) - return - -def BackToMain(): - GemRB.SetButtonState(StartWindow, SinglePlayerButton, IE_GUI_BUTTON_ENABLED) - GemRB.SetButtonState(StartWindow, OptionsButton, IE_GUI_BUTTON_ENABLED) - GemRB.SetButtonState(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_ENABLED) - GemRB.SetText(StartWindow, SinglePlayerButton, 15413) - GemRB.SetText(StartWindow, ExitButton, 15417) - GemRB.SetText(StartWindow, OptionsButton, 13905) - GemRB.SetText(StartWindow, MultiPlayerButton, 15414) - GemRB.SetText(StartWindow, MoviesButton, 15415) - GemRB.SetEvent(StartWindow, SinglePlayerButton, IE_GUI_BUTTON_ON_PRESS, "SinglePlayerPress") - GemRB.SetEvent(StartWindow, ExitButton, IE_GUI_BUTTON_ON_PRESS, "ExitPress") - GemRB.SetEvent(StartWindow, OptionsButton, IE_GUI_BUTTON_ON_PRESS, "OptionsPress") - GemRB.SetEvent(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_ON_PRESS, "MultiPlayerPress") - GemRB.SetEvent(StartWindow, MoviesButton, IE_GUI_BUTTON_ON_PRESS, "MoviesPress") - GemRB.SetVisible(QuitWindow, 0) - GemRB.SetVisible(StartWindow, 1) - return Added: gemrb/trunk/gemrb/GUIScripts/bg2/Start2.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/Start2.py (rev 0) +++ gemrb/trunk/gemrb/GUIScripts/bg2/Start2.py 2007-11-25 17:09:29 UTC (rev 4850) @@ -0,0 +1,213 @@ +#this is essentially Start.py from the SoA game, except for a very small change +import GemRB + +StartWindow = 0 +TutorialWindow = 0 +QuitWindow = 0 +ExitButton = 0 +SinglePlayerButton = 0 +OptionsButton = 0 +MultiPlayerButton = 0 +MoviesButton = 0 + +def OnLoad(): + global StartWindow, TutorialWindow, QuitWindow + global ExitButton, OptionsButton, MultiPlayerButton, MoviesButton + + skip_videos = not GemRB.GetVar ("SkipIntroVideos") + + GemRB.LoadWindowPack("START", 640, 480) +#tutorial subwindow + TutorialWindow = GemRB.LoadWindow(5) + TextAreaControl = GemRB.GetControl(TutorialWindow, 1) + CancelButton = GemRB.GetControl(TutorialWindow, 11) + PlayButton = GemRB.GetControl(TutorialWindow, 10) + GemRB.SetText(TutorialWindow, TextAreaControl, 44200) + GemRB.SetText(TutorialWindow, CancelButton, 13727) + GemRB.SetText(TutorialWindow, PlayButton, 33093) + GemRB.SetEvent(TutorialWindow, PlayButton, IE_GUI_BUTTON_ON_PRESS, "PlayPress") + GemRB.SetEvent(TutorialWindow, CancelButton, IE_GUI_BUTTON_ON_PRESS, "CancelTut") +#quit subwindow + QuitWindow = GemRB.LoadWindow(3) + QuitTextArea = GemRB.GetControl(QuitWindow,0) + CancelButton = GemRB.GetControl(QuitWindow, 2) + ConfirmButton = GemRB.GetControl(QuitWindow, 1) + GemRB.SetText(QuitWindow, QuitTextArea, 19532) + GemRB.SetText(QuitWindow, CancelButton, 13727) + GemRB.SetText(QuitWindow, ConfirmButton, 15417) + GemRB.SetEvent(QuitWindow, ConfirmButton, 0, "ExitConfirmed") + GemRB.SetEvent(QuitWindow, CancelButton, 0, "ExitCancelled") +#main window + StartWindow = GemRB.LoadWindow(0) + GemRB.SetWindowFrame (StartWindow) + #this is the ToB specific part of Start.py + if GemRB.GetVar("oldgame")==1: + #GemRB.SetWindowPicture(StartWindow,"STARTOLD") + GemRB.PlayMovie ("INTRO15F",skip_videos) + else: + GemRB.PlayMovie ("INTRO",skip_videos) + + #end ToB specific part + SinglePlayerButton = GemRB.GetControl(StartWindow, 0) + ExitButton = GemRB.GetControl(StartWindow, 3) + OptionsButton = GemRB.GetControl(StartWindow, 4) + MultiPlayerButton = GemRB.GetControl(StartWindow, 1) + MoviesButton = GemRB.GetControl(StartWindow, 2) + DisabledButton = GemRB.GetControl(StartWindow, 5) + GemRB.CreateLabel(StartWindow, 0x0fff0000, 0,450,640,30, "REALMS", "", 1) + Label=GemRB.GetControl(StartWindow, 0x0fff0000) + GemRB.SetText(StartWindow, Label,GEMRB_VERSION) + GemRB.SetButtonState(StartWindow, DisabledButton, IE_GUI_BUTTON_DISABLED) + GemRB.SetButtonState(StartWindow, SinglePlayerButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetButtonState(StartWindow, ExitButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetButtonState(StartWindow, OptionsButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetButtonState(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetButtonState(StartWindow, MoviesButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetText(StartWindow, SinglePlayerButton, 15413) + GemRB.SetText(StartWindow, ExitButton, 15417) + GemRB.SetText(StartWindow, OptionsButton, 13905) + GemRB.SetText(StartWindow, MultiPlayerButton, 15414) + GemRB.SetText(StartWindow, MoviesButton, 15415) + GemRB.SetText(StartWindow, DisabledButton, "") + GemRB.SetEvent(StartWindow, SinglePlayerButton, IE_GUI_BUTTON_ON_PRESS, "SinglePlayerPress") + GemRB.SetEvent(StartWindow, ExitButton, IE_GUI_BUTTON_ON_PRESS, "ExitPress") + GemRB.SetEvent(StartWindow, OptionsButton, IE_GUI_BUTTON_ON_PRESS, "OptionsPress") + GemRB.SetEvent(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_ON_PRESS, "MultiPlayerPress") + GemRB.SetEvent(StartWindow, MoviesButton, IE_GUI_BUTTON_ON_PRESS, "MoviesPress") + GemRB.SetEvent(StartWindow, DisabledButton, IE_GUI_BUTTON_ON_PRESS, "") + GemRB.SetVisible(QuitWindow, 0) + GemRB.SetVisible(TutorialWindow, 0) + GemRB.SetVisible(StartWindow, 1) + GemRB.LoadMusicPL("Theme.mus",1) + return + +def SinglePlayerPress(): + + GemRB.SetText(StartWindow, OptionsButton, "") + GemRB.SetText(StartWindow, SinglePlayerButton, 13728) + GemRB.SetText(StartWindow, ExitButton, 15416) + GemRB.SetText(StartWindow, MultiPlayerButton, 13729) + GemRB.SetText(StartWindow, MoviesButton, 33093) + GemRB.SetEvent(StartWindow, MultiPlayerButton, 0, "LoadSingle") + GemRB.SetEvent(StartWindow, SinglePlayerButton, 0, "NewSingle") + GemRB.SetEvent(StartWindow, MoviesButton, 0, "Tutorial") + GemRB.SetEvent(StartWindow, ExitButton, 0, "BackToMain") + GemRB.SetButtonState(StartWindow, OptionsButton, IE_GUI_BUTTON_DISABLED) + return + +def MultiPlayerPress(): + + GemRB.SetText(StartWindow, OptionsButton, "") + GemRB.SetText(StartWindow, SinglePlayerButton, 20642) + GemRB.SetText(StartWindow, ExitButton, 15416) + GemRB.SetText(StartWindow, MultiPlayerButton, "") + GemRB.SetText(StartWindow, MoviesButton, 11825) + GemRB.SetEvent(StartWindow, MultiPlayerButton, 0, "") + GemRB.SetEvent(StartWindow, SinglePlayerButton, 0, "ConnectPress") + GemRB.SetEvent(StartWindow, MoviesButton, 0, "PregenPress") + GemRB.SetEvent(StartWindow, ExitButton, 0, "BackToMain") + GemRB.SetButtonState(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_DISABLED) + GemRB.SetButtonState(StartWindow, OptionsButton, IE_GUI_BUTTON_DISABLED) + return + +def ConnectPress(): +#well... + #GemRB.SetVar("PlayMode",2) + return + +def PregenPress(): + GemRB.UnloadWindow(StartWindow) + GemRB.UnloadWindow(QuitWindow) + GemRB.UnloadWindow(TutorialWindow) + #do not start game after chargen + GemRB.SetVar("PlayMode",-1) #will allow export + GemRB.SetVar("Slot",0) + GemRB.LoadGame(-1) + GemRB.SetNextScript("CharGen") + return + +def LoadSingle(): + GemRB.UnloadWindow(StartWindow) + GemRB.UnloadWindow(QuitWindow) + GemRB.UnloadWindow(TutorialWindow) + GemRB.SetVar("PlayMode",0) + GemRB.SetNextScript("GUILOAD") + return + +def NewSingle(): + GemRB.UnloadWindow(StartWindow) + GemRB.UnloadWindow(QuitWindow) + GemRB.UnloadWindow(TutorialWindow) + GemRB.SetVar("PlayMode",0) + GemRB.SetVar("Slot",1) + GemRB.LoadGame(-1) + GemRB.SetNextScript("CharGen") + return + +def Tutorial(): + GemRB.SetVisible(StartWindow,0) + GemRB.SetVisible(TutorialWindow,1) + return + +def PlayPress(): + GemRB.UnloadWindow(StartWindow) + GemRB.UnloadWindow(QuitWindow) + GemRB.UnloadWindow(TutorialWindow) + GemRB.SetVar("PlayMode",1) #tutorial + GemRB.SetVar("Slot",1) + GemRB.LoadGame(-1) + GemRB.SetNextScript("CharGen") + return + +def CancelTut(): + GemRB.SetVisible(TutorialWindow,0) + GemRB.SetVisible(StartWindow,1) + return + +def ExitPress(): + GemRB.SetVisible(StartWindow,0) + GemRB.SetVisible(QuitWindow,1) + return + +def ExitConfirmed(): + GemRB.Quit() + return + +def OptionsPress(): +#apparently the order is important + GemRB.UnloadWindow(StartWindow) + GemRB.UnloadWindow(QuitWindow) + GemRB.UnloadWindow(TutorialWindow) + GemRB.SetNextScript("StartOpt") + return + +def MoviesPress(): +#apparently the order is important + GemRB.UnloadWindow(StartWindow) + GemRB.UnloadWindow(QuitWindow) + GemRB.UnloadWindow(TutorialWindow) + GemRB.SetNextScript("GUIMOVIE") + return + +def ExitCancelled(): + GemRB.SetVisible(QuitWindow, 0) + GemRB.SetVisible(StartWindow, 1) + return + +def BackToMain(): + GemRB.SetButtonState(StartWindow, SinglePlayerButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetButtonState(StartWindow, OptionsButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetButtonState(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_ENABLED) + GemRB.SetText(StartWindow, SinglePlayerButton, 15413) + GemRB.SetText(StartWindow, ExitButton, 15417) + GemRB.SetText(StartWindow, OptionsButton, 13905) + GemRB.SetText(StartWindow, MultiPlayerButton, 15414) + GemRB.SetText(StartWindow, MoviesButton, 15415) + GemRB.SetEvent(StartWindow, SinglePlayerButton, IE_GUI_BUTTON_ON_PRESS, "SinglePlayerPress") + GemRB.SetEvent(StartWindow, ExitButton, IE_GUI_BUTTON_ON_PRESS, "ExitPress") + GemRB.SetEvent(StartWindow, OptionsButton, IE_GUI_BUTTON_ON_PRESS, "OptionsPress") + GemRB.SetEvent(StartWindow, MultiPlayerButton, IE_GUI_BUTTON_ON_PRESS, "MultiPlayerPress") + GemRB.SetEvent(StartWindow, MoviesButton, IE_GUI_BUTTON_ON_PRESS, "MoviesPress") + GemRB.SetVisible(QuitWindow, 0) + GemRB.SetVisible(StartWindow, 1) + return Property changes on: gemrb/trunk/gemrb/GUIScripts/bg2/Start2.py ___________________________________________________________________ Name: svn:eol-style + native Modified: gemrb/trunk/gemrb/GUIScripts/tob/CharGen.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/CharGen.py 2007-11-25 17:05:39 UTC (rev 4849) +++ gemrb/trunk/gemrb/GUIScripts/tob/CharGen.py 2007-11-25 17:09:29 UTC (rev 4850) @@ -12,8 +12,10 @@ #this is tob specific code! if GemRB.GetVar("oldgame")==0: GemRB.GameSetExpansion(1) + GemRB.SetVar ("PlayMode",2) else: GemRB.GameSetExpansion(0) + GemRB.SetVar ("PlayMode",0) GemRB.SetVar("Gender",0) #gender GemRB.SetVar("Race",0) #race Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py 2007-11-25 17:05:39 UTC (rev 4849) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICG7.py 2007-11-25 17:09:29 UTC (rev 4850) @@ -28,10 +28,11 @@ SpellMask = 0 Random = 1 Learnable = [] +KitValue = 0 def OnLoad(): global MageSpellsWindow, MageSpellsTextArea, DoneButton - global MageSpellsSelectPointsLeft, Learnable + global MageSpellsSelectPointsLeft, Learnable, KitValue AlignmentTable = GemRB.LoadTable("aligns") ClassTable = GemRB.LoadTable("classes") @@ -138,7 +139,9 @@ return def MarkButton(i): - print "IIII:::",i + Spell = GemRB.GetSpell(Learnable[i]) + print "IIII:::",Spell + print "MySchool", KitValue type = IE_GUI_BUTTON_ENABLED #if the spell is specialist spell then type = IE_GUI_BUTTON_THIRD SpellButton = GemRB.GetControl(MageSpellsWindow, i + 2) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUILOAD.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUILOAD.py 2007-11-25 17:05:39 UTC (rev 4849) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUILOAD.py 2007-11-25 17:09:29 UTC (rev 4850) @@ -10,6 +10,11 @@ def OnLoad(): global LoadWindow, TextAreaControl, GameCount, ScrollBar + if GemRB.GetVar("oldgame")==0: + GemRB.GameSetExpansion(1) + else: + GemRB.GameSetExpansion(0) + GemRB.LoadWindowPack("GUILOAD", 640, 480) LoadWindow = GemRB.LoadWindow(0) GemRB.SetWindowFrame (LoadWindow) Modified: gemrb/trunk/gemrb/GUIScripts/tob/Start.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/Start.py 2007-11-25 17:05:39 UTC (rev 4849) +++ gemrb/trunk/gemrb/GUIScripts/tob/Start.py 2007-11-25 17:09:29 UTC (rev 4850) @@ -29,8 +29,6 @@ GemRB.SetMasterScript("BALDUR","WORLDMAP") GemRB.SetVar("oldgame",1) GemRB.SetNextScript("Start2") - if not skip_videos: - GemRB.PlayMovie ("INTRO15F") return GemRB.LoadWindowPack("START", 640, 480) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-12-08 11:23:54
|
Revision: 4888 http://gemrb.svn.sourceforge.net/gemrb/?rev=4888&view=rev Author: avenger_teambg Date: 2007-12-08 03:23:58 -0800 (Sat, 08 Dec 2007) Log Message: ----------- improved action buttons in all games a bit Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py Modified: gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-12-08 11:07:20 UTC (rev 4887) +++ gemrb/trunk/gemrb/GUIScripts/bg1/GUICommonWindows.py 2007-12-08 11:23:58 UTC (rev 4888) @@ -321,7 +321,7 @@ UpdateActionsWindow () return -def ActionSongPressed (): +def ActionBardSongPressed (): pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_BATTLESONG) UpdateActionsWindow () Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-12-08 11:07:20 UTC (rev 4887) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICommonWindows.py 2007-12-08 11:23:58 UTC (rev 4888) @@ -339,7 +339,7 @@ UpdateActionsWindow () return -def ActionSongPressed (): +def ActionBardSongPressed (): pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_BATTLESONG) UpdateActionsWindow () Modified: gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-12-08 11:07:20 UTC (rev 4887) +++ gemrb/trunk/gemrb/GUIScripts/how/GUICommonWindows.py 2007-12-08 11:23:58 UTC (rev 4888) @@ -327,7 +327,7 @@ UpdateActionsWindow () return -def ActionSongPressed (): +def ActionBardSongPressed (): pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_BATTLESONG) UpdateActionsWindow () Modified: gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-12-08 11:07:20 UTC (rev 4887) +++ gemrb/trunk/gemrb/GUIScripts/iwd/GUICommonWindows.py 2007-12-08 11:23:58 UTC (rev 4888) @@ -325,7 +325,7 @@ UpdateActionsWindow () return -def ActionSongPressed (): +def ActionBardSongPressed (): pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_BATTLESONG) UpdateActionsWindow () Modified: gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py 2007-12-08 11:07:20 UTC (rev 4887) +++ gemrb/trunk/gemrb/GUIScripts/iwd2/GUICommonWindows.py 2007-12-08 11:23:58 UTC (rev 4888) @@ -9,12 +9,12 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id$ @@ -24,6 +24,8 @@ import GemRB from GUIDefines import * from ie_stats import * +from ie_modal import * +from ie_action import * FRAME_PC_SELECTED = 0 FRAME_PC_TARGET = 1 @@ -176,6 +178,7 @@ def UpdateActionsWindow (): global PortraitWindow + global level, TopIndex if PortraitWindow == -1: return @@ -202,8 +205,19 @@ if pc == -1: GroupControls () return - #this is based on class - GemRB.SetupControls (PortraitWindow, pc, 6) + + level = GemRB.GetVar ("ActionLevel") + TopIndex = GemRB.GetVar ("TopIndex") + if level == 0: + GemRB.SetupControls (PortraitWindow, pc, 6) + elif level == 1: + GemRB.SetupEquipmentIcons(PortraitWindow, pc, TopIndex) + elif level == 2: #spells + GemRB.SetVar ("Type", 3) + GemRB.SetupSpellIcons(PortraitWindow, pc, 3, TopIndex) + elif level == 3: #innates + GemRB.SetVar ("Type", 4) + GemRB.SetupSpellIcons(PortraitWindow, pc, 4, TopIndex) return def OpenFloatMenuWindow (): @@ -221,6 +235,33 @@ def ActionThievingPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_PICK) +def ActionQWeaponPressed (which): + global PortraitWindow + + pc = GemRB.GameGetFirstSelectedPC () + + if GemRB.GetEquippedQuickSlot (pc,1)==which and not (GemRB.GameControlGetTargetMode() &TARGET_MODE_ATTACK): + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_ATTACK) + else: + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL) + GemRB.SetEquippedQuickSlot (pc, which) + + GemRB.SetupControls (PortraitWindow, pc, 6) + UpdateActionsWindow () + return + +def ActionQWeapon1Pressed (): + ActionQWeaponPressed(0) + +def ActionQWeapon2Pressed (): + ActionQWeaponPressed(1) + +def ActionQWeapon3Pressed (): + ActionQWeaponPressed(2) + +def ActionQWeapon4Pressed (): + ActionQWeaponPressed(3) + def ActionStopPressed (): for i in range (PARTY_SIZE): if GemRB.GameIsPCSelected(i + 1): @@ -254,6 +295,103 @@ UpdateActionsWindow () return +def ActionBardSongPressed (): + pc = GemRB.GameGetFirstSelectedPC () + GemRB.SetModalState (pc, MS_BATTLESONG) + UpdateActionsWindow () + return + +def ActionSearchPressed (): + pc = GemRB.GameGetFirstSelectedPC () + GemRB.SetModalState (pc, MS_DETECTTRAPS) + UpdateActionsWindow () + return + +def ActionStealthPressed (): + pc = GemRB.GameGetFirstSelectedPC () + GemRB.SetModalState (pc, MS_STEALTH) + UpdateActionsWindow () + return + +def ActionTurnPressed (): + pc = GemRB.GameGetFirstSelectedPC () + GemRB.SetModalState (pc, MS_TURNUNDEAD) + UpdateActionsWindow () + return + +def ActionUseItemPressed (): + GemRB.SetVar ("TopIndex", 0) + GemRB.SetVar ("ActionLevel", 1) + UpdateActionsWindow () + return + +def ActionCastPressed (): + print "CASRRE" + GemRB.SetVar ("TopIndex", 0) + GemRB.SetVar ("ActionLevel", 2) + UpdateActionsWindow () + return + +def ActionQItemPressed (action): + pc = GemRB.GameGetFirstSelectedPC () + #quick slot + GemRB.UseItem (pc, -2, action) + return + +def ActionQItem1Pressed (): + ActionQItemPressed (ACT_QSLOT1) + return + +def ActionQItem2Pressed (): + ActionQItemPressed (ACT_QSLOT2) + return + +def ActionQItem3Pressed (): + ActionQItemPressed (ACT_QSLOT3) + return + +def ActionQItem4Pressed (): + ActionQItemPressed (ACT_QSLOT4) + return + +def ActionQItem5Pressed (): + ActionQItemPressed (ACT_QSLOT5) + return + +def ActionInnatePressed (): + GemRB.SetVar ("TopIndex", 0) + GemRB.SetVar ("ActionLevel", 3) + UpdateActionsWindow () + return + +def ActionSkillsPressed (): + GemRB.SetVar ("TopIndex", 0) + GemRB.SetVar ("ActionLevel", 4) + UpdateActionsWindow () + return + +def SpellPressed (): + pc = GemRB.GameGetFirstSelectedPC () + + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) + Spell = GemRB.GetVar ("Spell") + Type = GemRB.GetVar ("Type") + GemRB.SpellCast (pc, Type, Spell) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () + return + +def EquipmentPressed (): + pc = GemRB.GameGetFirstSelectedPC () + + GemRB.GameControlSetTargetMode (TARGET_MODE_ALL | TARGET_MODE_CAST) + Item = GemRB.GetVar ("Equipment") + #equipment index + GemRB.UseItem (pc, -1, Item) + GemRB.SetVar ("ActionLevel", 0) + UpdateActionsWindow () + return + def GetActorRaceTitle (actor): Table = GemRB.LoadTable ("races") RaceID = GemRB.GetPlayerStat (actor, IE_SUBRACE) @@ -303,8 +441,8 @@ global SelectionChangeHandler # Switching from walking to non-walking environment: - # set the first selected PC in walking env as a selected - # in nonwalking env + # set the first selected PC in walking env as a selected + # in nonwalking env if (not SelectionChangeHandler) and handler: sel = GemRB.GameGetFirstSelectedPC () if not sel: @@ -446,7 +584,7 @@ #fighter/thief Class = GemRB.FindTableValue (ClassTable, 5, 4) SaveName2 = GemRB.GetTableValue (ClassTable, Class, 3) - Class = 0 #fighter + Class = 0 #fighter SaveName1 = GemRB.GetTableValue (ClassTable, Class, 3) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-12-08 11:07:20 UTC (rev 4887) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICommonWindows.py 2007-12-08 11:23:58 UTC (rev 4888) @@ -339,7 +339,7 @@ UpdateActionsWindow () return -def ActionSongPressed (): +def ActionBardSongPressed (): pc = GemRB.GameGetFirstSelectedPC () GemRB.SetModalState (pc, MS_BATTLESONG) UpdateActionsWindow () This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ave...@us...> - 2007-12-08 16:37:58
|
Revision: 4892 http://gemrb.svn.sourceforge.net/gemrb/?rev=4892&view=rev Author: avenger_teambg Date: 2007-12-08 08:25:14 -0800 (Sat, 08 Dec 2007) Log Message: ----------- fixed hated race screen (bugged recently) fixed kit value (hopefully) Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py gemrb/trunk/gemrb/GUIScripts/bg2/GUICG15.py gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py gemrb/trunk/gemrb/GUIScripts/tob/GUICG15.py Modified: gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-12-08 15:40:34 UTC (rev 4891) +++ gemrb/trunk/gemrb/GUIScripts/bg2/CharGen9.py 2007-12-08 16:25:14 UTC (rev 4892) @@ -164,7 +164,7 @@ GemRB.LearnSpell (MyChar, Learnable[i], 0) j=j<<1 else: - KitValue = 0x4000 + KitIndex + KitValue = (0x4000 + KitIndex)<<16 print "KitValue**********:",KitValue GemRB.SetPlayerStat (MyChar, IE_KIT, KitValue) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/GUICG15.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/GUICG15.py 2007-12-08 15:40:34 UTC (rev 4891) +++ gemrb/trunk/gemrb/GUIScripts/bg2/GUICG15.py 2007-12-08 16:25:14 UTC (rev 4892) @@ -35,7 +35,7 @@ ClassRow = GemRB.GetVar("Class")-1 Class = GemRB.GetTableValue(ClassTable, ClassRow, 5) TmpTable = GemRB.LoadTable("clskills") - TableName = GemRB.GetTableValue(TmpTable, Class, 0) + TableName = GemRB.GetTableValue(TmpTable, Class, 9) if TableName == "*": GemRB.SetNextScript("GUICG7") return Modified: gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-12-08 15:40:34 UTC (rev 4891) +++ gemrb/trunk/gemrb/GUIScripts/tob/CharGen9.py 2007-12-08 16:25:14 UTC (rev 4892) @@ -156,7 +156,7 @@ if TableName != "*": KitValue = GemRB.GetTableValue(KitTable, KitIndex, 6) if TableName != "MXSPLBRD" and KitValue == "*": - KitValue = 0x4000 + KitValue = 0x40000000 SetupSpellLevels(MyChar, TableName, IE_SPELL_TYPE_WIZARD, 1) Learnable = GetLearnableMageSpells( KitValue, t, 1) SpellBook = GemRB.GetVar ("MageSpellBook") @@ -166,7 +166,7 @@ GemRB.LearnSpell (MyChar, Learnable[i], 0) j=j<<1 else: - KitValue = 0x4000 + KitIndex + KitValue = (0x4000 + KitIndex)<<16 print "KitValue**********:",KitValue GemRB.SetPlayerStat (MyChar, IE_KIT, KitValue) Modified: gemrb/trunk/gemrb/GUIScripts/tob/GUICG15.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/tob/GUICG15.py 2007-12-08 15:40:34 UTC (rev 4891) +++ gemrb/trunk/gemrb/GUIScripts/tob/GUICG15.py 2007-12-08 16:25:14 UTC (rev 4892) @@ -35,7 +35,7 @@ ClassRow = GemRB.GetVar("Class")-1 Class = GemRB.GetTableValue(ClassTable, ClassRow, 5) TmpTable = GemRB.LoadTable("clskills") - TableName = GemRB.GetTableValue(TmpTable, Class, 0) + TableName = GemRB.GetTableValue(TmpTable, Class, 9) if TableName == "*": GemRB.SetNextScript("GUICG7") return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |