From: Jarda B. <edh...@us...> - 2004-09-24 15:15:45
|
Update of /cvsroot/gemrb/gemrb/gemrb/GUIScripts/how In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29717/GUIScripts/how Modified Files: GUICommonWindows.py Log Message: Added some lines from the file I forgot to upload, *sigh* Index: GUICommonWindows.py =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/GUIScripts/how/GUICommonWindows.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GUICommonWindows.py 23 Sep 2004 18:42:12 -0000 1.1 --- GUICommonWindows.py 24 Sep 2004 15:15:35 -0000 1.2 *************** *** 22,25 **** --- 22,27 ---- # GUICommonWindows.py - functions to open common windows in lower part of the screen + ################################################### + import GemRB from GUIDefines import * *************** *** 43,46 **** --- 45,49 ---- def SetupMenuWindowControls (Window): + # FIXME: add "(key)" to tooltips! # Return to Game *************** *** 98,105 **** GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenOptionsWindow") ! # Rest Button = GemRB.GetControl (Window, 8) ! GemRB.SetTooltip (Window, Button, 11942) ! GemRB.SetEvent(Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenStoreWindow") # AI --- 101,113 ---- GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenOptionsWindow") ! # Party mgmt Button = GemRB.GetControl (Window, 8) ! GemRB.SetTooltip (Window, Button, 16312) ! GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "") ! ! ## # Rest ! ## Button = GemRB.GetControl (Window, 8) ! ## GemRB.SetTooltip (Window, Button, 11942) ! ## GemRB.SetEvent(Window, Button, IE_GUI_BUTTON_ON_PRESS, "OpenStoreWindow") # AI *************** *** 111,119 **** def AIPress (): print "AIPress" ! return def RestPress (): print "RestPress" ! return def SetupActionsWindowControls (Window): --- 119,127 ---- def AIPress (): print "AIPress" ! def RestPress (): print "RestPress" ! def SetupActionsWindowControls (Window): *************** *** 131,135 **** Button = GemRB.GetControl (Window, 4) GemRB.SetTooltip (Window, Button, 44945) ! return def GetActorClassTitle (actor): --- 139,143 ---- Button = GemRB.GetControl (Window, 4) GemRB.SetTooltip (Window, Button, 44945) ! def GetActorClassTitle (actor): *************** *** 186,203 **** PortraitWindow = Window ! for i in range (0,6): Button = GemRB.GetControl (Window, i) - GemRB.SetVarAssoc (Window, Button, "SelectedSingle", i) GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_PRESS, "PortraitButtonOnPress") ! pic = GemRB.GetPlayerPortrait (i+1,1) GemRB.SetButtonPicture(Window, Button, pic) ! GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_PICTURE, OP_SET) - 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) - return def PortraitButtonOnPress (): --- 194,235 ---- PortraitWindow = Window ! for i in range (6): 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, "PortraitButtonOnDragDrop") + GemRB.SetEvent (Window, Button, IE_GUI_BUTTON_ON_DRAG_DROP, "OnDropItemToPC") + #GemRB.SetEvent (Window, Button, IE_GUI_MOUSE_ENTER_BUTTON, "PortraitButtonOnMouseOver") + #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) ! pic = GemRB.GetPlayerPortrait (i+1, 1) ! if not pic: ! GemRB.SetButtonFlags (Window, Button, IE_GUI_BUTTON_NO_IMAGE, OP_SET) ! continue ! ! #sel = GemRB.GameIsPCSelected (i+1) ! sel = GemRB.GameGetSelectedPCSingle () == i + 1 ! #GemRB.SetButtonBAM (Window, Button, pic, 0, 0, 0) GemRB.SetButtonPicture(Window, Button, pic) ! ! GemRB.SetButtonFlags(Window, Button, IE_GUI_BUTTON_PICTURE | IE_GUI_BUTTON_ALIGN_TOP | IE_GUI_BUTTON_ALIGN_LEFT, OP_SET) ! GemRB.SetButtonFont (Window, Button, 'NUMFONT') ! ! GemRB.SetVarAssoc (Window, Button, 'PressedPortrait', i) ! ! hp = GemRB.GetPlayerStat (i+1, IE_HITPOINTS) ! hp_max = GemRB.GetPlayerStat (i+1, IE_MAXHITPOINTS) ! ! GemRB.SetText (Window, Button, "%d/%d" %(hp, hp_max)) ! GemRB.SetTooltip (Window, Button, GemRB.GetPlayerName (i+1, 1) + "\n%d/%d" %(hp, hp_max)) ! if sel: ! #GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_SELECTED) ! GemRB.EnableButtonBorder(Window, Button, FRAME_PC_SELECTED, 1) ! else: ! #GemRB.SetButtonState(Window, Button, IE_GUI_BUTTON_UNPRESSED) ! GemRB.EnableButtonBorder(Window, Button, FRAME_PC_SELECTED, 0) def PortraitButtonOnPress (): *************** *** 210,214 **** SelectionChanged () RunSelectionChangeHandler () ! return def PortraitButtonOnShiftPress (): --- 242,246 ---- SelectionChanged () RunSelectionChangeHandler () ! def PortraitButtonOnShiftPress (): *************** *** 223,231 **** SelectionChanged () RunSelectionChangeHandler () ! return def SelectAllOnPress (): GemRB.GameSelectPC (0, 1) ! return # Run by Game class when selection was changed --- 255,263 ---- SelectionChanged () RunSelectionChangeHandler () ! def SelectAllOnPress (): GemRB.GameSelectPC (0, 1) ! # Run by Game class when selection was changed *************** *** 233,248 **** # FIXME: hack. If defined, display single selection if (not SelectionChangeHandler): ! for i in range (0, 6): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, GemRB.GameIsPCSelected (i + 1)) else: sel = GemRB.GameGetSelectedPCSingle () ! for i in range (0, 6): ! Button = GemRB.GetControl (PortraitWindow, i) ! ! for i in range (0, 6): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, i + 1 == sel) def GetSavingThrow (SaveName, row, level): SaveTable = GemRB.LoadTable (SaveName) --- 265,295 ---- # FIXME: hack. If defined, display single selection if (not SelectionChangeHandler): ! for i in range (6): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, GemRB.GameIsPCSelected (i + 1)) else: sel = GemRB.GameGetSelectedPCSingle () ! for i in range (6): Button = GemRB.GetControl (PortraitWindow, i) GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_SELECTED, i + 1 == sel) + + def PortraitButtonOnDragDrop (): + i = GemRB.GetVar ('PressedPortrait') + print "DragDrop" + + def PortraitButtonOnMouseOver (): + 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') + if GemRB.IsDraggingItem (): + Button = GemRB.GetControl (PortraitWindow, i) + GemRB.EnableButtonBorder (PortraitWindow, Button, FRAME_PC_TARGET, 0) + + def GetSavingThrow (SaveName, row, level): SaveTable = GemRB.LoadTable (SaveName) |