diff options
author | Darkvater <darkvater@openttd.org> | 2006-03-03 11:27:18 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-03-03 11:27:18 +0000 |
commit | 5b0e6f90a9a18ed549ebb70a1e1af35ef76361ef (patch) | |
tree | 76231f984c373d5df044a682822c784f1464a555 /settings_gui.c | |
parent | 72e28805b8c9210cd2551e3fe9edf535b88bd1ff (diff) | |
download | openttd-5b0e6f90a9a18ed549ebb70a1e1af35ef76361ef.tar.xz |
(svn r3746) - [7/7] Moving the callback functions for the setting-changes from settings_gui.c to settings.c. Also enable the callback functionality through the console.
- Fix a nasty bug with improper counter addition. (*i)++ and NOT *i++ when setting a patch value through the console.
Diffstat (limited to 'settings_gui.c')
-rw-r--r-- | settings_gui.c | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/settings_gui.c b/settings_gui.c index 49d22600e..7d28dfc4e 100644 --- a/settings_gui.c +++ b/settings_gui.c @@ -555,98 +555,6 @@ void ShowGameDifficulty(void) AllocateWindowDesc(&_game_difficulty_desc); } -// virtual PositionMainToolbar function, calls the right one. -static int32 v_PositionMainToolbar(int32 p1) -{ - if (_game_mode != GM_MENU) PositionMainToolbar(NULL); - return 0; -} - -static int32 AiNew_PatchActive_Warning(int32 p1) -{ - if (p1 == 1) ShowErrorMessage(INVALID_STRING_ID, TEMP_AI_ACTIVATED, 0, 0); - return 0; -} - -static int32 Ai_In_Multiplayer_Warning(int32 p1) -{ - if (p1 == 1) { - ShowErrorMessage(INVALID_STRING_ID, TEMP_AI_MULTIPLAYER, 0, 0); - _patches.ainew_active = true; - } - return 0; -} - -static int32 PopulationInLabelActive(int32 p1) -{ - Town* t; - - FOR_ALL_TOWNS(t) { - if (t->xy != 0) UpdateTownVirtCoord(t); - } - return 0; -} - -static int32 InvisibleTreesActive(int32 p1) -{ - MarkWholeScreenDirty(); - return 0; -} - -static int32 InValidateDetailsWindow(int32 p1) -{ - InvalidateWindowClasses(WC_VEHICLE_DETAILS); - return 0; -} - -static int32 InvalidateStationBuildWindow(int32 p1) -{ - InvalidateWindow(WC_BUILD_STATION, 0); - return 0; -} - -/* Check service intervals of vehicles, p1 is value of % or day based servicing */ -static int32 CheckInterval(int32 p1) -{ - bool warning; - if (p1) { - warning = ( (IS_INT_INSIDE(_patches.servint_trains, 5, 90+1) || _patches.servint_trains == 0) && - (IS_INT_INSIDE(_patches.servint_roadveh, 5, 90+1) || _patches.servint_roadveh == 0) && - (IS_INT_INSIDE(_patches.servint_aircraft, 5, 90+1) || _patches.servint_aircraft == 0) && - (IS_INT_INSIDE(_patches.servint_ships, 5, 90+1) || _patches.servint_ships == 0) ); - } else { - warning = ( (IS_INT_INSIDE(_patches.servint_trains, 30, 800+1) || _patches.servint_trains == 0) && - (IS_INT_INSIDE(_patches.servint_roadveh, 30, 800+1) || _patches.servint_roadveh == 0) && - (IS_INT_INSIDE(_patches.servint_aircraft, 30, 800+1) || _patches.servint_aircraft == 0) && - (IS_INT_INSIDE(_patches.servint_ships, 30, 800+1) || _patches.servint_ships == 0) ); - } - - if (!warning) - ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE, 0, 0); - - return InValidateDetailsWindow(0); -} - -static int32 EngineRenewUpdate(int32 p1) -{ - DoCommandP(0, 0, _patches.autorenew, NULL, CMD_REPLACE_VEHICLE); - return 0; -} - -static int32 EngineRenewMonthsUpdate(int32 p1) -{ - DoCommandP(0, 1, _patches.autorenew_months, NULL, CMD_REPLACE_VEHICLE); - return 0; -} - -static int32 EngineRenewMoneyUpdate(int32 p1) -{ - DoCommandP(0, 2, _patches.autorenew_money, NULL, CMD_REPLACE_VEHICLE); - return 0; -} - -typedef int32 PatchButtonClick(int32); - typedef uint PatchEntry; static const PatchEntry _patches_ui[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; |