From: Laszlo T. <ave...@us...> - 2005-05-25 18:56:05
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/tob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11153/GUIScripts/tob Modified Files: GUIINV.py Log Message: GetContainer creates empty container if required LeaveContainer removes empty groundpiles Index: GUIINV.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/tob/GUIINV.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** GUIINV.py 18 May 2005 15:37:10 -0000 1.20 --- GUIINV.py 25 May 2005 18:55:54 -0000 1.21 *************** *** 75,79 **** Button = GemRB.GetControl (Window, i) GemRB.SetTooltip (Window, Button, 12011) ! #major & minor clothing color Button = GemRB.GetControl (Window, 62) --- 75,83 ---- Button = GemRB.GetControl (Window, i) GemRB.SetTooltip (Window, Button, 12011) ! ! # ground items scrollbar ! ScrollBar = GemRB.GetControl (Window, 66) ! GemRB.SetEvent (Window, ScrollBar, IE_GUI_SCROLLBAR_ON_CHANGE, "RefreshInventoryWindow") ! #major & minor clothing color Button = GemRB.GetControl (Window, 62) *************** *** 105,111 **** Label = GemRB.GetControl (Window, 0x1000003a) - #ground icons scrollbar - ScrollBar = GemRB.GetControl (Window, 66) - #info label, game paused, etc Label = GemRB.GetControl (Window, 0x1000003f) --- 109,112 ---- *************** *** 190,198 **** return ! def UpdateInventoryWindow (): Window = InventoryWindow pc = GemRB.GameGetSelectedPCSingle () # name --- 191,209 ---- return ! #complete update def UpdateInventoryWindow (): Window = InventoryWindow pc = GemRB.GameGetSelectedPCSingle () + Container = GemRB.GetContainer (pc, 1) + ScrollBar = GemRB.GetControl (Window, 66) + GemRB.SetVarAssoc (Window, ScrollBar, "TopIndex", Container['ItemCount']) + RefreshInventoryWindow() + + #partial update without altering TopIndex + def RefreshInventoryWindow (): + Window = InventoryWindow + + pc = GemRB.GameGetSelectedPCSingle () # name *************** *** 247,250 **** --- 258,274 ---- GemRB.SetButtonBAM(Window, Button, "COLGRAD", 0, 0, Color) + # update ground inventory slots + Container = GemRB.GetContainer(pc, 1) + TopIndex = GemRB.GetVar("TopIndex") + for i in range (5): + Button = GemRB.GetControl (Window, i+68) + Slot = GemRB.GetContainerItem (pc, i+TopIndex) + if Slot != None: + Item = GemRB.GetItem (Slot['ItemResRef']) + GemRB.SetItemIcon (Window, Button, Slot['ItemResRef'],0) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) + else: + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_NAND) + # populate inventory slot controls for i in range (38): |