Changeset - r8319:ed53804bb33f
[Not reviewed]
master
0 1 0
peter1138 - 17 years ago 2008-01-16 23:46:46
peter1138@openttd.org
(svn r11884) -Cleanup: leftover use of widget numbers instead of enum
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/settings_gui.cpp
Show inline comments
 
@@ -145,50 +145,50 @@ enum GameOptionsWidgets {
 
	GAMEOPT_TOWNNAME_BTN,
 
	GAMEOPT_AUTOSAVE_TXT    = 16,
 
	GAMEOPT_AUTOSAVE_BTN,
 
	GAMEOPT_VEHICLENAME_TXT = 19,
 
	GAMEOPT_VEHICLENAME_BTN,
 
	GAMEOPT_VEHICLENAME_SAVE,
 
	GAMEOPT_LANG_TXT        = 23,
 
	GAMEOPT_LANG_BTN,
 
	GAMEOPT_RESOLUTION_TXT  = 26,
 
	GAMEOPT_RESOLUTION_BTN,
 
	GAMEOPT_FULLSCREEN,
 
	GAMEOPT_SCREENSHOT_TXT  = 30,
 
	GAMEOPT_SCREENSHOT_BTN,
 
};
 

	
 
static void ShowCustCurrency();
 

	
 
static void GameOptionsWndProc(Window *w, WindowEvent *e)
 
{
 
	switch (e->event) {
 
		case WE_PAINT: {
 
			int i;
 
			StringID str = STR_02BE_DEFAULT;
 

	
 
			w->SetWidgetDisabledState(21, !(_vehicle_design_names & 1));
 
			if (!w->IsWidgetDisabled(21)) str = STR_02BF_CUSTOM;
 
			w->SetWidgetDisabledState(GAMEOPT_VEHICLENAME_SAVE, !(_vehicle_design_names & 1));
 
			if (!w->IsWidgetDisabled(GAMEOPT_VEHICLENAME_SAVE)) str = STR_02BF_CUSTOM;
 
			SetDParam(0, str);
 
			SetDParam(1, _currency_specs[_opt_ptr->currency].name);
 
			SetDParam(2, STR_UNITS_IMPERIAL + _opt_ptr->units);
 
			SetDParam(3, STR_02E9_DRIVE_ON_LEFT + _opt_ptr->road_side);
 
			SetDParam(4, TownName(_opt_ptr->town_name));
 
			SetDParam(5, _autosave_dropdown[_opt_ptr->autosave]);
 
			SetDParam(6, SPECSTR_LANGUAGE_START + _dynlang.curr);
 
			i = GetCurRes();
 
			SetDParam(7, i == _num_resolutions ? STR_RES_OTHER : SPECSTR_RESOLUTION_START + i);
 
			SetDParam(8, SPECSTR_SCREENSHOT_START + _cur_screenshot_format);
 
			w->SetWidgetLoweredState(GAMEOPT_FULLSCREEN, _fullscreen);
 

	
 
			DrawWindowWidgets(w);
 
			DrawString(20, 175, STR_OPTIONS_FULLSCREEN, TC_FROMSTRING); // fullscreen
 
		} break;
 

	
 
		case WE_CLICK:
 
			switch (e->we.click.widget) {
 
				case GAMEOPT_CURRENCY_TXT: case GAMEOPT_CURRENCY_BTN: /* Setup currencies dropdown */
 
					ShowDropDownMenu(w, BuildCurrencyDropdown(), _opt_ptr->currency, GAMEOPT_CURRENCY_BTN, _game_mode == GM_MENU ? 0 : ~GetMaskOfAllowedCurrencies(), 0);
 
					break;
 

	
 
				case GAMEOPT_DISTANCE_TXT: case GAMEOPT_DISTANCE_BTN: /* Setup distance unit dropdown */
 
					ShowDropDownMenu(w, _units_dropdown, _opt_ptr->units, GAMEOPT_DISTANCE_BTN, 0, 0);
0 comments (0 inline, 0 general)