From: Laszlo T. <ave...@us...> - 2004-10-30 15:34:44
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/tob In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27070/tob Modified Files: GUICommonWindows.py GUIINV.py Log Message: bg2: added moving items in inventory/between PC Index: GUICommonWindows.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/tob/GUICommonWindows.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GUICommonWindows.py 17 Oct 2004 20:15:00 -0000 1.10 --- GUICommonWindows.py 30 Oct 2004 15:34:26 -0000 1.11 *************** *** 205,211 **** GemRB.SetVarAssoc (Window, Button, "SelectedSingle", i) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "PortraitButtonOnPress") GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_ALIGN_BOTTOM|IE_GUI_BUTTON_ALIGN_LEFT|IE_GUI_BUTTON_PICTURE, OP_SET) - GemRB.SetButtonBorder (Window, Button, FRAME_PC_SELECTED, 1, 1, 2, 2, 0, 255, 0, 255) --- 205,212 ---- GemRB.SetVarAssoc (Window, Button, "SelectedSingle", 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.SetButtonFlags(Window, Button, IE_GUI_BUTTON_ALIGN_BOTTOM|IE_GUI_BUTTON_ALIGN_LEFT|IE_GUI_BUTTON_PICTURE, OP_SET) GemRB.SetButtonBorder (Window, Button, FRAME_PC_SELECTED, 1, 1, 2, 2, 0, 255, 0, 255) Index: GUIINV.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/tob/GUIINV.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GUIINV.py 30 Oct 2004 12:44:15 -0000 1.12 --- GUIINV.py 30 Oct 2004 15:34:26 -0000 1.13 *************** *** 75,94 **** # encumbrance ! Label = GemRB.CreateLabel (Window, 0x10000043, 20,440,60,15,"NUMBER","0:",IE_FONT_ALIGN_LEFT|IE_FONT_ALIGN_TOP) ! #GemRB.SetTooltip (Window, Label, 4196) ! Label = GemRB.CreateLabel (Window, 0x10000044, 20,455,60,15,"NUMBER","0:",IE_FONT_ALIGN_LEFT|IE_FONT_ALIGN_TOP) ! #GemRB.SetTooltip (Window, Label, 4196) # armor class Label = GemRB.GetControl (Window, 0x10000038) - #GemRB.SetTooltip (Window, Label, 4197) # hp current Label = GemRB.GetControl (Window, 0x10000039) - #GemRB.SetTooltip (Window, Label, 4198) # hp max Label = GemRB.GetControl (Window, 0x1000003a) - #GemRB.SetTooltip (Window, Label, 4199) #ground icons scrollbar --- 75,89 ---- # encumbrance ! Label = GemRB.CreateLabel (Window, 0x10000043, 5,385,60,15,"NUMBER","0:",IE_FONT_ALIGN_LEFT|IE_FONT_ALIGN_TOP) ! Label = GemRB.CreateLabel (Window, 0x10000044, 5,455,80,15,"NUMBER","0:",IE_FONT_ALIGN_RIGHT|IE_FONT_ALIGN_TOP) # armor class Label = GemRB.GetControl (Window, 0x10000038) # hp current Label = GemRB.GetControl (Window, 0x10000039) # hp max Label = GemRB.GetControl (Window, 0x1000003a) #ground icons scrollbar *************** *** 100,103 **** --- 95,106 ---- SetSelectionChangeHandler (UpdateInventoryWindow) + + for slot in range(38): + SlotType = GemRB.GetSlotType(slot) + if SlotType["Type"]: + Button = GemRB.GetControl (Window, SlotType["ID"]) + GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_ALIGN_RIGHT | IE_GUI_BUTTON_ALIGN_BOTTOM | IE_GUI_BUTTON_PICTURE, OP_OR) + GemRB.SetVarAssoc (Window, Button, "ItemButton", slot) + UpdateInventoryWindow () *************** *** 170,175 **** def UpdateInventoryWindow (): - global ItemHash - GemRB.HideGUI() Window = InventoryWindow --- 173,176 ---- *************** *** 270,273 **** --- 271,275 ---- slot_item = GemRB.GetSlotItem (pc, slot) + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_DRAG_DROP, "OnDragItem") if slot_item: item = GemRB.GetItem (slot_item["ItemResRef"]) *************** *** 288,295 **** GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenItemInfoWindow") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_SHIFT_PRESS, "OpenItemAmountWindow") - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_DRAG_DROP, "OnDragItem") else: - GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_PICTURE, OP_OR) if SlotType["ResRef"]=="*": GemRB.SetButtonBAM (Window, Button, "",0,0,0) --- 290,295 ---- *************** *** 299,308 **** GemRB.SetTooltip (Window, Button, SlotType["Tip"]) - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_DRAG_DROP, "") - GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_SHIFT_PRESS, "") return ################################################### # End of file GUIINV.py --- 299,328 ---- GemRB.SetTooltip (Window, Button, SlotType["Tip"]) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_RIGHT_PRESS, "") GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_SHIFT_PRESS, "") return + + def OnDragItem (): + pc = GemRB.GameGetSelectedPCSingle () + + slot = GemRB.GetVar ("ItemButton") + if not GemRB.IsDraggingItem (): + slot_item = GemRB.GetSlotItem (pc, slot) + item = GemRB.GetItem (slot_item["ItemResRef"]) + GemRB.DragItem (pc, slot, item["ItemIcon"], 0, 0, 0) + else: + GemRB.DropDraggedItem (pc, slot) + + UpdateInventoryWindow () + return + + def OnDropItemToPC (): + pc = GemRB.GetVar ("PressedPortrait") + 1 + print "PC", pc + GemRB.DropDraggedItem (pc, -1) + UpdateInventoryWindow () + return + ################################################### # End of file GUIINV.py |