mirror of https://github.com/OpenTTD/OpenTTD
(svn r12704) -Codechange: code style cleanup, mostly switch case alignment
parent
fc1f32a693
commit
8418bc5050
|
@ -204,6 +204,7 @@ static void TownAuthorityWndProc(Window *w, WindowEvent *e)
|
||||||
DrawString(2, y, STR_2045_ACTIONS_AVAILABLE, TC_FROMSTRING);
|
DrawString(2, y, STR_2045_ACTIONS_AVAILABLE, TC_FROMSTRING);
|
||||||
y += 10;
|
y += 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; buttons; i++, buttons >>= 1) {
|
for (i = 0; buttons; i++, buttons >>= 1) {
|
||||||
if (pos <= -5) break; ///< Draw only the 5 fitting lines
|
if (pos <= -5) break; ///< Draw only the 5 fitting lines
|
||||||
|
|
||||||
|
@ -516,17 +517,17 @@ static void TownDirectoryWndProc(Window *w, WindowEvent *e)
|
||||||
|
|
||||||
case WE_CLICK:
|
case WE_CLICK:
|
||||||
switch (e->we.click.widget) {
|
switch (e->we.click.widget) {
|
||||||
case TDW_SORTNAME: { /* Sort by Name ascending/descending */
|
case TDW_SORTNAME: /* Sort by Name ascending/descending */
|
||||||
_town_sort_order = (_town_sort_order == 0) ? 1 : 0;
|
_town_sort_order = (_town_sort_order == 0) ? 1 : 0;
|
||||||
_town_sort_dirty = true;
|
_town_sort_dirty = true;
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
} break;
|
break;
|
||||||
|
|
||||||
case TDW_SORTPOPULATION: { /* Sort by Population ascending/descending */
|
case TDW_SORTPOPULATION: /* Sort by Population ascending/descending */
|
||||||
_town_sort_order = (_town_sort_order == 2) ? 3 : 2;
|
_town_sort_order = (_town_sort_order == 2) ? 3 : 2;
|
||||||
_town_sort_dirty = true;
|
_town_sort_dirty = true;
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
} break;
|
break;
|
||||||
|
|
||||||
case TDW_CENTERTOWN: { /* Click on Town Matrix */
|
case TDW_CENTERTOWN: { /* Click on Town Matrix */
|
||||||
const Town* t;
|
const Town* t;
|
||||||
|
@ -623,6 +624,7 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e)
|
||||||
case 4: // new town
|
case 4: // new town
|
||||||
HandlePlacePushButton(w, 4, SPR_CURSOR_TOWN, VHM_RECT, PlaceProc_Town);
|
HandlePlacePushButton(w, 4, SPR_CURSOR_TOWN, VHM_RECT, PlaceProc_Town);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5: {// random town
|
case 5: {// random town
|
||||||
Town *t;
|
Town *t;
|
||||||
uint size = min(_scengen_town_size, (int)TSM_CITY);
|
uint size = min(_scengen_town_size, (int)TSM_CITY);
|
||||||
|
@ -638,17 +640,15 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e)
|
||||||
} else {
|
} else {
|
||||||
ScrollMainWindowToTile(t->xy);
|
ScrollMainWindowToTile(t->xy);
|
||||||
}
|
}
|
||||||
|
} break;
|
||||||
|
|
||||||
break;
|
case 6: // many random towns
|
||||||
}
|
|
||||||
case 6: {// many random towns
|
|
||||||
w->HandleButtonClick(6);
|
w->HandleButtonClick(6);
|
||||||
|
|
||||||
_generating_world = true;
|
_generating_world = true;
|
||||||
if (!GenerateTowns()) ShowErrorMessage(STR_NO_SPACE_FOR_TOWN, STR_CANNOT_GENERATE_TOWN, 0, 0);
|
if (!GenerateTowns()) ShowErrorMessage(STR_NO_SPACE_FOR_TOWN, STR_CANNOT_GENERATE_TOWN, 0, 0);
|
||||||
_generating_world = false;
|
_generating_world = false;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case 7: case 8: case 9: case 10:
|
case 7: case 8: case 9: case 10:
|
||||||
w->RaiseWidget(_scengen_town_size + 7);
|
w->RaiseWidget(_scengen_town_size + 7);
|
||||||
|
@ -656,17 +656,18 @@ static void ScenEditTownGenWndProc(Window *w, WindowEvent *e)
|
||||||
w->LowerWidget(_scengen_town_size + 7);
|
w->LowerWidget(_scengen_town_size + 7);
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
break;
|
break;
|
||||||
}
|
} break;
|
||||||
break;
|
|
||||||
|
|
||||||
case WE_TIMEOUT:
|
case WE_TIMEOUT:
|
||||||
w->RaiseWidget(5);
|
w->RaiseWidget(5);
|
||||||
w->RaiseWidget(6);
|
w->RaiseWidget(6);
|
||||||
SetWindowDirty(w);
|
SetWindowDirty(w);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WE_PLACE_OBJ:
|
case WE_PLACE_OBJ:
|
||||||
_place_proc(e->we.place.tile);
|
_place_proc(e->we.place.tile);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WE_ABORT_PLACE_OBJ:
|
case WE_ABORT_PLACE_OBJ:
|
||||||
w->RaiseButtons();
|
w->RaiseButtons();
|
||||||
w->LowerWidget(_scengen_town_size + 7);
|
w->LowerWidget(_scengen_town_size + 7);
|
||||||
|
|
Loading…
Reference in New Issue