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