(svn r8338) -Codechange: merged road vehicle build window into the other ones

Note: now all build vehicle windows are merged into build_vehicle_gui.cpp
This commit is contained in:
bjarni
2007-01-22 02:09:51 +00:00
parent 09c9fe501f
commit 71d22b2f5e
6 changed files with 80 additions and 216 deletions

View File

@@ -1045,19 +1045,6 @@ static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int
}
}
static void DrawVehiclePurchaseInfoLocal(const int x, const int y, uint w, const EngineID engine_number)
{
switch (GetEngine(engine_number)->type) {
case VEH_Road: DrawRoadVehPurchaseInfo(x, y, w, engine_number); break;
case VEH_Ship:
case VEH_Train:
case VEH_Aircraft:
DrawVehiclePurchaseInfo(x, y, w, engine_number);
break;
default: NOT_REACHED();
}
}
static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
{
static const StringID _vehicle_type_names[] = {
@@ -1141,7 +1128,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
for (i = 0 ; i < 2 ; i++) {
if (selected_id[i] != INVALID_ENGINE) {
const Widget *wi = &w->widget[i == 0 ? 3 : 11];
DrawVehiclePurchaseInfoLocal(wi->left + 2 , wi->top + 1, wi->right - wi->left - 2, selected_id[i]);
DrawVehiclePurchaseInfo(wi->left + 2 , wi->top + 1, wi->right - wi->left - 2, selected_id[i]);
}
}
} break; // end of paint
@@ -1737,12 +1724,7 @@ void PlayerVehWndProc(Window *w, WindowEvent *e)
} break;
case VLW_WIDGET_NEW_VEHICLES:
switch (vl->vehicle_type) {
case VEH_Road: ShowBuildRoadVehWindow(0); break;
case VEH_Ship:
case VEH_Train:
case VEH_Aircraft: ShowBuildVehicleWindow(0, vl->vehicle_type); break;
}
ShowBuildVehicleWindow(0, vl->vehicle_type);
break;
case VLW_WIDGET_MANAGE_VEHICLES: