From: Laszlo T. <ave...@us...> - 2006-07-04 14:31:33
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2 In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv7046/GUIScripts/bg2 Modified Files: GUICommonWindows.py Log Message: bg/bg2/iwd1:improved inventory screens: item transfer/quick weapon slots Button: The MouseEnter/Leave functions will set the associated variable Index: GUICommonWindows.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/bg2/GUICommonWindows.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** GUICommonWindows.py 2 Jul 2006 11:23:25 -0000 1.32 --- GUICommonWindows.py 4 Jul 2006 14:31:28 -0000 1.33 *************** *** 241,253 **** def ActionQWeaponPressed (which): ! pc = GemRB.GameGetFirstSelectedPC() ! ! 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.SetupControls (ActionsWindow, pc) UpdateActionsWindow () return --- 241,253 ---- def ActionQWeaponPressed (which): ! pc = GemRB.GameGetFirstSelectedPC() ! ! 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.SetupControls (ActionsWindow, pc) UpdateActionsWindow () return *************** *** 354,366 **** for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) ! 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.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.SetVarAssoc (Window, Button, "PressedPortrait", i) GemRB.SetButtonFont (Window, Button, "NORMAL") --- 354,366 ---- for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) ! GemRB.SetVarAssoc (Window, Button, "PressedPortrait", 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.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") *************** *** 374,380 **** for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) ! pic = GemRB.GetPlayerPortrait (i+1,1) if not pic: GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) GemRB.SetText (Window, Button, "") GemRB.SetTooltip (Window, Button, "") --- 374,381 ---- for i in range (PARTY_SIZE): Button = GemRB.GetControl (Window, i) ! pic = GemRB.GetPlayerPortrait (i+1, 1) if not pic: 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, "") *************** *** 402,406 **** def PortraitButtonOnShiftPress (): ! i = GemRB.GetVar ('PressedPortrait') if (not SelectionChangeHandler): --- 403,407 ---- def PortraitButtonOnShiftPress (): ! i = GemRB.GetVar ("PressedPortrait") if (not SelectionChangeHandler): *************** *** 418,421 **** --- 419,423 ---- return + # Run by Game class when selection was changed def SelectionChanged (): global PortraitWindow *************** *** 432,435 **** --- 434,449 ---- Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, i + 1 == sel) + return + + 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): |