(svn r22249) -Codechange: Process some more invalidation of IDs during command scope.

This commit is contained in:
frosch
2011-03-13 21:35:50 +00:00
parent 2a4c4ab528
commit 8c8349d5da
2 changed files with 4 additions and 2 deletions

View File

@@ -711,11 +711,12 @@ struct AIConfigWindow : public Window {
*/
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
{
if (!gui_scope) return;
if (!IsEditable(this->selected_slot)) {
this->selected_slot = INVALID_COMPANY;
}
if (!gui_scope) return;
this->SetWidgetDisabledState(AIC_WIDGET_DECREASE, GetGameSettings().difficulty.max_no_competitors == 0);
this->SetWidgetDisabledState(AIC_WIDGET_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES - 1);
this->SetWidgetDisabledState(AIC_WIDGET_CHANGE, this->selected_slot == INVALID_COMPANY);