From: <ave...@us...> - 2009-07-19 06:18:58
|
Revision: 6744 http://gemrb.svn.sourceforge.net/gemrb/?rev=6744&view=rev Author: avenger_teambg Date: 2009-07-19 06:18:46 +0000 (Sun, 19 Jul 2009) Log Message: ----------- don't overwrite customised action buttons (iwd2 has them) Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/Actor.cpp gemrb/trunk/gemrb/plugins/Core/Actor.h gemrb/trunk/gemrb/plugins/Core/Game.cpp Modified: gemrb/trunk/gemrb/plugins/Core/Actor.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/Actor.cpp 2009-07-19 06:00:39 UTC (rev 6743) +++ gemrb/trunk/gemrb/plugins/Core/Actor.cpp 2009-07-19 06:18:46 UTC (rev 6744) @@ -633,7 +633,7 @@ void pcf_class (Actor *actor, ieDword /*oldValue*/, ieDword /*newValue*/) { - actor->InitButtons(actor->Modified[IE_CLASS]); + actor->InitButtons(actor->Modified[IE_CLASS], false); } void pcf_animid(Actor *actor, ieDword /*oldValue*/, ieDword newValue) @@ -4458,9 +4458,7 @@ //the first 3 buttons are untouched by this function void Actor::GetActionButtonRow(ActionButtonRow &ar) { - if (PCStats->QSlots[0]==0xff) { - InitButtons(GetStat(IE_CLASS)); - } + InitButtons(GetStat(IE_CLASS), false); for(int i=0;i<GUIBT_COUNT-3;i++) { ieByte tmp=PCStats->QSlots[i]; if (QslotTranslation) { @@ -4822,11 +4820,15 @@ return ReverseToHit; } -void Actor::InitButtons(ieDword cls) +void Actor::InitButtons(ieDword cls, bool forced) { if (!PCStats) { return; } + if ( (PCStats->QSlots[0]!=0xff) && !forced) { + return; + } + ActionButtonRow myrow; if ((int) cls >= classcount) { memcpy(&myrow, &DefaultButtons, sizeof(ActionButtonRow)); Modified: gemrb/trunk/gemrb/plugins/Core/Actor.h =================================================================== --- gemrb/trunk/gemrb/plugins/Core/Actor.h 2009-07-19 06:00:39 UTC (rev 6743) +++ gemrb/trunk/gemrb/plugins/Core/Actor.h 2009-07-19 06:18:46 UTC (rev 6744) @@ -538,7 +538,9 @@ void ChargeItem(ieDword slot, ieDword header, CREItem *item, Item *itm, bool silent); /* If it returns true, then default AC=10 and the lesser the better */ int IsReverseToHit(); - void InitButtons(ieDword cls); + /* initialize the action buttons based on class. If forced, it will override + previously customized or set buttons. */ + void InitButtons(ieDword cls, bool forced); void SetFeat(unsigned int feat, int mode); int GetFeat(unsigned int feat) const; void SetUsedWeapon(const char *AnimationType, ieWord *MeleeAnimation, Modified: gemrb/trunk/gemrb/plugins/Core/Game.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/Game.cpp 2009-07-19 06:00:39 UTC (rev 6743) +++ gemrb/trunk/gemrb/plugins/Core/Game.cpp 2009-07-19 06:18:46 UTC (rev 6744) @@ -316,7 +316,7 @@ { bool startorient = 0; actor->CreateStats(); //create stats if they didn't exist yet - actor->InitButtons(actor->GetStat(IE_CLASS)); //init actor's buttons + actor->InitButtons(actor->GetStat(IE_CLASS), false); //init actor's buttons actor->SetBase(IE_EXPLORE, 1); if (join&JP_INITPOS) { AutoTable strta("startpos"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |