ref BI_CommandEndChecking()
...
case "BI_Speed":
SetUserIcons("BI_Speed"); //Add this
BI_retComValue = BI_COMMODE_USER_ICONS;
break;
...
case "BI_NewCommand":
SetUserIcons("BI_NewCommand"); //Add this
BI_retComValue = BI_COMMODE_USER_ICONS;
break;
...
BI_LaunchCommand() doesn't change...the charIdx is the characters[] array index of the command issued to, and targetNum is the index of the character to target/interact with.
...
void BI_LaunchCommand()
...
case "BI_NewCommand":
//charIdx receiving command, targetNum is selected target to interact
ExecuteNewCommand(charIdx, targetNum );
break;
...
//New function
void SetUserIcons(string commState)
{
if(BattleInterface.UserIconsState == commState) return;
BattleInterface.UserIconsState = commState;
//Try this, if it doesn't remove them all, try iterating
DeleteAttribute(&BattleInterface, "UserIcons"); //Remove existing
/* if above doesn't work, delete individually?
aref userIcons, userIcn;
makearef(userIcons, BattleInterface);
int numUIcons = GetAttributesNum(userIcons);
for(int i=0;i<numUIcons;i++) {
userIcn = GetAttributeN(userIcons, i);
DeleteAttribute(&BattleInterface, GetAttributeName(userIcn);
}
*/
switch(commState) {
case "BI_NewCommand":
int nNum = 1;
//Loop companions and add icons
for(int j = 0; j< COMPANION_MAX; j++) {
int cn = GetCompanionIndex(pchar, i);
if( cn>=0 ) {
string attName = "ui" + nNum;
Event(BI_EVENT_GET_DATA, "ll", BIDT_SHIPPICTURE, cn);
BattleInterface.UserIcons.(attName).enable = true;
BattleInterface.UserIcons.(attName).pic = BI_intNRetValue[0];
BattleInterface.UserIcons.(attName).selpic = BI_intNRetValue[1];
BattleInterface.UserIcons.(attName).tex = BI_intNRetValue[2];
BattleInterface.UserIcons.(attName).name = cn; //Not necessary...could probably be ""
nNum++;
}
}
break;
//Default to sails if not BI_NewCommand
BattleInterface.UserIcons.ui1.enable = true;
BattleInterface.UserIcons.ui1.pic = 25;
BattleInterface.UserIcons.ui1.selpic = 9;
BattleInterface.UserIcons.ui1.tex = 0;
BattleInterface.UserIcons.ui1.name = "sail_none";
BattleInterface.UserIcons.ui2.enable = true;
BattleInterface.UserIcons.ui2.pic = 24;
BattleInterface.UserIcons.ui2.selpic = 8;
BattleInterface.UserIcons.ui2.tex = 0;
BattleInterface.UserIcons.ui2.name = "sail_midi";
BattleInterface.UserIcons.ui3.enable = true;
BattleInterface.UserIcons.ui3.pic = 23;
BattleInterface.UserIcons.ui3.selpic = 7;
BattleInterface.UserIcons.ui3.tex = 0;
BattleInterface.UserIcons.ui3.name = "sail_fast";
break;
}
}
...
//Change to add .UserIconsState to first command setup...find in battleinterface.c
SetParameterData()
...
BattleInterface.UserIconsState = "BI_Speed"; //Add this for checking for change
BattleInterface.UserIcons.ui1.enable = true;
BattleInterface.UserIcons.ui1.pic = 25;
BattleInterface.UserIcons.ui1.selpic = 9;
BattleInterface.UserIcons.ui1.tex = 0;
BattleInterface.UserIcons.ui1.name = "sail_none";
BattleInterface.UserIcons.ui2.enable = true;
BattleInterface.UserIcons.ui2.pic = 24;
BattleInterface.UserIcons.ui2.selpic = 8;
BattleInterface.UserIcons.ui2.tex = 0;
BattleInterface.UserIcons.ui2.name = "sail_midi";
BattleInterface.UserIcons.ui3.enable = true;
BattleInterface.UserIcons.ui3.pic = 23;
BattleInterface.UserIcons.ui3.selpic = 7;
BattleInterface.UserIcons.ui3.tex = 0;
BattleInterface.UserIcons.ui3.name = "sail_fast";
....