|
@@ -661,19 +661,19 @@ static bool RedrawScreen(int32 p1)
|
|
|
MarkWholeScreenDirty();
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
static bool InvalidateDetailsWindow(int32 p1)
|
|
|
{
|
|
|
InvalidateWindowClasses(WC_VEHICLE_DETAILS);
|
|
|
SetWindowClassesDirty(WC_VEHICLE_DETAILS);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
static bool InvalidateStationBuildWindow(int32 p1)
|
|
|
{
|
|
|
InvalidateWindow(WC_BUILD_STATION, 0);
|
|
|
SetWindowDirty(WC_BUILD_STATION, 0);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
static bool InvalidateBuildIndustryWindow(int32 p1)
|
|
|
{
|
|
|
InvalidateWindowData(WC_BUILD_INDUSTRY, 0);
|
|
@@ -749,13 +749,13 @@ static bool TrainAccelerationModelChange
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
static bool DragSignalsDensityChanged(int32)
|
|
|
{
|
|
|
InvalidateWindow(WC_BUILD_SIGNAL, 0);
|
|
|
SetWindowDirty(WC_BUILD_SIGNAL, 0);
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
* A: competitors
|
|
@@ -817,13 +817,13 @@ static bool DifficultyChange(int32)
|
|
|
{
|
|
|
if (_game_mode == GM_MENU) {
|
|
|
if (_settings_newgame.difficulty.diff_level != 3) {
|
|
|
ShowErrorMessage(INVALID_STRING_ID, STR_WARNING_DIFFICULTY_TO_CUSTOM, 0, 0);
|
|
|
_settings_newgame.difficulty.diff_level = 3;
|
|
|
}
|
|
|
InvalidateWindowClasses(WC_SELECT_GAME);
|
|
|
SetWindowClassesDirty(WC_SELECT_GAME);
|
|
|
} else {
|
|
|
_settings_game.difficulty.diff_level = 3;
|
|
|
}
|
|
|
|
|
|
/* If we are a network-client, update the difficult setting (if it is open).
|
|
|
* Use this instead of just dirtying the window because we need to load in
|
|
@@ -1443,13 +1443,13 @@ CommandCost CmdChangeSetting(TileIndex t
|
|
|
if (sd->desc.flags & SGF_NO_NETWORK) {
|
|
|
GamelogStartAction(GLAT_SETTING);
|
|
|
GamelogSetting(sd->desc.name, oldval, newval);
|
|
|
GamelogStopAction();
|
|
|
}
|
|
|
|
|
|
InvalidateWindow(WC_GAME_OPTIONS, 0);
|
|
|
SetWindowDirty(WC_GAME_OPTIONS, 0);
|
|
|
}
|
|
|
|
|
|
return CommandCost();
|
|
|
}
|
|
|
|
|
|
/** Change one of the per-company settings.
|
|
@@ -1477,13 +1477,13 @@ CommandCost CmdChangeCompanySetting(Tile
|
|
|
|
|
|
if (sd->desc.proc != NULL && !sd->desc.proc(newval)) {
|
|
|
WriteValue(var, sd->save.conv, (int64)oldval);
|
|
|
return CommandCost();
|
|
|
}
|
|
|
|
|
|
InvalidateWindow(WC_GAME_OPTIONS, 0);
|
|
|
SetWindowDirty(WC_GAME_OPTIONS, 0);
|
|
|
}
|
|
|
|
|
|
return CommandCost();
|
|
|
}
|
|
|
|
|
|
/** Top function to save the new value of an element of the Settings struct
|
|
@@ -1506,13 +1506,13 @@ bool SetSettingValue(uint index, int32 v
|
|
|
|
|
|
if (_game_mode != GM_MENU) {
|
|
|
void *var2 = GetVariableAddress(&_settings_newgame, &sd->save);
|
|
|
Write_ValidateSetting(var2, sd, value);
|
|
|
}
|
|
|
if (sd->desc.proc != NULL) sd->desc.proc((int32)ReadValue(var, sd->save.conv));
|
|
|
InvalidateWindow(WC_GAME_OPTIONS, 0);
|
|
|
SetWindowDirty(WC_GAME_OPTIONS, 0);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/* send non-company-based settings over the network */
|
|
|
if (!_networking || (_networking && _network_server)) {
|
|
|
return DoCommandP(0, index, value, CMD_CHANGE_SETTING);
|