From: Laszlo T. <ave...@us...> - 2005-03-21 23:09:42
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6315/iwd2 Modified Files: GUICommonWindows.py GUISTORE.py MessageWindow.py Log Message: Updated scripts (stores now work in bg2/tob) Index: MessageWindow.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd2/MessageWindow.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MessageWindow.py 20 Mar 2005 21:28:26 -0000 1.10 --- MessageWindow.py 21 Mar 2005 23:09:33 -0000 1.11 *************** *** 37,50 **** def OnLoad(): global MessageWindow, MessageTA ! GemRB.LoadWindowPack("GUIW08") OptionsWindow = MessageWindow = GemRB.LoadWindow(0) MessageTA = GemRB.GetControl(MessageWindow, 1) GemRB.SetTextAreaFlags(MessageWindow, MessageTA, IE_GUI_TEXTAREA_AUTOSCROLL) - OpenPortraitWindow() - ActionsWindow = PortraitWindow = GUICommonWindows.PortraitWindow - - #ActionsWindow = PortraitWindow = GemRB.LoadWindow(1) - GemRB.SetVar("MessageWindow", MessageWindow) GemRB.SetVar("PortraitWindow", PortraitWindow) --- 37,46 ---- def OnLoad(): global MessageWindow, MessageTA ! GemRB.LoadWindowPack(GetWindowPack()) OptionsWindow = MessageWindow = GemRB.LoadWindow(0) MessageTA = GemRB.GetControl(MessageWindow, 1) GemRB.SetTextAreaFlags(MessageWindow, MessageTA, IE_GUI_TEXTAREA_AUTOSCROLL) + ActionsWindow = PortraitWindow = OpenPortraitWindow(1) GemRB.SetVar("MessageWindow", MessageWindow) GemRB.SetVar("PortraitWindow", PortraitWindow) *************** *** 55,58 **** --- 51,55 ---- GemRB.SetVar("OptionsPosition", -1) #already handled in messagewindow GemRB.SetVar("MessagePosition", 4) + GemRB.SetVar("PortraitPosition", 4) GemRB.SetVar("OtherPosition", 5) #Inactivating GemRB.SetVar("TopPosition", 5) #Inactivating Index: GUISTORE.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd2/GUISTORE.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** GUISTORE.py 20 Mar 2005 23:36:46 -0000 1.11 --- GUISTORE.py 21 Mar 2005 23:09:33 -0000 1.12 *************** *** 26,36 **** import string import GemRB from GUIDefines import * from GUICommonWindows import * from ie_stats import * from GUICommonWindows import SetSelectionChangeHandler - from GUICommon import CloseOtherWindow StoreWindow = None StoreShoppingWindow = None StoreIdentifyWindow = None --- 26,38 ---- import string import GemRB + import GUICommonWindows from GUIDefines import * from GUICommonWindows import * from ie_stats import * from GUICommonWindows import SetSelectionChangeHandler StoreWindow = None + ActionWindow = None + PortraitWindow = None StoreShoppingWindow = None StoreIdentifyWindow = None *************** *** 40,47 **** StoreRumourWindow = None StoreRentWindow = None ! OldPortrait = None ! OldAction = None ! OldMessage = None ! OldOptions = None RentIndex = -1 --- 42,46 ---- StoreRumourWindow = None StoreRentWindow = None ! OldPortraitWindow = None RentIndex = -1 *************** *** 74,82 **** store_update_funcs = None def OpenStoreWindow (): global Store ! global StoreWindow ! global store_update_funcs, inventory_slots ! global OldPortrait, OldMessage, OldAction, OldOptions #these are function pointers, not strings --- 73,104 ---- store_update_funcs = None + def CloseStoreWindow (): + global StoreWindow, ActionWindow, PortraitWindow + global OldPortraitWindow + + CloseStoreShoppingWindow () + CloseStoreIdentifyWindow () + CloseStoreStealWindow () + CloseStoreHealWindow () + CloseStoreDonateWindow () + CloseStoreRumourWindow () + CloseStoreRentWindow () + + 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 ) + + def OpenStoreWindow (): global Store ! global StoreWindow, ActionWindow, PortraitWindow ! global OldPortraitWindow ! global store_update_funcs #these are function pointers, not strings *************** *** 87,132 **** OpenStoreRumourWindow,OpenStoreRentWindow ) - if CloseOtherWindow( OpenStoreWindow ): - GemRB.HideGUI () - CloseStoreShoppingWindow () - CloseStoreIdentifyWindow () - CloseStoreStealWindow () - CloseStoreHealWindow () - CloseStoreDonateWindow () - CloseStoreRumourWindow () - CloseStoreRentWindow () - - GemRB.UnloadWindow (StoreWindow) - StoreWindow = None - GemRB.SetVar ("OtherWindow", -1) - GemRB.SetVar ("TopWindow", -1) - GemRB.SetVar ("PortraitWindow", OldPortrait) - GemRB.SetVar ("OptionsWindow", OldOptions) - GemRB.SetVar ("ActionWindow", OldAction) - GemRB.SetVar ("MessageWindow", OldMessage) - SetSelectionChangeHandler( None ) - GemRB.SetVisible (0,1) #enabling the game control screen - GemRB.UnhideGUI () - GemRB.LeaveStore () - return - - OldPortrait = GemRB.GetVar ("PortraitWindow") - OldAction = GemRB.GetVar ("ActionWindow") - OldMessage = GemRB.GetVar ("MessageWindow") - OldOptions = GemRB.GetVar ("OptionsWindow") - GemRB.HideGUI () GemRB.SetVisible (0,0) #removing the game control screen GemRB.SetVar ("Action", 0) GemRB.LoadWindowPack ("GUISTORE", 640, 480) StoreWindow = Window = GemRB.LoadWindow (3) ! GemRB.SetWindowFrame (Window) ! GemRB.SetVar ("OtherWindow", StoreWindow) #this is the store button row ! OpenPortraitWindow(0) ActionWindow = GemRB.LoadWindow(0) ! GemRB.SetVar ("ActionWindow", ActionWindow) GemRB.SetWindowFrame (ActionWindow) - GemRB.SetVar ("MessageWindow", -1) - GemRB.SetVar ("OptionsWindow", -1) Store = GemRB.GetStore() --- 109,124 ---- OpenStoreRumourWindow,OpenStoreRentWindow ) GemRB.HideGUI () GemRB.SetVisible (0,0) #removing the game control screen + GemRB.SetVar ("Action", 0) GemRB.LoadWindowPack ("GUISTORE", 640, 480) StoreWindow = Window = GemRB.LoadWindow (3) ! #saving the original portrait window ! OldPortraitWindow = GUICommonWindows.PortraitWindow ! PortraitWindow = OpenPortraitWindow(0) ActionWindow = GemRB.LoadWindow(0) ! #this window is static and grey, but good to stick the frame onto GemRB.SetWindowFrame (ActionWindow) Store = GemRB.GetStore() *************** *** 134,138 **** Button = GemRB.GetControl (Window, 0) GemRB.SetText (Window, Button, 11973) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenStoreWindow") #Store type icon --- 126,130 ---- Button = GemRB.GetControl (Window, 0) GemRB.SetText (Window, Button, 11973) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "CloseStoreWindow") #Store type icon *************** *** 159,179 **** GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) ! GemRB.UnhideGUI () store_update_funcs[store_buttons[0]] () def OpenStoreShoppingWindow (): global StoreShoppingWindow - GemRB.HideGUI () if StoreShoppingWindow != None: Window = StoreShoppingWindow - GemRB.SetVar ("TopWindow", Window) UpdateStoreShoppingWindow () - GemRB.UnhideGUI () return StoreShoppingWindow = Window = GemRB.LoadWindow (2) - GemRB.SetWindowFrame (Window) - GemRB.SetVar ("TopWindow", Window) # buy price ... --- 151,169 ---- GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) ! GemRB.SetVisible (ActionWindow, 1) ! GemRB.SetVisible (Window, 1) store_update_funcs[store_buttons[0]] () + GemRB.SetVisible (PortraitWindow, 1) + def OpenStoreShoppingWindow (): global StoreShoppingWindow if StoreShoppingWindow != None: Window = StoreShoppingWindow UpdateStoreShoppingWindow () return StoreShoppingWindow = Window = GemRB.LoadWindow (2) # buy price ... *************** *** 226,230 **** SetSelectionChangeHandler( UpdateStoreShoppingWindow ) UpdateStoreShoppingWindow () ! GemRB.UnhideGUI () --- 216,220 ---- SetSelectionChangeHandler( UpdateStoreShoppingWindow ) UpdateStoreShoppingWindow () ! GemRB.SetVisible(Window, 1) *************** *** 232,248 **** global StoreIdentifyWindow - GemRB.HideGUI () GemRB.SetVar ("Index", -1) GemRB.SetVar ("TopIndex", 0) if StoreIdentifyWindow != None: Window = StoreIdentifyWindow - GemRB.SetVar ("TopWindow", Window) UpdateStoreIdentifyWindow () - GemRB.UnhideGUI () return StoreIdentifyWindow = Window = GemRB.LoadWindow (4) - GemRB.SetWindowFrame (Window) - GemRB.SetVar ("TopWindow", Window) # Identify --- 222,233 ---- *************** *** 270,274 **** SetSelectionChangeHandler( UpdateStoreIdentifyWindow ) UpdateStoreIdentifyWindow () ! GemRB.UnhideGUI () --- 255,259 ---- SetSelectionChangeHandler( UpdateStoreIdentifyWindow ) UpdateStoreIdentifyWindow () ! GemRB.SetVisible(Window, 1) *************** *** 276,290 **** global StoreStealWindow - GemRB.HideGUI () if StoreStealWindow != None: Window = StoreStealWindow - GemRB.SetVar ("TopWindow", Window) UpdateStoreStealWindow () - GemRB.UnhideGUI () return StoreStealWindow = Window = GemRB.LoadWindow (6) - GemRB.SetWindowFrame (Window) - GemRB.SetVar ("TopWindow", Window) j = 1 --- 261,270 ---- *************** *** 322,326 **** SetSelectionChangeHandler( UpdateStoreStealWindow ) UpdateStoreStealWindow () ! GemRB.UnhideGUI () --- 302,306 ---- SetSelectionChangeHandler( UpdateStoreStealWindow ) UpdateStoreStealWindow () ! GemRB.SetVisible(Window, 1) *************** *** 328,342 **** global StoreDonateWindow - GemRB.HideGUI () if StoreDonateWindow != None: Window = StoreDonateWindow - GemRB.SetVar ("TopWindow", Window) UpdateStoreDonateWindow () - GemRB.UnhideGUI () return StoreDonateWindow = Window = GemRB.LoadWindow (9) - GemRB.SetWindowFrame (Window) - GemRB.SetVar ("TopWindow", Window) # graphics --- 308,317 ---- *************** *** 366,370 **** SetSelectionChangeHandler( UpdateStoreDonateWindow ) UpdateStoreDonateWindow () ! GemRB.UnhideGUI () --- 341,345 ---- SetSelectionChangeHandler( UpdateStoreDonateWindow ) UpdateStoreDonateWindow () ! GemRB.SetVisible(Window, 1) *************** *** 372,388 **** global StoreHealWindow - GemRB.HideGUI () GemRB.SetVar ("Index", -1) GemRB.SetVar ("TopIndex", 0) if StoreHealWindow != None: Window = StoreHealWindow - GemRB.SetVar ("TopWindow", Window) UpdateStoreHealWindow () - GemRB.UnhideGUI () return StoreHealWindow = Window = GemRB.LoadWindow (5) - GemRB.SetWindowFrame (Window) - GemRB.SetVar ("TopWindow", Window) #spell buttons --- 347,358 ---- *************** *** 413,417 **** UpdateStoreHealWindow () ! GemRB.UnhideGUI () --- 383,387 ---- UpdateStoreHealWindow () ! GemRB.SetVisible(Window, 1) *************** *** 419,434 **** global StoreRumourWindow - GemRB.HideGUI () GemRB.SetVar ("TopIndex", 0) if StoreRumourWindow != None: Window = StoreRumourWindow - GemRB.SetVar ("TopWindow", Window) UpdateStoreRumourWindow () - GemRB.UnhideGUI () return StoreRumourWindow = Window = GemRB.LoadWindow (8) - GemRB.SetWindowFrame (Window) - GemRB.SetVar ("TopWindow", Window) #removing those pesky labels --- 389,399 ---- *************** *** 453,457 **** UpdateStoreRumourWindow () ! GemRB.UnhideGUI () --- 418,422 ---- UpdateStoreRumourWindow () ! GemRB.SetVisible(Window, 1) *************** *** 459,474 **** global StoreRentWindow, RentIndex - GemRB.HideGUI () if StoreRentWindow != None: Window = StoreRentWindow GemRB.SetVar ("RentIndex", RentIndex) - GemRB.SetVar ("TopWindow", Window) UpdateStoreRentWindow () - GemRB.UnhideGUI () return StoreRentWindow = Window = GemRB.LoadWindow (7) - GemRB.SetWindowFrame (Window) - GemRB.SetVar ("TopWindow", Window) # room types --- 424,434 ---- *************** *** 501,505 **** UpdateStoreRentWindow () ! GemRB.UnhideGUI () --- 461,465 ---- UpdateStoreRentWindow () ! GemRB.SetVisible(Window, 1) *************** *** 696,702 **** GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ErrorDone") - GemRB.HideGUI () - GemRB.SetVar ("FloatWindow", Window) - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) --- 656,659 ---- *************** *** 841,847 **** #if reputation<180: if GemRB.IncreaseReputation( donation ): - #limit = donationlimit[reputation/10] - #if donation>=limit: - #GemRB.GameSetReputation (reputation+10) GemRB.TextAreaAppend (Window, TextArea, 10468, -1) GemRB.PlaySound ("act_03") --- 798,801 ---- *************** *** 913,919 **** GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ErrorDone") - GemRB.HideGUI () - GemRB.SetVar ("FloatWindow", Window) - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) --- 867,870 ---- *************** *** 968,972 **** Drink = GemRB.GetStoreDrink (Index) if gold < Drink['Price']: - #GemRB.TextAreaAppend (Window, TextArea, 11049, -1) ErrorWindow (11049) return --- 919,922 ---- *************** *** 1003,1008 **** if Gold<price: ErrorWindow (11051) - #GemRB.SetText (Window, TextArea, 11051) return GemRB.GameSetPartyGold (Gold-price) UpdateStoreRentWindow () --- 953,958 ---- if Gold<price: ErrorWindow (11051) return + GemRB.GameSetPartyGold (Gold-price) UpdateStoreRentWindow () *************** *** 1076,1082 **** GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "ErrorDone") - GemRB.HideGUI () - GemRB.SetVar ("FloatWindow", Window) - GemRB.UnhideGUI () GemRB.ShowModal (Window, MODAL_SHADOW_GRAY) --- 1026,1029 ---- *************** *** 1084,1091 **** def ErrorDone (): Window = GemRB.GetVar ("FloatWindow") - GemRB.HideGUI () GemRB.UnloadWindow (Window) - GemRB.SetVar ("FloatWindow", -1) - GemRB.UnhideGUI () --- 1031,1035 ---- Index: GUICommonWindows.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/iwd2/GUICommonWindows.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GUICommonWindows.py 22 Nov 2004 21:41:28 -0000 1.7 --- GUICommonWindows.py 21 Mar 2005 23:09:33 -0000 1.8 *************** *** 176,195 **** SelectionChangeHandler () ! def OpenPortraitWindow (): global PortraitWindow PortraitWindow = Window = GemRB.LoadWindow(1) - GemRB.SetVar ("PortraitWindow", PortraitWindow) - GemRB.SetVar ("PortraitPosition", 4) # Bottom ! # AI ! Button = GemRB.GetControl (Window, 6) ! GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "AIPress") ! #Select All ! Button = GemRB.GetControl (Window, 7) ! GemRB.SetTooltip (Window, Button, 10485) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SelectAllOnPress") for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) --- 176,194 ---- SelectionChangeHandler () ! def OpenPortraitWindow (needcontrols): global PortraitWindow PortraitWindow = Window = GemRB.LoadWindow(1) ! if needcontrols: ! # AI ! Button = GemRB.GetControl (Window, 6) ! GemRB.SetButtonState (Window, Button, IE_GUI_BUTTON_DISABLED) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "AIPress") ! #Select All ! Button = GemRB.GetControl (Window, 7) ! GemRB.SetTooltip (Window, Button, 10485) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "SelectAllOnPress") for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) *************** *** 205,209 **** UpdatePortraitWindow () ! return def UpdatePortraitWindow (): --- 204,208 ---- UpdatePortraitWindow () ! return Window def UpdatePortraitWindow (): |