From: Laszlo T. <ave...@us...> - 2011-06-09 21:31:47
|
gemrb: Infinity Engine emulator The branch master has been updated via 31a2d880ad9fcbc6a918afc93d82e8e1eb185e39 (commit) Summary of changes: gemrb/GUIScripts/bg2/GUICommonWindows.py | 31 ++++++++++++++++++++++++++++- 1 files changed, 29 insertions(+), 2 deletions(-) from bc195e0ddcf7ad277115fd8ea6fea06e6e42a7ae (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=31a2d880ad9fcbc6a918afc93d82e8e1eb185e39 commit 31a2d880ad9fcbc6a918afc93d82e8e1eb185e39 Author: Avenger <ave...@so...> Date: Thu Jun 9 23:31:16 2011 +0200 implemented quick spell selection in bg2 diff --git a/gemrb/GUIScripts/bg2/GUICommonWindows.py b/gemrb/GUIScripts/bg2/GUICommonWindows.py index 5247cc6..bc5a834 100644 --- a/gemrb/GUIScripts/bg2/GUICommonWindows.py +++ b/gemrb/GUIScripts/bg2/GUICommonWindows.py @@ -389,6 +389,22 @@ def ActionQSpell2Pressed (): def ActionQSpell3Pressed (): ActionQSpellPressed(2) +def ActionQSpellRightPressed (which): + GemRB.SetVar ("QSpell", which) + GemRB.SetVar ("TopIndex", 0) + GemRB.SetVar ("ActionLevel", 2) + UpdateActionsWindow () + return + +def ActionQSpell1RightPressed (): + ActionQSpellRightPressed(0) + +def ActionQSpell2RightPressed (): + ActionQSpellRightPressed(1) + +def ActionQSpell3RightPressed (): + ActionQSpellRightPressed(2) + #no check needed because the button wouldn't be drawn if illegal def ActionLeftPressed (): """Scrolls the actions window left. @@ -416,9 +432,9 @@ def ActionRightPressed (): #Type is a bitfield if there is no level given #This is to make sure cleric/mages get all spells listed if Type&128: - Max = GemRB.GetKnownSpellsCount(pc, Type&127, -1, 1) + Max = GemRB.GetKnownSpellsCount(pc, Type&127, -1, 1, 1) else: - Max = GemRB.GetMemorizedSpellsCount(pc, Type, -1, 1) + Max = GemRB.GetMemorizedSpellsCount(pc, Type, -1, 1, 1) TopIndex += 10 if TopIndex > Max - 10: if Max>10: @@ -468,6 +484,7 @@ def ActionUseItemPressed (): def ActionCastPressed (): """Opens the spell choice scrollbar.""" + GemRB.SetVar ("QSpell", -1) GemRB.SetVar ("TopIndex", 0) GemRB.SetVar ("ActionLevel", 2) UpdateActionsWindow () @@ -550,6 +567,16 @@ def SpellPressed (): GemRB.GameControlSetTargetMode (TARGET_MODE_CAST) Spell = GemRB.GetVar ("Spell") Type = GemRB.GetVar ("Type") + slot = GemRB.GetVar ("QSpell") + if slot>=0: + #setup quickspell slot + #if spell has no target, return + #otherwise continue with casting + Target = GemRB.SetupQuickSpell (pc, slot, Spell, Type, 1) + if Target == 5: + Type = -1 + GemRB.GameControlSetTargetMode (TARGET_MODE_NONE) + if Type==-1: GemRB.SetVar ("ActionLevel", 0) GemRB.SetVar("Type", 0) ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |