(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out

how the system works. All useful windows are already made resizable. Enjoy :)
-Fix: fixed some GUI-glitches and flaws along the way
This commit is contained in:
truelight 2005-01-03 19:45:18 +00:00
parent 5b6be88587
commit a94fe04a9a
31 changed files with 2118 additions and 1780 deletions

View File

@ -18,7 +18,7 @@ void Set_DPARAM_Aircraft_Build_Window(uint16 engine_number)
const AircraftVehicleInfo *avi = AircraftVehInfo(engine_number); const AircraftVehicleInfo *avi = AircraftVehInfo(engine_number);
Engine *e; Engine *e;
YearMonthDay ymd; YearMonthDay ymd;
SetDParam(0, avi->base_cost * (_price.aircraft_base>>3)>>5); SetDParam(0, avi->base_cost * (_price.aircraft_base>>3)>>5);
SetDParam(1, avi->max_speed * 8); SetDParam(1, avi->max_speed * 8);
SetDParam(2, avi->passanger_capacity); SetDParam(2, avi->passanger_capacity);
@ -30,7 +30,7 @@ void Set_DPARAM_Aircraft_Build_Window(uint16 engine_number)
SetDParam(7, e->reliability * 100 >> 16); SetDParam(7, e->reliability * 100 >> 16);
ConvertDayToYMD(&ymd, e->intro_date); ConvertDayToYMD(&ymd, e->intro_date);
SetDParam(5, ymd.year + 1920); SetDParam(5, ymd.year + 1920);
} }
static void DrawAircraftImage(Vehicle *v, int x, int y, VehicleID selection) static void DrawAircraftImage(Vehicle *v, int x, int y, VehicleID selection)
@ -95,7 +95,7 @@ static void NewAircraftWndProc(Window *w, WindowEvent *e)
do { do {
if (HASBIT(e->player_avail, _local_player)) { if (HASBIT(e->player_avail, _local_player)) {
if (sel==0) selected_id = engine_id; if (sel==0) selected_id = engine_id;
if (IS_INT_INSIDE(--pos, -4, 0)) { if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
DrawString(x+62, y+7, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10); DrawString(x+62, y+7, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10);
DrawAircraftEngine(x+29, y+10, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player))); DrawAircraftEngine(x+29, y+10, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
y += 24; y += 24;
@ -109,7 +109,7 @@ static void NewAircraftWndProc(Window *w, WindowEvent *e)
if (selected_id != -1) { if (selected_id != -1) {
Set_DPARAM_Aircraft_Build_Window(selected_id); Set_DPARAM_Aircraft_Build_Window(selected_id);
DrawString(2, 111, STR_A007_COST_SPEED_CAPACITY_PASSENGERS, 0); DrawString(2, w->widget[4].top + 1, STR_A007_COST_SPEED_CAPACITY_PASSENGERS, 0);
} }
} }
} break; } break;
@ -118,7 +118,7 @@ static void NewAircraftWndProc(Window *w, WindowEvent *e)
switch(e->click.widget) { switch(e->click.widget) {
case 2: { /* listbox */ case 2: { /* listbox */
uint i = (e->click.pt.y - 14) / 24; uint i = (e->click.pt.y - 14) / 24;
if (i < 4) { if (i < w->vscroll.cap) {
WP(w,buildtrain_d).sel_index = i + w->vscroll.pos; WP(w,buildtrain_d).sel_index = i + w->vscroll.pos;
SetWindowDirty(w); SetWindowDirty(w);
} }
@ -156,24 +156,30 @@ static void NewAircraftWndProc(Window *w, WindowEvent *e)
memcpy(_decode_parameters, b, 32); memcpy(_decode_parameters, b, 32);
DoCommandP(0, WP(w,buildtrain_d).rename_engine, 0, NULL, CMD_RENAME_ENGINE | CMD_MSG(STR_A03A_CAN_T_RENAME_AIRCRAFT_TYPE)); DoCommandP(0, WP(w,buildtrain_d).rename_engine, 0, NULL, CMD_RENAME_ENGINE | CMD_MSG(STR_A03A_CAN_T_RENAME_AIRCRAFT_TYPE));
} break; } break;
case WE_RESIZE:
w->vscroll.cap += e->sizing.diff.y / 24;
w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
break;
} }
} }
static const Widget _new_aircraft_widgets[] = { static const Widget _new_aircraft_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 239, 0, 13, STR_A005_NEW_AIRCRAFT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 239, 0, 13, STR_A005_NEW_AIRCRAFT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_MATRIX, 14, 0, 228, 14, 109, 0x401, STR_A025_AIRCRAFT_SELECTION_LIST}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 0, 228, 14, 109, 0x401, STR_A025_AIRCRAFT_SELECTION_LIST},
{ WWT_SCROLLBAR, 14, 229, 239, 14, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_BOTTOM, 14, 229, 239, 14, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_IMGBTN, 14, 0, 239, 110, 161, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_TB, 14, 0, 239, 110, 161, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 119, 162, 173, STR_A006_BUILD_AIRCRAFT, STR_A026_BUILD_THE_HIGHLIGHTED_AIRCRAFT}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 114, 162, 173, STR_A006_BUILD_AIRCRAFT, STR_A026_BUILD_THE_HIGHLIGHTED_AIRCRAFT},
{ WWT_PUSHTXTBTN, 14, 120, 239, 162, 173, STR_A037_RENAME, STR_A038_RENAME_AIRCRAFT_TYPE}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 115, 228, 162, 173, STR_A037_RENAME, STR_A038_RENAME_AIRCRAFT_TYPE},
{ WWT_RESIZEBOX, RESIZE_TB, 14, 229, 239, 162, 173, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const WindowDesc _new_aircraft_desc = { static const WindowDesc _new_aircraft_desc = {
-1, -1, 240, 174, -1, -1, 240, 174,
WC_BUILD_VEHICLE,0, WC_BUILD_VEHICLE,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_new_aircraft_widgets, _new_aircraft_widgets,
NewAircraftWndProc NewAircraftWndProc
}; };
@ -187,6 +193,9 @@ static void ShowBuildAircraftWindow(uint tile)
w = AllocateWindowDesc(&_new_aircraft_desc); w = AllocateWindowDesc(&_new_aircraft_desc);
w->window_number = tile; w->window_number = tile;
w->vscroll.cap = 4; w->vscroll.cap = 4;
w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
w->resize.step_height = 24;
if (tile != 0) { if (tile != 0) {
w->caption_color = _map_owner[tile]; w->caption_color = _map_owner[tile];
@ -298,11 +307,11 @@ static void AircraftRefitWndProc(Window *w, WindowEvent *e)
} }
static const Widget _aircraft_refit_widgets[] = { static const Widget _aircraft_refit_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 239, 0, 13, STR_A03C_REFIT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 239, 0, 13, STR_A03C_REFIT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 239, 14, 135, 0x0, STR_A03E_SELECT_TYPE_OF_CARGO_FOR}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 239, 14, 135, 0x0, STR_A03E_SELECT_TYPE_OF_CARGO_FOR},
{ WWT_IMGBTN, 14, 0, 239, 136, 157, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 239, 136, 157, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 239, 158, 169, STR_A03D_REFIT_AIRCRAFT, STR_A03F_REFIT_AIRCRAFT_TO_CARRY}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 239, 158, 169, STR_A03D_REFIT_AIRCRAFT, STR_A03F_REFIT_AIRCRAFT_TO_CARRY},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -469,14 +478,14 @@ change_int:
static const Widget _aircraft_details_widgets[] = { static const Widget _aircraft_details_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 349, 0, 13, STR_A00C_DETAILS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 349, 0, 13, STR_A00C_DETAILS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 350, 389, 0, 13, STR_01AA_NAME, STR_A032_NAME_AIRCRAFT}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 350, 389, 0, 13, STR_01AA_NAME, STR_A032_NAME_AIRCRAFT},
{ WWT_IMGBTN, 14, 0, 389, 14, 55, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 389, 14, 55, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 389, 56, 101, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 389, 56, 101, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 10, 102, 107, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 102, 107, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL},
{ WWT_PUSHTXTBTN, 14, 0, 10, 108, 113, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 108, 113, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL},
{ WWT_IMGBTN, 14, 11, 389, 102, 113, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 11, 389, 102, 113, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -507,17 +516,17 @@ static void ShowAircraftDetailsWindow(Vehicle *v)
static const Widget _aircraft_view_widgets[] = { static const Widget _aircraft_view_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 237, 0, 13, STR_A00A, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 237, 0, 13, STR_A00A, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 238, 249, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 14, 238, 249, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 14, 0, 231, 14, 103, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 231, 14, 103, 0x0, STR_NULL},
{ WWT_6, 14, 2, 229, 16, 101, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, 14, 2, 229, 16, 101, 0x0, STR_NULL},
{ WWT_PUSHIMGBTN, 14, 0, 249, 104, 115, 0x0, STR_A027_CURRENT_AIRCRAFT_ACTION}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 0, 249, 104, 115, 0x0, STR_A027_CURRENT_AIRCRAFT_ACTION},
{ WWT_PUSHIMGBTN, 14, 232, 249, 14, 31, 0x2AB, STR_A029_CENTER_MAIN_VIEW_ON_AIRCRAFT}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 14, 31, 0x2AB, STR_A029_CENTER_MAIN_VIEW_ON_AIRCRAFT},
{ WWT_PUSHIMGBTN, 14, 232, 249, 32, 49, 0x2AF, STR_A02A_SEND_AIRCRAFT_TO_HANGAR}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 32, 49, 0x2AF, STR_A02A_SEND_AIRCRAFT_TO_HANGAR},
{ WWT_PUSHIMGBTN, 14, 232, 249, 50, 67, 0x2B4, STR_A03B_REFIT_AIRCRAFT_TO_CARRY}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 50, 67, 0x2B4, STR_A03B_REFIT_AIRCRAFT_TO_CARRY},
{ WWT_PUSHIMGBTN, 14, 232, 249, 68, 85, 0x2B2, STR_A028_SHOW_AIRCRAFT_S_ORDERS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 68, 85, 0x2B2, STR_A028_SHOW_AIRCRAFT_S_ORDERS},
{ WWT_PUSHIMGBTN, 14, 232, 249, 86, 103, 0x2B3, STR_A02B_SHOW_AIRCRAFT_DETAILS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 86, 103, 0x2B3, STR_A02B_SHOW_AIRCRAFT_DETAILS},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -648,7 +657,7 @@ static void DrawAircraftDepotWindow(Window *w)
tile = w->window_number; tile = w->window_number;
/* setup disabled buttons */ /* setup disabled buttons */
w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<6)); w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<7));
/* determine amount of items for scroller */ /* determine amount of items for scroller */
num = 0; num = 0;
@ -657,21 +666,21 @@ static void DrawAircraftDepotWindow(Window *w)
v->tile == (TileIndex)tile) v->tile == (TileIndex)tile)
num++; num++;
} }
SetVScrollCount(w, (num + 3) >> 2); SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
SetDParam(0, _map2[tile]); SetDParam(0, _map2[tile]);
DrawWindowWidgets(w); DrawWindowWidgets(w);
x = 2; x = 2;
y = 15; y = 15;
num = w->vscroll.pos * 4; num = w->vscroll.pos * w->hscroll.cap;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {
if (v->type == VEH_Aircraft && if (v->type == VEH_Aircraft &&
v->subtype <= 2 && v->subtype <= 2 &&
v->vehstatus&VS_HIDDEN && v->vehstatus&VS_HIDDEN &&
v->tile == (TileIndex)tile && v->tile == (TileIndex)tile &&
--num < 0 && num >= -8) { --num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
DrawAircraftImage(v, x+12, y, WP(w,traindepot_d).sel); DrawAircraftImage(v, x+12, y, WP(w,traindepot_d).sel);
@ -680,8 +689,8 @@ static void DrawAircraftDepotWindow(Window *w)
DrawSprite( (v->vehstatus & VS_STOPPED) ? 0xC12 : 0xC13, x, y+12); DrawSprite( (v->vehstatus & VS_STOPPED) ? 0xC12 : 0xC13, x, y+12);
if ((x+=74) == 2+74*4) { if ((x+=74) == 2 + 74 * w->hscroll.cap) {
x -= 74*4; x = 2;
y += 24; y += 24;
} }
} }
@ -760,14 +769,17 @@ static void AircraftDepotClickAircraft(Window *w, int x, int y)
} }
static const Widget _aircraft_depot_widgets[] = { static const Widget _aircraft_depot_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 318, 0, 13, STR_A002_AIRCRAFT_HANGAR, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 318, 0, 13, STR_A002_AIRCRAFT_HANGAR, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 319, 330, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 319, 330, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_MATRIX, 14, 0, 295, 14, 61, 0x204, STR_A021_AIRCRAFT_CLICK_ON_AIRCRAFT}, { WWT_MATRIX, RESIZE_RB, 14, 0, 295, 14, 61, 0x204, STR_A021_AIRCRAFT_CLICK_ON_AIRCRAFT},
{ WWT_IMGBTN, 14, 296, 319, 14, 61, 0x2A9, STR_A023_DRAG_AIRCRAFT_TO_HERE_TO}, { WWT_PANEL, RESIZE_LRB, 14, 296, 319, 14, 13, 0x0, STR_NULL},
{ WWT_SCROLLBAR, 14, 320, 330, 14, 61, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_IMGBTN, RESIZE_LRTB, 14, 296, 319, 14, 61, 0x2A9, STR_A023_DRAG_AIRCRAFT_TO_HERE_TO},
{ WWT_PUSHTXTBTN, 14, 0, 164, 62, 73, STR_A003_NEW_AIRCRAFT, STR_A022_BUILD_NEW_AIRCRAFT}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 320, 330, 14, 61, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 165, 330, 62, 73, STR_00E4_LOCATION, STR_A024_CENTER_MAIN_VIEW_ON_HANGAR}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 159, 62, 73, STR_A003_NEW_AIRCRAFT, STR_A022_BUILD_NEW_AIRCRAFT},
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 160, 319, 62, 73, STR_00E4_LOCATION, STR_A024_CENTER_MAIN_VIEW_ON_HANGAR},
{ WWT_PANEL, RESIZE_RTB, 14, 320, 319, 62, 73, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 320, 330, 62, 73, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -784,10 +796,10 @@ static void AircraftDepotWndProc(Window *w, WindowEvent *e)
case 3: /* click aircraft */ case 3: /* click aircraft */
AircraftDepotClickAircraft(w, e->click.pt.x, e->click.pt.y); AircraftDepotClickAircraft(w, e->click.pt.x, e->click.pt.y);
break; break;
case 6: /* show build aircraft window */ case 7: /* show build aircraft window */
ShowBuildAircraftWindow(w->window_number); ShowBuildAircraftWindow(w->window_number);
break; break;
case 7: /* scroll to tile */ case 8: /* scroll to tile */
ScrollMainWindowToTile(w->window_number); ScrollMainWindowToTile(w->window_number);
break; break;
} }
@ -813,12 +825,12 @@ static void AircraftDepotWndProc(Window *w, WindowEvent *e)
} }
} break; } break;
case 4: case 5:
if (!HASBIT(w->disabled_state, 4) && if (!HASBIT(w->disabled_state, 5) &&
WP(w,traindepot_d).sel != INVALID_VEHICLE) { WP(w,traindepot_d).sel != INVALID_VEHICLE) {
Vehicle *v; Vehicle *v;
HandleButtonClick(w, 4); HandleButtonClick(w, 5);
v = &_vehicles[WP(w,traindepot_d).sel]; v = &_vehicles[WP(w,traindepot_d).sel];
WP(w,traindepot_d).sel = INVALID_VEHICLE; WP(w,traindepot_d).sel = INVALID_VEHICLE;
@ -837,6 +849,12 @@ static void AircraftDepotWndProc(Window *w, WindowEvent *e)
break; break;
} }
break; break;
case WE_RESIZE:
w->vscroll.cap += e->sizing.diff.y / 24;
w->hscroll.cap += e->sizing.diff.x / 74;
w->widget[3].unkA = (w->vscroll.cap << 8) + w->hscroll.cap;
break;
} }
} }
@ -845,7 +863,7 @@ static void AircraftDepotWndProc(Window *w, WindowEvent *e)
static const WindowDesc _aircraft_depot_desc = { static const WindowDesc _aircraft_depot_desc = {
-1, -1, 331, 74, -1, -1, 331, 74,
WC_VEHICLE_DEPOT,0, WC_VEHICLE_DEPOT,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_aircraft_depot_widgets, _aircraft_depot_widgets,
AircraftDepotWndProc AircraftDepotWndProc
}; };
@ -859,6 +877,9 @@ void ShowAircraftDepotWindow(uint tile)
if (w) { if (w) {
w->caption_color = _map_owner[tile]; w->caption_color = _map_owner[tile];
w->vscroll.cap = 2; w->vscroll.cap = 2;
w->hscroll.cap = 4;
w->resize.step_width = 74;
w->resize.step_height = 24;
WP(w,traindepot_d).sel = INVALID_VEHICLE; WP(w,traindepot_d).sel = INVALID_VEHICLE;
_backup_orders_tile = 0; _backup_orders_tile = 0;
} }
@ -893,31 +914,35 @@ static void DrawSmallSchedule(Vehicle *v, int x, int y) {
} }
static Widget _player_aircraft_widgets[] = { static const Widget _player_aircraft_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 247, 0, 13, STR_A009_AIRCRAFT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 247, 0, 13, STR_A009_AIRCRAFT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PUSHTXTBTN, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_PANEL, 14, 81, 237, 14, 25, 0x0, STR_SORT_CRITERIA_TIP}, { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_CLOSEBOX, 14, 238, 248, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, 14, 249, 259, 14, 25, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_RIGHT, 14, 244, 259, 14, 25, 0x0, STR_NULL},
{ WWT_MATRIX, 14, 0, 248, 26, 169, 0x401, STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT}, { WWT_MATRIX, RESIZE_RB, 14, 0, 248, 26, 169, 0x401, STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT},
{ WWT_SCROLLBAR, 14, 249, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 249, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 0, 129, 170, 181, STR_A003_NEW_AIRCRAFT, STR_A020_BUILD_NEW_AIRCRAFT_REQUIRES}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 124, 170, 181, STR_A003_NEW_AIRCRAFT, STR_A020_BUILD_NEW_AIRCRAFT_REQUIRES},
{ WWT_PUSHTXTBTN, 14, 130, 259, 170, 181, STR_REPLACE_VEHICLES, STR_REPLACE_HELP}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 125, 248, 170, 181, STR_REPLACE_VEHICLES, STR_REPLACE_HELP},
{ WWT_PANEL, RESIZE_RTB, 14, 249, 248, 170, 181, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 249, 259, 170, 181, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static Widget _other_player_aircraft_widgets[] = { static const Widget _other_player_aircraft_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 247, 0, 13, STR_A009_AIRCRAFT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 247, 0, 13, STR_A009_AIRCRAFT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PUSHTXTBTN, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_PANEL, 14, 81, 237, 14, 25, 0x0, STR_SORT_CRITERIA_TIP}, { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_CLOSEBOX, 14, 238, 248, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, 14, 249, 259, 14, 25, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_RIGHT, 14, 244, 259, 14, 25, 0x0, STR_NULL},
{ WWT_MATRIX, 14, 0, 248, 26, 169, 0x401, STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT}, { WWT_MATRIX, RESIZE_RB, 14, 0, 248, 26, 169, 0x401, STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT},
{ WWT_SCROLLBAR, 14, 249, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 249, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, RESIZE_RTB, 14, 249, 248, 170, 181, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 249, 259, 170, 181, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -946,20 +971,17 @@ static void PlayerAircraftWndProc(Window *w, WindowEvent *e)
/* draw the widgets */ /* draw the widgets */
{ {
const Player *p = DEREF_PLAYER(owner); const Player *p = DEREF_PLAYER(owner);
/* XXX hack */
if (station == -1) { if (station == -1) {
/* Company Name -- (###) Aircraft */ /* Company Name -- (###) Aircraft */
SetDParam(0, p->name_1); SetDParam(0, p->name_1);
SetDParam(1, p->name_2); SetDParam(1, p->name_2);
SetDParam(2, w->vscroll.count); SetDParam(2, w->vscroll.count);
_player_aircraft_widgets[1].unkA = STR_A009_AIRCRAFT; w->widget[1].unkA = STR_A009_AIRCRAFT;
_other_player_aircraft_widgets[1].unkA = STR_A009_AIRCRAFT;
} else { } else {
/* Station Name -- (###) Aircraft */ /* Station Name -- (###) Aircraft */
SetDParam(0, DEREF_STATION(station)->index); SetDParam(0, DEREF_STATION(station)->index);
SetDParam(1, w->vscroll.count); SetDParam(1, w->vscroll.count);
_player_aircraft_widgets[1].unkA = STR_SCHEDULED_AIRCRAFT; w->widget[1].unkA = STR_SCHEDULED_AIRCRAFT;
_other_player_aircraft_widgets[1].unkA = STR_SCHEDULED_AIRCRAFT;
} }
DrawWindowWidgets(w); DrawWindowWidgets(w);
} }
@ -1049,11 +1071,11 @@ static void PlayerAircraftWndProc(Window *w, WindowEvent *e)
ShowBuildAircraftWindow(0); ShowBuildAircraftWindow(0);
} break; } break;
case 10: case 10:
ShowReplaceVehicleWindow(VEH_Aircraft); ShowReplaceVehicleWindow(VEH_Aircraft);
break; break;
} }
} break; } break;
@ -1090,21 +1112,27 @@ static void PlayerAircraftWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w); SetWindowDirty(w);
} }
break; break;
case WE_RESIZE:
/* Update the scroll + matrix */
w->vscroll.cap += e->sizing.diff.y / PLY_WND_PRC__SIZE_OF_ROW_BIG;
w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
break;
} }
} }
static const WindowDesc _player_aircraft_desc = { static const WindowDesc _player_aircraft_desc = {
-1, -1, 260, 182, -1, -1, 260, 182,
WC_AIRCRAFT_LIST,0, WC_AIRCRAFT_LIST,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_player_aircraft_widgets, _player_aircraft_widgets,
PlayerAircraftWndProc PlayerAircraftWndProc
}; };
static const WindowDesc _other_player_aircraft_desc = { static const WindowDesc _other_player_aircraft_desc = {
-1, -1, 260, 170, -1, -1, 260, 182,
WC_AIRCRAFT_LIST,0, WC_AIRCRAFT_LIST,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_other_player_aircraft_widgets, _other_player_aircraft_widgets,
PlayerAircraftWndProc PlayerAircraftWndProc
}; };
@ -1121,6 +1149,8 @@ void ShowPlayerAircraft(int player, int station)
if (w) { if (w) {
w->caption_color = w->window_number; w->caption_color = w->window_number;
w->vscroll.cap = 4; // maximum number of vehicles shown w->vscroll.cap = 4;
w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_BIG;
} }
} }

View File

@ -96,12 +96,12 @@ static void BuildAirToolbWndProc(Window *w, WindowEvent *e)
} }
static const Widget _air_toolbar_widgets[] = { static const Widget _air_toolbar_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 73, 0, 13, STR_A000_AIRPORTS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 73, 0, 13, STR_A000_AIRPORTS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 7, 74, 85, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 7, 74, 85, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 7, 0, 41, 14, 35, 0x2E8, STR_A01E_BUILD_AIRPORT}, { WWT_PANEL, RESIZE_NONE, 7, 0, 41, 14, 35, 0x2E8, STR_A01E_BUILD_AIRPORT},
{ WWT_PANEL, 7, 42, 63, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC}, { WWT_PANEL, RESIZE_NONE, 7, 42, 63, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
{ WWT_PANEL, 7, 64, 85, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 64, 85, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -155,7 +155,7 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
case AT_INTERNATIONAL: rad = CA_AIR_INTER; break; case AT_INTERNATIONAL: rad = CA_AIR_INTER; break;
} }
} }
if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad); if (_station_show_coverage) SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
DrawWindowWidgets(w); DrawWindowWidgets(w);
@ -196,16 +196,16 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
} }
static const Widget _build_airport_picker_widgets[] = { static const Widget _build_airport_picker_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 147, 0, 13, STR_3001_AIRPORT_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 147, 0, 13, STR_3001_AIRPORT_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 147, 14, 130, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 147, 14, 130, 0x0, STR_NULL},
{WWT_NODISTXTBTN, 14, 2, 73, 27, 38, STR_3059_SMALL, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT}, {WWT_NODISTXTBTN, RESIZE_NONE, 14, 2, 73, 27, 38, STR_3059_SMALL, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
{WWT_NODISTXTBTN, 14, 74, 145, 27, 38, STR_305A_LARGE, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT}, {WWT_NODISTXTBTN, RESIZE_NONE, 14, 74, 145, 27, 38, STR_305A_LARGE, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
{WWT_NODISTXTBTN, 14, 2, 145, 63, 74, STR_306B_HELIPORT, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT}, {WWT_NODISTXTBTN, RESIZE_NONE, 14, 2, 145, 63, 74, STR_306B_HELIPORT, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
{WWT_NODISTXTBTN, 14, 2, 145, 39, 50, STR_305AA_LARGE, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT}, {WWT_NODISTXTBTN, RESIZE_NONE, 14, 2, 145, 39, 50, STR_305AA_LARGE, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
{WWT_NODISTXTBTN, 14, 2, 145, 51, 62, STR_305AB_LARGE, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT}, {WWT_NODISTXTBTN, RESIZE_NONE, 14, 2, 145, 51, 62, STR_305AB_LARGE, STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT},
{ WWT_CLOSEBOX, 14, 14, 73, 88, 98, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 14, 73, 88, 98, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE},
{ WWT_CLOSEBOX, 14, 74, 133, 88, 98, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 74, 133, 88, 98, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -77,10 +77,10 @@ static void BuildBridgeWndProc(Window *w, WindowEvent *e)
} }
static const Widget _build_bridge_widgets[] = { static const Widget _build_bridge_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 199, 0, 13, STR_100D_SELECT_RAIL_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 199, 0, 13, STR_100D_SELECT_RAIL_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_MATRIX, 7, 0, 188, 14, 101, 0x401, STR_101F_BRIDGE_SELECTION_CLICK}, { WWT_MATRIX, RESIZE_NONE, 7, 0, 188, 14, 101, 0x401, STR_101F_BRIDGE_SELECTION_CLICK},
{ WWT_SCROLLBAR, 7, 189, 199, 14, 101, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 7, 189, 199, 14, 101, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -94,10 +94,10 @@ static const WindowDesc _build_bridge_desc = {
static const Widget _build_road_bridge_widgets[] = { static const Widget _build_road_bridge_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 199, 0, 13, STR_1803_SELECT_ROAD_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 199, 0, 13, STR_1803_SELECT_ROAD_BRIDGE, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_MATRIX, 7, 0, 188, 14, 101, 0x401, STR_101F_BRIDGE_SELECTION_CLICK}, { WWT_MATRIX, RESIZE_NONE, 7, 0, 188, 14, 101, 0x401, STR_101F_BRIDGE_SELECTION_CLICK},
{ WWT_SCROLLBAR, 7, 189, 199, 14, 101, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 7, 189, 199, 14, 101, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -164,19 +164,19 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e)
} }
static const Widget _build_docks_toolb_widgets[] = { static const Widget _build_docks_toolb_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 145, 0, 13, STR_9801_DOCK_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 145, 0, 13, STR_9801_DOCK_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 7, 146, 157, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 7, 146, 157, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 7, 0, 21, 14, 35, SPR_OPENTTD_BASE+65, STR_BUILD_CANALS_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_OPENTTD_BASE+65, STR_BUILD_CANALS_TIP},
{ WWT_PANEL, 7, 22, 43, 14, 35, SPR_CANALS_BASE+69, STR_BUILD_LOCKS_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_CANALS_BASE+69, STR_BUILD_LOCKS_TIP},
{ WWT_PANEL, 7, 44, 47, 14, 35, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 44, 47, 14, 35, 0x0, STR_NULL},
{ WWT_PANEL, 7, 48, 69, 14, 35, 703, STR_018D_DEMOLISH_BUILDINGS_ETC}, { WWT_PANEL, RESIZE_NONE, 7, 48, 69, 14, 35, 703, STR_018D_DEMOLISH_BUILDINGS_ETC},
{ WWT_PANEL, 7, 70, 91, 14, 35, 748, STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING}, { WWT_PANEL, RESIZE_NONE, 7, 70, 91, 14, 35, 748, STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING},
{ WWT_PANEL, 7, 92, 113, 14, 35, 746, STR_981D_BUILD_SHIP_DOCK}, { WWT_PANEL, RESIZE_NONE, 7, 92, 113, 14, 35, 746, STR_981D_BUILD_SHIP_DOCK},
{ WWT_PANEL, 7, 114, 135, 14, 35, 693, STR_9834_POSITION_BUOY_WHICH_CAN}, { WWT_PANEL, RESIZE_NONE, 7, 114, 135, 14, 35, 693, STR_9834_POSITION_BUOY_WHICH_CAN},
{ WWT_PANEL, 7, 136, 157, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 136, 157, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -243,11 +243,11 @@ static void BuildDockStationWndProc(Window *w, WindowEvent *e)
} }
static const Widget _build_dock_station_widgets[] = { static const Widget _build_dock_station_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 147, 0, 13, STR_3068_DOCK, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 147, 0, 13, STR_3068_DOCK, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 147, 14, 74, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 147, 14, 74, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 14, 73, 30, 40, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 14, 73, 30, 40, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE},
{ WWT_CLOSEBOX, 14, 74, 133, 30, 40, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 74, 133, 30, 40, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -309,11 +309,11 @@ static void BuildDocksDepotWndProc(Window *w, WindowEvent *e)
} }
static const Widget _build_docks_depot_widgets[] = { static const Widget _build_docks_depot_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 203, 0, 13, STR_3800_SHIP_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 203, 0, 13, STR_3800_SHIP_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 203, 14, 85, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 203, 14, 85, 0x0, STR_NULL},
{ WWT_PANEL, 14, 3, 100, 17, 82, 0x0, STR_3803_SELECT_SHIP_DEPOT_ORIENTATION}, { WWT_PANEL, RESIZE_NONE, 14, 3, 100, 17, 82, 0x0, STR_3803_SELECT_SHIP_DEPOT_ORIENTATION},
{ WWT_PANEL, 14, 103, 200, 17, 82, 0x0, STR_3803_SELECT_SHIP_DEPOT_ORIENTATION}, { WWT_PANEL, RESIZE_NONE, 14, 103, 200, 17, 82, 0x0, STR_3803_SELECT_SHIP_DEPOT_ORIENTATION},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -36,11 +36,11 @@ StringID GetEngineCategoryName(byte engine)
} }
static const Widget _engine_preview_widgets[] = { static const Widget _engine_preview_widgets[] = {
{ WWT_TEXTBTN, 5, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 5, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 5, 11, 299, 0, 13, STR_8100_MESSAGE_FROM_VEHICLE_MANUFACTURE, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 5, 11, 299, 0, 13, STR_8100_MESSAGE_FROM_VEHICLE_MANUFACTURE, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 5, 0, 299, 14, 191, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 5, 0, 299, 14, 191, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 5, 85, 144, 172, 183, STR_00C9_NO, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 5, 85, 144, 172, 183, STR_00C9_NO, STR_NULL},
{ WWT_PUSHTXTBTN, 5, 155, 214, 172, 183, STR_00C8_YES, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 5, 155, 214, 172, 183, STR_00C8_YES, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -250,17 +250,17 @@ static void GraphLegendWndProc(Window *w, WindowEvent *e)
} }
static const Widget _graph_legend_widgets[] = { static const Widget _graph_legend_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 249, 0, 13, STR_704E_KEY_TO_COMPANY_GRAPHS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 249, 0, 13, STR_704E_KEY_TO_COMPANY_GRAPHS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 249, 14, 113, 0x0,STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 249, 14, 113, 0x0,STR_NULL},
{ WWT_IMGBTN, 14, 2, 247, 16, 27, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 247, 16, 27, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 2, 247, 28, 39, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 247, 28, 39, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 2, 247, 40, 51, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 247, 40, 51, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 2, 247, 52, 63, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 247, 52, 63, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 2, 247, 64, 75, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 247, 64, 75, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 2, 247, 76, 87, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 247, 76, 87, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 2, 247, 88, 99, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 247, 88, 99, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 2, 247, 100, 111, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 247, 100, 111, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -357,10 +357,10 @@ static void OperatingProfitWndProc(Window *w, WindowEvent *e)
} }
static const Widget _operating_profit_widgets[] = { static const Widget _operating_profit_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 525, 0, 13, STR_7025_OPERATING_PROFIT_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 525, 0, 13, STR_7025_OPERATING_PROFIT_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS},
{ WWT_IMGBTN, 14, 0, 575, 14, 173, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 575, 14, 173, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -433,10 +433,10 @@ static void IncomeGraphWndProc(Window *w, WindowEvent *e)
} }
static const Widget _income_graph_widgets[] = { static const Widget _income_graph_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 525, 0, 13, STR_7022_INCOME_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 525, 0, 13, STR_7022_INCOME_GRAPH, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS},
{ WWT_IMGBTN, 14, 0, 575, 14, 141, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 575, 14, 141, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -507,10 +507,10 @@ static void DeliveredCargoGraphWndProc(Window *w, WindowEvent *e)
} }
static const Widget _delivered_cargo_graph_widgets[] = { static const Widget _delivered_cargo_graph_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 525, 0, 13, STR_7050_UNITS_OF_CARGO_DELIVERED, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 525, 0, 13, STR_7050_UNITS_OF_CARGO_DELIVERED, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS},
{ WWT_IMGBTN, 14, 0, 575, 14, 141, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 575, 14, 141, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -711,29 +711,29 @@ static void PerformanceRatingDetailWndProc(Window *w, WindowEvent *e)
} }
static const Widget _performance_rating_detail_widgets[] = { static const Widget _performance_rating_detail_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 298, 0, 13, STR_PERFORMANCE_DETAIL, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 298, 0, 13, STR_PERFORMANCE_DETAIL, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 298, 14, 27, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 14, 27, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 298, 28, 47, 0x0,STR_PERFORMANCE_DETAIL_VEHICLES_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 28, 47, 0x0,STR_PERFORMANCE_DETAIL_VEHICLES_TIP},
{ WWT_IMGBTN, 14, 0, 298, 48, 67, 0x0,STR_PERFORMANCE_DETAIL_STATIONS_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 48, 67, 0x0,STR_PERFORMANCE_DETAIL_STATIONS_TIP},
{ WWT_IMGBTN, 14, 0, 298, 68, 87, 0x0,STR_PERFORMANCE_DETAIL_MIN_PROFIT_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 68, 87, 0x0,STR_PERFORMANCE_DETAIL_MIN_PROFIT_TIP},
{ WWT_IMGBTN, 14, 0, 298, 88, 107, 0x0,STR_PERFORMANCE_DETAIL_MIN_INCOME_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 88, 107, 0x0,STR_PERFORMANCE_DETAIL_MIN_INCOME_TIP},
{ WWT_IMGBTN, 14, 0, 298, 108, 127, 0x0,STR_PERFORMANCE_DETAIL_MAX_INCOME_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 108, 127, 0x0,STR_PERFORMANCE_DETAIL_MAX_INCOME_TIP},
{ WWT_IMGBTN, 14, 0, 298, 128, 147, 0x0,STR_PERFORMANCE_DETAIL_DELIVERED_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 128, 147, 0x0,STR_PERFORMANCE_DETAIL_DELIVERED_TIP},
{ WWT_IMGBTN, 14, 0, 298, 148, 167, 0x0,STR_PERFORMANCE_DETAIL_CARGO_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 148, 167, 0x0,STR_PERFORMANCE_DETAIL_CARGO_TIP},
{ WWT_IMGBTN, 14, 0, 298, 168, 187, 0x0,STR_PERFORMANCE_DETAIL_MONEY_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 168, 187, 0x0,STR_PERFORMANCE_DETAIL_MONEY_TIP},
{ WWT_IMGBTN, 14, 0, 298, 188, 207, 0x0,STR_PERFORMANCE_DETAIL_LOAN_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 188, 207, 0x0,STR_PERFORMANCE_DETAIL_LOAN_TIP},
{ WWT_IMGBTN, 14, 0, 298, 208, 227, 0x0,STR_PERFORMANCE_DETAIL_TOTAL_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 298, 208, 227, 0x0,STR_PERFORMANCE_DETAIL_TOTAL_TIP},
{ WWT_IMGBTN, 14, 2, 38, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 38, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 39, 75, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 39, 75, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 76, 112, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 76, 112, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 113, 149, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 113, 149, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 150, 186, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 150, 186, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 187, 223, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 187, 223, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 224, 260, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 224, 260, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WWT_IMGBTN, 14, 261, 297, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY}, { WWT_IMGBTN, RESIZE_NONE, 14, 261, 297, 14, 26, 0x0,STR_704F_CLICK_HERE_TO_TOGGLE_COMPANY},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -802,11 +802,11 @@ static void PerformanceHistoryWndProc(Window *w, WindowEvent *e)
} }
static const Widget _performance_history_widgets[] = { static const Widget _performance_history_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 475, 0, 13, STR_7051_COMPANY_PERFORMANCE_RATINGS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 475, 0, 13, STR_7051_COMPANY_PERFORMANCE_RATINGS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS},
{ WWT_PUSHTXTBTN, 14, 476, 525, 0, 13, STR_PERFORMANCE_DETAIL_KEY, STR_704D_SHOW_KEY_TO_GRAPHS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 476, 525, 0, 13, STR_PERFORMANCE_DETAIL_KEY, STR_704D_SHOW_KEY_TO_GRAPHS},
{ WWT_IMGBTN, 14, 0, 575, 14, 237, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 575, 14, 237, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -878,10 +878,10 @@ static void CompanyValueGraphWndProc(Window *w, WindowEvent *e)
} }
static const Widget _company_value_graph_widgets[] = { static const Widget _company_value_graph_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 525, 0, 13, STR_7052_COMPANY_VALUES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 525, 0, 13, STR_7052_COMPANY_VALUES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 526, 575, 0, 13, STR_704C_KEY, STR_704D_SHOW_KEY_TO_GRAPHS},
{ WWT_IMGBTN, 14, 0, 575, 14, 237, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 575, 14, 237, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -971,21 +971,21 @@ static void CargoPaymentRatesWndProc(Window *w, WindowEvent *e)
} }
static const Widget _cargo_payment_rates_widgets[] = { static const Widget _cargo_payment_rates_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 567, 0, 13, STR_7061_CARGO_PAYMENT_RATES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 567, 0, 13, STR_7061_CARGO_PAYMENT_RATES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 14, 0, 567, 14, 141, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 567, 14, 141, 0x0, STR_NULL},
{ WWT_PANEL, 12, 493, 562, 24, 31, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 24, 31, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 32, 39, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 32, 39, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 40, 47, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 40, 47, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 48, 55, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 48, 55, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 56, 63, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 56, 63, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 64, 71, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 64, 71, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 72, 79, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 72, 79, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 80, 87, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 80, 87, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 88, 95, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 88, 95, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 96, 103, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 96, 103, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 104, 111, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 104, 111, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WWT_PANEL, 12, 493, 562, 112, 119, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO}, { WWT_PANEL, RESIZE_NONE, 12, 493, 562, 112, 119, 0x0, STR_7064_TOGGLE_GRAPH_FOR_CARGO},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1084,9 +1084,9 @@ static void CompanyLeagueWndProc(Window *w, WindowEvent *e)
static const Widget _company_league_widgets[] = { static const Widget _company_league_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 399, 0, 13, STR_7053_COMPANY_LEAGUE_TABLE, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 399, 0, 13, STR_7053_COMPANY_LEAGUE_TABLE, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 399, 14, 96, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 399, 14, 96, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -53,130 +53,130 @@ static void BuildIndustryWndProc(Window *w, WindowEvent *e)
} }
static const Widget _build_industry_land0_widgets[] = { static const Widget _build_industry_land0_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 169, 14, 115, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 115, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
{ WWT_CLOSEBOX, 14, 2, 167, 29, 40, STR_0242_SAWMILL, STR_0264_CONSTRUCT_SAWMILL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 29, 40, STR_0242_SAWMILL, STR_0264_CONSTRUCT_SAWMILL},
{ WWT_CLOSEBOX, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
{ WWT_CLOSEBOX, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
{ WWT_CLOSEBOX, 14, 2, 167, 68, 79, STR_0247_STEEL_MILL, STR_0269_CONSTRUCT_STEEL_MILL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0247_STEEL_MILL, STR_0269_CONSTRUCT_STEEL_MILL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _build_industry_land1_widgets[] = { static const Widget _build_industry_land1_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 169, 14, 115, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 115, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
{ WWT_CLOSEBOX, 14, 2, 167, 29, 40, STR_024C_PAPER_MILL, STR_026E_CONSTRUCT_PAPER_MILL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 29, 40, STR_024C_PAPER_MILL, STR_026E_CONSTRUCT_PAPER_MILL},
{ WWT_CLOSEBOX, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
{ WWT_CLOSEBOX, 14, 2, 167, 55, 66, STR_024D_FOOD_PROCESSING_PLANT,STR_026F_CONSTRUCT_FOOD_PROCESSING}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 55, 66, STR_024D_FOOD_PROCESSING_PLANT,STR_026F_CONSTRUCT_FOOD_PROCESSING},
{ WWT_CLOSEBOX, 14, 2, 167, 68, 79, STR_024E_PRINTING_WORKS, STR_0270_CONSTRUCT_PRINTING_WORKS}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 68, 79, STR_024E_PRINTING_WORKS, STR_0270_CONSTRUCT_PRINTING_WORKS},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _build_industry_land2_widgets[] = { static const Widget _build_industry_land2_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 169, 14, 115, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 115, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 2, 167, 16, 27, STR_0250_LUMBER_MILL, STR_0273_CONSTRUCT_LUMBER_MILL_TO}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0250_LUMBER_MILL, STR_0273_CONSTRUCT_LUMBER_MILL_TO},
{ WWT_CLOSEBOX, 14, 2, 167, 29, 40, STR_024D_FOOD_PROCESSING_PLANT,STR_026F_CONSTRUCT_FOOD_PROCESSING}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 29, 40, STR_024D_FOOD_PROCESSING_PLANT,STR_026F_CONSTRUCT_FOOD_PROCESSING},
{ WWT_CLOSEBOX, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
{ WWT_CLOSEBOX, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
{ WWT_CLOSEBOX, 14, 2, 167, 68, 79, STR_0254_WATER_TOWER, STR_0277_CONSTRUCT_WATER_TOWER_CAN}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0254_WATER_TOWER, STR_0277_CONSTRUCT_WATER_TOWER_CAN},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _build_industry_land3_widgets[] = { static const Widget _build_industry_land3_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 169, 14, 115, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 115, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 2, 167, 16, 27, STR_0258_CANDY_FACTORY, STR_027B_CONSTRUCT_CANDY_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0258_CANDY_FACTORY, STR_027B_CONSTRUCT_CANDY_FACTORY},
{ WWT_CLOSEBOX, 14, 2, 167, 29, 40, STR_025B_TOY_SHOP, STR_027E_CONSTRUCT_TOY_SHOP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 29, 40, STR_025B_TOY_SHOP, STR_027E_CONSTRUCT_TOY_SHOP},
{ WWT_CLOSEBOX, 14, 2, 167, 42, 53, STR_025C_TOY_FACTORY, STR_027F_CONSTRUCT_TOY_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 42, 53, STR_025C_TOY_FACTORY, STR_027F_CONSTRUCT_TOY_FACTORY},
{ WWT_CLOSEBOX, 14, 2, 167, 55, 66, STR_025E_FIZZY_DRINK_FACTORY, STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 55, 66, STR_025E_FIZZY_DRINK_FACTORY, STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _build_industry_land0_widgets_extra[] = { static const Widget _build_industry_land0_widgets_extra[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY,STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 169, 14, 187, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 187, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 2, 167, 16, 27, STR_0241_POWER_STATION,STR_0263_CONSTRUCT_POWER_STATION}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0241_POWER_STATION,STR_0263_CONSTRUCT_POWER_STATION},
{ WWT_CLOSEBOX, 14, 2, 167, 29, 40, STR_0242_SAWMILL, STR_0264_CONSTRUCT_SAWMILL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 29, 40, STR_0242_SAWMILL, STR_0264_CONSTRUCT_SAWMILL},
{ WWT_CLOSEBOX, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
{ WWT_CLOSEBOX, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
{ WWT_CLOSEBOX, 14, 2, 167, 68, 79, STR_0247_STEEL_MILL, STR_0269_CONSTRUCT_STEEL_MILL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0247_STEEL_MILL, STR_0269_CONSTRUCT_STEEL_MILL},
{ WWT_CLOSEBOX, 14, 2, 167, 84, 95, STR_0240_COAL_MINE, STR_CONSTRUCT_COAL_MINE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 84, 95, STR_0240_COAL_MINE, STR_CONSTRUCT_COAL_MINE_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 97, 108, STR_0243_FOREST, STR_CONSTRUCT_FOREST_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 97, 108, STR_0243_FOREST, STR_CONSTRUCT_FOREST_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 110, 121, STR_0245_OIL_RIG, STR_CONSTRUCT_OIL_RIG_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 110, 121, STR_0245_OIL_RIG, STR_CONSTRUCT_OIL_RIG_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 123, 134, STR_0248_FARM, STR_CONSTRUCT_FARM_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 123, 134, STR_0248_FARM, STR_CONSTRUCT_FARM_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 136, 147, STR_024A_OIL_WELLS, STR_CONSTRUCT_OIL_WELLS_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 136, 147, STR_024A_OIL_WELLS, STR_CONSTRUCT_OIL_WELLS_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 149, 160, STR_0249_IRON_ORE_MINE, STR_CONSTRUCT_IRON_ORE_MINE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 149, 160, STR_0249_IRON_ORE_MINE, STR_CONSTRUCT_IRON_ORE_MINE_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _build_industry_land1_widgets_extra[] = { static const Widget _build_industry_land1_widgets_extra[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 169, 14, 174, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 174, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
{ WWT_CLOSEBOX, 14, 2, 167, 29, 40, STR_024C_PAPER_MILL, STR_026E_CONSTRUCT_PAPER_MILL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 29, 40, STR_024C_PAPER_MILL, STR_026E_CONSTRUCT_PAPER_MILL},
{ WWT_CLOSEBOX, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
{ WWT_CLOSEBOX, 14, 2, 167, 55, 66, STR_024D_FOOD_PROCESSING_PLANT,STR_026F_CONSTRUCT_FOOD_PROCESSING}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 55, 66, STR_024D_FOOD_PROCESSING_PLANT,STR_026F_CONSTRUCT_FOOD_PROCESSING},
{ WWT_CLOSEBOX, 14, 2, 167, 68, 79, STR_024E_PRINTING_WORKS, STR_0270_CONSTRUCT_PRINTING_WORKS}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 68, 79, STR_024E_PRINTING_WORKS, STR_0270_CONSTRUCT_PRINTING_WORKS},
{ WWT_CLOSEBOX, 14, 2, 167, 81+3, 92+3, STR_0240_COAL_MINE, STR_CONSTRUCT_COAL_MINE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 81+3, 92+3, STR_0240_COAL_MINE, STR_CONSTRUCT_COAL_MINE_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 94+3, 105+3, STR_0243_FOREST, STR_CONSTRUCT_FOREST_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 94+3, 105+3, STR_0243_FOREST, STR_CONSTRUCT_FOREST_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 107+3, 118+3, STR_0248_FARM, STR_CONSTRUCT_FARM_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 107+3, 118+3, STR_0248_FARM, STR_CONSTRUCT_FARM_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 120+3, 131+3, STR_024A_OIL_WELLS, STR_CONSTRUCT_OIL_WELLS_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 120+3, 131+3, STR_024A_OIL_WELLS, STR_CONSTRUCT_OIL_WELLS_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 133+3, 144+3, STR_024F_GOLD_MINE, STR_CONSTRUCT_GOLD_MINE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 133+3, 144+3, STR_024F_GOLD_MINE, STR_CONSTRUCT_GOLD_MINE_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _build_industry_land2_widgets_extra[] = { static const Widget _build_industry_land2_widgets_extra[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 169, 14, 200, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 200, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 2, 167, 16, 27, STR_0250_LUMBER_MILL, STR_0273_CONSTRUCT_LUMBER_MILL_TO}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0250_LUMBER_MILL, STR_0273_CONSTRUCT_LUMBER_MILL_TO},
{ WWT_CLOSEBOX, 14, 2, 167, 29, 40, STR_024D_FOOD_PROCESSING_PLANT,STR_026F_CONSTRUCT_FOOD_PROCESSING}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 29, 40, STR_024D_FOOD_PROCESSING_PLANT,STR_026F_CONSTRUCT_FOOD_PROCESSING},
{ WWT_CLOSEBOX, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
{ WWT_CLOSEBOX, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
{ WWT_CLOSEBOX, 14, 2, 167, 68, 79, STR_0254_WATER_TOWER, STR_0277_CONSTRUCT_WATER_TOWER_CAN}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0254_WATER_TOWER, STR_0277_CONSTRUCT_WATER_TOWER_CAN},
{ WWT_CLOSEBOX, 14, 2, 167, 81+3, 92+3, STR_024A_OIL_WELLS,STR_CONSTRUCT_OIL_WELLS_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 81+3, 92+3, STR_024A_OIL_WELLS,STR_CONSTRUCT_OIL_WELLS_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 94+3, 105+3, STR_0255_DIAMOND_MINE, STR_CONSTRUCT_DIAMOND_MINE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 94+3, 105+3, STR_0255_DIAMOND_MINE, STR_CONSTRUCT_DIAMOND_MINE_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 107+3, 118+3, STR_0256_COPPER_ORE_MINE, STR_CONSTRUCT_COPPER_ORE_MINE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 107+3, 118+3, STR_0256_COPPER_ORE_MINE, STR_CONSTRUCT_COPPER_ORE_MINE_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 120+3, 131+3, STR_0248_FARM, STR_CONSTRUCT_FARM_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 120+3, 131+3, STR_0248_FARM, STR_CONSTRUCT_FARM_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 133+3, 144+3, STR_0251_FRUIT_PLANTATION, STR_CONSTRUCT_FRUIT_PLANTATION_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 133+3, 144+3, STR_0251_FRUIT_PLANTATION, STR_CONSTRUCT_FRUIT_PLANTATION_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 146+3, 157+3, STR_0252_RUBBER_PLANTATION,STR_CONSTRUCT_RUBBER_PLANTATION_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 146+3, 157+3, STR_0252_RUBBER_PLANTATION,STR_CONSTRUCT_RUBBER_PLANTATION_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 159+3, 170+3, STR_0253_WATER_SUPPLY, STR_CONSTRUCT_WATER_SUPPLY_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 159+3, 170+3, STR_0253_WATER_SUPPLY, STR_CONSTRUCT_WATER_SUPPLY_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _build_industry_land3_widgets_extra[] = { static const Widget _build_industry_land3_widgets_extra[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 169, 14, 187, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 169, 14, 187, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 2, 167, 16, 27, STR_0258_CANDY_FACTORY, STR_027B_CONSTRUCT_CANDY_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 16, 27, STR_0258_CANDY_FACTORY, STR_027B_CONSTRUCT_CANDY_FACTORY},
{ WWT_CLOSEBOX, 14, 2, 167, 29, 40, STR_025B_TOY_SHOP, STR_027E_CONSTRUCT_TOY_SHOP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 29, 40, STR_025B_TOY_SHOP, STR_027E_CONSTRUCT_TOY_SHOP},
{ WWT_CLOSEBOX, 14, 2, 167, 42, 53, STR_025C_TOY_FACTORY, STR_027F_CONSTRUCT_TOY_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 42, 53, STR_025C_TOY_FACTORY, STR_027F_CONSTRUCT_TOY_FACTORY},
{ WWT_CLOSEBOX, 14, 2, 167, 55, 66, STR_025E_FIZZY_DRINK_FACTORY, STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 55, 66, STR_025E_FIZZY_DRINK_FACTORY, STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY},
{ WWT_CLOSEBOX, 14, 2, 167, 68+3, 79+3, STR_0257_COTTON_CANDY_FOREST,STR_CONSTRUCT_COTTON_CANDY_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 68+3, 79+3, STR_0257_COTTON_CANDY_FOREST,STR_CONSTRUCT_COTTON_CANDY_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 81+3, 92+3, STR_0259_BATTERY_FARM, STR_CONSTRUCT_BATTERY_FARM_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 81+3, 92+3, STR_0259_BATTERY_FARM, STR_CONSTRUCT_BATTERY_FARM_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 94+3, 105+3, STR_025A_COLA_WELLS, STR_CONSTRUCT_COLA_WELLS_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 94+3, 105+3, STR_025A_COLA_WELLS, STR_CONSTRUCT_COLA_WELLS_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 107+3, 118+3, STR_025D_PLASTIC_FOUNTAINS,STR_CONSTRUCT_PLASTIC_FOUNTAINS_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 107+3, 118+3, STR_025D_PLASTIC_FOUNTAINS,STR_CONSTRUCT_PLASTIC_FOUNTAINS_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 120+3, 131+3, STR_025F_BUBBLE_GENERATOR, STR_CONSTRUCT_BUBBLE_GENERATOR_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 120+3, 131+3, STR_025F_BUBBLE_GENERATOR, STR_CONSTRUCT_BUBBLE_GENERATOR_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 133+3, 144+3, STR_0260_TOFFEE_QUARRY, STR_CONSTRUCT_TOFFEE_QUARRY_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 133+3, 144+3, STR_0260_TOFFEE_QUARRY, STR_CONSTRUCT_TOFFEE_QUARRY_TIP},
{ WWT_CLOSEBOX, 14, 2, 167, 146+3, 157+3, STR_0261_SUGAR_MINE, STR_CONSTRUCT_SUGAR_MINE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 167, 146+3, 157+3, STR_0261_SUGAR_MINE, STR_CONSTRUCT_SUGAR_MINE_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -336,16 +336,16 @@ static void IndustryViewWndProc(Window *w, WindowEvent *e)
} }
static const Widget _industry_view_widgets[] = { static const Widget _industry_view_widgets[] = {
{ WWT_TEXTBTN, 9, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 9, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 9, 11, 247, 0, 13, STR_4801, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 9, 11, 247, 0, 13, STR_4801, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 9, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 9, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 9, 0, 259, 14, 105, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 9, 0, 259, 14, 105, 0x0, STR_NULL},
{ WWT_6, 9, 2, 257, 16, 103, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, 9, 2, 257, 16, 103, 0x0, STR_NULL},
{ WWT_IMGBTN, 9, 0, 259, 106, 147, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 9, 0, 259, 106, 147, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 9, 0, 129, 148, 159, STR_00E4_LOCATION, STR_482C_CENTER_THE_MAIN_VIEW_ON}, { WWT_PUSHTXTBTN, RESIZE_NONE, 9, 0, 129, 148, 159, STR_00E4_LOCATION, STR_482C_CENTER_THE_MAIN_VIEW_ON},
{ WWT_IMGBTN, 9, 130, 259, 148, 159, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 9, 130, 259, 148, 159, 0x0, STR_NULL},
// Destroy Industry button costing money removed per request of dominik // Destroy Industry button costing money removed per request of dominik
//{ WWT_PUSHTXTBTN, 9, 130, 259, 148, 159, STR_INDUSTRYDIR_DESTROY, STR_482C_DESTROY_INDUSTRY}, //{ WWT_PUSHTXTBTN, RESIZE_NONE, 9, 130, 259, 148, 159, STR_INDUSTRYDIR_DESTROY, STR_482C_DESTROY_INDUSTRY},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -371,16 +371,17 @@ void ShowIndustryViewWindow(int industry)
} }
static const Widget _industry_directory_widgets[] = { static const Widget _industry_directory_widgets[] = {
{ WWT_TEXTBTN, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 495, 0, 13, STR_INDUSTRYDIR_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 13, 11, 495, 0, 13, STR_INDUSTRYDIR_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 13, 496, 507, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 13, 496, 507, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PUSHTXTBTN, 13, 0, 100, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 0, 100, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 13, 101, 200, 14, 25, STR_SORT_BY_TYPE, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 101, 200, 14, 25, STR_SORT_BY_TYPE, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 13, 201, 300, 14, 25, STR_SORT_BY_PRODUCTION, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 201, 300, 14, 25, STR_SORT_BY_PRODUCTION, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 13, 301, 400, 14, 25, STR_SORT_BY_TRANSPORTED, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 301, 400, 14, 25, STR_SORT_BY_TRANSPORTED, STR_SORT_ORDER_TIP},
{ WWT_PANEL, 13, 401, 496, 14, 25, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 13, 401, 496, 14, 25, 0x0, STR_NULL},
{ WWT_IMGBTN, 13, 0, 496, 26, 189, 0x0, STR_200A_TOWN_NAMES_CLICK_ON_NAME}, { WWT_IMGBTN, RESIZE_BOTTOM, 13, 0, 496, 26, 189, 0x0, STR_200A_TOWN_NAMES_CLICK_ON_NAME},
{ WWT_SCROLLBAR, 13, 497, 507, 14, 189, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_BOTTOM, 13, 497, 507, 14, 177, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_RESIZEBOX, RESIZE_TB, 13, 497, 507, 178, 189, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -517,7 +518,7 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e)
DrawString(4, 28+n*10, STR_INDUSTRYDIR_ITEM_NOPROD, 0); DrawString(4, 28+n*10, STR_INDUSTRYDIR_ITEM_NOPROD, 0);
} }
p++; p++;
if (++n == 16) if (++n == w->vscroll.cap)
break; break;
} }
} break; } break;
@ -553,7 +554,7 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e)
uint16 p; uint16 p;
Industry *c; Industry *c;
if (!IS_INT_INSIDE(y, 0, 16)) if (!IS_INT_INSIDE(y, 0, w->vscroll.cap))
return; return;
p = y + w->vscroll.pos; p = y + w->vscroll.pos;
if (p < _num_industry_sort) { if (p < _num_industry_sort) {
@ -567,6 +568,10 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e)
case WE_4: case WE_4:
SetWindowDirty(w); SetWindowDirty(w);
break; break;
case WE_RESIZE:
w->vscroll.cap += e->sizing.diff.y / 10;
break;
} }
} }
@ -575,7 +580,7 @@ static void IndustryDirectoryWndProc(Window *w, WindowEvent *e)
static const WindowDesc _industry_directory_desc = { static const WindowDesc _industry_directory_desc = {
-1, -1, 508, 190, -1, -1, 508, 190,
WC_INDUSTRY_DIRECTORY,0, WC_INDUSTRY_DIRECTORY,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_industry_directory_widgets, _industry_directory_widgets,
IndustryDirectoryWndProc IndustryDirectoryWndProc
}; };
@ -590,6 +595,8 @@ void ShowIndustryDirectory()
w = AllocateWindowDescFront(&_industry_directory_desc, 0); w = AllocateWindowDescFront(&_industry_directory_desc, 0);
if (w) { if (w) {
w->vscroll.cap = 16; w->vscroll.cap = 16;
w->resize.height = w->height - 6 * 10; // minimum 10 items
w->resize.step_height = 10;
SetWindowDirty(w); SetWindowDirty(w);
} }
} }

View File

@ -19,23 +19,23 @@ static void ShowSelectTutorialWindow()
*/ */
static const Widget _select_game_widgets[] = { static const Widget _select_game_widgets[] = {
{ WWT_CAPTION, 13, 0, 335, 0, 13, STR_0307_OPENTTD, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 13, 0, 335, 0, 13, STR_0307_OPENTTD, STR_NULL},
{ WWT_IMGBTN, 13, 0, 335, 14, 196, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 13, 0, 335, 14, 196, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 12, 10, 167, 22, 33, STR_0140_NEW_GAME, STR_02FB_START_A_NEW_GAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 10, 167, 22, 33, STR_0140_NEW_GAME, STR_02FB_START_A_NEW_GAME},
{ WWT_PUSHTXTBTN, 12, 168, 325, 22, 33, STR_0141_LOAD_GAME, STR_02FC_LOAD_A_SAVED_GAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325, 22, 33, STR_0141_LOAD_GAME, STR_02FC_LOAD_A_SAVED_GAME},
//{ WWT_PUSHTXTBTN, 12, 10, 167, 177, 188, STR_0142_TUTORIAL_DEMONSTRATION, STR_02FD_VIEW_DEMONSTRATIONS_TUTORIALS}, //{ WWT_PUSHTXTBTN, RESIZE_NONE, 12, 10, 167, 177, 188, STR_0142_TUTORIAL_DEMONSTRATION, STR_02FD_VIEW_DEMONSTRATIONS_TUTORIALS},
{ WWT_PUSHTXTBTN, 12, 10, 167, 177, 188, STR_CONFIG_PATCHES, STR_CONFIG_PATCHES_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 10, 167, 177, 188, STR_CONFIG_PATCHES, STR_CONFIG_PATCHES_TIP},
{ WWT_PUSHTXTBTN, 12, 10, 167, 40, 51, STR_0220_CREATE_SCENARIO,STR_02FE_CREATE_A_CUSTOMIZED_GAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 10, 167, 40, 51, STR_0220_CREATE_SCENARIO,STR_02FE_CREATE_A_CUSTOMIZED_GAME},
{ WWT_PUSHTXTBTN, 12, 10, 167, 136, 147, STR_SINGLE_PLAYER, STR_02FF_SELECT_SINGLE_PLAYER_GAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 10, 167, 136, 147, STR_SINGLE_PLAYER, STR_02FF_SELECT_SINGLE_PLAYER_GAME},
{ WWT_PUSHTXTBTN, 12, 168, 325, 136, 147, STR_MULTIPLAYER, STR_0300_SELECT_MULTIPLAYER_GAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325, 136, 147, STR_MULTIPLAYER, STR_0300_SELECT_MULTIPLAYER_GAME},
{ WWT_PUSHTXTBTN, 12, 10, 167, 159, 170, STR_0148_GAME_OPTIONS, STR_0301_DISPLAY_GAME_OPTIONS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 10, 167, 159, 170, STR_0148_GAME_OPTIONS, STR_0301_DISPLAY_GAME_OPTIONS},
{ WWT_PUSHTXTBTN, 12, 168, 325, 159, 170, STR_01FE_DIFFICULTY, STR_0302_DISPLAY_DIFFICULTY_OPTIONS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325, 159, 170, STR_01FE_DIFFICULTY, STR_0302_DISPLAY_DIFFICULTY_OPTIONS},
{ WWT_PUSHTXTBTN, 12, 168, 325, 40, 51, STR_029A_PLAY_SCENARIO, STR_0303_START_A_NEW_GAME_USING}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325, 40, 51, STR_029A_PLAY_SCENARIO, STR_0303_START_A_NEW_GAME_USING},
{ WWT_PUSHTXTBTN, 12, 168, 325, 177, 188, STR_0304_QUIT, STR_0305_QUIT_OPENTTD}, { WWT_PUSHTXTBTN, RESIZE_NONE, 12, 168, 325, 177, 188, STR_0304_QUIT, STR_0305_QUIT_OPENTTD},
{ WWT_PANEL_2, 12, 10, 85, 69, 122, 0x1312, STR_030E_SELECT_TEMPERATE_LANDSCAPE}, { WWT_PANEL_2, RESIZE_NONE, 12, 10, 85, 69, 122, 0x1312, STR_030E_SELECT_TEMPERATE_LANDSCAPE},
{ WWT_PANEL_2, 12, 90, 165, 69, 122, 0x1314, STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE}, { WWT_PANEL_2, RESIZE_NONE, 12, 90, 165, 69, 122, 0x1314, STR_030F_SELECT_SUB_ARCTIC_LANDSCAPE},
{ WWT_PANEL_2, 12, 170, 245, 69, 122, 0x1316, STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE}, { WWT_PANEL_2, RESIZE_NONE, 12, 170, 245, 69, 122, 0x1316, STR_0310_SELECT_SUB_TROPICAL_LANDSCAPE},
{ WWT_PANEL_2, 12, 250, 325, 69, 122, 0x1318, STR_0311_SELECT_TOYLAND_LANDSCAPE}, { WWT_PANEL_2, RESIZE_NONE, 12, 250, 325, 69, 122, 0x1318, STR_0311_SELECT_TOYLAND_LANDSCAPE},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -177,11 +177,11 @@ int32 CmdStartScenario(int x, int y, uint32 flags, uint32 p1, uint32 p2)
static const Widget _ask_abandon_game_widgets[] = { static const Widget _ask_abandon_game_widgets[] = {
{ WWT_TEXTBTN, 4, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 4, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 4, 11, 179, 0, 13, STR_00C7_QUIT, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 4, 11, 179, 0, 13, STR_00C7_QUIT, STR_NULL},
{ WWT_IMGBTN, 4, 0, 179, 14, 91, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 4, 0, 179, 14, 91, 0x0, STR_NULL},
{ WWT_TEXTBTN, 12, 25, 84, 72, 83, STR_00C9_NO, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 12, 25, 84, 72, 83, STR_00C9_NO, STR_NULL},
{ WWT_TEXTBTN, 12, 95, 154, 72, 83, STR_00C8_YES, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 12, 95, 154, 72, 83, STR_00C8_YES, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -197,7 +197,7 @@ static void AskAbandonGameWndProc(Window *w, WindowEvent *e) {
SetDParam(0, STR_OSNAME_BEOS); SetDParam(0, STR_OSNAME_BEOS);
#elif defined(__MORPHOS__) #elif defined(__MORPHOS__)
SetDParam(0, STR_OSNAME_MORPHOS); SetDParam(0, STR_OSNAME_MORPHOS);
#elif defined(__AMIGA__) #elif defined(__AMIGA__)
SetDParam(0, STR_OSNAME_AMIGAOS); SetDParam(0, STR_OSNAME_AMIGAOS);
#elif defined(__OS2__) #elif defined(__OS2__)
SetDParam(0, STR_OSNAME_OS2); SetDParam(0, STR_OSNAME_OS2);
@ -239,11 +239,11 @@ void AskExitGame()
static const Widget _ask_quit_game_widgets[] = { static const Widget _ask_quit_game_widgets[] = {
{ WWT_TEXTBTN, 4, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 4, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 4, 11, 179, 0, 13, STR_0161_QUIT_GAME, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 4, 11, 179, 0, 13, STR_0161_QUIT_GAME, STR_NULL},
{ WWT_IMGBTN, 4, 0, 179, 14, 91, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 4, 0, 179, 14, 91, 0x0, STR_NULL},
{ WWT_TEXTBTN, 12, 25, 84, 72, 83, STR_00C9_NO, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 12, 25, 84, 72, 83, STR_00C9_NO, STR_NULL},
{ WWT_TEXTBTN, 12, 95, 154, 72, 83, STR_00C8_YES, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 12, 95, 154, 72, 83, STR_00C8_YES, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -416,6 +416,7 @@ STR_018A_CAN_T_CHANGE_SERVICING :{WHITE}Can't change servicing interval...
STR_018B_CLOSE_WINDOW :{BLACK}Close window STR_018B_CLOSE_WINDOW :{BLACK}Close window
STR_018C_WINDOW_TITLE_DRAG_THIS :{BLACK}Window title - drag this to move window STR_018C_WINDOW_TITLE_DRAG_THIS :{BLACK}Window title - drag this to move window
STR_STICKY_BUTTON :{BLACK}Mark this window as uncloseable by the 'Close All Windows' key STR_STICKY_BUTTON :{BLACK}Mark this window as uncloseable by the 'Close All Windows' key
STR_RESIZE_BUTTON :{BLACK}Click and drag to resize this window
STR_018D_DEMOLISH_BUILDINGS_ETC :{BLACK}Demolish buildings etc. on a square of land STR_018D_DEMOLISH_BUILDINGS_ETC :{BLACK}Demolish buildings etc. on a square of land
STR_018E_LOWER_A_CORNER_OF_LAND :{BLACK}Lower a corner of land STR_018E_LOWER_A_CORNER_OF_LAND :{BLACK}Lower a corner of land
STR_018F_RAISE_A_CORNER_OF_LAND :{BLACK}Raise a corner of land STR_018F_RAISE_A_CORNER_OF_LAND :{BLACK}Raise a corner of land
@ -2774,9 +2775,9 @@ STR_REPLACE_HELP :{BLACK}This feature allows you to select an enginetype an
############ Lists rail types ############ Lists rail types
STR_RAIL_VEHICLES :{BLACK}Rail Vehicles STR_RAIL_VEHICLES :Rail Vehicles
STR_MONORAIL_VEHICLES :{BLACK}Monorail Vehicles STR_MONORAIL_VEHICLES :Monorail Vehicles
STR_MAGLEV_VEHICLES :{BLACK}Maglev Vehicles STR_MAGLEV_VEHICLES :Maglev Vehicles
############ End of list of rail types ############ End of list of rail types

View File

@ -551,14 +551,14 @@ static void MenuWndProc(Window *w, WindowEvent *e)
} }
} }
static Widget _menu_widgets[] = { static const Widget _menu_widgets[] = {
{ WWT_PANEL, 14, 0, 159, 0, 65535, 0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 159, 0, 65535, 0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static Widget _player_menu_widgets[] = { static const Widget _player_menu_widgets[] = {
{ WWT_PANEL, 14, 0, 240, 0, 81, 0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 240, 0, 81, 0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -599,7 +599,7 @@ static void UpdatePlayerMenuHeight(Window *w)
SetWindowDirty(w); SetWindowDirty(w);
num = num * 10 + 2; num = num * 10 + 2;
w->height = num; w->height = num;
_player_menu_widgets[0].bottom = _player_menu_widgets[0].top + num - 1; w->widget[0].bottom = w->widget[0].top + num - 1;
SetWindowDirty(w); SetWindowDirty(w);
} }
} }
@ -715,8 +715,6 @@ static void PlayerMenuWndProc(Window *w, WindowEvent *e)
static Window *PopupMainToolbMenu(Window *w, int x, int main_button, StringID base_string, int item_count) static Window *PopupMainToolbMenu(Window *w, int x, int main_button, StringID base_string, int item_count)
{ {
int h;
x += w->left; x += w->left;
SETBIT(w->click_state, (byte)main_button); SETBIT(w->click_state, (byte)main_button);
@ -724,8 +722,8 @@ static Window *PopupMainToolbMenu(Window *w, int x, int main_button, StringID ba
DeleteWindowById(WC_TOOLBAR_MENU, 0); DeleteWindowById(WC_TOOLBAR_MENU, 0);
_menu_widgets[0].bottom = h = item_count * 10 + 1; w = AllocateWindow(x, 0x16, 0xA0, item_count * 10 + 2, MenuWndProc, WC_TOOLBAR_MENU, _menu_widgets);
w = AllocateWindow(x, 0x16, 0xA0, h+1, MenuWndProc, WC_TOOLBAR_MENU, _menu_widgets); w->widget[0].bottom = item_count * 10 + 1;
w->flags4 &= ~WF_WHITE_BORDER_MASK; w->flags4 &= ~WF_WHITE_BORDER_MASK;
WP(w,menu_d).item_count = item_count; WP(w,menu_d).item_count = item_count;
@ -1086,11 +1084,11 @@ static void ResetLandscape()
} }
static const Widget _ask_reset_landscape_widgets[] = { static const Widget _ask_reset_landscape_widgets[] = {
{ WWT_TEXTBTN, 4, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 4, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 4, 11, 179, 0, 13, STR_022C_RESET_LANDSCAPE, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 4, 11, 179, 0, 13, STR_022C_RESET_LANDSCAPE, STR_NULL},
{ WWT_IMGBTN, 4, 0, 179, 14, 91, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 4, 0, 179, 14, 91, 0x0, STR_NULL},
{ WWT_TEXTBTN, 12, 25, 84, 72, 83, STR_00C9_NO, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 12, 25, 84, 72, 83, STR_00C9_NO, STR_NULL},
{ WWT_TEXTBTN, 12, 95, 154, 72, 83, STR_00C8_YES, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 12, 95, 154, 72, 83, STR_00C8_YES, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1242,21 +1240,21 @@ static void PlaceProc_Desert(uint tile)
} }
static const Widget _scen_edit_land_gen_widgets[] = { static const Widget _scen_edit_land_gen_widgets[] = {
{ WWT_TEXTBTN, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 153, 0, 13, STR_0223_LAND_GENERATION,STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 153, 0, 13, STR_0223_LAND_GENERATION,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 7, 0, 153, 14, 99, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 7, 0, 153, 14, 99, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 22, 43, 14, 35, 0x2B6, STR_018F_RAISE_A_CORNER_OF_LAND}, { WWT_IMGBTN, RESIZE_NONE, 14, 22, 43, 14, 35, 0x2B6, STR_018F_RAISE_A_CORNER_OF_LAND},
{ WWT_IMGBTN, 14, 44, 65, 14, 35, 0x2B7, STR_018E_LOWER_A_CORNER_OF_LAND}, { WWT_IMGBTN, RESIZE_NONE, 14, 44, 65, 14, 35, 0x2B7, STR_018E_LOWER_A_CORNER_OF_LAND},
{ WWT_IMGBTN, 14, 0, 21, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 21, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
{ WWT_TEXTBTN, 14, 125, 135, 43, 54, STR_0224, STR_0228_INCREASE_SIZE_OF_LAND_AREA}, { WWT_TEXTBTN, RESIZE_NONE, 14, 125, 135, 43, 54, STR_0224, STR_0228_INCREASE_SIZE_OF_LAND_AREA},
{ WWT_TEXTBTN, 14, 125, 135, 56, 67, STR_0225, STR_0229_DECREASE_SIZE_OF_LAND_AREA}, { WWT_TEXTBTN, RESIZE_NONE, 14, 125, 135, 56, 67, STR_0225, STR_0229_DECREASE_SIZE_OF_LAND_AREA},
{ WWT_TEXTBTN, 14, 20, 135, 75, 86, STR_0226_RANDOM_LAND, STR_022A_GENERATE_RANDOM_LAND}, { WWT_TEXTBTN, RESIZE_NONE, 14, 20, 135, 75, 86, STR_0226_RANDOM_LAND, STR_022A_GENERATE_RANDOM_LAND},
{ WWT_TEXTBTN, 14, 20, 135, 88, 99, STR_0227_RESET_LAND, STR_022B_RESET_LANDSCAPE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 20, 135, 88, 99, STR_0227_RESET_LAND, STR_022B_RESET_LANDSCAPE},
{ WWT_IMGBTN, 14, 88, 109, 14, 35, 0xFF4, STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE}, { WWT_IMGBTN, RESIZE_NONE, 14, 88, 109, 14, 35, 0xFF4, STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE},
{ WWT_IMGBTN, 14, 110, 131, 14, 35, 0xFF5, STR_028D_PLACE_LIGHTHOUSE}, { WWT_IMGBTN, RESIZE_NONE, 14, 110, 131, 14, 35, 0xFF5, STR_028D_PLACE_LIGHTHOUSE},
{ WWT_IMGBTN, 14, 132, 153, 14, 35, 0xFF6, STR_028E_PLACE_TRANSMITTER}, { WWT_IMGBTN, RESIZE_NONE, 14, 132, 153, 14, 35, 0xFF6, STR_028E_PLACE_TRANSMITTER},
{ WWT_IMGBTN, 14, 66, 87, 14, 35, SPR_OPENTTD_BASE+68, STR_LEVEL_LAND_TOOLTIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 66, 87, 14, 35, SPR_OPENTTD_BASE+68, STR_LEVEL_LAND_TOOLTIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1411,15 +1409,15 @@ static void PlaceProc_Town(uint tile)
static const Widget _scen_edit_town_gen_widgets[] = { static const Widget _scen_edit_town_gen_widgets[] = {
{ WWT_TEXTBTN, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 159, 0, 13, STR_0233_TOWN_GENERATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 159, 0, 13, STR_0233_TOWN_GENERATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 7, 0, 159, 14, 81, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 7, 0, 159, 14, 81, 0x0, STR_NULL},
{ WWT_TEXTBTN, 14, 2, 157, 16, 27, STR_0234_NEW_TOWN, STR_0235_CONSTRUCT_NEW_TOWN}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 157, 16, 27, STR_0234_NEW_TOWN, STR_0235_CONSTRUCT_NEW_TOWN},
{ WWT_TEXTBTN, 14, 2, 157, 29, 40, STR_023D_RANDOM_TOWN, STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 157, 29, 40, STR_023D_RANDOM_TOWN, STR_023E_BUILD_TOWN_IN_RANDOM_LOCATION},
{ WWT_TEXTBTN, 14, 2, 157, 42, 53, STR_MANY_RANDOM_TOWNS, STR_RANDOM_TOWNS_TIP}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 157, 42, 53, STR_MANY_RANDOM_TOWNS, STR_RANDOM_TOWNS_TIP},
{ WWT_TEXTBTN, 14, 2, 53, 68, 79, STR_02A1_SMALL, STR_02A4_SELECT_TOWN_SIZE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 53, 68, 79, STR_02A1_SMALL, STR_02A4_SELECT_TOWN_SIZE},
{ WWT_TEXTBTN, 14, 54, 105, 68, 79, STR_02A2_MEDIUM, STR_02A4_SELECT_TOWN_SIZE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 54, 105, 68, 79, STR_02A2_MEDIUM, STR_02A4_SELECT_TOWN_SIZE},
{ WWT_TEXTBTN, 14, 106, 157, 68, 79, STR_02A3_LARGE, STR_02A4_SELECT_TOWN_SIZE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 106, 157, 68, 79, STR_02A3_LARGE, STR_02A4_SELECT_TOWN_SIZE},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1496,90 +1494,90 @@ static void ToolbarScenGenTown(Window *w)
static const Widget _scenedit_industry_normal_widgets[] = { static const Widget _scenedit_industry_normal_widgets[] = {
{ WWT_TEXTBTN, 7, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL},
{ WWT_IMGBTN, 7, 0, 169, 14, 224, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 7, 0, 169, 14, 224, 0x0, STR_NULL},
{ WWT_TEXTBTN, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP},
{ WWT_TEXTBTN, 14, 2, 167, 42, 53, STR_0240_COAL_MINE, STR_0262_CONSTRUCT_COAL_MINE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0240_COAL_MINE, STR_0262_CONSTRUCT_COAL_MINE},
{ WWT_TEXTBTN, 14, 2, 167, 55, 66, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
{ WWT_TEXTBTN, 14, 2, 167, 68, 79, STR_0242_SAWMILL, STR_0264_CONSTRUCT_SAWMILL}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0242_SAWMILL, STR_0264_CONSTRUCT_SAWMILL},
{ WWT_TEXTBTN, 14, 2, 167, 81, 92, STR_0243_FOREST, STR_0265_PLANT_FOREST}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 81, 92, STR_0243_FOREST, STR_0265_PLANT_FOREST},
{ WWT_TEXTBTN, 14, 2, 167, 94, 105, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 94, 105, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
{ WWT_TEXTBTN, 14, 2, 167, 107, 118, STR_0245_OIL_RIG, STR_0267_CONSTRUCT_OIL_RIG_CAN_ONLY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 107, 118, STR_0245_OIL_RIG, STR_0267_CONSTRUCT_OIL_RIG_CAN_ONLY},
{ WWT_TEXTBTN, 14, 2, 167, 120, 131, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 120, 131, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
{ WWT_TEXTBTN, 14, 2, 167, 133, 144, STR_0247_STEEL_MILL, STR_0269_CONSTRUCT_STEEL_MILL}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 133, 144, STR_0247_STEEL_MILL, STR_0269_CONSTRUCT_STEEL_MILL},
{ WWT_TEXTBTN, 14, 2, 167, 146, 157, STR_0248_FARM, STR_026A_CONSTRUCT_FARM}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 146, 157, STR_0248_FARM, STR_026A_CONSTRUCT_FARM},
{ WWT_TEXTBTN, 14, 2, 167, 159, 170, STR_0249_IRON_ORE_MINE, STR_026B_CONSTRUCT_IRON_ORE_MINE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 159, 170, STR_0249_IRON_ORE_MINE, STR_026B_CONSTRUCT_IRON_ORE_MINE},
{ WWT_TEXTBTN, 14, 2, 167, 172, 183, STR_024A_OIL_WELLS, STR_026C_CONSTRUCT_OIL_WELLS}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 172, 183, STR_024A_OIL_WELLS, STR_026C_CONSTRUCT_OIL_WELLS},
{ WWT_TEXTBTN, 14, 2, 167, 185, 196, STR_024B_BANK, STR_026D_CONSTRUCT_BANK_CAN_ONLY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 185, 196, STR_024B_BANK, STR_026D_CONSTRUCT_BANK_CAN_ONLY},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _scenedit_industry_hilly_widgets[] = { static const Widget _scenedit_industry_hilly_widgets[] = {
{ WWT_TEXTBTN, 7, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL},
{ WWT_IMGBTN, 7, 0, 169, 14, 224, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 7, 0, 169, 14, 224, 0x0, STR_NULL},
{ WWT_TEXTBTN, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP},
{ WWT_TEXTBTN, 14, 2, 167, 42, 53, STR_0240_COAL_MINE, STR_0262_CONSTRUCT_COAL_MINE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0240_COAL_MINE, STR_0262_CONSTRUCT_COAL_MINE},
{ WWT_TEXTBTN, 14, 2, 167, 55, 66, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0241_POWER_STATION, STR_0263_CONSTRUCT_POWER_STATION},
{ WWT_TEXTBTN, 14, 2, 167, 68, 79, STR_024C_PAPER_MILL, STR_026E_CONSTRUCT_PAPER_MILL}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_024C_PAPER_MILL, STR_026E_CONSTRUCT_PAPER_MILL},
{ WWT_TEXTBTN, 14, 2, 167, 81, 92, STR_0243_FOREST, STR_0265_PLANT_FOREST}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 81, 92, STR_0243_FOREST, STR_0265_PLANT_FOREST},
{ WWT_TEXTBTN, 14, 2, 167, 94, 105, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 94, 105, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
{ WWT_TEXTBTN, 14, 2, 167, 107, 118, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 107, 118, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING},
{ WWT_TEXTBTN, 14, 2, 167, 120, 131, STR_024E_PRINTING_WORKS, STR_0270_CONSTRUCT_PRINTING_WORKS}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 120, 131, STR_024E_PRINTING_WORKS, STR_0270_CONSTRUCT_PRINTING_WORKS},
{ WWT_TEXTBTN, 14, 2, 167, 133, 144, STR_024F_GOLD_MINE, STR_0271_CONSTRUCT_GOLD_MINE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 133, 144, STR_024F_GOLD_MINE, STR_0271_CONSTRUCT_GOLD_MINE},
{ WWT_TEXTBTN, 14, 2, 167, 146, 157, STR_0248_FARM, STR_026A_CONSTRUCT_FARM}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 146, 157, STR_0248_FARM, STR_026A_CONSTRUCT_FARM},
{ WWT_TEXTBTN, 14, 2, 167, 159, 170, STR_024B_BANK, STR_0272_CONSTRUCT_BANK_CAN_ONLY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 159, 170, STR_024B_BANK, STR_0272_CONSTRUCT_BANK_CAN_ONLY},
{ WWT_TEXTBTN, 14, 2, 167, 172, 183, STR_024A_OIL_WELLS, STR_026C_CONSTRUCT_OIL_WELLS}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 172, 183, STR_024A_OIL_WELLS, STR_026C_CONSTRUCT_OIL_WELLS},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _scenedit_industry_desert_widgets[] = { static const Widget _scenedit_industry_desert_widgets[] = {
{ WWT_TEXTBTN, 7, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION, STR_NULL},
{ WWT_IMGBTN, 7, 0, 169, 14, 224, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 7, 0, 169, 14, 224, 0x0, STR_NULL},
{ WWT_TEXTBTN, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP},
{ WWT_TEXTBTN, 14, 2, 167, 42, 53, STR_0250_LUMBER_MILL, STR_0273_CONSTRUCT_LUMBER_MILL_TO}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0250_LUMBER_MILL, STR_0273_CONSTRUCT_LUMBER_MILL_TO},
{ WWT_TEXTBTN, 14, 2, 167, 55, 66, STR_0251_FRUIT_PLANTATION, STR_0274_PLANT_FRUIT_PLANTATION}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0251_FRUIT_PLANTATION, STR_0274_PLANT_FRUIT_PLANTATION},
{ WWT_TEXTBTN, 14, 2, 167, 68, 79, STR_0252_RUBBER_PLANTATION,STR_0275_PLANT_RUBBER_PLANTATION}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0252_RUBBER_PLANTATION,STR_0275_PLANT_RUBBER_PLANTATION},
{ WWT_TEXTBTN, 14, 2, 167, 81, 92, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 81, 92, STR_0244_OIL_REFINERY, STR_0266_CONSTRUCT_OIL_REFINERY},
{ WWT_TEXTBTN, 14, 2, 167, 94, 105, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 94, 105, STR_024D_FOOD_PROCESSING_PLANT, STR_026F_CONSTRUCT_FOOD_PROCESSING},
{ WWT_TEXTBTN, 14, 2, 167, 107, 118, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 107, 118, STR_0246_FACTORY, STR_0268_CONSTRUCT_FACTORY},
{ WWT_TEXTBTN, 14, 2, 167, 120, 131, STR_0253_WATER_SUPPLY, STR_0276_CONSTRUCT_WATER_SUPPLY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 120, 131, STR_0253_WATER_SUPPLY, STR_0276_CONSTRUCT_WATER_SUPPLY},
{ WWT_TEXTBTN, 14, 2, 167, 133, 144, STR_0248_FARM, STR_026A_CONSTRUCT_FARM}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 133, 144, STR_0248_FARM, STR_026A_CONSTRUCT_FARM},
{ WWT_TEXTBTN, 14, 2, 167, 146, 157, STR_0254_WATER_TOWER, STR_0277_CONSTRUCT_WATER_TOWER_CAN}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 146, 157, STR_0254_WATER_TOWER, STR_0277_CONSTRUCT_WATER_TOWER_CAN},
{ WWT_TEXTBTN, 14, 2, 167, 159, 170, STR_024A_OIL_WELLS, STR_026C_CONSTRUCT_OIL_WELLS}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 159, 170, STR_024A_OIL_WELLS, STR_026C_CONSTRUCT_OIL_WELLS},
{ WWT_TEXTBTN, 14, 2, 167, 172, 183, STR_024B_BANK, STR_0272_CONSTRUCT_BANK_CAN_ONLY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 172, 183, STR_024B_BANK, STR_0272_CONSTRUCT_BANK_CAN_ONLY},
{ WWT_TEXTBTN, 14, 2, 167, 185, 196, STR_0255_DIAMOND_MINE, STR_0278_CONSTRUCT_DIAMOND_MINE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 185, 196, STR_0255_DIAMOND_MINE, STR_0278_CONSTRUCT_DIAMOND_MINE},
{ WWT_TEXTBTN, 14, 2, 167, 198, 209, STR_0256_COPPER_ORE_MINE, STR_0279_CONSTRUCT_COPPER_ORE_MINE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 198, 209, STR_0256_COPPER_ORE_MINE, STR_0279_CONSTRUCT_COPPER_ORE_MINE},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _scenedit_industry_candy_widgets[] = { static const Widget _scenedit_industry_candy_widgets[] = {
{ WWT_TEXTBTN, 7, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION,STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 169, 0, 13, STR_023F_INDUSTRY_GENERATION,STR_NULL},
{ WWT_IMGBTN, 7, 0, 169, 14, 224, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 7, 0, 169, 14, 224, 0x0, STR_NULL},
{ WWT_TEXTBTN, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 16, 27, STR_MANY_RANDOM_INDUSTRIES, STR_RANDOM_INDUSTRIES_TIP},
{ WWT_TEXTBTN, 14, 2, 167, 42, 53, STR_0257_COTTON_CANDY_FOREST,STR_027A_PLANT_COTTON_CANDY_FOREST}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 42, 53, STR_0257_COTTON_CANDY_FOREST,STR_027A_PLANT_COTTON_CANDY_FOREST},
{ WWT_TEXTBTN, 14, 2, 167, 55, 66, STR_0258_CANDY_FACTORY, STR_027B_CONSTRUCT_CANDY_FACTORY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 55, 66, STR_0258_CANDY_FACTORY, STR_027B_CONSTRUCT_CANDY_FACTORY},
{ WWT_TEXTBTN, 14, 2, 167, 68, 79, STR_0259_BATTERY_FARM, STR_027C_CONSTRUCT_BATTERY_FARM}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 68, 79, STR_0259_BATTERY_FARM, STR_027C_CONSTRUCT_BATTERY_FARM},
{ WWT_TEXTBTN, 14, 2, 167, 81, 92, STR_025A_COLA_WELLS, STR_027D_CONSTRUCT_COLA_WELLS}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 81, 92, STR_025A_COLA_WELLS, STR_027D_CONSTRUCT_COLA_WELLS},
{ WWT_TEXTBTN, 14, 2, 167, 94, 105, STR_025B_TOY_SHOP, STR_027E_CONSTRUCT_TOY_SHOP}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 94, 105, STR_025B_TOY_SHOP, STR_027E_CONSTRUCT_TOY_SHOP},
{ WWT_TEXTBTN, 14, 2, 167, 107, 118, STR_025C_TOY_FACTORY, STR_027F_CONSTRUCT_TOY_FACTORY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 107, 118, STR_025C_TOY_FACTORY, STR_027F_CONSTRUCT_TOY_FACTORY},
{ WWT_TEXTBTN, 14, 2, 167, 120, 131, STR_025D_PLASTIC_FOUNTAINS, STR_0280_CONSTRUCT_PLASTIC_FOUNTAINS}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 120, 131, STR_025D_PLASTIC_FOUNTAINS, STR_0280_CONSTRUCT_PLASTIC_FOUNTAINS},
{ WWT_TEXTBTN, 14, 2, 167, 133, 144, STR_025E_FIZZY_DRINK_FACTORY,STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 133, 144, STR_025E_FIZZY_DRINK_FACTORY,STR_0281_CONSTRUCT_FIZZY_DRINK_FACTORY},
{ WWT_TEXTBTN, 14, 2, 167, 146, 157, STR_025F_BUBBLE_GENERATOR, STR_0282_CONSTRUCT_BUBBLE_GENERATOR}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 146, 157, STR_025F_BUBBLE_GENERATOR, STR_0282_CONSTRUCT_BUBBLE_GENERATOR},
{ WWT_TEXTBTN, 14, 2, 167, 159, 170, STR_0260_TOFFEE_QUARRY, STR_0283_CONSTRUCT_TOFFEE_QUARRY}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 159, 170, STR_0260_TOFFEE_QUARRY, STR_0283_CONSTRUCT_TOFFEE_QUARRY},
{ WWT_TEXTBTN, 14, 2, 167, 172, 183, STR_0261_SUGAR_MINE, STR_0284_CONSTRUCT_SUGAR_MINE}, { WWT_TEXTBTN, RESIZE_NONE, 14, 2, 167, 172, 183, STR_0261_SUGAR_MINE, STR_0284_CONSTRUCT_SUGAR_MINE},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1886,39 +1884,39 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e)
} }
static const Widget _toolb_normal_widgets[] = { static const Widget _toolb_normal_widgets[] = {
{ WWT_PANEL, 14, 0, 21, 0, 21, 0x2D6, STR_0171_PAUSE_GAME}, { WWT_PANEL, RESIZE_NONE, 14, 0, 21, 0, 21, 0x2D6, STR_0171_PAUSE_GAME},
{ WWT_PANEL, 14, 22, 43, 0, 21, SPR_OPENTTD_BASE + 57, STR_FAST_FORWARD}, { WWT_PANEL, RESIZE_NONE, 14, 22, 43, 0, 21, SPR_OPENTTD_BASE + 57, STR_FAST_FORWARD},
{ WWT_PANEL, 14, 44, 65, 0, 21, 0x2EF, STR_0187_OPTIONS}, { WWT_PANEL, RESIZE_NONE, 14, 44, 65, 0, 21, 0x2EF, STR_0187_OPTIONS},
{ WWT_PANEL_2, 14, 66, 87, 0, 21, 0x2D4, STR_0172_SAVE_GAME_ABANDON_GAME}, { WWT_PANEL_2, RESIZE_NONE, 14, 66, 87, 0, 21, 0x2D4, STR_0172_SAVE_GAME_ABANDON_GAME},
{ WWT_PANEL, 14, 96, 117, 0, 21, 0x2C4, STR_0174_DISPLAY_MAP}, { WWT_PANEL, RESIZE_NONE, 14, 96, 117, 0, 21, 0x2C4, STR_0174_DISPLAY_MAP},
{ WWT_PANEL, 14, 118, 139, 0, 21, 0xFED, STR_0176_DISPLAY_TOWN_DIRECTORY}, { WWT_PANEL, RESIZE_NONE, 14, 118, 139, 0, 21, 0xFED, STR_0176_DISPLAY_TOWN_DIRECTORY},
{ WWT_PANEL, 14, 140, 161, 0, 21, 0x2A7, STR_02DC_DISPLAY_SUBSIDIES}, { WWT_PANEL, RESIZE_NONE, 14, 140, 161, 0, 21, 0x2A7, STR_02DC_DISPLAY_SUBSIDIES},
{ WWT_PANEL, 14, 162, 183, 0, 21, 0x513, STR_0173_DISPLAY_LIST_OF_COMPANY}, { WWT_PANEL, RESIZE_NONE, 14, 162, 183, 0, 21, 0x513, STR_0173_DISPLAY_LIST_OF_COMPANY},
{ WWT_PANEL, 14, 191, 212, 0, 21, 0x2E1, STR_0177_DISPLAY_COMPANY_FINANCES}, { WWT_PANEL, RESIZE_NONE, 14, 191, 212, 0, 21, 0x2E1, STR_0177_DISPLAY_COMPANY_FINANCES},
{ WWT_PANEL, 14, 213, 235, 0, 21, 0x2E7, STR_0178_DISPLAY_COMPANY_GENERAL}, { WWT_PANEL, RESIZE_NONE, 14, 213, 235, 0, 21, 0x2E7, STR_0178_DISPLAY_COMPANY_GENERAL},
{ WWT_PANEL, 14, 236, 257, 0, 21, 0x2E9, STR_0179_DISPLAY_GRAPHS}, { WWT_PANEL, RESIZE_NONE, 14, 236, 257, 0, 21, 0x2E9, STR_0179_DISPLAY_GRAPHS},
{ WWT_PANEL, 14, 258, 279, 0, 21, 0x2AC, STR_017A_DISPLAY_COMPANY_LEAGUE}, { WWT_PANEL, RESIZE_NONE, 14, 258, 279, 0, 21, 0x2AC, STR_017A_DISPLAY_COMPANY_LEAGUE},
{ WWT_PANEL, 14, 280, 301, 0, 21, 0x2E5, STR_0312_FUND_CONSTRUCTION_OF_NEW}, { WWT_PANEL, RESIZE_NONE, 14, 280, 301, 0, 21, 0x2E5, STR_0312_FUND_CONSTRUCTION_OF_NEW},
{ WWT_PANEL, 14, 310, 331, 0, 21, 0x2DB, STR_017B_DISPLAY_LIST_OF_COMPANY}, { WWT_PANEL, RESIZE_NONE, 14, 310, 331, 0, 21, 0x2DB, STR_017B_DISPLAY_LIST_OF_COMPANY},
{ WWT_PANEL, 14, 332, 353, 0, 21, 0x2DC, STR_017C_DISPLAY_LIST_OF_COMPANY}, { WWT_PANEL, RESIZE_NONE, 14, 332, 353, 0, 21, 0x2DC, STR_017C_DISPLAY_LIST_OF_COMPANY},
{ WWT_PANEL, 14, 354, 375, 0, 21, 0x2DD, STR_017D_DISPLAY_LIST_OF_COMPANY}, { WWT_PANEL, RESIZE_NONE, 14, 354, 375, 0, 21, 0x2DD, STR_017D_DISPLAY_LIST_OF_COMPANY},
{ WWT_PANEL, 14, 376, 397, 0, 21, 0x2DE, STR_017E_DISPLAY_LIST_OF_COMPANY}, { WWT_PANEL, RESIZE_NONE, 14, 376, 397, 0, 21, 0x2DE, STR_017E_DISPLAY_LIST_OF_COMPANY},
{ WWT_PANEL, 14, 406, 427, 0, 21, 0x2DF, STR_017F_ZOOM_THE_VIEW_IN}, { WWT_PANEL, RESIZE_NONE, 14, 406, 427, 0, 21, 0x2DF, STR_017F_ZOOM_THE_VIEW_IN},
{ WWT_PANEL, 14, 428, 449, 0, 21, 0x2E0, STR_0180_ZOOM_THE_VIEW_OUT}, { WWT_PANEL, RESIZE_NONE, 14, 428, 449, 0, 21, 0x2E0, STR_0180_ZOOM_THE_VIEW_OUT},
{ WWT_PANEL, 14, 457, 478, 0, 21, 0x2D7, STR_0181_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 14, 457, 478, 0, 21, 0x2D7, STR_0181_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 14, 479, 500, 0, 21, 0x2D8, STR_0182_BUILD_ROADS}, { WWT_PANEL, RESIZE_NONE, 14, 479, 500, 0, 21, 0x2D8, STR_0182_BUILD_ROADS},
{ WWT_PANEL, 14, 501, 522, 0, 21, 0x2D9, STR_0183_BUILD_SHIP_DOCKS}, { WWT_PANEL, RESIZE_NONE, 14, 501, 522, 0, 21, 0x2D9, STR_0183_BUILD_SHIP_DOCKS},
{ WWT_PANEL, 14, 523, 544, 0, 21, 0x2DA, STR_0184_BUILD_AIRPORTS}, { WWT_PANEL, RESIZE_NONE, 14, 523, 544, 0, 21, 0x2DA, STR_0184_BUILD_AIRPORTS},
{ WWT_PANEL, 14, 545, 566, 0, 21, 0xFF3, STR_LANDSCAPING_TOOLBAR_TIP}, // tree icon is 0x2E6 { WWT_PANEL, RESIZE_NONE, 14, 545, 566, 0, 21, 0xFF3, STR_LANDSCAPING_TOOLBAR_TIP}, // tree icon is 0x2E6
{ WWT_PANEL, 14, 574, 595, 0, 21, 0x2C9, STR_01D4_SHOW_SOUND_MUSIC_WINDOW}, { WWT_PANEL, RESIZE_NONE, 14, 574, 595, 0, 21, 0x2C9, STR_01D4_SHOW_SOUND_MUSIC_WINDOW},
{ WWT_PANEL, 14, 596, 617, 0, 21, 0x2A8, STR_0203_SHOW_LAST_MESSAGE_NEWS}, { WWT_PANEL, RESIZE_NONE, 14, 596, 617, 0, 21, 0x2A8, STR_0203_SHOW_LAST_MESSAGE_NEWS},
{ WWT_PANEL, 14, 618, 639, 0, 21, 0x2D3, STR_0186_LAND_BLOCK_INFORMATION}, { WWT_PANEL, RESIZE_NONE, 14, 618, 639, 0, 21, 0x2D3, STR_0186_LAND_BLOCK_INFORMATION},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1940,39 +1938,39 @@ static const WindowDesc _toolb_intro_desc = {
static const Widget _toolb_scen_widgets[] = { static const Widget _toolb_scen_widgets[] = {
{ WWT_PANEL, 14, 0, 21, 0, 21, 0x2D6, STR_0171_PAUSE_GAME}, { WWT_PANEL, RESIZE_NONE, 14, 0, 21, 0, 21, 0x2D6, STR_0171_PAUSE_GAME},
{ WWT_PANEL, 14, 22, 43, 0, 21, SPR_OPENTTD_BASE + 57, STR_FAST_FORWARD}, { WWT_PANEL, RESIZE_NONE, 14, 22, 43, 0, 21, SPR_OPENTTD_BASE + 57, STR_FAST_FORWARD},
{ WWT_PANEL, 14, 44, 65, 0, 21, 0x2EF, STR_0187_OPTIONS}, { WWT_PANEL, RESIZE_NONE, 14, 44, 65, 0, 21, 0x2EF, STR_0187_OPTIONS},
{ WWT_PANEL_2, 14, 66, 87, 0, 21, 0x2D4, STR_0297_SAVE_SCENARIO_LOAD_SCENARIO}, { WWT_PANEL_2, RESIZE_NONE, 14, 66, 87, 0, 21, 0x2D4, STR_0297_SAVE_SCENARIO_LOAD_SCENARIO},
{ WWT_PANEL, 14, 96, 225, 0, 21, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 96, 225, 0, 21, 0x0, STR_NULL},
{ WWT_PANEL, 14, 233, 362, 0, 21, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 233, 362, 0, 21, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 14, 236, 246, 5, 16, STR_0225, STR_029E_MOVE_THE_STARTING_DATE}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 236, 246, 5, 16, STR_0225, STR_029E_MOVE_THE_STARTING_DATE},
{ WWT_CLOSEBOX, 14, 347, 357, 5, 16, STR_0224, STR_029F_MOVE_THE_STARTING_DATE}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 347, 357, 5, 16, STR_0224, STR_029F_MOVE_THE_STARTING_DATE},
{ WWT_PANEL, 14, 371, 392, 0, 21, 0x2C4, STR_0175_DISPLAY_MAP_TOWN_DIRECTORY}, { WWT_PANEL, RESIZE_NONE, 14, 371, 392, 0, 21, 0x2C4, STR_0175_DISPLAY_MAP_TOWN_DIRECTORY},
{ WWT_PANEL, 14, 400, 421, 0, 21, 0x2DF, STR_017F_ZOOM_THE_VIEW_IN}, { WWT_PANEL, RESIZE_NONE, 14, 400, 421, 0, 21, 0x2DF, STR_017F_ZOOM_THE_VIEW_IN},
{ WWT_PANEL, 14, 422, 443, 0, 21, 0x2E0, STR_0180_ZOOM_THE_VIEW_OUT}, { WWT_PANEL, RESIZE_NONE, 14, 422, 443, 0, 21, 0x2E0, STR_0180_ZOOM_THE_VIEW_OUT},
{ WWT_PANEL, 14, 452, 473, 0, 21, 0xFF3, STR_022E_LANDSCAPE_GENERATION}, { WWT_PANEL, RESIZE_NONE, 14, 452, 473, 0, 21, 0xFF3, STR_022E_LANDSCAPE_GENERATION},
{ WWT_PANEL, 14, 474, 495, 0, 21, 0xFED, STR_022F_TOWN_GENERATION}, { WWT_PANEL, RESIZE_NONE, 14, 474, 495, 0, 21, 0xFED, STR_022F_TOWN_GENERATION},
{ WWT_PANEL, 14, 496, 517, 0, 21, 0x2E5, STR_0230_INDUSTRY_GENERATION}, { WWT_PANEL, RESIZE_NONE, 14, 496, 517, 0, 21, 0x2E5, STR_0230_INDUSTRY_GENERATION},
{ WWT_PANEL, 14, 518, 539, 0, 21, 0x2D8, STR_0231_ROAD_CONSTRUCTION}, { WWT_PANEL, RESIZE_NONE, 14, 518, 539, 0, 21, 0x2D8, STR_0231_ROAD_CONSTRUCTION},
{ WWT_PANEL, 14, 540, 561, 0, 21, 0x2E6, STR_0288_PLANT_TREES}, { WWT_PANEL, RESIZE_NONE, 14, 540, 561, 0, 21, 0x2E6, STR_0288_PLANT_TREES},
{ WWT_PANEL, 14, 562, 583, 0, 21, 0xFF2, STR_0289_PLACE_SIGN}, { WWT_PANEL, RESIZE_NONE, 14, 562, 583, 0, 21, 0xFF2, STR_0289_PLACE_SIGN},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_PANEL, 14, 596, 617, 0, 21, 0x2C9, STR_01D4_SHOW_SOUND_MUSIC_WINDOW}, { WWT_PANEL, RESIZE_NONE, 14, 596, 617, 0, 21, 0x2C9, STR_01D4_SHOW_SOUND_MUSIC_WINDOW},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_PANEL, 14, 618, 639, 0, 21, 0x2D3, STR_0186_LAND_BLOCK_INFORMATION}, { WWT_PANEL, RESIZE_NONE, 14, 618, 639, 0, 21, 0x2D3, STR_0186_LAND_BLOCK_INFORMATION},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -2212,9 +2210,9 @@ static void ScrollMainViewport(int x, int y)
static const Widget _main_status_widgets[] = { static const Widget _main_status_widgets[] = {
{ WWT_IMGBTN, 14, 0, 139, 0, 11, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 139, 0, 11, 0x0, STR_NULL},
{ WWT_PUSHIMGBTN, 14, 140, 499, 0, 11, 0x0, STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 140, 499, 0, 11, 0x0, STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS},
{ WWT_PUSHIMGBTN, 14, 500, 639, 0, 11, 0x0, STR_NULL}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 500, 639, 0, 11, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -96,9 +96,9 @@ static void LandInfoWndProc(Window *w, WindowEvent *e)
} }
static const Widget _land_info_widgets[] = { static const Widget _land_info_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 279, 0, 13, STR_01A3_LAND_AREA_INFORMATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 279, 0, 13, STR_01A3_LAND_AREA_INFORMATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 279, 14, 92, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 279, 14, 92, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -253,9 +253,9 @@ static void AboutWindowProc(Window *w, WindowEvent *e)
} }
static const Widget _about_widgets[] = { static const Widget _about_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 14, 11, 399, 0, 13, STR_015B_OPENTTD, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 399, 0, 13, STR_015B_OPENTTD, STR_NULL},
{ WWT_PANEL, 14, 0, 399, 14, 271, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 399, 14, 271, 0x0, STR_NULL},
{ WWT_FRAME, 14, 5, 394, 40, 245, STR_NULL, STR_NULL}, { WWT_FRAME, 14, 5, 394, 40, 245, STR_NULL, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -370,22 +370,22 @@ static void BuildTreesWndProc(Window *w, WindowEvent *e)
} }
static const Widget _build_trees_widgets[] = { static const Widget _build_trees_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 142, 0, 13, STR_2802_TREES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 142, 0, 13, STR_2802_TREES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 142, 14, 170, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 142, 14, 170, 0x0, STR_NULL},
{ WWT_PANEL, 14, 2, 35, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 2, 35, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 37, 70, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 37, 70, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 72, 105, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 72, 105, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 107, 140, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 107, 140, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 2, 35, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 2, 35, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 37, 70, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 37, 70, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 72, 105, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 72, 105, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 107, 140, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 107, 140, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 2, 35, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 2, 35, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 37, 70, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 37, 70, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 72, 105, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 72, 105, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 107, 140, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 107, 140, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_CLOSEBOX, 14, 2, 140, 157, 168, STR_TREES_RANDOM_TYPE, STR_TREES_RANDOM_TYPE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 140, 157, 168, STR_TREES_RANDOM_TYPE, STR_TREES_RANDOM_TYPE_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -398,23 +398,23 @@ static const WindowDesc _build_trees_desc = {
}; };
static const Widget _build_trees_scen_widgets[] = { static const Widget _build_trees_scen_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 142, 0, 13, STR_2802_TREES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 142, 0, 13, STR_2802_TREES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 142, 14, 183, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 142, 14, 183, 0x0, STR_NULL},
{ WWT_PANEL, 14, 2, 35, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 2, 35, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 37, 70, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 37, 70, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 72, 105, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 72, 105, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 107, 140, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 107, 140, 16, 61, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 2, 35, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 2, 35, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 37, 70, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 37, 70, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 72, 105, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 72, 105, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 107, 140, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 107, 140, 63, 108, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 2, 35, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 2, 35, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 37, 70, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 37, 70, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 72, 105, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 72, 105, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_PANEL, 14, 107, 140, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT}, { WWT_PANEL, RESIZE_NONE, 14, 107, 140, 110, 155, 0x0, STR_280D_SELECT_TREE_TYPE_TO_PLANT},
{ WWT_CLOSEBOX, 14, 2, 140, 157, 168, STR_TREES_RANDOM_TYPE, STR_TREES_RANDOM_TYPE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 140, 157, 168, STR_TREES_RANDOM_TYPE, STR_TREES_RANDOM_TYPE_TIP},
{ WWT_CLOSEBOX, 14, 2, 140, 170, 181, STR_028A_RANDOM_TREES, STR_028B_PLANT_TREES_RANDOMLY_OVER}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 2, 140, 170, 181, STR_028A_RANDOM_TREES, STR_028B_PLANT_TREES_RANDOMLY_OVER},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -443,16 +443,16 @@ static uint _errmsg_duration;
static const Widget _errmsg_widgets[] = { static const Widget _errmsg_widgets[] = {
{ WWT_CLOSEBOX, 4, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 4, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 4, 11, 239, 0, 13, STR_00B2_MESSAGE, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 4, 11, 239, 0, 13, STR_00B2_MESSAGE, STR_NULL},
{ WWT_PANEL, 4, 0, 239, 14, 45, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 4, 0, 239, 14, 45, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _errmsg_face_widgets[] = { static const Widget _errmsg_face_widgets[] = {
{ WWT_CLOSEBOX, 4, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 4, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 4, 11, 333, 0, 13, STR_00B3_MESSAGE_FROM, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 4, 11, 333, 0, 13, STR_00B3_MESSAGE_FROM, STR_NULL},
{ WWT_PANEL, 4, 0, 333, 14, 136, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 4, 0, 333, 14, 136, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -463,7 +463,7 @@ static void ErrmsgWndProc(Window *w, WindowEvent *e)
COPY_IN_DPARAM(0, _errmsg_decode_params, lengthof(_errmsg_decode_params)); COPY_IN_DPARAM(0, _errmsg_decode_params, lengthof(_errmsg_decode_params));
DrawWindowWidgets(w); DrawWindowWidgets(w);
COPY_IN_DPARAM(0, _errmsg_decode_params, lengthof(_errmsg_decode_params)); COPY_IN_DPARAM(0, _errmsg_decode_params, lengthof(_errmsg_decode_params));
if (w->widget != _errmsg_face_widgets) { if (!IsWindowOfPrototype(w, _errmsg_face_widgets)) {
DrawStringMultiCenter( DrawStringMultiCenter(
120, 120,
(_errmsg_message_1 == INVALID_STRING_ID ? 25 : 15), (_errmsg_message_1 == INVALID_STRING_ID ? 25 : 15),
@ -604,7 +604,7 @@ void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost)
} }
static Widget _tooltips_widgets[] = { static Widget _tooltips_widgets[] = {
{ WWT_PANEL, 14, 0, 199, 0, 31, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 199, 0, 31, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -757,7 +757,7 @@ void SetVScrollCount(Window *w, int num)
} }
void SetVScroll2Count(Window *w, int num) void SetVScroll2Count(Window *w, int num)
{ {
w->vscroll2.count = num; w->vscroll2.count = num;
num -= w->vscroll2.cap; num -= w->vscroll2.cap;
if (num < 0) num = 0; if (num < 0) num = 0;
@ -922,12 +922,12 @@ press_ok:;
} }
static const Widget _query_string_widgets[] = { static const Widget _query_string_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 14, 11, 259, 0, 13, STR_012D, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 259, 0, 13, STR_012D, STR_NULL},
{ WWT_IMGBTN, 14, 0, 259, 14, 29, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 259, 14, 29, 0x0, STR_NULL},
{ WWT_TEXTBTN, 14, 0, 129, 30, 41, STR_012E_CANCEL, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 129, 30, 41, STR_012E_CANCEL, STR_NULL},
{ WWT_TEXTBTN, 14, 130, 259, 30, 41, STR_012F_OK, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 14, 130, 259, 30, 41, STR_012F_OK, STR_NULL},
{ WWT_IMGBTN, 14, 2, 257, 16, 27, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 257, 16, 27, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -981,58 +981,62 @@ void ShowQueryString(StringID str, StringID caption, int maxlen, int maxwidth, b
} }
static const Widget _load_dialog_1_widgets[] = { static const Widget _load_dialog_1_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 256, 0, 13, STR_4001_LOAD_GAME, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 256, 0, 13, STR_4001_LOAD_GAME, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 14, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP},
{ WWT_IMGBTN, 14, 0, 256, 26, 47, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RIGHT, 14, 0, 256, 26, 47, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 256, 48, 293, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RB, 14, 0, 256, 48, 293, 0x0, STR_NULL},
{ WWT_6, 14, 2, 243, 50, 291, 0x0, STR_400A_LIST_OF_DRIVES_DIRECTORIES}, { WWT_6, RESIZE_RB, 14, 2, 243, 50, 291, 0x0, STR_400A_LIST_OF_DRIVES_DIRECTORIES},
{ WWT_SCROLLBAR, 14, 246, 256, 48, 293, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 246, 256, 48, 281, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 246, 256, 282, 293, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _load_dialog_2_widgets[] = { static const Widget _load_dialog_2_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 256, 0, 13, STR_0298_LOAD_SCENARIO, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 256, 0, 13, STR_0298_LOAD_SCENARIO, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 14, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP},
{ WWT_IMGBTN, 14, 0, 256, 26, 47, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RIGHT, 14, 0, 256, 26, 47, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 256, 48, 293, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RB, 14, 0, 256, 48, 293, 0x0, STR_NULL},
{ WWT_6, 14, 2, 243, 50, 291, 0x0, STR_400A_LIST_OF_DRIVES_DIRECTORIES}, { WWT_6, RESIZE_RB, 14, 2, 243, 50, 291, 0x0, STR_400A_LIST_OF_DRIVES_DIRECTORIES},
{ WWT_SCROLLBAR, 14, 246, 256, 48, 293, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 246, 256, 48, 281, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 246, 256, 282, 293, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _save_dialog_widgets[] = { static const Widget _save_dialog_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 256, 0, 13, STR_4000_SAVE_GAME, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 256, 0, 13, STR_4000_SAVE_GAME, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 14, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP},
{ WWT_IMGBTN, 14, 0, 256, 26, 47, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RIGHT, 14, 0, 256, 26, 47, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 256, 48, 291, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RB, 14, 0, 256, 48, 291, 0x0, STR_NULL},
{ WWT_6, 14, 2, 243, 50, 289, 0x0, STR_400A_LIST_OF_DRIVES_DIRECTORIES}, { WWT_6, RESIZE_RB, 14, 2, 243, 50, 290, 0x0, STR_400A_LIST_OF_DRIVES_DIRECTORIES},
{ WWT_SCROLLBAR, 14, 246, 256, 48, 291, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 246, 256, 48, 279, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_IMGBTN, 14, 0, 256, 292, 307, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RTB, 14, 0, 256, 292, 307, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 2, 254, 294, 305, 0x0, STR_400B_CURRENTLY_SELECTED_NAME}, { WWT_IMGBTN, RESIZE_RTB, 14, 2, 254, 294, 305, 0x0, STR_400B_CURRENTLY_SELECTED_NAME},
{ WWT_PUSHTXTBTN, 14, 0, 127, 308, 319, STR_4003_DELETE, STR_400C_DELETE_THE_CURRENTLY_SELECTED}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 127, 308, 319, STR_4003_DELETE, STR_400C_DELETE_THE_CURRENTLY_SELECTED},
{ WWT_PUSHTXTBTN, 14, 128, 256, 308, 319, STR_4002_SAVE, STR_400D_SAVE_THE_CURRENT_GAME_USING}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 128, 256, 308, 319, STR_4002_SAVE, STR_400D_SAVE_THE_CURRENT_GAME_USING},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 246, 256, 280, 291, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _save_dialog_scen_widgets[] = { static const Widget _save_dialog_scen_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 256, 0, 13, STR_0299_SAVE_SCENARIO, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 256, 0, 13, STR_0299_SAVE_SCENARIO, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 14, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP},
{ WWT_IMGBTN, 14, 0, 256, 26, 47, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RIGHT, 14, 0, 256, 26, 47, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 256, 48, 291, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RB, 14, 0, 256, 48, 291, 0x0, STR_NULL},
{ WWT_6, 14, 2, 243, 50, 289, 0x0, STR_400A_LIST_OF_DRIVES_DIRECTORIES}, { WWT_6, RESIZE_RB, 14, 2, 243, 50, 290, 0x0, STR_400A_LIST_OF_DRIVES_DIRECTORIES},
{ WWT_SCROLLBAR, 14, 246, 256, 48, 291, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 246, 256, 48, 279, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_IMGBTN, 14, 0, 256, 292, 307, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_RTB, 14, 0, 256, 292, 307, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 2, 254, 294, 305, 0x0, STR_400B_CURRENTLY_SELECTED_NAME}, { WWT_IMGBTN, RESIZE_RTB, 14, 2, 254, 294, 305, 0x0, STR_400B_CURRENTLY_SELECTED_NAME},
{ WWT_PUSHTXTBTN, 14, 0, 127, 308, 319, STR_4003_DELETE, STR_400C_DELETE_THE_CURRENTLY_SELECTED}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 127, 308, 319, STR_4003_DELETE, STR_400C_DELETE_THE_CURRENTLY_SELECTED},
{ WWT_PUSHTXTBTN, 14, 128, 256, 308, 319, STR_4002_SAVE, STR_400D_SAVE_THE_CURRENT_GAME_USING}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 128, 256, 308, 319, STR_4002_SAVE, STR_400D_SAVE_THE_CURRENT_GAME_USING},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 246, 256, 280, 291, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1107,8 +1111,6 @@ static void GenerateFileName(void)
static void SaveLoadDlgWndProc(Window *w, WindowEvent *e) static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
{ {
const int list_start = 51;
switch(e->event) { switch(e->event) {
case WE_PAINT: { case WE_PAINT: {
int y,pos; int y,pos;
@ -1123,17 +1125,17 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
MakeSortedSaveGameList(); MakeSortedSaveGameList();
} }
GfxFillRect(3, list_start, 3+239, list_start+239, 0xD7); GfxFillRect(w->widget[6].left + 1, w->widget[6].top + 1, w->widget[6].right, w->widget[6].bottom, 0xD7);
DoDrawString(_savegame_sort_order & 1 ? "\xAA" : "\xA0", _savegame_sort_order <= 1 ? 248 : 118, 15, 0x10); DoDrawString(_savegame_sort_order & 1 ? "\xAA" : "\xA0", _savegame_sort_order <= 1 ? w->widget[3].right - 9 : w->widget[2].right - 9, 15, 0x10);
y = list_start; y = w->widget[6].top + 1;
pos = w->vscroll.pos; pos = w->vscroll.pos;
while (pos < _fios_num) { while (pos < _fios_num) {
item = _fios_list + pos; item = _fios_list + pos;
DoDrawString(item->title[0] ? item->title : item->name, 4, y, _fios_colors[item->type] ); DoDrawString(item->title[0] ? item->title : item->name, 4, y, _fios_colors[item->type] );
pos++; pos++;
y+=10; y+=10;
if (y >= w->vscroll.cap*10+list_start) if (y >= w->vscroll.cap*10+w->widget[6].top+1)
break; break;
} }
@ -1157,7 +1159,7 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
break; break;
case 6: { /* Click the listbox */ case 6: { /* Click the listbox */
int y = (e->click.pt.y - list_start) / 10; int y = (e->click.pt.y - w->widget[6].top - 1) / 10;
char *name; char *name;
const FiosItem *file; const FiosItem *file;
@ -1222,13 +1224,29 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
_query_string_active = false; _query_string_active = false;
FiosFreeSavegameList(); FiosFreeSavegameList();
break; break;
case WE_RESIZE: {
/* Widget 2 and 3 have to go with halve speed, make it so obiwan */
uint diff = e->sizing.diff.x / 2;
w->widget[2].right += diff;
w->widget[3].left += diff;
w->widget[3].right += e->sizing.diff.x;
/* Same for widget 10 and 11 in save-dialog */
if (_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO) {
w->widget[10].right += diff;
w->widget[11].left += diff;
w->widget[11].right += e->sizing.diff.x;
}
w->vscroll.cap += e->sizing.diff.y / 10;
} break;
} }
} }
static const WindowDesc _load_dialog_desc = { static const WindowDesc _load_dialog_desc = {
WDP_CENTER, WDP_CENTER, 257, 294, WDP_CENTER, WDP_CENTER, 257, 294,
WC_SAVELOAD,0, WC_SAVELOAD,0,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_load_dialog_1_widgets, _load_dialog_1_widgets,
SaveLoadDlgWndProc, SaveLoadDlgWndProc,
}; };
@ -1236,7 +1254,7 @@ static const WindowDesc _load_dialog_desc = {
static const WindowDesc _load_dialog_scen_desc = { static const WindowDesc _load_dialog_scen_desc = {
WDP_CENTER, WDP_CENTER, 257, 294, WDP_CENTER, WDP_CENTER, 257, 294,
WC_SAVELOAD,0, WC_SAVELOAD,0,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_load_dialog_2_widgets, _load_dialog_2_widgets,
SaveLoadDlgWndProc, SaveLoadDlgWndProc,
}; };
@ -1244,7 +1262,7 @@ static const WindowDesc _load_dialog_scen_desc = {
static const WindowDesc _save_dialog_desc = { static const WindowDesc _save_dialog_desc = {
WDP_CENTER, WDP_CENTER, 257, 320, WDP_CENTER, WDP_CENTER, 257, 320,
WC_SAVELOAD,0, WC_SAVELOAD,0,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_save_dialog_widgets, _save_dialog_widgets,
SaveLoadDlgWndProc, SaveLoadDlgWndProc,
}; };
@ -1252,7 +1270,7 @@ static const WindowDesc _save_dialog_desc = {
static const WindowDesc _save_dialog_scen_desc = { static const WindowDesc _save_dialog_scen_desc = {
WDP_CENTER, WDP_CENTER, 257, 320, WDP_CENTER, WDP_CENTER, 257, 320,
WC_SAVELOAD,0, WC_SAVELOAD,0,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_save_dialog_scen_widgets, _save_dialog_scen_widgets,
SaveLoadDlgWndProc, SaveLoadDlgWndProc,
}; };
@ -1276,6 +1294,9 @@ void ShowSaveLoadDialog(int mode)
w = AllocateWindowDesc(_saveload_dialogs[mode]); w = AllocateWindowDesc(_saveload_dialogs[mode]);
w->vscroll.cap = 24; w->vscroll.cap = 24;
w->resize.step_width = 2;
w->resize.step_height = 10;
w->resize.height = w->height - 14 * 10; // Minimum of 10 items
w->click_state |= (1 << 6); w->click_state |= (1 << 6);
WP(w,querystr_d).caret = 0; WP(w,querystr_d).caret = 0;
WP(w,querystr_d).maxlen = MAX_QUERYSTR_LEN; WP(w,querystr_d).maxlen = MAX_QUERYSTR_LEN;
@ -1303,13 +1324,15 @@ void RedrawAutosave()
} }
static const Widget _select_scenario_widgets[] = { static const Widget _select_scenario_widgets[] = {
{ WWT_TEXTBTN, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 256, 0, 13, STR_400E_SELECT_NEW_GAME_TYPE, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 7, 11, 256, 0, 13, STR_400E_SELECT_NEW_GAME_TYPE, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 7, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, { WWT_IMGBTN, RESIZE_RIGHT, 7, 0, 256, 14, 25, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 7, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 7, 0, 127, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
{ WWT_IMGBTN, 7, 0, 245, 26, 319, 0x0, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 7, 128, 256, 14, 25, STR_SORT_BY_DATE, STR_SORT_ORDER_TIP},
{ WWT_6, 7, 2, 243, 28, 317, 0x0, STR_400F_SELECT_SCENARIO_GREEN_PRE}, { WWT_IMGBTN, RESIZE_RB, 7, 0, 245, 26, 319, 0x0, STR_NULL},
{ WWT_SCROLLBAR, 7, 246, 256, 26, 319, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_6, RESIZE_RB, 7, 2, 243, 28, 317, 0x0, STR_400F_SELECT_SCENARIO_GREEN_PRE},
{ WWT_SCROLLBAR, RESIZE_LRB, 7, 246, 256, 26, 307, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_RESIZEBOX, RESIZE_LRTB, 7, 246, 256, 308, 319, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1329,7 +1352,7 @@ static void SelectScenarioWndProc(Window *w, WindowEvent *e) {
SetVScrollCount(w, _fios_num); SetVScrollCount(w, _fios_num);
DrawWindowWidgets(w); DrawWindowWidgets(w);
DoDrawString(_savegame_sort_order & 1 ? "\xAA" : "\xA0", _savegame_sort_order <= 1 ? 248 : 118, 15, 0x10); DoDrawString(_savegame_sort_order & 1 ? "\xAA" : "\xA0", _savegame_sort_order <= 1 ? w->widget[4].right - 9 : w->widget[3].right - 9, 15, 0x10);
DrawString(4, 32, STR_4010_GENERATE_RANDOM_NEW_GAME, 9); DrawString(4, 32, STR_4010_GENERATE_RANDOM_NEW_GAME, 9);
y = list_start; y = list_start;
@ -1347,19 +1370,19 @@ static void SelectScenarioWndProc(Window *w, WindowEvent *e) {
case WE_CLICK: case WE_CLICK:
switch(e->click.widget) { switch(e->click.widget) {
case 2: /* Sort scenario names by name */ case 3: /* Sort scenario names by name */
_savegame_sort_order = (_savegame_sort_order == 2) ? 3 : 2; _savegame_sort_order = (_savegame_sort_order == 2) ? 3 : 2;
_savegame_sort_dirty = true; _savegame_sort_dirty = true;
SetWindowDirty(w); SetWindowDirty(w);
break; break;
case 3: /* Sort scenario names by date */ case 4: /* Sort scenario names by date */
_savegame_sort_order = (_savegame_sort_order == 0) ? 1 : 0; _savegame_sort_order = (_savegame_sort_order == 0) ? 1 : 0;
_savegame_sort_dirty = true; _savegame_sort_dirty = true;
SetWindowDirty(w); SetWindowDirty(w);
break; break;
case 5: /* Click the listbox */ case 6: /* Click the listbox */
if(e->click.pt.y < list_start) if(e->click.pt.y < list_start)
DoCommandP(0, Random(), InteractiveRandom(), NULL, CMD_GEN_RANDOM_NEW_GAME); DoCommandP(0, Random(), InteractiveRandom(), NULL, CMD_GEN_RANDOM_NEW_GAME);
else { else {
@ -1383,6 +1406,16 @@ static void SelectScenarioWndProc(Window *w, WindowEvent *e) {
} }
case WE_DESTROY: case WE_DESTROY:
break; break;
case WE_RESIZE: {
/* Widget 3 and 4 have to go with halve speed, make it so obiwan */
uint diff = e->sizing.diff.x / 2;
w->widget[3].right += diff;
w->widget[4].left += diff;
w->widget[4].right += e->sizing.diff.x;
w->vscroll.cap += e->sizing.diff.y / 10;
} break;
} }
} }
@ -1403,7 +1436,7 @@ void SetFiosType(const byte fiostype)
static const WindowDesc _select_scenario_desc = { static const WindowDesc _select_scenario_desc = {
WDP_CENTER, WDP_CENTER, 257, 320, WDP_CENTER, WDP_CENTER, 257, 320,
WC_SAVELOAD,0, WC_SAVELOAD,0,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_STD_BTN | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_select_scenario_widgets, _select_scenario_widgets,
SelectScenarioWndProc SelectScenarioWndProc
}; };
@ -1420,6 +1453,9 @@ void AskForNewGameToStart()
w = AllocateWindowDesc(&_select_scenario_desc); w = AllocateWindowDesc(&_select_scenario_desc);
w->vscroll.cap = 27; w->vscroll.cap = 27;
w->resize.step_width = 2;
w->resize.step_height = 10;
w->resize.height = w->height - 10 * 17; // Minimum of 10 in the list
} }
static int32 ClickMoneyCheat(int32 p1, int32 p2) static int32 ClickMoneyCheat(int32 p1, int32 p2)
@ -1543,10 +1579,10 @@ static const CheatEntry _cheats_ui[] = {
static const Widget _cheat_widgets[] = { static const Widget _cheat_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 399, 0, 13, STR_CHEATS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 399, 0, 13, STR_CHEATS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 14, 0, 399, 14, 147, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 399, 14, 147, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 399, 14, 147, 0x0, STR_CHEATS_TIP}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 399, 14, 147, 0x0, STR_CHEATS_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -275,19 +275,19 @@ static void MusicTrackSelectionWndProc(Window *w, WindowEvent *e)
} }
static const Widget _music_track_selection_widgets[] = { static const Widget _music_track_selection_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 431, 0, 13, STR_01EB_MUSIC_PROGRAM_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 431, 0, 13, STR_01EB_MUSIC_PROGRAM_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 431, 14, 217, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 431, 14, 217, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 2, 181, 22, 215, 0x0, STR_01FA_CLICK_ON_MUSIC_TRACK_TO}, { WWT_IMGBTN, RESIZE_NONE, 14, 2, 181, 22, 215, 0x0, STR_01FA_CLICK_ON_MUSIC_TRACK_TO},
{ WWT_IMGBTN, 14, 250, 429, 22, 215, 0x0, STR_01F2_CURRENT_PROGRAM_OF_MUSIC}, { WWT_IMGBTN, RESIZE_NONE, 14, 250, 429, 22, 215, 0x0, STR_01F2_CURRENT_PROGRAM_OF_MUSIC},
{ WWT_PUSHIMGBTN, 14, 186, 245, 44, 51, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 186, 245, 44, 51, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM},
{ WWT_PUSHIMGBTN, 14, 186, 245, 52, 59, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 186, 245, 52, 59, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC},
{ WWT_PUSHIMGBTN, 14, 186, 245, 60, 67, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 186, 245, 60, 67, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC},
{ WWT_PUSHIMGBTN, 14, 186, 245, 68, 75, 0x0, STR_0330_SELECT_EZY_STREET_STYLE}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 186, 245, 68, 75, 0x0, STR_0330_SELECT_EZY_STREET_STYLE},
{ WWT_PUSHIMGBTN, 14, 186, 245, 76, 83, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 186, 245, 76, 83, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED},
{ WWT_PUSHIMGBTN, 14, 186, 245, 84, 91, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 186, 245, 84, 91, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED},
{ WWT_PUSHIMGBTN, 14, 186, 245, 108, 115, 0x0, STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 186, 245, 108, 115, 0x0, STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1},
{ WWT_PUSHIMGBTN, 14, 186, 245, 124, 131, 0x0, STR_01F9_SAVE_MUSIC_SETTINGS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 186, 245, 124, 131, 0x0, STR_01F9_SAVE_MUSIC_SETTINGS},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -446,24 +446,24 @@ static void MusicWindowWndProc(Window *w, WindowEvent *e)
} }
static const Widget _music_window_widgets[] = { static const Widget _music_window_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 299, 0, 13, STR_01D2_JAZZ_JUKEBOX, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 299, 0, 13, STR_01D2_JAZZ_JUKEBOX, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHIMGBTN, 14, 0, 21, 14, 35, 0x2C5, STR_01DE_SKIP_TO_PREVIOUS_TRACK}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 0, 21, 14, 35, 0x2C5, STR_01DE_SKIP_TO_PREVIOUS_TRACK},
{ WWT_PUSHIMGBTN, 14, 22, 43, 14, 35, 0x2C6, STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 22, 43, 14, 35, 0x2C6, STR_01DF_SKIP_TO_NEXT_TRACK_IN_SELECTION},
{ WWT_PUSHIMGBTN, 14, 44, 65, 14, 35, 0x2C7, STR_01E0_STOP_PLAYING_MUSIC}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 44, 65, 14, 35, 0x2C7, STR_01E0_STOP_PLAYING_MUSIC},
{ WWT_PUSHIMGBTN, 14, 66, 87, 14, 35, 0x2C8, STR_01E1_START_PLAYING_MUSIC}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 66, 87, 14, 35, 0x2C8, STR_01E1_START_PLAYING_MUSIC},
{ WWT_IMGBTN, 14, 88, 299, 14, 35, 0x0, STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC}, { WWT_IMGBTN, RESIZE_NONE, 14, 88, 299, 14, 35, 0x0, STR_01E2_DRAG_SLIDERS_TO_SET_MUSIC},
{ WWT_IMGBTN, 14, 186, 201, 15, 34, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 186, 201, 15, 34, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 299, 36, 57, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 299, 36, 57, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 59, 240, 45, 53, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 59, 240, 45, 53, 0x0, STR_NULL},
{ WWT_PUSHIMGBTN, 14, 6, 55, 42, 49, 0x0, STR_01FB_TOGGLE_PROGRAM_SHUFFLE}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 6, 55, 42, 49, 0x0, STR_01FB_TOGGLE_PROGRAM_SHUFFLE},
{ WWT_PUSHIMGBTN, 14, 244, 293, 42, 49, 0x0, STR_01FC_SHOW_MUSIC_TRACK_SELECTION}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 244, 293, 42, 49, 0x0, STR_01FC_SHOW_MUSIC_TRACK_SELECTION},
{ WWT_PUSHIMGBTN, 14, 0, 49, 58, 65, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 0, 49, 58, 65, 0x0, STR_01F3_SELECT_ALL_TRACKS_PROGRAM},
{ WWT_PUSHIMGBTN, 14, 50, 99, 58, 65, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 50, 99, 58, 65, 0x0, STR_01F4_SELECT_OLD_STYLE_MUSIC},
{ WWT_PUSHIMGBTN, 14, 100, 149, 58, 65, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 100, 149, 58, 65, 0x0, STR_01F5_SELECT_NEW_STYLE_MUSIC},
{ WWT_PUSHIMGBTN, 14, 150, 199, 58, 65, 0x0, STR_0330_SELECT_EZY_STREET_STYLE}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 150, 199, 58, 65, 0x0, STR_0330_SELECT_EZY_STREET_STYLE},
{ WWT_PUSHIMGBTN, 14, 200, 249, 58, 65, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 200, 249, 58, 65, 0x0, STR_01F6_SELECT_CUSTOM_1_USER_DEFINED},
{ WWT_PUSHIMGBTN, 14, 250, 299, 58, 65, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 250, 299, 58, 65, 0x0, STR_01F7_SELECT_CUSTOM_2_USER_DEFINED},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -370,35 +370,35 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e)
} }
static const Widget _network_game_window_widgets[] = { static const Widget _network_game_window_widgets[] = {
{ WWT_CLOSEBOX, BGC, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, BGC, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, BGC, 11, 479, 0, 13, STR_NETWORK_MULTIPLAYER, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, BGC, 11, 479, 0, 13, STR_NETWORK_MULTIPLAYER, STR_NULL},
{ WWT_IMGBTN, BGC, 0, 479, 14, 214, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, BGC, 0, 479, 14, 214, 0x0, STR_NULL},
/* LEFT SIDE */ /* LEFT SIDE */
{ WWT_IMGBTN, BGC, 90, 230, 22, 33, 0x0, STR_NETWORK_ENTER_NAME_TIP}, { WWT_IMGBTN, RESIZE_NONE, BGC, 90, 230, 22, 33, 0x0, STR_NETWORK_ENTER_NAME_TIP},
{ WWT_6, BGC, 90, 230, 42, 53, STR_NETWORK_COMBO1, STR_NETWORK_CONNECTION_TIP}, { WWT_6, RESIZE_NONE, BGC, 90, 230, 42, 53, STR_NETWORK_COMBO1, STR_NETWORK_CONNECTION_TIP},
{ WWT_CLOSEBOX, BGC, 219, 229, 43, 52, STR_0225, STR_NETWORK_CONNECTION_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, BGC, 219, 229, 43, 52, STR_0225, STR_NETWORK_CONNECTION_TIP},
{ WWT_SCROLLBAR, BGC, 220, 230, 62, 185, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, BGC, 220, 230, 62, 185, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_IMGBTN, BTC, 10, 130, 62, 73, 0x0, STR_NETWORK_GAME_NAME_TIP }, { WWT_IMGBTN, RESIZE_NONE, BTC, 10, 130, 62, 73, 0x0, STR_NETWORK_GAME_NAME_TIP },
{ WWT_IMGBTN, BTC, 131, 180, 62, 73, 0x0, STR_NETWORK_CLIENTS_CAPTION_TIP }, { WWT_IMGBTN, RESIZE_NONE, BTC, 131, 180, 62, 73, 0x0, STR_NETWORK_CLIENTS_CAPTION_TIP },
{ WWT_IMGBTN, BTC, 181, 219, 62, 73, 0x0, STR_NETWORK_INFO_ICONS_TIP }, { WWT_IMGBTN, RESIZE_NONE, BTC, 181, 219, 62, 73, 0x0, STR_NETWORK_INFO_ICONS_TIP },
{ WWT_MATRIX, BGC, 10, 219, 74, 185, 0x801, STR_NETWORK_CLICK_GAME_TO_SELECT}, { WWT_MATRIX, RESIZE_NONE, BGC, 10, 219, 74, 185, 0x801, STR_NETWORK_CLICK_GAME_TO_SELECT},
{ WWT_PUSHTXTBTN, BTC, 10, 115, 195, 206, STR_NETWORK_FIND_SERVER, STR_NETWORK_FIND_SERVER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 10, 115, 195, 206, STR_NETWORK_FIND_SERVER, STR_NETWORK_FIND_SERVER_TIP},
{ WWT_PUSHTXTBTN, BTC, 125, 230, 195, 206, STR_NETWORK_ADD_SERVER, STR_NETWORK_ADD_SERVER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 125, 230, 195, 206, STR_NETWORK_ADD_SERVER, STR_NETWORK_ADD_SERVER_TIP},
{ WWT_PUSHTXTBTN, BTC, 250, 355, 195, 206, STR_NETWORK_START_SERVER, STR_NETWORK_START_SERVER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 250, 355, 195, 206, STR_NETWORK_START_SERVER, STR_NETWORK_START_SERVER_TIP},
{ WWT_PUSHTXTBTN, BTC, 365, 470, 195, 206, STR_012E_CANCEL, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 365, 470, 195, 206, STR_012E_CANCEL, STR_NULL},
/* RIGHT SIDE */ /* RIGHT SIDE */
{ WWT_IMGBTN, BGC, 250, 470, 22, 185, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, BGC, 250, 470, 22, 185, 0x0, STR_NULL},
{ WWT_6, BGC, 251, 469, 23, 184, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, BGC, 251, 469, 23, 184, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, BTC, 257, 355, 164, 175, STR_NETWORK_JOIN_GAME, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 257, 355, 164, 175, STR_NETWORK_JOIN_GAME, STR_NULL},
{ WWT_PUSHTXTBTN, BTC, 365, 463, 164, 175, STR_NETWORK_REFRESH, STR_NETWORK_REFRESH_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 365, 463, 164, 175, STR_NETWORK_REFRESH, STR_NETWORK_REFRESH_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -621,28 +621,28 @@ static void NetworkStartServerWindowWndProc(Window *w, WindowEvent *e)
} }
static const Widget _network_start_server_window_widgets[] = { static const Widget _network_start_server_window_widgets[] = {
{ WWT_CLOSEBOX, BGC, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW }, { WWT_CLOSEBOX, RESIZE_NONE, BGC, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW },
{ WWT_CAPTION, BGC, 11, 419, 0, 13, STR_NETWORK_START_GAME_WINDOW, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, BGC, 11, 419, 0, 13, STR_NETWORK_START_GAME_WINDOW, STR_NULL},
{ WWT_IMGBTN, BGC, 0, 419, 14, 199, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, BGC, 0, 419, 14, 199, 0x0, STR_NULL},
{ WWT_IMGBTN, BGC, 100, 271, 22, 33, 0x0, STR_NETWORK_NEW_GAME_NAME_TIP}, { WWT_IMGBTN, RESIZE_NONE, BGC, 100, 271, 22, 33, 0x0, STR_NETWORK_NEW_GAME_NAME_TIP},
{ WWT_PUSHTXTBTN, BTC, 285, 405, 22, 33, STR_NETWORK_SET_PASSWORD, STR_NETWORK_PASSWORD_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 285, 405, 22, 33, STR_NETWORK_SET_PASSWORD, STR_NETWORK_PASSWORD_TIP},
{ WWT_6, BGC, 10, 270, 62, 172, 0x0, STR_NETWORK_SELECT_MAP_TIP}, { WWT_6, RESIZE_NONE, BGC, 10, 270, 62, 172, 0x0, STR_NETWORK_SELECT_MAP_TIP},
{ WWT_SCROLLBAR, BGC, 260, 270, 63, 171, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, BGC, 260, 270, 63, 171, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_6, BGC, 280, 410, 77, 88, STR_NETWORK_COMBO1, STR_NETWORK_CONNECTION_TIP}, { WWT_6, RESIZE_NONE, BGC, 280, 410, 77, 88, STR_NETWORK_COMBO1, STR_NETWORK_CONNECTION_TIP},
{ WWT_CLOSEBOX, BGC, 399, 409, 78, 87, STR_0225, STR_NETWORK_CONNECTION_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, BGC, 399, 409, 78, 87, STR_0225, STR_NETWORK_CONNECTION_TIP},
{ WWT_6, BGC, 280, 410, 109, 120, STR_NETWORK_COMBO2, STR_NETWORK_NUMBER_OF_CLIENTS_TIP}, { WWT_6, RESIZE_NONE, BGC, 280, 410, 109, 120, STR_NETWORK_COMBO2, STR_NETWORK_NUMBER_OF_CLIENTS_TIP},
{ WWT_CLOSEBOX, BGC, 399, 409, 110, 119, STR_0225, STR_NETWORK_NUMBER_OF_CLIENTS_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, BGC, 399, 409, 110, 119, STR_0225, STR_NETWORK_NUMBER_OF_CLIENTS_TIP},
{ WWT_6, BGC, 280, 410, 141, 152, STR_NETWORK_COMBO3, STR_NETWORK_LANGUAGE_TIP}, { WWT_6, RESIZE_NONE, BGC, 280, 410, 141, 152, STR_NETWORK_COMBO3, STR_NETWORK_LANGUAGE_TIP},
{ WWT_CLOSEBOX, BGC, 399, 409, 142, 151, STR_0225, STR_NETWORK_LANGUAGE_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, BGC, 399, 409, 142, 151, STR_0225, STR_NETWORK_LANGUAGE_TIP},
{ WWT_PUSHTXTBTN, BTC, 40, 140, 180, 191, STR_NETWORK_START_GAME, STR_NETWORK_START_GAME_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 40, 140, 180, 191, STR_NETWORK_START_GAME, STR_NETWORK_START_GAME_TIP},
{ WWT_PUSHTXTBTN, BTC, 150, 250, 180, 191, STR_NETWORK_LOAD_GAME, STR_NETWORK_LOAD_GAME_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 150, 250, 180, 191, STR_NETWORK_LOAD_GAME, STR_NETWORK_LOAD_GAME_TIP},
{ WWT_PUSHTXTBTN, BTC, 260, 360, 180, 191, STR_012E_CANCEL, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 260, 360, 180, 191, STR_012E_CANCEL, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -836,24 +836,24 @@ static void NetworkLobbyWindowWndProc(Window *w, WindowEvent *e)
} }
static const Widget _network_lobby_window_widgets[] = { static const Widget _network_lobby_window_widgets[] = {
{ WWT_CLOSEBOX, BGC, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW }, { WWT_CLOSEBOX, RESIZE_NONE, BGC, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW },
{ WWT_CAPTION, BGC, 11, 419, 0, 13, STR_NETWORK_GAME_LOBBY, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, BGC, 11, 419, 0, 13, STR_NETWORK_GAME_LOBBY, STR_NULL},
{ WWT_IMGBTN, BGC, 0, 419, 14, 209, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, BGC, 0, 419, 14, 209, 0x0, STR_NULL},
// company list // company list
{ WWT_6, BGC, 10, 151, 40, 166, 0x0, STR_NETWORK_COMPANY_LIST_TIP}, { WWT_6, RESIZE_NONE, BGC, 10, 151, 40, 166, 0x0, STR_NETWORK_COMPANY_LIST_TIP},
{ WWT_SCROLLBAR, BGC, 140, 150, 41, 165, 0x1, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, BGC, 140, 150, 41, 165, 0x1, STR_0190_SCROLL_BAR_SCROLLS_LIST},
// company/player info // company/player info
{ WWT_IMGBTN, BGC, 158, 389, 38, 165, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, BGC, 158, 389, 38, 165, 0x0, STR_NULL},
{ WWT_6, BGC, 159, 388, 39, 164, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, BGC, 159, 388, 39, 164, 0x0, STR_NULL},
// buttons // buttons
{ WWT_PUSHTXTBTN, BTC, 10, 150, 175, 186, STR_NETWORK_JOIN_COMPANY, STR_NETWORK_JOIN_COMPANY_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 10, 150, 175, 186, STR_NETWORK_JOIN_COMPANY, STR_NETWORK_JOIN_COMPANY_TIP},
{ WWT_PUSHTXTBTN, BTC, 10, 150, 190, 201, STR_NETWORK_NEW_COMPANY, STR_NETWORK_NEW_COMPANY_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 10, 150, 190, 201, STR_NETWORK_NEW_COMPANY, STR_NETWORK_NEW_COMPANY_TIP},
{ WWT_PUSHTXTBTN, BTC, 158, 268, 175, 186, STR_NETWORK_SPECTATE_GAME, STR_NETWORK_SPECTATE_GAME_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 158, 268, 175, 186, STR_NETWORK_SPECTATE_GAME, STR_NETWORK_SPECTATE_GAME_TIP},
{ WWT_PUSHTXTBTN, BTC, 158, 268, 190, 201, STR_NETWORK_REFRESH, STR_NETWORK_REFRESH_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 158, 268, 190, 201, STR_NETWORK_REFRESH, STR_NETWORK_REFRESH_TIP},
{ WWT_PUSHTXTBTN, BTC, 278, 388, 175, 186, STR_012E_CANCEL, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 278, 388, 175, 186, STR_012E_CANCEL, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -902,7 +902,6 @@ static void ClientListWndProc(Window *w, WindowEvent *e);
static void ClientListPopupWndProc(Window *w, WindowEvent *e); static void ClientListPopupWndProc(Window *w, WindowEvent *e);
static byte _selected_clientlist_item = 255; static byte _selected_clientlist_item = 255;
static byte _selected_clientlist_y = 0; static byte _selected_clientlist_y = 0;
static uint16 _client_list_popup_height = 0;
static char _clientlist_action[MAX_CLIENTLIST_ACTION][50]; static char _clientlist_action[MAX_CLIENTLIST_ACTION][50];
static ClientList_Action_Proc *_clientlist_proc[MAX_CLIENTLIST_ACTION]; static ClientList_Action_Proc *_clientlist_proc[MAX_CLIENTLIST_ACTION];
@ -911,16 +910,16 @@ enum {
CLNWND_ROWSIZE = 10 CLNWND_ROWSIZE = 10
}; };
static Widget _client_list_widgets[] = { static const Widget _client_list_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 249, 0, 13, STR_NETWORK_CLIENT_LIST, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 249, 0, 13, STR_NETWORK_CLIENT_LIST, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 249, 14, 14 + CLNWND_ROWSIZE + 1, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 249, 14, 14 + CLNWND_ROWSIZE + 1, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static Widget _client_list_popup_widgets[] = { static const Widget _client_list_popup_widgets[] = {
{ WWT_PANEL, 14, 0, 99, 0, 0, 0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 99, 0, 0, 0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1023,22 +1022,19 @@ static bool CheckClientListHeight(Window *w)
num *= CLNWND_ROWSIZE; num *= CLNWND_ROWSIZE;
// If height is changed // If height is changed
if (_client_list_desc.height != CLNWND_OFFSET + num + 1) { if (w->height != CLNWND_OFFSET + num + 1) {
// XXX - magic unfortunately; (num + 2) has to be one bigger than heigh (num + 1) // XXX - magic unfortunately; (num + 2) has to be one bigger than heigh (num + 1)
_client_list_widgets[2].bottom = _client_list_widgets[2].top + num + 2; SetWindowDirty(w);
_client_list_desc.height = CLNWND_OFFSET + num + 1; w->widget[2].bottom = w->widget[2].top + num + 2;
_client_list_desc.left = w->left; w->height = CLNWND_OFFSET + num + 1;
_client_list_desc.top = w->top; SetWindowDirty(w);
// Delete the window and reallocate.. else we can not change the height ;)
DeleteWindow(w);
w = AllocateWindowDescFront(&_client_list_desc, 0);
return false; return false;
} }
return true; return true;
} }
// Finds the amount of actions in the popup and set the height correct // Finds the amount of actions in the popup and set the height correct
static void UpdateClientListPopupHeigth(void) { static uint ClientListPopupHeigth(void) {
int i, num = 0; int i, num = 0;
// Find the amount of actions // Find the amount of actions
@ -1049,15 +1045,14 @@ static void UpdateClientListPopupHeigth(void) {
} }
num *= CLNWND_ROWSIZE; num *= CLNWND_ROWSIZE;
// Set the height
_client_list_popup_height = num + 2; // XXX - magic, has to be one more than the value below (num + 1) return num + 1;
_client_list_popup_widgets[0].bottom = _client_list_popup_widgets[0].top + num + 1;
} }
// Show the popup (action list) // Show the popup (action list)
static Window *PopupClientList(Window *w, int client_no, int x, int y) static Window *PopupClientList(Window *w, int client_no, int x, int y)
{ {
int i; int i, h;
NetworkClientInfo *ci; NetworkClientInfo *ci;
DeleteWindowById(WC_TOOLBAR_MENU, 0); DeleteWindowById(WC_TOOLBAR_MENU, 0);
@ -1110,12 +1105,13 @@ static Window *PopupClientList(Window *w, int client_no, int x, int y)
_clientlist_proc[i++] = &ClientList_None; _clientlist_proc[i++] = &ClientList_None;
} }
/* Calculate the height */
// Find the right height for the popup h = ClientListPopupHeigth();
UpdateClientListPopupHeigth();
// Allocate the popup // Allocate the popup
w = AllocateWindow(x, y, 100, _client_list_popup_height, ClientListPopupWndProc, WC_TOOLBAR_MENU, _client_list_popup_widgets); w = AllocateWindow(x, y, 100, h + 1, ClientListPopupWndProc, WC_TOOLBAR_MENU, _client_list_popup_widgets);
w->widget[0].bottom = w->widget[0].top + h;
w->flags4 &= ~WF_WHITE_BORDER_MASK; w->flags4 &= ~WF_WHITE_BORDER_MASK;
WP(w,menu_d).item_count = 0; WP(w,menu_d).item_count = 0;
// Save our client // Save our client
@ -1313,10 +1309,10 @@ static void NetworkJoinStatusWindowWndProc(Window *w, WindowEvent *e)
} }
static const Widget _network_join_status_window_widget[] = { static const Widget _network_join_status_window_widget[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 249, 0, 13, STR_NETWORK_CONNECTING, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 249, 0, 13, STR_NETWORK_CONNECTING, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 249, 14, 84, 0x0,STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 249, 14, 84, 0x0,STR_NULL},
{ WWT_PUSHTXTBTN, BTC, 75, 175, 69, 80, STR_NETWORK_DISCONNECT, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, BTC, 75, 175, 69, 80, STR_NETWORK_DISCONNECT, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1427,10 +1423,10 @@ press_ok:;
} }
static const Widget _chat_window_widgets[] = { static const Widget _chat_window_widgets[] = {
{ WWT_IMGBTN, 14, 0, 639, 0, 13, 0x0, STR_NULL}, // background { WWT_IMGBTN, RESIZE_NONE, 14, 0, 639, 0, 13, 0x0, STR_NULL}, // background
{ WWT_IMGBTN, 14, 2, 399, 1, 12, 0x0, STR_NULL}, // text box { WWT_IMGBTN, RESIZE_NONE, 14, 2, 399, 1, 12, 0x0, STR_NULL}, // text box
{ WWT_TEXTBTN, 14, 400, 519, 1, 12, STR_NETWORK_SEND,STR_NULL}, // send button { WWT_TEXTBTN, RESIZE_NONE, 14, 400, 519, 1, 12, STR_NETWORK_SEND,STR_NULL}, // send button
{ WWT_TEXTBTN, 14, 520, 639, 1, 12, STR_012E_CANCEL, STR_NULL}, // cancel button { WWT_TEXTBTN, RESIZE_NONE, 14, 520, 639, 1, 12, STR_012E_CANCEL, STR_NULL}, // cancel button
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -269,8 +269,8 @@ void AddValidatedNewsItem(StringID string, uint32 flags, uint data_a, uint data_
static const byte _news_items_age[] = {60, 60, 90, 60, 90, 30, 150, 30, 90, 180}; static const byte _news_items_age[] = {60, 60, 90, 60, 90, 30, 150, 30, 90, 180};
static const Widget _news_type13_widgets[] = { static const Widget _news_type13_widgets[] = {
{ WWT_PANEL, 15, 0, 429, 0, 169, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 15, 0, 429, 0, 169, 0x0, STR_NULL},
{ WWT_PANEL, 15, 0, 10, 0, 11, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 15, 0, 10, 0, 11, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -283,8 +283,8 @@ static WindowDesc _news_type13_desc = {
}; };
static const Widget _news_type2_widgets[] = { static const Widget _news_type2_widgets[] = {
{ WWT_PANEL, 15, 0, 429, 0, 129, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 15, 0, 429, 0, 129, 0x0, STR_NULL},
{ WWT_PANEL, 15, 0, 10, 0, 11, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 15, 0, 10, 0, 11, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -297,10 +297,10 @@ static WindowDesc _news_type2_desc = {
}; };
static const Widget _news_type0_widgets[] = { static const Widget _news_type0_widgets[] = {
{ WWT_PANEL, 5, 0, 279, 14, 86, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 5, 0, 279, 14, 86, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 5, 0, 10, 0, 13, STR_00C5, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 5, 0, 10, 0, 13, STR_00C5, STR_NULL},
{ WWT_CAPTION, 5, 11, 279, 0, 13, STR_012C_MESSAGE, STR_NULL}, { WWT_CAPTION, RESIZE_NONE, 5, 11, 279, 0, 13, STR_012C_MESSAGE, STR_NULL},
{ WWT_6, 5, 2, 277, 16, 64, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, 5, 2, 277, 16, 64, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -605,10 +605,10 @@ static void MessageHistoryWndProc(Window *w, WindowEvent *e)
} }
static const Widget _message_history_widgets[] = { static const Widget _message_history_widgets[] = {
{ WWT_CLOSEBOX, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 399, 0, 13, STR_MESSAGE_HISTORY, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 13, 11, 399, 0, 13, STR_MESSAGE_HISTORY, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 13, 0, 388, 14, 139, 0x0, STR_MESSAGE_HISTORY_TIP}, { WWT_IMGBTN, RESIZE_NONE, 13, 0, 388, 14, 139, 0x0, STR_MESSAGE_HISTORY_TIP},
{ WWT_SCROLLBAR, 13, 389, 399, 14, 139, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 13, 389, 399, 14, 139, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -688,32 +688,32 @@ static void MessageOptionsWndProc(Window *w, WindowEvent *e)
} }
static const Widget _message_options_widgets[] = { static const Widget _message_options_widgets[] = {
{ WWT_CLOSEBOX, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 369, 0, 13, STR_0204_MESSAGE_OPTIONS,STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 13, 11, 369, 0, 13, STR_0204_MESSAGE_OPTIONS,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 13, 0, 369, 14, 172, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 13, 0, 369, 14, 172, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 26, 37, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 26, 37, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 26, 37, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 26, 37, STR_02B9_FULL, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 38, 49, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 38, 49, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 38, 49, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 38, 49, STR_02B9_FULL, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 50, 61, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 50, 61, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 50, 61, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 50, 61, STR_02B9_FULL, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 62, 73, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 62, 73, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 62, 73, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 62, 73, STR_02B9_FULL, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 74, 85, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 74, 85, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 74, 85, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 74, 85, STR_02B9_FULL, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 86, 97, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 86, 97, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 86, 97, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 86, 97, STR_02B9_FULL, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 98, 109, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 98, 109, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 98, 109, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 98, 109, STR_02B9_FULL, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 110, 121, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 110, 121, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 110, 121, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 110, 121, STR_02B9_FULL, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 122, 133, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 122, 133, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 122, 133, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 122, 133, STR_02B9_FULL, STR_NULL},
{ WWT_CLOSEBOX, 3, 2, 61, 134, 145, STR_02B8_SUMMARY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 2, 61, 134, 145, STR_02B8_SUMMARY, STR_NULL},
{ WWT_CLOSEBOX, 3, 62, 121, 134, 145, STR_02B9_FULL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 62, 121, 134, 145, STR_02B9_FULL, STR_NULL},
{ WWT_PUSHTXTBTN, 3, 15, 170, 154, 165, STR_MESSAGES_DISABLE_ALL,STR_NULL }, { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 15, 170, 154, 165, STR_MESSAGES_DISABLE_ALL,STR_NULL },
{ WWT_PUSHTXTBTN, 3, 200, 355, 154, 165, STR_MESSAGES_ENABLE_ALL, STR_NULL }, { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 200, 355, 154, 165, STR_MESSAGES_ENABLE_ALL, STR_NULL },
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -227,7 +227,7 @@ static Order GetOrderCmdFromTile(Vehicle *v, uint tile)
// check waypoint // check waypoint
if (IS_TILETYPE(tile, MP_RAILWAY) if (IS_TILETYPE(tile, MP_RAILWAY)
&& v->type == VEH_Train && v->type == VEH_Train
&& _map_owner[tile] == _local_player && _map_owner[tile] == _local_player
&& (_map5[tile]&0xFE)==0xC4) { && (_map5[tile]&0xFE)==0xC4) {
order.type = OT_GOTO_WAYPOINT; order.type = OT_GOTO_WAYPOINT;
@ -432,16 +432,16 @@ static void OrdersWndProc(Window *w, WindowEvent *e)
} }
static const Widget _train_orders_widgets[] = { static const Widget _train_orders_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 319, 0, 13, STR_8829_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 319, 0, 13, STR_8829_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, { WWT_PANEL, RESIZE_NONE, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
{ WWT_SCROLLBAR, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 0, 52, 76, 87, STR_8823_SKIP, STR_8853_SKIP_THE_CURRENT_ORDER}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 52, 76, 87, STR_8823_SKIP, STR_8853_SKIP_THE_CURRENT_ORDER},
{ WWT_PUSHTXTBTN, 14, 53, 105, 76, 87, STR_8824_DELETE, STR_8854_DELETE_THE_HIGHLIGHTED}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 53, 105, 76, 87, STR_8824_DELETE, STR_8854_DELETE_THE_HIGHLIGHTED},
{ WWT_PUSHTXTBTN, 14, 106, 158, 76, 87, STR_8825_NON_STOP, STR_8855_MAKE_THE_HIGHLIGHTED_ORDER}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 106, 158, 76, 87, STR_8825_NON_STOP, STR_8855_MAKE_THE_HIGHLIGHTED_ORDER},
{WWT_NODISTXTBTN, 14, 159, 211, 76, 87, STR_8826_GO_TO, STR_8856_INSERT_A_NEW_ORDER_BEFORE}, {WWT_NODISTXTBTN, RESIZE_NONE, 14, 159, 211, 76, 87, STR_8826_GO_TO, STR_8856_INSERT_A_NEW_ORDER_BEFORE},
{ WWT_PUSHTXTBTN, 14, 212, 264, 76, 87, STR_FULLLOAD_OR_SERVICE, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 212, 264, 76, 87, STR_FULLLOAD_OR_SERVICE, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 265, 319, 76, 87, STR_8828_UNLOAD, STR_8858_MAKE_THE_HIGHLIGHTED_ORDER}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 265, 319, 76, 87, STR_8828_UNLOAD, STR_8858_MAKE_THE_HIGHLIGHTED_ORDER},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -454,10 +454,10 @@ static const WindowDesc _train_orders_desc = {
}; };
static const Widget _other_train_orders_widgets[] = { static const Widget _other_train_orders_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 319, 0, 13, STR_8829_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 319, 0, 13, STR_8829_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, { WWT_PANEL, RESIZE_NONE, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
{ WWT_SCROLLBAR, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -471,16 +471,16 @@ static const WindowDesc _other_train_orders_desc = {
static const Widget _roadveh_orders_widgets[] = { static const Widget _roadveh_orders_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 319, 0, 13, STR_900B_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 319, 0, 13, STR_900B_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
{ WWT_SCROLLBAR, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 0, 63, 76, 87, STR_8823_SKIP, STR_8853_SKIP_THE_CURRENT_ORDER}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 63, 76, 87, STR_8823_SKIP, STR_8853_SKIP_THE_CURRENT_ORDER},
{ WWT_PUSHTXTBTN, 14, 64, 127, 76, 87, STR_8824_DELETE, STR_8854_DELETE_THE_HIGHLIGHTED}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 64, 127, 76, 87, STR_8824_DELETE, STR_8854_DELETE_THE_HIGHLIGHTED},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{WWT_NODISTXTBTN, 14, 128, 191, 76, 87, STR_8826_GO_TO, STR_8856_INSERT_A_NEW_ORDER_BEFORE}, {WWT_NODISTXTBTN, RESIZE_NONE, 14, 128, 191, 76, 87, STR_8826_GO_TO, STR_8856_INSERT_A_NEW_ORDER_BEFORE},
{ WWT_PUSHTXTBTN, 14, 192, 255, 76, 87, STR_FULLLOAD_OR_SERVICE, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 192, 255, 76, 87, STR_FULLLOAD_OR_SERVICE, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 256, 319, 76, 87, STR_8828_UNLOAD, STR_8858_MAKE_THE_HIGHLIGHTED_ORDER}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 256, 319, 76, 87, STR_8828_UNLOAD, STR_8858_MAKE_THE_HIGHLIGHTED_ORDER},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -493,10 +493,10 @@ static const WindowDesc _roadveh_orders_desc = {
}; };
static const Widget _other_roadveh_orders_widgets[] = { static const Widget _other_roadveh_orders_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 319, 0, 13, STR_900B_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 319, 0, 13, STR_900B_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
{ WWT_SCROLLBAR, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -509,16 +509,16 @@ static const WindowDesc _other_roadveh_orders_desc = {
}; };
static const Widget _ship_orders_widgets[] = { static const Widget _ship_orders_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 319, 0, 13, STR_9810_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 319, 0, 13, STR_9810_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
{ WWT_SCROLLBAR, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 0, 63, 76, 87, STR_8823_SKIP, STR_8853_SKIP_THE_CURRENT_ORDER}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 63, 76, 87, STR_8823_SKIP, STR_8853_SKIP_THE_CURRENT_ORDER},
{ WWT_PUSHTXTBTN, 14, 64, 127, 76, 87, STR_8824_DELETE, STR_8854_DELETE_THE_HIGHLIGHTED}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 64, 127, 76, 87, STR_8824_DELETE, STR_8854_DELETE_THE_HIGHLIGHTED},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{WWT_NODISTXTBTN, 14, 128, 191, 76, 87, STR_8826_GO_TO, STR_8856_INSERT_A_NEW_ORDER_BEFORE}, {WWT_NODISTXTBTN, RESIZE_NONE, 14, 128, 191, 76, 87, STR_8826_GO_TO, STR_8856_INSERT_A_NEW_ORDER_BEFORE},
{ WWT_PUSHTXTBTN, 14, 192, 255, 76, 87, STR_FULLLOAD_OR_SERVICE, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 192, 255, 76, 87, STR_FULLLOAD_OR_SERVICE, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 256, 319, 76, 87, STR_8828_UNLOAD, STR_8858_MAKE_THE_HIGHLIGHTED_ORDER}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 256, 319, 76, 87, STR_8828_UNLOAD, STR_8858_MAKE_THE_HIGHLIGHTED_ORDER},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -531,10 +531,10 @@ static const WindowDesc _ship_orders_desc = {
}; };
static const Widget _other_ship_orders_widgets[] = { static const Widget _other_ship_orders_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 319, 0, 13, STR_9810_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 319, 0, 13, STR_9810_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
{ WWT_SCROLLBAR, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -548,16 +548,16 @@ static const WindowDesc _other_ship_orders_desc = {
static const Widget _aircraft_orders_widgets[] = { static const Widget _aircraft_orders_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 319, 0, 13, STR_A00B_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 319, 0, 13, STR_A00B_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
{ WWT_SCROLLBAR, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 0, 63, 76, 87, STR_8823_SKIP, STR_8853_SKIP_THE_CURRENT_ORDER}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 63, 76, 87, STR_8823_SKIP, STR_8853_SKIP_THE_CURRENT_ORDER},
{ WWT_PUSHTXTBTN, 14, 64, 127, 76, 87, STR_8824_DELETE, STR_8854_DELETE_THE_HIGHLIGHTED}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 64, 127, 76, 87, STR_8824_DELETE, STR_8854_DELETE_THE_HIGHLIGHTED},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{WWT_NODISTXTBTN, 14, 128, 191, 76, 87, STR_8826_GO_TO, STR_8856_INSERT_A_NEW_ORDER_BEFORE}, {WWT_NODISTXTBTN, RESIZE_NONE, 14, 128, 191, 76, 87, STR_8826_GO_TO, STR_8856_INSERT_A_NEW_ORDER_BEFORE},
{ WWT_PUSHTXTBTN, 14, 192, 255, 76, 87, STR_FULLLOAD_OR_SERVICE, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 192, 255, 76, 87, STR_FULLLOAD_OR_SERVICE, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 256, 319, 76, 87, STR_8828_UNLOAD, STR_8858_MAKE_THE_HIGHLIGHTED_ORDER}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 256, 319, 76, 87, STR_8828_UNLOAD, STR_8858_MAKE_THE_HIGHLIGHTED_ORDER},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -570,10 +570,10 @@ static const WindowDesc _aircraft_orders_desc = {
}; };
static const Widget _other_aircraft_orders_widgets[] = { static const Widget _other_aircraft_orders_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 319, 0, 13, STR_A00B_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 319, 0, 13, STR_A00B_ORDERS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 308, 14, 75, 0x0, STR_8852_ORDERS_LIST_CLICK_ON_ORDER},
{ WWT_SCROLLBAR, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 309, 319, 14, 75, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -95,42 +95,42 @@ static void DrawPlayerEconomyStats(Player *p, byte mode)
} }
static const Widget _player_finances_widgets[] = { static const Widget _player_finances_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 392, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 392, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 393, 406, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW}, { WWT_IMGBTN, RESIZE_NONE, 14, 393, 406, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW},
{ WWT_IMGBTN, 14, 0, 406, 14, 169, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 406, 14, 169, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 406, 170, 203, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 406, 170, 203, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 202, 204, 215, STR_7029_BORROW, STR_7035_INCREASE_SIZE_OF_LOAN}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 202, 204, 215, STR_7029_BORROW, STR_7035_INCREASE_SIZE_OF_LOAN},
{ WWT_PUSHTXTBTN, 14, 203, 406, 204, 215, STR_702A_REPAY, STR_7036_REPAY_PART_OF_LOAN}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 203, 406, 204, 215, STR_702A_REPAY, STR_7036_REPAY_PART_OF_LOAN},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _other_player_finances_widgets[] = { static const Widget _other_player_finances_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 392, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 392, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 393, 406, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW}, { WWT_IMGBTN, RESIZE_NONE, 14, 393, 406, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW},
{ WWT_IMGBTN, 14, 0, 406, 14, 169, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 406, 14, 169, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 406, 170, 203, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 406, 170, 203, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _other_player_finances_small_widgets[] = { static const Widget _other_player_finances_small_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 265, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 265, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 266, 279, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW}, { WWT_IMGBTN, RESIZE_NONE, 14, 266, 279, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 279, 14, 47, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 279, 14, 47, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _player_finances_small_widgets[] = { static const Widget _player_finances_small_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 265, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 265, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 266, 279, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW}, { WWT_IMGBTN, RESIZE_NONE, 14, 266, 279, 0, 13, 0x2AA, STR_7075_TOGGLE_LARGE_SMALL_WINDOW},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 279, 14, 47, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 279, 14, 47, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 139, 48, 59, STR_7029_BORROW, STR_7035_INCREASE_SIZE_OF_LOAN}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 139, 48, 59, STR_7029_BORROW, STR_7035_INCREASE_SIZE_OF_LOAN},
{ WWT_PUSHTXTBTN, 14, 140, 279, 48, 59, STR_702A_REPAY, STR_7036_REPAY_PART_OF_LOAN}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 140, 279, 48, 59, STR_702A_REPAY, STR_7036_REPAY_PART_OF_LOAN},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -287,10 +287,10 @@ static void SelectPlayerColorWndProc(Window *w, WindowEvent *e)
} }
static const Widget _select_player_color_widgets[] = { static const Widget _select_player_color_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 149, 0, 13, STR_7007_NEW_COLOR_SCHEME, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 149, 0, 13, STR_7007_NEW_COLOR_SCHEME, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 138, 14, 127, 0x0, STR_7034_CLICK_ON_SELECTED_NEW_COLOR}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 138, 14, 127, 0x0, STR_7034_CLICK_ON_SELECTED_NEW_COLOR},
{ WWT_SCROLLBAR, 14, 139, 149, 14, 127, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 139, 149, 14, 127, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -335,14 +335,14 @@ static void SelectPlayerFaceWndProc(Window *w, WindowEvent *e)
} }
static const Widget _select_player_face_widgets[] = { static const Widget _select_player_face_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 189, 0, 13, STR_7043_FACE_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 189, 0, 13, STR_7043_FACE_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 189, 14, 136, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 189, 14, 136, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 94, 137, 148, STR_012E_CANCEL, STR_7047_CANCEL_NEW_FACE_SELECTION}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 94, 137, 148, STR_012E_CANCEL, STR_7047_CANCEL_NEW_FACE_SELECTION},
{ WWT_PUSHTXTBTN, 14, 95, 189, 137, 148, STR_012F_OK, STR_7048_ACCEPT_NEW_FACE_SELECTION}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 189, 137, 148, STR_012F_OK, STR_7048_ACCEPT_NEW_FACE_SELECTION},
{ WWT_TEXTBTN, 14, 95, 187, 25, 36, STR_7044_MALE, STR_7049_SELECT_MALE_FACES}, { WWT_TEXTBTN, RESIZE_NONE, 14, 95, 187, 25, 36, STR_7044_MALE, STR_7049_SELECT_MALE_FACES},
{ WWT_TEXTBTN, 14, 95, 187, 37, 48, STR_7045_FEMALE, STR_704A_SELECT_FEMALE_FACES}, { WWT_TEXTBTN, RESIZE_NONE, 14, 95, 187, 37, 48, STR_7045_FEMALE, STR_704A_SELECT_FEMALE_FACES},
{ WWT_PUSHTXTBTN, 14, 95, 187, 79, 90, STR_7046_NEW_FACE, STR_704B_GENERATE_RANDOM_NEW_FACE}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 95, 187, 79, 90, STR_7046_NEW_FACE, STR_704B_GENERATE_RANDOM_NEW_FACE},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -355,45 +355,45 @@ static const WindowDesc _select_player_face_desc = {
}; };
static const Widget _my_player_company_widgets[] = { static const Widget _my_player_company_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 359, 0, 13, STR_7001, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 359, 0, 13, STR_7001, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 359, 14, 157, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 359, 14, 157, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 89, 158, 169, STR_7004_NEW_FACE, STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 89, 158, 169, STR_7004_NEW_FACE, STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT},
{ WWT_PUSHTXTBTN, 14, 90, 179, 158, 169, STR_7005_COLOR_SCHEME, STR_7031_CHANGE_THE_COMPANY_VEHICLE}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 90, 179, 158, 169, STR_7005_COLOR_SCHEME, STR_7031_CHANGE_THE_COMPANY_VEHICLE},
{ WWT_PUSHTXTBTN, 14, 180, 269, 158, 169, STR_7009_PRESIDENT_NAME, STR_7032_CHANGE_THE_PRESIDENT_S}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 180, 269, 158, 169, STR_7009_PRESIDENT_NAME, STR_7032_CHANGE_THE_PRESIDENT_S},
{ WWT_PUSHTXTBTN, 14, 270, 359, 158, 169, STR_7008_COMPANY_NAME, STR_7033_CHANGE_THE_COMPANY_NAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 270, 359, 158, 169, STR_7008_COMPANY_NAME, STR_7033_CHANGE_THE_COMPANY_NAME},
{ WWT_PUSHTXTBTN, 14, 266, 355, 18, 29, STR_706F_BUILD_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 18, 29, STR_706F_BUILD_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS},
{ WWT_EMPTY, 14, 266, 355, 32, 43, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 14, 266, 355, 32, 43, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 266, 355, 138, 149, STR_COMPANY_PASSWORD, STR_COMPANY_PASSWORD_TOOLTIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 138, 149, STR_COMPANY_PASSWORD, STR_COMPANY_PASSWORD_TOOLTIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _other_player_company_widgets[] = { static const Widget _other_player_company_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 359, 0, 13, STR_7001, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 359, 0, 13, STR_7001, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 359, 14, 157, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 359, 14, 157, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 266, 355, 18, 29, STR_7072_VIEW_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 18, 29, STR_7072_VIEW_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 179, 158, 169, STR_7077_BUY_25_SHARE_IN_COMPANY, STR_7079_BUY_25_SHARE_IN_THIS_COMPANY}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 179, 158, 169, STR_7077_BUY_25_SHARE_IN_COMPANY, STR_7079_BUY_25_SHARE_IN_THIS_COMPANY},
{ WWT_PUSHTXTBTN, 14, 180, 359, 158, 169, STR_7078_SELL_25_SHARE_IN_COMPANY, STR_707A_SELL_25_SHARE_IN_THIS_COMPANY}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 180, 359, 158, 169, STR_7078_SELL_25_SHARE_IN_COMPANY, STR_707A_SELL_25_SHARE_IN_THIS_COMPANY},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _my_player_company_bh_widgets[] = { static const Widget _my_player_company_bh_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 359, 0, 13, STR_7001, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 359, 0, 13, STR_7001, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 359, 14, 157, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 359, 14, 157, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 89, 158, 169, STR_7004_NEW_FACE, STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 89, 158, 169, STR_7004_NEW_FACE, STR_7030_SELECT_NEW_FACE_FOR_PRESIDENT},
{ WWT_PUSHTXTBTN, 14, 90, 179, 158, 169, STR_7005_COLOR_SCHEME, STR_7031_CHANGE_THE_COMPANY_VEHICLE}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 90, 179, 158, 169, STR_7005_COLOR_SCHEME, STR_7031_CHANGE_THE_COMPANY_VEHICLE},
{ WWT_PUSHTXTBTN, 14, 180, 269, 158, 169, STR_7009_PRESIDENT_NAME, STR_7032_CHANGE_THE_PRESIDENT_S}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 180, 269, 158, 169, STR_7009_PRESIDENT_NAME, STR_7032_CHANGE_THE_PRESIDENT_S},
{ WWT_PUSHTXTBTN, 14, 270, 359, 158, 169, STR_7008_COMPANY_NAME, STR_7033_CHANGE_THE_COMPANY_NAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 270, 359, 158, 169, STR_7008_COMPANY_NAME, STR_7033_CHANGE_THE_COMPANY_NAME},
{ WWT_PUSHTXTBTN, 14, 266, 355, 18, 29, STR_7072_VIEW_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 18, 29, STR_7072_VIEW_HQ, STR_7070_BUILD_COMPANY_HEADQUARTERS},
{ WWT_PUSHTXTBTN, 14, 266, 355, 32, 43, STR_RELOCATE_HQ, STR_RELOCATE_COMPANY_HEADQUARTERS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 32, 43, STR_RELOCATE_HQ, STR_RELOCATE_COMPANY_HEADQUARTERS},
{ WWT_PUSHTXTBTN, 14, 266, 355, 138, 149, STR_COMPANY_PASSWORD, STR_COMPANY_PASSWORD_TOOLTIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 266, 355, 138, 149, STR_COMPANY_PASSWORD, STR_COMPANY_PASSWORD_TOOLTIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -490,8 +490,9 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e)
Player *p = DEREF_PLAYER(w->window_number); Player *p = DEREF_PLAYER(w->window_number);
uint32 dis; uint32 dis;
if (w->widget != _other_player_company_widgets) { if (!IsWindowOfPrototype(w, _other_player_company_widgets)) {
w->widget = (p->location_of_house != 0) ? _my_player_company_bh_widgets : _my_player_company_widgets; AssignWidgetToWindow(w, (p->location_of_house != 0) ? _my_player_company_bh_widgets : _my_player_company_widgets);
if (!_networking) w->hidden_state |= (1 << 9); // hide company-password widget if (!_networking) w->hidden_state |= (1 << 9); // hide company-password widget
} }
@ -582,7 +583,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e)
break; break;
case 9: {/* buy 25% or password protect your company */ case 9: {/* buy 25% or password protect your company */
#ifdef ENABLE_NETWORK #ifdef ENABLE_NETWORK
if (w->widget != _other_player_company_widgets) { if (!IsWindowOfPrototype(w, _other_player_company_widgets)) {
StringID str; StringID str;
WP(w,def_d).byte_1 = 2; WP(w,def_d).byte_1 = 2;
str = AllocateName(_network_player_info[_local_player].password, 0); str = AllocateName(_network_player_info[_local_player].password, 0);
@ -705,11 +706,11 @@ static void BuyCompanyWndProc(Window *w, WindowEvent *e)
} }
static const Widget _buy_company_widgets[] = { static const Widget _buy_company_widgets[] = {
{ WWT_TEXTBTN, 5, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 5, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 5, 11, 333, 0, 13, STR_00B3_MESSAGE_FROM, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 5, 11, 333, 0, 13, STR_00B3_MESSAGE_FROM, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 5, 0, 333, 14, 136, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 5, 0, 333, 14, 136, 0x0, STR_NULL},
{ WWT_TEXTBTN, 5, 148, 207, 117, 128, STR_00C9_NO, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 5, 148, 207, 117, 128, STR_00C9_NO, STR_NULL},
{ WWT_TEXTBTN, 5, 218, 277, 117, 128, STR_00C8_YES, STR_NULL}, { WWT_TEXTBTN, RESIZE_NONE, 5, 218, 277, 117, 128, STR_00C8_YES, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -684,30 +684,30 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e)
static const Widget _build_railroad_widgets[] = { static const Widget _build_railroad_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 359, 0, 13, STR_100A_RAILROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 359, 0, 13, STR_100A_RAILROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 7, 360, 371, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 7, 360, 371, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 7, 110, 113, 14, 35, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 110, 113, 14, 35, 0x0, STR_NULL},
{ WWT_PANEL, 7, 0, 21, 14, 35, 0x4E3, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 0, 21, 14, 35, 0x4E3, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 22, 43, 14, 35, 0x4E4, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 22, 43, 14, 35, 0x4E4, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 44, 65, 14, 35, 0x4E5, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 44, 65, 14, 35, 0x4E5, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 66, 87, 14, 35, 0x4E6, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 66, 87, 14, 35, 0x4E6, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 0, STR_BUILD_AUTORAIL_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 0, STR_BUILD_AUTORAIL_TIP},
{ WWT_PANEL, 7, 114, 135, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC}, { WWT_PANEL, RESIZE_NONE, 7, 114, 135, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
{ WWT_PANEL, 7, 136, 157, 14, 35, 0x50E, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING}, { WWT_PANEL, RESIZE_NONE, 7, 136, 157, 14, 35, 0x50E, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
{ WWT_PANEL, 7, 158, 179, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 158, 179, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP},
{ WWT_PANEL, 7, 180, 221, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION}, { WWT_PANEL, RESIZE_NONE, 7, 180, 221, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION},
{ WWT_PANEL, 7, 222, 243, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS}, { WWT_PANEL, RESIZE_NONE, 7, 222, 243, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS},
{ WWT_PANEL, 7, 244, 285, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE}, { WWT_PANEL, RESIZE_NONE, 7, 244, 285, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE},
{ WWT_PANEL, 7, 286, 305, 14, 35, 0x97E, STR_101D_BUILD_RAILROAD_TUNNEL}, { WWT_PANEL, RESIZE_NONE, 7, 286, 305, 14, 35, 0x97E, STR_101D_BUILD_RAILROAD_TUNNEL},
{ WWT_PANEL, 7, 306, 327, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR}, { WWT_PANEL, RESIZE_NONE, 7, 306, 327, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR},
{ WWT_PANEL, 7, 328, 349, 14, 35, SPR_OPENTTD_BASE + 25, STR_CONVERT_RAIL_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 328, 349, 14, 35, SPR_OPENTTD_BASE + 25, STR_CONVERT_RAIL_TIP},
{ WWT_PANEL, 7, 350, 371, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 350, 371, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -721,30 +721,30 @@ static const WindowDesc _build_railroad_desc = {
}; };
static const Widget _build_monorail_widgets[] = { static const Widget _build_monorail_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 359, 0, 13, STR_100B_MONORAIL_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 359, 0, 13, STR_100B_MONORAIL_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 7, 360, 371, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 7, 360, 371, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 7, 110, 113, 14, 35, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 110, 113, 14, 35, 0x0, STR_NULL},
{ WWT_PANEL, 7, 0, 21, 14, 35, 0x4E7, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 0, 21, 14, 35, 0x4E7, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 22, 43, 14, 35, 0x4E8, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 22, 43, 14, 35, 0x4E8, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 44, 65, 14, 35, 0x4E9, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 44, 65, 14, 35, 0x4E9, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 66, 87, 14, 35, 0x4EA, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 66, 87, 14, 35, 0x4EA, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 1, STR_BUILD_AUTORAIL_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 1, STR_BUILD_AUTORAIL_TIP},
{ WWT_PANEL, 7, 114, 135, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC}, { WWT_PANEL, RESIZE_NONE, 7, 114, 135, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
{ WWT_PANEL, 7, 136, 157, 14, 35, SPR_OPENTTD_BASE + 12, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING}, { WWT_PANEL, RESIZE_NONE, 7, 136, 157, 14, 35, SPR_OPENTTD_BASE + 12, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
{ WWT_PANEL, 7, 158, 179, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 158, 179, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP},
{ WWT_PANEL, 7, 180, 221, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION}, { WWT_PANEL, RESIZE_NONE, 7, 180, 221, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION},
{ WWT_PANEL, 7, 222, 243, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS}, { WWT_PANEL, RESIZE_NONE, 7, 222, 243, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS},
{ WWT_PANEL, 7, 244, 285, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE}, { WWT_PANEL, RESIZE_NONE, 7, 244, 285, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE},
{ WWT_PANEL, 7, 286, 305, 14, 35, 0x97F, STR_101D_BUILD_RAILROAD_TUNNEL}, { WWT_PANEL, RESIZE_NONE, 7, 286, 305, 14, 35, 0x97F, STR_101D_BUILD_RAILROAD_TUNNEL},
{ WWT_PANEL, 7, 306, 327, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR}, { WWT_PANEL, RESIZE_NONE, 7, 306, 327, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR},
{ WWT_PANEL, 7, 328, 349, 14, 35, SPR_OPENTTD_BASE + 27, STR_CONVERT_RAIL_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 328, 349, 14, 35, SPR_OPENTTD_BASE + 27, STR_CONVERT_RAIL_TIP},
{ WWT_PANEL, 7, 350, 371, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 350, 371, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -758,30 +758,30 @@ static const WindowDesc _build_monorail_desc = {
}; };
static const Widget _build_maglev_widgets[] = { static const Widget _build_maglev_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 359, 0, 13, STR_100C_MAGLEV_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 359, 0, 13, STR_100C_MAGLEV_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 7, 360, 371, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 7, 360, 371, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 7, 110, 113, 14, 35, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 110, 113, 14, 35, 0x0, STR_NULL},
{ WWT_PANEL, 7, 0, 21, 14, 35, 0x4EB, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 0, 21, 14, 35, 0x4EB, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 22, 43, 14, 35, 0x4EC, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 22, 43, 14, 35, 0x4EC, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 44, 65, 14, 35, 0x4EE, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 44, 65, 14, 35, 0x4EE, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 66, 87, 14, 35, 0x4ED, STR_1018_BUILD_RAILROAD_TRACK}, { WWT_PANEL, RESIZE_NONE, 7, 66, 87, 14, 35, 0x4ED, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 2, STR_BUILD_AUTORAIL_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 2, STR_BUILD_AUTORAIL_TIP},
{ WWT_PANEL, 7, 114, 135, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC}, { WWT_PANEL, RESIZE_NONE, 7, 114, 135, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
{ WWT_PANEL, 7, 136, 157, 14, 35, SPR_OPENTTD_BASE + 13, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING}, { WWT_PANEL, RESIZE_NONE, 7, 136, 157, 14, 35, SPR_OPENTTD_BASE + 13, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
{ WWT_PANEL, 7, 158, 179, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 158, 179, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP},
{ WWT_PANEL, 7, 180, 221, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION}, { WWT_PANEL, RESIZE_NONE, 7, 180, 221, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION},
{ WWT_PANEL, 7, 222, 243, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS}, { WWT_PANEL, RESIZE_NONE, 7, 222, 243, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS},
{ WWT_PANEL, 7, 244, 285, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE}, { WWT_PANEL, RESIZE_NONE, 7, 244, 285, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE},
{ WWT_PANEL, 7, 286, 305, 14, 35, 0x980, STR_101D_BUILD_RAILROAD_TUNNEL}, { WWT_PANEL, RESIZE_NONE, 7, 286, 305, 14, 35, 0x980, STR_101D_BUILD_RAILROAD_TUNNEL},
{ WWT_PANEL, 7, 306, 327, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR}, { WWT_PANEL, RESIZE_NONE, 7, 306, 327, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR},
{ WWT_PANEL, 7, 328, 349, 14, 35, SPR_OPENTTD_BASE + 29, STR_CONVERT_RAIL_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 328, 349, 14, 35, SPR_OPENTTD_BASE + 29, STR_CONVERT_RAIL_TIP},
{ WWT_PANEL, 7, 350, 371, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 350, 371, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -955,33 +955,33 @@ static void StationBuildWndProc(Window *w, WindowEvent *e) {
} }
static const Widget _station_builder_widgets[] = { static const Widget _station_builder_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 147, 0, 13, STR_3000_RAIL_STATION_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 147, 0, 13, STR_3000_RAIL_STATION_SELECTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 147, 14, 199, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 147, 14, 199, 0x0, STR_NULL},
{ WWT_PANEL, 14, 7, 72, 26, 73, 0x0, STR_304E_SELECT_RAILROAD_STATION}, { WWT_PANEL, RESIZE_NONE, 14, 7, 72, 26, 73, 0x0, STR_304E_SELECT_RAILROAD_STATION},
{ WWT_PANEL, 14, 75, 140, 26, 73, 0x0, STR_304E_SELECT_RAILROAD_STATION}, { WWT_PANEL, RESIZE_NONE, 14, 75, 140, 26, 73, 0x0, STR_304E_SELECT_RAILROAD_STATION},
{ WWT_CLOSEBOX, 14, 22, 36, 87, 98, STR_00CB_1, STR_304F_SELECT_NUMBER_OF_PLATFORMS}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 22, 36, 87, 98, STR_00CB_1, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
{ WWT_CLOSEBOX, 14, 37, 51, 87, 98, STR_00CC_2, STR_304F_SELECT_NUMBER_OF_PLATFORMS}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 37, 51, 87, 98, STR_00CC_2, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
{ WWT_CLOSEBOX, 14, 52, 66, 87, 98, STR_00CD_3, STR_304F_SELECT_NUMBER_OF_PLATFORMS}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 52, 66, 87, 98, STR_00CD_3, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
{ WWT_CLOSEBOX, 14, 67, 81, 87, 98, STR_00CE_4, STR_304F_SELECT_NUMBER_OF_PLATFORMS}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 67, 81, 87, 98, STR_00CE_4, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
{ WWT_CLOSEBOX, 14, 82, 96, 87, 98, STR_00CF_5, STR_304F_SELECT_NUMBER_OF_PLATFORMS}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 82, 96, 87, 98, STR_00CF_5, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
{ WWT_CLOSEBOX, 14, 97, 111, 87, 98, STR_0335_6, STR_304F_SELECT_NUMBER_OF_PLATFORMS}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 97, 111, 87, 98, STR_0335_6, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
{ WWT_CLOSEBOX, 14, 112, 126, 87, 98, STR_0336_7, STR_304F_SELECT_NUMBER_OF_PLATFORMS}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 112, 126, 87, 98, STR_0336_7, STR_304F_SELECT_NUMBER_OF_PLATFORMS},
{ WWT_CLOSEBOX, 14, 22, 36, 112, 123, STR_00CB_1, STR_3050_SELECT_LENGTH_OF_RAILROAD}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 22, 36, 112, 123, STR_00CB_1, STR_3050_SELECT_LENGTH_OF_RAILROAD},
{ WWT_CLOSEBOX, 14, 37, 51, 112, 123, STR_00CC_2, STR_3050_SELECT_LENGTH_OF_RAILROAD}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 37, 51, 112, 123, STR_00CC_2, STR_3050_SELECT_LENGTH_OF_RAILROAD},
{ WWT_CLOSEBOX, 14, 52, 66, 112, 123, STR_00CD_3, STR_3050_SELECT_LENGTH_OF_RAILROAD}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 52, 66, 112, 123, STR_00CD_3, STR_3050_SELECT_LENGTH_OF_RAILROAD},
{ WWT_CLOSEBOX, 14, 67, 81, 112, 123, STR_00CE_4, STR_3050_SELECT_LENGTH_OF_RAILROAD}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 67, 81, 112, 123, STR_00CE_4, STR_3050_SELECT_LENGTH_OF_RAILROAD},
{ WWT_CLOSEBOX, 14, 82, 96, 112, 123, STR_00CF_5, STR_3050_SELECT_LENGTH_OF_RAILROAD}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 82, 96, 112, 123, STR_00CF_5, STR_3050_SELECT_LENGTH_OF_RAILROAD},
{ WWT_CLOSEBOX, 14, 97, 111, 112, 123, STR_0335_6, STR_3050_SELECT_LENGTH_OF_RAILROAD}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 97, 111, 112, 123, STR_0335_6, STR_3050_SELECT_LENGTH_OF_RAILROAD},
{ WWT_CLOSEBOX, 14, 112, 126, 112, 123, STR_0336_7, STR_3050_SELECT_LENGTH_OF_RAILROAD}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 112, 126, 112, 123, STR_0336_7, STR_3050_SELECT_LENGTH_OF_RAILROAD},
//{ WWT_CLOSEBOX, 14, 14, 73, 137, 148, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE}, //{ WWT_CLOSEBOX, RESIZE_NONE, 14, 14, 73, 137, 148, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE},
//{ WWT_CLOSEBOX, 14, 74, 133, 137, 148, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, //{ WWT_CLOSEBOX, RESIZE_NONE, 14, 74, 133, 137, 148, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA},
{ WWT_CLOSEBOX, 14, 37, 111, 126, 137, STR_DRAG_DROP, STR_STATION_DRAG_DROP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 37, 111, 126, 137, STR_DRAG_DROP, STR_STATION_DRAG_DROP},
{ WWT_CLOSEBOX, 14, 14, 73, 152, 163, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 14, 73, 152, 163, STR_02DB_OFF, STR_3065_DON_T_HIGHLIGHT_COVERAGE},
{ WWT_CLOSEBOX, 14, 74, 133, 152, 163, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 74, 133, 152, 163, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1038,13 +1038,13 @@ static void BuildTrainDepotWndProc(Window *w, WindowEvent *e)
} }
static const Widget _build_depot_widgets[] = { static const Widget _build_depot_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 139, 0, 13, STR_1014_TRAIN_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_1014_TRAIN_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 139, 14, 121, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 121, 0x0, STR_NULL},
{ WWT_PANEL, 14, 71, 136, 17, 66, 0x0, STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO}, { WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO},
{ WWT_PANEL, 14, 71, 136, 69, 118, 0x0, STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO}, { WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO},
{ WWT_PANEL, 14, 3, 68, 69, 118, 0x0, STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO}, { WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO},
{ WWT_PANEL, 14, 3, 68, 17, 66, 0x0, STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO}, { WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_1020_SELECT_RAILROAD_DEPOT_ORIENTATIO},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1096,7 +1096,7 @@ static void BuildWaypointWndProc(Window *w, WindowEvent *e)
} }
break; break;
} }
case WE_MOUSELOOP: case WE_MOUSELOOP:
if (WP(w,def_d).close) if (WP(w,def_d).close)
DeleteWindow(w); DeleteWindow(w);
@ -1105,17 +1105,17 @@ static void BuildWaypointWndProc(Window *w, WindowEvent *e)
} }
static const Widget _build_waypoint_widgets[] = { static const Widget _build_waypoint_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 343, 0, 13, STR_WAYPOINT,STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 343, 0, 13, STR_WAYPOINT,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 343, 14, 91, 0x0, 0}, { WWT_PANEL, RESIZE_NONE, 7, 0, 343, 14, 91, 0x0, 0},
{ WWT_PANEL, 7, 3, 68, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 3, 68, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP},
{ WWT_PANEL, 7, 71, 136, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 71, 136, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP},
{ WWT_PANEL, 7, 139, 204, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 139, 204, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP},
{ WWT_PANEL, 7, 207, 272, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 207, 272, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP},
{ WWT_PANEL, 7, 275, 340, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 275, 340, 17, 76, 0x0, STR_WAYPOINT_GRAPHICS_TIP},
{ WWT_HSCROLLBAR, 7, 1, 343, 80, 91, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_HSCROLLBAR, RESIZE_NONE, 7, 1, 343, 80, 91, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -277,20 +277,20 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) {
} }
static const Widget _build_road_widgets[] = { static const Widget _build_road_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 227, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 227, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 7, 228, 239, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 7, 228, 239, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 7, 0, 21, 14, 35, SPR_IMG_ROAD_NW, STR_180B_BUILD_ROAD_SECTION}, { WWT_PANEL, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_ROAD_NW, STR_180B_BUILD_ROAD_SECTION},
{ WWT_PANEL, 7, 22, 43, 14, 35, SPR_IMG_ROAD_NE, STR_180B_BUILD_ROAD_SECTION}, { WWT_PANEL, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_ROAD_NE, STR_180B_BUILD_ROAD_SECTION},
{ WWT_PANEL, 7, 44, 65, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, { WWT_PANEL, RESIZE_NONE, 7, 44, 65, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC},
{ WWT_PANEL, 7, 66, 87, 14, 35, SPR_IMG_ROAD_DEPOT, STR_180C_BUILD_ROAD_VEHICLE_DEPOT}, { WWT_PANEL, RESIZE_NONE, 7, 66, 87, 14, 35, SPR_IMG_ROAD_DEPOT, STR_180C_BUILD_ROAD_VEHICLE_DEPOT},
{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_IMG_BUS_STATION, STR_180D_BUILD_BUS_STATION}, { WWT_PANEL, RESIZE_NONE, 7, 88, 109, 14, 35, SPR_IMG_BUS_STATION, STR_180D_BUILD_BUS_STATION},
{ WWT_PANEL, 7, 110, 131, 14, 35, SPR_IMG_TRUCK_BAY, STR_180E_BUILD_TRUCK_LOADING_BAY}, { WWT_PANEL, RESIZE_NONE, 7, 110, 131, 14, 35, SPR_IMG_TRUCK_BAY, STR_180E_BUILD_TRUCK_LOADING_BAY},
{ WWT_PANEL, 7, 132, 173, 14, 35, SPR_IMG_BRIDGE, STR_180F_BUILD_ROAD_BRIDGE}, { WWT_PANEL, RESIZE_NONE, 7, 132, 173, 14, 35, SPR_IMG_BRIDGE, STR_180F_BUILD_ROAD_BRIDGE},
{ WWT_PANEL, 7, 174, 195, 14, 35, SPR_IMG_ROAD_TUNNEL, STR_1810_BUILD_ROAD_TUNNEL}, { WWT_PANEL, RESIZE_NONE, 7, 174, 195, 14, 35, SPR_IMG_ROAD_TUNNEL, STR_1810_BUILD_ROAD_TUNNEL},
{ WWT_PANEL, 7, 196, 217, 14, 35, SPR_IMG_REMOVE, STR_1811_TOGGLE_BUILD_REMOVE_FOR}, { WWT_PANEL, RESIZE_NONE, 7, 196, 217, 14, 35, SPR_IMG_REMOVE, STR_1811_TOGGLE_BUILD_REMOVE_FOR},
{ WWT_PANEL, 7, 218, 239, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 218, 239, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -309,20 +309,20 @@ void ShowBuildRoadToolbar()
} }
static const Widget _build_road_scen_widgets[] = { static const Widget _build_road_scen_widgets[] = {
{ WWT_TEXTBTN, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 161, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 161, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 7, 162, 173, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 7, 162, 173, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 7, 0, 21, 14, 35, 0x51D, STR_180B_BUILD_ROAD_SECTION}, { WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, 0x51D, STR_180B_BUILD_ROAD_SECTION},
{ WWT_IMGBTN, 7, 22, 43, 14, 35, 0x51E, STR_180B_BUILD_ROAD_SECTION}, { WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, 0x51E, STR_180B_BUILD_ROAD_SECTION},
{ WWT_IMGBTN, 7, 44, 65, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC}, { WWT_IMGBTN, RESIZE_NONE, 7, 44, 65, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_IMGBTN, 7, 66, 107, 14, 35, 0xA22, STR_180F_BUILD_ROAD_BRIDGE}, { WWT_IMGBTN, RESIZE_NONE, 7, 66, 107, 14, 35, 0xA22, STR_180F_BUILD_ROAD_BRIDGE},
{ WWT_IMGBTN, 7, 108, 129, 14, 35, 0x97D, STR_1810_BUILD_ROAD_TUNNEL}, { WWT_IMGBTN, RESIZE_NONE, 7, 108, 129, 14, 35, 0x97D, STR_1810_BUILD_ROAD_TUNNEL},
{ WWT_IMGBTN, 7, 130, 151, 14, 35, 0x2CA, STR_1811_TOGGLE_BUILD_REMOVE_FOR}, { WWT_IMGBTN, RESIZE_NONE, 7, 130, 151, 14, 35, 0x2CA, STR_1811_TOGGLE_BUILD_REMOVE_FOR},
{ WWT_PANEL, 7, 152, 173, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP}, { WWT_PANEL, RESIZE_NONE, 7, 152, 173, 14, 35, SPR_IMG_LANDSCAPING, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -375,13 +375,13 @@ static void BuildRoadDepotWndProc(Window *w, WindowEvent *e) {
} }
static const Widget _build_road_depot_widgets[] = { static const Widget _build_road_depot_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 139, 0, 13, STR_1806_ROAD_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_1806_ROAD_DEPOT_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 139, 14, 121, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 121, 0x0, STR_NULL},
{ WWT_PANEL, 14, 71, 136, 17, 66, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, { WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT},
{ WWT_PANEL, 14, 71, 136, 69, 118, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, { WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT},
{ WWT_PANEL, 14, 3, 68, 69, 118, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, { WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT},
{ WWT_PANEL, 14, 3, 68, 17, 66, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT}, { WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_1813_SELECT_ROAD_VEHICLE_DEPOT},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -401,7 +401,7 @@ static void ShowRoadDepotPicker()
static void RoadStationPickerWndProc(Window *w, WindowEvent *e) { static void RoadStationPickerWndProc(Window *w, WindowEvent *e) {
int rad; int rad;
switch(e->event) { switch(e->event) {
case WE_PAINT: { case WE_PAINT: {
int image; int image;
@ -411,13 +411,13 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e) {
DrawWindowWidgets(w); DrawWindowWidgets(w);
SetTileSelectSize(1, 1); SetTileSelectSize(1, 1);
if (_patches.modified_catchment) { if (_patches.modified_catchment) {
rad = CA_TRUCK; // = CA_BUS rad = CA_TRUCK; // = CA_BUS
} else { } else {
rad = 4; rad = 4;
} }
if (_station_show_coverage) if (_station_show_coverage)
SetTileSelectBigSize(-rad, -rad, 2*rad, 2*rad); SetTileSelectBigSize(-rad, -rad, 2*rad, 2*rad);
@ -469,15 +469,15 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e) {
} }
static const Widget _bus_station_picker_widgets[] = { static const Widget _bus_station_picker_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 139, 0, 13, STR_3042_BUS_STATION_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_3042_BUS_STATION_ORIENTATION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 139, 14, 176, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 176, 0x0, STR_NULL},
{ WWT_PANEL, 14, 71, 136, 17, 66, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, { WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION},
{ WWT_PANEL, 14, 71, 136, 69, 118, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, { WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION},
{ WWT_PANEL, 14, 3, 68, 69, 118, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, { WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION},
{ WWT_PANEL, 14, 3, 68, 17, 66, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION}, { WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_3051_SELECT_BUS_STATION_ORIENTATION},
{ WWT_CLOSEBOX, 14, 10, 69, 133, 144, STR_02DB_OFF,STR_3065_DON_T_HIGHLIGHT_COVERAGE}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 10, 69, 133, 144, STR_02DB_OFF,STR_3065_DON_T_HIGHLIGHT_COVERAGE},
{ WWT_CLOSEBOX, 14, 70, 129, 133, 144, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 70, 129, 133, 144, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -495,15 +495,15 @@ static void ShowBusStationPicker()
} }
static const Widget _truck_station_picker_widgets[] = { static const Widget _truck_station_picker_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 139, 0, 13, STR_3043_TRUCK_STATION_ORIENT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 139, 0, 13, STR_3043_TRUCK_STATION_ORIENT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 0, 139, 14, 176, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 0, 139, 14, 176, 0x0, STR_NULL},
{ WWT_PANEL, 14, 71, 136, 17, 66, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, { WWT_PANEL, RESIZE_NONE, 14, 71, 136, 17, 66, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY},
{ WWT_PANEL, 14, 71, 136, 69, 118, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, { WWT_PANEL, RESIZE_NONE, 14, 71, 136, 69, 118, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY},
{ WWT_PANEL, 14, 3, 68, 69, 118, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, { WWT_PANEL, RESIZE_NONE, 14, 3, 68, 69, 118, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY},
{ WWT_PANEL, 14, 3, 68, 17, 66, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY}, { WWT_PANEL, RESIZE_NONE, 14, 3, 68, 17, 66, 0x0, STR_3052_SELECT_TRUCK_LOADING_BAY},
{ WWT_CLOSEBOX, 14, 10, 69, 133, 144, STR_02DB_OFF,STR_3065_DON_T_HIGHLIGHT_COVERAGE}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 10, 69, 133, 144, STR_02DB_OFF,STR_3065_DON_T_HIGHLIGHT_COVERAGE},
{ WWT_CLOSEBOX, 14, 70, 129, 133, 144, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 70, 129, 133, 144, STR_02DA_ON, STR_3064_HIGHLIGHT_COVERAGE_AREA},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -169,14 +169,14 @@ change_int:
} }
static const Widget _roadveh_details_widgets[] = { static const Widget _roadveh_details_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 339, 0, 13, STR_900C_DETAILS,STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 339, 0, 13, STR_900C_DETAILS,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 340, 379, 0, 13, STR_01AA_NAME, STR_902E_NAME_ROAD_VEHICLE}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 340, 379, 0, 13, STR_01AA_NAME, STR_902E_NAME_ROAD_VEHICLE},
{ WWT_IMGBTN, 14, 0, 379, 14, 55, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 379, 14, 55, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 379, 56, 88, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 379, 56, 88, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 10, 89, 94, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 89, 94, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL},
{ WWT_PUSHTXTBTN, 14, 0, 10, 95, 100, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 95, 100, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL},
{ WWT_IMGBTN, 14, 11, 379, 89, 100, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 11, 379, 89, 100, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -290,17 +290,17 @@ static void RoadVehViewWndProc(Window *w, WindowEvent *e)
} }
static const Widget _roadveh_view_widgets[] = { static const Widget _roadveh_view_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 237, 0, 13, STR_9002, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 237, 0, 13, STR_9002, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 238, 249, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 14, 238, 249, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 14, 0, 231, 14, 103, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 231, 14, 103, 0x0, STR_NULL},
{ WWT_6, 14, 2, 229, 16, 101, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, 14, 2, 229, 16, 101, 0x0, STR_NULL},
{ WWT_PUSHIMGBTN, 14, 0, 249, 104, 115, 0x0, STR_901C_CURRENT_VEHICLE_ACTION}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 0, 249, 104, 115, 0x0, STR_901C_CURRENT_VEHICLE_ACTION},
{ WWT_PUSHIMGBTN, 14, 232, 249, 14, 31, 0x2AB, STR_901E_CENTER_MAIN_VIEW_ON_VEHICLE}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 14, 31, 0x2AB, STR_901E_CENTER_MAIN_VIEW_ON_VEHICLE},
{ WWT_PUSHIMGBTN, 14, 232, 249, 32, 49, 0x2AE, STR_901F_SEND_VEHICLE_TO_DEPOT}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 32, 49, 0x2AE, STR_901F_SEND_VEHICLE_TO_DEPOT},
{ WWT_PUSHIMGBTN, 14, 232, 249, 50, 67, 0x2CB, STR_9020_FORCE_VEHICLE_TO_TURN_AROUND}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 50, 67, 0x2CB, STR_9020_FORCE_VEHICLE_TO_TURN_AROUND},
{ WWT_PUSHIMGBTN, 14, 232, 249, 68, 85, 0x2B2, STR_901D_SHOW_VEHICLE_S_ORDERS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 68, 85, 0x2B2, STR_901D_SHOW_VEHICLE_S_ORDERS},
{ WWT_PUSHIMGBTN, 14, 232, 249, 86, 103, 0x2B3, STR_9021_SHOW_ROAD_VEHICLE_DETAILS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 86, 103, 0x2B3, STR_9021_SHOW_ROAD_VEHICLE_DETAILS},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -356,7 +356,7 @@ static void DrawNewRoadVehWindow(Window *w)
do { do {
if (HASBIT(e->player_avail, _local_player)) { if (HASBIT(e->player_avail, _local_player)) {
if (sel==0) selected_id = engine_id; if (sel==0) selected_id = engine_id;
if (IS_INT_INSIDE(--pos, -8, 0)) { if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
DrawString(x+59, y+2, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10); DrawString(x+59, y+2, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10);
DrawRoadVehEngine(x+29, y+6, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player))); DrawRoadVehEngine(x+29, y+6, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
y += 14; y += 14;
@ -369,7 +369,7 @@ static void DrawNewRoadVehWindow(Window *w)
if (selected_id != -1) { if (selected_id != -1) {
Set_DPARAM_Road_Veh_Build_Window(selected_id); Set_DPARAM_Road_Veh_Build_Window(selected_id);
DrawString(2, 127, STR_9008_COST_SPEED_RUNNING_COST, 0); DrawString(2, w->widget[4].top + 1, STR_9008_COST_SPEED_RUNNING_COST, 0);
} }
} }
} }
@ -399,7 +399,7 @@ static void NewRoadVehWndProc(Window *w, WindowEvent *e)
switch(e->click.widget) { switch(e->click.widget) {
case 2: { /* listbox */ case 2: { /* listbox */
uint i = (e->click.pt.y - 14) / 14; uint i = (e->click.pt.y - 14) / 14;
if (i < 8) { if (i < w->vscroll.cap) {
WP(w,buildtrain_d).sel_index = i + w->vscroll.pos; WP(w,buildtrain_d).sel_index = i + w->vscroll.pos;
SetWindowDirty(w); SetWindowDirty(w);
} }
@ -438,24 +438,33 @@ static void NewRoadVehWndProc(Window *w, WindowEvent *e)
DoCommandP(0, WP(w,buildtrain_d).rename_engine, 0, NULL, CMD_RENAME_ENGINE | CMD_MSG(STR_9037_CAN_T_RENAME_ROAD_VEHICLE)); DoCommandP(0, WP(w,buildtrain_d).rename_engine, 0, NULL, CMD_RENAME_ENGINE | CMD_MSG(STR_9037_CAN_T_RENAME_ROAD_VEHICLE));
} break; } break;
case WE_RESIZE: {
if (e->sizing.diff.y == 0)
break;
w->vscroll.cap += e->sizing.diff.y / 14;
w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
} break;
} }
} }
static const Widget _new_road_veh_widgets[] = { static const Widget _new_road_veh_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 247, 0, 13, STR_9006_NEW_ROAD_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 247, 0, 13, STR_9006_NEW_ROAD_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_MATRIX, 14, 0, 236, 14, 125, 0x801, STR_9026_ROAD_VEHICLE_SELECTION}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 0, 236, 14, 125, 0x801, STR_9026_ROAD_VEHICLE_SELECTION},
{ WWT_SCROLLBAR, 14, 237, 247, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_BOTTOM, 14, 237, 247, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_IMGBTN, 14, 0, 247, 126, 177, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_TB, 14, 0, 247, 126, 177, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 123, 178, 189, STR_9007_BUILD_VEHICLE,STR_9027_BUILD_THE_HIGHLIGHTED_ROAD}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 117, 178, 189, STR_9007_BUILD_VEHICLE,STR_9027_BUILD_THE_HIGHLIGHTED_ROAD},
{ WWT_PUSHTXTBTN, 14, 124, 247, 178, 189, STR_9034_RENAME, STR_9035_RENAME_ROAD_VEHICLE_TYPE}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 118, 235, 178, 189, STR_9034_RENAME, STR_9035_RENAME_ROAD_VEHICLE_TYPE},
{ WWT_RESIZEBOX, RESIZE_TB, 14, 237, 247, 178, 189, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const WindowDesc _new_road_veh_desc = { static const WindowDesc _new_road_veh_desc = {
-1, -1, 248, 190, -1, -1, 248, 190,
WC_BUILD_VEHICLE,0, WC_BUILD_VEHICLE,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_new_road_veh_widgets, _new_road_veh_widgets,
NewRoadVehWndProc NewRoadVehWndProc
}; };
@ -469,6 +478,10 @@ static void ShowBuildRoadVehWindow(TileIndex tile)
w = AllocateWindowDesc(&_new_road_veh_desc); w = AllocateWindowDesc(&_new_road_veh_desc);
w->window_number = tile; w->window_number = tile;
w->vscroll.cap = 8; w->vscroll.cap = 8;
w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
w->resize.step_height = 14;
w->resize.height = w->height - 14 * 4; /* Minimum of 4 vehicles in the display */
if (tile != 0) { if (tile != 0) {
w->caption_color = _map_owner[tile]; w->caption_color = _map_owner[tile];
@ -487,7 +500,7 @@ static void DrawRoadDepotWindow(Window *w)
tile = w->window_number; tile = w->window_number;
/* setup disabled buttons */ /* setup disabled buttons */
w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<6)); w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<5)|(1<<7));
/* determine amount of items for scroller */ /* determine amount of items for scroller */
num = 0; num = 0;
@ -496,7 +509,7 @@ static void DrawRoadDepotWindow(Window *w)
v->tile == (TileIndex)tile) v->tile == (TileIndex)tile)
num++; num++;
} }
SetVScrollCount(w, (num + 4) / 5); SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
/* locate the depot struct */ /* locate the depot struct */
for(d=_depots; d->xy != (TileIndex)tile; d++) {} for(d=_depots; d->xy != (TileIndex)tile; d++) {}
@ -506,13 +519,13 @@ static void DrawRoadDepotWindow(Window *w)
x = 2; x = 2;
y = 15; y = 15;
num = w->vscroll.pos * 5; num = w->vscroll.pos * w->hscroll.cap;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {
if (v->type == VEH_Road && if (v->type == VEH_Road &&
v->u.road.state == 254 && v->u.road.state == 254 &&
v->tile == (TileIndex)tile && v->tile == (TileIndex)tile &&
--num < 0 && num >= -15) { --num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
DrawRoadVehImage(v, x+24, y, WP(w,traindepot_d).sel); DrawRoadVehImage(v, x+24, y, WP(w,traindepot_d).sel);
@ -521,7 +534,7 @@ static void DrawRoadDepotWindow(Window *w)
DrawSprite( (v->vehstatus & VS_STOPPED) ? 0xC12 : 0xC13, x + 16, y); DrawSprite( (v->vehstatus & VS_STOPPED) ? 0xC12 : 0xC13, x + 16, y);
if ((x+=56) == 2+56*5) { if ((x+=56) == 2 + 56 * w->hscroll.cap) {
x = 2; x = 2;
y += 14; y += 14;
} }
@ -613,11 +626,11 @@ static void RoadDepotWndProc(Window *w, WindowEvent *e)
RoadDepotClickVeh(w, e->click.pt.x, e->click.pt.y); RoadDepotClickVeh(w, e->click.pt.x, e->click.pt.y);
break; break;
case 6: case 7:
ShowBuildRoadVehWindow(w->window_number); ShowBuildRoadVehWindow(w->window_number);
break; break;
case 7: /* scroll to tile */ case 8: /* scroll to tile */
ScrollMainWindowToTile(w->window_number); ScrollMainWindowToTile(w->window_number);
break; break;
} }
@ -643,12 +656,12 @@ static void RoadDepotWndProc(Window *w, WindowEvent *e)
} }
} break; } break;
case 4: case 5:
if (!HASBIT(w->disabled_state, 4) && if (!HASBIT(w->disabled_state, 5) &&
WP(w,traindepot_d).sel != INVALID_VEHICLE) { WP(w,traindepot_d).sel != INVALID_VEHICLE) {
Vehicle *v; Vehicle *v;
HandleButtonClick(w, 4); HandleButtonClick(w, 5);
v = &_vehicles[WP(w,traindepot_d).sel]; v = &_vehicles[WP(w,traindepot_d).sel];
WP(w,traindepot_d).sel = INVALID_VEHICLE; WP(w,traindepot_d).sel = INVALID_VEHICLE;
@ -668,26 +681,37 @@ static void RoadDepotWndProc(Window *w, WindowEvent *e)
} }
break; break;
case WE_RESIZE: {
/* Update the scroll + matrix */
w->vscroll.cap += e->sizing.diff.y / 14;
w->hscroll.cap += e->sizing.diff.x / 56;
w->widget[3].unkA = (w->vscroll.cap << 8) + w->hscroll.cap;
} break;
} }
} }
static const Widget _road_depot_widgets[] = { static const Widget _road_depot_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 302, 0, 13, STR_9003_ROAD_VEHICLE_DEPOT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 302, 0, 13, STR_9003_ROAD_VEHICLE_DEPOT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 303, 314, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 303, 314, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_MATRIX, 14, 0, 279, 14, 55, 0x305, STR_9022_VEHICLES_CLICK_ON_VEHICLE}, { WWT_MATRIX, RESIZE_RB, 14, 0, 279, 14, 55, 0x305, STR_9022_VEHICLES_CLICK_ON_VEHICLE},
{ WWT_IMGBTN, 14, 280, 303, 14, 55, 0x2A9, STR_9024_DRAG_ROAD_VEHICLE_TO_HERE}, { WWT_PANEL, RESIZE_LRB, 14, 280, 303, 14, 13, 0x0, STR_NULL},
{ WWT_SCROLLBAR, 14, 304, 314, 14, 55, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_IMGBTN, RESIZE_LRTB, 14, 280, 303, 14, 55, 0x2A9, STR_9024_DRAG_ROAD_VEHICLE_TO_HERE},
{ WWT_PUSHTXTBTN, 14, 0, 156, 56, 67, STR_9004_NEW_VEHICLES, STR_9023_BUILD_NEW_ROAD_VEHICLE}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 304, 314, 14, 55, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 157, 314, 56, 67, STR_00E4_LOCATION, STR_9025_CENTER_MAIN_VIEW_ON_ROAD}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 150, 56, 67, STR_9004_NEW_VEHICLES, STR_9023_BUILD_NEW_ROAD_VEHICLE},
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 151, 302, 56, 67, STR_00E4_LOCATION, STR_9025_CENTER_MAIN_VIEW_ON_ROAD},
{ WWT_PANEL, RESIZE_RTB, 14, 303, 302, 56, 67, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 304, 314, 56, 67, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const WindowDesc _road_depot_desc = { static const WindowDesc _road_depot_desc = {
-1, -1, 315, 68, -1, -1, 315, 68,
WC_VEHICLE_DEPOT,0, WC_VEHICLE_DEPOT,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_road_depot_widgets, _road_depot_widgets,
RoadDepotWndProc RoadDepotWndProc
}; };
@ -699,39 +723,45 @@ void ShowRoadDepotWindow(uint tile)
w = AllocateWindowDescFront(&_road_depot_desc, tile); w = AllocateWindowDescFront(&_road_depot_desc, tile);
if (w) { if (w) {
w->caption_color = _map_owner[w->window_number]; w->caption_color = _map_owner[w->window_number];
w->hscroll.cap = 5;
w->vscroll.cap = 3; w->vscroll.cap = 3;
WP(w,traindepot_d).sel = -1; w->resize.step_width = 56;
w->resize.step_height = 14;
WP(w,traindepot_d).sel = INVALID_VEHICLE;
_backup_orders_tile = 0; _backup_orders_tile = 0;
} }
} }
static const Widget _player_roadveh_widgets[] = {
static Widget _player_roadveh_widgets[] = { { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 247, 0, 13, STR_9001_ROAD_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_CAPTION, 14, 11, 259, 0, 13, STR_9001_ROAD_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_STICKYBOX, RESIZE_LR, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_STICKYBOX, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP}, { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, 14, 81, 237, 14, 25, 0x0, STR_SORT_CRITERIA_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_CLOSEBOX, 14, 238, 248, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP}, { WWT_PANEL, RESIZE_RIGHT, 14, 244, 259, 14, 25, 0x0, STR_NULL},
{ WWT_PANEL, 14, 249, 259, 14, 25, 0x0, STR_NULL}, { WWT_MATRIX, RESIZE_RB, 14, 0, 248, 26, 207, 0x701, STR_901A_ROAD_VEHICLES_CLICK_ON},
{ WWT_MATRIX, 14, 0, 248, 26, 207, 0x701, STR_901A_ROAD_VEHICLES_CLICK_ON}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 249, 259, 26, 207, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_SCROLLBAR, 14, 249, 259, 26, 207, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
/* only for our road list, a 'Build Vehicle' button that opens the depot of the last built depot */ /* only for our road list, a 'Build Vehicle' button that opens the depot of the last built depot */
{ WWT_PUSHTXTBTN, 14, 0, 129, 208, 219, STR_8815_NEW_VEHICLES, STR_901B_BUILD_NEW_ROAD_VEHICLES}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 124, 208, 219, STR_8815_NEW_VEHICLES, STR_901B_BUILD_NEW_ROAD_VEHICLES},
{ WWT_PUSHTXTBTN, 14, 130, 259, 208, 219, STR_REPLACE_VEHICLES, STR_REPLACE_HELP}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 125, 248, 208, 219, STR_REPLACE_VEHICLES, STR_REPLACE_HELP},
{ WWT_PANEL, RESIZE_RTB, 14, 249, 248, 208, 219, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 249, 259, 208, 219, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static Widget _other_player_roadveh_widgets[] = { static const Widget _other_player_roadveh_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 247, 0, 13, STR_9001_ROAD_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 247, 0, 13, STR_9001_ROAD_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PUSHTXTBTN, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_PANEL, 14, 81, 237, 14, 25, 0x0, STR_SORT_CRITERIA_TIP}, { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_CLOSEBOX, 14, 238, 248, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, 14, 249, 259, 14, 25, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_RIGHT, 14, 244, 259, 14, 25, 0x0, STR_NULL},
{ WWT_MATRIX, 14, 0, 248, 26, 207, 0x701, STR_901A_ROAD_VEHICLES_CLICK_ON}, { WWT_MATRIX, RESIZE_RB, 14, 0, 248, 26, 207, 0x701, STR_901A_ROAD_VEHICLES_CLICK_ON},
{ WWT_SCROLLBAR, 14, 249, 259, 26, 207, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 249, 259, 26, 207, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, RESIZE_RTB, 14, 0, 247, 208, 219, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 249, 259, 208, 219, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -760,20 +790,17 @@ static void PlayerRoadVehWndProc(Window *w, WindowEvent *e)
/* draw the widgets */ /* draw the widgets */
{ {
const Player *p = DEREF_PLAYER(owner); const Player *p = DEREF_PLAYER(owner);
/* XXX hack */
if (station == -1) { if (station == -1) {
/* Company Name -- (###) Road vehicles */ /* Company Name -- (###) Road vehicles */
SetDParam(0, p->name_1); SetDParam(0, p->name_1);
SetDParam(1, p->name_2); SetDParam(1, p->name_2);
SetDParam(2, w->vscroll.count); SetDParam(2, w->vscroll.count);
_player_roadveh_widgets[1].unkA = STR_9001_ROAD_VEHICLES; w->widget[1].unkA = STR_9001_ROAD_VEHICLES;
_other_player_roadveh_widgets[1].unkA = STR_9001_ROAD_VEHICLES;
} else { } else {
/* Station Name -- (###) Road vehicles */ /* Station Name -- (###) Road vehicles */
SetDParam(0, DEREF_STATION(station)->index); SetDParam(0, DEREF_STATION(station)->index);
SetDParam(1, w->vscroll.count); SetDParam(1, w->vscroll.count);
_player_roadveh_widgets[1].unkA = STR_SCHEDULED_ROAD_VEHICLES; w->widget[1].unkA = STR_SCHEDULED_ROAD_VEHICLES;
_other_player_roadveh_widgets[1].unkA = STR_SCHEDULED_ROAD_VEHICLES;
} }
DrawWindowWidgets(w); DrawWindowWidgets(w);
} }
@ -847,6 +874,9 @@ static void PlayerRoadVehWndProc(Window *w, WindowEvent *e)
case 9: { /* Build new Vehicle */ case 9: { /* Build new Vehicle */
uint tile; uint tile;
if (!IsWindowOfPrototype(w, _player_roadveh_widgets))
break;
tile = _last_built_road_depot_tile; tile = _last_built_road_depot_tile;
do { do {
if (_map_owner[tile] == _local_player && IsRoadDepotTile(tile)) { if (_map_owner[tile] == _local_player && IsRoadDepotTile(tile)) {
@ -900,21 +930,28 @@ static void PlayerRoadVehWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w); SetWindowDirty(w);
} }
break; break;
case WE_RESIZE:
/* Update the scroll + matrix */
w->vscroll.cap += e->sizing.diff.y / PLY_WND_PRC__SIZE_OF_ROW_SMALL;
w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
break;
} }
} }
static const WindowDesc _player_roadveh_desc = { static const WindowDesc _player_roadveh_desc = {
-1, -1, 260, 220, -1, -1, 260, 220,
WC_ROADVEH_LIST,0, WC_ROADVEH_LIST,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_player_roadveh_widgets, _player_roadveh_widgets,
PlayerRoadVehWndProc PlayerRoadVehWndProc
}; };
static const WindowDesc _other_player_roadveh_desc = { static const WindowDesc _other_player_roadveh_desc = {
-1, -1, 260, 208, -1, -1, 260, 220,
WC_ROADVEH_LIST,0, WC_ROADVEH_LIST,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_other_player_roadveh_widgets, _other_player_roadveh_widgets,
PlayerRoadVehWndProc PlayerRoadVehWndProc
}; };
@ -931,6 +968,9 @@ void ShowPlayerRoadVehicles(int player, int station)
} }
if (w) { if (w) {
w->caption_color = player; w->caption_color = player;
w->vscroll.cap = 7; w->vscroll.cap = 7; // maximum number of vehicles shown
w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_SMALL;
w->resize.height = 220 - (PLY_WND_PRC__SIZE_OF_ROW_SMALL * 3); /* Minimum of 4 vehicles */
} }
} }

View File

@ -215,42 +215,42 @@ int32 CmdSetTownNameType(int x, int y, uint32 flags, uint32 p1, uint32 p2)
static const Widget _game_options_widgets[] = { static const Widget _game_options_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 369, 0, 13, STR_00B1_GAME_OPTIONS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 369, 0, 13, STR_00B1_GAME_OPTIONS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 14, 0, 369, 14, 238, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 369, 14, 238, 0x0, STR_NULL},
{ WWT_FRAME, 14, 10, 179, 20, 55, STR_02E0_CURRENCY_UNITS, STR_NULL}, { WWT_FRAME, RESIZE_NONE, 14, 10, 179, 20, 55, STR_02E0_CURRENCY_UNITS, STR_NULL},
{ WWT_6, 14, 20, 169, 34, 45, STR_02E1, STR_02E2_CURRENCY_UNITS_SELECTION}, { WWT_6, RESIZE_NONE, 14, 20, 169, 34, 45, STR_02E1, STR_02E2_CURRENCY_UNITS_SELECTION},
{ WWT_CLOSEBOX, 14, 158, 168, 35, 44, STR_0225, STR_02E2_CURRENCY_UNITS_SELECTION}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 158, 168, 35, 44, STR_0225, STR_02E2_CURRENCY_UNITS_SELECTION},
{ WWT_FRAME, 14, 190, 359, 20, 55, STR_02E3_DISTANCE_UNITS, STR_NULL}, { WWT_FRAME, RESIZE_NONE, 14, 190, 359, 20, 55, STR_02E3_DISTANCE_UNITS, STR_NULL},
{ WWT_6, 14, 200, 349, 34, 45, STR_02E4, STR_02E5_DISTANCE_UNITS_SELECTION}, { WWT_6, RESIZE_NONE, 14, 200, 349, 34, 45, STR_02E4, STR_02E5_DISTANCE_UNITS_SELECTION},
{ WWT_CLOSEBOX, 14, 338, 348, 35, 44, STR_0225, STR_02E5_DISTANCE_UNITS_SELECTION}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 338, 348, 35, 44, STR_0225, STR_02E5_DISTANCE_UNITS_SELECTION},
{ WWT_FRAME, 14, 10, 179, 62, 97, STR_02E6_ROAD_VEHICLES, STR_NULL}, { WWT_FRAME, RESIZE_NONE, 14, 10, 179, 62, 97, STR_02E6_ROAD_VEHICLES, STR_NULL},
{ WWT_6, 14, 20, 169, 76, 87, STR_02E7, STR_02E8_SELECT_SIDE_OF_ROAD_FOR}, { WWT_6, RESIZE_NONE, 14, 20, 169, 76, 87, STR_02E7, STR_02E8_SELECT_SIDE_OF_ROAD_FOR},
{ WWT_CLOSEBOX, 14, 158, 168, 77, 86, STR_0225, STR_02E8_SELECT_SIDE_OF_ROAD_FOR}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 158, 168, 77, 86, STR_0225, STR_02E8_SELECT_SIDE_OF_ROAD_FOR},
{ WWT_FRAME, 14, 190, 359, 62, 97, STR_02EB_TOWN_NAMES, STR_NULL}, { WWT_FRAME, RESIZE_NONE, 14, 190, 359, 62, 97, STR_02EB_TOWN_NAMES, STR_NULL},
{ WWT_6, 14, 200, 349, 76, 87, STR_02EC, STR_02ED_SELECT_STYLE_OF_TOWN_NAMES}, { WWT_6, RESIZE_NONE, 14, 200, 349, 76, 87, STR_02EC, STR_02ED_SELECT_STYLE_OF_TOWN_NAMES},
{ WWT_CLOSEBOX, 14, 338, 348, 77, 86, STR_0225, STR_02ED_SELECT_STYLE_OF_TOWN_NAMES}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 338, 348, 77, 86, STR_0225, STR_02ED_SELECT_STYLE_OF_TOWN_NAMES},
{ WWT_FRAME, 14, 10, 179, 104, 139, STR_02F4_AUTOSAVE, STR_NULL}, { WWT_FRAME, RESIZE_NONE, 14, 10, 179, 104, 139, STR_02F4_AUTOSAVE, STR_NULL},
{ WWT_6, 14, 20, 169, 118, 129, STR_02F5, STR_02F6_SELECT_INTERVAL_BETWEEN}, { WWT_6, RESIZE_NONE, 14, 20, 169, 118, 129, STR_02F5, STR_02F6_SELECT_INTERVAL_BETWEEN},
{ WWT_CLOSEBOX, 14, 158, 168, 119, 128, STR_0225, STR_02F6_SELECT_INTERVAL_BETWEEN}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 158, 168, 119, 128, STR_0225, STR_02F6_SELECT_INTERVAL_BETWEEN},
{ WWT_FRAME, 14, 10, 359, 194, 228, STR_02BC_VEHICLE_DESIGN_NAMES, STR_NULL}, { WWT_FRAME, RESIZE_NONE, 14, 10, 359, 194, 228, STR_02BC_VEHICLE_DESIGN_NAMES, STR_NULL},
{ WWT_6, 14, 20, 119, 207, 218, STR_02BD, STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION}, { WWT_6, RESIZE_NONE, 14, 20, 119, 207, 218, STR_02BD, STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION},
{ WWT_CLOSEBOX, 14, 108, 118, 208, 217, STR_0225, STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 108, 118, 208, 217, STR_0225, STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION},
{ WWT_CLOSEBOX, 14, 130, 349, 207, 218, STR_02C0_SAVE_CUSTOM_NAMES, STR_02C2_SAVE_CUSTOMIZED_VEHICLE}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 130, 349, 207, 218, STR_02C0_SAVE_CUSTOM_NAMES, STR_02C2_SAVE_CUSTOMIZED_VEHICLE},
{ WWT_FRAME, 14, 190, 359, 104, 139, STR_OPTIONS_LANG, STR_NULL}, { WWT_FRAME, RESIZE_NONE, 14, 190, 359, 104, 139, STR_OPTIONS_LANG, STR_NULL},
{ WWT_6, 14, 200, 349, 118, 129, STR_OPTIONS_LANG_CBO, STR_OPTIONS_LANG_TIP}, { WWT_6, RESIZE_NONE, 14, 200, 349, 118, 129, STR_OPTIONS_LANG_CBO, STR_OPTIONS_LANG_TIP},
{ WWT_CLOSEBOX, 14, 338, 348, 119, 128, STR_0225, STR_OPTIONS_LANG_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 338, 348, 119, 128, STR_0225, STR_OPTIONS_LANG_TIP},
{ WWT_FRAME, 14, 10, 179, 146, 190, STR_OPTIONS_RES, STR_NULL}, { WWT_FRAME, RESIZE_NONE, 14, 10, 179, 146, 190, STR_OPTIONS_RES, STR_NULL},
{ WWT_6, 14, 20, 169, 160, 171, STR_OPTIONS_RES_CBO, STR_OPTIONS_RES_TIP}, { WWT_6, RESIZE_NONE, 14, 20, 169, 160, 171, STR_OPTIONS_RES_CBO, STR_OPTIONS_RES_TIP},
{ WWT_CLOSEBOX, 14, 158, 168, 161, 170, STR_0225, STR_OPTIONS_RES_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 158, 168, 161, 170, STR_0225, STR_OPTIONS_RES_TIP},
{ WWT_TEXTBTN, 14, 149, 169, 176, 184, STR_EMPTY, STR_OPTIONS_FULLSCREEN_TIP}, { WWT_TEXTBTN, RESIZE_NONE, 14, 149, 169, 176, 184, STR_EMPTY, STR_OPTIONS_FULLSCREEN_TIP},
{ WWT_FRAME, 14, 190, 359, 146, 190, STR_OPTIONS_SCREENSHOT_FORMAT, STR_NULL}, { WWT_FRAME, RESIZE_NONE, 14, 190, 359, 146, 190, STR_OPTIONS_SCREENSHOT_FORMAT, STR_NULL},
{ WWT_6, 14, 200, 349, 160, 171, STR_OPTIONS_SCREENSHOT_FORMAT_CBO, STR_OPTIONS_SCREENSHOT_FORMAT_TIP}, { WWT_6, RESIZE_NONE, 14, 200, 349, 160, 171, STR_OPTIONS_SCREENSHOT_FORMAT_CBO, STR_OPTIONS_SCREENSHOT_FORMAT_TIP},
{ WWT_CLOSEBOX, 14, 338, 348, 161, 170, STR_0225, STR_OPTIONS_SCREENSHOT_FORMAT_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 338, 348, 161, 170, STR_0225, STR_OPTIONS_SCREENSHOT_FORMAT_TIP},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -471,19 +471,19 @@ static void GameDifficultyWndProc(Window *w, WindowEvent *e)
} }
static const Widget _game_difficulty_widgets[] = { static const Widget _game_difficulty_widgets[] = {
{ WWT_CLOSEBOX, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 10, 11, 369, 0, 13, STR_6800_DIFFICULTY_LEVEL, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 10, 11, 369, 0, 13, STR_6800_DIFFICULTY_LEVEL, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 10, 0, 369, 14, 29, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 14, 29, 0x0, STR_NULL},
{ WWT_PANEL, 10, 0, 369, 30, 276, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 30, 276, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 3, 10, 96, 16, 27, STR_6801_EASY, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 10, 96, 16, 27, STR_6801_EASY, STR_NULL},
{ WWT_PUSHTXTBTN, 3, 97, 183, 16, 27, STR_6802_MEDIUM, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 97, 183, 16, 27, STR_6802_MEDIUM, STR_NULL},
{ WWT_PUSHTXTBTN, 3, 184, 270, 16, 27, STR_6803_HARD, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 184, 270, 16, 27, STR_6803_HARD, STR_NULL},
{ WWT_PUSHTXTBTN, 3, 271, 357, 16, 27, STR_6804_CUSTOM, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 271, 357, 16, 27, STR_6804_CUSTOM, STR_NULL},
{ WWT_EMPTY, 10, 0, 369, 251, 262, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 10, 0, 369, 251, 262, 0x0, STR_NULL},
//{ WWT_CLOSEBOX, 10, 0, 369, 251, 262, STR_6838_SHOW_HI_SCORE_CHART,STR_NULL}, //{ WWT_CLOSEBOX, RESIZE_NONE, 10, 0, 369, 251, 262, STR_6838_SHOW_HI_SCORE_CHART,STR_NULL},
{ WWT_PANEL, 10, 0, 369, 263, 278, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 263, 278, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 3, 105, 185, 265, 276, STR_OPTIONS_SAVE_CHANGES, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 105, 185, 265, 276, STR_OPTIONS_SAVE_CHANGES, STR_NULL},
{ WWT_PUSHTXTBTN, 3, 186, 266, 265, 276, STR_012E_CANCEL, STR_NULL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 3, 186, 266, 265, 276, STR_012E_CANCEL, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1106,17 +1106,17 @@ void ConsoleGetPatchSetting(char *name)
} }
static const Widget _patches_selection_widgets[] = { static const Widget _patches_selection_widgets[] = {
{ WWT_CLOSEBOX, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 10, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 10, 11, 369, 0, 13, STR_CONFIG_PATCHES_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 10, 11, 369, 0, 13, STR_CONFIG_PATCHES_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 10, 0, 369, 14, 41, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 14, 41, 0x0, STR_NULL},
{ WWT_PANEL, 10, 0, 369, 42, 320, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 10, 0, 369, 42, 320, 0x0, STR_NULL},
{ WWT_CLOSEBOX, 3, 10, 96, 16, 27, STR_CONFIG_PATCHES_GUI, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 10, 96, 16, 27, STR_CONFIG_PATCHES_GUI, STR_NULL},
{ WWT_CLOSEBOX, 3, 97, 183, 16, 27, STR_CONFIG_PATCHES_CONSTRUCTION, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 97, 183, 16, 27, STR_CONFIG_PATCHES_CONSTRUCTION, STR_NULL},
{ WWT_CLOSEBOX, 3, 184, 270, 16, 27, STR_CONFIG_PATCHES_VEHICLES, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 184, 270, 16, 27, STR_CONFIG_PATCHES_VEHICLES, STR_NULL},
{ WWT_CLOSEBOX, 3, 271, 357, 16, 27, STR_CONFIG_PATCHES_STATIONS, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 271, 357, 16, 27, STR_CONFIG_PATCHES_STATIONS, STR_NULL},
{ WWT_CLOSEBOX, 3, 10, 96, 28, 39, STR_CONFIG_PATCHES_ECONOMY, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 10, 96, 28, 39, STR_CONFIG_PATCHES_ECONOMY, STR_NULL},
{ WWT_CLOSEBOX, 3, 97, 183, 28, 39, STR_CONFIG_PATCHES_AI, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 97, 183, 28, 39, STR_CONFIG_PATCHES_AI, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1231,19 +1231,19 @@ static void NewgrfWndProc(Window *w, WindowEvent *e)
} }
static const Widget _newgrf_widgets[] = { static const Widget _newgrf_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 279, 0, 13, STR_NEWGRF_SETTINGS_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 279, 0, 13, STR_NEWGRF_SETTINGS_CAPTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_MATRIX, 14, 0, 268, 14, 182, 0xC01,/*small rows*/ STR_NEWGRF_TIP}, { WWT_MATRIX, RESIZE_NONE, 14, 0, 268, 14, 182, 0xC01,/*small rows*/ STR_NEWGRF_TIP},
{ WWT_PANEL, 14, 0, 279, 183, 276, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 279, 183, 276, 0x0, STR_NULL},
{ WWT_SCROLLBAR, 14, 269, 279, 14, 182, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 269, 279, 14, 182, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_CLOSEBOX, 14, 147, 158, 244, 255, STR_0188, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 147, 158, 244, 255, STR_0188, STR_NULL},
{ WWT_CLOSEBOX, 14, 159, 170, 244, 255, STR_0189, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 159, 170, 244, 255, STR_0189, STR_NULL},
{ WWT_CLOSEBOX, 14, 175, 274, 244, 255, STR_NEWGRF_SET_PARAMETERS, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 175, 274, 244, 255, STR_NEWGRF_SET_PARAMETERS, STR_NULL},
{ WWT_CLOSEBOX, 3, 5, 138, 261, 272, STR_NEWGRF_APPLY_CHANGES, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 5, 138, 261, 272, STR_NEWGRF_APPLY_CHANGES, STR_NULL},
{ WWT_CLOSEBOX, 3, 142, 274, 261, 272, STR_012E_CANCEL, STR_NULL}, { WWT_CLOSEBOX, RESIZE_NONE, 3, 142, 274, 261, 272, STR_012E_CANCEL, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1469,9 +1469,9 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e)
} }
static const Widget _cust_currency_widgets[] = { static const Widget _cust_currency_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 229, 0, 13, STR_CURRENCY_WINDOW, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 229, 0, 13, STR_CURRENCY_WINDOW, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 14, 0, 229, 14, 119, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 229, 14, 119, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -135,11 +135,11 @@ static void ShipRefitWndProc(Window *w, WindowEvent *e)
static const Widget _ship_refit_widgets[] = { static const Widget _ship_refit_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 239, 0, 13, STR_983B_REFIT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 239, 0, 13, STR_983B_REFIT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 239, 14, 135, 0x0, STR_983D_SELECT_TYPE_OF_CARGO_FOR}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 239, 14, 135, 0x0, STR_983D_SELECT_TYPE_OF_CARGO_FOR},
{ WWT_IMGBTN, 14, 0, 239, 136, 157, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 239, 136, 157, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 239, 158, 169, STR_983C_REFIT_SHIP, STR_983E_REFIT_SHIP_TO_CARRY_HIGHLIGHTED}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 239, 158, 169, STR_983C_REFIT_SHIP, STR_983E_REFIT_SHIP_TO_CARRY_HIGHLIGHTED},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -290,14 +290,14 @@ change_int:
static const Widget _ship_details_widgets[] = { static const Widget _ship_details_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 364, 0, 13, STR_9811_DETAILS,STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 364, 0, 13, STR_9811_DETAILS,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 365, 404, 0, 13, STR_01AA_NAME, STR_982F_NAME_SHIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 365, 404, 0, 13, STR_01AA_NAME, STR_982F_NAME_SHIP},
{ WWT_IMGBTN, 14, 0, 404, 14, 55, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 404, 14, 55, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 404, 56, 88, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 404, 56, 88, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 10, 89, 94, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 89, 94, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL},
{ WWT_PUSHTXTBTN, 14, 0, 10, 95, 100, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 95, 100, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL},
{ WWT_IMGBTN, 14, 11, 404, 89, 100, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 11, 404, 89, 100, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -368,7 +368,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
do { do {
if (HASBIT(e->player_avail, _local_player)) { if (HASBIT(e->player_avail, _local_player)) {
if (sel==0) selected_id = engine_id; if (sel==0) selected_id = engine_id;
if (IS_INT_INSIDE(--pos, -4, 0)) { if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
DrawString(x+75, y+7, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10); DrawString(x+75, y+7, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10);
DrawShipEngine(x+35, y+10, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player))); DrawShipEngine(x+35, y+10, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
y += 24; y += 24;
@ -382,7 +382,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
if (selected_id != -1) { if (selected_id != -1) {
Set_DPARAM_Ship_Build_Window(selected_id); Set_DPARAM_Ship_Build_Window(selected_id);
DrawString(2, 111, STR_980A_COST_SPEED_CAPACITY_RUNNING, 0); DrawString(2, w->widget[4].top + 1, STR_980A_COST_SPEED_CAPACITY_RUNNING, 0);
} }
} }
break; break;
@ -391,7 +391,7 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
switch(e->click.widget) { switch(e->click.widget) {
case 2: { /* listbox */ case 2: { /* listbox */
uint i = (e->click.pt.y - 14) / 24; uint i = (e->click.pt.y - 14) / 24;
if (i < 4) { if (i < w->vscroll.cap) {
WP(w,buildtrain_d).sel_index = i + w->vscroll.pos; WP(w,buildtrain_d).sel_index = i + w->vscroll.pos;
SetWindowDirty(w); SetWindowDirty(w);
} }
@ -430,17 +430,23 @@ static void NewShipWndProc(Window *w, WindowEvent *e)
DoCommandP(0, WP(w,buildtrain_d).rename_engine, 0, NULL, CMD_RENAME_ENGINE | CMD_MSG(STR_9839_CAN_T_RENAME_SHIP_TYPE)); DoCommandP(0, WP(w,buildtrain_d).rename_engine, 0, NULL, CMD_RENAME_ENGINE | CMD_MSG(STR_9839_CAN_T_RENAME_SHIP_TYPE));
} break; } break;
case WE_RESIZE:
w->vscroll.cap += e->sizing.diff.y / 24;
w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
break;
} }
} }
static const Widget _new_ship_widgets[] = { static const Widget _new_ship_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 254, 0, 13, STR_9808_NEW_SHIPS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 254, 0, 13, STR_9808_NEW_SHIPS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_MATRIX, 14, 0, 243, 14, 109, 0x401, STR_9825_SHIP_SELECTION_LIST_CLICK}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 0, 243, 14, 109, 0x401, STR_9825_SHIP_SELECTION_LIST_CLICK},
{ WWT_SCROLLBAR, 14, 244, 254, 14, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_BOTTOM, 14, 244, 254, 14, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_IMGBTN, 14, 0, 254, 110, 161, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_TB, 14, 0, 254, 110, 161, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 126, 162, 173, STR_9809_BUILD_SHIP, STR_9826_BUILD_THE_HIGHLIGHTED_SHIP}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 121, 162, 173, STR_9809_BUILD_SHIP, STR_9826_BUILD_THE_HIGHLIGHTED_SHIP},
{ WWT_PUSHTXTBTN, 14, 127, 254, 162, 173, STR_9836_RENAME, STR_9837_RENAME_SHIP_TYPE}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 122, 243, 162, 173, STR_9836_RENAME, STR_9837_RENAME_SHIP_TYPE},
{ WWT_RESIZEBOX, RESIZE_TB, 14, 244, 254, 162, 173, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -462,6 +468,9 @@ static void ShowBuildShipWindow(TileIndex tile)
w = AllocateWindowDesc(&_new_ship_desc); w = AllocateWindowDesc(&_new_ship_desc);
w->window_number = tile; w->window_number = tile;
w->vscroll.cap = 4; w->vscroll.cap = 4;
w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
w->resize.step_height = 24;
if (tile != 0) { if (tile != 0) {
w->caption_color = _map_owner[tile]; w->caption_color = _map_owner[tile];
@ -570,17 +579,17 @@ static void ShipViewWndProc(Window *w, WindowEvent *e) {
} }
static const Widget _ship_view_widgets[] = { static const Widget _ship_view_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 237, 0, 13, STR_980F, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 237, 0, 13, STR_980F, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 238, 249, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 14, 238, 249, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 14, 0, 231, 14, 103, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 231, 14, 103, 0x0, STR_NULL},
{ WWT_6, 14, 2, 229, 16, 101, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, 14, 2, 229, 16, 101, 0x0, STR_NULL},
{ WWT_PUSHIMGBTN, 14, 0, 249, 104, 115, 0x0, STR_9827_CURRENT_SHIP_ACTION_CLICK}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 0, 249, 104, 115, 0x0, STR_9827_CURRENT_SHIP_ACTION_CLICK},
{ WWT_PUSHIMGBTN, 14, 232, 249, 14, 31, 0x2AB, STR_9829_CENTER_MAIN_VIEW_ON_SHIP}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 14, 31, 0x2AB, STR_9829_CENTER_MAIN_VIEW_ON_SHIP},
{ WWT_PUSHIMGBTN, 14, 232, 249, 32, 49, 0x2B0, STR_982A_SEND_SHIP_TO_DEPOT}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 32, 49, 0x2B0, STR_982A_SEND_SHIP_TO_DEPOT},
{ WWT_PUSHIMGBTN, 14, 232, 249, 50, 67, 0x2B4, STR_983A_REFIT_CARGO_SHIP_TO_CARRY}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 50, 67, 0x2B4, STR_983A_REFIT_CARGO_SHIP_TO_CARRY},
{ WWT_PUSHIMGBTN, 14, 232, 249, 68, 85, 0x2B2, STR_9828_SHOW_SHIP_S_ORDERS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 68, 85, 0x2B2, STR_9828_SHOW_SHIP_S_ORDERS},
{ WWT_PUSHIMGBTN, 14, 232, 249, 86, 103, 0x2B3, STR_982B_SHOW_SHIP_DETAILS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 86, 103, 0x2B3, STR_982B_SHOW_SHIP_DETAILS},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -625,7 +634,7 @@ static void DrawShipDepotWindow(Window *w)
tile = w->window_number; tile = w->window_number;
/* setup disabled buttons */ /* setup disabled buttons */
w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<6)); w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<7));
/* determine amount of items for scroller */ /* determine amount of items for scroller */
num = 0; num = 0;
@ -634,7 +643,7 @@ static void DrawShipDepotWindow(Window *w)
v->tile == (TileIndex)tile) v->tile == (TileIndex)tile)
num++; num++;
} }
SetVScrollCount(w, (num+2) / 3); SetVScrollCount(w, (num + w->hscroll.cap - 1) / w->hscroll.cap);
/* locate the depot struct */ /* locate the depot struct */
for(d=_depots; d->xy != (TileIndex)tile; d++) {} for(d=_depots; d->xy != (TileIndex)tile; d++) {}
@ -644,22 +653,22 @@ static void DrawShipDepotWindow(Window *w)
x = 2; x = 2;
y = 15; y = 15;
num = w->vscroll.pos * 3; num = w->vscroll.pos * w->hscroll.cap;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {
if (v->type == VEH_Ship && if (v->type == VEH_Ship &&
v->u.ship.state == 0x80 && v->u.ship.state == 0x80 &&
v->tile == (TileIndex)tile && v->tile == (TileIndex)tile &&
--num < 0 && num >= -6) { --num < 0 && num >= -w->vscroll.cap * w->hscroll.cap) {
DrawShipImage(v, x+19, y, WP(w,traindepot_d).sel); DrawShipImage(v, x+19, y, WP(w,traindepot_d).sel);
SetDParam(0, v->unitnumber); SetDParam(0, v->unitnumber);
DrawString(x, y, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, 0); DrawString(x, y+2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, 0);
DrawSprite( (v->vehstatus & VS_STOPPED) ? 0xC12 : 0xC13, x, y + 9); DrawSprite( (v->vehstatus & VS_STOPPED) ? 0xC12 : 0xC13, x, y + 9);
if ((x+=90) == 2+90*3) { if ((x+=90) == 2 + 90 * w->hscroll.cap) {
x = 2; x = 2;
y += 24; y += 24;
} }
@ -751,11 +760,11 @@ static void ShipDepotWndProc(Window *w, WindowEvent *e) {
ShipDepotClick(w, e->click.pt.x, e->click.pt.y); ShipDepotClick(w, e->click.pt.x, e->click.pt.y);
break; break;
case 6: case 7:
ShowBuildShipWindow(w->window_number); ShowBuildShipWindow(w->window_number);
break; break;
case 7: /* scroll to tile */ case 8: /* scroll to tile */
ScrollMainWindowToTile(w->window_number); ScrollMainWindowToTile(w->window_number);
break; break;
} }
@ -781,12 +790,12 @@ static void ShipDepotWndProc(Window *w, WindowEvent *e) {
} }
} break; } break;
case 4: case 5:
if (!HASBIT(w->disabled_state, 4) && if (!HASBIT(w->disabled_state, 5) &&
WP(w,traindepot_d).sel != INVALID_VEHICLE) { WP(w,traindepot_d).sel != INVALID_VEHICLE) {
Vehicle *v; Vehicle *v;
HandleButtonClick(w, 4); HandleButtonClick(w, 5);
v = &_vehicles[WP(w,traindepot_d).sel]; v = &_vehicles[WP(w,traindepot_d).sel];
WP(w,traindepot_d).sel = INVALID_VEHICLE; WP(w,traindepot_d).sel = INVALID_VEHICLE;
@ -805,25 +814,34 @@ static void ShipDepotWndProc(Window *w, WindowEvent *e) {
break; break;
} }
break; break;
case WE_RESIZE:
w->vscroll.cap += e->sizing.diff.y / 24;
w->hscroll.cap += e->sizing.diff.x / 90;
w->widget[3].unkA = (w->vscroll.cap << 8) + w->hscroll.cap;
break;
} }
} }
static const Widget _ship_depot_widgets[] = { static const Widget _ship_depot_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 292, 0, 13, STR_9803_SHIP_DEPOT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 292, 0, 13, STR_9803_SHIP_DEPOT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 293, 304, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 293, 304, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_MATRIX, 14, 0, 269, 14, 61, 0x203, STR_981F_SHIPS_CLICK_ON_SHIP_FOR}, { WWT_MATRIX, RESIZE_RB, 14, 0, 269, 14, 61, 0x203, STR_981F_SHIPS_CLICK_ON_SHIP_FOR},
{ WWT_IMGBTN, 14, 270, 293, 14, 61, 0x2A9, STR_9821_DRAG_SHIP_TO_HERE_TO_SELL}, { WWT_PANEL, RESIZE_LRB, 14, 270, 293, 14, 13, 0x0, STR_NULL},
{ WWT_SCROLLBAR, 14, 294, 304, 14, 61, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_IMGBTN, RESIZE_LRTB, 14, 270, 293, 14, 61, 0x2A9, STR_9821_DRAG_SHIP_TO_HERE_TO_SELL},
{ WWT_PUSHTXTBTN, 14, 0, 151, 62, 73, STR_9804_NEW_SHIPS, STR_9820_BUILD_NEW_SHIP}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 294, 304, 14, 61, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 152, 304, 62, 73, STR_00E4_LOCATION, STR_9822_CENTER_MAIN_VIEW_ON_SHIP}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 146, 62, 73, STR_9804_NEW_SHIPS, STR_9820_BUILD_NEW_SHIP},
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 147, 293, 62, 73, STR_00E4_LOCATION, STR_9822_CENTER_MAIN_VIEW_ON_SHIP},
{ WWT_PANEL, RESIZE_RTB, 14, 294, 293, 62, 73, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 294, 304, 62, 73, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const WindowDesc _ship_depot_desc = { static const WindowDesc _ship_depot_desc = {
-1, -1, 305, 74, -1, -1, 305, 74,
WC_VEHICLE_DEPOT,0, WC_VEHICLE_DEPOT,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_ship_depot_widgets, _ship_depot_widgets,
ShipDepotWndProc ShipDepotWndProc
}; };
@ -836,6 +854,9 @@ void ShowShipDepotWindow(uint tile)
if (w) { if (w) {
w->caption_color = _map_owner[w->window_number]; w->caption_color = _map_owner[w->window_number];
w->vscroll.cap = 2; w->vscroll.cap = 2;
w->hscroll.cap = 3;
w->resize.step_width = 90;
w->resize.step_height = 24;
WP(w,traindepot_d).sel = INVALID_VEHICLE; WP(w,traindepot_d).sel = INVALID_VEHICLE;
_backup_orders_tile = 0; _backup_orders_tile = 0;
} }
@ -874,31 +895,35 @@ static void DrawSmallShipSchedule(Vehicle *v, int x, int y) {
} }
static Widget _player_ships_widgets[] = { static const Widget _player_ships_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 247, 0, 13, STR_9805_SHIPS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 247, 0, 13, STR_9805_SHIPS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PUSHTXTBTN, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_PANEL, 14, 81, 237, 14, 25, 0x0, STR_SORT_CRITERIA_TIP}, { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_CLOSEBOX, 14, 238, 248, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, 14, 249, 259, 14, 25, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_RIGHT, 14, 244, 259, 14, 25, 0x0, STR_NULL},
{ WWT_MATRIX, 14, 0, 248, 26, 169, 0x401, STR_9823_SHIPS_CLICK_ON_SHIP_FOR}, { WWT_MATRIX, RESIZE_RB, 14, 0, 248, 26, 169, 0x401, STR_9823_SHIPS_CLICK_ON_SHIP_FOR},
{ WWT_SCROLLBAR, 14, 249, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 249, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 0, 129, 170, 181, STR_9804_NEW_SHIPS, STR_9824_BUILD_NEW_SHIPS_REQUIRES}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 124, 170, 181, STR_9804_NEW_SHIPS, STR_9824_BUILD_NEW_SHIPS_REQUIRES},
{ WWT_PUSHTXTBTN, 14, 130, 259, 170, 181, STR_REPLACE_VEHICLES, STR_REPLACE_HELP}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 125, 248, 170, 181, STR_REPLACE_VEHICLES, STR_REPLACE_HELP},
{ WWT_PANEL, RESIZE_RTB, 14, 249, 248, 170, 181, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 249, 259, 170, 181, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static Widget _other_player_ships_widgets[] = { static const Widget _other_player_ships_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 247, 0, 13, STR_9805_SHIPS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 247, 0, 13, STR_9805_SHIPS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PUSHTXTBTN, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_PANEL, 14, 81, 237, 14, 25, 0x0, STR_SORT_CRITERIA_TIP}, { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_CLOSEBOX, 14, 238, 248, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, 14, 249, 259, 14, 25, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_RIGHT, 14, 244, 259, 14, 25, 0x0, STR_NULL},
{ WWT_MATRIX, 14, 0, 248, 26, 169, 0x401, STR_9823_SHIPS_CLICK_ON_SHIP_FOR}, { WWT_MATRIX, RESIZE_RB, 14, 0, 248, 26, 169, 0x401, STR_9823_SHIPS_CLICK_ON_SHIP_FOR},
{ WWT_SCROLLBAR, 14, 249, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 249, 259, 26, 169, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, RESIZE_RTB, 14, 249, 248, 170, 181, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 249, 259, 170, 181, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -927,20 +952,17 @@ static void PlayerShipsWndProc(Window *w, WindowEvent *e)
/* draw the widgets */ /* draw the widgets */
{ {
const Player *p = DEREF_PLAYER(owner); const Player *p = DEREF_PLAYER(owner);
/* XXX hack */
if (station == -1) { if (station == -1) {
/* Company Name -- (###) Trains */ /* Company Name -- (###) Trains */
SetDParam(0, p->name_1); SetDParam(0, p->name_1);
SetDParam(1, p->name_2); SetDParam(1, p->name_2);
SetDParam(2, w->vscroll.count); SetDParam(2, w->vscroll.count);
_player_ships_widgets[1].unkA = STR_9805_SHIPS; w->widget[1].unkA = STR_9805_SHIPS;
_other_player_ships_widgets[1].unkA = STR_9805_SHIPS;
} else { } else {
/* Station Name -- (###) Trains */ /* Station Name -- (###) Trains */
SetDParam(0, DEREF_STATION(station)->index); SetDParam(0, DEREF_STATION(station)->index);
SetDParam(1, w->vscroll.count); SetDParam(1, w->vscroll.count);
_player_ships_widgets[1].unkA = STR_SCHEDULED_SHIPS; w->widget[1].unkA = STR_SCHEDULED_SHIPS;
_other_player_ships_widgets[1].unkA = STR_SCHEDULED_SHIPS;
} }
DrawWindowWidgets(w); DrawWindowWidgets(w);
} }
@ -1015,6 +1037,10 @@ static void PlayerShipsWndProc(Window *w, WindowEvent *e)
case 9: { /* Build new Vehicle */ case 9: { /* Build new Vehicle */
uint tile; uint tile;
if (!IsWindowOfPrototype(w, _player_ships_widgets))
break;
tile = _last_built_ship_depot_tile; tile = _last_built_ship_depot_tile;
do { do {
if (_map_owner[tile] == _local_player && IsShipDepotTile(tile)) { if (_map_owner[tile] == _local_player && IsShipDepotTile(tile)) {
@ -1028,7 +1054,7 @@ static void PlayerShipsWndProc(Window *w, WindowEvent *e)
ShowBuildShipWindow(0); ShowBuildShipWindow(0);
} break; } break;
case 10: { case 10: {
ShowReplaceVehicleWindow(VEH_Ship); ShowReplaceVehicleWindow(VEH_Ship);
break; break;
@ -1069,21 +1095,27 @@ static void PlayerShipsWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w); SetWindowDirty(w);
} }
break; break;
case WE_RESIZE:
/* Update the scroll + matrix */
w->vscroll.cap += e->sizing.diff.y / PLY_WND_PRC__SIZE_OF_ROW_BIG;
w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
break;
} }
} }
static const WindowDesc _player_ships_desc = { static const WindowDesc _player_ships_desc = {
-1, -1, 260, 182, -1, -1, 260, 182,
WC_SHIPS_LIST,0, WC_SHIPS_LIST,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_player_ships_widgets, _player_ships_widgets,
PlayerShipsWndProc PlayerShipsWndProc
}; };
static const WindowDesc _other_player_ships_desc = { static const WindowDesc _other_player_ships_desc = {
-1, -1, 260, 170, -1, -1, 260, 182,
WC_SHIPS_LIST,0, WC_SHIPS_LIST,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_other_player_ships_widgets, _other_player_ships_widgets,
PlayerShipsWndProc PlayerShipsWndProc
}; };
@ -1101,5 +1133,7 @@ void ShowPlayerShips(int player, int station)
if (w) { if (w) {
w->caption_color = w->window_number; w->caption_color = w->window_number;
w->vscroll.cap = 4; w->vscroll.cap = 4;
w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_BIG;
} }
} }

View File

@ -11,69 +11,29 @@
#include "town.h" #include "town.h"
#include "sound.h" #include "sound.h"
static const Widget _smallmap_megabig_widgets[] = { static const Widget _smallmap_widgets[] = {
{ WWT_TEXTBTN, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 580, 0, 13, STR_00B0_MAP,STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 13, 11, 433, 0, 13, STR_00B0_MAP,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 13, 581, 592, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 13, 434, 445, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 13, 593, 606, 0, 13, 0x2AA, STR_01CC_TOGGLE_LARGE_SMALL_MAP}, { WWT_IMGBTN, RESIZE_RB, 13, 0, 445, 14, 257, 0x0, STR_NULL},
{ WWT_IMGBTN, 13, 0, 606, 14, 407, 0x0, STR_NULL}, { WWT_6, RESIZE_RB, 13, 2, 443, 16, 255, 0x0, STR_NULL},
{ WWT_6, 13, 2, 604, 16, 405, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_LRTB, 13, 380, 401, 258, 279, 0x2E2, STR_0191_SHOW_LAND_CONTOURS_ON_MAP},
{ WWT_IMGBTN, 13, 541, 562, 408, 429, 0x2E2, STR_0191_SHOW_LAND_CONTOURS_ON_MAP}, { WWT_IMGBTN, RESIZE_LRTB, 13, 402, 423, 258, 279, 0x2E3, STR_0192_SHOW_VEHICLES_ON_MAP},
{ WWT_IMGBTN, 13, 563, 584, 408, 429, 0x2E3, STR_0192_SHOW_VEHICLES_ON_MAP}, { WWT_IMGBTN, RESIZE_LRTB, 13, 424, 445, 258, 279, 0x2E5, STR_0193_SHOW_INDUSTRIES_ON_MAP},
{ WWT_IMGBTN, 13, 585, 606, 408, 429, 0x2E5, STR_0193_SHOW_INDUSTRIES_ON_MAP}, { WWT_IMGBTN, RESIZE_LRTB, 13, 380, 401, 280, 301, 0x2E4, STR_0194_SHOW_TRANSPORT_ROUTES_ON},
{ WWT_IMGBTN, 13, 519, 540, 430, 451, 0x2E4, STR_0194_SHOW_TRANSPORT_ROUTES_ON}, { WWT_IMGBTN, RESIZE_LRTB, 13, 402, 423, 280, 301, 0x2E6, STR_0195_SHOW_VEGETATION_ON_MAP},
{ WWT_IMGBTN, 13, 541, 562, 430, 451, 0x2E6, STR_0195_SHOW_VEGETATION_ON_MAP}, { WWT_IMGBTN, RESIZE_LRTB, 13, 424, 445, 280, 301, 0x2E7, STR_0196_SHOW_LAND_OWNERS_ON_MAP},
{ WWT_IMGBTN, 13, 563, 584, 430, 451, 0x2E7, STR_0196_SHOW_LAND_OWNERS_ON_MAP}, { WWT_IMGBTN, RESIZE_LRTB, 13, 358, 379, 258, 279, 0x0, STR_NULL},
{ WWT_IMGBTN, 13, 585, 606, 430, 451, 0xFED, STR_0197_TOGGLE_TOWN_NAMES_ON_OFF}, { WWT_IMGBTN, RESIZE_LRTB, 13, 358, 379, 280, 301, 0xFED, STR_0197_TOGGLE_TOWN_NAMES_ON_OFF},
{ WWT_IMGBTN, 13, 0, 518, 408, 451, 0x0, STR_0197_TOGGLE_TOWN_NAMES_ON_OFF}, { WWT_IMGBTN, RESIZE_RTB, 13, 0, 357, 258, 301, 0x0, STR_NULL},
{ WWT_IMGBTN, 13, 519, 540, 408, 429, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_RTB, 13, 0, 433, 302, 313, 0x0, STR_NULL},
{ WIDGETS_END}, { WWT_RESIZEBOX, RESIZE_LRTB, 13, 434, 445, 302, 313, 0x0, STR_RESIZE_BUTTON},
};
static const Widget _smallmap_big_widgets[] = {
{ WWT_TEXTBTN, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 419, 0, 13, STR_00B0_MAP,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 13, 420, 431, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 13, 432, 445, 0, 13, 0x2AA, STR_01CC_TOGGLE_LARGE_SMALL_MAP},
{ WWT_IMGBTN, 13, 0, 445, 14, 257, 0x0, STR_NULL},
{ WWT_6, 13, 2, 443, 16, 255, 0x0, STR_NULL},
{ WWT_IMGBTN, 13, 380, 401, 258, 279, 0x2E2, STR_0191_SHOW_LAND_CONTOURS_ON_MAP},
{ WWT_IMGBTN, 13, 402, 423, 258, 279, 0x2E3, STR_0192_SHOW_VEHICLES_ON_MAP},
{ WWT_IMGBTN, 13, 424, 445, 258, 279, 0x2E5, STR_0193_SHOW_INDUSTRIES_ON_MAP},
{ WWT_IMGBTN, 13, 380, 401, 280, 301, 0x2E4, STR_0194_SHOW_TRANSPORT_ROUTES_ON},
{ WWT_IMGBTN, 13, 402, 423, 280, 301, 0x2E6, STR_0195_SHOW_VEGETATION_ON_MAP},
{ WWT_IMGBTN, 13, 424, 445, 280, 301, 0x2E7, STR_0196_SHOW_LAND_OWNERS_ON_MAP},
{ WWT_IMGBTN, 13, 358, 379, 280, 301, 0xFED, STR_0197_TOGGLE_TOWN_NAMES_ON_OFF},
{ WWT_IMGBTN, 13, 0, 357, 258, 301, 0x0, STR_0197_TOGGLE_TOWN_NAMES_ON_OFF},
{ WWT_IMGBTN, 13, 358, 379, 258, 279, 0x0, STR_NULL},
{ WIDGETS_END},
};
static const Widget _smallmap_small_widgets[] = {
{ WWT_TEXTBTN, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 221, 0, 13, STR_00B0_MAP,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 13, 222, 233, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 13, 234, 247, 0, 13, 0x2AA, STR_01CC_TOGGLE_LARGE_SMALL_MAP},
{ WWT_IMGBTN, 13, 0, 225, 14, 167, 0x0, STR_NULL},
{ WWT_6, 13, 2, 223, 16, 165, 0x0, STR_NULL},
{ WWT_IMGBTN, 13, 226, 247, 14, 35, 0x2E2, STR_0191_SHOW_LAND_CONTOURS_ON_MAP},
{ WWT_IMGBTN, 13, 226, 247, 36, 57, 0x2E3, STR_0192_SHOW_VEHICLES_ON_MAP},
{ WWT_IMGBTN, 13, 226, 247, 58, 79, 0x2E5, STR_0193_SHOW_INDUSTRIES_ON_MAP},
{ WWT_IMGBTN, 13, 226, 247, 80, 101, 0x2E4, STR_0194_SHOW_TRANSPORT_ROUTES_ON},
{ WWT_IMGBTN, 13, 226, 247, 102, 123, 0x2E6, STR_0195_SHOW_VEGETATION_ON_MAP},
{ WWT_IMGBTN, 13, 226, 247, 124, 145, 0x2E7, STR_0196_SHOW_LAND_OWNERS_ON_MAP},
{ WWT_IMGBTN, 13, 226, 247, 146, 167, 0xFED, STR_0197_TOGGLE_TOWN_NAMES_ON_OFF},
{ WWT_IMGBTN, 13, 0, 247, 168, 211, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static int _smallmap_type; static int _smallmap_type;
static byte _smallmap_size;
static bool _smallmap_show_towns = true; static bool _smallmap_show_towns = true;
static void DoShowSmallMap(int big);
#define MK(a,b) a,b #define MK(a,b) a,b
#define MKEND() 0xffff #define MKEND() 0xffff
#define MS(a,b) (a|0x100),b #define MS(a,b) (a|0x100),b
@ -848,7 +808,6 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
int x,y,y_org; int x,y,y_org;
DrawPixelInfo new_dpi; DrawPixelInfo new_dpi;
/* draw the window */ /* draw the window */
SetDParam(0, STR_00E5_CONTOURS + _smallmap_type); SetDParam(0, STR_00E5_CONTOURS + _smallmap_type);
DrawWindowWidgets(w); DrawWindowWidgets(w);
@ -856,9 +815,9 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
/* draw the legend */ /* draw the legend */
tbl = _legend_table[(_smallmap_type != 2) ? _smallmap_type : (_opt.landscape + IND_OFFS)]; tbl = _legend_table[(_smallmap_type != 2) ? _smallmap_type : (_opt.landscape + IND_OFFS)];
x = 4; x = 4;
y_org = w->height - 43; y_org = w->height - 43 - 11;
y = y_org; y = y_org;
while(1) { while (true) {
GfxFillRect(x, y+1, x+8, y + 5, 0); GfxFillRect(x, y+1, x+8, y + 5, 0);
GfxFillRect(x+1, y+2, x+7, y + 4, (byte)tbl[0]); GfxFillRect(x+1, y+2, x+7, y + 4, (byte)tbl[0]);
DrawString(x+11, y, tbl[1], 0); DrawString(x+11, y, tbl[1], 0);
@ -874,7 +833,7 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
} }
} }
if (!FillDrawPixelInfo(&new_dpi, NULL, 3, 17, w->width - 28 + (w->widget == _smallmap_small_widgets ? 0 : 22), w->height - 64)) if (!FillDrawPixelInfo(&new_dpi, NULL, 3, 17, w->width - 28 + 22, w->height - 64 - 11))
return; return;
DrawSmallMap(&new_dpi, w, _smallmap_type, _smallmap_show_towns); DrawSmallMap(&new_dpi, w, _smallmap_type, _smallmap_show_towns);
@ -882,18 +841,7 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
case WE_CLICK: case WE_CLICK:
switch(e->click.widget) { switch(e->click.widget) {
case 3: {/* big/small size */ case 4: {/* main wnd */
// const Widget *wi = w->widget;
DeleteWindow(w);
SndPlayFx(SND_15_BEEP);
{
int i = _smallmap_size + 1;
if (i == 3) i = 0;
DoShowSmallMap(i);
}
} break;
case 5: {/* main wnd */
Window *w2; Window *w2;
Point pt; Point pt;
@ -906,15 +854,15 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
WP(w2,vp_d).scrollpos_y = pt.y + ((_cursor.pos.y - w->top - 16) << 4) - (w2->viewport->virtual_height >> 1); WP(w2,vp_d).scrollpos_y = pt.y + ((_cursor.pos.y - w->top - 16) << 4) - (w2->viewport->virtual_height >> 1);
} break; } break;
case 6: /* show land contours */ case 5: /* show land contours */
case 7: /* show vehicles */ case 6: /* show vehicles */
case 8: /* show industries */ case 7: /* show industries */
case 9: /* show transport routes */ case 8: /* show transport routes */
case 10: /* show vegetation */ case 9: /* show vegetation */
case 11: /* show land owners */ case 10: /* show land owners */
w->click_state &= ~(1<<6|1<<7|1<<8|1<<9|1<<10|1<<11); w->click_state &= ~(1<<5|1<<6|1<<7|1<<8|1<<9|1<<10);
w->click_state |= 1 << e->click.widget; w->click_state |= 1 << e->click.widget;
_smallmap_type = e->click.widget - 6; _smallmap_type = e->click.widget - 5;
SetWindowDirty(w); SetWindowDirty(w);
SndPlayFx(SND_15_BEEP); SndPlayFx(SND_15_BEEP);
@ -930,7 +878,7 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
break; break;
case WE_RCLICK: case WE_RCLICK:
if (e->click.widget == 5) { if (e->click.widget == 4) {
if (_scrolling_viewport) if (_scrolling_viewport)
return; return;
_scrolling_viewport = true; _scrolling_viewport = true;
@ -947,73 +895,50 @@ static void SmallMapWindowProc(Window *w, WindowEvent *e)
} }
} }
static const WindowDesc _smallmap_small_desc = { static const WindowDesc _smallmap_desc = {
-1,-1, 248, 212, -1,-1, 446, 314,
WC_SMALLMAP,0, WC_SMALLMAP,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_smallmap_small_widgets, _smallmap_widgets,
SmallMapWindowProc SmallMapWindowProc
}; };
static const WindowDesc _smallmap_big_desc = { void ShowSmallMap()
-1,-1, 446, 302,
WC_SMALLMAP,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
_smallmap_big_widgets,
SmallMapWindowProc
};
static const WindowDesc _smallmap_megabig_desc = {
-1,-1, 607, 452,
WC_SMALLMAP,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
_smallmap_megabig_widgets,
SmallMapWindowProc
};
static const WindowDesc * const _smallmap_descs[3] = {
&_smallmap_small_desc,
&_smallmap_big_desc,
&_smallmap_megabig_desc
};
static void DoShowSmallMap(int big)
{ {
Window *w; Window *w;
ViewPort *vp; ViewPort *vp;
int x,y; int x,y;
_smallmap_size = big; w = AllocateWindowDescFront(&_smallmap_desc, 0);
w = AllocateWindowDescFront(_smallmap_descs[big], 0);
if (w) { if (w) {
w->click_state = (1<<6) << _smallmap_type | _smallmap_show_towns << 12; w->click_state = ((1<<5) << _smallmap_type) | (_smallmap_show_towns << 12);
w->resize.width = 350;
w->resize.height = 250;
vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport; vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
x = (((vp->virtual_width - (big?220*32:110*32)) >> 1) + vp->virtual_left) >> 2; x = (((vp->virtual_width - (220*32)) / 2) + vp->virtual_left) / 4;
y = ((((vp->virtual_height- (big?120*32:75*32)) >> 1) + vp->virtual_top) >> 1) - 32; y = ((((vp->virtual_height- (120*32)) / 2) + vp->virtual_top ) / 2) - 32;
WP(w,smallmap_d).scroll_x = (y-x) & ~0xF; WP(w,smallmap_d).scroll_x = (y-x) & ~0xF;
WP(w,smallmap_d).scroll_y = (x+y) & ~0xF; WP(w,smallmap_d).scroll_y = (x+y) & ~0xF;
WP(w,smallmap_d).subscroll = 0; WP(w,smallmap_d).subscroll = 0;
} }
} }
void ShowSmallMap()
{
DoShowSmallMap(_smallmap_size);
}
/* Extra ViewPort Window Stuff */ /* Extra ViewPort Window Stuff */
static Widget _extra_view_port_widgets[] = { static const Widget _extra_view_port_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 287, 0, 13, STR_EXTRA_VIEW_PORT_TITLE, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 287, 0, 13, STR_EXTRA_VIEW_PORT_TITLE, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 288, 299, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 288, 299, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 14, 0, 299, 14, 233, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_RB, 14, 0, 299, 14, 233, 0x0, STR_NULL},
{ WWT_6, 14, 2, 297, 16, 231, 0x0, STR_NULL}, { WWT_6, RESIZE_RB, 14, 2, 297, 16, 231, 0x0, STR_NULL},
{ WWT_PANEL, 14, 0, 21, 234, 255, 0x2DF, STR_017F_ZOOM_THE_VIEW_IN}, { WWT_PANEL, RESIZE_TB, 14, 0, 21, 234, 255, 0x2DF, STR_017F_ZOOM_THE_VIEW_IN},
{ WWT_PANEL, 14, 22, 43, 234, 255, 0x2E0, STR_0180_ZOOM_THE_VIEW_OUT}, { WWT_PANEL, RESIZE_TB, 14, 22, 43, 234, 255, 0x2E0, STR_0180_ZOOM_THE_VIEW_OUT},
{ WWT_PUSHTXTBTN, 14, 44, 171, 234, 255, STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW,STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 44, 171, 234, 255, STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW,STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT},
{ WWT_PUSHTXTBTN, 14, 172, 299, 234, 255, STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN,STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 172, 298, 234, 255, STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN,STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT},
{ WWT_PANEL, RESIZE_RTB, 14, 299, 299, 234, 255, 0x0, STR_NULL},
{ WWT_PANEL, RESIZE_RTB, 14, 0, 287, 256, 267, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 288, 299, 256, 267, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1032,11 +957,11 @@ static void ExtraViewPortWndProc(Window *w, WindowEvent *e)
case WE_CLICK: { case WE_CLICK: {
switch(e->click.widget) { switch(e->click.widget) {
case 5: { /* zoom in */ case 5: { /* zoom in */
DoZoomInOutWindow(ZOOM_IN,w); DoZoomInOutWindow(ZOOM_IN, w);
} break; } break;
case 6: { /* zoom out */ case 6: { /* zoom out */
DoZoomInOutWindow(ZOOM_OUT,w); DoZoomInOutWindow(ZOOM_OUT, w);
} break; } break;
case 7: { /* location button (move main view to same spot as this view) */ case 7: { /* location button (move main view to same spot as this view) */
@ -1045,26 +970,33 @@ static void ExtraViewPortWndProc(Window *w, WindowEvent *e)
int y = WP(w,vp_d).scrollpos_y; int y = WP(w,vp_d).scrollpos_y;
// set this view to same location. Based on the center, adjusting for zoom // set this view to same location. Based on the center, adjusting for zoom
WP(w2,vp_d).scrollpos_x = x - (w2->viewport->virtual_width - (294 <<vp->zoom) )/2; WP(w2,vp_d).scrollpos_x = x - (w2->viewport->virtual_width - (w->viewport->virtual_width << vp->zoom)) / 2;
WP(w2,vp_d).scrollpos_y = y - (w2->viewport->virtual_height - (214 << vp->zoom) )/2; WP(w2,vp_d).scrollpos_y = y - (w2->viewport->virtual_height - (w->viewport->virtual_height << vp->zoom)) / 2;
} break; } break;
case 8: { /* inverse location button (move this view to same spot as main view) */ case 8: { /* inverse location button (move this view to same spot as main view) */
Window * w2 = FindWindowById(WC_MAIN_WINDOW, 0); Window * w2 = FindWindowById(WC_MAIN_WINDOW, 0);
int x = WP(w2,vp_d).scrollpos_x; int x = WP(w2,vp_d).scrollpos_x;
int y = WP(w2,vp_d).scrollpos_y; int y = WP(w2,vp_d).scrollpos_y;
WP(w,vp_d).scrollpos_x = x + (w2->viewport->virtual_width - (294 <<vp->zoom) )/2; WP(w,vp_d).scrollpos_x = x + (w2->viewport->virtual_width - (w->viewport->virtual_width << vp->zoom)) / 2;
WP(w,vp_d).scrollpos_y = y + (w2->viewport->virtual_height - (214 << vp->zoom) )/2; WP(w,vp_d).scrollpos_y = y + (w2->viewport->virtual_height - (w->viewport->virtual_height << vp->zoom)) / 2;
} break; } break;
} }
} break; } break;
case WE_RESIZE: {
w->viewport->width += e->sizing.diff.x;
w->viewport->height += e->sizing.diff.y;
w->viewport->virtual_width += e->sizing.diff.x;
w->viewport->virtual_height += e->sizing.diff.y;
} break;
} }
} }
static const WindowDesc _extra_view_port_desc = { static const WindowDesc _extra_view_port_desc = {
-1,-1, 300, 256, -1,-1, 300, 268,
WC_EXTRA_VIEW_PORT,0, WC_EXTRA_VIEW_PORT,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_extra_view_port_widgets, _extra_view_port_widgets,
ExtraViewPortWndProc ExtraViewPortWndProc
}; };
@ -1075,15 +1007,15 @@ void ShowExtraViewPortWindow()
int i = 0; int i = 0;
// find next free window number for extra viewport // find next free window number for extra viewport
while (FindWindowById(WC_EXTRA_VIEW_PORT,i) ) { while (FindWindowById(WC_EXTRA_VIEW_PORT, i) ) {
i++; i++;
} }
w = AllocateWindowDescFront(&_extra_view_port_desc,i); w = AllocateWindowDescFront(&_extra_view_port_desc, i);
if (w) { if (w) {
int x,y; int x, y;
// disable zoom in button // disable zoom in button
w->disabled_state = 1 << 4; w->disabled_state = (1 << 4);
// the main window with the main view // the main window with the main view
v = FindWindowById(WC_MAIN_WINDOW, 0); v = FindWindowById(WC_MAIN_WINDOW, 0);
// New viewport start ats (zero,zero) // New viewport start ats (zero,zero)
@ -1092,7 +1024,7 @@ void ShowExtraViewPortWindow()
// center on same place as main window (zoom is maximum, no adjustment needed) // center on same place as main window (zoom is maximum, no adjustment needed)
x = WP(v,vp_d).scrollpos_x; x = WP(v,vp_d).scrollpos_x;
y = WP(v,vp_d).scrollpos_y; y = WP(v,vp_d).scrollpos_y;
WP(w,vp_d).scrollpos_x = x + (v->viewport->virtual_width - (294) )/2; WP(w,vp_d).scrollpos_x = x + (v->viewport->virtual_width - (294)) / 2;
WP(w,vp_d).scrollpos_y = y + (v->viewport->virtual_height - (214) )/2; WP(w,vp_d).scrollpos_y = y + (v->viewport->virtual_height - (214)) / 2;
} }
} }

View File

@ -226,22 +226,27 @@ static void PlayerStationsWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w); SetWindowDirty(w);
} }
break; break;
case WE_RESIZE:
w->vscroll.cap += e->sizing.diff.y / 10;
break;
} }
} }
static const Widget _player_stations_widgets[] = { static const Widget _player_stations_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 345, 0, 13, STR_3048_STATIONS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 345, 0, 13, STR_3048_STATIONS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 346, 357, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 346, 357, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 14, 0, 346, 14, 137, 0x0, STR_3057_STATION_NAMES_CLICK_ON}, { WWT_PANEL, RESIZE_RB, 14, 0, 346, 14, 137, 0x0, STR_3057_STATION_NAMES_CLICK_ON},
{ WWT_SCROLLBAR, 14, 347, 357, 14, 137, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 347, 357, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 347, 357, 126, 137, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const WindowDesc _player_stations_desc = { static const WindowDesc _player_stations_desc = {
-1, -1, 358, 138, -1, -1, 358, 138,
WC_STATION_LIST,0, WC_STATION_LIST,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_player_stations_widgets, _player_stations_widgets,
PlayerStationsWndProc PlayerStationsWndProc
}; };
@ -255,42 +260,44 @@ void ShowPlayerStations(int player)
if (w) { if (w) {
w->caption_color = (byte)w->window_number; w->caption_color = (byte)w->window_number;
w->vscroll.cap = 12; w->vscroll.cap = 12;
w->resize.step_height = 10;
w->resize.height = w->height - 10 * 7; // minimum if 5 in the list
} }
} }
static const Widget _station_view_expanded_widgets[] = { static const Widget _station_view_expanded_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 236, 0, 13, STR_300A_0, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 236, 0, 13, STR_300A_0, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 237, 248, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 14, 237, 248, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 14, 0, 237, 14, 65, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 237, 14, 65, 0x0, STR_NULL},
{ WWT_SCROLLBAR, 14, 238, 248, 14, 65, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 238, 248, 14, 65, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_IMGBTN, 14, 0, 248, 66, 197, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 248, 66, 197, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 63, 198, 209, STR_00E4_LOCATION, STR_3053_CENTER_MAIN_VIEW_ON_STATION}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 63, 198, 209, STR_00E4_LOCATION, STR_3053_CENTER_MAIN_VIEW_ON_STATION},
{ WWT_PUSHTXTBTN, 14, 64, 128, 198, 209, STR_3033_ACCEPTS, STR_3056_SHOW_LIST_OF_ACCEPTED_CARGO}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 64, 128, 198, 209, STR_3033_ACCEPTS, STR_3056_SHOW_LIST_OF_ACCEPTED_CARGO},
{ WWT_PUSHTXTBTN, 14, 129, 192, 198, 209, STR_0130_RENAME, STR_3055_CHANGE_NAME_OF_STATION}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 129, 192, 198, 209, STR_0130_RENAME, STR_3055_CHANGE_NAME_OF_STATION},
{ WWT_PUSHTXTBTN, 14, 193, 206, 198, 209, STR_TRAIN, STR_SCHEDULED_TRAINS_TIP }, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 193, 206, 198, 209, STR_TRAIN, STR_SCHEDULED_TRAINS_TIP },
{ WWT_PUSHTXTBTN, 14, 207, 220, 198, 209, STR_LORRY, STR_SCHEDULED_ROAD_VEHICLES_TIP }, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 207, 220, 198, 209, STR_LORRY, STR_SCHEDULED_ROAD_VEHICLES_TIP },
{ WWT_PUSHTXTBTN, 14, 221, 234, 198, 209, STR_PLANE, STR_SCHEDULED_AIRCRAFT_TIP }, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 221, 234, 198, 209, STR_PLANE, STR_SCHEDULED_AIRCRAFT_TIP },
{ WWT_PUSHTXTBTN, 14, 235, 248, 198, 209, STR_SHIP, STR_SCHEDULED_SHIPS_TIP }, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 235, 248, 198, 209, STR_SHIP, STR_SCHEDULED_SHIPS_TIP },
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _station_view_widgets[] = { static const Widget _station_view_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 236, 0, 13, STR_300A_0, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 236, 0, 13, STR_300A_0, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 237, 248, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 14, 237, 248, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 14, 0, 237, 14, 65, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 237, 14, 65, 0x0, STR_NULL},
{ WWT_SCROLLBAR, 14, 238, 248, 14, 65, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 238, 248, 14, 65, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_IMGBTN, 14, 0, 248, 66, 97, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 248, 66, 97, 0x0, STR_NULL},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 63, 98, 109, STR_00E4_LOCATION, STR_3053_CENTER_MAIN_VIEW_ON_STATION}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 63, 98, 109, STR_00E4_LOCATION, STR_3053_CENTER_MAIN_VIEW_ON_STATION},
{ WWT_PUSHTXTBTN, 14, 64, 128, 98, 109, STR_3032_RATINGS, STR_3054_SHOW_STATION_RATINGS}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 64, 128, 98, 109, STR_3032_RATINGS, STR_3054_SHOW_STATION_RATINGS},
{ WWT_PUSHTXTBTN, 14, 129, 192, 98, 109, STR_0130_RENAME, STR_3055_CHANGE_NAME_OF_STATION}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 129, 192, 98, 109, STR_0130_RENAME, STR_3055_CHANGE_NAME_OF_STATION},
{ WWT_PUSHTXTBTN, 14, 193, 206, 98, 109, STR_TRAIN, STR_SCHEDULED_TRAINS_TIP }, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 193, 206, 98, 109, STR_TRAIN, STR_SCHEDULED_TRAINS_TIP },
{ WWT_PUSHTXTBTN, 14, 207, 220, 98, 109, STR_LORRY, STR_SCHEDULED_ROAD_VEHICLES_TIP }, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 207, 220, 98, 109, STR_LORRY, STR_SCHEDULED_ROAD_VEHICLES_TIP },
{ WWT_PUSHTXTBTN, 14, 221, 234, 98, 109, STR_PLANE, STR_SCHEDULED_AIRCRAFT_TIP }, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 221, 234, 98, 109, STR_PLANE, STR_SCHEDULED_AIRCRAFT_TIP },
{ WWT_PUSHTXTBTN, 14, 235, 248, 98, 109, STR_SHIP, STR_SCHEDULED_SHIPS_TIP }, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 235, 248, 98, 109, STR_SHIP, STR_SCHEDULED_SHIPS_TIP },
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -386,7 +393,7 @@ static void DrawStationViewWindow(Window *w)
} }
} while (pos > -5 && ++i != 12); } while (pos > -5 && ++i != 12);
if (w->widget == _station_view_widgets) { if (IsWindowOfPrototype(w, _station_view_widgets)) {
b = _userstring; b = _userstring;
b[0] = 0x81; b[0] = 0x81;
b[1] = STR_000C_ACCEPTS; b[1] = STR_000C_ACCEPTS;
@ -449,8 +456,13 @@ static void StationViewWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w); SetWindowDirty(w);
/* toggle height/widget set */ /* toggle height/widget set */
w->height ^= (210 ^ 110); if (IsWindowOfPrototype(w, _station_view_expanded_widgets)) {
*(uint32*)&w->widget ^= (uint32)_station_view_expanded_widgets ^ (uint32)_station_view_widgets; AssignWidgetToWindow(w, _station_view_widgets);
w->height = 110;
} else {
AssignWidgetToWindow(w, _station_view_expanded_widgets);
w->height = 220;
}
SetWindowDirty(w); SetWindowDirty(w);
break; break;

View File

@ -144,9 +144,9 @@ static void SubsidiesListWndProc(Window *w, WindowEvent *e)
} }
static const Widget _subsidies_list_widgets[] = { static const Widget _subsidies_list_widgets[] = {
{ WWT_CLOSEBOX, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 629, 0, 13, STR_2025_SUBSIDIES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 13, 11, 629, 0, 13, STR_2025_SUBSIDIES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 13, 0, 629, 14, 126, 0x0, STR_01FD_CLICK_ON_SERVICE_TO_CENTER}, { WWT_PANEL, RESIZE_NONE, 13, 0, 629, 14, 126, 0x0, STR_01FD_CLICK_ON_SERVICE_TO_CENTER},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -174,18 +174,18 @@ static void TerraformToolbWndProc(Window *w, WindowEvent *e)
} }
static const Widget _terraform_widgets[] = { static const Widget _terraform_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 7, 11, 123, 0, 13, STR_LANDSCAPING_TOOLBAR, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 7, 11, 123, 0, 13, STR_LANDSCAPING_TOOLBAR, STR_018C_WINDOW_TITLE_DRAG_THIS},
{WWT_STICKYBOX, 7, 124, 135, 0, 13, 0x0, STR_STICKY_BUTTON}, {WWT_STICKYBOX, RESIZE_NONE, 7, 124, 135, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 7, 66, 69, 14, 35, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 7, 66, 69, 14, 35, 0x0, STR_NULL},
{ WWT_PANEL, 7, 0, 21, 14, 35, 695, STR_018E_LOWER_A_CORNER_OF_LAND}, { WWT_PANEL, RESIZE_NONE, 7, 0, 21, 14, 35, 695, STR_018E_LOWER_A_CORNER_OF_LAND},
{ WWT_PANEL, 7, 22, 43, 14, 35, 694, STR_018F_RAISE_A_CORNER_OF_LAND}, { WWT_PANEL, RESIZE_NONE, 7, 22, 43, 14, 35, 694, STR_018F_RAISE_A_CORNER_OF_LAND},
{ WWT_PANEL, 7, 44, 65, 14, 35, SPR_OPENTTD_BASE+68, STR_LEVEL_LAND_TOOLTIP}, { WWT_PANEL, RESIZE_NONE, 7, 44, 65, 14, 35, SPR_OPENTTD_BASE+68, STR_LEVEL_LAND_TOOLTIP},
{ WWT_PANEL, 7, 70, 91, 14, 35, 4791, STR_0329_PURCHASE_LAND_FOR_FUTURE}, { WWT_PANEL, RESIZE_NONE, 7, 70, 91, 14, 35, 4791, STR_0329_PURCHASE_LAND_FOR_FUTURE},
{ WWT_PANEL, 7, 92, 113, 14, 35, 742, STR_0185_PLANT_TREES_PLACE_SIGNS}, { WWT_PANEL, RESIZE_NONE, 7, 92, 113, 14, 35, 742, STR_0185_PLANT_TREES_PLACE_SIGNS},
{ WWT_PANEL, 7, 114, 135, 14, 35, SPR_OPENTTD_BASE+70, STR_0289_PLACE_SIGN}, { WWT_PANEL, RESIZE_NONE, 7, 114, 135, 14, 35, SPR_OPENTTD_BASE+70, STR_0289_PLACE_SIGN},
{ WIDGETS_END}, { WIDGETS_END},
}; };

View File

@ -10,13 +10,13 @@
#include "player.h" #include "player.h"
static const Widget _town_authority_widgets[] = { static const Widget _town_authority_widgets[] = {
{ WWT_TEXTBTN, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 316, 0, 13, STR_2022_LOCAL_AUTHORITY, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 13, 11, 316, 0, 13, STR_2022_LOCAL_AUTHORITY, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 13, 0, 316, 14, 105, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 13, 0, 316, 14, 105, 0x0, STR_NULL},
{ WWT_IMGBTN, 13, 0, 305, 106, 157, 0x0, STR_2043_LIST_OF_THINGS_TO_DO_AT}, { WWT_IMGBTN, RESIZE_NONE, 13, 0, 305, 106, 157, 0x0, STR_2043_LIST_OF_THINGS_TO_DO_AT},
{ WWT_SCROLLBAR, 13, 306, 316, 106, 157, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 13, 306, 316, 106, 157, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_IMGBTN, 13, 0, 316, 158, 209, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 13, 0, 316, 158, 209, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 13, 0, 316, 210, 221, STR_2042_DO_IT, STR_2044_CARRY_OUT_THE_HIGHLIGHTED}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 0, 316, 210, 221, STR_2042_DO_IT, STR_2044_CARRY_OUT_THE_HIGHLIGHTED},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -278,15 +278,15 @@ static void TownViewWndProc(Window *w, WindowEvent *e)
static const Widget _town_view_widgets[] = { static const Widget _town_view_widgets[] = {
{ WWT_TEXTBTN, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 247, 0, 13, STR_2005, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 13, 11, 247, 0, 13, STR_2005, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 13, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 13, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 13, 0, 259, 14, 105, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 13, 0, 259, 14, 105, 0x0, STR_NULL},
{ WWT_6, 13, 2, 257, 16, 103, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, 13, 2, 257, 16, 103, 0x0, STR_NULL},
{ WWT_IMGBTN, 13, 0, 259, 106, 137, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 13, 0, 259, 106, 137, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 13, 0, 85, 138, 149, STR_00E4_LOCATION, STR_200B_CENTER_THE_MAIN_VIEW_ON}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 0, 85, 138, 149, STR_00E4_LOCATION, STR_200B_CENTER_THE_MAIN_VIEW_ON},
{ WWT_PUSHTXTBTN, 13, 86, 171, 138, 149, STR_2020_LOCAL_AUTHORITY,STR_2021_SHOW_INFORMATION_ON_LOCAL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 86, 171, 138, 149, STR_2020_LOCAL_AUTHORITY,STR_2021_SHOW_INFORMATION_ON_LOCAL},
{ WWT_PUSHTXTBTN, 13, 172, 259, 138, 149, STR_0130_RENAME, STR_200C_CHANGE_TOWN_NAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 172, 259, 138, 149, STR_0130_RENAME, STR_200C_CHANGE_TOWN_NAME},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -299,17 +299,17 @@ static const WindowDesc _town_view_desc = {
}; };
static const Widget _town_view_scen_widgets[] = { static const Widget _town_view_scen_widgets[] = {
{ WWT_TEXTBTN, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 172, 0, 13, STR_2005, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 13, 11, 172, 0, 13, STR_2005, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 13, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 13, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_IMGBTN, 13, 0, 259, 14, 105, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 13, 0, 259, 14, 105, 0x0, STR_NULL},
{ WWT_6, 13, 2, 257, 16, 103, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, 13, 2, 257, 16, 103, 0x0, STR_NULL},
{ WWT_IMGBTN, 13, 0, 259, 106, 137, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 13, 0, 259, 106, 137, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 13, 0, 85, 138, 149, STR_00E4_LOCATION, STR_200B_CENTER_THE_MAIN_VIEW_ON}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 0, 85, 138, 149, STR_00E4_LOCATION, STR_200B_CENTER_THE_MAIN_VIEW_ON},
{ WWT_EMPTY, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 13, 173, 247, 0, 13, STR_0130_RENAME, STR_200C_CHANGE_TOWN_NAME}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 173, 247, 0, 13, STR_0130_RENAME, STR_200C_CHANGE_TOWN_NAME},
{ WWT_PUSHTXTBTN, 13, 86, 171, 138, 149, STR_023C_EXPAND, STR_023B_INCREASE_SIZE_OF_TOWN}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 86, 171, 138, 149, STR_023C_EXPAND, STR_023B_INCREASE_SIZE_OF_TOWN},
{ WWT_PUSHTXTBTN, 13, 172, 259, 138, 149, STR_0290_DELETE, STR_0291_DELETE_THIS_TOWN_COMPLETELY}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 172, 259, 138, 149, STR_0290_DELETE, STR_0291_DELETE_THIS_TOWN_COMPLETELY},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -340,13 +340,14 @@ void ShowTownViewWindow(uint town)
} }
static const Widget _town_directory_widgets[] = { static const Widget _town_directory_widgets[] = {
{ WWT_TEXTBTN, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 13, 11, 195, 0, 13, STR_2000_TOWNS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 13, 11, 195, 0, 13, STR_2000_TOWNS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 13, 196, 207, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 13, 196, 207, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PUSHTXTBTN, 13, 0, 98, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 0, 98, 14, 25, STR_SORT_BY_NAME, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 13, 99, 196, 14, 25, STR_SORT_BY_POPULATION,STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 13, 99, 196, 14, 25, STR_SORT_BY_POPULATION, STR_SORT_ORDER_TIP},
{ WWT_IMGBTN, 13, 0, 196, 26, 189, 0x0, STR_200A_TOWN_NAMES_CLICK_ON_NAME}, { WWT_IMGBTN, RESIZE_BOTTOM, 13, 0, 196, 26, 189, 0x0, STR_200A_TOWN_NAMES_CLICK_ON_NAME},
{ WWT_SCROLLBAR, 13, 197, 207, 14, 189, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_BOTTOM, 13, 197, 207, 14, 177, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_RESIZEBOX, RESIZE_TB, 13, 197, 207, 178, 189, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -480,13 +481,17 @@ static void TownDirectoryWndProc(Window *w, WindowEvent *e)
case WE_4: case WE_4:
SetWindowDirty(w); SetWindowDirty(w);
break; break;
case WE_RESIZE:
w->vscroll.cap += e->sizing.diff.y / 10;
break;
} }
} }
static const WindowDesc _town_directory_desc = { static const WindowDesc _town_directory_desc = {
-1, -1, 208, 190, -1, -1, 208, 190,
WC_TOWN_DIRECTORY,0, WC_TOWN_DIRECTORY,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_town_directory_widgets, _town_directory_widgets,
TownDirectoryWndProc TownDirectoryWndProc
}; };
@ -499,6 +504,8 @@ void ShowTownDirectory()
w = AllocateWindowDescFront(&_town_directory_desc, 0); w = AllocateWindowDescFront(&_town_directory_desc, 0);
if (w) { if (w) {
w->vscroll.cap = 16; w->vscroll.cap = 16;
w->resize.step_height = 10;
w->resize.height = w->height - 10 * 6; // minimum of 10 items in the list
} }
} }

View File

@ -47,7 +47,7 @@ void Set_DPARAM_Train_Engine_Build_Window(uint16 engine_number)
void Set_DPARAM_Train_Car_Build_Window(Window *w, uint16 engine_number) void Set_DPARAM_Train_Car_Build_Window(Window *w, uint16 engine_number)
{ {
const RailVehicleInfo *rvi = RailVehInfo(engine_number); const RailVehicleInfo *rvi = RailVehInfo(engine_number);
SetDParam(0, DoCommandByTile(w->window_number, engine_number, 0, DC_QUERY_COST, CMD_BUILD_RAIL_VEHICLE) ); SetDParam(0, DoCommandByTile(w->window_number, engine_number, 0, DC_QUERY_COST, CMD_BUILD_RAIL_VEHICLE) );
SetDParam(4, rvi->capacity); SetDParam(4, rvi->capacity);
SetDParam(1, rvi->weight); SetDParam(1, rvi->weight);
@ -99,7 +99,7 @@ void CcBuildLoco(bool success, uint tile, uint32 p1, uint32 p2)
} }
static void engine_drawing_loop(int *x, int *y, int *pos, int *sel, static void engine_drawing_loop(int *x, int *y, int *pos, int *sel,
int *selected_id, byte railtype, bool is_engine) int *selected_id, byte railtype, byte show_max, bool is_engine)
{ {
int i; int i;
@ -111,11 +111,11 @@ static void engine_drawing_loop(int *x, int *y, int *pos, int *sel,
!HASBIT(e->player_avail, _local_player)) !HASBIT(e->player_avail, _local_player))
continue; continue;
if (*sel == 0) *selected_id = i; if (*sel == 0)
*selected_id = i;
if (IS_INT_INSIDE(--*pos, -8, 0)) { if (IS_INT_INSIDE(--*pos, -show_max, 0)) {
DrawString(*x + 59, *y + 2, GetCustomEngineName(i), DrawString(*x + 59, *y + 2, GetCustomEngineName(i), *sel == 0 ? 0xC : 0x10);
*sel == 0 ? 0xC : 0x10);
DrawTrainEngine(*x + 29, *y + 6 + _traininfo_vehicle_pitch, i, DrawTrainEngine(*x + 29, *y + 6 + _traininfo_vehicle_pitch, i,
SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player))); SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
*y += 14; *y += 14;
@ -162,8 +162,8 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e)
* XXX - DO NOT EVER DO THIS EVER AGAIN! GRRR hacking in wagons as * XXX - DO NOT EVER DO THIS EVER AGAIN! GRRR hacking in wagons as
* engines to get more types.. Stays here until we have our own format * engines to get more types.. Stays here until we have our own format
* then it is exit!!! */ * then it is exit!!! */
engine_drawing_loop(&x, &y, &pos, &sel, &selected_id, railtype, true); // True engines engine_drawing_loop(&x, &y, &pos, &sel, &selected_id, railtype, w->vscroll.cap, true); // True engines
engine_drawing_loop(&x, &y, &pos, &sel, &selected_id, railtype, false); // Feeble wagons engine_drawing_loop(&x, &y, &pos, &sel, &selected_id, railtype, w->vscroll.cap, false); // Feeble wagons
WP(w,buildtrain_d).sel_engine = selected_id; WP(w,buildtrain_d).sel_engine = selected_id;
@ -174,12 +174,12 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e)
/* it's an engine */ /* it's an engine */
Set_DPARAM_Train_Engine_Build_Window(selected_id); Set_DPARAM_Train_Engine_Build_Window(selected_id);
DrawString(2, 0x7F, STR_8817_COST_WEIGHT_T_SPEED_POWER, 0); DrawString(2, w->widget[4].top + 1, STR_8817_COST_WEIGHT_T_SPEED_POWER, 0);
} else { } else {
/* it's a wagon */ /* it's a wagon */
Set_DPARAM_Train_Car_Build_Window(w, selected_id); Set_DPARAM_Train_Car_Build_Window(w, selected_id);
DrawString(2, 0x7F, STR_8821_COST_WEIGHT_T_T_CAPACITY, 0); DrawString(2, w->widget[4].top + 1, STR_8821_COST_WEIGHT_T_T_CAPACITY, 0);
} }
} }
} }
@ -189,7 +189,7 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e)
switch(e->click.widget) { switch(e->click.widget) {
case 2: { case 2: {
uint i = (e->click.pt.y - 14) / 14; uint i = (e->click.pt.y - 14) / 14;
if (i < 8) { if (i < w->vscroll.cap) {
WP(w,buildtrain_d).sel_index = i + w->vscroll.pos; WP(w,buildtrain_d).sel_index = i + w->vscroll.pos;
SetWindowDirty(w); SetWindowDirty(w);
} }
@ -227,24 +227,33 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e)
memcpy(_decode_parameters, b, 32); memcpy(_decode_parameters, b, 32);
DoCommandP(0, WP(w,buildtrain_d).rename_engine, 0, NULL, CMD_RENAME_ENGINE | CMD_MSG(STR_886B_CAN_T_RENAME_TRAIN_VEHICLE)); DoCommandP(0, WP(w,buildtrain_d).rename_engine, 0, NULL, CMD_RENAME_ENGINE | CMD_MSG(STR_886B_CAN_T_RENAME_TRAIN_VEHICLE));
} break; } break;
case WE_RESIZE: {
if (e->sizing.diff.y == 0)
break;
w->vscroll.cap += e->sizing.diff.y / 14;
w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
} break;
} }
} }
static const Widget _new_rail_vehicle_widgets[] = { static const Widget _new_rail_vehicle_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 227, 0, 13, STR_0315, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 227, 0, 13, STR_0315, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_MATRIX, 14, 0, 216, 14, 125, 0x801, STR_8843_TRAIN_VEHICLE_SELECTION}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 0, 216, 14, 125, 0x801, STR_8843_TRAIN_VEHICLE_SELECTION},
{ WWT_SCROLLBAR, 14, 217, 227, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_BOTTOM, 14, 217, 227, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, 14, 0, 227, 126, 187, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 14, 0, 227, 126, 187, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 113, 188, 199, STR_881F_BUILD_VEHICLE, STR_8844_BUILD_THE_HIGHLIGHTED_TRAIN}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 107, 188, 199, STR_881F_BUILD_VEHICLE, STR_8844_BUILD_THE_HIGHLIGHTED_TRAIN},
{ WWT_PUSHTXTBTN, 14, 114, 227, 188, 199, STR_8820_RENAME, STR_8845_RENAME_TRAIN_VEHICLE_TYPE}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 108, 215, 188, 199, STR_8820_RENAME, STR_8845_RENAME_TRAIN_VEHICLE_TYPE},
{ WWT_RESIZEBOX, RESIZE_TB, 14, 217, 227, 188, 199, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const WindowDesc _new_rail_vehicle_desc = { static const WindowDesc _new_rail_vehicle_desc = {
-1, -1, 228, 200, -1, -1, 228, 200,
WC_BUILD_VEHICLE,0, WC_BUILD_VEHICLE,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_new_rail_vehicle_widgets, _new_rail_vehicle_widgets,
NewRailVehicleWndProc NewRailVehicleWndProc
}; };
@ -258,6 +267,10 @@ static void ShowBuildTrainWindow(uint tile)
w = AllocateWindowDesc(&_new_rail_vehicle_desc); w = AllocateWindowDesc(&_new_rail_vehicle_desc);
w->window_number = tile; w->window_number = tile;
w->vscroll.cap = 8; w->vscroll.cap = 8;
w->widget[2].unkA = (w->vscroll.cap << 8) + 1;
w->resize.step_height = 14;
w->resize.height = w->height - 14 * 4; /* Minimum of 4 vehicles in the display */
if (tile != 0) { if (tile != 0) {
w->caption_color = _map_owner[tile]; w->caption_color = _map_owner[tile];
@ -296,11 +309,11 @@ static void DrawTrainDepotWindow(Window *w)
tile = w->window_number; tile = w->window_number;
/* setup disabled buttons */ /* setup disabled buttons */
w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<4)|(1<<5)|(1<<7)); w->disabled_state = (_map_owner[tile]==_local_player) ? 0 : ((1<<5)|(1<<6)|(1<<8));
/* determine amount of items for scroller */ /* determine amount of items for scroller */
num = 1; num = 0;
hnum = 0; hnum = 1;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {
if (v->type == VEH_Train && if (v->type == VEH_Train &&
(v->subtype == 0 || v->subtype == 4) && (v->subtype == 0 || v->subtype == 4) &&
@ -309,7 +322,7 @@ static void DrawTrainDepotWindow(Window *w)
num++; num++;
// determine number of items in the X direction. // determine number of items in the X direction.
if (v->subtype == 0) { if (v->subtype == 0) {
i = -1; i = 0;
u = v; u = v;
do i++; while ( (u=u->next) != NULL); do i++; while ( (u=u->next) != NULL);
if (i > hnum) hnum = i; if (i > hnum) hnum = i;
@ -322,7 +335,7 @@ static void DrawTrainDepotWindow(Window *w)
/* locate the depot struct */ /* locate the depot struct */
for(d=_depots; d->xy != (TileIndex)tile; d++) {} for(d=_depots; d->xy != (TileIndex)tile; d++) {}
SetDParam(0,d->town_index); SetDParam(0, d->town_index);
DrawWindowWidgets(w); DrawWindowWidgets(w);
x = 2; x = 2;
@ -335,9 +348,9 @@ static void DrawTrainDepotWindow(Window *w)
v->subtype == 0 && v->subtype == 0 &&
v->tile == (TileIndex)tile && v->tile == (TileIndex)tile &&
v->u.rail.track == 0x80 && v->u.rail.track == 0x80 &&
--num < 0 && num >= -6) { --num < 0 && num >= -w->vscroll.cap) {
DrawTrainImage(v, x+21, y, 10, w->hscroll.pos, WP(w,traindepot_d).sel); DrawTrainImage(v, x+21, y, w->hscroll.cap, w->hscroll.pos, WP(w,traindepot_d).sel);
/* Draw the train number */ /* Draw the train number */
SetDParam(0, v->unitnumber); SetDParam(0, v->unitnumber);
DrawString(x, y, (v->max_age - 366 < v->age) ? STR_00E3 : STR_00E2, 0); DrawString(x, y, (v->max_age - 366 < v->age) ? STR_00E3 : STR_00E2, 0);
@ -354,9 +367,9 @@ static void DrawTrainDepotWindow(Window *w)
v->subtype == 4 && v->subtype == 4 &&
v->tile == (TileIndex)tile && v->tile == (TileIndex)tile &&
v->u.rail.track == 0x80 && v->u.rail.track == 0x80 &&
--num < 0 && num >= -6) { --num < 0 && num >= -w->vscroll.cap) {
DrawTrainImage(v, x+50, y, 9, 0, WP(w,traindepot_d).sel); DrawTrainImage(v, x+50, y, w->hscroll.cap - 1, 0, WP(w,traindepot_d).sel);
DrawString(x, y+2, STR_8816, 0); DrawString(x, y+2, STR_8816, 0);
y += 14; y += 14;
} }
@ -504,10 +517,10 @@ static void TrainDepotWndProc(Window *w, WindowEvent *e)
case WE_CLICK: { case WE_CLICK: {
switch(e->click.widget) { switch(e->click.widget) {
case 7: case 8:
ShowBuildTrainWindow(w->window_number); ShowBuildTrainWindow(w->window_number);
break; break;
case 8: case 9:
ScrollMainWindowToTile(w->window_number); ScrollMainWindowToTile(w->window_number);
break; break;
case 3: case 3:
@ -522,8 +535,8 @@ static void TrainDepotWndProc(Window *w, WindowEvent *e)
case WE_DRAGDROP: { case WE_DRAGDROP: {
switch(e->click.widget) { switch(e->click.widget) {
case 4: case 5:
case 5: { case 6: {
Vehicle *v; Vehicle *v;
int sell_cmd; int sell_cmd;
@ -541,7 +554,7 @@ static void TrainDepotWndProc(Window *w, WindowEvent *e)
HandleButtonClick(w, e->click.widget); HandleButtonClick(w, e->click.widget);
sell_cmd = (e->click.widget == 5 || _ctrl_pressed) ? 1 : 0; sell_cmd = (e->click.widget == 6 || _ctrl_pressed) ? 1 : 0;
if (v->subtype != 0) { if (v->subtype != 0) {
DoCommandP(v->tile, v->index, sell_cmd, NULL, CMD_SELL_RAIL_WAGON | CMD_MSG(STR_8839_CAN_T_SELL_RAILROAD_VEHICLE)); DoCommandP(v->tile, v->index, sell_cmd, NULL, CMD_SELL_RAIL_WAGON | CMD_MSG(STR_8839_CAN_T_SELL_RAILROAD_VEHICLE));
@ -576,29 +589,37 @@ static void TrainDepotWndProc(Window *w, WindowEvent *e)
break; break;
} }
} break; } break;
case WE_RESIZE: {
/* Update the scroll + matrix */
w->vscroll.cap += e->sizing.diff.y / 14;
w->hscroll.cap += e->sizing.diff.x / 29;
w->widget[3].unkA = (w->vscroll.cap << 8) + 1;
} break;
} }
} }
static const Widget _train_depot_widgets[] = { static const Widget _train_depot_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 336, 0, 13, STR_8800_TRAIN_DEPOT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 336, 0, 13, STR_8800_TRAIN_DEPOT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 337, 348, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 337, 348, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_MATRIX, 14, 0, 313, 14, 97, 0x601, STR_883F_TRAINS_CLICK_ON_TRAIN_FOR}, { WWT_MATRIX, RESIZE_RB, 14, 0, 313, 14, 97, 0x601, STR_883F_TRAINS_CLICK_ON_TRAIN_FOR},
{ WWT_PANEL, 14, 314, 337, 14, 54, 0x2A9, STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE}, { WWT_PANEL, RESIZE_LRB, 14, 314, 337, 14, 13, 0x0, STR_NULL},
{ WWT_PANEL, 14, 314, 337, 55, 108, 0x2BF, STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP}, { WWT_PANEL, RESIZE_LRTB, 14, 314, 337, 14, 54, 0x2A9, STR_8841_DRAG_TRAIN_VEHICLE_TO_HERE},
{ WWT_PANEL, RESIZE_LRTB, 14, 314, 337, 55, 108, 0x2BF, STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP},
{ WWT_SCROLLBAR, 14, 338, 348, 14, 108, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 338, 348, 14, 108, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 0, 173, 109, 120, STR_8815_NEW_VEHICLES, STR_8840_BUILD_NEW_TRAIN_VEHICLE}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 167, 109, 120, STR_8815_NEW_VEHICLES, STR_8840_BUILD_NEW_TRAIN_VEHICLE},
{ WWT_PUSHTXTBTN, 14, 174, 348, 109, 120, STR_00E4_LOCATION, STR_8842_CENTER_MAIN_VIEW_ON_TRAIN}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 168, 336, 109, 120, STR_00E4_LOCATION, STR_8842_CENTER_MAIN_VIEW_ON_TRAIN},
{ WWT_HSCROLLBAR, 14, 0, 313, 98, 108, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_HSCROLLBAR, RESIZE_RTB, 14, 0, 313, 98, 108, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, RESIZE_RTB, 14, 337, 336, 109, 120, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 338, 348, 109, 120, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const WindowDesc _train_depot_desc = { static const WindowDesc _train_depot_desc = {
-1, -1, 349, 121, -1, -1, 349, 121,
WC_VEHICLE_DEPOT,0, WC_VEHICLE_DEPOT,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_train_depot_widgets, _train_depot_widgets,
TrainDepotWndProc TrainDepotWndProc
}; };
@ -612,7 +633,9 @@ void ShowTrainDepotWindow(uint tile)
if (w) { if (w) {
w->caption_color = _map_owner[w->window_number]; w->caption_color = _map_owner[w->window_number];
w->vscroll.cap = 6; w->vscroll.cap = 6;
w->hscroll.cap = 9; w->hscroll.cap = 10;
w->resize.step_width = 29;
w->resize.step_height = 14;
WP(w,traindepot_d).sel = INVALID_VEHICLE; WP(w,traindepot_d).sel = INVALID_VEHICLE;
_backup_orders_tile = 0; _backup_orders_tile = 0;
} }
@ -717,11 +740,11 @@ static void RailVehicleRefitWndProc(Window *w, WindowEvent *e)
static const Widget _rail_vehicle_refit_widgets[] = { static const Widget _rail_vehicle_refit_widgets[] = {
{ WWT_TEXTBTN, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 239, 0, 13, STR_983B_REFIT, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 239, 0, 13, STR_983B_REFIT, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, 14, 0, 239, 14, 135, 0x0, STR_RAIL_SELECT_TYPE_OF_CARGO_FOR}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 239, 14, 135, 0x0, STR_RAIL_SELECT_TYPE_OF_CARGO_FOR},
{ WWT_IMGBTN, 14, 0, 239, 136, 157, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 14, 0, 239, 136, 157, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 239, 158, 169, STR_RAIL_REFIT_VEHICLE,STR_RAIL_REFIT_TO_CARRY_HIGHLIGHTED}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 239, 158, 169, STR_RAIL_REFIT_VEHICLE,STR_RAIL_REFIT_TO_CARRY_HIGHLIGHTED},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -745,19 +768,19 @@ static void ShowRailVehicleRefitWindow(Vehicle *v)
} }
static Widget _train_view_widgets[] = { static Widget _train_view_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 237, 0, 13, STR_882E,STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 237, 0, 13, STR_882E,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 238, 249, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 14, 238, 249, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 14, 0, 231, 14, 121, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 231, 14, 121, 0x0, STR_NULL},
{ WWT_6, 14, 2, 229, 16, 119, 0x0, STR_NULL}, { WWT_6, RESIZE_NONE, 14, 2, 229, 16, 119, 0x0, STR_NULL},
{ WWT_PUSHIMGBTN, 14, 0, 249, 122, 133, 0x0, STR_8846_CURRENT_TRAIN_ACTION_CLICK}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 0, 249, 122, 133, 0x0, STR_8846_CURRENT_TRAIN_ACTION_CLICK},
{ WWT_PUSHIMGBTN, 14, 232, 249, 14, 31, 0x2AB, STR_8848_CENTER_MAIN_VIEW_ON_TRAIN}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 14, 31, 0x2AB, STR_8848_CENTER_MAIN_VIEW_ON_TRAIN},
{ WWT_PUSHIMGBTN, 14, 232, 249, 32, 49, 0x2AD, STR_8849_SEND_TRAIN_TO_DEPOT}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 32, 49, 0x2AD, STR_8849_SEND_TRAIN_TO_DEPOT},
{ WWT_PUSHIMGBTN, 14, 232, 249, 50, 67, 0x2B1, STR_884A_FORCE_TRAIN_TO_PROCEED}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 50, 67, 0x2B1, STR_884A_FORCE_TRAIN_TO_PROCEED},
{ WWT_PUSHIMGBTN, 14, 232, 249, 68, 85, 0x2CB, STR_884B_REVERSE_DIRECTION_OF_TRAIN}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 68, 85, 0x2CB, STR_884B_REVERSE_DIRECTION_OF_TRAIN},
{ WWT_PUSHIMGBTN, 14, 232, 249, 86, 103, 0x2B2, STR_8847_SHOW_TRAIN_S_ORDERS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 86, 103, 0x2B2, STR_8847_SHOW_TRAIN_S_ORDERS},
{ WWT_PUSHIMGBTN, 14, 232, 249, 104, 121, 0x2B3, STR_884C_SHOW_TRAIN_DETAILS}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 104, 121, 0x2B3, STR_884C_SHOW_TRAIN_DETAILS},
{ WWT_PUSHIMGBTN, 14, 232, 249, 68, 85, 0x2B4, STR_RAIL_REFIT_VEHICLE_TO_CARRY}, { WWT_PUSHIMGBTN, RESIZE_NONE, 14, 232, 249, 68, 85, 0x2B4, STR_RAIL_REFIT_VEHICLE_TO_CARRY},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1139,19 +1162,19 @@ do_change_service_int:
} }
static const Widget _train_details_widgets[] = { static const Widget _train_details_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 329, 0, 13, STR_8802_DETAILS,STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 329, 0, 13, STR_8802_DETAILS,STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PUSHTXTBTN, 14, 330, 369, 0, 13, STR_01AA_NAME, STR_8867_NAME_TRAIN}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 330, 369, 0, 13, STR_01AA_NAME, STR_8867_NAME_TRAIN},
{ WWT_PANEL, 14, 0, 369, 14, 55, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 0, 369, 14, 55, 0x0, STR_NULL},
{ WWT_MATRIX, 14, 0, 358, 56, 139, 0x601, STR_NULL}, { WWT_MATRIX, RESIZE_NONE, 14, 0, 358, 56, 139, 0x601, STR_NULL},
{ WWT_SCROLLBAR, 14, 359, 369, 56, 139, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_NONE, 14, 359, 369, 56, 139, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PUSHTXTBTN, 14, 0, 10, 140, 145, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 140, 145, STR_0188, STR_884D_INCREASE_SERVICING_INTERVAL},
{ WWT_PUSHTXTBTN, 14, 0, 10, 146, 151, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 10, 146, 151, STR_0189, STR_884E_DECREASE_SERVICING_INTERVAL},
{ WWT_PANEL, 14, 11, 369, 140, 151, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_NONE, 14, 11, 369, 140, 151, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 92, 152, 163, STR_013C_CARGO, STR_884F_SHOW_DETAILS_OF_CARGO_CARRIED}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 92, 152, 163, STR_013C_CARGO, STR_884F_SHOW_DETAILS_OF_CARGO_CARRIED},
{ WWT_PUSHTXTBTN, 14, 93, 184, 152, 163, STR_013D_INFORMATION, STR_8850_SHOW_DETAILS_OF_TRAIN_VEHICLES}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 93, 184, 152, 163, STR_013D_INFORMATION, STR_8850_SHOW_DETAILS_OF_TRAIN_VEHICLES},
{ WWT_PUSHTXTBTN, 14, 185, 277, 152, 163, STR_013E_CAPACITIES, STR_8851_SHOW_CAPACITIES_OF_EACH}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 185, 277, 152, 163, STR_013E_CAPACITIES, STR_8851_SHOW_CAPACITIES_OF_EACH},
{ WWT_PUSHTXTBTN, 14, 278, 369, 152, 163, STR_013E_TOTAL_CARGO, STR_8852_SHOW_TOTAL_CARGO}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 278, 369, 152, 163, STR_013E_TOTAL_CARGO, STR_8852_SHOW_TOTAL_CARGO},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1182,32 +1205,35 @@ void ShowTrainDetailsWindow(Vehicle *v)
WP(w,traindetails_d).tab = 0; WP(w,traindetails_d).tab = 0;
} }
static const Widget _player_trains_widgets[] = {
static Widget _player_trains_widgets[] = { { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 312, 0, 13, STR_881B_TRAINS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_CAPTION, 14, 11, 312, 0, 13, STR_881B_TRAINS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_STICKYBOX, RESIZE_LR, 14, 313, 324, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_STICKYBOX, 14, 313, 324, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_PUSHTXTBTN, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP}, { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_CLOSEBOX, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP}, { WWT_PANEL, RESIZE_RIGHT, 14, 244, 324, 14, 25, 0x0, STR_NULL},
{ WWT_PANEL, 14, 244, 324, 14, 25, 0x0, STR_NULL}, { WWT_MATRIX, RESIZE_RB, 14, 0, 313, 26, 207, 0x701, STR_883D_TRAINS_CLICK_ON_TRAIN_FOR},
{ WWT_MATRIX, 14, 0, 313, 26, 207, 0x701, STR_883D_TRAINS_CLICK_ON_TRAIN_FOR}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 314, 324, 26, 207, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_SCROLLBAR, 14, 314, 324, 26, 207, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 156, 208, 219, STR_8815_NEW_VEHICLES, STR_883E_BUILD_NEW_TRAINS_REQUIRES},
{ WWT_PUSHTXTBTN, 14, 0, 161, 208, 219, STR_8815_NEW_VEHICLES, STR_883E_BUILD_NEW_TRAINS_REQUIRES}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 157, 313, 208, 219, STR_REPLACE_VEHICLES, STR_REPLACE_HELP},
{ WWT_PUSHTXTBTN, 14, 162, 324, 208, 219, STR_REPLACE_VEHICLES, STR_REPLACE_HELP}, { WWT_PANEL, RESIZE_RTB, 14, 314, 313, 208, 219, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 314, 324, 208, 219, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static Widget _other_player_trains_widgets[] = { static const Widget _other_player_trains_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 312, 0, 13, STR_881B_TRAINS, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_RIGHT, 14, 11, 312, 0, 13, STR_881B_TRAINS, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 313, 324, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_LR, 14, 313, 324, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PUSHTXTBTN, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP}, { WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 80, 14, 25, SRT_SORT_BY, STR_SORT_ORDER_TIP},
{ WWT_PANEL, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP}, { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 14, 25, 0x0, STR_SORT_CRITERIA_TIP},
{ WWT_CLOSEBOX, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 233, 243, 14, 25, STR_0225, STR_SORT_CRITERIA_TIP},
{ WWT_PANEL, 14, 244, 324, 14, 25, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_RIGHT, 14, 244, 324, 14, 25, 0x0, STR_NULL},
{ WWT_MATRIX, 14, 0, 313, 26, 207, 0x701, STR_883D_TRAINS_CLICK_ON_TRAIN_FOR}, { WWT_MATRIX, RESIZE_RB, 14, 0, 313, 26, 207, 0x701, STR_883D_TRAINS_CLICK_ON_TRAIN_FOR},
{ WWT_SCROLLBAR, 14, 314, 324, 26, 207, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_LRB, 14, 314, 324, 26, 207, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, RESIZE_TB, 14, 0, 312, 208, 219, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 314, 324, 208, 219, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -1236,20 +1262,17 @@ static void PlayerTrainsWndProc(Window *w, WindowEvent *e)
/* draw the widgets */ /* draw the widgets */
{ {
const Player *p = DEREF_PLAYER(owner); const Player *p = DEREF_PLAYER(owner);
/* XXX hack */
if (station == -1) { if (station == -1) {
/* Company Name -- (###) Trains */ /* Company Name -- (###) Trains */
SetDParam(0, p->name_1); SetDParam(0, p->name_1);
SetDParam(1, p->name_2); SetDParam(1, p->name_2);
SetDParam(2, w->vscroll.count); SetDParam(2, w->vscroll.count);
_player_trains_widgets[1].unkA = STR_881B_TRAINS; w->widget[1].unkA = STR_881B_TRAINS;
_other_player_trains_widgets[1].unkA = STR_881B_TRAINS;
} else { } else {
/* Station Name -- (###) Trains */ /* Station Name -- (###) Trains */
SetDParam(0, DEREF_STATION(station)->index); SetDParam(0, DEREF_STATION(station)->index);
SetDParam(1, w->vscroll.count); SetDParam(1, w->vscroll.count);
_player_trains_widgets[1].unkA = STR_SCHEDULED_TRAINS; w->widget[1].unkA = STR_SCHEDULED_TRAINS;
_other_player_trains_widgets[1].unkA = STR_SCHEDULED_TRAINS;
} }
DrawWindowWidgets(w); DrawWindowWidgets(w);
} }
@ -1267,7 +1290,7 @@ static void PlayerTrainsWndProc(Window *w, WindowEvent *e)
assert(v->type == VEH_Train && v->owner == owner); assert(v->type == VEH_Train && v->owner == owner);
DrawTrainImage( DrawTrainImage(
v, x + 21, y + 6 + _traininfo_vehicle_pitch, 10, 0, INVALID_VEHICLE); v, x + 21, y + 6 + _traininfo_vehicle_pitch, w->hscroll.cap, 0, INVALID_VEHICLE);
DrawVehicleProfitButton(v, x, y + 13); DrawVehicleProfitButton(v, x, y + 13);
SetDParam(0, v->unitnumber); SetDParam(0, v->unitnumber);
@ -1326,6 +1349,9 @@ static void PlayerTrainsWndProc(Window *w, WindowEvent *e)
case 9: { /* Build new Vehicle */ case 9: { /* Build new Vehicle */
uint tile; uint tile;
if (!IsWindowOfPrototype(w, _player_trains_widgets))
break;
tile = _last_built_train_depot_tile; tile = _last_built_train_depot_tile;
do { do {
if (_map_owner[tile] == _local_player && IsTrainDepotTile(tile)) { if (_map_owner[tile] == _local_player && IsTrainDepotTile(tile)) {
@ -1380,21 +1406,28 @@ static void PlayerTrainsWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w); SetWindowDirty(w);
} }
break; break;
case WE_RESIZE:
/* Update the scroll + matrix */
w->hscroll.cap += e->sizing.diff.x / 29;
w->vscroll.cap += e->sizing.diff.y / PLY_WND_PRC__SIZE_OF_ROW_SMALL;
w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
break;
} }
} }
static const WindowDesc _player_trains_desc = { static const WindowDesc _player_trains_desc = {
-1, -1, 325, 220, -1, -1, 325, 220,
WC_TRAINS_LIST,0, WC_TRAINS_LIST,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_player_trains_widgets, _player_trains_widgets,
PlayerTrainsWndProc PlayerTrainsWndProc
}; };
static const WindowDesc _other_player_trains_desc = { static const WindowDesc _other_player_trains_desc = {
-1, -1, 325, 208, -1, -1, 325, 220,
WC_TRAINS_LIST,0, WC_TRAINS_LIST,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_other_player_trains_widgets, _other_player_trains_widgets,
PlayerTrainsWndProc PlayerTrainsWndProc
}; };
@ -1410,6 +1443,11 @@ void ShowPlayerTrains(int player, int station)
} }
if (w) { if (w) {
w->caption_color = w->window_number; w->caption_color = w->window_number;
w->hscroll.cap = 10;
w->vscroll.cap = 7; // maximum number of vehicles shown w->vscroll.cap = 7; // maximum number of vehicles shown
w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_SMALL;
w->resize.step_width = 29;
w->resize.height = 220 - (PLY_WND_PRC__SIZE_OF_ROW_SMALL * 3); /* Minimum of 4 vehicles */
} }
} }

View File

@ -88,7 +88,7 @@ void BuildVehicleList(vehiclelist_d *vl, int type, int owner, int station)
if (!(vl->flags & VL_REBUILD)) return; if (!(vl->flags & VL_REBUILD)) return;
DEBUG(misc, 1) ("Building vehicle list for player %d station %d...", DEBUG(misc, 1) ("Building vehicle list for player %d station %d...",
owner, station); owner, station);
if (station != -1) { if (station != -1) {
const Vehicle *v; const Vehicle *v;
@ -311,14 +311,14 @@ int CDECL VehicleMaxSpeedSorter(const void *a, const void *b)
#define ENGINE_AVAILABLE ((e->flags & 1 && HASBIT(info->railtype_climates, _opt.landscape)) || HASBIT(e->player_avail, _local_player)) #define ENGINE_AVAILABLE ((e->flags & 1 && HASBIT(info->railtype_climates, _opt.landscape)) || HASBIT(e->player_avail, _local_player))
/* if show_outdated is selected, it do not sort psudo engines properly but it draws all engines /* if show_outdated is selected, it do not sort psudo engines properly but it draws all engines
* if used compined with show_cars set to false, it will work as intended. Replace window do it like that * if used compined with show_cars set to false, it will work as intended. Replace window do it like that
* this was a big hack even before show_outdated was added. Stupid newgrf :p */ * this was a big hack even before show_outdated was added. Stupid newgrf :p */
static void train_engine_drawing_loop(int *x, int *y, int *pos, int *sel, int *selected_id, byte railtype, static void train_engine_drawing_loop(int *x, int *y, int *pos, int *sel, int *selected_id, byte railtype,
uint8 lines_drawn, bool is_engine, bool show_cars, bool show_outdated) uint8 lines_drawn, bool is_engine, bool show_cars, bool show_outdated)
{ {
int i; int i;
byte colour; byte colour;
for (i = 0; i < NUM_TRAIN_ENGINES; i++) { for (i = 0; i < NUM_TRAIN_ENGINES; i++) {
const Engine *e = DEREF_ENGINE(i); const Engine *e = DEREF_ENGINE(i);
const RailVehicleInfo *rvi = RailVehInfo(i); const RailVehicleInfo *rvi = RailVehInfo(i);
@ -326,7 +326,7 @@ static void train_engine_drawing_loop(int *x, int *y, int *pos, int *sel, int *s
if ( rvi->power == 0 && !(show_cars) ) // disables display of cars (works since they do not have power) if ( rvi->power == 0 && !(show_cars) ) // disables display of cars (works since they do not have power)
continue; continue;
if (*sel == 0) *selected_id = i; if (*sel == 0) *selected_id = i;
@ -335,12 +335,12 @@ static void train_engine_drawing_loop(int *x, int *y, int *pos, int *sel, int *s
if (e->railtype != railtype || !(rvi->flags & RVI_WAGON) != is_engine || if (e->railtype != railtype || !(rvi->flags & RVI_WAGON) != is_engine ||
!HASBIT(e->player_avail, _local_player)) !HASBIT(e->player_avail, _local_player))
continue; continue;
} /*else { } /*else {
// TODO find a nice red colour for vehicles being replaced // TODO find a nice red colour for vehicles being replaced
if ( _autoreplace_array[i] != i ) if ( _autoreplace_array[i] != i )
colour = *sel == 0 ? 0x44 : 0x45; colour = *sel == 0 ? 0x44 : 0x45;
} */ } */
if (IS_INT_INSIDE(--*pos, -lines_drawn, 0)) { if (IS_INT_INSIDE(--*pos, -lines_drawn, 0)) {
DrawString(*x + 59, *y + 2, GetCustomEngineName(i), DrawString(*x + 59, *y + 2, GetCustomEngineName(i),
colour); colour);
@ -361,14 +361,14 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
int count = 0; int count = 0;
int count2 = 0; int count2 = 0;
int engine_id; int engine_id;
switch (WP(w,replaceveh_d).vehicletype) { switch (WP(w,replaceveh_d).vehicletype) {
case VEH_Train: { case VEH_Train: {
railtype = WP(w,replaceveh_d).railtype; railtype = WP(w,replaceveh_d).railtype;
for (engine_id = 0; engine_id < NUM_TRAIN_ENGINES; engine_id++) { for (engine_id = 0; engine_id < NUM_TRAIN_ENGINES; engine_id++) {
const Engine *e = DEREF_ENGINE(engine_id); const Engine *e = DEREF_ENGINE(engine_id);
const EngineInfo *info = &_engine_info[engine_id]; const EngineInfo *info = &_engine_info[engine_id];
if (ENGINE_AVAILABLE && RailVehInfo(engine_id)->power && e->railtype == railtype) { if (ENGINE_AVAILABLE && RailVehInfo(engine_id)->power && e->railtype == railtype) {
count++; count++;
if (sel[0]==0) selected_id[0] = engine_id; if (sel[0]==0) selected_id[0] = engine_id;
@ -394,16 +394,16 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
if (ENGINE_AVAILABLE) { if (ENGINE_AVAILABLE) {
if (sel[0]==0) selected_id[0] = engine_id; if (sel[0]==0) selected_id[0] = engine_id;
count++; count++;
sel[0]--; sel[0]--;
} }
} while (++engine_id,++e,--num); } while (++engine_id,++e,--num);
if ( selected_id[0] != -1 ) { // only draw right array if we have anything in the left one if ( selected_id[0] != -1 ) { // only draw right array if we have anything in the left one
num = NUM_ROAD_ENGINES; num = NUM_ROAD_ENGINES;
engine_id = ROAD_ENGINES_INDEX; engine_id = ROAD_ENGINES_INDEX;
e = &_engines[ROAD_ENGINES_INDEX]; e = &_engines[ROAD_ENGINES_INDEX];
cargo = RoadVehInfo(selected_id[0])->cargo_type; cargo = RoadVehInfo(selected_id[0])->cargo_type;
do { do {
if ( cargo == RoadVehInfo(engine_id)->cargo_type && HASBIT(e->player_avail, _local_player)) { if ( cargo == RoadVehInfo(engine_id)->cargo_type && HASBIT(e->player_avail, _local_player)) {
count2++; count2++;
@ -411,14 +411,14 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
sel[1]--; sel[1]--;
} }
} while (++engine_id,++e,--num); } while (++engine_id,++e,--num);
} }
break; break;
} }
case VEH_Ship: { case VEH_Ship: {
int num = NUM_SHIP_ENGINES; int num = NUM_SHIP_ENGINES;
Engine *e = &_engines[SHIP_ENGINES_INDEX]; Engine *e = &_engines[SHIP_ENGINES_INDEX];
byte cargo, refittable; byte cargo, refittable;
EngineInfo *info; EngineInfo *info;
engine_id = SHIP_ENGINES_INDEX; engine_id = SHIP_ENGINES_INDEX;
@ -427,21 +427,21 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
if (ENGINE_AVAILABLE) { if (ENGINE_AVAILABLE) {
if ( sel[0] == 0 ) selected_id[0] = engine_id; if ( sel[0] == 0 ) selected_id[0] = engine_id;
count++; count++;
sel[0]--; sel[0]--;
} }
} while (++engine_id,++e,--num); } while (++engine_id,++e,--num);
if ( selected_id[0] != -1 ) { if ( selected_id[0] != -1 ) {
num = NUM_SHIP_ENGINES; num = NUM_SHIP_ENGINES;
e = &_engines[SHIP_ENGINES_INDEX]; e = &_engines[SHIP_ENGINES_INDEX];
engine_id = SHIP_ENGINES_INDEX; engine_id = SHIP_ENGINES_INDEX;
cargo = ShipVehInfo(selected_id[0])->cargo_type; cargo = ShipVehInfo(selected_id[0])->cargo_type;
refittable = ShipVehInfo(selected_id[0])->refittable; refittable = ShipVehInfo(selected_id[0])->refittable;
do { do {
if (HASBIT(e->player_avail, _local_player) if (HASBIT(e->player_avail, _local_player)
&& ( cargo == ShipVehInfo(engine_id)->cargo_type || refittable & ShipVehInfo(engine_id)->refittable)) { && ( cargo == ShipVehInfo(engine_id)->cargo_type || refittable & ShipVehInfo(engine_id)->refittable)) {
if ( sel[1]==0) selected_id[1] = engine_id; if ( sel[1]==0) selected_id[1] = engine_id;
sel[1]--; sel[1]--;
count2++; count2++;
@ -450,7 +450,7 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
} }
break; break;
} //end of ship } //end of ship
case VEH_Aircraft:{ case VEH_Aircraft:{
int num = NUM_AIRCRAFT_ENGINES; int num = NUM_AIRCRAFT_ENGINES;
byte subtype; byte subtype;
@ -466,7 +466,7 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
sel[0]--; sel[0]--;
} }
} while (++engine_id,++e,--num); } while (++engine_id,++e,--num);
if ( selected_id[0] != -1 ) { if ( selected_id[0] != -1 ) {
num = NUM_AIRCRAFT_ENGINES; num = NUM_AIRCRAFT_ENGINES;
e = &_engines[AIRCRAFT_ENGINES_INDEX]; e = &_engines[AIRCRAFT_ENGINES_INDEX];
@ -490,7 +490,7 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
SetVScroll2Count(w, count2); SetVScroll2Count(w, count2);
WP(w,replaceveh_d).sel_engine[0] = selected_id[0]; WP(w,replaceveh_d).sel_engine[0] = selected_id[0];
WP(w,replaceveh_d).sel_engine[1] = selected_id[1]; WP(w,replaceveh_d).sel_engine[1] = selected_id[1];
WP(w,replaceveh_d).count[0] = count; WP(w,replaceveh_d).count[0] = count;
WP(w,replaceveh_d).count[1] = count2; WP(w,replaceveh_d).count[1] = count2;
return; return;
@ -498,7 +498,7 @@ static void SetupScrollStuffForReplaceWindow(Window *w)
static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int y2, int pos, int pos2, static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int y2, int pos, int pos2,
int sel1, int sel2, int selected_id1, int selected_id2) int sel1, int sel2, int selected_id1, int selected_id2)
{ {
int sel[2] = {sel1, sel2}; int sel[2] = {sel1, sel2};
int selected_id[2] = {selected_id1, selected_id2}; int selected_id[2] = {selected_id1, selected_id2};
@ -518,16 +518,16 @@ static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int
train_engine_drawing_loop(&x2, &y2, &pos2, &sel[1], &selected_id[1], railtype, w->vscroll.cap, false, false, false); // Feeble wagons train_engine_drawing_loop(&x2, &y2, &pos2, &sel[1], &selected_id[1], railtype, w->vscroll.cap, false, false, false); // Feeble wagons
break; break;
} }
case VEH_Road: { case VEH_Road: {
int num = NUM_ROAD_ENGINES; int num = NUM_ROAD_ENGINES;
Engine *e = &_engines[ROAD_ENGINES_INDEX]; Engine *e = &_engines[ROAD_ENGINES_INDEX];
int engine_id = ROAD_ENGINES_INDEX; int engine_id = ROAD_ENGINES_INDEX;
byte cargo; byte cargo;
EngineInfo *info; EngineInfo *info;
if ( selected_id[0] >= ROAD_ENGINES_INDEX && selected_id[0] <= SHIP_ENGINES_INDEX ) { if ( selected_id[0] >= ROAD_ENGINES_INDEX && selected_id[0] <= SHIP_ENGINES_INDEX ) {
cargo = RoadVehInfo(selected_id[0])->cargo_type; cargo = RoadVehInfo(selected_id[0])->cargo_type;
do { do {
info = &_engine_info[engine_id]; info = &_engine_info[engine_id];
@ -537,7 +537,7 @@ static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int
DrawRoadVehEngine(x+29, y+6, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player))); DrawRoadVehEngine(x+29, y+6, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
y += 14; y += 14;
} }
if ( RoadVehInfo(engine_id)->cargo_type == cargo && HASBIT(e->player_avail, _local_player) ) { if ( RoadVehInfo(engine_id)->cargo_type == cargo && HASBIT(e->player_avail, _local_player) ) {
if (IS_INT_INSIDE(--pos2, -w->vscroll.cap, 0) && RoadVehInfo(engine_id)->cargo_type == cargo) { if (IS_INT_INSIDE(--pos2, -w->vscroll.cap, 0) && RoadVehInfo(engine_id)->cargo_type == cargo) {
DrawString(x2+59, y2+2, GetCustomEngineName(engine_id), sel[1]==0 ? 0xC : 0x10); DrawString(x2+59, y2+2, GetCustomEngineName(engine_id), sel[1]==0 ? 0xC : 0x10);
@ -552,18 +552,18 @@ static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int
} }
break; break;
} }
case VEH_Ship: { case VEH_Ship: {
int num = NUM_SHIP_ENGINES; int num = NUM_SHIP_ENGINES;
Engine *e = &_engines[SHIP_ENGINES_INDEX]; Engine *e = &_engines[SHIP_ENGINES_INDEX];
int engine_id = SHIP_ENGINES_INDEX; int engine_id = SHIP_ENGINES_INDEX;
byte cargo, refittable; byte cargo, refittable;
EngineInfo *info; EngineInfo *info;
if ( selected_id[0] != -1 ) { if ( selected_id[0] != -1 ) {
cargo = ShipVehInfo(selected_id[0])->cargo_type; cargo = ShipVehInfo(selected_id[0])->cargo_type;
refittable = ShipVehInfo(selected_id[0])->refittable; refittable = ShipVehInfo(selected_id[0])->refittable;
do { do {
info = &_engine_info[engine_id]; info = &_engine_info[engine_id];
if (ENGINE_AVAILABLE) { if (ENGINE_AVAILABLE) {
@ -588,7 +588,7 @@ static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int
} }
break; break;
} //end of ship } //end of ship
case VEH_Aircraft: { case VEH_Aircraft: {
if ( selected_id[0] != -1 ) { if ( selected_id[0] != -1 ) {
int num = NUM_AIRCRAFT_ENGINES; int num = NUM_AIRCRAFT_ENGINES;
@ -633,7 +633,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
byte click_side = 1; byte click_side = 1;
switch(e->event) { switch(e->event) {
case WE_PAINT: case WE_PAINT:
{ {
int pos = w->vscroll.pos; int pos = w->vscroll.pos;
int selected_id[2] = {-1,-1}; int selected_id[2] = {-1,-1};
@ -643,12 +643,12 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
int x2 = 1 + 228; int x2 = 1 + 228;
int y2 = 15; int y2 = 15;
int sel[2] = { WP(w,replaceveh_d).sel_index[0], WP(w,replaceveh_d).sel_index[1]}; int sel[2] = { WP(w,replaceveh_d).sel_index[0], WP(w,replaceveh_d).sel_index[1]};
SetupScrollStuffForReplaceWindow(w); SetupScrollStuffForReplaceWindow(w);
selected_id[0] = WP(w,replaceveh_d).sel_engine[0]; selected_id[0] = WP(w,replaceveh_d).sel_engine[0];
selected_id[1] = WP(w,replaceveh_d).sel_engine[1]; selected_id[1] = WP(w,replaceveh_d).sel_engine[1];
// sets the selected left item to the top one if it's greater than the number of vehicles in the left side // sets the selected left item to the top one if it's greater than the number of vehicles in the left side
if ( WP(w,replaceveh_d).count[0] <= sel[0] ) { if ( WP(w,replaceveh_d).count[0] <= sel[0] ) {
@ -676,23 +676,23 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
selected_id[1] = -1; selected_id[1] = -1;
} }
} }
if ( selected_id[0] == selected_id[1] || _autoreplace_array[selected_id[0]] == selected_id[1] if ( selected_id[0] == selected_id[1] || _autoreplace_array[selected_id[0]] == selected_id[1]
|| selected_id[0] == -1 || selected_id[1] == -1 ) || selected_id[0] == -1 || selected_id[1] == -1 )
SETBIT(w->disabled_state, 4); SETBIT(w->disabled_state, 4);
else else
CLRBIT(w->disabled_state, 4); CLRBIT(w->disabled_state, 4);
if ( _autoreplace_array[selected_id[0]] == selected_id[0] || selected_id[0] == -1 ) if ( _autoreplace_array[selected_id[0]] == selected_id[0] || selected_id[0] == -1 )
SETBIT(w->disabled_state, 6); SETBIT(w->disabled_state, 6);
else else
CLRBIT(w->disabled_state, 6); CLRBIT(w->disabled_state, 6);
// now the actual drawing of the window itself takes place // now the actual drawing of the window itself takes place
DrawWindowWidgets(w); DrawWindowWidgets(w);
// sets up the string for the vehicle that is being replaced to // sets up the string for the vehicle that is being replaced to
if ( selected_id[0] != -1 ) { if ( selected_id[0] != -1 ) {
if ( selected_id[0] == _autoreplace_array[selected_id[0]] ) if ( selected_id[0] == _autoreplace_array[selected_id[0]] )
@ -702,14 +702,14 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
} else { } else {
SetDParam(0, STR_NOT_REPLACING_VEHICLE_SELECTED); SetDParam(0, STR_NOT_REPLACING_VEHICLE_SELECTED);
} }
DrawString(145, (WP(w,replaceveh_d).line_height == 24 ? 67 : 77 ) + ( WP(w,replaceveh_d).line_height * w->vscroll.cap), STR_02BD, 0x10); DrawString(145, (WP(w,replaceveh_d).line_height == 24 ? 67 : 77 ) + ( WP(w,replaceveh_d).line_height * w->vscroll.cap), STR_02BD, 0x10);
/* now we draw the two arrays according to what we just counted */ /* now we draw the two arrays according to what we just counted */
DrawEngineArrayInReplaceWindow(w, x, y, x2, y2, pos, pos2, sel[0], sel[1], selected_id[0], selected_id[1]); DrawEngineArrayInReplaceWindow(w, x, y, x2, y2, pos, pos2, sel[0], sel[1], selected_id[0], selected_id[1]);
WP(w,replaceveh_d).sel_engine[0] = selected_id[0]; WP(w,replaceveh_d).sel_engine[0] = selected_id[0];
WP(w,replaceveh_d).sel_engine[1] = selected_id[1]; WP(w,replaceveh_d).sel_engine[1] = selected_id[1];
/* now we draw the info about the vehicles we selected */ /* now we draw the info about the vehicles we selected */
@ -717,7 +717,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
case VEH_Train: { case VEH_Train: {
byte i = 0; byte i = 0;
int offset = 0; int offset = 0;
for ( i = 0 ; i < 2 ; i++) { for ( i = 0 ; i < 2 ; i++) {
if ( i ) if ( i )
offset = 228; offset = 228;
@ -735,7 +735,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
} }
break; break;
} //end if case VEH_Train } //end if case VEH_Train
case VEH_Road: { case VEH_Road: {
if (selected_id[0] != -1) { if (selected_id[0] != -1) {
Set_DPARAM_Road_Veh_Build_Window(selected_id[0]); Set_DPARAM_Road_Veh_Build_Window(selected_id[0]);
@ -747,7 +747,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
} }
break; break;
} // end of VEH_Road } // end of VEH_Road
case VEH_Ship: { case VEH_Ship: {
if (selected_id[0] != -1) { if (selected_id[0] != -1) {
Set_DPARAM_Ship_Build_Window(selected_id[0]); Set_DPARAM_Ship_Build_Window(selected_id[0]);
@ -758,8 +758,8 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
} }
} }
break; break;
} // end of VEH_Ship } // end of VEH_Ship
case VEH_Aircraft: { case VEH_Aircraft: {
if (selected_id[0] != -1) { if (selected_id[0] != -1) {
Set_DPARAM_Aircraft_Build_Window(selected_id[0]); Set_DPARAM_Aircraft_Build_Window(selected_id[0]);
@ -779,7 +779,7 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
/*case 0: /*case 0:
DeleteWindowById(WC_REPLACE_VEHICLE, WP(w,replaceveh_d).vehicletype ); DeleteWindowById(WC_REPLACE_VEHICLE, WP(w,replaceveh_d).vehicletype );
break;*/ break;*/
case 14: case 15:/* Select sorting criteria dropdown menu */ case 14: case 15:/* Select sorting criteria dropdown menu */
// finds mask for available engines // finds mask for available engines
{ {
@ -797,14 +797,14 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
SetWindowDirty(w); SetWindowDirty(w);
break; break;
} }
case 6: { case 6: {
_autoreplace_array[WP(w,replaceveh_d).sel_engine[0]] = WP(w,replaceveh_d).sel_engine[0]; _autoreplace_array[WP(w,replaceveh_d).sel_engine[0]] = WP(w,replaceveh_d).sel_engine[0];
SetWindowDirty(w); SetWindowDirty(w);
break; break;
} }
case 7: case 7:
// sets up that the left one was clicked. The default values are for the right one (9) // sets up that the left one was clicked. The default values are for the right one (9)
// this way, the code for 9 handles both sides // this way, the code for 9 handles both sides
click_scroll_pos = w->vscroll.pos; click_scroll_pos = w->vscroll.pos;
@ -818,78 +818,87 @@ static void ReplaceVehicleWndProc(Window *w, WindowEvent *e)
} }
} break; } break;
} }
} break; } break;
case WE_DROPDOWN_SELECT: { /* we have selected a dropdown item in the list */ case WE_DROPDOWN_SELECT: { /* we have selected a dropdown item in the list */
//potiential bug: railtypes needs to be activated 0, 1, 2... If one is skipped, it messes up //potiential bug: railtypes needs to be activated 0, 1, 2... If one is skipped, it messes up
WP(w,replaceveh_d).railtype = e->dropdown.index; WP(w,replaceveh_d).railtype = e->dropdown.index;
SetWindowDirty(w); SetWindowDirty(w);
break; } break;
}
case WE_RESIZE: {
w->vscroll.cap += e->sizing.diff.y / (int)w->resize.step_height;
w->vscroll2.cap += e->sizing.diff.y / (int)w->resize.step_height;
w->widget[7].unkA = (w->vscroll.cap << 8) + 1;
w->widget[9].unkA = (w->vscroll2.cap << 8) + 1;
} break;
} }
} }
static const Widget _replace_rail_vehicle_widgets[] = { static const Widget _replace_rail_vehicle_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 443, 0, 13, STR_REPLACE_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 443, 0, 13, STR_REPLACE_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 444, 455, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 14, 444, 455, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 14, 0, 227, 126, 187, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 14, 0, 227, 126, 187, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 138, 200, 211, STR_REPLACE_VEHICLES_START,STR_REPLACE_HELP_START_BUTTON}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 138, 200, 211, STR_REPLACE_VEHICLES_START,STR_REPLACE_HELP_START_BUTTON},
{ WWT_PANEL, 14, 139, 316, 188, 199, 0x0, STR_REPLACE_HELP_REPLACE_INFO_TAB}, { WWT_PANEL, RESIZE_TB, 14, 139, 316, 188, 199, 0x0, STR_REPLACE_HELP_REPLACE_INFO_TAB},
{ WWT_PUSHTXTBTN, 14, 317, 455, 200, 211, STR_REPLACE_VEHICLES_STOP, STR_REPLACE_HELP_STOP_BUTTON}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 306, 444, 200, 211, STR_REPLACE_VEHICLES_STOP, STR_REPLACE_HELP_STOP_BUTTON},
{ WWT_MATRIX, 14, 0, 216, 14, 125, 0x801, STR_REPLACE_HELP_LEFT_ARRAY}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 0, 216, 14, 125, 0x801, STR_REPLACE_HELP_LEFT_ARRAY},
{ WWT_SCROLLBAR, 14, 217, 227, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_BOTTOM, 14, 217, 227, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_MATRIX, 14, 228, 455, 14, 125, 0x801, STR_REPLACE_HELP_RIGHT_ARRAY}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 228, 455, 14, 125, 0x801, STR_REPLACE_HELP_RIGHT_ARRAY},
{ WWT_SCROLL2BAR, 14, 445, 455, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLL2BAR, RESIZE_BOTTOM, 14, 445, 455, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, 14, 228, 455, 126, 187, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 14, 228, 455, 126, 187, 0x0, STR_NULL},
// the rest are train specific stuff // the rest are train specific stuff
{ WWT_PANEL, 14, 0, 138, 188, 199, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 14, 0, 138, 188, 199, 0x0, STR_NULL},
{ WWT_PANEL, 3, 139, 153, 200, 211, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 3, 139, 153, 200, 211, 0x0, STR_NULL},
{ WWT_PANEL, 14, 154, 290, 200, 211, 0x0, STR_REPLACE_HELP_RAILTYPE}, { WWT_PANEL, RESIZE_TB, 14, 154, 289, 200, 211, 0x0, STR_REPLACE_HELP_RAILTYPE},
{ WWT_CLOSEBOX, 14, 291, 301, 200, 210, STR_0225, STR_REPLACE_HELP_RAILTYPE}, { WWT_CLOSEBOX, RESIZE_TB, 14, 279, 287, 201, 210, STR_0225, STR_REPLACE_HELP_RAILTYPE},
{ WWT_PANEL, 3, 301, 316, 200, 211, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 3, 290, 305, 200, 211, 0x0, STR_NULL},
{ WWT_PANEL, 14, 317, 455, 188, 199, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 14, 317, 455, 188, 199, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_TB, 14, 445, 455, 200, 211, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _replace_road_vehicle_widgets[] = { static const Widget _replace_road_vehicle_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 443, 0, 13, STR_REPLACE_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 443, 0, 13, STR_REPLACE_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 444, 455, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 14, 444, 455, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 14, 0, 227, 126, 187, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 14, 0, 227, 126, 187, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 138, 188, 199, STR_REPLACE_VEHICLES_START,STR_REPLACE_HELP_START_BUTTON}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 138, 188, 199, STR_REPLACE_VEHICLES_START, STR_REPLACE_HELP_START_BUTTON},
{ WWT_PANEL, 14, 139, 316, 188, 199, 0x0, STR_REPLACE_HELP_REPLACE_INFO_TAB}, { WWT_PANEL, RESIZE_TB, 14, 139, 305, 188, 199, 0x0, STR_REPLACE_HELP_REPLACE_INFO_TAB},
{ WWT_PUSHTXTBTN, 14, 317, 455, 188, 199, STR_REPLACE_VEHICLES_STOP, STR_REPLACE_HELP_STOP_BUTTON}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 306, 444, 188, 199, STR_REPLACE_VEHICLES_STOP, STR_REPLACE_HELP_STOP_BUTTON},
{ WWT_MATRIX, 14, 0, 216, 14, 125, 0x801, STR_REPLACE_HELP_LEFT_ARRAY}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 0, 216, 14, 125, 0x801, STR_REPLACE_HELP_LEFT_ARRAY},
{ WWT_SCROLLBAR, 14, 217, 227, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_BOTTOM, 14, 217, 227, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_MATRIX, 14, 228, 455, 14, 125, 0x801, STR_REPLACE_HELP_RIGHT_ARRAY}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 228, 455, 14, 125, 0x801, STR_REPLACE_HELP_RIGHT_ARRAY},
{ WWT_SCROLL2BAR, 14, 445, 455, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLL2BAR, RESIZE_BOTTOM, 14, 445, 455, 14, 125, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, 14, 228, 455, 126, 187, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 14, 228, 455, 126, 187, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_TB, 14, 445, 455, 188, 199, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const Widget _replace_ship_aircraft_vehicle_widgets[] = { static const Widget _replace_ship_aircraft_vehicle_widgets[] = {
{ WWT_CLOSEBOX, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
{ WWT_CAPTION, 14, 11, 443, 0, 13, STR_REPLACE_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS}, { WWT_CAPTION, RESIZE_NONE, 14, 11, 443, 0, 13, STR_REPLACE_VEHICLES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_STICKYBOX, 14, 444, 455, 0, 13, 0x0, STR_STICKY_BUTTON}, { WWT_STICKYBOX, RESIZE_NONE, 14, 444, 455, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, 14, 0, 227, 110, 161, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 14, 0, 227, 110, 161, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, 14, 0, 138, 162, 173, STR_REPLACE_VEHICLES_START,STR_REPLACE_HELP_START_BUTTON}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 138, 162, 173, STR_REPLACE_VEHICLES_START, STR_REPLACE_HELP_START_BUTTON},
{ WWT_PANEL, 14, 139, 316, 162, 173, 0x0, STR_REPLACE_HELP_REPLACE_INFO_TAB}, { WWT_PANEL, RESIZE_TB, 14, 139, 305, 162, 173, 0x0, STR_REPLACE_HELP_REPLACE_INFO_TAB},
{ WWT_PUSHTXTBTN, 14, 317, 455, 162, 173, STR_REPLACE_VEHICLES_STOP, STR_REPLACE_HELP_STOP_BUTTON}, { WWT_PUSHTXTBTN, RESIZE_TB, 14, 306, 444, 162, 173, STR_REPLACE_VEHICLES_STOP, STR_REPLACE_HELP_STOP_BUTTON},
{ WWT_MATRIX, 14, 0, 216, 14, 109, 0x401, STR_REPLACE_HELP_LEFT_ARRAY}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 0, 216, 14, 109, 0x401, STR_REPLACE_HELP_LEFT_ARRAY},
{ WWT_SCROLLBAR, 14, 217, 227, 14, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLLBAR, RESIZE_BOTTOM, 14, 217, 227, 14, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_MATRIX, 14, 228, 455, 14, 109, 0x401, STR_REPLACE_HELP_RIGHT_ARRAY}, { WWT_MATRIX, RESIZE_BOTTOM, 14, 228, 455, 14, 109, 0x401, STR_REPLACE_HELP_RIGHT_ARRAY},
{ WWT_SCROLL2BAR, 14, 445, 455, 14, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, { WWT_SCROLL2BAR, RESIZE_BOTTOM, 14, 445, 455, 14, 109, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, 14, 228, 455, 110, 161, 0x0, STR_NULL}, { WWT_PANEL, RESIZE_TB, 14, 228, 455, 110, 161, 0x0, STR_NULL},
{ WWT_RESIZEBOX, RESIZE_TB, 14, 445, 455, 162, 173, 0x0, STR_RESIZE_BUTTON},
{ WIDGETS_END}, { WIDGETS_END},
}; };
static const WindowDesc _replace_rail_vehicle_desc = { static const WindowDesc _replace_rail_vehicle_desc = {
-1, -1, 456, 212, -1, -1, 456, 212,
WC_REPLACE_VEHICLE,0, WC_REPLACE_VEHICLE,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_replace_rail_vehicle_widgets, _replace_rail_vehicle_widgets,
ReplaceVehicleWndProc ReplaceVehicleWndProc
}; };
@ -897,7 +906,7 @@ static const WindowDesc _replace_rail_vehicle_desc = {
static const WindowDesc _replace_road_vehicle_desc = { static const WindowDesc _replace_road_vehicle_desc = {
-1, -1, 456, 200, -1, -1, 456, 200,
WC_REPLACE_VEHICLE,0, WC_REPLACE_VEHICLE,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_replace_road_vehicle_widgets, _replace_road_vehicle_widgets,
ReplaceVehicleWndProc ReplaceVehicleWndProc
}; };
@ -905,7 +914,7 @@ static const WindowDesc _replace_road_vehicle_desc = {
static const WindowDesc _replace_ship_aircraft_vehicle_desc = { static const WindowDesc _replace_ship_aircraft_vehicle_desc = {
-1, -1, 456, 174, -1, -1, 456, 174,
WC_REPLACE_VEHICLE,0, WC_REPLACE_VEHICLE,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON, WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
_replace_ship_aircraft_vehicle_widgets, _replace_ship_aircraft_vehicle_widgets,
ReplaceVehicleWndProc ReplaceVehicleWndProc
}; };
@ -914,23 +923,26 @@ static const WindowDesc _replace_ship_aircraft_vehicle_desc = {
void ShowReplaceVehicleWindow(byte vehicletype) void ShowReplaceVehicleWindow(byte vehicletype)
{ {
Window *w; Window *w;
DeleteWindowById(WC_REPLACE_VEHICLE, vehicletype ); DeleteWindowById(WC_REPLACE_VEHICLE, vehicletype );
switch (vehicletype) { switch (vehicletype) {
case VEH_Train: case VEH_Train:
w = AllocateWindowDescFront(&_replace_rail_vehicle_desc, vehicletype); w = AllocateWindowDescFront(&_replace_rail_vehicle_desc, vehicletype);
w->vscroll.cap = 8; w->vscroll.cap = 8;
w->resize.step_height = 14;
WP(w,replaceveh_d).line_height = 14; WP(w,replaceveh_d).line_height = 14;
break; break;
case VEH_Road: case VEH_Road:
w = AllocateWindowDescFront(&_replace_road_vehicle_desc, vehicletype); w = AllocateWindowDescFront(&_replace_road_vehicle_desc, vehicletype);
w->vscroll.cap = 8; w->vscroll.cap = 8;
w->resize.step_height = 14;
WP(w,replaceveh_d).line_height = 14; WP(w,replaceveh_d).line_height = 14;
break; break;
case VEH_Ship: case VEH_Aircraft: case VEH_Ship: case VEH_Aircraft:
w = AllocateWindowDescFront(&_replace_ship_aircraft_vehicle_desc, vehicletype); w = AllocateWindowDescFront(&_replace_ship_aircraft_vehicle_desc, vehicletype);
w->vscroll.cap = 4; w->vscroll.cap = 4;
w->resize.step_height = 24;
WP(w,replaceveh_d).line_height = 24; WP(w,replaceveh_d).line_height = 24;
break; break;
default: return; default: return;

View File

@ -69,12 +69,13 @@ void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y)
} }
case WWT_HSCROLLBAR: { case WWT_HSCROLLBAR: {
// horizontal scroller // horizontal scroller
assert(wi->type == WWT_HSCROLLBAR); w->flags4 &= ~WF_SCROLL2;
w->flags4 |= WF_HSCROLL; w->flags4 |= WF_HSCROLL;
mi = wi->left; mi = wi->left;
ma = wi->right; ma = wi->right;
pos = x; pos = x;
sb = &w->hscroll; sb = &w->hscroll;
break;
} }
default: return; //this should never happen default: return; //this should never happen
} }
@ -394,10 +395,16 @@ void DrawWindowWidgets(Window *w)
case WWT_STICKYBOX: { case WWT_STICKYBOX: {
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (cur_click & 1) ? 0x20 : 0); DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (cur_click & 1) ? 0x20 : 0);
DrawSprite((cur_click & 1) ? SPR_PIN_UP :SPR_PIN_DOWN, r.left + 2, r.top + 3); DrawSprite((cur_click & 1) ? SPR_PIN_UP : SPR_PIN_DOWN, r.left + 2, r.top + 3);
break; break;
} }
case WWT_RESIZEBOX: {
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0);
DrawSprite(SPR_WINDOW_RESIZE, r.left + 2, r.top + 3);
break;
}
case WWT_CAPTION: { case WWT_CAPTION: {
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0x10); DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0x10);
DrawFrameRect(r.left+1, r.top+1, r.right-1, r.bottom-1, wi->color, (w->caption_color == 0xFF) ? 0x60 : 0x70); DrawFrameRect(r.left+1, r.top+1, r.right-1, r.bottom-1, wi->color, (w->caption_color == 0xFF) ? 0x60 : 0x70);
@ -436,8 +443,8 @@ static WindowNumber _dropdown_windownum;
static byte _dropdown_var1; static byte _dropdown_var1;
static byte _dropdown_var2; static byte _dropdown_var2;
static Widget _dropdown_menu_widgets[] = { static const Widget _dropdown_menu_widgets[] = {
{ WWT_IMGBTN, 0, 0, 0, 0, 0, 0x0, STR_NULL}, { WWT_IMGBTN, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WIDGETS_END}, { WIDGETS_END},
}; };
@ -478,10 +485,10 @@ void DropdownMenuWndProc(Window *w, WindowEvent *e)
sel = _dropdown_selindex; sel = _dropdown_selindex;
dis = _dropdown_disabled; dis = _dropdown_disabled;
hidden = _dropdown_hide_disabled; hidden = _dropdown_hide_disabled;
for(i=0; _dropdown_items[i] != INVALID_STRING_ID; i++) { for(i=0; _dropdown_items[i] != INVALID_STRING_ID; i++) {
if (!(hidden) | !(dis & 1)) { if (!(hidden && (dis & 1))) {
if (_dropdown_items[i] != 0) { if (_dropdown_items[i] != 0) {
if (sel == 0) { if (sel == 0) {
GfxFillRect(x+1, y, x+w->width-4, y + 9, 0); GfxFillRect(x+1, y, x+w->width-4, y + 9, 0);
@ -563,7 +570,7 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt
{ {
WindowNumber num; WindowNumber num;
WindowClass cls; WindowClass cls;
int i,t1,t2; int i;
const Widget *wi; const Widget *wi;
Window *w2; Window *w2;
uint32 old_click_state = w->click_state; uint32 old_click_state = w->click_state;
@ -610,17 +617,18 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt
} }
} }
_dropdown_menu_widgets[0].color = wi->color;
w2 = AllocateWindow( w2 = AllocateWindow(
w->left + wi[-1].left + 1, w->left + wi[-1].left + 1,
w->top + wi->bottom + 2, w->top + wi->bottom + 2,
(_dropdown_menu_widgets[0].right=t1=wi->right - wi[-1].left, t1 + 1), wi->right - wi[-1].left + 1,
(_dropdown_menu_widgets[0].bottom=t2=i*10+3, t2+1), i * 10 + 4,
DropdownMenuWndProc, DropdownMenuWndProc,
0x3F, 0x3F,
_dropdown_menu_widgets); _dropdown_menu_widgets);
w2->widget[0].color = wi->color;
w2->widget[0].right = wi->right - wi[-1].left;
w2->widget[0].bottom = i * 10 + 3;
w2->flags4 &= ~WF_WHITE_BORDER_MASK; w2->flags4 &= ~WF_WHITE_BORDER_MASK;
} }

155
window.c
View File

@ -51,23 +51,23 @@ void DispatchLeftClickEvent(Window *w, int x, int y) {
w->wndproc(w, &e); w->wndproc(w, &e);
if (w->desc_flags & WDF_STD_BTN) { if (w->desc_flags & WDF_STD_BTN) {
if (e.click.widget == 0) DeleteWindow(w); if (e.click.widget == 0) {
else { DeleteWindow(w);
} else {
if (e.click.widget == 1) { if (e.click.widget == 1) {
if (_ctrl_pressed) StartWindowDrag(w);
StartWindowSizing(w);
else
StartWindowDrag(w);
} }
} }
} }
if (w->desc_flags & WDF_STICKY_BUTTON) { if (w->desc_flags & WDF_RESIZABLE && wi->type == WWT_RESIZEBOX) {
if (e.click.widget == 2) { StartWindowSizing(w);
w->click_state ^= (1 << e.click.widget); }
w->flags4 ^= WF_STICKY;
InvalidateWidget(w, e.click.widget); if (w->desc_flags & WDF_STICKY_BUTTON && wi->type == WWT_STICKYBOX) {
} w->click_state ^= (1 << e.click.widget);
w->flags4 ^= WF_STICKY;
InvalidateWidget(w, e.click.widget);
} }
} else { } else {
w->wndproc(w, &e); w->wndproc(w, &e);
@ -223,6 +223,8 @@ void DeleteWindow(Window *w)
SetWindowDirty(w); SetWindowDirty(w);
free(w->widget);
v = --_last_window; v = --_last_window;
count = (byte*)v - (byte*)w; count = (byte*)v - (byte*)w;
memcpy(w, w + 1, count); memcpy(w, w + 1, count);
@ -313,6 +315,31 @@ static Window *ForceFindDeletableWindow(void)
} }
} }
bool IsWindowOfPrototype(Window *w, const Widget *widget)
{
return (w->original_widget == widget);
}
/* Copies 'widget' to 'w->widget' */
void AssignWidgetToWindow(Window *w, const Widget *widget)
{
w->original_widget = widget;
if (widget != NULL) {
const Widget *wi = widget;
uint index = 1;
while (wi->type != WWT_LAST) {
wi++;
index++;
}
w->widget = malloc(sizeof(Widget) * index);
memcpy(w->widget, widget, sizeof(Widget) * index);
} else {
w->widget = NULL;
}
}
Window *AllocateWindow( Window *AllocateWindow(
int x, int x,
int y, int y,
@ -373,7 +400,11 @@ Window *AllocateWindow(
w->vscroll.count = 0; w->vscroll.count = 0;
w->hscroll.pos = 0; w->hscroll.pos = 0;
w->hscroll.count = 0; w->hscroll.count = 0;
w->widget = widget; AssignWidgetToWindow(w, widget);
w->resize.width = width;
w->resize.height = height;
w->resize.step_width = 1;
w->resize.step_height = 1;
{ {
int i; int i;
@ -898,6 +929,89 @@ bool HandleWindowDragging()
w->left = nx; w->left = nx;
w->top = ny; w->top = ny;
SetWindowDirty(w);
return false;
} else if (w->flags4 & WF_SIZING) {
WindowEvent e;
int x, y;
/* Stop the sizing if the left mouse button was released */
if (!_left_button_down) {
w->flags4 &= ~WF_SIZING;
break;
}
x = _cursor.pos.x - _drag_delta.x;
y = _cursor.pos.y - _drag_delta.y;
/* X and Y has to go by step.. calculate it */
if (w->resize.step_width > 1)
x = x - (x % (int)w->resize.step_width);
if (w->resize.step_height > 1)
y = y - (y % (int)w->resize.step_height);
/* Check if we don't go below the minimum set size */
if ((int)w->width + x < (int)w->resize.width)
x = w->resize.width - w->width;
if ((int)w->height + y < (int)w->resize.height)
y = w->resize.height - w->height;
/* Window already on size */
if (x == 0 && y == 0)
return false;
/* Now find the new cursor pos.. this is NOT _cursor, because
we move in steps. */
_drag_delta.x += x;
_drag_delta.y += y;
SetWindowDirty(w);
/* Scroll through all the windows and update the widgets if needed */
{
Widget *wi = w->widget;
bool resize_height = false;
bool resize_width = false;
while (wi->type != WWT_LAST) {
if (wi->resize_flag != RESIZE_NONE) {
/* Resize this widget */
if (wi->resize_flag & RESIZE_LEFT) {
wi->left += x;
resize_width = true;
}
if (wi->resize_flag & RESIZE_RIGHT) {
wi->right += x;
resize_width = true;
}
if (wi->resize_flag & RESIZE_TOP) {
wi->top += y;
resize_height = true;
}
if (wi->resize_flag & RESIZE_BOTTOM) {
wi->bottom += y;
resize_height = true;
}
}
wi++;
}
/* We resized at least 1 widget, so let's rezise the window totally */
if (resize_width)
w->width = x + w->width;
if (resize_height)
w->height = y + w->height;
}
e.event = WE_RESIZE;
e.sizing.size.x = x + w->width;
e.sizing.size.y = y + w->height;
e.sizing.diff.x = x;
e.sizing.diff.y = y;
w->wndproc(w, &e);
SetWindowDirty(w); SetWindowDirty(w);
return false; return false;
} }
@ -911,8 +1025,10 @@ Window *StartWindowDrag(Window *w)
{ {
w->flags4 |= WF_DRAGGING; w->flags4 |= WF_DRAGGING;
_dragging_window = true; _dragging_window = true;
_drag_delta.x = w->left - _cursor.pos.x; _drag_delta.x = w->left - _cursor.pos.x;
_drag_delta.y = w->top - _cursor.pos.y; _drag_delta.y = w->top - _cursor.pos.y;
w = BringWindowToFront(w); w = BringWindowToFront(w);
DeleteWindowById(WC_DROPDOWN_MENU, 0); DeleteWindowById(WC_DROPDOWN_MENU, 0);
return w; return w;
@ -922,7 +1038,10 @@ Window *StartWindowSizing(Window *w)
{ {
w->flags4 |= WF_SIZING; w->flags4 |= WF_SIZING;
_dragging_window = true; _dragging_window = true;
_cursorpos_drag_start = _cursor.pos;
_drag_delta.x = _cursor.pos.x;
_drag_delta.y = _cursor.pos.y;
w = BringWindowToFront(w); w = BringWindowToFront(w);
DeleteWindowById(WC_DROPDOWN_MENU, 0); DeleteWindowById(WC_DROPDOWN_MENU, 0);
return w; return w;
@ -1090,8 +1209,8 @@ static void HandleKeypress(uint32 key)
{ {
Window *w; Window *w;
WindowEvent we; WindowEvent we;
/* Stores if a window with a textfield for typing is open /* Stores if a window with a textfield for typing is open
* If this is the case, keypress events are only passed to windows with text fields and * If this is the case, keypress events are only passed to windows with text fields and
* to thein this main toolbar. */ * to thein this main toolbar. */
bool query_open = false; bool query_open = false;
@ -1369,7 +1488,7 @@ void DeleteNonVitalWindows()
} }
} }
/* It is possible that a stickied window gets to a position where the /* It is possible that a stickied window gets to a position where the
* 'close' button is outside the gaming area. You cannot close it then; except * 'close' button is outside the gaming area. You cannot close it then; except
* with this function. It closes all windows calling the standard function, * with this function. It closes all windows calling the standard function,
* then, does a little hacked loop of closing all stickied windows. Note * then, does a little hacked loop of closing all stickied windows. Note

View File

@ -9,8 +9,52 @@ typedef union WindowEvent WindowEvent;
typedef void WindowProc(Window *w, WindowEvent *e); typedef void WindowProc(Window *w, WindowEvent *e);
/* How the resize system works:
First, you need to add a WWT_RESIZEBOX to the widgets, and you need
to add the flag WDF_RESIZABLE to the window. Now the window is ready
to resize itself.
As you may have noticed, all widgets have a RESIZE_XXX in their line.
This lines controls how the widgets behave on resize. RESIZE_NONE means
it doesn't do anything. Any other option let's one of the borders
move with the changed width/height. So if a widget has
RESIZE_RIGHT, and the window is made 5 pixels wider by the user,
the right of the window will also be made 5 pixels wider.
Now, what if you want to clamp a widget to the bottom? Give it the flag
RESIZE_TB. This is RESIZE_TOP + RESIZE_BOTTOM. Now if the window gets
5 pixels bigger, both the top and bottom gets 5 bigger, so the whole
widgets moves downwards without resizing, and appears to be clamped
to the bottom. Nice aint it?
You should know one more thing about this system. Most windows can't
handle an increase of 1 pixel. So there is a step function, which
let the windowsize only be changed by X pixels. You configure this
after making the window, like this:
w->resize.step_height = 10;
Now the window will only change in height in steps of 10.
You can also give a minimum width and height. The default value is
the default height/width of the window itself. You can change this
AFTER window-creation, with:
w->resize.width or w->resize.height.
That was all.. good luck, and enjoy :) -- TrueLight */
enum {
RESIZE_NONE = 0,
RESIZE_LEFT = 1,
RESIZE_RIGHT = 2,
RESIZE_TOP = 4,
RESIZE_BOTTOM = 8,
RESIZE_LR = RESIZE_LEFT | RESIZE_RIGHT,
RESIZE_RB = RESIZE_RIGHT | RESIZE_BOTTOM,
RESIZE_TB = RESIZE_TOP | RESIZE_BOTTOM,
RESIZE_LRB = RESIZE_LEFT | RESIZE_RIGHT | RESIZE_BOTTOM,
RESIZE_LRTB = RESIZE_LEFT | RESIZE_RIGHT | RESIZE_TOP | RESIZE_BOTTOM,
RESIZE_RTB = RESIZE_RIGHT | RESIZE_TOP | RESIZE_BOTTOM,
};
typedef struct Widget { typedef struct Widget {
byte type; byte type;
byte resize_flag;
byte color; byte color;
uint16 left, right, top, bottom; uint16 left, right, top, bottom;
uint16 unkA; uint16 unkA;
@ -39,6 +83,12 @@ union WindowEvent {
int widget; int widget;
} dragdrop; } dragdrop;
struct {
byte event;
Point size;
Point diff;
} sizing;
struct { struct {
byte event; byte event;
byte *str; byte *str;
@ -163,6 +213,7 @@ enum {
WDF_RESTORE_DPARAM = 8, /* when drawing widgets, restore the dparam so all widgets recieve the same set of them */ WDF_RESTORE_DPARAM = 8, /* when drawing widgets, restore the dparam so all widgets recieve the same set of them */
WDF_UNCLICK_BUTTONS=16, /* Unclick buttons when the window event times out */ WDF_UNCLICK_BUTTONS=16, /* Unclick buttons when the window event times out */
WDF_STICKY_BUTTON =32, /* Set window to sticky mode; they are not closed unless closed with 'X' (widget 2) */ WDF_STICKY_BUTTON =32, /* Set window to sticky mode; they are not closed unless closed with 'X' (widget 2) */
WDF_RESIZABLE =64, /* A window can be resized */
}; };
/* can be used as x or y coordinates to cause a specific placement */ /* can be used as x or y coordinates to cause a specific placement */
@ -192,22 +243,32 @@ typedef struct {
uint16 count, cap, pos; uint16 count, cap, pos;
} Scrollbar; } Scrollbar;
typedef struct {
uint width; /* Minimum width and height */
uint height;
uint step_width; /* In how big steps the width and height go */
uint step_height;
} ResizeInfo;
struct Window { struct Window {
uint16 flags4; uint16 flags4;
WindowClass window_class; WindowClass window_class;
WindowNumber window_number; WindowNumber window_number;
int left,top; int left, top;
int width,height; int width, height;
Scrollbar hscroll, vscroll, vscroll2; Scrollbar hscroll, vscroll, vscroll2;
ResizeInfo resize;
byte caption_color; byte caption_color;
uint32 click_state, disabled_state, hidden_state; uint32 click_state, disabled_state, hidden_state;
WindowProc *wndproc; WindowProc *wndproc;
ViewPort *viewport; ViewPort *viewport;
const Widget *widget; const Widget *original_widget;
Widget *widget;
//const WindowDesc *desc; //const WindowDesc *desc;
uint32 desc_flags; uint32 desc_flags;
@ -347,6 +408,7 @@ enum WindowEvents {
WE_CREATE = 19, WE_CREATE = 19,
WE_MOUSEOVER = 20, WE_MOUSEOVER = 20,
WE_ON_EDIT_TEXT_CANCEL = 21, WE_ON_EDIT_TEXT_CANCEL = 21,
WE_RESIZE = 22,
}; };
@ -377,7 +439,8 @@ enum WindowWidgetTypes {
WWT_HSCROLLBAR = 11, WWT_HSCROLLBAR = 11,
WWT_STICKYBOX = 12, WWT_STICKYBOX = 12,
WWT_SCROLL2BAR = 13, /* 2nd vertical scrollbar*/ WWT_SCROLL2BAR = 13, /* 2nd vertical scrollbar*/
WWT_LAST = 14, /* Last Item. use WIDGETS_END to fill up padding!! */ WWT_RESIZEBOX = 14,
WWT_LAST = 15, /* Last Item. use WIDGETS_END to fill up padding!! */
WWT_MASK = 31, WWT_MASK = 31,
@ -386,7 +449,7 @@ enum WindowWidgetTypes {
WWT_NODISTXTBTN = WWT_TEXTBTN | WWB_NODISBUTTON, WWT_NODISTXTBTN = WWT_TEXTBTN | WWB_NODISBUTTON,
}; };
#define WIDGETS_END WWT_LAST, 0, 0, 0, 0, 0, 0, STR_NULL #define WIDGETS_END WWT_LAST, RESIZE_NONE, 0, 0, 0, 0, 0, 0, STR_NULL
enum WindowFlags { enum WindowFlags {
WF_TIMEOUT_SHL = 0, WF_TIMEOUT_SHL = 0,
@ -398,7 +461,7 @@ enum WindowFlags {
WF_HSCROLL = 1 << 7, WF_HSCROLL = 1 << 7,
WF_SIZING = 1 << 8, WF_SIZING = 1 << 8,
WF_STICKY = 1 << 9, WF_STICKY = 1 << 9,
WF_DISABLE_VP_SCROLL = 1 << 10, WF_DISABLE_VP_SCROLL = 1 << 10,
WF_WHITE_BORDER_ONE = 1 << 11, WF_WHITE_BORDER_ONE = 1 << 11,
@ -427,6 +490,10 @@ Window *StartWindowDrag(Window *w);
Window *StartWindowSizing(Window *w); Window *StartWindowSizing(Window *w);
Window *FindWindowFromPt(int x, int y); Window *FindWindowFromPt(int x, int y);
bool IsWindowOfPrototype(Window *w, const Widget *widget);
void AssignWidgetToWindow(Window *w, const Widget *widget);
/* Use this function to save the current widget to be the global default */
void MakeWindowWidgetDefault(Window *w);
Window *AllocateWindow( Window *AllocateWindow(
int x, int x,
int y, int y,