mirror of https://github.com/OpenTTD/OpenTTD
(svn r22249) -Codechange: Process some more invalidation of IDs during command scope.
parent
141f2eba50
commit
cba6eb87c2
|
@ -711,11 +711,12 @@ struct AIConfigWindow : public Window {
|
||||||
*/
|
*/
|
||||||
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
||||||
{
|
{
|
||||||
if (!gui_scope) return;
|
|
||||||
if (!IsEditable(this->selected_slot)) {
|
if (!IsEditable(this->selected_slot)) {
|
||||||
this->selected_slot = INVALID_COMPANY;
|
this->selected_slot = INVALID_COMPANY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!gui_scope) return;
|
||||||
|
|
||||||
this->SetWidgetDisabledState(AIC_WIDGET_DECREASE, GetGameSettings().difficulty.max_no_competitors == 0);
|
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_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES - 1);
|
||||||
this->SetWidgetDisabledState(AIC_WIDGET_CHANGE, this->selected_slot == INVALID_COMPANY);
|
this->SetWidgetDisabledState(AIC_WIDGET_CHANGE, this->selected_slot == INVALID_COMPANY);
|
||||||
|
|
|
@ -666,16 +666,17 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
||||||
{
|
{
|
||||||
if (!gui_scope) return;
|
|
||||||
switch (data) {
|
switch (data) {
|
||||||
case 0:
|
case 0:
|
||||||
/* Rescan files */
|
/* Rescan files */
|
||||||
this->selected = NULL;
|
this->selected = NULL;
|
||||||
_load_check_data.Clear();
|
_load_check_data.Clear();
|
||||||
|
if (!gui_scope) break;
|
||||||
BuildFileList();
|
BuildFileList();
|
||||||
/* FALL THROUGH */
|
/* FALL THROUGH */
|
||||||
case 1:
|
case 1:
|
||||||
/* Selection changes */
|
/* Selection changes */
|
||||||
|
if (!gui_scope) break;
|
||||||
if (_saveload_mode == SLD_LOAD_GAME || _saveload_mode == SLD_LOAD_SCENARIO) {
|
if (_saveload_mode == SLD_LOAD_GAME || _saveload_mode == SLD_LOAD_SCENARIO) {
|
||||||
this->SetWidgetDisabledState(SLWW_LOAD_BUTTON,
|
this->SetWidgetDisabledState(SLWW_LOAD_BUTTON,
|
||||||
this->selected == NULL || _load_check_data.HasErrors() || !(_load_check_data.grf_compatibility != GLC_NOT_FOUND || _settings_client.gui.UserIsAllowedToChangeNewGRFs()));
|
this->selected == NULL || _load_check_data.HasErrors() || !(_load_check_data.grf_compatibility != GLC_NOT_FOUND || _settings_client.gui.UserIsAllowedToChangeNewGRFs()));
|
||||||
|
|
Loading…
Reference in New Issue