From 672e9e42ecd56567bf72be79dfe0714dd3f92e20 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Sun, 13 Jun 2010 13:42:03 -0400 Subject: [PATCH] GUIScript: Use None instead if "", for null event handler. Signed-off-by: Tom Prince --- gemrb/GUIScripts/bg1/GUIINV.py | 12 ++++++------ gemrb/GUIScripts/bg1/GUIMG.py | 8 ++++---- gemrb/GUIScripts/bg1/GUIPR.py | 8 ++++---- gemrb/GUIScripts/bg1/GUISTORE.py | 2 +- gemrb/GUIScripts/bg1/Start.py | 2 +- gemrb/GUIScripts/bg2/GUIINV.py | 14 +++++++------- gemrb/GUIScripts/bg2/GUIMG.py | 10 +++++----- gemrb/GUIScripts/bg2/GUIPR.py | 8 ++++---- gemrb/GUIScripts/bg2/GUISTORE.py | 2 +- gemrb/GUIScripts/bg2/Start2.py | 2 +- gemrb/GUIScripts/iwd/GUICommonWindows.py | 2 +- gemrb/GUIScripts/iwd/GUIINV.py | 14 +++++++------- gemrb/GUIScripts/iwd/GUIMG.py | 10 +++++----- gemrb/GUIScripts/iwd/GUIPR.py | 8 ++++---- gemrb/GUIScripts/iwd/GUISTORE.py | 2 +- gemrb/GUIScripts/iwd2/GUIINV.py | 12 ++++++------ gemrb/GUIScripts/iwd2/GUISPL.py | 8 ++++---- gemrb/GUIScripts/iwd2/GUISTORE.py | 2 +- gemrb/GUIScripts/pst/GUICommonWindows.py | 8 ++++---- gemrb/GUIScripts/pst/GUIINV.py | 14 +++++++------- gemrb/GUIScripts/pst/GUIMG.py | 8 ++++---- gemrb/GUIScripts/pst/GUIOPT.py | 2 +- gemrb/GUIScripts/pst/GUIPR.py | 8 ++++---- 23 files changed, 83 insertions(+), 83 deletions(-) diff --git a/gemrb/GUIScripts/bg1/GUIINV.py b/gemrb/GUIScripts/bg1/GUIINV.py index 6d803e10e..fbbf6829f 100644 --- a/gemrb/GUIScripts/bg1/GUIINV.py +++ b/gemrb/GUIScripts/bg1/GUIINV.py @@ -386,9 +386,9 @@ def RefreshInventoryWindow (): Button.EnableBorder (0, 0) Button.EnableBorder (1, 0) Button.EnableBorder (2, 0) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) #making window visible/shaded depending on the pc's state Window.SetVisible (WINDOW_VISIBLE) @@ -467,9 +467,9 @@ def UpdateSlot (pc, slot): Button.EnableBorder (1, 0) Button.EnableBorder (2, 0) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) if OverSlot == slot+1: if GemRB.CanUseItemType (SlotType["Type"], itemname): diff --git a/gemrb/GUIScripts/bg1/GUIMG.py b/gemrb/GUIScripts/bg1/GUIMG.py index da9b6a4cf..5fc121d2b 100644 --- a/gemrb/GUIScripts/bg1/GUIMG.py +++ b/gemrb/GUIScripts/bg1/GUIMG.py @@ -153,8 +153,8 @@ def UpdateMageWindow (): Button.SetFlags (IE_GUI_BUTTON_NORMAL, OP_SET) else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) @@ -174,8 +174,8 @@ def UpdateMageWindow (): else: Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) diff --git a/gemrb/GUIScripts/bg1/GUIPR.py b/gemrb/GUIScripts/bg1/GUIPR.py index e0b3ddb87..052934c26 100644 --- a/gemrb/GUIScripts/bg1/GUIPR.py +++ b/gemrb/GUIScripts/bg1/GUIPR.py @@ -150,8 +150,8 @@ def UpdatePriestWindow (): Button.SetFlags (IE_GUI_BUTTON_NORMAL, OP_SET) else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) @@ -173,8 +173,8 @@ def UpdatePriestWindow (): else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) diff --git a/gemrb/GUIScripts/bg1/GUISTORE.py b/gemrb/GUIScripts/bg1/GUISTORE.py index 81efa483f..de9310bdb 100644 --- a/gemrb/GUIScripts/bg1/GUISTORE.py +++ b/gemrb/GUIScripts/bg1/GUISTORE.py @@ -172,7 +172,7 @@ def OpenStoreWindow (): else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) Button.SetTooltip ("") - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) Button.SetState (IE_GUI_BUTTON_DISABLED) ActionWindow.SetVisible (WINDOW_VISIBLE) diff --git a/gemrb/GUIScripts/bg1/Start.py b/gemrb/GUIScripts/bg1/Start.py index bf97006fa..a3248eacc 100644 --- a/gemrb/GUIScripts/bg1/Start.py +++ b/gemrb/GUIScripts/bg1/Start.py @@ -90,7 +90,7 @@ def MultiPlayerPress(): MultiPlayerButton.SetEventByName(0, "ConnectPress") MoviesButton.SetEventByName(0, "BackToMain") MoviesButton.SetFlags(IE_GUI_BUTTON_CANCEL, OP_OR) - ExitButton.SetEventByName(0, "") + ExitButton.SetEvent(0, None) ExitButton.SetStatus(IE_GUI_BUTTON_DISABLED) ExitButton.SetFlags(IE_GUI_BUTTON_NO_IMAGE, OP_SET) return diff --git a/gemrb/GUIScripts/bg2/GUIINV.py b/gemrb/GUIScripts/bg2/GUIINV.py index 504755bf0..c94afaff6 100644 --- a/gemrb/GUIScripts/bg2/GUIINV.py +++ b/gemrb/GUIScripts/bg2/GUIINV.py @@ -369,9 +369,9 @@ def RefreshInventoryWindow (): Slot = GemRB.GetContainerItem (pc, i+TopIndex) if Slot == None: - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) else: Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "OnDragItemGround") Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenGroundItemInfoWindow") @@ -427,10 +427,10 @@ def UpdateSlot (pc, slot): Button.SetBAM (SlotType["ResRef"],0,0) Button.SetTooltip (SlotType["Tip"]) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_DOUBLE_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_DOUBLE_PRESS, None) if OverSlot == slot+1: if GemRB.CanUseItemType (SlotType["Type"], itemname): diff --git a/gemrb/GUIScripts/bg2/GUIMG.py b/gemrb/GUIScripts/bg2/GUIMG.py index beee1c75a..e07ac90f6 100644 --- a/gemrb/GUIScripts/bg2/GUIMG.py +++ b/gemrb/GUIScripts/bg2/GUIMG.py @@ -192,8 +192,8 @@ def UpdateMageWindow (): Button.SetFlags (IE_GUI_BUTTON_NORMAL, OP_SET) else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) else: @@ -215,8 +215,8 @@ def UpdateMageWindow (): else: Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) @@ -270,7 +270,7 @@ def OpenMageSpellInfoWindow (): if HasTOB(): Button = Window.GetControl (6) if index < 100: - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) else: Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "OpenMageSpellRemoveWindow") diff --git a/gemrb/GUIScripts/bg2/GUIPR.py b/gemrb/GUIScripts/bg2/GUIPR.py index 4c43b804f..e039d7417 100644 --- a/gemrb/GUIScripts/bg2/GUIPR.py +++ b/gemrb/GUIScripts/bg2/GUIPR.py @@ -158,8 +158,8 @@ def UpdatePriestWindow (): Button.SetFlags (IE_GUI_BUTTON_NORMAL, OP_SET) else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) @@ -180,8 +180,8 @@ def UpdatePriestWindow (): else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) diff --git a/gemrb/GUIScripts/bg2/GUISTORE.py b/gemrb/GUIScripts/bg2/GUISTORE.py index 9d5482e1c..7dc7aba90 100644 --- a/gemrb/GUIScripts/bg2/GUISTORE.py +++ b/gemrb/GUIScripts/bg2/GUISTORE.py @@ -174,7 +174,7 @@ def OpenStoreWindow (): else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) Button.SetTooltip ("") - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) Button.SetState (IE_GUI_BUTTON_DISABLED) ActionWindow.SetVisible (WINDOW_VISIBLE) diff --git a/gemrb/GUIScripts/bg2/Start2.py b/gemrb/GUIScripts/bg2/Start2.py index 8eaecd0b9..c8b2c7bbf 100644 --- a/gemrb/GUIScripts/bg2/Start2.py +++ b/gemrb/GUIScripts/bg2/Start2.py @@ -137,7 +137,7 @@ def MultiPlayerPress(): ExitButton.SetText (15416) MultiPlayerButton.SetText ("") MoviesButton.SetText (11825) - MultiPlayerButton.SetEventByName (0, "") + MultiPlayerButton.SetEvent (0, None) SinglePlayerButton.SetEventByName (0, "ConnectPress") MoviesButton.SetEventByName (0, "PregenPress") ExitButton.SetEventByName (0, "BackToMain") diff --git a/gemrb/GUIScripts/iwd/GUICommonWindows.py b/gemrb/GUIScripts/iwd/GUICommonWindows.py index b75e5be7f..dbddb2534 100644 --- a/gemrb/GUIScripts/iwd/GUICommonWindows.py +++ b/gemrb/GUIScripts/iwd/GUICommonWindows.py @@ -100,7 +100,7 @@ def SetupMenuWindowControls (Window, Gears, ReturnToGame): # Party mgmt Button = Window.GetControl (8) Button.SetTooltip (16312) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) if Gears: # Gears (time), how doesn't have this in the right place diff --git a/gemrb/GUIScripts/iwd/GUIINV.py b/gemrb/GUIScripts/iwd/GUIINV.py index 36c6035e0..994a9a8f4 100644 --- a/gemrb/GUIScripts/iwd/GUIINV.py +++ b/gemrb/GUIScripts/iwd/GUIINV.py @@ -347,9 +347,9 @@ def RefreshInventoryWindow (): Slot = GemRB.GetContainerItem (pc, i+TopIndex) if Slot == None: - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) else: Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "OnDragItemGround") Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "OpenGroundItemInfoWindow") @@ -405,10 +405,10 @@ def UpdateSlot (pc, slot): Button.SetBAM (SlotType["ResRef"],0,0) Button.SetTooltip (SlotType["Tip"]) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_DOUBLE_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_DOUBLE_PRESS, None) if OverSlot == slot+1: if GemRB.CanUseItemType (SlotType["Type"], itemname): diff --git a/gemrb/GUIScripts/iwd/GUIMG.py b/gemrb/GUIScripts/iwd/GUIMG.py index 5f7caed83..3c478dc8d 100644 --- a/gemrb/GUIScripts/iwd/GUIMG.py +++ b/gemrb/GUIScripts/iwd/GUIMG.py @@ -163,8 +163,8 @@ def UpdateMageWindow (): Button.SetFlags (IE_GUI_BUTTON_NORMAL, OP_SET) else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) @@ -184,8 +184,8 @@ def UpdateMageWindow (): else: Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) @@ -250,7 +250,7 @@ def OpenMageSpellInfoWindow (): index = GemRB.GetVar ("SpellButton") if index < 100: ResRef = MageMemorizedSpellList[index] - #Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") + #Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) #Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) else: ResRef = MageKnownSpellList[index - 100] diff --git a/gemrb/GUIScripts/iwd/GUIPR.py b/gemrb/GUIScripts/iwd/GUIPR.py index 2096053e0..d06619e41 100644 --- a/gemrb/GUIScripts/iwd/GUIPR.py +++ b/gemrb/GUIScripts/iwd/GUIPR.py @@ -147,8 +147,8 @@ def UpdatePriestWindow (): Button.SetFlags (IE_GUI_BUTTON_NORMAL, OP_SET) else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_SET) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) @@ -170,8 +170,8 @@ def UpdatePriestWindow (): else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) if (ClassSkillsTable.GetValue (GemRB.GetPlayerStat( GemRB.GameGetSelectedPCSingle(), IE_CLASS), 1)=="*"): diff --git a/gemrb/GUIScripts/iwd/GUISTORE.py b/gemrb/GUIScripts/iwd/GUISTORE.py index 18630ed2a..9afdd9c8d 100644 --- a/gemrb/GUIScripts/iwd/GUISTORE.py +++ b/gemrb/GUIScripts/iwd/GUISTORE.py @@ -174,7 +174,7 @@ def OpenStoreWindow (): else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) Button.SetTooltip ("") - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) Button.SetState (IE_GUI_BUTTON_DISABLED) ActionWindow.SetVisible (WINDOW_VISIBLE) diff --git a/gemrb/GUIScripts/iwd2/GUIINV.py b/gemrb/GUIScripts/iwd2/GUIINV.py index afd7e9478..5d13feb49 100644 --- a/gemrb/GUIScripts/iwd2/GUIINV.py +++ b/gemrb/GUIScripts/iwd2/GUIINV.py @@ -357,9 +357,9 @@ def RefreshInventoryWindow (): Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "OpenItemAmountGroundWindow") else: Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) #if actor is uncontrollable, make this grayed Window.SetVisible (WINDOW_VISIBLE) @@ -404,9 +404,9 @@ def UpdateSlot (pc, slot): Button.SetText ("") Button.SetTooltip (SlotType["Tip"]) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) return def OnDragItemGround (): diff --git a/gemrb/GUIScripts/iwd2/GUISPL.py b/gemrb/GUIScripts/iwd2/GUISPL.py index d73121e0b..05f1a4568 100644 --- a/gemrb/GUIScripts/iwd2/GUISPL.py +++ b/gemrb/GUIScripts/iwd2/GUISPL.py @@ -163,8 +163,8 @@ def UpdateSpellBookWindow (): else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) @@ -186,8 +186,8 @@ def UpdateSpellBookWindow (): else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Button.SetTooltip ('') Button.EnableBorder (0, 0) diff --git a/gemrb/GUIScripts/iwd2/GUISTORE.py b/gemrb/GUIScripts/iwd2/GUISTORE.py index 6d59fd040..520083654 100644 --- a/gemrb/GUIScripts/iwd2/GUISTORE.py +++ b/gemrb/GUIScripts/iwd2/GUISTORE.py @@ -174,7 +174,7 @@ def OpenStoreWindow (): else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) Button.SetTooltip ("") - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) Button.SetState (IE_GUI_BUTTON_DISABLED) ActionWindow.SetVisible (WINDOW_VISIBLE) diff --git a/gemrb/GUIScripts/pst/GUICommonWindows.py b/gemrb/GUIScripts/pst/GUICommonWindows.py index 77a12e536..243e9b875 100644 --- a/gemrb/GUIScripts/pst/GUICommonWindows.py +++ b/gemrb/GUIScripts/pst/GUICommonWindows.py @@ -516,10 +516,10 @@ def SetItemButton (Window, Button, Slot, PressHandler, RightPressHandler): Button.SetText ('') Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - #Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") - #Button.SetEventByName (IE_GUI_BUTTON_ON_DRAG_DROP, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + #Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) + #Button.SetEvent (IE_GUI_BUTTON_ON_DRAG_DROP, None) def OpenWaitForDiscWindow (): global DiscWindow diff --git a/gemrb/GUIScripts/pst/GUIINV.py b/gemrb/GUIScripts/pst/GUIINV.py index 2f29846cf..021a56f3c 100644 --- a/gemrb/GUIScripts/pst/GUIINV.py +++ b/gemrb/GUIScripts/pst/GUIINV.py @@ -246,9 +246,9 @@ def RefreshInventoryWindow (): Button.SetFlags (IE_GUI_BUTTON_PICTURE, OP_NAND) Button.SetTooltip (4273) Button.EnableBorder (0, 0) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) return def UpdateSlot (pc, i): @@ -319,15 +319,15 @@ def UpdateSlot (pc, i): Button.SetTooltip (SlotType["Tip"]) else: Button.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) - Button.SetEventByName (IE_GUI_BUTTON_ON_DRAG_DROP, '') + Button.SetEvent (IE_GUI_BUTTON_ON_DRAG_DROP, None) Button.SetTooltip ('') itemname = "" Button.EnableBorder (0, 0) Button.EnableBorder (1, 0) - Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") - Button.SetEventByName (IE_GUI_BUTTON_ON_SHIFT_PRESS, "") + Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) + Button.SetEvent (IE_GUI_BUTTON_ON_SHIFT_PRESS, None) if OverSlot == slot-1: if GemRB.CanUseItemType (SlotType["Type"], itemname): diff --git a/gemrb/GUIScripts/pst/GUIMG.py b/gemrb/GUIScripts/pst/GUIMG.py index 00ae6051e..2f73e0e94 100644 --- a/gemrb/GUIScripts/pst/GUIMG.py +++ b/gemrb/GUIScripts/pst/GUIMG.py @@ -110,8 +110,8 @@ def UpdateMageWindow (): Icon.SetSprites ("IVSLOT", 0, 0, 0, 0, 0) else: Icon.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) - Icon.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Icon.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Icon.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Icon.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Icon.SetTooltip ('') Icon.EnableBorder (0, 0) @@ -133,8 +133,8 @@ def UpdateMageWindow (): Icon.SetVarAssoc ("SpellButton", 100 + i) else: Icon.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) - Icon.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Icon.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Icon.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Icon.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Icon.SetTooltip ('') if (ClassSkillsTable.GetValue (GemRB.GetPlayerStat( GemRB.GameGetSelectedPCSingle(), IE_CLASS), 2)=="*"): Window.SetVisible (WINDOW_GRAYED) diff --git a/gemrb/GUIScripts/pst/GUIOPT.py b/gemrb/GUIScripts/pst/GUIOPT.py index 924dfd457..ae8741087 100644 --- a/gemrb/GUIScripts/pst/GUIOPT.py +++ b/gemrb/GUIScripts/pst/GUIOPT.py @@ -682,7 +682,7 @@ def OpenKeyboardMappingsWindow (): # Default Button = Window.GetControl (3) Button.SetText (49051) - #Button.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") + #Button.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) # Done Button = Window.GetControl (4) diff --git a/gemrb/GUIScripts/pst/GUIPR.py b/gemrb/GUIScripts/pst/GUIPR.py index efbbeb9bd..5b3193c5e 100644 --- a/gemrb/GUIScripts/pst/GUIPR.py +++ b/gemrb/GUIScripts/pst/GUIPR.py @@ -114,8 +114,8 @@ def UpdatePriestWindow (): Icon.SetSprites ("IVSLOT", 0, 0, 0, 0, 0) else: Icon.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) - Icon.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Icon.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Icon.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Icon.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Icon.SetTooltip ('') Icon.EnableBorder (0, 0) @@ -136,8 +136,8 @@ def UpdatePriestWindow (): else: Icon.SetFlags (IE_GUI_BUTTON_NO_IMAGE, OP_OR) - Icon.SetEventByName (IE_GUI_BUTTON_ON_PRESS, "") - Icon.SetEventByName (IE_GUI_BUTTON_ON_RIGHT_PRESS, "") + Icon.SetEvent (IE_GUI_BUTTON_ON_PRESS, None) + Icon.SetEvent (IE_GUI_BUTTON_ON_RIGHT_PRESS, None) Icon.SetTooltip ('') if (ClassSkillsTable.GetValue (GemRB.GetPlayerStat( GemRB.GameGetSelectedPCSingle(), IE_CLASS), 1)=="*"): Window.SetVisible (WINDOW_GRAYED) -- 2.11.4.GIT