mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r6639) -CodeChange : Conversion of SetWidgetLoweredState to SetWindowWidgetLoweredState, in order to follow pre-established standard
This commit is contained in:
parent
ddb46fe8d8
commit
6444b0e781
|
@ -143,8 +143,8 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
|
|||
{
|
||||
switch (e->event) {
|
||||
case WE_CREATE:
|
||||
SetWidgetLoweredState(w, 16, !_station_show_coverage);
|
||||
SetWidgetLoweredState(w, 17, _station_show_coverage);
|
||||
SetWindowWidgetLoweredState(w, 16, !_station_show_coverage);
|
||||
SetWindowWidgetLoweredState(w, 17, _station_show_coverage);
|
||||
LowerWindowWidget(w, _selected_airport_type + 7);
|
||||
break;
|
||||
|
||||
|
@ -210,8 +210,8 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
|
|||
break;
|
||||
case 16: case 17:
|
||||
_station_show_coverage = e->we.click.widget - 16;
|
||||
SetWidgetLoweredState(w, 16, !_station_show_coverage);
|
||||
SetWidgetLoweredState(w, 17, _station_show_coverage);
|
||||
SetWindowWidgetLoweredState(w, 16, !_station_show_coverage);
|
||||
SetWindowWidgetLoweredState(w, 17, _station_show_coverage);
|
||||
SndPlayFx(SND_15_BEEP);
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
|
|
|
@ -241,10 +241,10 @@ void GenerateLandscapeWndProc(Window *w, WindowEvent *e)
|
|||
SetWindowWidgetDisabledState(w, 21, _patches_newgame.snow_line_height <= 2 || _opt_newgame.landscape != LT_HILLY);
|
||||
SetWindowWidgetDisabledState(w, 23, _patches_newgame.snow_line_height >= 13 || _opt_newgame.landscape != LT_HILLY);
|
||||
|
||||
SetWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
|
||||
SetWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
|
||||
SetWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
|
||||
SetWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
|
||||
SetWindowWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
|
||||
SetWindowWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
|
||||
SetvWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
|
||||
SetWindowWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
|
||||
DrawWindowWidgets(w);
|
||||
|
||||
y = (mode == GLWP_HEIGHTMAP) ? 22 : 0;
|
||||
|
@ -594,10 +594,10 @@ void CreateScenarioWndProc(Window *w, WindowEvent *e)
|
|||
SetWindowWidgetDisabledState(w, 17, _patches_newgame.se_flat_world_height <= 0);
|
||||
SetWindowWidgetDisabledState(w, 19, _patches_newgame.se_flat_world_height >= 15);
|
||||
|
||||
SetWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
|
||||
SetWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
|
||||
SetWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
|
||||
SetWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
|
||||
SetWindowWidgetLoweredState(w, 3, _opt_newgame.landscape == LT_NORMAL);
|
||||
SetWindowWidgetLoweredState(w, 4, _opt_newgame.landscape == LT_HILLY);
|
||||
SetWindowWidgetLoweredState(w, 5, _opt_newgame.landscape == LT_DESERT);
|
||||
SetWindowWidgetLoweredState(w, 6, _opt_newgame.landscape == LT_CANDY);
|
||||
DrawWindowWidgets(w);
|
||||
|
||||
DrawString( 12, 96, STR_MAPSIZE, 0);
|
||||
|
|
|
@ -50,10 +50,10 @@ static void SelectGameWndProc(Window *w, WindowEvent *e)
|
|||
case WE_CREATE: LowerWindowWidget(w, _opt_newgame.landscape + 8); break;
|
||||
|
||||
case WE_PAINT:
|
||||
SetWidgetLoweredState(w, 8, _opt_newgame.landscape == LT_NORMAL);
|
||||
SetWidgetLoweredState(w, 9, _opt_newgame.landscape == LT_HILLY);
|
||||
SetWidgetLoweredState(w, 10, _opt_newgame.landscape == LT_DESERT);
|
||||
SetWidgetLoweredState(w, 11, _opt_newgame.landscape == LT_CANDY);
|
||||
SetWindowWidgetLoweredState(w, 8, _opt_newgame.landscape == LT_NORMAL);
|
||||
SetWindowWidgetLoweredState(w, 9, _opt_newgame.landscape == LT_HILLY);
|
||||
SetWindowWidgetLoweredState(w, 10, _opt_newgame.landscape == LT_DESERT);
|
||||
SetWindowWidgetLoweredState(w, 11, _opt_newgame.landscape == LT_CANDY);
|
||||
SetDParam(0, STR_6801_EASY + _opt_newgame.diff_level);
|
||||
DrawWindowWidgets(w);
|
||||
break;
|
||||
|
|
12
rail_gui.c
12
rail_gui.c
|
@ -621,8 +621,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
|
|||
LowerWindowWidget(w, _railstation.numtracks + 4);
|
||||
LowerWindowWidget(w, _railstation.platlength + 11);
|
||||
}
|
||||
SetWidgetLoweredState(w, 20, !_station_show_coverage);
|
||||
SetWidgetLoweredState(w, 21, _station_show_coverage);
|
||||
SetWindowWidgetLoweredState(w, 20, !_station_show_coverage);
|
||||
SetWindowWidgetLoweredState(w, 21, _station_show_coverage);
|
||||
break;
|
||||
|
||||
case WE_PAINT: {
|
||||
|
@ -768,8 +768,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
|
|||
case 19:
|
||||
_railstation.dragdrop ^= true;
|
||||
ToggleWidgetLoweredState(w, 19);
|
||||
SetWidgetLoweredState(w, _railstation.numtracks + 4, !_railstation.dragdrop);
|
||||
SetWidgetLoweredState(w, _railstation.platlength + 11, !_railstation.dragdrop);
|
||||
SetWindowWidgetLoweredState(w, _railstation.numtracks + 4, !_railstation.dragdrop);
|
||||
SetWindowWidgetLoweredState(w, _railstation.platlength + 11, !_railstation.dragdrop);
|
||||
SndPlayFx(SND_15_BEEP);
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
|
@ -777,8 +777,8 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
|
|||
case 20:
|
||||
case 21:
|
||||
_station_show_coverage = e->we.click.widget - 20;
|
||||
SetWidgetLoweredState(w, 20, !_station_show_coverage);
|
||||
SetWidgetLoweredState(w, 21, _station_show_coverage);
|
||||
SetWindowWidgetLoweredState(w, 20, !_station_show_coverage);
|
||||
SetWindowWidgetLoweredState(w, 21, _station_show_coverage);
|
||||
SndPlayFx(SND_15_BEEP);
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
|
|
|
@ -108,7 +108,7 @@ static void GameOptionsWndProc(Window *w, WindowEvent *e)
|
|||
i = GetCurRes();
|
||||
SetDParam(7, i == _num_resolutions ? STR_RES_OTHER : SPECSTR_RESOLUTION_START + i);
|
||||
SetDParam(8, SPECSTR_SCREENSHOT_START + _cur_screenshot_format);
|
||||
SetWidgetLoweredState(w, 28, _fullscreen);
|
||||
SetWindowWidgetLoweredState(w, 28, _fullscreen);
|
||||
|
||||
DrawWindowWidgets(w);
|
||||
DrawString(20, 175, STR_OPTIONS_FULLSCREEN, 0); // fullscreen
|
||||
|
@ -152,7 +152,7 @@ static void GameOptionsWndProc(Window *w, WindowEvent *e)
|
|||
ShowDropDownMenu(w, BuildDynamicDropdown(SPECSTR_RESOLUTION_START, _num_resolutions), GetCurRes(), 27, 0, 0);
|
||||
return;
|
||||
case 28: /* Click fullscreen on/off */
|
||||
SetWidgetLoweredState(w, 28, !_fullscreen);
|
||||
SetWindowWidgetLoweredState(w, 28, !_fullscreen);
|
||||
ToggleFullScreen(!_fullscreen); // toggle full-screen on/off
|
||||
SetWindowDirty(w);
|
||||
return;
|
||||
|
|
|
@ -983,7 +983,7 @@ void ShowSmallMap(void)
|
|||
if (w == NULL) return;
|
||||
|
||||
LowerWindowWidget(w, _smallmap_type + 5);
|
||||
SetWidgetLoweredState(w, 12, _smallmap_show_towns);
|
||||
SetWindowWidgetLoweredState(w, 12, _smallmap_show_towns);
|
||||
w->resize.width = 350;
|
||||
w->resize.height = 250;
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
|
|||
SETBIT(facilities, e->we.click.widget - 6);
|
||||
LowerWindowWidget(w, e->we.click.widget);
|
||||
}
|
||||
SetWidgetLoweredState(w, 26, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
|
||||
SetWindowWidgetLoweredState(w, 26, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
|
||||
sl->flags |= SL_REBUILD;
|
||||
SetWindowDirty(w);
|
||||
break;
|
||||
|
@ -405,7 +405,7 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
|
|||
LowerWindowWidget(w, e->we.click.widget);
|
||||
}
|
||||
sl->flags |= SL_REBUILD;
|
||||
SetWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
|
||||
SetWindowWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
|
||||
SetWindowDirty(w);
|
||||
}
|
||||
}
|
||||
|
@ -436,8 +436,8 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
|
|||
for (i = 0; i < NUM_CARGO; i++) {
|
||||
if (HASBIT(cargo_filter, i)) LowerWindowWidget(w, i + 12);
|
||||
}
|
||||
SetWidgetLoweredState(w, 26, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
|
||||
SetWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
|
||||
SetWindowWidgetLoweredState(w, 26, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
|
||||
SetWindowWidgetLoweredState(w, 27, cargo_filter == 0x1FFF);
|
||||
sl->sort_list = NULL;
|
||||
sl->flags = SL_REBUILD;
|
||||
sl->sort_type = 0;
|
||||
|
|
2
window.h
2
window.h
|
@ -695,7 +695,7 @@ static inline bool IsWindowWidgetHidden(Window *w, byte widget_index)
|
|||
* @param widget_index : index of this widget in the window
|
||||
* @param hidden_stat : status to use ie: lowered = true, raised = false
|
||||
*/
|
||||
static inline void SetWidgetLoweredState(Window *w, byte widget_index, bool lowered_stat)
|
||||
static inline void SetWindowWidgetLoweredState(Window *w, byte widget_index, bool lowered_stat)
|
||||
{
|
||||
SB(w->click_state, widget_index, 1, !!lowered_stat);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue