From: <lyn...@us...> - 2009-05-18 15:09:07
|
Revision: 5998 http://gemrb.svn.sourceforge.net/gemrb/?rev=5998&view=rev Author: lynxlupodian Date: 2009-05-18 15:08:47 +0000 (Mon, 18 May 2009) Log Message: ----------- implemented fx_disable_button so eg. heavy armor prevents thieving Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/ie_stats.py gemrb/trunk/gemrb/plugins/FXOpcodes/FXOpc.cpp Modified: gemrb/trunk/gemrb/GUIScripts/ie_stats.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/ie_stats.py 2009-05-18 14:30:20 UTC (rev 5997) +++ gemrb/trunk/gemrb/GUIScripts/ie_stats.py 2009-05-18 15:08:47 UTC (rev 5998) @@ -290,6 +290,8 @@ IE_STONESKINSGOLEM = 199 IE_LEVELDRAIN = 200 IE_AVATARREMOVAL = 201 + +IE_DISABLEDBUTTON = 204 # GemRB Specific Defines IE_ANIMATION_ID = 205 IE_STATE_ID = 206 Modified: gemrb/trunk/gemrb/plugins/FXOpcodes/FXOpc.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/FXOpcodes/FXOpc.cpp 2009-05-18 14:30:20 UTC (rev 5997) +++ gemrb/trunk/gemrb/plugins/FXOpcodes/FXOpc.cpp 2009-05-18 15:08:47 UTC (rev 5998) @@ -3551,10 +3551,23 @@ } // 0x90 DisableButton -int fx_disable_button (Actor* /*Owner*/, Actor* /*target*/, Effect* fx) +// different in iwd2 and the rest (maybe also in how: 0-7?) +int fx_disable_button (Actor* /*Owner*/, Actor* target, Effect* fx) { if (0) printf( "fx_disable_button (%2d): Button: %d\n", fx->Opcode, fx->Parameter2 ); - // + + // iwd2 has a flexible action bar, so there are more possible parameter values + // only values 0-5 match the bg2 constants (which map to ACT_*) + // FIXME: support disabling all iwd2 buttons + if (target->spellbook.IsIWDSpellBook()) { + if (fx->Parameter2 < 6) STAT_BIT_OR( IE_DISABLEDBUTTON, 1<<fx->Parameter2 ); + } else { + STAT_BIT_OR( IE_DISABLEDBUTTON, 1<<fx->Parameter2 ); + } + + if (target->InParty && fx->FirstApply) { + core->SetEventFlag(EF_ACTION); + } return FX_APPLIED; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |