(svn r6712) -Code cleanup: renamed buildtrain_d to buildvehicle_d as it's used for all vehicle types

This commit is contained in:
bjarni
2006-10-10 07:56:23 +00:00
parent 28d11c2bda
commit 08789dd3e8
6 changed files with 143 additions and 143 deletions

View File

@@ -263,7 +263,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
DrawWindowWidgets(w);
y = 15;
sel = WP(w,buildtrain_d).sel_index;
sel = WP(w,buildvehicle_d).sel_index;
pos = w->vscroll.pos;
selected_id = INVALID_ENGINE;
for (eid = SHIP_ENGINES_INDEX; eid < SHIP_ENGINES_INDEX + NUM_SHIP_ENGINES; eid++) {
@@ -277,7 +277,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
sel--;
}
WP(w,buildtrain_d).sel_engine = selected_id;
WP(w,buildvehicle_d).sel_engine = selected_id;
if (selected_id != INVALID_ENGINE) {
DrawShipPurchaseInfo(2, w->widget[4].top + 1, selected_id);
@@ -290,20 +290,20 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
case 2: { /* listbox */
uint i = (e->we.click.pt.y - 14) / 24;
if (i < w->vscroll.cap) {
WP(w,buildtrain_d).sel_index = i + w->vscroll.pos;
WP(w,buildvehicle_d).sel_index = i + w->vscroll.pos;
SetWindowDirty(w);
}
} break;
case 5: { /* build */
EngineID sel_eng = WP(w,buildtrain_d).sel_engine;
EngineID sel_eng = WP(w,buildvehicle_d).sel_engine;
if (sel_eng != INVALID_ENGINE)
DoCommandP(w->window_number, sel_eng, 0, CcBuildShip, CMD_BUILD_SHIP | CMD_MSG(STR_980D_CAN_T_BUILD_SHIP));
} break;
case 6: { /* rename */
EngineID sel_eng = WP(w,buildtrain_d).sel_engine;
EngineID sel_eng = WP(w,buildvehicle_d).sel_engine;
if (sel_eng != INVALID_ENGINE) {
WP(w,buildtrain_d).rename_engine = sel_eng;
WP(w,buildvehicle_d).rename_engine = sel_eng;
ShowQueryString(GetCustomEngineName(sel_eng),
STR_9838_RENAME_SHIP_TYPE, 31, 160, w->window_class, w->window_number, CS_ALPHANUMERAL);
}
@@ -314,7 +314,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
case WE_ON_EDIT_TEXT:
if (e->we.edittext.str[0] != '\0') {
_cmd_text = e->we.edittext.str;
DoCommandP(0, WP(w, buildtrain_d).rename_engine, 0, NULL,
DoCommandP(0, WP(w, buildvehicle_d).rename_engine, 0, NULL,
CMD_RENAME_ENGINE | CMD_MSG(STR_9839_CAN_T_RENAME_SHIP_TYPE));
}
break;