Merge branch 'master' into enhanced_viewport_overlay
Notes on conflict resolution: * MarkTileDirtyByTile gained an extra param on both sides of the merge Move bridge level offset to be after zoom level param, as it's used less. * Add zoom level params to MarkBridgeDirty functions * Fix undefined behaviour in colour_index cycling in ViewportMapDraw Conflicts: src/clear_cmd.cpp src/pbs.cpp src/rail_cmd.cpp src/toolbar_gui.cpp src/train_cmd.cpp src/vehicle.cpp src/viewport.cpp src/viewport_func.h
This commit is contained in:
@@ -116,11 +116,17 @@ struct BuildDocksToolbarWindow : Window {
|
||||
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
this->SetWidgetsDisabledState(!CanBuildVehicleInfrastructure(VEH_SHIP),
|
||||
|
||||
bool can_build = CanBuildVehicleInfrastructure(VEH_SHIP);
|
||||
this->SetWidgetsDisabledState(!can_build,
|
||||
WID_DT_DEPOT,
|
||||
WID_DT_STATION,
|
||||
WID_DT_BUOY,
|
||||
WIDGET_LIST_END);
|
||||
if (!can_build) {
|
||||
DeleteWindowById(WC_BUILD_STATION, TRANSPORT_WATER);
|
||||
DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_WATER);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
@@ -504,8 +510,8 @@ public:
|
||||
switch (widget) {
|
||||
case WID_BDD_X:
|
||||
case WID_BDD_Y:
|
||||
size->width = UnScaleByZoom(96 * 4, ZOOM_LVL_GUI) + 2;
|
||||
size->height = UnScaleByZoom(64 * 4, ZOOM_LVL_GUI) + 2;
|
||||
size->width = ScaleGUITrad(96) + 2;
|
||||
size->height = ScaleGUITrad(64) + 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -514,10 +520,10 @@ public:
|
||||
{
|
||||
this->DrawWidgets();
|
||||
|
||||
int x1 = UnScaleByZoom(63 * 4, ZOOM_LVL_GUI) + 1;
|
||||
int x2 = UnScaleByZoom(31 * 4, ZOOM_LVL_GUI) + 1;
|
||||
int y1 = UnScaleByZoom(17 * 4, ZOOM_LVL_GUI) + 1;
|
||||
int y2 = UnScaleByZoom(33 * 4, ZOOM_LVL_GUI) + 1;
|
||||
int x1 = ScaleGUITrad(63) + 1;
|
||||
int x2 = ScaleGUITrad(31) + 1;
|
||||
int y1 = ScaleGUITrad(17) + 1;
|
||||
int y2 = ScaleGUITrad(33) + 1;
|
||||
|
||||
DrawShipDepotSprite(this->GetWidget<NWidgetBase>(WID_BDD_X)->pos_x + x1, this->GetWidget<NWidgetBase>(WID_BDD_X)->pos_y + y1, AXIS_X, DEPOT_PART_NORTH);
|
||||
DrawShipDepotSprite(this->GetWidget<NWidgetBase>(WID_BDD_X)->pos_x + x2, this->GetWidget<NWidgetBase>(WID_BDD_X)->pos_y + y2, AXIS_X, DEPOT_PART_SOUTH);
|
||||
|
Reference in New Issue
Block a user