TheSuperHackers / SuperThyme

An open source re-implementation of Generals : Zero Hour written in C++.
GNU General Public License v2.0
0 stars 0 forks source link

Attack Move button is always enabled for multi select, but not Guard Mode buttons #12

Open xezon opened 11 months ago

xezon commented 11 months ago

See code in ControlBar::Add_Common_Commands. Check if appropriate to add Guard Mode.

...
const CommandButton *button = set->Get_Command_Button(i);
bool b = (button != nullptr && button->Get_Command() == GUI_COMMAND_ATTACK_MOVE)
    || (m_commonCommands[i] != nullptr
        && m_commonCommands[i]->Get_Command() == GUI_COMMAND_ATTACK_MOVE);

if (!b || m_commonCommands[i] != nullptr) {
    if (button != m_commonCommands[i] && !b) {
        m_commonCommands[i] = nullptr;
        m_commandWindows[i]->Win_Hide(true);
    }
} else {
    m_commonCommands[i] = button;
    m_commandWindows[i]->Win_Hide(false);
    m_commandWindows[i]->Win_Enable(true);
    Set_Control_Command(m_commandWindows[i], button);
}
...