From aea866a42f3ca37e47b7f86f871f6e234f30a893 Mon Sep 17 00:00:00 2001 From: dP Date: Tue, 6 Sep 2022 20:29:53 +0300 Subject: [PATCH 1/5] Change: Refactor modifier key handling, split Ctrl into function and remove --- src/ai/ai_gui.cpp | 4 ++-- src/airport_gui.cpp | 2 +- src/autoreplace_gui.cpp | 6 +++--- src/bridge_gui.cpp | 2 +- src/build_vehicle_gui.cpp | 2 +- src/command.cpp | 2 +- src/company_gui.cpp | 12 ++++++------ src/depot_gui.cpp | 24 +++++++++++------------ src/dock_gui.cpp | 6 +++--- src/engine_gui.cpp | 2 +- src/game/game_gui.cpp | 4 ++-- src/gfx.cpp | 6 ++++-- src/gfx_func.h | 8 +++++--- src/goal_gui.cpp | 2 +- src/group_gui.cpp | 10 +++++----- src/industry_gui.cpp | 4 ++-- src/intro_gui.cpp | 2 +- src/league_gui.cpp | 2 +- src/misc_gui.cpp | 2 +- src/network/network_gui.cpp | 2 +- src/newgrf_debug_gui.cpp | 2 +- src/news_gui.cpp | 2 +- src/object_gui.cpp | 2 +- src/order_gui.cpp | 38 ++++++++++++++++++------------------- src/rail_cmd.cpp | 12 ++++++------ src/rail_cmd.h | 2 +- src/rail_gui.cpp | 34 ++++++++++++++++----------------- src/road_gui.cpp | 18 +++++++++--------- src/script/script_gui.cpp | 4 ++-- src/settings_gui.cpp | 2 +- src/signs_gui.cpp | 4 ++-- src/smallmap_gui.cpp | 2 +- src/station_gui.cpp | 31 +++++++++++++++--------------- src/story_gui.cpp | 2 +- src/subsidy_gui.cpp | 6 +++--- src/terraform_gui.cpp | 12 ++++++------ src/timetable_gui.cpp | 20 +++++++++---------- src/toolbar_gui.cpp | 2 +- src/town_gui.cpp | 6 +++--- src/transparency_gui.cpp | 2 +- src/tree_gui.cpp | 2 +- src/vehicle_gui.cpp | 30 ++++++++++++++--------------- src/video/allegro_v.cpp | 8 +++----- src/video/cocoa/cocoa_v.mm | 8 +++----- src/video/sdl2_v.cpp | 8 +++----- src/video/sdl_v.cpp | 8 +++----- src/video/win32_v.cpp | 8 +++----- src/viewport.cpp | 4 ++-- src/waypoint_gui.cpp | 2 +- src/window.cpp | 36 ++++++++++++++++++++++++++++------- src/window_gui.h | 10 ++++++++-- 51 files changed, 227 insertions(+), 204 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 4469974c63..555d1a48da 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -229,7 +229,7 @@ struct AIConfigWindow : public Window { case WID_AIC_LIST: { // Select a slot this->selected_slot = (CompanyID)this->vscroll->GetScrolledRowFromWidget(pt.y, this, widget); this->InvalidateData(); - if (click_count > 1 && this->selected_slot != INVALID_COMPANY) ShowScriptListWindow((CompanyID)this->selected_slot, _ctrl_pressed); + if (click_count > 1 && this->selected_slot != INVALID_COMPANY) ShowScriptListWindow((CompanyID)this->selected_slot, _fn_pressed); break; } @@ -259,7 +259,7 @@ struct AIConfigWindow : public Window { } case WID_AIC_CHANGE: // choose other AI - ShowScriptListWindow((CompanyID)this->selected_slot, _ctrl_pressed); + ShowScriptListWindow((CompanyID)this->selected_slot, _fn_pressed); break; case WID_AIC_CONFIGURE: // change the settings for an AI diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index aa2069c425..c5d631529b 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -65,7 +65,7 @@ static void PlaceAirport(TileIndex tile) byte airport_type = AirportClass::Get(_selected_airport_class)->GetSpec(_selected_airport_index)->GetIndex(); byte layout = _selected_airport_layout; - bool adjacent = _ctrl_pressed; + bool adjacent = _fn_pressed; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 64707259d3..db8d60e60a 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -582,7 +582,7 @@ public: case WID_RV_TRAIN_WAGONREMOVE_TOGGLE: { const Group *g = Group::GetIfValid(this->sel_group); if (g != nullptr) { - Command::Post(this->sel_group, GroupFlags::GF_REPLACE_WAGON_REMOVAL, !HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL), _ctrl_pressed); + Command::Post(this->sel_group, GroupFlags::GF_REPLACE_WAGON_REMOVAL, !HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL), _fn_pressed); } else { // toggle renew_keep_length Command::Post("company.renew_keep_length", Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1); @@ -634,9 +634,9 @@ public: if ((item.flags & EngineDisplayFlags::Shaded) == EngineDisplayFlags::None) e = item.engine_id; } - /* If Ctrl is pressed on the left side and we don't have any engines of the selected type, stop autoreplacing. + /* If Fn modifier is pressed on the left side and we don't have any engines of the selected type, stop autoreplacing. * This is most common when we have finished autoreplacing the engine and want to remove it from the list. */ - if (click_side == 0 && _ctrl_pressed && e != INVALID_ENGINE && + if (click_side == 0 && _fn_pressed && e != INVALID_ENGINE && (GetGroupNumEngines(_local_company, sel_group, e) == 0 || GetGroupNumEngines(_local_company, ALL_GROUP, e) == 0)) { EngineID veh_from = e; Command::Post(this->sel_group, veh_from, INVALID_ENGINE, false); diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index fec724bb4c..52f9fbcca7 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -376,7 +376,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo case TRANSPORT_RAIL: last_bridge_type = _last_railbridge_type; break; default: break; // water ways and air routes don't have bridge types } - if (_ctrl_pressed && CheckBridgeAvailability(last_bridge_type, bridge_len).Succeeded()) { + if (_fn_pressed && CheckBridgeAvailability(last_bridge_type, bridge_len).Succeeded()) { Command::Post(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE, CcBuildBridge, end, start, transport_type, last_bridge_type, road_rail_type); return; } diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 02e86115e2..f4b9b1576f 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1620,7 +1620,7 @@ struct BuildVehicleWindow : Window { } this->SelectEngine(e); this->SetDirty(); - if (_ctrl_pressed) { + if (_fn_pressed) { this->OnClick(pt, WID_BV_SHOW_HIDE, 1); } else if (click_count > 1 && !this->listview_mode) { this->OnClick(pt, WID_BV_BUILD, 1); diff --git a/src/command.cpp b/src/command.cpp index 51ec446e77..2cf95315a6 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -226,7 +226,7 @@ std::tuple CommandHelperBase::InternalPostBefore(Commands cmd, * However, in case of incoming network commands, * map generation or the pause button we do want * to execute. */ - bool estimate_only = _shift_pressed && IsLocalCompany() && !_generating_world && !network_command && !(flags & CMD_NO_EST); + bool estimate_only = _estimate_pressed && IsLocalCompany() && !_generating_world && !network_command && !(flags & CMD_NO_EST); /* We're only sending the command, so don't do * fancy things for 'success'. */ diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 6d354d86bd..4b865925c5 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -497,11 +497,11 @@ struct CompanyFinancesWindow : Window { break; case WID_CF_INCREASE_LOAN: // increase loan - Command::Post(STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY, _ctrl_pressed ? LoanCommand::Max : LoanCommand::Interval, 0); + Command::Post(STR_ERROR_CAN_T_BORROW_ANY_MORE_MONEY, _fn_pressed ? LoanCommand::Max : LoanCommand::Interval, 0); break; case WID_CF_REPAY_LOAN: // repay loan - Command::Post(STR_ERROR_CAN_T_REPAY_LOAN, _ctrl_pressed ? LoanCommand::Max : LoanCommand::Interval, 0); + Command::Post(STR_ERROR_CAN_T_REPAY_LOAN, _fn_pressed ? LoanCommand::Max : LoanCommand::Interval, 0); break; case WID_CF_INFRASTRUCTURE: // show infrastructure details @@ -1017,7 +1017,7 @@ public: } assert(j < LS_END); - if (_ctrl_pressed) { + if (_fn_pressed) { ToggleBit(this->sel, j); } else { this->sel = 1 << j; @@ -1048,7 +1048,7 @@ public: /* Set company colour livery */ for (LiveryScheme scheme = LS_DEFAULT; scheme < LS_END; scheme++) { /* Changed colour for the selected scheme, or all visible schemes if CTRL is pressed. */ - if (HasBit(this->sel, scheme) || (_ctrl_pressed && _livery_class[scheme] == this->livery_class && HasBit(_loaded_newgrf_features.used_liveries, scheme))) { + if (HasBit(this->sel, scheme) || (_fn_pressed && _livery_class[scheme] == this->livery_class && HasBit(_loaded_newgrf_features.used_liveries, scheme))) { Command::Post(scheme, widget == WID_SCL_PRI_COL_DROPDOWN, colour); } } @@ -2510,7 +2510,7 @@ struct CompanyWindow : Window case WID_C_VIEW_HQ: { TileIndex tile = Company::Get((CompanyID)this->window_number)->location_of_HQ; - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(tile); } else { ScrollMainWindowToTile(tile); @@ -2585,7 +2585,7 @@ struct CompanyWindow : Window void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override { - if (Command::Post(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS, tile, OBJECT_HQ, 0) && !_shift_pressed) { + if (Command::Post(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS, tile, OBJECT_HQ, 0) && !_estimate_pressed) { ResetObjectToPlace(); this->RaiseButtons(); } diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index f523825b85..fa8aec4148 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -144,7 +144,7 @@ static void TrainDepotMoveVehicle(const Vehicle *wagon, VehicleID sel, const Veh if (wagon == v) return; - Command::Post(STR_ERROR_CAN_T_MOVE_VEHICLE, v->tile, v->index, wagon == nullptr ? INVALID_VEHICLE : wagon->index, _ctrl_pressed); + Command::Post(STR_ERROR_CAN_T_MOVE_VEHICLE, v->tile, v->index, wagon == nullptr ? INVALID_VEHICLE : wagon->index, _fn_pressed); } static VehicleCellSize _base_block_sizes_depot[VEH_COMPANY_END]; ///< Cell size for vehicle images in the depot view. @@ -560,7 +560,7 @@ struct DepotWindow : Window { } else if (v != nullptr) { SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this); SetMouseCursorVehicle(v, EIT_IN_DEPOT); - _cursor.vehchain = _ctrl_pressed; + _cursor.vehchain = _fn_pressed; this->sel = v->index; this->SetDirty(); @@ -786,7 +786,7 @@ struct DepotWindow : Window { break; case WID_D_LOCATION: - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(this->window_number); } else { ScrollMainWindowToTile(this->window_number); @@ -854,7 +854,7 @@ struct DepotWindow : Window { CargoArray capacity{}, loaded{}; /* Display info for single (articulated) vehicle, or for whole chain starting with selected vehicle */ - bool whole_chain = (this->type == VEH_TRAIN && _ctrl_pressed); + bool whole_chain = (this->type == VEH_TRAIN && _fn_pressed); /* loop through vehicle chain and collect cargoes */ uint num = 0; @@ -900,7 +900,7 @@ struct DepotWindow : Window { */ bool OnVehicleSelect(const Vehicle *v) override { - if (_ctrl_pressed) { + if (_fn_pressed) { /* Share-clone, do not open new viewport, and keep tool active */ Command::Post(STR_ERROR_CAN_T_BUY_TRAIN + v->type, this->window_number, v->index, true); } else { @@ -921,8 +921,8 @@ struct DepotWindow : Window { */ bool OnVehicleSelect(VehicleList::const_iterator begin, VehicleList::const_iterator end) override { - if (!_ctrl_pressed) { - /* If CTRL is not pressed: If all the vehicles in this list have the same orders, then copy orders */ + if (!_fn_pressed) { + /* If Fn is not pressed: If all the vehicles in this list have the same orders, then copy orders */ if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { return VehiclesHaveSameEngineList(v1, v2); })) { @@ -937,7 +937,7 @@ struct DepotWindow : Window { ShowErrorMessage(STR_ERROR_CAN_T_BUY_TRAIN + (*begin)->type, STR_ERROR_CAN_T_CLONE_VEHICLE_LIST, WL_INFO); } } else { - /* If CTRL is pressed: If all the vehicles in this list share orders, then copy orders */ + /* If Fn is pressed: If all the vehicles in this list share orders, then copy orders */ if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { return VehiclesHaveSameEngineList(v1, v2); })) { @@ -1039,7 +1039,7 @@ struct DepotWindow : Window { GetDepotVehiclePtData gdvp = { nullptr, nullptr }; if (this->GetVehicleFromDepotWndPt(pt.x, pt.y, &v, &gdvp) == MODE_DRAG_VEHICLE && sel != INVALID_VEHICLE) { - if (gdvp.wagon != nullptr && gdvp.wagon->index == sel && _ctrl_pressed) { + if (gdvp.wagon != nullptr && gdvp.wagon->index == sel && _fn_pressed) { Command::Post(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE, Vehicle::Get(sel)->tile, Vehicle::Get(sel)->index, true); } else if (gdvp.wagon == nullptr || gdvp.wagon->index != sel) { this->vehicle_over = INVALID_VEHICLE; @@ -1064,7 +1064,7 @@ struct DepotWindow : Window { this->sel = INVALID_VEHICLE; this->SetDirty(); - bool sell_cmd = (v->type == VEH_TRAIN && (widget == WID_D_SELL_CHAIN || _ctrl_pressed)); + bool sell_cmd = (v->type == VEH_TRAIN && (widget == WID_D_SELL_CHAIN || _fn_pressed)); Command::Post(GetCmdSellVehMsg(v->type), v->tile, v->index, sell_cmd, true, INVALID_CLIENT_ID); break; } @@ -1101,10 +1101,10 @@ struct DepotWindow : Window { } } - EventState OnCTRLStateChange() override + EventState OnFnStateChange() override { if (this->sel != INVALID_VEHICLE) { - _cursor.vehchain = _ctrl_pressed; + _cursor.vehchain = _fn_pressed; this->SetWidgetDirty(WID_D_MATRIX); return ES_HANDLED; } diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 76a778622a..21009c69c0 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -213,7 +213,7 @@ struct BuildDocksToolbarWindow : Window { DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile)); TileIndex tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(tile, ReverseDiagDir(dir)) : tile); - bool adjacent = _ctrl_pressed; + bool adjacent = _fn_pressed; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { return Command::Do(CommandFlagsToDCFlags(GetCommandFlags()), tile, INVALID_STATION, adjacent).Succeeded(); @@ -255,10 +255,10 @@ struct BuildDocksToolbarWindow : Window { GUIPlaceProcDragXY(select_proc, start_tile, end_tile); break; case DDSP_CREATE_WATER: - Command::Post(STR_ERROR_CAN_T_BUILD_CANALS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, (_game_mode == GM_EDITOR && _ctrl_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, false); + Command::Post(STR_ERROR_CAN_T_BUILD_CANALS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, (_game_mode == GM_EDITOR && _fn_pressed) ? WATER_CLASS_SEA : WATER_CLASS_CANAL, false); break; case DDSP_CREATE_RIVER: - Command::Post(STR_ERROR_CAN_T_PLACE_RIVERS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, WATER_CLASS_RIVER, _ctrl_pressed); + Command::Post(STR_ERROR_CAN_T_PLACE_RIVERS, CcPlaySound_CONSTRUCTION_WATER, end_tile, start_tile, WATER_CLASS_RIVER, _fn_pressed); break; default: break; diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 908c856199..ee5bb0c44e 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -130,7 +130,7 @@ struct EnginePreviewWindow : Window { Command::Post(this->window_number); FALLTHROUGH; case WID_EP_NO: - if (!_shift_pressed) this->Close(); + if (!_estimate_pressed) this->Close(); break; } } diff --git a/src/game/game_gui.cpp b/src/game/game_gui.cpp index debc06af13..620c4ab0e5 100644 --- a/src/game/game_gui.cpp +++ b/src/game/game_gui.cpp @@ -255,12 +255,12 @@ struct GSConfigWindow : public Window { switch (widget) { case WID_GSC_GSLIST: { this->InvalidateData(); - if (click_count > 1 && _game_mode != GM_NORMAL) ShowScriptListWindow((CompanyID)OWNER_DEITY, _ctrl_pressed); + if (click_count > 1 && _game_mode != GM_NORMAL) ShowScriptListWindow((CompanyID)OWNER_DEITY, _fn_pressed); break; } case WID_GSC_CHANGE: // choose other Game Script - ShowScriptListWindow((CompanyID)OWNER_DEITY, _ctrl_pressed); + ShowScriptListWindow((CompanyID)OWNER_DEITY, _fn_pressed); break; case WID_GSC_CONTENT_DOWNLOAD: diff --git a/src/gfx.cpp b/src/gfx.cpp index 1cf74769e6..1ba7185309 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -34,8 +34,10 @@ byte _dirkeys; ///< 1 = left, 2 = up, 4 = right, 8 = down bool _fullscreen; byte _support8bpp; CursorVars _cursor; -bool _ctrl_pressed; ///< Is Ctrl pressed? -bool _shift_pressed; ///< Is Shift pressed? +bool _shift_pressed; ///< Is Shift pressed? +bool _fn_pressed; ///< Is function modifier pressed? +bool _remove_pressed; ///< Is remove modifier pressed? +bool _estimate_pressed; ///< Is estimate modifier pressed? uint16_t _game_speed = 100; ///< Current game-speed; 100 is 1x, 0 is infinite. bool _left_button_down; ///< Is left mouse button pressed? bool _left_button_clicked; ///< Is left mouse button clicked? diff --git a/src/gfx_func.h b/src/gfx_func.h index 9681158768..96c58a517c 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -52,8 +52,10 @@ extern byte _dirkeys; ///< 1 = left, 2 = up, 4 = right, 8 = down extern bool _fullscreen; extern byte _support8bpp; extern CursorVars _cursor; -extern bool _ctrl_pressed; ///< Is Ctrl pressed? -extern bool _shift_pressed; ///< Is Shift pressed? +extern bool _shift_pressed; ///< Is Shift pressed? +extern bool _fn_pressed; ///< Is function modifier pressed? +extern bool _remove_pressed; ///< Is remove modifier pressed? +extern bool _estimate_pressed; ///< Is esitame modifier pressed? extern uint16_t _game_speed; extern bool _left_button_down; @@ -71,7 +73,7 @@ extern Palette _cur_palette; ///< Current palette void HandleToolbarHotkey(int hotkey); void HandleKeypress(uint keycode, char32_t key); void HandleTextInput(const char *str, bool marked = false, const char *caret = nullptr, const char *insert_location = nullptr, const char *replacement_end = nullptr); -void HandleCtrlChanged(); +void HandleModifierKeys(bool shift_pressed, bool ctrl_pressed); void HandleMouseEvents(); void UpdateWindows(); void ChangeGameSpeed(bool enable_fast_forward); diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index d8be74d358..44bf11ebf0 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -143,7 +143,7 @@ struct GoalListWindow : public Window { default: NOT_REACHED(); } - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(xy); } else { ScrollMainWindowToTile(xy); diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 50e6990fe8..1ede6a3e02 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -757,12 +757,12 @@ public: NOT_REACHED(); } if (v) { - if (_ctrl_pressed && this->grouping == GB_SHARED_ORDERS) { + if (_fn_pressed && this->grouping == GB_SHARED_ORDERS) { ShowOrdersWindow(v); } else { this->vehicle_sel = v->index; - if (_ctrl_pressed && this->grouping == GB_NONE) { + if (_fn_pressed && this->grouping == GB_NONE) { /* * It only makes sense to select a group if not using shared orders * since two vehicles sharing orders can be from different groups. @@ -818,7 +818,7 @@ public: case WID_GL_REPLACE_PROTECTION: { const Group *g = Group::GetIfValid(this->vli.index); if (g != nullptr) { - Command::Post(this->vli.index, GroupFlags::GF_REPLACE_PROTECTION, !HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION), _ctrl_pressed); + Command::Post(this->vli.index, GroupFlags::GF_REPLACE_PROTECTION, !HasBit(g->flags, GroupFlags::GF_REPLACE_PROTECTION), _fn_pressed); } break; } @@ -861,7 +861,7 @@ public: { switch (widget) { case WID_GL_DEFAULT_VEHICLES: // Ungrouped vehicles - Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, DEFAULT_GROUP, this->vehicle_sel, _ctrl_pressed || this->grouping == GB_SHARED_ORDERS, VehicleListIdentifier{}); + Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, DEFAULT_GROUP, this->vehicle_sel, _fn_pressed || this->grouping == GB_SHARED_ORDERS, VehicleListIdentifier{}); this->vehicle_sel = INVALID_VEHICLE; this->group_over = INVALID_GROUP; @@ -878,7 +878,7 @@ public: auto it = this->group_sb->GetScrolledItemFromWidget(this->groups, pt.y, this, WID_GL_LIST_GROUP); GroupID new_g = it == this->groups.end() ? NEW_GROUP : (*it)->index; - Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr, new_g, vindex, _ctrl_pressed || this->grouping == GB_SHARED_ORDERS, VehicleListIdentifier{}); + Command::Post(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE, new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr, new_g, vindex, _fn_pressed || this->grouping == GB_SHARED_ORDERS, VehicleListIdentifier{}); break; } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index d3127ef1ae..2ec615c73c 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1080,7 +1080,7 @@ public: case WID_IV_GOTO: { Industry *i = Industry::Get(this->window_number); - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(i->location.GetCenterTile()); } else { ScrollMainWindowToTile(i->location.GetCenterTile()); @@ -1778,7 +1778,7 @@ public: case WID_ID_INDUSTRY_LIST: { auto it = this->vscroll->GetScrolledItemFromWidget(this->industries, pt.y, this, WID_ID_INDUSTRY_LIST, WidgetDimensions::scaled.framerect.top); if (it != this->industries.end()) { - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow((*it)->location.tile); } else { ScrollMainWindowToTile((*it)->location.tile); diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 2ffe2d4097..e08023a219 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -333,7 +333,7 @@ struct SelectGameWindow : public Window { switch (widget) { case WID_SGI_GENERATE_GAME: - if (_ctrl_pressed) { + if (_fn_pressed) { StartNewGameWithoutGUI(GENERATE_NEW_SEED); } else { ShowGenerateLandscape(); diff --git a/src/league_gui.cpp b/src/league_gui.cpp index de02cfe8c2..f8d2148998 100644 --- a/src/league_gui.cpp +++ b/src/league_gui.cpp @@ -244,7 +244,7 @@ static void HandleLinkClick(Link link) default: NOT_REACHED(); } - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(xy); } else { ScrollMainWindowToTile(xy); diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 64e1d02840..6cc74d93ee 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -344,7 +344,7 @@ public: { switch (widget) { case WID_LI_LOCATION: - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(this->tile); } else { ScrollMainWindowToTile(this->tile); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index a228bedb82..68c9e458f8 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1082,7 +1082,7 @@ struct NetworkStartServerWindow : public Window { case WID_NSS_GENERATE_GAME: // Start game if (!CheckServerName()) return; _is_network_server = true; - if (_ctrl_pressed) { + if (_fn_pressed) { StartNewGameWithoutGUI(GENERATE_NEW_SEED); } else { ShowGenerateLandscape(); diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 6bb16255bb..4841ca34b2 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -1007,7 +1007,7 @@ struct SpriteAlignerWindow : Window { if (this->offs_start_map.count(this->current_sprite) == 0) { this->offs_start_map[this->current_sprite] = XyOffs(spr->x_offs, spr->y_offs); } - int amt = ScaleByZoom(_ctrl_pressed ? 8 : 1, SpriteAlignerWindow::zoom); + int amt = ScaleByZoom(_fn_pressed ? 8 : 1, SpriteAlignerWindow::zoom); switch (widget) { /* Move eight units at a time if ctrl is pressed. */ case WID_SA_UP: spr->y_offs -= amt; break; diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 01479f1872..7309dad7c4 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -510,7 +510,7 @@ struct NewsWindow : Window { } else { TileIndex tile1 = GetReferenceTile(this->ni->reftype1, this->ni->ref1); TileIndex tile2 = GetReferenceTile(this->ni->reftype2, this->ni->ref2); - if (_ctrl_pressed) { + if (_fn_pressed) { if (tile1 != INVALID_TILE) ShowExtraViewportWindow(tile1); if (tile2 != INVALID_TILE) ShowExtraViewportWindow(tile2); } else { diff --git a/src/object_gui.cpp b/src/object_gui.cpp index a72edbe4ff..0ee70b7df6 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -553,7 +553,7 @@ public: } const ObjectSpec *spec = ObjectClass::Get(_selected_object_class)->GetSpec(_selected_object_index); Command::Post(STR_ERROR_CAN_T_BUILD_OBJECT, CcPlaySound_CONSTRUCTION_OTHER, - end_tile, start_tile, spec->Index(), _selected_object_view, (_ctrl_pressed ? true : false)); + end_tile, start_tile, spec->Index(), _selected_object_view, (_fn_pressed ? true : false)); } void OnPlaceObjectAbort() override diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 62780c4850..a914d27623 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -388,7 +388,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) ODTFB_PART_OF_ORDERS, (_settings_client.gui.new_nonstop && v->IsGroundVehicle()) ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE); - if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE)); + if (_fn_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE)); return order; } @@ -398,7 +398,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) v->type == VEH_TRAIN && IsTileOwner(tile, _local_company)) { order.MakeGoToWaypoint(GetStationIndex(tile)); - if (_settings_client.gui.new_nonstop != _ctrl_pressed) order.SetNonStopType(ONSF_NO_STOP_AT_ANY_STATION); + if (_settings_client.gui.new_nonstop != _fn_pressed) order.SetNonStopType(ONSF_NO_STOP_AT_ANY_STATION); return order; } @@ -429,7 +429,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) } if (st->facilities & facil) { order.MakeGoToStation(st->index); - if (_ctrl_pressed) order.SetLoadType(OLF_FULL_LOAD_ANY); + if (_fn_pressed) order.SetLoadType(OLF_FULL_LOAD_ANY); if (_settings_client.gui.new_nonstop && v->IsGroundVehicle()) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS); order.SetStopLocation(v->type == VEH_TRAIN ? (OrderStopLocation)(_settings_client.gui.stop_location) : OSL_PLATFORM_FAR_END); return order; @@ -689,16 +689,16 @@ private: /** * Handle the click on the skip button. - * If ctrl is pressed, skip to selected order, else skip to current order + 1 + * If Fn is pressed, skip to selected order, else skip to current order + 1 */ void OrderClick_Skip() { /* Don't skip when there's nothing to skip */ - if (_ctrl_pressed && this->vehicle->cur_implicit_order_index == this->OrderGetSel()) return; + if (_fn_pressed && this->vehicle->cur_implicit_order_index == this->OrderGetSel()) return; if (this->vehicle->GetNumOrders() <= 1) return; - Command::Post(_ctrl_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER, - this->vehicle->tile, this->vehicle->index, _ctrl_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders())); + Command::Post(_fn_pressed ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER, + this->vehicle->tile, this->vehicle->index, _fn_pressed ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders())); } /** @@ -717,7 +717,7 @@ private: /** * Handle the click on the 'stop sharing' button. - * If 'End of Shared Orders' isn't selected, do nothing. If Ctrl is pressed, call OrderClick_Delete and exit. + * If 'End of Shared Orders' isn't selected, do nothing. If Fn is pressed, call OrderClick_Delete and exit. * To stop sharing this vehicle order list, we copy the orders of a vehicle that share this order list. That way we * exit the group of shared vehicles while keeping the same order list. */ @@ -725,8 +725,8 @@ private: { /* Don't try to stop sharing orders if 'End of Shared Orders' isn't selected. */ if (!this->vehicle->IsOrderListShared() || this->selected_order != this->vehicle->GetNumOrders()) return; - /* If Ctrl is pressed, delete the order list as if we clicked the 'Delete' button. */ - if (_ctrl_pressed) { + /* If Fn is pressed, delete the order list as if we clicked the 'Delete' button. */ + if (_fn_pressed) { this->OrderClick_Delete(); return; } @@ -741,13 +741,13 @@ private: /** * Handle the click on the refit button. - * If ctrl is pressed, cancel refitting, else show the refit window. + * If Fn is pressed, cancel refitting, else show the refit window. * @param i Selected refit command. * @param auto_refit Select refit for auto-refitting. */ void OrderClick_Refit(int i, bool auto_refit) { - if (_ctrl_pressed) { + if (_fn_pressed) { /* Cancel refitting */ Command::Post(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), CARGO_NO_REFIT); } else { @@ -1023,7 +1023,7 @@ public: this->SetWidgetLoweredState(WID_O_NON_STOP, order->GetNonStopType() & ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS); } /* Disable refit button if the order is no 'always go' order. - * However, keep the service button enabled for refit-orders to allow clearing refits (without knowing about ctrl). */ + * However, keep the service button enabled for refit-orders to allow clearing refits (without knowing about Fn). */ this->SetWidgetDisabledState(WID_O_REFIT, (order->GetDepotOrderType() & ODTFB_SERVICE) || (order->GetDepotActionType() & ODATFB_HALT) || (!this->can_do_refit && !order->IsRefit())); @@ -1178,7 +1178,7 @@ public: VehicleOrderID sel = this->GetOrderFromPt(pt.y); - if (_ctrl_pressed && sel < this->vehicle->GetNumOrders()) { + if (_fn_pressed && sel < this->vehicle->GetNumOrders()) { TileIndex xy = this->vehicle->GetOrder(sel)->GetLocation(this->vehicle); if (xy != INVALID_TILE) ScrollMainWindowToTile(xy); return; @@ -1463,9 +1463,9 @@ public: /* v is vehicle getting orders. Only copy/clone orders if vehicle doesn't have any orders yet. * We disallow copying orders of other vehicles if we already have at least one order entry * ourself as it easily copies orders of vehicles within a station when we mean the station. - * Obviously if you press CTRL on a non-empty orders vehicle you know what you are doing + * Obviously if you press Fn on a non-empty orders vehicle you know what you are doing * TODO: give a warning message */ - bool share_order = _ctrl_pressed || this->goto_type == OPOS_SHARE; + bool share_order = _fn_pressed || this->goto_type == OPOS_SHARE; if (this->vehicle->GetNumOrders() != 0 && !share_order) return false; if (Command::Post(share_order ? STR_ERROR_CAN_T_SHARE_ORDER_LIST : STR_ERROR_CAN_T_COPY_ORDER_LIST, @@ -1484,11 +1484,11 @@ public: */ bool OnVehicleSelect(VehicleList::const_iterator begin, VehicleList::const_iterator end) override { - bool share_order = _ctrl_pressed || this->goto_type == OPOS_SHARE; + bool share_order = _fn_pressed || this->goto_type == OPOS_SHARE; if (this->vehicle->GetNumOrders() != 0 && !share_order) return false; if (!share_order) { - /* If CTRL is not pressed: If all the vehicles in this list have the same orders, then copy orders */ + /* If Fn is not pressed: If all the vehicles in this list have the same orders, then copy orders */ if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { return VehiclesHaveSameOrderList(v1, v2); })) { @@ -1497,7 +1497,7 @@ public: ShowErrorMessage(STR_ERROR_CAN_T_COPY_ORDER_LIST, STR_ERROR_CAN_T_COPY_ORDER_VEHICLE_LIST, WL_INFO); } } else { - /* If CTRL is pressed: If all the vehicles in this list share orders, then copy orders */ + /* If Fn is pressed: If all the vehicles in this list share orders, then copy orders */ if (AllEqual(begin, end, [](const Vehicle *v1, const Vehicle *v2) { return v1->FirstShared() == v2->FirstShared(); })) { diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 190716bd83..fe83536a63 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1039,7 +1039,7 @@ CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType rai * @param track track-orientation * @param sigtype type of the signal * @param sigvar variant of signal type (normal/semaphore) - * @param ctrl_pressed true = override signal/semaphore, or pre/exit/combo signal or toggle variant (CTRL-toggle) + * @param fn_pressed true = override signal/semaphore, or pre/exit/combo signal or toggle variant (Fn-toggle) * @param convert_signal convert the present signal type and variant * @param cycle_start start cycle from this signal type * @param cycle_stop wrap around after this signal type @@ -1049,12 +1049,12 @@ CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType rai * @return the cost of this operation or an error * @todo p2 should be replaced by two bits for "along" and "against" the track. */ -CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool ctrl_pressed, SignalType cycle_start, SignalType cycle_stop, uint8_t num_dir_cycle, byte signals_copy) +CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool fn_pressed, SignalType cycle_start, SignalType cycle_stop, uint8_t num_dir_cycle, byte signals_copy) { if (sigtype > SIGTYPE_LAST || sigvar > SIG_SEMAPHORE) return CMD_ERROR; if (cycle_start > cycle_stop || cycle_stop > SIGTYPE_LAST) return CMD_ERROR; - if (ctrl_pressed) sigvar = (SignalVariant)(sigvar ^ SIG_SEMAPHORE); + if (fn_pressed) sigvar = (SignalVariant)(sigvar ^ SIG_SEMAPHORE); /* You can only build signals on plain rail tiles, and the selected track must exist */ if (!ValParamTrackOrientation(track) || !IsPlainRailTile(tile) || @@ -1087,7 +1087,7 @@ CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track trac } else if (convert_signal) { /* convert button pressed */ - if (ctrl_pressed || GetSignalVariant(tile, track) != sigvar) { + if (fn_pressed || GetSignalVariant(tile, track) != sigvar) { /* it costs money to change signal variant (light or semaphore) */ cost = CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_SIGNALS] + _price[PR_CLEAR_SIGNALS]); } else { @@ -1133,7 +1133,7 @@ CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track trac } else { if (convert_signal) { /* convert signal button pressed */ - if (ctrl_pressed) { + if (fn_pressed) { /* toggle the present signal variant: SIG_ELECTRIC <-> SIG_SEMAPHORE */ SetSignalVariant(tile, track, (GetSignalVariant(tile, track) == SIG_ELECTRIC) ? SIG_SEMAPHORE : SIG_ELECTRIC); /* Query current signal type so the check for PBS signals below works. */ @@ -1147,7 +1147,7 @@ CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track trac } } - } else if (ctrl_pressed) { + } else if (fn_pressed) { /* cycle between cycle_start and cycle_end */ sigtype = (SignalType)(GetSignalType(tile, track) + 1); diff --git a/src/rail_cmd.h b/src/rail_cmd.h index 38a5e5c30a..5230f5285a 100644 --- a/src/rail_cmd.h +++ b/src/rail_cmd.h @@ -20,7 +20,7 @@ CommandCost CmdRemoveRailroadTrack(DoCommandFlag flags, TileIndex end_tile, Tile CommandCost CmdBuildSingleRail(DoCommandFlag flags, TileIndex tile, RailType railtype, Track track, bool auto_remove_signals); CommandCost CmdRemoveSingleRail(DoCommandFlag flags, TileIndex tile, Track track); CommandCost CmdBuildTrainDepot(DoCommandFlag flags, TileIndex tile, RailType railtype, DiagDirection dir); -CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool ctrl_pressed, SignalType cycle_start, SignalType cycle_stop, uint8_t num_dir_cycle, byte signals_copy); +CommandCost CmdBuildSingleSignal(DoCommandFlag flags, TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool fn_pressed, SignalType cycle_start, SignalType cycle_stop, uint8_t num_dir_cycle, byte signals_copy); CommandCost CmdRemoveSingleSignal(DoCommandFlag flags, TileIndex tile, Track track); CommandCost CmdConvertRail(DoCommandFlag flags, TileIndex tile, TileIndex area_start, RailType totype, bool diagonal); CommandCost CmdBuildSignalTrack(DoCommandFlag flags, TileIndex tile, TileIndex end_tile, Track track, SignalType sigtype, SignalVariant sigvar, bool mode, bool autofill, bool minimise_gaps, byte signal_density); diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 05a641fa81..ad8a3613a1 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -204,7 +204,7 @@ static void PlaceRail_Station(TileIndex tile) RailType rt = _cur_railtype; byte numtracks = _settings_client.gui.station_numtracks; byte platlength = _settings_client.gui.station_platlength; - bool adjacent = _ctrl_pressed; + bool adjacent = _fn_pressed; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { @@ -246,11 +246,11 @@ static void GenericPlaceSignals(TileIndex tile) if (FindWindowById(WC_BUILD_SIGNAL, 0) != nullptr) { /* signal GUI is used */ Command::Post(_convert_signal_button ? STR_ERROR_SIGNAL_CAN_T_CONVERT_SIGNALS_HERE : STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, CcPlaySound_CONSTRUCTION_RAIL, - tile, track, _cur_signal_type, _cur_signal_variant, _convert_signal_button, false, _ctrl_pressed, cycle_start, SIGTYPE_LAST, 0, 0); + tile, track, _cur_signal_type, _cur_signal_variant, _convert_signal_button, false, _fn_pressed, cycle_start, SIGTYPE_LAST, 0, 0); } else { SignalVariant sigvar = TimerGameCalendar::year < _settings_client.gui.semaphore_build_before ? SIG_SEMAPHORE : SIG_ELECTRIC; Command::Post(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, CcPlaySound_CONSTRUCTION_RAIL, - tile, track, _settings_client.gui.default_signal_type, sigvar, false, false, _ctrl_pressed, cycle_start, SIGTYPE_LAST, 0, 0); + tile, track, _settings_client.gui.default_signal_type, sigvar, false, false, _fn_pressed, cycle_start, SIGTYPE_LAST, 0, 0); } } @@ -297,11 +297,11 @@ static void ToggleRailButton_Remove(Window *w) } /** - * Updates the Remove button because of Ctrl state change + * Updates the Remove button because of remove modifer state change * @param w window the button belongs to * @return true iff the remove button was changed */ -static bool RailToolbar_CtrlChanged(Window *w) +static bool RailToolbar_RemoveChanged(Window *w) { if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return false; @@ -393,13 +393,13 @@ static void HandleAutoSignalPlacement() * in a network game can specify their own signal density */ if (_remove_button_clicked) { Command::Post(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM, CcPlaySound_CONSTRUCTION_RAIL, - TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), track, _ctrl_pressed); + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), track, _fn_pressed); } else { bool sig_gui = FindWindowById(WC_BUILD_SIGNAL, 0) != nullptr; SignalType sigtype = sig_gui ? _cur_signal_type : _settings_client.gui.default_signal_type; SignalVariant sigvar = sig_gui ? _cur_signal_variant : (TimerGameCalendar::year < _settings_client.gui.semaphore_build_before ? SIG_SEMAPHORE : SIG_ELECTRIC); Command::Post(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE, CcPlaySound_CONSTRUCTION_RAIL, - TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), track, sigtype, sigvar, false, _ctrl_pressed, !_settings_client.gui.drag_signals_fixed_distance, _settings_client.gui.drag_signals_density); + TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), track, sigtype, sigvar, false, _fn_pressed, !_settings_client.gui.drag_signals_fixed_distance, _settings_client.gui.drag_signals_density); } } @@ -596,7 +596,7 @@ struct BuildRailToolbarWindow : Window { case WID_RAT_BUILD_SIGNALS: { this->last_user_action = widget; bool started = HandlePlacePushButton(this, WID_RAT_BUILD_SIGNALS, ANIMCURSOR_BUILDSIGNALS, HT_RECT); - if (started != _ctrl_pressed) { + if (started != _fn_pressed) { ShowSignalBuilder(this); } break; @@ -624,7 +624,7 @@ struct BuildRailToolbarWindow : Window { default: NOT_REACHED(); } this->UpdateRemoveWidgetStatus(widget); - if (_ctrl_pressed) RailToolbar_CtrlChanged(this); + if (_remove_pressed) RailToolbar_RemoveChanged(this); } EventState OnHotkey(int hotkey) override @@ -723,7 +723,7 @@ struct BuildRailToolbarWindow : Window { break; case DDSP_CONVERT_RAIL: - Command::Post(STR_ERROR_CAN_T_CONVERT_RAIL, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _cur_railtype, _ctrl_pressed); + Command::Post(STR_ERROR_CAN_T_CONVERT_RAIL, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, _cur_railtype, _fn_pressed); break; case DDSP_REMOVE_STATION: @@ -731,7 +731,7 @@ struct BuildRailToolbarWindow : Window { if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) { /* Station */ if (_remove_button_clicked) { - bool keep_rail = !_ctrl_pressed; + bool keep_rail = !_fn_pressed; Command::Post(STR_ERROR_CAN_T_REMOVE_PART_OF_STATION, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, keep_rail); } else { HandleStationPlacement(start_tile, end_tile); @@ -739,12 +739,12 @@ struct BuildRailToolbarWindow : Window { } else { /* Waypoint */ if (_remove_button_clicked) { - bool keep_rail = !_ctrl_pressed; + bool keep_rail = !_fn_pressed; Command::Post(STR_ERROR_CAN_T_REMOVE_TRAIN_WAYPOINT, CcPlaySound_CONSTRUCTION_RAIL, end_tile, start_tile, keep_rail); } else { TileArea ta(start_tile, end_tile); Axis axis = select_method == VPM_X_LIMITED ? AXIS_X : AXIS_Y; - bool adjacent = _ctrl_pressed; + bool adjacent = _fn_pressed; uint16_t waypoint_type = _cur_waypoint_type; auto proc = [=](bool test, StationID to_join) -> bool { @@ -786,10 +786,10 @@ struct BuildRailToolbarWindow : Window { VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } - EventState OnCTRLStateChange() override + EventState OnRemoveStateChange() override { - /* do not toggle Remove button by Ctrl when placing station */ - if (!this->IsWidgetLowered(WID_RAT_BUILD_STATION) && !this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT) && RailToolbar_CtrlChanged(this)) return ES_HANDLED; + /* do not toggle Remove button by remove modifier when placing station */ + if (!this->IsWidgetLowered(WID_RAT_BUILD_STATION) && !this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT) && RailToolbar_RemoveChanged(this)) return ES_HANDLED; return ES_NOT_HANDLED; } @@ -912,7 +912,7 @@ static void HandleStationPlacement(TileIndex start, TileIndex end) RailStationGUISettings params = _railstation; RailType rt = _cur_railtype; - bool adjacent = _ctrl_pressed; + bool adjacent = _fn_pressed; auto proc = [=](bool test, StationID to_join) -> bool { if (test) { diff --git a/src/road_gui.cpp b/src/road_gui.cpp index adb88f33e6..220966f19e 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -285,11 +285,11 @@ static void ToggleRoadButton_Remove(Window *w) } /** - * Updates the Remove button because of Ctrl state change + * Updates the Remove button because of remove modifer state change * @param w window the button belongs to * @return true iff the remove button was changed */ -static bool RoadToolbar_CtrlChanged(Window *w) +static bool RoadToolbar_RemoveChanged(Window *w) { if (w->IsWidgetDisabled(WID_ROT_REMOVE)) return false; @@ -549,7 +549,7 @@ struct BuildRoadToolbarWindow : Window { default: NOT_REACHED(); } this->UpdateOptionWidgetStatus((RoadToolbarWidgets)widget); - if (_ctrl_pressed) RoadToolbar_CtrlChanged(this); + if (_remove_pressed) RoadToolbar_RemoveChanged(this); } EventState OnHotkey(int hotkey) override @@ -709,9 +709,9 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_BUS_STATION) && GetIfClassHasNewStopsByType(RoadStopClass::Get(_roadstop_gui_settings.roadstop_class), ROADSTOP_BUS, _cur_roadtype)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - Command::Post(this->rti->strings.err_remove_station[ROADSTOP_BUS], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w, ta.h, ROADSTOP_BUS, _ctrl_pressed); + Command::Post(this->rti->strings.err_remove_station[ROADSTOP_BUS], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w, ta.h, ROADSTOP_BUS, _fn_pressed); } else { - PlaceRoadStop(start_tile, end_tile, ROADSTOP_BUS, _ctrl_pressed, _cur_roadtype, this->rti->strings.err_build_station[ROADSTOP_BUS]); + PlaceRoadStop(start_tile, end_tile, ROADSTOP_BUS, _fn_pressed, _cur_roadtype, this->rti->strings.err_build_station[ROADSTOP_BUS]); } } break; @@ -721,9 +721,9 @@ struct BuildRoadToolbarWindow : Window { if (this->IsWidgetLowered(WID_ROT_TRUCK_STATION) && GetIfClassHasNewStopsByType(RoadStopClass::Get(_roadstop_gui_settings.roadstop_class), ROADSTOP_TRUCK, _cur_roadtype)) { if (_remove_button_clicked) { TileArea ta(start_tile, end_tile); - Command::Post(this->rti->strings.err_remove_station[ROADSTOP_TRUCK], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w, ta.h, ROADSTOP_TRUCK, _ctrl_pressed); + Command::Post(this->rti->strings.err_remove_station[ROADSTOP_TRUCK], CcPlaySound_CONSTRUCTION_OTHER, ta.tile, ta.w, ta.h, ROADSTOP_TRUCK, _fn_pressed); } else { - PlaceRoadStop(start_tile, end_tile, ROADSTOP_TRUCK, _ctrl_pressed, _cur_roadtype, this->rti->strings.err_build_station[ROADSTOP_TRUCK]); + PlaceRoadStop(start_tile, end_tile, ROADSTOP_TRUCK, _fn_pressed, _cur_roadtype, this->rti->strings.err_build_station[ROADSTOP_TRUCK]); } } break; @@ -741,9 +741,9 @@ struct BuildRoadToolbarWindow : Window { VpSetPresizeRange(tile, _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile); } - EventState OnCTRLStateChange() override + EventState OnRemoveStateChange() override { - if (RoadToolbar_CtrlChanged(this)) return ES_HANDLED; + if (RoadToolbar_RemoveChanged(this)) return ES_HANDLED; return ES_NOT_HANDLED; } diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index 6f2d15da49..e83a3616b9 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -1042,12 +1042,12 @@ struct ScriptDebugWindow : public Window { /* Check which button is clicked */ if (IsInsideMM(widget, WID_SCRD_COMPANY_BUTTON_START, WID_SCRD_COMPANY_BUTTON_END + 1)) { - ChangeToScript((CompanyID)(widget - WID_SCRD_COMPANY_BUTTON_START), _ctrl_pressed); + ChangeToScript((CompanyID)(widget - WID_SCRD_COMPANY_BUTTON_START), _fn_pressed); } switch (widget) { case WID_SCRD_SCRIPT_GAME: - ChangeToScript(OWNER_DEITY, _ctrl_pressed); + ChangeToScript(OWNER_DEITY, _fn_pressed); break; case WID_SCRD_RELOAD_TOGGLE: diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index f335d10a18..bfd59e43bb 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -785,7 +785,7 @@ struct GameOptionsWindow : Window { case WID_GO_GUI_SCALE: if (ClickSliderWidget(this->GetWidget(widget)->GetCurrentRect(), pt, MIN_INTERFACE_SCALE, MAX_INTERFACE_SCALE, this->gui_scale)) { - if (!_ctrl_pressed) this->gui_scale = ((this->gui_scale + 12) / 25) * 25; + if (!_fn_pressed) this->gui_scale = ((this->gui_scale + 12) / 25) * 25; this->SetWidgetDirty(widget); } diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 848cb8e529..a029454cec 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -489,7 +489,7 @@ struct SignWindow : Window, SignList { case WID_QES_LOCATION: { const Sign *si = Sign::Get(this->cur_sign); TileIndex tile = TileVirtXY(si->x, si->y); - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(tile); } else { ScrollMainWindowToTile(tile); @@ -565,7 +565,7 @@ void HandleClickOnSign(const Sign *si) /* If we can't rename the sign, don't even open the rename GUI. */ if (!CompanyCanRenameSign(si)) return; - if (_ctrl_pressed && (si->owner == _local_company || (si->owner == OWNER_DEITY && _game_mode == GM_EDITOR))) { + if (_fn_pressed && (si->owner == _local_company || (si->owner == OWNER_DEITY && _game_mode == GM_EDITOR))) { RenameSign(si->index, ""); return; } diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 3df7ab6e14..23d1e2cec5 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -792,7 +792,7 @@ protected: */ void SelectLegendItem(int click_pos, LegendAndColour *legend, int end_legend_item, int begin_legend_item = 0) { - if (_ctrl_pressed) { + if (_fn_pressed) { /* Disable all, except the clicked one */ bool changes = false; for (int i = begin_legend_item; i != end_legend_item; i++) { diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 07553fbcd7..d104d90147 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -84,7 +84,7 @@ template void FindStationsAroundSelection() { /* With distant join we don't know which station will be selected, so don't show any */ - if (_ctrl_pressed) { + if (_fn_pressed) { SetViewportCatchmentSpecializedStation(nullptr, true); return; } @@ -125,11 +125,11 @@ void FindStationsAroundSelection() */ void CheckRedrawStationCoverage(const Window *w) { - /* Test if ctrl state changed */ - static bool _last_ctrl_pressed; - if (_ctrl_pressed != _last_ctrl_pressed) { + /* Test if fn modifer state changed */ + static bool _last_fn_pressed; + if (_fn_pressed != _last_fn_pressed) { _thd.dirty = 0xff; - _last_ctrl_pressed = _ctrl_pressed; + _last_fn_pressed = _fn_pressed; } if (_thd.dirty & 1) { @@ -145,10 +145,10 @@ void CheckRedrawStationCoverage(const Window *w) void CheckRedrawWaypointCoverage(const Window *) { /* Test if ctrl state changed */ - static bool _last_ctrl_pressed; - if (_ctrl_pressed != _last_ctrl_pressed) { + static bool _last_fn_pressed; + if (_fn_pressed != _last_fn_pressed) { _thd.dirty = 0xff; - _last_ctrl_pressed = _ctrl_pressed; + _last_fn_pressed = _fn_pressed; } if (_thd.dirty & 1) { @@ -544,7 +544,7 @@ public: /* do not check HasStationInUse - it is slow and may be invalid */ assert(st->owner == (Owner)this->window_number || st->owner == OWNER_NONE); - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(st->xy); } else { ScrollMainWindowToTile(st->xy); @@ -557,7 +557,7 @@ public: case WID_STL_BUS: case WID_STL_AIRPLANE: case WID_STL_SHIP: - if (_ctrl_pressed) { + if (_fn_pressed) { ToggleBit(this->filter.facilities, widget - WID_STL_TRAIN); this->ToggleWidgetLoweredState(widget); } else { @@ -604,7 +604,7 @@ public: break; case WID_STL_NOCARGOWAITING: - if (_ctrl_pressed) { + if (_fn_pressed) { this->filter.include_empty = !this->filter.include_empty; this->ToggleWidgetLoweredState(WID_STL_NOCARGOWAITING); } else { @@ -626,8 +626,9 @@ public: /* Determine the selected cargo type */ const CargoSpec *cs = _sorted_cargo_specs[widget - WID_STL_CARGOSTART]; - if (_ctrl_pressed) { + if (_fn_pressed) { ToggleBit(this->filter.cargoes, cs->Index()); + this->ToggleWidgetLoweredState(widget); } else { for (uint i = 0; i < _sorted_standard_cargo_specs.size(); i++) { @@ -1901,7 +1902,7 @@ struct StationViewWindow : public Window { void HandleCargoWaitingClick(int row) { if (row < 0 || (uint)row >= this->displayed_rows.size()) return; - if (_ctrl_pressed) { + if (_fn_pressed) { this->scroll_to_row = row; } else { RowDisplay &display = this->displayed_rows[row]; @@ -1926,7 +1927,7 @@ struct StationViewWindow : public Window { break; case WID_SV_LOCATION: - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(Station::Get(this->window_number)->xy); } else { ScrollMainWindowToTile(Station::Get(this->window_number)->xy); @@ -2423,7 +2424,7 @@ static bool StationJoinerNeeded(TileArea ta, const StationPickerCmdProc &proc) } /* only show the popup, if we press ctrl */ - if (!_ctrl_pressed) return false; + if (!_fn_pressed) return false; /* Now check if we could build there */ if (!proc(true, INVALID_STATION)) return false; diff --git a/src/story_gui.cpp b/src/story_gui.cpp index c986042cb7..14490e0a53 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -542,7 +542,7 @@ protected: break; case SPET_LOCATION: - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow((TileIndex)pe.referenced_id); } else { ScrollMainWindowToTile((TileIndex)pe.referenced_id); diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index 9e72fe203e..7db7c4d53e 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -82,8 +82,8 @@ struct SubsidyListWindow : Window { default: NOT_REACHED(); } - if (_ctrl_pressed || !ScrollMainWindowToTile(xy)) { - if (_ctrl_pressed) ShowExtraViewportWindow(xy); + if (_fn_pressed || !ScrollMainWindowToTile(xy)) { + if (_fn_pressed) ShowExtraViewportWindow(xy); /* otherwise determine dst coordinate for subsidy and scroll to it */ switch (s->dst_type) { @@ -92,7 +92,7 @@ struct SubsidyListWindow : Window { default: NOT_REACHED(); } - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(xy); } else { ScrollMainWindowToTile(xy); diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index e589c4f20e..d7b149142b 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -63,7 +63,7 @@ static void GenerateDesertArea(TileIndex end, TileIndex start) TileArea ta(start, end); for (TileIndex tile : ta) { - SetTropicZone(tile, (_ctrl_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT); + SetTropicZone(tile, (_remove_pressed) ? TROPICZONE_NORMAL : TROPICZONE_DESERT); Command::Post(tile); MarkTileDirtyByTile(tile); } @@ -119,16 +119,16 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t switch (proc) { case DDSP_DEMOLISH_AREA: - Command::Post(STR_ERROR_CAN_T_CLEAR_THIS_AREA, CcPlaySound_EXPLOSION, end_tile, start_tile, _ctrl_pressed); + Command::Post(STR_ERROR_CAN_T_CLEAR_THIS_AREA, CcPlaySound_EXPLOSION, end_tile, start_tile, _fn_pressed); break; case DDSP_RAISE_AND_LEVEL_AREA: - Command::Post(STR_ERROR_CAN_T_RAISE_LAND_HERE, CcTerraform, end_tile, start_tile, _ctrl_pressed, LM_RAISE); + Command::Post(STR_ERROR_CAN_T_RAISE_LAND_HERE, CcTerraform, end_tile, start_tile, _fn_pressed, LM_RAISE); break; case DDSP_LOWER_AND_LEVEL_AREA: - Command::Post(STR_ERROR_CAN_T_LOWER_LAND_HERE, CcTerraform, end_tile, start_tile, _ctrl_pressed, LM_LOWER); + Command::Post(STR_ERROR_CAN_T_LOWER_LAND_HERE, CcTerraform, end_tile, start_tile, _fn_pressed, LM_LOWER); break; case DDSP_LEVEL_AREA: - Command::Post(STR_ERROR_CAN_T_LEVEL_LAND_HERE, CcTerraform, end_tile, start_tile, _ctrl_pressed, LM_LEVEL); + Command::Post(STR_ERROR_CAN_T_LEVEL_LAND_HERE, CcTerraform, end_tile, start_tile, _fn_pressed, LM_LEVEL); break; case DDSP_CREATE_ROCKS: GenerateRockyArea(end_tile, start_tile); @@ -284,7 +284,7 @@ struct TerraformToolbarWindow : Window { if (TileY(end_tile) == Map::MaxY()) end_tile += TileDiffXY(0, -1); } Command::Post(STR_ERROR_CAN_T_PURCHASE_THIS_LAND, CcPlaySound_CONSTRUCTION_RAIL, - end_tile, start_tile, OBJECT_OWNED_LAND, 0, (_ctrl_pressed ? true : false)); + end_tile, start_tile, OBJECT_OWNED_LAND, 0, (_fn_pressed ? true : false)); break; } } diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 961e25eda2..c715c2ce01 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -204,8 +204,8 @@ struct TimetableWindow : Window { const Vehicle *vehicle; ///< Vehicle monitored by the window. bool show_expected; ///< Whether we show expected arrival or scheduled. Scrollbar *vscroll; ///< The scrollbar. - bool set_start_date_all; ///< Set start date using minutes text entry for all timetable entries (ctrl-click) action. - bool change_timetable_all; ///< Set wait time or speed for all timetable entries (ctrl-click) action. + bool set_start_date_all; ///< Set start date using minutes text entry for all timetable entries (Fn-click) action. + bool change_timetable_all; ///< Set wait time or speed for all timetable entries (Fn-click) action. TimetableWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc), @@ -646,10 +646,10 @@ struct TimetableWindow : Window { case WID_VT_START_DATE: // Change the date that the timetable starts. if (_settings_client.gui.timetable_mode == TimetableMode::Seconds) { this->query_widget = WID_VT_START_DATE; - this->change_timetable_all = _ctrl_pressed; + this->change_timetable_all = _fn_pressed; ShowQueryString(STR_EMPTY, STR_TIMETABLE_START_SECONDS_QUERY, 6, this, CS_NUMERAL, QSF_ACCEPT_UNCHANGED); } else { - ShowSetDateWindow(this, v->index, TimerGameEconomy::date, TimerGameEconomy::year, TimerGameEconomy::year + MAX_TIMETABLE_START_YEARS, ChangeTimetableStartCallback, reinterpret_cast(static_cast(_ctrl_pressed))); + ShowSetDateWindow(this, v->index, TimerGameEconomy::date, TimerGameEconomy::year, TimerGameEconomy::year + MAX_TIMETABLE_START_YEARS, ChangeTimetableStartCallback, reinterpret_cast(static_cast(_fn_pressed))); } break; @@ -673,7 +673,7 @@ struct TimetableWindow : Window { } } - this->change_timetable_all = _ctrl_pressed && (order != nullptr); + this->change_timetable_all = _fn_pressed && (order != nullptr); ShowQueryString(current, STR_TIMETABLE_CHANGE_TIME, 31, this, CS_NUMERAL, QSF_ACCEPT_UNCHANGED); break; } @@ -694,14 +694,14 @@ struct TimetableWindow : Window { } } - this->change_timetable_all = _ctrl_pressed && (order != nullptr); + this->change_timetable_all = _fn_pressed && (order != nullptr); ShowQueryString(current, STR_TIMETABLE_CHANGE_SPEED, 31, this, CS_NUMERAL, QSF_NONE); break; } case WID_VT_CLEAR_TIME: { // Clear waiting time. auto [order_id, mtf] = PackTimetableArgs(v, this->sel_index, false); - if (_ctrl_pressed) { + if (_fn_pressed) { Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, mtf, 0); } else { Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, order_id, mtf, 0); @@ -711,7 +711,7 @@ struct TimetableWindow : Window { case WID_VT_CLEAR_SPEED: { // Clear max speed button. auto [order_id, mtf] = PackTimetableArgs(v, this->sel_index, true); - if (_ctrl_pressed) { + if (_fn_pressed) { Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, mtf, UINT16_MAX); } else { Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, order_id, mtf, UINT16_MAX); @@ -720,11 +720,11 @@ struct TimetableWindow : Window { } case WID_VT_RESET_LATENESS: // Reset the vehicle's late counter. - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, _ctrl_pressed); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, _fn_pressed); break; case WID_VT_AUTOFILL: { // Autofill the timetable. - Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, !HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE), _ctrl_pressed); + Command::Post(STR_ERROR_CAN_T_TIMETABLE_VEHICLE, v->index, !HasBit(v->vehicle_flags, VF_AUTOFILL_TIMETABLE), _fn_pressed); break; } diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index f1be2f9c7a..9355fa3a38 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1133,7 +1133,7 @@ static CallBackFunction MenuClickHelp(int index) case 0: return PlaceLandBlockInfo(); case 1: ShowHelpWindow(); break; case 2: IConsoleSwitch(); break; - case 3: ShowScriptDebugWindow(INVALID_COMPANY, _ctrl_pressed); break; + case 3: ShowScriptDebugWindow(INVALID_COMPANY, _fn_pressed); break; case 4: ShowScreenshotWindow(); break; case 5: ShowFramerateWindow(); break; case 6: ShowAboutWindow(); break; diff --git a/src/town_gui.cpp b/src/town_gui.cpp index d3d1244a9e..18371d2946 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -493,7 +493,7 @@ public: { switch (widget) { case WID_TV_CENTER_VIEW: // scroll to location - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(this->town->xy); } else { ScrollMainWindowToTile(this->town->xy); @@ -958,7 +958,7 @@ public: const Town *t = *it; assert(t != nullptr); - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(t->xy); } else { ScrollMainWindowToTile(t->xy); @@ -1217,7 +1217,7 @@ public: tile, this->town_size, this->city, this->town_layout, random, townnameparts, name); /* Rerandomise name, if success and no cost-estimation. */ - if (success && !_shift_pressed) this->RandomTownName(); + if (success && !_estimate_pressed) this->RandomTownName(); } void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp index d0379ad801..bcb81fe18d 100644 --- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -72,7 +72,7 @@ public: void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override { if (widget >= WID_TT_BEGIN && widget < WID_TT_END) { - if (_ctrl_pressed) { + if (_fn_pressed) { /* toggle the bit of the transparencies lock variable */ ToggleTransparencyLock((TransparencyOption)(widget - WID_TT_BEGIN)); this->SetDirty(); diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 4a91853289..b3684263b2 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -239,7 +239,7 @@ public: void OnPlaceMouseUp([[maybe_unused]] ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, [[maybe_unused]] Point pt, TileIndex start_tile, TileIndex end_tile) override { if (_game_mode != GM_EDITOR && this->mode == PM_NORMAL && pt.x != -1 && select_proc == DDSP_PLANT_TREES) { - Command::Post(STR_ERROR_CAN_T_PLANT_TREE_HERE, end_tile, start_tile, this->tree_to_plant, _ctrl_pressed); + Command::Post(STR_ERROR_CAN_T_PLANT_TREE_HERE, end_tile, start_tile, this->tree_to_plant, _fn_pressed); } } diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index de0a11f11d..86a454571a 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1155,7 +1155,7 @@ struct RefitWindow : public Window { /* If the selection is not correct, clear it. */ if (this->num_vehicles != 0) { - if (_ctrl_pressed) this->num_vehicles = UINT8_MAX; + if (_fn_pressed) this->num_vehicles = UINT8_MAX; break; } FALLTHROUGH; @@ -1178,7 +1178,7 @@ struct RefitWindow : public Window { this->click_x = GetClickPosition(pt.x - nwi->pos_x); this->SetSelectedVehicles(pt.x - nwi->pos_x); this->SetWidgetDirty(WID_VR_VEHICLE_PANEL_DISPLAY); - if (!_ctrl_pressed) { + if (!_fn_pressed) { SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this); } else { /* The vehicle selection has changed. */ @@ -2074,7 +2074,7 @@ public: case GB_NONE: { const Vehicle *v = vehgroup.GetSingleVehicle(); if (!VehicleClicked(v)) { - if (_ctrl_pressed) { + if (_fn_pressed) { ShowCompanyGroupForVehicle(v); } else { ShowVehicleViewWindow(v); @@ -2087,7 +2087,7 @@ public: assert(vehgroup.NumVehicles() > 0); if (!VehicleClicked(vehgroup)) { const Vehicle *v = vehgroup.vehicles_begin[0]; - if (_ctrl_pressed) { + if (_fn_pressed) { ShowOrdersWindow(v); } else { if (vehgroup.NumVehicles() == 1) { @@ -2232,10 +2232,10 @@ void ShowVehicleListWindow(CompanyID company, VehicleType vehicle_type) { /* If _settings_client.gui.advanced_vehicle_list > 1, display the Advanced list * if _settings_client.gui.advanced_vehicle_list == 1, display Advanced list only for local company - * if _ctrl_pressed, do the opposite action (Advanced list x Normal list) + * if _fn_pressed, do the opposite action (Advanced list x Normal list) */ - if ((_settings_client.gui.advanced_vehicle_list > (uint)(company != _local_company)) != _ctrl_pressed) { + if ((_settings_client.gui.advanced_vehicle_list > (uint)(company != _local_company)) != _fn_pressed) { ShowCompanyGroup(company, vehicle_type); } else { ShowVehicleListWindowLocal(company, VL_STANDARD, vehicle_type, company); @@ -2687,9 +2687,9 @@ struct VehicleDetailsWindow : Window { const Vehicle *v = Vehicle::Get(this->window_number); int mod; if (!v->ServiceIntervalIsPercent() && TimerGameEconomy::UsingWallclockUnits()) { - mod = _ctrl_pressed ? 1 : 5; + mod = _fn_pressed ? 1 : 5; } else { - mod = _ctrl_pressed ? 5 : 10; + mod = _fn_pressed ? 5 : 10; } mod = (widget == WID_VD_DECREASE_SERVICING_INTERVAL) ? -mod : mod; @@ -3209,7 +3209,7 @@ public: TileIndex tile = v->current_order.GetLocation(v); if (tile == INVALID_TILE) break; - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(tile); } else { ScrollMainWindowToTile(tile); @@ -3218,7 +3218,7 @@ public: } case WID_VV_LOCATION: // center main view - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(TileVirtXY(v->x_pos, v->y_pos)); } else { const Window *mainwindow = GetMainWindow(); @@ -3232,20 +3232,20 @@ public: break; case WID_VV_GOTO_DEPOT: // goto hangar - Command::Post(GetCmdSendToDepotMsg(v), v->index, _ctrl_pressed ? DepotCommand::Service : DepotCommand::None, {}); + Command::Post(GetCmdSendToDepotMsg(v), v->index, _fn_pressed ? DepotCommand::Service : DepotCommand::None, {}); break; case WID_VV_REFIT: // refit ShowVehicleRefitWindow(v, INVALID_VEH_ORDER_ID, this); break; case WID_VV_SHOW_ORDERS: // show orders - if (_ctrl_pressed) { + if (_fn_pressed) { ShowTimetableWindow(v); } else { ShowOrdersWindow(v); } break; case WID_VV_SHOW_DETAILS: // show details - if (_ctrl_pressed) { + if (_fn_pressed) { ShowCompanyGroupForVehicle(v); } else { ShowVehicleDetailsWindow(v); @@ -3257,8 +3257,8 @@ public: * For starting the vehicle the player has to open the depot GUI, which is * most likely already open, but is also visible in the vehicle viewport. */ Command::Post(_vehicle_msg_translation_table[VCT_CMD_CLONE_VEH][v->type], - _ctrl_pressed ? nullptr : CcCloneVehicle, - v->tile, v->index, _ctrl_pressed); + _fn_pressed ? nullptr : CcCloneVehicle, + v->tile, v->index, _fn_pressed); break; case WID_VV_TURN_AROUND: // turn around assert(v->IsGroundVehicle()); diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp index a2ac32c117..7ad6b01602 100644 --- a/src/video/allegro_v.cpp +++ b/src/video/allegro_v.cpp @@ -461,10 +461,8 @@ void VideoDriver_Allegro::Stop() void VideoDriver_Allegro::InputLoop() { - bool old_ctrl_pressed = _ctrl_pressed; - - _ctrl_pressed = !!(key_shifts & KB_CTRL_FLAG); - _shift_pressed = !!(key_shifts & KB_SHIFT_FLAG); + bool ctrl_pressed = !!(key_shifts & KB_CTRL_FLAG); + bool shift_pressed = !!(key_shifts & KB_SHIFT_FLAG); /* Speedup when pressing tab, except when using ALT+TAB * to switch to another application. */ @@ -477,7 +475,7 @@ void VideoDriver_Allegro::InputLoop() (key[KEY_RIGHT] ? 4 : 0) | (key[KEY_DOWN] ? 8 : 0); - if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged(); + HandleModifierKeys(shift_pressed, ctrl_pressed); } void VideoDriver_Allegro::MainLoop() diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 23979b4ef4..33a6640f30 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -472,14 +472,12 @@ void VideoDriver_Cocoa::InputLoop() { NSUInteger cur_mods = [ NSEvent modifierFlags ]; - bool old_ctrl_pressed = _ctrl_pressed; - - _ctrl_pressed = (cur_mods & ( _settings_client.gui.right_mouse_btn_emulation != RMBE_CONTROL ? NSEventModifierFlagControl : NSEventModifierFlagCommand)) != 0; - _shift_pressed = (cur_mods & NSEventModifierFlagShift) != 0; + bool ctrl_pressed = (cur_mods & ( _settings_client.gui.right_mouse_btn_emulation != RMBE_CONTROL ? NSEventModifierFlagControl : NSEventModifierFlagCommand)) != 0; + bool shift_pressed = (cur_mods & NSEventModifierFlagShift) != 0; this->fast_forward_key_pressed = _tab_is_down; - if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged(); + HandleModifierKeys(shift_pressed, ctrl_pressed); } /** Main game loop. */ diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp index 2bb381f5ec..e53a345230 100644 --- a/src/video/sdl2_v.cpp +++ b/src/video/sdl2_v.cpp @@ -575,10 +575,8 @@ void VideoDriver_SDL_Base::InputLoop() uint32_t mod = SDL_GetModState(); const Uint8 *keys = SDL_GetKeyboardState(nullptr); - bool old_ctrl_pressed = _ctrl_pressed; - - _ctrl_pressed = !!(mod & KMOD_CTRL); - _shift_pressed = !!(mod & KMOD_SHIFT); + bool ctrl_pressed = !!(mod & KMOD_CTRL); + bool shift_pressed = !!(mod & KMOD_SHIFT); /* Speedup when pressing tab, except when using ALT+TAB * to switch to another application. */ @@ -591,7 +589,7 @@ void VideoDriver_SDL_Base::InputLoop() (keys[SDL_SCANCODE_RIGHT] ? 4 : 0) | (keys[SDL_SCANCODE_DOWN] ? 8 : 0); - if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged(); + HandleModifierKeys(shift_pressed, ctrl_pressed); } void VideoDriver_SDL_Base::LoopOnce() diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 54819eb9e3..c54de0eecf 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -631,10 +631,8 @@ void VideoDriver_SDL::InputLoop() int numkeys; Uint8 *keys = SDL_GetKeyState(&numkeys); - bool old_ctrl_pressed = _ctrl_pressed; - - _ctrl_pressed = !!(mod & KMOD_CTRL); - _shift_pressed = !!(mod & KMOD_SHIFT); + bool ctrl_pressed = !!(mod & KMOD_CTRL); + bool shift_pressed = !!(mod & KMOD_SHIFT); /* Speedup when pressing tab, except when using ALT+TAB * to switch to another application. */ @@ -647,7 +645,7 @@ void VideoDriver_SDL::InputLoop() (keys[SDLK_RIGHT] ? 4 : 0) | (keys[SDLK_DOWN] ? 8 : 0); - if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged(); + HandleModifierKeys(shift_pressed, ctrl_pressed); } void VideoDriver_SDL::MainLoop() diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index a2710186a2..ab3bb1bed6 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -848,10 +848,8 @@ void VideoDriver_Win32Base::CheckPaletteAnim() void VideoDriver_Win32Base::InputLoop() { - bool old_ctrl_pressed = _ctrl_pressed; - - _ctrl_pressed = this->has_focus && GetAsyncKeyState(VK_CONTROL) < 0; - _shift_pressed = this->has_focus && GetAsyncKeyState(VK_SHIFT) < 0; + bool ctrl_pressed = this->has_focus && GetAsyncKeyState(VK_CONTROL) < 0; + bool shift_pressed = this->has_focus && GetAsyncKeyState(VK_SHIFT) < 0; /* Speedup when pressing tab, except when using ALT+TAB * to switch to another application. */ @@ -868,7 +866,7 @@ void VideoDriver_Win32Base::InputLoop() _dirkeys = 0; } - if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged(); + HandleModifierKeys(shift_pressed, ctrl_pressed); } bool VideoDriver_Win32Base::PollEvent() diff --git a/src/viewport.cpp b/src/viewport.cpp index 77e93cb2ff..3be3ae22be 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -2430,7 +2430,7 @@ bool HandleViewportClicked(const Viewport *vp, int x, int y) Debug(misc, 2, "Vehicle {} (index {}) at {}", v->unitnumber, v->index, fmt::ptr(v)); if (IsCompanyBuildableVehicleType(v)) { v = v->First(); - if (_ctrl_pressed && v->owner == _local_company) { + if (_fn_pressed && v->owner == _local_company) { StartStopVehicle(v, true); } else { ShowVehicleViewWindow(v); @@ -2572,7 +2572,7 @@ void TileHighlightData::Reset() */ bool TileHighlightData::IsDraggingDiagonal() { - return (this->place_mode & HT_DIAGONAL) != 0 && _ctrl_pressed && _left_button_down; + return (this->place_mode & HT_DIAGONAL) != 0 && _fn_pressed && _left_button_down; } /** diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 725f8f91d8..130cf8584a 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -101,7 +101,7 @@ public: { switch (widget) { case WID_W_CENTER_VIEW: // scroll to location - if (_ctrl_pressed) { + if (_fn_pressed) { ShowExtraViewportWindow(this->GetCenterTile()); } else { ScrollMainWindowToTile(this->GetCenterTile()); diff --git a/src/window.cpp b/src/window.cpp index a33c3c0177..1585a8451a 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -680,7 +680,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count) return; case WWT_DEFSIZEBOX: { - if (_ctrl_pressed) { + if (_fn_pressed) { w->window_desc->pref_width = w->width; w->window_desc->pref_height = w->height; } else { @@ -714,7 +714,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count) case WWT_STICKYBOX: w->flags ^= WF_STICKY; nw->SetDirty(w); - if (_ctrl_pressed) w->window_desc->pref_sticky = (w->flags & WF_STICKY) != 0; + if (_fn_pressed) w->window_desc->pref_sticky = (w->flags & WF_STICKY) != 0; return; default: @@ -2614,14 +2614,36 @@ void HandleKeypress(uint keycode, char32_t key) } /** - * State of CONTROL key has changed + * Handle the modifier key state changes. */ -void HandleCtrlChanged() +void HandleModifierKeys(bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { - /* Call the event, start with the uppermost window. */ - for (Window *w : Window::IterateFromFront()) { - if (w->OnCTRLStateChange() == ES_HANDLED) return; + bool old_fn_pressed = _fn_pressed; + bool old_remove_pressed = _remove_pressed; + + _shift_pressed = shift_pressed; + + /* Hardwire modifiers leaving remove inaccessible for now. */ + _fn_pressed = ctrl_pressed; + _remove_pressed = false; + _estimate_pressed = shift_pressed; + + if (old_fn_pressed != _fn_pressed) { + /* Call the event, start with the uppermost window. */ + for (Window *w : Window::IterateFromFront()) { + if (w->OnFnStateChange() == ES_HANDLED) return; + } } + + if (old_remove_pressed != _remove_pressed) { + /* Call the event, start with the uppermost window. */ + for (Window *w : Window::IterateFromFront()) { + if (w->OnRemoveStateChange() == ES_HANDLED) return; + } + } + + old_fn_pressed = _fn_pressed; + old_remove_pressed = _remove_pressed; } /** diff --git a/src/window_gui.h b/src/window_gui.h index d4171070cf..ac227a037c 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -647,12 +647,18 @@ public: virtual EventState OnHotkey(int hotkey); /** - * The state of the control key has changed + * The state of the function modifier key has changed * @return #ES_HANDLED if the change has been handled and no other * window should receive the event. */ - virtual EventState OnCTRLStateChange() { return ES_NOT_HANDLED; } + virtual EventState OnFnStateChange() { return ES_NOT_HANDLED; } + /** + * The state of the remove modifier key has changed + * @return #ES_HANDLED if the change has been handled and no other + * window should receive the event. + */ + virtual EventState OnRemoveStateChange() { return ES_NOT_HANDLED; } /** * A click with the left mouse button has been made on the window. From f0a594abcf33dd08f5d125789742c1f8fb55e3f2 Mon Sep 17 00:00:00 2001 From: dP Date: Tue, 6 Sep 2022 22:01:40 +0300 Subject: [PATCH 2/5] Add: Use Alt as a remove modifier key --- src/gfx_func.h | 2 +- src/video/allegro_v.cpp | 3 ++- src/video/cocoa/cocoa_v.mm | 3 ++- src/video/sdl2_v.cpp | 3 ++- src/video/sdl_v.cpp | 3 ++- src/video/win32_v.cpp | 3 ++- src/window.cpp | 4 ++-- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/gfx_func.h b/src/gfx_func.h index 96c58a517c..0e47f16ad8 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -73,7 +73,7 @@ extern Palette _cur_palette; ///< Current palette void HandleToolbarHotkey(int hotkey); void HandleKeypress(uint keycode, char32_t key); void HandleTextInput(const char *str, bool marked = false, const char *caret = nullptr, const char *insert_location = nullptr, const char *replacement_end = nullptr); -void HandleModifierKeys(bool shift_pressed, bool ctrl_pressed); +void HandleModifierKeys(bool shift_pressed, bool ctrl_pressed, bool alt_pressed); void HandleMouseEvents(); void UpdateWindows(); void ChangeGameSpeed(bool enable_fast_forward); diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp index 7ad6b01602..48aa8b80ed 100644 --- a/src/video/allegro_v.cpp +++ b/src/video/allegro_v.cpp @@ -463,6 +463,7 @@ void VideoDriver_Allegro::InputLoop() { bool ctrl_pressed = !!(key_shifts & KB_CTRL_FLAG); bool shift_pressed = !!(key_shifts & KB_SHIFT_FLAG); + bool alt_pressed = !!(key_shifts & KB_ALT_FLAG); /* Speedup when pressing tab, except when using ALT+TAB * to switch to another application. */ @@ -475,7 +476,7 @@ void VideoDriver_Allegro::InputLoop() (key[KEY_RIGHT] ? 4 : 0) | (key[KEY_DOWN] ? 8 : 0); - HandleModifierKeys(shift_pressed, ctrl_pressed); + HandleModifierKeys(shift_pressed, ctrl_pressed, alt_pressed); } void VideoDriver_Allegro::MainLoop() diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 33a6640f30..b4bd2875fb 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -474,10 +474,11 @@ void VideoDriver_Cocoa::InputLoop() bool ctrl_pressed = (cur_mods & ( _settings_client.gui.right_mouse_btn_emulation != RMBE_CONTROL ? NSEventModifierFlagControl : NSEventModifierFlagCommand)) != 0; bool shift_pressed = (cur_mods & NSEventModifierFlagShift) != 0; + bool alt_pressed = (cur_mods & NSEventModifierFlagOption) != 0; this->fast_forward_key_pressed = _tab_is_down; - HandleModifierKeys(shift_pressed, ctrl_pressed); + HandleModifierKeys(shift_pressed, ctrl_pressed, alt_pressed); } /** Main game loop. */ diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp index e53a345230..0efe939abf 100644 --- a/src/video/sdl2_v.cpp +++ b/src/video/sdl2_v.cpp @@ -577,6 +577,7 @@ void VideoDriver_SDL_Base::InputLoop() bool ctrl_pressed = !!(mod & KMOD_CTRL); bool shift_pressed = !!(mod & KMOD_SHIFT); + bool alt_pressed = !!(mod & KMOD_ALT); /* Speedup when pressing tab, except when using ALT+TAB * to switch to another application. */ @@ -589,7 +590,7 @@ void VideoDriver_SDL_Base::InputLoop() (keys[SDL_SCANCODE_RIGHT] ? 4 : 0) | (keys[SDL_SCANCODE_DOWN] ? 8 : 0); - HandleModifierKeys(shift_pressed, ctrl_pressed); + HandleModifierKeys(shift_pressed, ctrl_pressed, alt_pressed); } void VideoDriver_SDL_Base::LoopOnce() diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index c54de0eecf..14554a4634 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -633,6 +633,7 @@ void VideoDriver_SDL::InputLoop() bool ctrl_pressed = !!(mod & KMOD_CTRL); bool shift_pressed = !!(mod & KMOD_SHIFT); + bool alt_pressed = !!(mod & KMOD_ALT); /* Speedup when pressing tab, except when using ALT+TAB * to switch to another application. */ @@ -645,7 +646,7 @@ void VideoDriver_SDL::InputLoop() (keys[SDLK_RIGHT] ? 4 : 0) | (keys[SDLK_DOWN] ? 8 : 0); - HandleModifierKeys(shift_pressed, ctrl_pressed); + HandleModifierKeys(shift_pressed, ctrl_pressed, alt_pressed); } void VideoDriver_SDL::MainLoop() diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index ab3bb1bed6..be5a3c35c1 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -850,6 +850,7 @@ void VideoDriver_Win32Base::InputLoop() { bool ctrl_pressed = this->has_focus && GetAsyncKeyState(VK_CONTROL) < 0; bool shift_pressed = this->has_focus && GetAsyncKeyState(VK_SHIFT) < 0; + bool alt_pressed = this->has_focus && GetAsyncKeyState(VK_MENU) < 0; /* Speedup when pressing tab, except when using ALT+TAB * to switch to another application. */ @@ -866,7 +867,7 @@ void VideoDriver_Win32Base::InputLoop() _dirkeys = 0; } - HandleModifierKeys(shift_pressed, ctrl_pressed); + HandleModifierKeys(shift_pressed, ctrl_pressed, alt_pressed); } bool VideoDriver_Win32Base::PollEvent() diff --git a/src/window.cpp b/src/window.cpp index 1585a8451a..ae8315bf2c 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2623,9 +2623,9 @@ void HandleModifierKeys(bool shift_pressed, bool ctrl_pressed, bool alt_pressed) _shift_pressed = shift_pressed; - /* Hardwire modifiers leaving remove inaccessible for now. */ + /* Hardwire modifier keys. */ _fn_pressed = ctrl_pressed; - _remove_pressed = false; + _remove_pressed = alt_pressed; _estimate_pressed = shift_pressed; if (old_fn_pressed != _fn_pressed) { From 553fbe8f85877693498fa5719e02a498ff0614b9 Mon Sep 17 00:00:00 2001 From: dP Date: Tue, 6 Sep 2022 22:51:05 +0300 Subject: [PATCH 3/5] Add: Allow to configure modifier keys --- src/gfx_type.h | 7 +++++ src/lang/english.txt | 12 ++++++++ src/settings_gui.cpp | 3 ++ src/settings_table.cpp | 27 +++++++++++++++++ src/settings_type.h | 4 +++ src/table/settings/gui_settings.ini | 45 +++++++++++++++++++++++++++++ src/window.cpp | 26 ++++++++++++++--- 7 files changed, 120 insertions(+), 4 deletions(-) diff --git a/src/gfx_type.h b/src/gfx_type.h index fbedceb87c..5d28015ace 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -351,4 +351,11 @@ enum StringAlignment { }; DECLARE_ENUM_AS_BIT_SET(StringAlignment) +enum ModifierKey : byte { + None = 0, ///< No key configured + Shift = 1, ///< Shift key + Ctrl = 2, ///< Ctrl key + Alt = 3, ///< Alt key +}; + #endif /* GFX_TYPE_H */ diff --git a/src/lang/english.txt b/src/lang/english.txt index c6b6af7c2b..d04c47e989 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1766,6 +1766,18 @@ STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_VAL :{NUM}% normal g ###setting-zero-is-special STR_CONFIG_SETTING_FAST_FORWARD_SPEED_LIMIT_ZERO :No limit (as fast as your computer allows) +STR_CONFIG_SETTING_MODIFIER_FN :Function modifier key: {STRING2} +STR_CONFIG_SETTING_MODIFIER_FN_HELPTEXT :Modifier key for accessing additional functions. +STR_CONFIG_SETTING_MODIFIER_REMOVE :Remove modifier key: {STRING2} +STR_CONFIG_SETTING_MODIFIER_REMOVE_HELPTEXT :Modifier key for removal mode on building tools. +STR_CONFIG_SETTING_MODIFIER_ESTIMATE :Estimate modifier key: {STRING2} +STR_CONFIG_SETTING_MODIFIER_ESTIMATE_HELPTEXT :Modifier key for estimating action cost. +STR_CONFIG_SETTING_MODIFIER_NONE :None +STR_CONFIG_SETTING_MODIFIER_SHIFT :Shift +STR_CONFIG_SETTING_MODIFIER_CTRL :Ctrl +STR_CONFIG_SETTING_MODIFIER_ALT :Alt +STR_CONFIG_SETTING_MODIFIER_ALREADY_IN_USE :{WHITE}This modifier key is already in use. + STR_CONFIG_SETTING_SOUND_TICKER :News ticker: {STRING2} STR_CONFIG_SETTING_SOUND_TICKER_HELPTEXT :Play sound for summarised news messages diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index bfd59e43bb..8d51e24137 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -2041,6 +2041,9 @@ static SettingsContainer &GetSettingsTree() interface->Add(new SettingEntry("gui.timetable_arrival_departure")); interface->Add(new SettingEntry("gui.show_newgrf_name")); interface->Add(new SettingEntry("gui.show_cargo_in_vehicle_lists")); + viewports->Add(new SettingEntry("gui.fn_modifier")); + viewports->Add(new SettingEntry("gui.remove_modifier")); + viewports->Add(new SettingEntry("gui.estimate_modifier")); } SettingsPage *advisors = main->Add(new SettingsPage(STR_CONFIG_SETTING_ADVISORS)); diff --git a/src/settings_table.cpp b/src/settings_table.cpp index 224f9a1174..360210a556 100644 --- a/src/settings_table.cpp +++ b/src/settings_table.cpp @@ -483,6 +483,33 @@ static bool CheckMaxHeightLevel(int32_t &new_value) return true; } +static bool CheckModifier(int32_t new_value, ModifierKey other1, ModifierKey other2) +{ + ModifierKey key = (ModifierKey)new_value; + if (key == ModifierKey::None) return true; + if (other1 == key || other2 == key) { + ShowErrorMessage(STR_CONFIG_SETTING_MODIFIER_ALREADY_IN_USE, INVALID_STRING_ID, WL_ERROR); + return false; + } + + return true; +} + +static bool CheckFnModifier(int32_t &new_value) +{ + return CheckModifier(new_value, _settings_client.gui.remove_modifier, _settings_client.gui.estimate_modifier); +} + +static bool CheckRemoveModifier(int32_t &new_value) +{ + return CheckModifier(new_value, _settings_client.gui.fn_modifier, _settings_client.gui.estimate_modifier); +} + +static bool CheckEstimateModifier(int32_t &new_value) +{ + return CheckModifier(new_value, _settings_client.gui.fn_modifier, _settings_client.gui.remove_modifier); +} + static void StationCatchmentChanged(int32_t) { Station::RecomputeCatchmentForAll(); diff --git a/src/settings_type.h b/src/settings_type.h index e9c6a60038..22a6b9efd5 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -23,6 +23,7 @@ #include "rail_gui.h" #include "signal_type.h" #include "timetable.h" +#include "gfx_type.h" /* Used to validate sizes of "max" value in settings. */ const size_t MAX_SLE_UINT8 = UINT8_MAX; @@ -220,6 +221,9 @@ struct GUISettings { uint8_t newgrf_default_palette; ///< default palette to use for NewGRFs without action 14 palette information bool scale_bevels; ///< bevels are scaled with GUI scale. + ModifierKey fn_modifier; ///< function modifier key + ModifierKey remove_modifier; ///< remove modifier key + ModifierKey estimate_modifier; ///< estimate modifier key /** * Returns true when the user has sufficient privileges to edit newgrfs on a running game diff --git a/src/table/settings/gui_settings.ini b/src/table/settings/gui_settings.ini index 5cc1c3ecdb..5f82c64580 100644 --- a/src/table/settings/gui_settings.ini +++ b/src/table/settings/gui_settings.ini @@ -16,10 +16,14 @@ static void InvalidateCompanyLiveryWindow(int32_t new_value); static void InvalidateNewGRFChangeWindows(int32_t new_value); static void ZoomMinMaxChanged(int32_t new_value); static void SpriteZoomMinChanged(int32_t new_value); +static bool CheckFnModifier(int32_t &new_value); +static bool CheckRemoveModifier(int32_t &new_value); +static bool CheckEstimateModifier(int32_t &new_value); static constexpr std::initializer_list _osk_activation{"disabled", "double", "single", "immediately"}; static constexpr std::initializer_list _savegame_date{"long", "short", "iso"}; static constexpr std::initializer_list _right_click_close{"no", "yes", "except sticky"}; +static constexpr std::initializer_list _mod_keys{"none", "shift", "ctrl", "alt"}; static const SettingVariant _gui_settings_table[] = { [post-amble] @@ -903,3 +907,44 @@ post_cb = [](auto) { SetupWidgetDimensions(); ReInitAllWindows(true); } cat = SC_BASIC startup = true +[SDTC_OMANY] +var = gui.fn_modifier +type = SLE_UINT8 +flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN +full = _mod_keys +def = 2 +min = 0 +max = 3 +str = STR_CONFIG_SETTING_MODIFIER_FN +strhelp = STR_CONFIG_SETTING_MODIFIER_FN_HELPTEXT +strval = STR_CONFIG_SETTING_MODIFIER_NONE +pre_cb = CheckFnModifier +cat = SC_ADVANCED + +[SDTC_OMANY] +var = gui.remove_modifier +type = SLE_UINT8 +flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN +full = _mod_keys +def = 3 +min = 0 +max = 3 +str = STR_CONFIG_SETTING_MODIFIER_REMOVE +strhelp = STR_CONFIG_SETTING_MODIFIER_REMOVE_HELPTEXT +strval = STR_CONFIG_SETTING_MODIFIER_NONE +pre_cb = CheckRemoveModifier +cat = SC_ADVANCED + +[SDTC_OMANY] +var = gui.estimate_modifier +type = SLE_UINT8 +flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN +full = _mod_keys +def = 1 +min = 0 +max = 3 +str = STR_CONFIG_SETTING_MODIFIER_ESTIMATE +strhelp = STR_CONFIG_SETTING_MODIFIER_ESTIMATE_HELPTEXT +strval = STR_CONFIG_SETTING_MODIFIER_NONE +pre_cb = CheckEstimateModifier +cat = SC_ADVANCED diff --git a/src/window.cpp b/src/window.cpp index ae8315bf2c..40f59eadb7 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2613,6 +2613,25 @@ void HandleKeypress(uint keycode, char32_t key) HandleGlobalHotkeys(key, keycode); } +/** + * Select the right state for the requested modifier key. + */ +static bool SelectModifierKey(ModifierKey key, bool shift_pressed, bool ctrl_pressed, bool alt_pressed) +{ + switch (key) { + case ModifierKey::None: + return false; + case ModifierKey::Shift: + return shift_pressed; + case ModifierKey::Ctrl: + return ctrl_pressed; + case ModifierKey::Alt: + return alt_pressed; + default: + NOT_REACHED(); + } +} + /** * Handle the modifier key state changes. */ @@ -2623,10 +2642,9 @@ void HandleModifierKeys(bool shift_pressed, bool ctrl_pressed, bool alt_pressed) _shift_pressed = shift_pressed; - /* Hardwire modifier keys. */ - _fn_pressed = ctrl_pressed; - _remove_pressed = alt_pressed; - _estimate_pressed = shift_pressed; + _fn_pressed = SelectModifierKey(_settings_client.gui.fn_modifier, shift_pressed, ctrl_pressed, alt_pressed); + _remove_pressed = SelectModifierKey(_settings_client.gui.remove_modifier, shift_pressed, ctrl_pressed, alt_pressed); + _estimate_pressed = SelectModifierKey(_settings_client.gui.estimate_modifier, shift_pressed, ctrl_pressed, alt_pressed); if (old_fn_pressed != _fn_pressed) { /* Call the event, start with the uppermost window. */ From 9989c2cd43452b00250279c0f270a749a895c2c0 Mon Sep 17 00:00:00 2001 From: dP Date: Tue, 6 Sep 2022 23:44:11 +0300 Subject: [PATCH 4/5] Add: Allow to use remove modifier with more road and rail tools --- src/rail_gui.cpp | 68 +++++++++++++++++++++++------------------------- src/road_gui.cpp | 3 +-- 2 files changed, 34 insertions(+), 37 deletions(-) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index ad8a3613a1..891c294020 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -294,39 +294,6 @@ static void ToggleRailButton_Remove(Window *w) w->SetWidgetDirty(WID_RAT_REMOVE); _remove_button_clicked = w->IsWidgetLowered(WID_RAT_REMOVE); SetSelectionRed(_remove_button_clicked); -} - -/** - * Updates the Remove button because of remove modifer state change - * @param w window the button belongs to - * @return true iff the remove button was changed - */ -static bool RailToolbar_RemoveChanged(Window *w) -{ - if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return false; - - /* allow ctrl to switch remove mode only for these widgets */ - for (WidgetID i = WID_RAT_BUILD_NS; i <= WID_RAT_BUILD_STATION; i++) { - if ((i <= WID_RAT_AUTORAIL || i >= WID_RAT_BUILD_WAYPOINT) && w->IsWidgetLowered(i)) { - ToggleRailButton_Remove(w); - return true; - } - } - - return false; -} - - -/** - * The "remove"-button click proc of the build-rail toolbar. - * @param w Build-rail toolbar window - * @see BuildRailToolbarWindow::OnClick() - */ -static void BuildRailClick_Remove(Window *w) -{ - if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return; - ToggleRailButton_Remove(w); - if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); /* handle station builder */ if (w->IsWidgetLowered(WID_RAT_BUILD_STATION)) { @@ -351,6 +318,38 @@ static void BuildRailClick_Remove(Window *w) } } +/** + * Updates the Remove button because of remove modifer state change + * @param w window the button belongs to + * @return true iff the remove button was changed + */ +static bool RailToolbar_RemoveChanged(Window *w) +{ + if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return false; + + for (WidgetID i = WID_RAT_BUILD_NS; i <= WID_RAT_BUILD_SIGNALS; i++) { + if (w->IsWidgetLowered(i)) { + ToggleRailButton_Remove(w); + return true; + } + } + + return false; +} + + +/** + * The "remove"-button click proc of the build-rail toolbar. + * @param w Build-rail toolbar window + * @see BuildRailToolbarWindow::OnClick() + */ +static void BuildRailClick_Remove(Window *w) +{ + if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return; + ToggleRailButton_Remove(w); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); +} + static void DoRailroadTrack(Track track) { if (_remove_button_clicked) { @@ -788,8 +787,7 @@ struct BuildRailToolbarWindow : Window { EventState OnRemoveStateChange() override { - /* do not toggle Remove button by remove modifier when placing station */ - if (!this->IsWidgetLowered(WID_RAT_BUILD_STATION) && !this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT) && RailToolbar_RemoveChanged(this)) return ES_HANDLED; + if (RailToolbar_RemoveChanged(this)) return ES_HANDLED; return ES_NOT_HANDLED; } diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 220966f19e..f80b1672d1 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -293,8 +293,7 @@ static bool RoadToolbar_RemoveChanged(Window *w) { if (w->IsWidgetDisabled(WID_ROT_REMOVE)) return false; - /* allow ctrl to switch remove mode only for these widgets */ - for (WidgetID i = WID_ROT_ROAD_X; i <= WID_ROT_AUTOROAD; i++) { + for (WidgetID i = WID_ROT_ROAD_X; i <= WID_ROT_TRUCK_STATION; i++) { if (w->IsWidgetLowered(i)) { ToggleRoadButton_Remove(w); return true; From 7b9dee9474682f838c7c620e01daabe7535c14a4 Mon Sep 17 00:00:00 2001 From: dP Date: Tue, 20 Sep 2022 01:24:25 +0300 Subject: [PATCH 5/5] Add: String codes to show custom modifier keys --- src/lang/english.txt | 314 +++++++++++++++++++------------------- src/strings.cpp | 21 +++ src/table/control_codes.h | 5 + src/table/strgen_tables.h | 5 + 4 files changed, 192 insertions(+), 153 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index d04c47e989..9714aaef6f 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -284,13 +284,13 @@ STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Close wi STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Window title - drag this to move window STR_TOOLTIP_SHADE :{BLACK}Shade window - only show the title bar STR_TOOLTIP_DEBUG :{BLACK}Show NewGRF debug information -STR_TOOLTIP_DEFSIZE :{BLACK}Resize window to default size. Ctrl+Click to store current size as default -STR_TOOLTIP_STICKY :{BLACK}Mark this window as uncloseable by the 'Close All Windows' key. Ctrl+Click to also save state as default +STR_TOOLTIP_DEFSIZE :{BLACK}Resize window to default size. {FN_KEY}+Click to store current size as default +STR_TOOLTIP_STICKY :{BLACK}Mark this window as uncloseable by the 'Close All Windows' key. {FN_KEY}+Click to also save state as default STR_TOOLTIP_RESIZE :{BLACK}Click and drag to resize this window STR_TOOLTIP_TOGGLE_LARGE_SMALL_WINDOW :{BLACK}Toggle large/small window size STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST :{BLACK}Scroll bar - scrolls list up/down STR_TOOLTIP_HSCROLL_BAR_SCROLLS_LIST :{BLACK}Scroll bar - scrolls list left/right -STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC :{BLACK}Demolish buildings etc. on a square of land. Ctrl+Click+Drag to select the area diagonally. Also press Shift to show cost estimate only +STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC :{BLACK}Demolish buildings etc. on a square of land. {FN_KEY}+Click+Drag to select the area diagonally. Also press {ESTIMATE_KEY} to show cost estimate only # Show engines button ###length VEHICLE_TYPES @@ -315,6 +315,13 @@ STR_WARNING_PASSWORD_SECURITY :{YELLOW}Warning STR_OSK_KEYBOARD_LAYOUT :`1234567890-=\qwertyuiop[]asdfghjkl;' zxcvbnm,./ . STR_OSK_KEYBOARD_LAYOUT_CAPS :~!@#$%^&*()_+|QWERTYUIOP{{}}ASDFGHJKL:" ZXCVBNM<>? . +# Modifier key names, must follow order of ModifierKey enum +###length 4 +STR_MODIFIER_KEY_UNASSIGNED :{PUSH_COLOUR}{RED}Unassigned{POP_COLOUR} +STR_MODIFIER_KEY_SHIFT :Shift +STR_MODIFIER_KEY_CTRL :Ctrl +STR_MODIFIER_KEY_ALT :Alt + # Measurement tooltip STR_MEASURE_LENGTH :{BLACK}Length: {NUM} STR_MEASURE_AREA :{BLACK}Area: {NUM} x {NUM} @@ -395,10 +402,10 @@ STR_TOOLBAR_TOOLTIP_DISPLAY_GOALS_LIST :{BLACK}Open goa STR_TOOLBAR_TOOLTIP_DISPLAY_GRAPHS :{BLACK}Open company graphs and cargo payment rates STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_LEAGUE :{BLACK}Open company league table STR_TOOLBAR_TOOLTIP_FUND_CONSTRUCTION_OF_NEW :{BLACK}Open industry directory, industry chain, or fund construction of a new industry -STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_TRAINS :{BLACK}Open list of company's trains. Ctrl+Click to show or hide vehicle groups, opposite of the chosen setting -STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_ROAD_VEHICLES :{BLACK}Open list of company's road vehicles. Ctrl+Click to show or hide vehicle groups, opposite of the chosen setting -STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_SHIPS :{BLACK}Open list of company's ships. Ctrl+Click to show or hide vehicle groups, opposite of the chosen setting -STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_AIRCRAFT :{BLACK}Open list of company's aircraft. Ctrl+Click to show or hide vehicle groups, opposite of the chosen setting +STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_TRAINS :{BLACK}Open list of company's trains. {FN_KEY}+Click to show or hide vehicle groups, opposite of the chosen setting +STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_ROAD_VEHICLES :{BLACK}Open list of company's road vehicles. {FN_KEY}+Click to show or hide vehicle groups, opposite of the chosen setting +STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_SHIPS :{BLACK}Open list of company's ships. {FN_KEY}+Click to show or hide vehicle groups, opposite of the chosen setting +STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_AIRCRAFT :{BLACK}Open list of company's aircraft. {FN_KEY}+Click to show or hide vehicle groups, opposite of the chosen setting STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_IN :{BLACK}Zoom in STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_OUT :{BLACK}Zoom out STR_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Build railway infrastructure @@ -425,9 +432,9 @@ STR_SCENEDIT_TOOLBAR_TOWN_GENERATION :{BLACK}Build or STR_SCENEDIT_TOOLBAR_INDUSTRY_GENERATION :{BLACK}Build or generate industries STR_SCENEDIT_TOOLBAR_ROAD_CONSTRUCTION :{BLACK}Build road infrastructure STR_SCENEDIT_TOOLBAR_TRAM_CONSTRUCTION :{BLACK}Build tramway infrastructure -STR_SCENEDIT_TOOLBAR_PLANT_TREES :{BLACK}Plant trees. Ctrl+Click+Drag to select the area diagonally. Also press Shift to show cost estimate only +STR_SCENEDIT_TOOLBAR_PLANT_TREES :{BLACK}Plant trees. {FN_KEY}+Click+Drag to select the area diagonally. Also press {ESTIMATE_KEY} to show cost estimate only STR_SCENEDIT_TOOLBAR_PLACE_SIGN :{BLACK}Place sign -STR_SCENEDIT_TOOLBAR_PLACE_OBJECT :{BLACK}Place object. Ctrl+Click+Drag to select the area diagonally. Also press Shift to show cost estimate only +STR_SCENEDIT_TOOLBAR_PLACE_OBJECT :{BLACK}Place object. {FN_KEY}+Click+Drag to select the area diagonally. Also press {ESTIMATE_KEY} to show cost estimate only # Scenario editor file menu ###length 7 @@ -775,9 +782,9 @@ STR_SMALLMAP_TOOLTIP_SHOW_LINK_STATS_ON_MAP :{BLACK}Show car STR_SMALLMAP_TOOLTIP_SHOW_TRANSPORT_ROUTES_ON :{BLACK}Show transport routes on map STR_SMALLMAP_TOOLTIP_SHOW_VEGETATION_ON_MAP :{BLACK}Show vegetation on map STR_SMALLMAP_TOOLTIP_SHOW_LAND_OWNERS_ON_MAP :{BLACK}Show land owners on map -STR_SMALLMAP_TOOLTIP_INDUSTRY_SELECTION :{BLACK}Click on an industry type to toggle displaying it. Ctrl+Click disables all types except the selected one. Ctrl+Click on it again to enable all industry types -STR_SMALLMAP_TOOLTIP_COMPANY_SELECTION :{BLACK}Click on a company to toggle displaying its property. Ctrl+Click disables all companies except the selected one. Ctrl+Click on it again to enable all companies -STR_SMALLMAP_TOOLTIP_CARGO_SELECTION :{BLACK}Click on a cargo to toggle displaying its property. Ctrl+Click disables all cargoes except the selected one. Ctrl+Click on it again to enable all cargoes +STR_SMALLMAP_TOOLTIP_INDUSTRY_SELECTION :{BLACK}Click on an industry type to toggle displaying it. {FN_KEY}+Click disables all types except the selected one. {FN_KEY}+Click on it again to enable all industry types +STR_SMALLMAP_TOOLTIP_COMPANY_SELECTION :{BLACK}Click on a company to toggle displaying its property. {FN_KEY}+Click disables all companies except the selected one. {FN_KEY}+Click on it again to enable all companies +STR_SMALLMAP_TOOLTIP_CARGO_SELECTION :{BLACK}Click on a cargo to toggle displaying its property. {FN_KEY}+Click disables all cargoes except the selected one. {FN_KEY}+Click on it again to enable all cargoes STR_SMALLMAP_LEGENDA_ROADS :{TINY_FONT}{BLACK}Roads STR_SMALLMAP_LEGENDA_RAILROADS :{TINY_FONT}{BLACK}Railways @@ -1062,7 +1069,7 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Check th STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Current driver: {RAW_STRING} STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Interface size -STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Drag slider to set interface size. Ctrl+Drag for continuous adjustment +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Drag slider to set interface size. {FN_KEY}+Drag for continuous adjustment STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Auto-detect size STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Check this box to detect interface size automatically @@ -1375,7 +1382,7 @@ STR_CONFIG_SETTING_FORBID_90_DEG :Forbid trains f STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :90 degree turns occur when a horizontal track is directly followed by a vertical track piece on the adjacent tile, thus making the train turn by 90 degree when traversing the tile edge instead of the usual 45 degrees for other track combinations. STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Allow to join stations not directly adjacent: {STRING2} -STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Allow adding parts to a station without directly touching the existing parts, by Ctrl+Clicking while placing the new parts +STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Allow adding parts to a station without directly touching the existing parts, by {FN_KEY}+Clicking while placing the new parts STR_CONFIG_SETTING_INFLATION :Inflation: {STRING2} STR_CONFIG_SETTING_INFLATION_HELPTEXT :Enable inflation in the economy, where costs are slightly faster rising than payments @@ -1950,13 +1957,13 @@ STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY :When dragging, STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY_HELPTEXT :Set the distance at which signals will be built on a track up to the next obstacle (signal, junction), if signals are dragged STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY_VALUE :{COMMA} tile{P 0 "" s} STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE :When dragging, keep fixed distance between signals: {STRING2} -STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE_HELPTEXT :Select the behaviour of signal placement when Ctrl+dragging signals. If disabled, signals are placed around tunnels or bridges to avoid long stretches without signals. If enabled, signals are placed every n tiles, making alignment of signals at parallel tracks easier +STR_CONFIG_SETTING_DRAG_SIGNALS_FIXED_DISTANCE_HELPTEXT :Select the behaviour of signal placement when {FN_KEY}+dragging signals. If disabled, signals are placed around tunnels or bridges to avoid long stretches without signals. If enabled, signals are placed every n tiles, making alignment of signals at parallel tracks easier STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :Automatically build semaphores before: {STRING2} STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE_HELPTEXT :Set the year when electric signals will be used for tracks. Before this year, non-electric signals will be used (which have the exact same function, but different looks) STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES :Cycle through signal types: {STRING2} -STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Select which signal types to cycle through when Ctrl+Clicking on a built signal with the signal tool +STR_CONFIG_SETTING_CYCLE_SIGNAL_TYPES_HELPTEXT :Select which signal types to cycle through when {FN_KEY}+Clicking on a built signal with the signal tool ###length 2 STR_CONFIG_SETTING_CYCLE_SIGNAL_PBS :Path signals only STR_CONFIG_SETTING_CYCLE_SIGNAL_ALL :All visible @@ -2217,7 +2224,7 @@ STR_INTRO_AI_SETTINGS :{BLACK}AI Setti STR_INTRO_GAMESCRIPT_SETTINGS :{BLACK}Game Script Settings STR_INTRO_QUIT :{BLACK}Exit -STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Start a new game. Ctrl+Click skips map configuration +STR_INTRO_TOOLTIP_NEW_GAME :{BLACK}Start a new game. {FN_KEY}+Click skips map configuration STR_INTRO_TOOLTIP_LOAD_GAME :{BLACK}Load a saved game STR_INTRO_TOOLTIP_PLAY_HEIGHTMAP :{BLACK}Start a new game, using a heightmap as landscape STR_INTRO_TOOLTIP_PLAY_SCENARIO :{BLACK}Start a new game, using a customised scenario @@ -2292,9 +2299,9 @@ STR_LIVERY_TRAIN_GROUP_TOOLTIP :{BLACK}Show col STR_LIVERY_ROAD_VEHICLE_GROUP_TOOLTIP :{BLACK}Show colours of road vehicle groups STR_LIVERY_SHIP_GROUP_TOOLTIP :{BLACK}Show colours of ship groups STR_LIVERY_AIRCRAFT_GROUP_TOOLTIP :{BLACK}Show colours of aircraft groups -STR_LIVERY_PRIMARY_TOOLTIP :{BLACK}Choose the primary colour for the selected scheme. Ctrl+Click to set this colour for every scheme -STR_LIVERY_SECONDARY_TOOLTIP :{BLACK}Choose the secondary colour for the selected scheme. Ctrl+Click to set this colour for every scheme -STR_LIVERY_PANEL_TOOLTIP :{BLACK}Select a colour scheme to change, or multiple schemes with Ctrl+Click. Click on the box to toggle use of the scheme +STR_LIVERY_PRIMARY_TOOLTIP :{BLACK}Choose the primary colour for the selected scheme. {FN_KEY}+Click to set this colour for every scheme +STR_LIVERY_SECONDARY_TOOLTIP :{BLACK}Choose the secondary colour for the selected scheme. {FN_KEY}+Click to set this colour for every scheme +STR_LIVERY_PANEL_TOOLTIP :{BLACK}Select a colour scheme to change, or multiple schemes with {FN_KEY}+Click. Click on the box to toggle use of the scheme STR_LIVERY_TRAIN_GROUP_EMPTY :No train groups are set up STR_LIVERY_ROAD_VEHICLE_GROUP_EMPTY :No road vehicle groups are set up STR_LIVERY_SHIP_GROUP_EMPTY :No ship groups are set up @@ -2754,15 +2761,15 @@ STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}Exit Ope # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}Transparency Options -STR_TRANSPARENT_SIGNS_TOOLTIP :{BLACK}Toggle transparency for signs. Ctrl+Click to lock -STR_TRANSPARENT_TREES_TOOLTIP :{BLACK}Toggle transparency for trees. Ctrl+Click to lock -STR_TRANSPARENT_HOUSES_TOOLTIP :{BLACK}Toggle transparency for houses. Ctrl+Click to lock -STR_TRANSPARENT_INDUSTRIES_TOOLTIP :{BLACK}Toggle transparency for industries. Ctrl+Click to lock -STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}Toggle transparency for buildables like stations, depots and waypoints. Ctrl+Click to lock -STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Toggle transparency for bridges. Ctrl+Click to lock -STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}Toggle transparency for structures like lighthouses and antennas. Ctrl+Click to lock -STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Toggle transparency for catenary. Ctrl+Click to lock -STR_TRANSPARENT_TEXT_TOOLTIP :{BLACK}Toggle transparency for loading and cost/income text. Ctrl+Click to lock +STR_TRANSPARENT_SIGNS_TOOLTIP :{BLACK}Toggle transparency for signs. {FN_KEY}+Click to lock +STR_TRANSPARENT_TREES_TOOLTIP :{BLACK}Toggle transparency for trees. {FN_KEY}+Click to lock +STR_TRANSPARENT_HOUSES_TOOLTIP :{BLACK}Toggle transparency for houses. {FN_KEY}+Click to lock +STR_TRANSPARENT_INDUSTRIES_TOOLTIP :{BLACK}Toggle transparency for industries. {FN_KEY}+Click to lock +STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}Toggle transparency for buildables like stations, depots and waypoints. {FN_KEY}+Click to lock +STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Toggle transparency for bridges. {FN_KEY}+Click to lock +STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}Toggle transparency for structures like lighthouses and antennas. {FN_KEY}+Click to lock +STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Toggle transparency for catenary. {FN_KEY}+Click to lock +STR_TRANSPARENT_TEXT_TOOLTIP :{BLACK}Toggle transparency for loading and cost/income text. {FN_KEY}+Click to lock STR_TRANSPARENT_INVISIBLE_TOOLTIP :{BLACK}Set objects invisible instead of transparent # Linkgraph legend window @@ -2810,16 +2817,16 @@ STR_RAIL_TOOLBAR_ELRAIL_CONSTRUCTION_CAPTION :Electrified Rai STR_RAIL_TOOLBAR_MONORAIL_CONSTRUCTION_CAPTION :Monorail Construction STR_RAIL_TOOLBAR_MAGLEV_CONSTRUCTION_CAPTION :Maglev Construction -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Build railway track. Ctrl+Click to remove railway track. Also press Shift to show cost estimate only -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Build railway track using the Autorail mode. Ctrl+Click to remove railway track. Also press Shift to show cost estimate only -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Build train depot (for buying and servicing trains). Also press Shift to show cost estimate only -STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Build waypoint on railway. Ctrl+Click to select another waypoint to join. Also press Shift to show cost estimate only -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Build railway station. Ctrl+Click to select another station to join. Also press Shift to show cost estimate only -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Build signal on railway. Ctrl+Click to build the alternate signal style{}Click+Drag to fill the selected section of rail with signals at the chosen spacing. Ctrl+Click+Drag to fill signals up to the next junction, station, or signal. Also press Shift to show cost estimate only -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Build railway bridge. Also press Shift to show cost estimate only -STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Build railway tunnel. Also press Shift to show cost estimate only -STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Toggle build/remove for railway track, signals, waypoints and stations. Ctrl+Click to also remove the rail of waypoints and stations -STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL :{BLACK}Convert/Upgrade the type of rail. Also press Shift to show cost estimate only +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK :{BLACK}Build railway track. {FN_KEY}+Click to remove railway track. Also press {ESTIMATE_KEY} to show cost estimate only +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_AUTORAIL :{BLACK}Build railway track using the Autorail mode. {REMOVE_KEY}+Click to remove railway track. Also press {ESTIMATE_KEY} to show cost estimate only +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_TRAIN_DEPOT_FOR_BUILDING :{BLACK}Build train depot (for buying and servicing trains). Also press {ESTIMATE_KEY} to show cost estimate only +STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL_TO_WAYPOINT :{BLACK}Build waypoint on railway. {FN_KEY}+Click to select another waypoint to join. Also press {ESTIMATE_KEY} to show cost estimate only +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_STATION :{BLACK}Build railway station. {FN_KEY}+Click to select another station to join. Also press {ESTIMATE_KEY} to show cost estimate only +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_SIGNALS :{BLACK}Build signal on railway. {FN_KEY}+Click to build the alternate signal style{}Click+Drag to fill the selected section of rail with signals at the chosen spacing. {FN_KEY}+Click+Drag to fill signals up to the next junction, station, or signal. Also press {ESTIMATE_KEY} to show cost estimate only +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_BRIDGE :{BLACK}Build railway bridge. Also press {ESTIMATE_KEY} to show cost estimate only +STR_RAIL_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TUNNEL :{BLACK}Build railway tunnel. Also press {ESTIMATE_KEY} to show cost estimate only +STR_RAIL_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR :{BLACK}Toggle build/remove for railway track, signals, waypoints and stations. {REMOVE_KEY}+Click to also remove the rail of waypoints and stations +STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL :{BLACK}Convert/Upgrade the type of rail. Also press {ESTIMATE_KEY} to show cost estimate only STR_RAIL_NAME_RAILROAD :Railway STR_RAIL_NAME_ELRAIL :Electrified railway @@ -2869,7 +2876,7 @@ STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}Exit Sig STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}Combo Signal (electric){}The combo signal simply acts as both an entry and exit signal. This allows you to build large "trees" of pre-signals STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}Path Signal (electric){}A path signal allows more than one train to enter a signal block at the same time, if the train can reserve a path to a safe stopping point. Standard path signals can be passed from the back side STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}One-way Path Signal (electric){}A path signal allows more than one train to enter a signal block at the same time, if the train can reserve a path to a safe stopping point. One-way path signals can't be passed from the back side -STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Signal Convert{}Click an existing signal to convert it to the selected signal type and variant. Ctrl+Click to toggle the existing variant. Shift+Click shows estimated conversion cost +STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}Signal Convert{}Click an existing signal to convert it to the selected signal type and variant. {FN_KEY}+Click to toggle the existing variant. {ESTIMATE_KEY}+Click shows estimated conversion cost STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}Dragging signal distance STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}Decrease dragging signal distance STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}Increase dragging signal distance @@ -2895,25 +2902,25 @@ STR_BRIDGE_TUBULAR_SILICON :Tubular, Silico # Road construction toolbar STR_ROAD_TOOLBAR_ROAD_CONSTRUCTION_CAPTION :{WHITE}Road Construction STR_ROAD_TOOLBAR_TRAM_CONSTRUCTION_CAPTION :{WHITE}Tramway Construction -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_SECTION :{BLACK}Build road section. Ctrl+Click to remove road section. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_SECTION :{BLACK}Build tramway section. Ctrl+Click to remove tramway section. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOROAD :{BLACK}Build road section using the Autoroad mode. Ctrl+Click to remove road section. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOTRAM :{BLACK}Build tramway section using the Autotram mode. Ctrl+Click to remove tramway section. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Build road vehicle depot (for buying and servicing vehicles). Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Build tram vehicle depot (for buying and servicing vehicles). Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Build bus station. Ctrl+Click to select another station to join. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Build passenger tram station. Ctrl+Click to select another station to join. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Build lorry station. Ctrl+Click to select another station to join. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Build freight tram station. Ctrl+Click to select another station to join. Also press Shift to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_SECTION :{BLACK}Build road section. {REMOVE_KEY}+Click to remove road section. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_SECTION :{BLACK}Build tramway section. {REMOVE_KEY}+Click to remove tramway section. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOROAD :{BLACK}Build road section using the Autoroad mode. {REMOVE_KEY}+Click to remove road section. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_AUTOTRAM :{BLACK}Build tramway section using the Autotram mode. {REMOVE_KEY}+Click to remove tramway section. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_VEHICLE_DEPOT :{BLACK}Build road vehicle depot (for buying and servicing vehicles). Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAM_VEHICLE_DEPOT :{BLACK}Build tram vehicle depot (for buying and servicing vehicles). Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_BUS_STATION :{BLACK}Build bus station. {FN_KEY}+Click to select another station to join. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_PASSENGER_TRAM_STATION :{BLACK}Build passenger tram station. {FN_KEY}+Click to select another station to join. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRUCK_LOADING_BAY :{BLACK}Build lorry station. {FN_KEY}+Click to select another station to join. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_CARGO_TRAM_STATION :{BLACK}Build freight tram station. {FN_KEY}+Click to select another station to join. Also press {ESTIMATE_KEY} to show cost estimate only STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_ONE_WAY_ROAD :{BLACK}Activate/Deactivate one way roads -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Build road bridge. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_BRIDGE :{BLACK}Build tramway bridge. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_TUNNEL :{BLACK}Build road tunnel. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_TUNNEL :{BLACK}Build tramway tunnel. Also press Shift to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_BRIDGE :{BLACK}Build road bridge. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_BRIDGE :{BLACK}Build tramway bridge. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_ROAD_TUNNEL :{BLACK}Build road tunnel. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_TUNNEL :{BLACK}Build tramway tunnel. Also press {ESTIMATE_KEY} to show cost estimate only STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_ROAD :{BLACK}Toggle build/remove for road construction STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS :{BLACK}Toggle build/remove for tramway construction -STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD :{BLACK}Convert/Upgrade the type of road. Also press Shift to show cost estimate only -STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_TRAM :{BLACK}Convert/Upgrade the type of tram. Also press Shift to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD :{BLACK}Convert/Upgrade the type of road. Also press {ESTIMATE_KEY} to show cost estimate only +STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_TRAM :{BLACK}Convert/Upgrade the type of tram. Also press {ESTIMATE_KEY} to show cost estimate only STR_ROAD_NAME_ROAD :Road STR_ROAD_NAME_TRAM :Tramway @@ -2937,14 +2944,14 @@ STR_STATION_BUILD_CARGO_TRAM_ORIENTATION_TOOLTIP :{BLACK}Select f # Waterways toolbar (last two for SE only) STR_WATERWAYS_TOOLBAR_CAPTION :{WHITE}Waterways Construction STR_WATERWAYS_TOOLBAR_CAPTION_SE :{WHITE}Waterways -STR_WATERWAYS_TOOLBAR_BUILD_CANALS_TOOLTIP :{BLACK}Build canals. Also press Shift to show cost estimate only -STR_WATERWAYS_TOOLBAR_BUILD_LOCKS_TOOLTIP :{BLACK}Build locks. Also press Shift to show cost estimate only -STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP :{BLACK}Build ship depot (for buying and servicing ships). Also press Shift to show cost estimate only -STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Build ship dock. Ctrl+Click to select another station to join. Also press Shift to show cost estimate only -STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Place a buoy which can be used as a waypoint. Also press Shift to show cost estimate only -STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Build aqueduct. Also press Shift to show cost estimate only -STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Build canal. Ctrl+Click at sea level to flood with sea water instead -STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Place rivers. Ctrl+Click to select diagonally +STR_WATERWAYS_TOOLBAR_BUILD_CANALS_TOOLTIP :{BLACK}Build canals. Also press {ESTIMATE_KEY} to show cost estimate only +STR_WATERWAYS_TOOLBAR_BUILD_LOCKS_TOOLTIP :{BLACK}Build locks. Also press {ESTIMATE_KEY} to show cost estimate only +STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP :{BLACK}Build ship depot (for buying and servicing ships). Also press {ESTIMATE_KEY} to show cost estimate only +STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP :{BLACK}Build ship dock. {FN_KEY}+Click to select another station to join. Also press {ESTIMATE_KEY} to show cost estimate only +STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP :{BLACK}Place a buoy which can be used as a waypoint. Also press {ESTIMATE_KEY} to show cost estimate only +STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP :{BLACK}Build aqueduct. Also press {ESTIMATE_KEY} to show cost estimate only +STR_WATERWAYS_TOOLBAR_CREATE_LAKE_TOOLTIP :{BLACK}Build canal. {FN_KEY}+Click at sea level to flood with sea water instead +STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP :{BLACK}Place rivers. {FN_KEY}+Click to select diagonally # Ship depot construction window STR_DEPOT_BUILD_SHIP_CAPTION :{WHITE}Ship Depot Orientation @@ -2955,7 +2962,7 @@ STR_STATION_BUILD_DOCK_CAPTION :{WHITE}Dock # Airport toolbar STR_TOOLBAR_AIRCRAFT_CAPTION :{WHITE}Airports -STR_TOOLBAR_AIRCRAFT_BUILD_AIRPORT_TOOLTIP :{BLACK}Build airport. Ctrl+Click to select another station to join. Also press Shift to show cost estimate only +STR_TOOLBAR_AIRCRAFT_BUILD_AIRPORT_TOOLTIP :{BLACK}Build airport. {FN_KEY}+Click to select another station to join. Also press {ESTIMATE_KEY} to show cost estimate only # Airport construction window STR_STATION_BUILD_AIRPORT_CAPTION :{WHITE}Airport Selection @@ -2982,14 +2989,14 @@ STR_STATION_BUILD_NOISE :{BLACK}Noise ge # Landscaping toolbar STR_LANDSCAPING_TOOLBAR :{WHITE}Landscaping -STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND :{BLACK}Lower a corner of land. Click+Drag to lower the first selected corner and level the selected area to the new corner height. Ctrl+Click+Drag to select the area diagonally. Also press Shift to show cost estimate only -STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND :{BLACK}Raise a corner of land. Click+Drag to raise the first selected corner and level the selected area to the new corner height. Ctrl+Click+Drag to select the area diagonally. Also press Shift to show cost estimate only -STR_LANDSCAPING_LEVEL_LAND_TOOLTIP :{BLACK}Level an area of land to the height of the first selected corner. Ctrl+Click+Drag to select the area diagonally. Also press Shift to show cost estimate only -STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND :{BLACK}Purchase land for future use. Ctrl+Click+Drag to select the area diagonally. Also press Shift to show cost estimate only +STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND :{BLACK}Lower a corner of land. {FN_KEY}+Drag to lower the first selected corner and level the selected area to the new corner height. {FN_KEY}+Click+Drag to select the area diagonally. Also press {ESTIMATE_KEY} to show cost estimate only +STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND :{BLACK}Raise a corner of land. {FN_KEY}+Drag to raise the first selected corner and level the selected area to the new corner height. {FN_KEY}+Click+Drag to select the area diagonally. Also press {ESTIMATE_KEY} to show cost estimate only +STR_LANDSCAPING_LEVEL_LAND_TOOLTIP :{BLACK}Level an area of land to the height of the first selected corner. Ctrl+Click+Drag to select the area diagonally. Also press {ESTIMATE_KEY} to show cost estimate only +STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND :{BLACK}Purchase land for future use. {FN_KEY}+Click+Drag to select the area diagonally. Also press {ESTIMATE_KEY} to show cost estimate only # Object construction window STR_OBJECT_BUILD_CAPTION :{WHITE}Object Selection -STR_OBJECT_BUILD_TOOLTIP :{BLACK}Select object to build. Ctrl+Click+Drag to select the area diagonally. Also press Shift to show cost estimate only +STR_OBJECT_BUILD_TOOLTIP :{BLACK}Select object to build. {FN_KEY}+Click+Drag to select the area diagonally. Also press {ESTIMATE_KEY} to show cost estimate only STR_OBJECT_BUILD_CLASS_TOOLTIP :{BLACK}Select class of the object to build STR_OBJECT_BUILD_PREVIEW_TOOLTIP :{BLACK}Preview of the object STR_OBJECT_BUILD_SIZE :{BLACK}Size: {GOLD}{NUM} x {NUM} tiles @@ -3001,7 +3008,7 @@ STR_OBJECT_CLASS_TRNS :Transmitters STR_PLANT_TREE_CAPTION :{WHITE}Trees STR_PLANT_TREE_TOOLTIP :{BLACK}Select tree type to plant. If the tile already has a tree, this will add more trees of mixed types independent of the selected type STR_TREES_RANDOM_TYPE :{BLACK}Trees of random type -STR_TREES_RANDOM_TYPE_TOOLTIP :{BLACK}Place trees of random type. Ctrl+Click+Drag to select the area diagonally. Also press Shift to show cost estimate only +STR_TREES_RANDOM_TYPE_TOOLTIP :{BLACK}Place trees of random type. {FN_KEY}+Click+Drag to select the area diagonally. Also press {ESTIMATE_KEY} to show cost estimate only STR_TREES_RANDOM_TREES_BUTTON :{BLACK}Random Trees STR_TREES_RANDOM_TREES_TOOLTIP :{BLACK}Plant trees randomly throughout the landscape STR_TREES_MODE_NORMAL_BUTTON :{BLACK}Normal @@ -3014,7 +3021,7 @@ STR_TREES_MODE_FOREST_LG_TOOLTIP :{BLACK}Plant la # Land generation window (SE) STR_TERRAFORM_TOOLBAR_LAND_GENERATION_CAPTION :{WHITE}Land Generation STR_TERRAFORM_TOOLTIP_PLACE_ROCKY_AREAS_ON_LANDSCAPE :{BLACK}Place rocky areas on landscape -STR_TERRAFORM_TOOLTIP_DEFINE_DESERT_AREA :{BLACK}Define desert area.{}Ctrl+Click to remove desert area +STR_TERRAFORM_TOOLTIP_DEFINE_DESERT_AREA :{BLACK}Define desert area.{}{FN_KEY}+Click to remove desert area STR_TERRAFORM_TOOLTIP_INCREASE_SIZE_OF_LAND_AREA :{BLACK}Increase area of land to lower/raise STR_TERRAFORM_TOOLTIP_DECREASE_SIZE_OF_LAND_AREA :{BLACK}Decrease area of land to lower/raise STR_TERRAFORM_TOOLTIP_GENERATE_RANDOM_LAND :{BLACK}Generate random land @@ -3028,7 +3035,7 @@ STR_RESET_LANDSCAPE_CONFIRMATION_TEXT :{WHITE}Are you # Town generation window (SE) STR_FOUND_TOWN_CAPTION :{WHITE}Town Generation STR_FOUND_TOWN_NEW_TOWN_BUTTON :{BLACK}New Town -STR_FOUND_TOWN_NEW_TOWN_TOOLTIP :{BLACK}Found new town. Also press Shift to show cost estimate only +STR_FOUND_TOWN_NEW_TOWN_TOOLTIP :{BLACK}Found new town. Also press {ESTIMATE_KEY} to show cost estimate only STR_FOUND_TOWN_RANDOM_TOWN_BUTTON :{BLACK}Random Town STR_FOUND_TOWN_RANDOM_TOWN_TOOLTIP :{BLACK}Found town in random location STR_FOUND_TOWN_MANY_RANDOM_TOWNS :{BLACK}Many random towns @@ -3094,7 +3101,7 @@ STR_INDUSTRY_CARGOES_SELECT_INDUSTRY_TOOLTIP :{BLACK}Select t # Land area window STR_LAND_AREA_INFORMATION_CAPTION :{WHITE}Land Area Information -STR_LAND_AREA_INFORMATION_LOCATION_TOOLTIP :{BLACK}Centre the main view on tile location. Ctrl+Click to open a new viewport on tile location +STR_LAND_AREA_INFORMATION_LOCATION_TOOLTIP :{BLACK}Centre the main view on tile location. {FN_KEY}+Click to open a new viewport on tile location STR_LAND_AREA_INFORMATION_COST_TO_CLEAR_N_A :{BLACK}Cost to clear: {LTBLUE}N/A STR_LAND_AREA_INFORMATION_COST_TO_CLEAR :{BLACK}Cost to clear: {RED}{CURRENCY_LONG} STR_LAND_AREA_INFORMATION_REVENUE_WHEN_CLEARED :{BLACK}Revenue when cleared: {LTBLUE}{CURRENCY_LONG} @@ -3519,7 +3526,7 @@ STR_SPRITE_ALIGNER_GOTO_TOOLTIP :{BLACK}Go to th STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Previous sprite STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Proceed to the previous normal sprite, skipping any pseudo/recolour/font sprites and wrapping around from the first sprite to the last STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Representation of the currently selected sprite. The alignment is ignored when drawing this sprite -STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Move the sprite around, changing the X and Y offsets. Ctrl+Click to move the sprite eight units at a time +STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Move the sprite around, changing the X and Y offsets. {FN_KEY}+Click to move the sprite eight units at a time ###length 2 STR_SPRITE_ALIGNER_CENTRE_OFFSET :{BLACK}Offset centred @@ -3621,7 +3628,7 @@ STR_SIGN_LIST_MATCH_CASE_TOOLTIP :{BLACK}Toggle m # Sign window STR_EDIT_SIGN_CAPTION :{WHITE}Edit sign text -STR_EDIT_SIGN_LOCATION_TOOLTIP :{BLACK}Centre the main view on sign location. Ctrl+Click to open a new viewport on sign location +STR_EDIT_SIGN_LOCATION_TOOLTIP :{BLACK}Centre the main view on sign location. {FN_KEY}+Click to open a new viewport on sign location STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP :{BLACK}Go to next sign STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP :{BLACK}Go to previous sign @@ -3632,7 +3639,7 @@ STR_TOWN_DIRECTORY_CAPTION :{WHITE}Towns STR_TOWN_DIRECTORY_NONE :{ORANGE}- None - STR_TOWN_DIRECTORY_TOWN :{ORANGE}{TOWN}{BLACK} ({COMMA}) STR_TOWN_DIRECTORY_CITY :{ORANGE}{TOWN}{YELLOW} (City){BLACK} ({COMMA}) -STR_TOWN_DIRECTORY_LIST_TOOLTIP :{BLACK}Town names - click on name to centre main view on town. Ctrl+Click to open a new viewport on town location +STR_TOWN_DIRECTORY_LIST_TOOLTIP :{BLACK}Town names - click on name to centre main view on town. {FN_KEY}+Click to open a new viewport on town location STR_TOWN_POPULATION :{BLACK}World population: {COMMA} # Town view window @@ -3651,7 +3658,7 @@ STR_TOWN_VIEW_TOWN_GROWS_EVERY :{BLACK}Town gro STR_TOWN_VIEW_TOWN_GROWS_EVERY_FUNDED :{BLACK}Town grows every {ORANGE}{UNITS_DAYS_OR_SECONDS} (funded) STR_TOWN_VIEW_TOWN_GROW_STOPPED :{BLACK}Town is {RED}not{BLACK} growing STR_TOWN_VIEW_NOISE_IN_TOWN :{BLACK}Noise limit in town: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA} -STR_TOWN_VIEW_CENTER_TOOLTIP :{BLACK}Centre the main view on town location. Ctrl+Click to open a new viewport on town location +STR_TOWN_VIEW_CENTER_TOOLTIP :{BLACK}Centre the main view on town location. {FN_KEY}+Click to open a new viewport on town location STR_TOWN_VIEW_LOCAL_AUTHORITY_BUTTON :{BLACK}Local Authority STR_TOWN_VIEW_LOCAL_AUTHORITY_TOOLTIP :{BLACK}Show information on local authority STR_TOWN_VIEW_RENAME_TOOLTIP :{BLACK}Change town name @@ -3708,7 +3715,7 @@ STR_GOALS_TEXT :{ORANGE}{RAW_ST STR_GOALS_NONE :{ORANGE}- None - STR_GOALS_PROGRESS :{ORANGE}{RAW_STRING} STR_GOALS_PROGRESS_COMPLETE :{GREEN}{RAW_STRING} -STR_GOALS_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Click on goal to centre main view on industry/town/tile. Ctrl+Click to open a new viewport on industry/town/tile location +STR_GOALS_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Click on goal to centre main view on industry/town/tile. {FN_KEY}+Click to open a new viewport on industry/town/tile location # Goal question window STR_GOAL_QUESTION_CAPTION_QUESTION :{BLACK}Question @@ -3744,7 +3751,7 @@ STR_SUBSIDIES_OFFERED_FROM_TO :{ORANGE}{STRING STR_SUBSIDIES_NONE :{ORANGE}- None - STR_SUBSIDIES_SUBSIDISED_TITLE :{BLACK}Services already subsidised: STR_SUBSIDIES_SUBSIDISED_FROM_TO :{ORANGE}{STRING} from {STRING2} to {STRING2}{YELLOW} ({COMPANY}{YELLOW}, {STRING1}) -STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Click on service to centre main view on industry/town. Ctrl+Click to open a new viewport on industry/town location +STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Click on service to centre main view on industry/town. {FN_KEY}+Click to open a new viewport on industry/town location STR_SUBSIDIES_OFFERED_EXPIRY_DATE :by {DATE_SHORT} STR_SUBSIDIES_OFFERED_EXPIRY_TIME :within {UNITS_MONTHS_OR_MINUTES} STR_SUBSIDIES_SUBSIDISED_EXPIRY_DATE :until {DATE_SHORT} @@ -3764,8 +3771,8 @@ STR_STORY_BOOK_NEXT_PAGE_TOOLTIP :{BLACK}Go to ne STR_STORY_BOOK_INVALID_GOAL_REF :{RED}Invalid goal reference # Station list window -STR_STATION_LIST_TOOLTIP :{BLACK}Station names - click on name to centre main view on station. Ctrl+Click to open a new viewport on station location -STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE :{BLACK}Ctrl+Click to select multiple items +STR_STATION_LIST_TOOLTIP :{BLACK}Station names - click on name to centre main view on station. {FN_KEY}+Click to open a new viewport on station location +STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE :{BLACK}{FN_KEY}+Click to select multiple items STR_STATION_LIST_CAPTION :{WHITE}{COMPANY} - {COMMA} Station{P "" s} STR_STATION_LIST_STATION :{YELLOW}{STATION} {STATION_FEATURES} STR_STATION_LIST_WAYPOINT :{YELLOW}{WAYPOINT} @@ -3825,7 +3832,7 @@ STR_CARGO_RATING_VERY_GOOD :Very Good STR_CARGO_RATING_EXCELLENT :Excellent STR_CARGO_RATING_OUTSTANDING :Outstanding -STR_STATION_VIEW_CENTER_TOOLTIP :{BLACK}Centre main view on station location. Ctrl+Click to open a new viewport on station location +STR_STATION_VIEW_CENTER_TOOLTIP :{BLACK}Centre main view on station location. {FN_KEY}+Click to open a new viewport on station location STR_STATION_VIEW_RENAME_TOOLTIP :{BLACK}Change name of station STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP :{BLACK}Show all trains which have this station on their schedule @@ -3840,9 +3847,9 @@ STR_STATION_VIEW_CLOSE_AIRPORT_TOOLTIP :{BLACK}Prevent # Waypoint/buoy view window STR_WAYPOINT_VIEW_CAPTION :{WHITE}{WAYPOINT} -STR_WAYPOINT_VIEW_CENTER_TOOLTIP :{BLACK}Centre main view on waypoint location. Ctrl+Click to open a new viewport on waypoint location +STR_WAYPOINT_VIEW_CENTER_TOOLTIP :{BLACK}Centre main view on waypoint location. {FN_KEY}+Click to open a new viewport on waypoint location STR_WAYPOINT_VIEW_CHANGE_WAYPOINT_NAME :{BLACK}Change waypoint name -STR_BUOY_VIEW_CENTER_TOOLTIP :{BLACK}Centre main view on buoy location. Ctrl+Click to open a new viewport on buoy location +STR_BUOY_VIEW_CENTER_TOOLTIP :{BLACK}Centre main view on buoy location. {FN_KEY}+Click to open a new viewport on buoy location STR_BUOY_VIEW_CHANGE_BUOY_NAME :{BLACK}Change buoy name STR_EDIT_WAYPOINT_NAME :{WHITE}Edit waypoint name @@ -3887,9 +3894,10 @@ STR_FINANCES_MAX_LOAN :{WHITE}Maximum STR_FINANCES_TOTAL_CURRENCY :{BLACK}{CURRENCY_LONG} STR_FINANCES_BANK_BALANCE :{WHITE}{CURRENCY_LONG} STR_FINANCES_BORROW_BUTTON :{BLACK}Borrow {CURRENCY_LONG} -STR_FINANCES_BORROW_TOOLTIP :{BLACK}Increase size of loan. Ctrl+Click to borrow as much as possible +STR_FINANCES_BORROW_TOOLTIP :{BLACK}Increase size of loan. {FN_KEY}+Click to borrow as much as possible STR_FINANCES_REPAY_BUTTON :{BLACK}Repay {CURRENCY_LONG} -STR_FINANCES_REPAY_TOOLTIP :{BLACK}Repay part of loan. Ctrl+Click to repay as much loan as possible +STR_FINANCES_REPAY_TOOLTIP :{BLACK}Repay part of loan. {FN_KEY}+Click to repay as much loan as possible + STR_FINANCES_INFRASTRUCTURE_BUTTON :{BLACK}Infrastructure # Company view @@ -3918,7 +3926,7 @@ STR_COMPANY_VIEW_BUILD_HQ_TOOLTIP :{BLACK}Build co STR_COMPANY_VIEW_VIEW_HQ_BUTTON :{BLACK}View HQ STR_COMPANY_VIEW_VIEW_HQ_TOOLTIP :{BLACK}View company headquarters STR_COMPANY_VIEW_RELOCATE_HQ :{BLACK}Relocate HQ -STR_COMPANY_VIEW_RELOCATE_COMPANY_HEADQUARTERS :{BLACK}Rebuild company headquarters elsewhere for 1% cost of company value. Also press Shift to show cost estimate only +STR_COMPANY_VIEW_RELOCATE_COMPANY_HEADQUARTERS :{BLACK}Rebuild company headquarters elsewhere for 1% cost of company value. Also press {ESTIMATE_KEY} to show cost estimate only STR_COMPANY_VIEW_INFRASTRUCTURE_BUTTON :{BLACK}Details STR_COMPANY_VIEW_INFRASTRUCTURE_TOOLTIP :{BLACK}View detailed infrastructure counts STR_COMPANY_VIEW_GIVE_MONEY_BUTTON :{BLACK}Give money @@ -3965,7 +3973,7 @@ STR_INDUSTRY_DIRECTORY_ITEM_PROD1 :{ORANGE}{INDUST STR_INDUSTRY_DIRECTORY_ITEM_PROD2 :{ORANGE}{INDUSTRY} {STRING4}, {STRING4} STR_INDUSTRY_DIRECTORY_ITEM_PROD3 :{ORANGE}{INDUSTRY} {STRING4}, {STRING4}, {STRING4} STR_INDUSTRY_DIRECTORY_ITEM_PRODMORE :{ORANGE}{INDUSTRY} {STRING4}, {STRING4}, {STRING4} and {NUM} more... -STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Industry names - click on name to centre main view on industry. Ctrl+Click to open a new viewport on industry location +STR_INDUSTRY_DIRECTORY_LIST_CAPTION :{BLACK}Industry names - click on name to centre main view on industry. {FN_KEY}+Click to open a new viewport on industry location STR_INDUSTRY_DIRECTORY_ACCEPTED_CARGO_FILTER :{BLACK}Accepted cargo: {SILVER}{STRING} STR_INDUSTRY_DIRECTORY_PRODUCED_CARGO_FILTER :{BLACK}Produced cargo: {SILVER}{STRING} STR_INDUSTRY_DIRECTORY_FILTER_ALL_TYPES :All cargo types @@ -3976,7 +3984,7 @@ STR_INDUSTRY_VIEW_CAPTION :{WHITE}{INDUSTR STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Production last month: STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Production last minute: STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{RAW_STRING}{BLACK} ({COMMA}% transported) -STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centre the main view on industry location. Ctrl+Click to open a new viewport on industry location +STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centre the main view on industry location. {FN_KEY}+Click to open a new viewport on industry location STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Production level: {YELLOW}{COMMA}% STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}The industry has announced imminent closure! @@ -4051,7 +4059,7 @@ STR_GROUP_CREATE_TOOLTIP :{BLACK}Click to STR_GROUP_DELETE_TOOLTIP :{BLACK}Delete the selected group STR_GROUP_RENAME_TOOLTIP :{BLACK}Rename the selected group STR_GROUP_LIVERY_TOOLTIP :{BLACK}Change livery of the selected group -STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Click to protect this group from global autoreplace. Ctrl+Click to also protect sub-groups. +STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Click to protect this group from global autoreplace. {FN_KEY}+Click to also protect sub-groups. STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Delete Group STR_GROUP_DELETE_QUERY_TEXT :{WHITE}Are you sure you want to delete this group and any descendants? @@ -4119,10 +4127,10 @@ STR_CARGO_TYPE_FILTER_FREIGHT :Freight STR_CARGO_TYPE_FILTER_NONE :None ###length VEHICLE_TYPES -STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Train vehicle selection list. Click on vehicle for information. Ctrl+Click to show/hide this vehicle type -STR_BUY_VEHICLE_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Road vehicle selection list. Click on vehicle for information. Ctrl+Click to show/hide this vehicle type -STR_BUY_VEHICLE_SHIP_LIST_TOOLTIP :{BLACK}Ship selection list. Click on ship for information. Ctrl+Click to show/hide this ship type -STR_BUY_VEHICLE_AIRCRAFT_LIST_TOOLTIP :{BLACK}Aircraft selection list. Click on aircraft for information. Ctrl+Click to show/hide this aircraft type +STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP :{BLACK}Train vehicle selection list. Click on vehicle for information. {FN_KEY}+Click to show/hide this vehicle type +STR_BUY_VEHICLE_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Road vehicle selection list. Click on vehicle for information. {FN_KEY}+Click to show/hide this vehicle type +STR_BUY_VEHICLE_SHIP_LIST_TOOLTIP :{BLACK}Ship selection list. Click on ship for information. {FN_KEY}+Click to show/hide this ship type +STR_BUY_VEHICLE_AIRCRAFT_LIST_TOOLTIP :{BLACK}Aircraft selection list. Click on aircraft for information. {FN_KEY}+Click to show/hide this aircraft type ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_BUTTON :{BLACK}Buy Vehicle @@ -4137,16 +4145,16 @@ STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Buy and STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Buy and Refit Aircraft ###length VEHICLE_TYPES -STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted train vehicle. Also press Shift to show cost estimate only -STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted road vehicle. Also press Shift to show cost estimate only -STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted ship. Also press Shift to show cost estimate only -STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted aircraft. Also press Shift to show cost estimate only +STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted train vehicle. Also press {ESTIMATE_KEY} to show cost estimate only +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted road vehicle. Also press {ESTIMATE_KEY} to show cost estimate only +STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted ship. Also press {ESTIMATE_KEY} to show cost estimate only +STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_TOOLTIP :{BLACK}Buy the highlighted aircraft. Also press {ESTIMATE_KEY} to show cost estimate only ###length VEHICLE_TYPES -STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted train vehicle. Also press Shift to show cost estimate only -STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted road vehicle. Also press Shift to show cost estimate only -STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted ship. Also press Shift to show cost estimate only -STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted aircraft. Also press Shift to show cost estimate only +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted train vehicle. Also press {ESTIMATE_KEY} to show cost estimate only +STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted road vehicle. Also press {ESTIMATE_KEY} to show cost estimate only +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted ship. Also press {ESTIMATE_KEY} to show cost estimate only +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_TOOLTIP :{BLACK}Buy and refit the highlighted aircraft. Also press {ESTIMATE_KEY} to show cost estimate only ###length VEHICLE_TYPES STR_BUY_VEHICLE_TRAIN_RENAME_BUTTON :{BLACK}Rename @@ -4196,7 +4204,7 @@ STR_DEPOT_VEHICLE_TOOLTIP_CHAIN :{BLACK}{NUM} ve STR_DEPOT_VEHICLE_TOOLTIP_CARGO :{}{CARGO_LONG} ({CARGO_SHORT}) ###length VEHICLE_TYPES -STR_DEPOT_TRAIN_LIST_TOOLTIP :{BLACK}Trains - drag vehicle with left-click to add/remove from train, right-click for information. Ctrl+Click to apply either function to the following chain +STR_DEPOT_TRAIN_LIST_TOOLTIP :{BLACK}Trains - drag vehicle with left-click to add/remove from train, right-click for information. {FN_KEY}+Click to apply either function to the following chain STR_DEPOT_ROAD_VEHICLE_LIST_TOOLTIP :{BLACK}Vehicles - right-click on vehicle for information STR_DEPOT_SHIP_LIST_TOOLTIP :{BLACK}Ships - right-click on ship for information STR_DEPOT_AIRCRAFT_LIST_TOOLTIP :{BLACK}Aircraft - right-click on aircraft for information @@ -4238,16 +4246,16 @@ STR_DEPOT_CLONE_SHIP :{BLACK}Clone Sh STR_DEPOT_CLONE_AIRCRAFT :{BLACK}Clone Aircraft ###length VEHICLE_TYPES -STR_DEPOT_CLONE_TRAIN_DEPOT_INFO :{BLACK}Buy a copy of a train including all cars. Click this button and then on a train inside or outside the depot. Ctrl+Click to share the orders. Also press Shift to show cost estimate only -STR_DEPOT_CLONE_ROAD_VEHICLE_DEPOT_INFO :{BLACK}Buy a copy of a road vehicle. Click this button and then on a road vehicle inside or outside the depot. Ctrl+Click to share the orders. Also press Shift to show cost estimate only -STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Buy a copy of a ship. Click this button and then on a ship inside or outside the depot. Ctrl+Click to share the orders. Also press Shift to show cost estimate only -STR_DEPOT_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW :{BLACK}Buy a copy of an aircraft. Click this button and then on an aircraft inside or outside the hangar. Ctrl+Click to share the orders. Also press Shift to show cost estimate only +STR_DEPOT_CLONE_TRAIN_DEPOT_INFO :{BLACK}Buy a copy of a train including all cars. Click this button and then on a train inside or outside the depot. {FN_KEY}+Click to share the orders. Also press {ESTIMATE_KEY} to show cost estimate only +STR_DEPOT_CLONE_ROAD_VEHICLE_DEPOT_INFO :{BLACK}Buy a copy of a road vehicle. Click this button and then on a road vehicle inside or outside the depot. {FN_KEY}+Click to share the orders. Also press {ESTIMATE_KEY} to show cost estimate only +STR_DEPOT_CLONE_SHIP_DEPOT_INFO :{BLACK}Buy a copy of a ship. Click this button and then on a ship inside or outside the depot. {FN_KEY}+Click to share the orders. Also press {ESTIMATE_KEY} to show cost estimate only +STR_DEPOT_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW :{BLACK}Buy a copy of an aircraft. Click this button and then on an aircraft inside or outside the hangar. {FN_KEY}+Click to share the orders. Also press {ESTIMATE_KEY} to show cost estimate only ###length VEHICLE_TYPES -STR_DEPOT_TRAIN_LOCATION_TOOLTIP :{BLACK}Centre main view on train depot location. Ctrl+Click to open a new viewport on train depot location -STR_DEPOT_ROAD_VEHICLE_LOCATION_TOOLTIP :{BLACK}Centre main view on road vehicle depot location. Ctrl+Click to open a new viewport on road depot location -STR_DEPOT_SHIP_LOCATION_TOOLTIP :{BLACK}Centre main view on ship depot location. Ctrl+Click to open a new viewport on ship depot location -STR_DEPOT_AIRCRAFT_LOCATION_TOOLTIP :{BLACK}Centre main view on hangar location. Ctrl+Click to open a new viewport on hangar location +STR_DEPOT_TRAIN_LOCATION_TOOLTIP :{BLACK}Centre main view on train depot location. {FN_KEY}+Click to open a new viewport on train depot location +STR_DEPOT_ROAD_VEHICLE_LOCATION_TOOLTIP :{BLACK}Centre main view on road vehicle depot location. {FN_KEY}+Click to open a new viewport on road depot location +STR_DEPOT_SHIP_LOCATION_TOOLTIP :{BLACK}Centre main view on ship depot location. {FN_KEY}+Click to open a new viewport on ship depot location +STR_DEPOT_AIRCRAFT_LOCATION_TOOLTIP :{BLACK}Centre main view on hangar location. {FN_KEY}+Click to open a new viewport on hangar location ###length VEHICLE_TYPES STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TOOLTIP :{BLACK}Get a list of all trains with the current depot in their orders @@ -4347,33 +4355,33 @@ STR_REPLACE_TRAM_VEHICLES :Tramway Vehicle STR_REPLACE_REMOVE_WAGON :{BLACK}Wagon removal ({STRING1}): {ORANGE}{STRING} STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Make autoreplace keep the length of a train the same by removing wagons (starting at the front), if replacing the engine would make the train longer -STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. Ctrl+Click to also apply to sub-groups +STR_REPLACE_REMOVE_WAGON_GROUP_HELP :{STRING}. {FN_KEY}+Click to also apply to sub-groups # Vehicle view STR_VEHICLE_VIEW_CAPTION :{WHITE}{VEHICLE} ###length VEHICLE_TYPES -STR_VEHICLE_VIEW_TRAIN_CENTER_TOOLTIP :{BLACK}Centre main view on train's location. Double click to follow train in main view. Ctrl+Click to open a new viewport on train's location -STR_VEHICLE_VIEW_ROAD_VEHICLE_CENTER_TOOLTIP :{BLACK}Centre main view on vehicle's location. Double click to follow vehicle in main view. Ctrl+Click to open a new viewport on vehicle's location -STR_VEHICLE_VIEW_SHIP_CENTER_TOOLTIP :{BLACK}Centre main view on ship's location. Double click to follow ship in main view. Ctrl+Click to open a new viewport on ship's location -STR_VEHICLE_VIEW_AIRCRAFT_CENTER_TOOLTIP :{BLACK}Centre main view on aircraft's location. Double click to follow aircraft in main view. Ctrl+Click to open a new viewport on aircraft's location +STR_VEHICLE_VIEW_TRAIN_CENTER_TOOLTIP :{BLACK}Centre main view on train's location. Double click to follow train in main view. {FN_KEY}+Click to open a new viewport on train's location +STR_VEHICLE_VIEW_ROAD_VEHICLE_CENTER_TOOLTIP :{BLACK}Centre main view on vehicle's location. Double click to follow vehicle in main view. {FN_KEY}+Click to open a new viewport on vehicle's location +STR_VEHICLE_VIEW_SHIP_CENTER_TOOLTIP :{BLACK}Centre main view on ship's location. Double click to follow ship in main view. {FN_KEY}+Click to open a new viewport on ship's location +STR_VEHICLE_VIEW_AIRCRAFT_CENTER_TOOLTIP :{BLACK}Centre main view on aircraft's location. Double click to follow aircraft in main view. {FN_KEY}+Click to open a new viewport on aircraft's location ###length VEHICLE_TYPES -STR_VEHICLE_VIEW_TRAIN_SEND_TO_DEPOT_TOOLTIP :{BLACK}Send train to depot. Ctrl+Click to only service -STR_VEHICLE_VIEW_ROAD_VEHICLE_SEND_TO_DEPOT_TOOLTIP :{BLACK}Send vehicle to depot. Ctrl+Click to only service -STR_VEHICLE_VIEW_SHIP_SEND_TO_DEPOT_TOOLTIP :{BLACK}Send ship to depot. Ctrl+Click to only service -STR_VEHICLE_VIEW_AIRCRAFT_SEND_TO_DEPOT_TOOLTIP :{BLACK}Send aircraft to hangar. Ctrl+Click to only service +STR_VEHICLE_VIEW_TRAIN_SEND_TO_DEPOT_TOOLTIP :{BLACK}Send train to depot. {FN_KEY}+Click to only service +STR_VEHICLE_VIEW_ROAD_VEHICLE_SEND_TO_DEPOT_TOOLTIP :{BLACK}Send vehicle to depot. {FN_KEY}+Click to only service +STR_VEHICLE_VIEW_SHIP_SEND_TO_DEPOT_TOOLTIP :{BLACK}Send ship to depot. {FN_KEY}+Click to only service +STR_VEHICLE_VIEW_AIRCRAFT_SEND_TO_DEPOT_TOOLTIP :{BLACK}Send aircraft to hangar. {FN_KEY}+Click to only service ###length VEHICLE_TYPES -STR_VEHICLE_VIEW_CLONE_TRAIN_INFO :{BLACK}Buy a copy of the train including all cars. Ctrl+Click to share orders. Also press Shift to show cost estimate only -STR_VEHICLE_VIEW_CLONE_ROAD_VEHICLE_INFO :{BLACK}Buy a copy of the road vehicle. Ctrl+Click to share orders. Also press Shift to show cost estimate only -STR_VEHICLE_VIEW_CLONE_SHIP_INFO :{BLACK}Buy a copy of the ship. Ctrl+Click to share orders. Also press Shift to show cost estimate only -STR_VEHICLE_VIEW_CLONE_AIRCRAFT_INFO :{BLACK}Buy a copy of the aircraft. Ctrl+Click to share orders. Also press Shift to show cost estimate only +STR_VEHICLE_VIEW_CLONE_TRAIN_INFO :{BLACK}Buy a copy of the train including all cars. {FN_KEY}+Click to share orders. Also press {ESTIMATE_KEY} to show cost estimate only +STR_VEHICLE_VIEW_CLONE_ROAD_VEHICLE_INFO :{BLACK}Buy a copy of the road vehicle. {FN_KEY}+Click to share orders. Also press {ESTIMATE_KEY} to show cost estimate only +STR_VEHICLE_VIEW_CLONE_SHIP_INFO :{BLACK}Buy a copy of the ship. {FN_KEY}+Click to share orders. Also press {ESTIMATE_KEY} to show cost estimate only +STR_VEHICLE_VIEW_CLONE_AIRCRAFT_INFO :{BLACK}Buy a copy of the aircraft. {FN_KEY}+Click to share orders. Also press {ESTIMATE_KEY} to show cost estimate only STR_VEHICLE_VIEW_TRAIN_IGNORE_SIGNAL_TOOLTIP :{BLACK}Force train to proceed without waiting for signal to clear it STR_VEHICLE_VIEW_TRAIN_REVERSE_TOOLTIP :{BLACK}Reverse direction of train STR_VEHICLE_VIEW_ROAD_VEHICLE_REVERSE_TOOLTIP :{BLACK}Force vehicle to turn around -STR_VEHICLE_VIEW_ORDER_LOCATION_TOOLTIP :{BLACK}Centre main view on order destination. Ctrl+Click to open a new viewport on the order destination's location +STR_VEHICLE_VIEW_ORDER_LOCATION_TOOLTIP :{BLACK}Centre main view on order destination. {FN_KEY}+Click to open a new viewport on the order destination's location ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_REFIT_TOOLTIP :{BLACK}Refit train to carry a different cargo type @@ -4382,10 +4390,10 @@ STR_VEHICLE_VIEW_SHIP_REFIT_TOOLTIP :{BLACK}Refit sh STR_VEHICLE_VIEW_AIRCRAFT_REFIT_TOOLTIP :{BLACK}Refit aircraft to carry a different cargo type ###length VEHICLE_TYPES -STR_VEHICLE_VIEW_TRAIN_ORDERS_TOOLTIP :{BLACK}Show train's orders. Ctrl+Click to show train's timetable -STR_VEHICLE_VIEW_ROAD_VEHICLE_ORDERS_TOOLTIP :{BLACK}Show vehicle's orders. Ctrl+Click to show vehicle's timetable -STR_VEHICLE_VIEW_SHIP_ORDERS_TOOLTIP :{BLACK}Show ship's orders. Ctrl+Click to show ship's timetable -STR_VEHICLE_VIEW_AIRCRAFT_ORDERS_TOOLTIP :{BLACK}Show aircraft's orders. Ctrl+Click to show aircraft's timetable +STR_VEHICLE_VIEW_TRAIN_ORDERS_TOOLTIP :{BLACK}Show train's orders. {FN_KEY}+Click to show train's timetable +STR_VEHICLE_VIEW_ROAD_VEHICLE_ORDERS_TOOLTIP :{BLACK}Show vehicle's orders. {FN_KEY}+Click to show vehicle's timetable +STR_VEHICLE_VIEW_SHIP_ORDERS_TOOLTIP :{BLACK}Show ship's orders. {FN_KEY}+Click to show ship's timetable +STR_VEHICLE_VIEW_AIRCRAFT_ORDERS_TOOLTIP :{BLACK}Show aircraft's orders. {FN_KEY}+Click to show aircraft's timetable ###length VEHICLE_TYPES STR_VEHICLE_VIEW_TRAIN_SHOW_DETAILS_TOOLTIP :{BLACK}Show train details @@ -4469,12 +4477,12 @@ STR_VEHICLE_DETAILS_SERVICING_INTERVAL_MINUTES :{BLACK}Servicin STR_VEHICLE_DETAILS_SERVICING_INTERVAL_PERCENT :{BLACK}Servicing interval: {LTBLUE}{COMMA}%{BLACK} {STRING1} STR_VEHICLE_DETAILS_LAST_SERVICE_DATE :Last service: {LTBLUE}{DATE_LONG} STR_VEHICLE_DETAILS_LAST_SERVICE_MINUTES_AGO :Last service: {LTBLUE}{NUM} minutes ago -STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP_DAYS :{BLACK}Increase servicing interval by 10 days. Ctrl+Click to increase servicing interval by 5 days -STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP_MINUTES :{BLACK}Increase servicing interval by 5 minutes. Ctrl+Click to increase servicing interval by 1 minute -STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP_PERCENT :{BLACK}Increase servicing interval by 10 percent. Ctrl+Click to increase servicing interval by 5 percent -STR_VEHICLE_DETAILS_DECREASE_SERVICING_INTERVAL_TOOLTIP_DAYS :{BLACK}Decrease servicing interval by 10 days. Ctrl+Click to decrease servicing interval by 5 days -STR_VEHICLE_DETAILS_DECREASE_SERVICING_INTERVAL_TOOLTIP_MINUTES :{BLACK}Decrease servicing interval by 5 minutes. Ctrl+Click to decrease servicing interval by 1 minute -STR_VEHICLE_DETAILS_DECREASE_SERVICING_INTERVAL_TOOLTIP_PERCENT :{BLACK}Decrease servicing interval by 10 percent. Ctrl+Click to decrease servicing interval by 5 percent +STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP_DAYS :{BLACK}Increase servicing interval by 10 days. {FN_KEY}+Click to increase servicing interval by 5 days +STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP_MINUTES :{BLACK}Increase servicing interval by 5 minutes. {FN_KEY}+Click to increase servicing interval by 1 minute +STR_VEHICLE_DETAILS_INCREASE_SERVICING_INTERVAL_TOOLTIP_PERCENT :{BLACK}Increase servicing interval by 10 percent. {FN_KEY}+Click to increase servicing interval by 5 percent +STR_VEHICLE_DETAILS_DECREASE_SERVICING_INTERVAL_TOOLTIP_DAYS :{BLACK}Decrease servicing interval by 10 days. {FN_KEY}+Click to decrease servicing interval by 5 days +STR_VEHICLE_DETAILS_DECREASE_SERVICING_INTERVAL_TOOLTIP_MINUTES :{BLACK}Decrease servicing interval by 5 minutes. {FN_KEY}+Click to decrease servicing interval by 1 minute +STR_VEHICLE_DETAILS_DECREASE_SERVICING_INTERVAL_TOOLTIP_PERCENT :{BLACK}Decrease servicing interval by 10 percent. {FN_KEY}+Click to decrease servicing interval by 5 percent STR_SERVICE_INTERVAL_DROPDOWN_TOOLTIP :{BLACK}Change servicing interval type STR_VEHICLE_DETAILS_DEFAULT :Default @@ -4518,7 +4526,7 @@ STR_REFIT_NEW_CAPACITY_COST_OF_REFIT :{BLACK}New capa STR_REFIT_NEW_CAPACITY_INCOME_FROM_REFIT :{BLACK}New capacity: {GOLD}{CARGO_LONG}{}{BLACK}Income from refit: {GREEN}{CURRENCY_LONG} STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT :{BLACK}New capacity: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Cost of refit: {RED}{CURRENCY_LONG} STR_REFIT_NEW_CAPACITY_INCOME_FROM_AIRCRAFT_REFIT :{BLACK}New capacity: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Income from refit: {GREEN}{CURRENCY_LONG} -STR_REFIT_SELECT_VEHICLES_TOOLTIP :{BLACK}Select the vehicles to refit. Click+Drag to select multiple vehicles. Click on an empty space to select the whole vehicle. Ctrl+Click to select a vehicle and the following chain +STR_REFIT_SELECT_VEHICLES_TOOLTIP :{BLACK}Select the vehicles to refit. {FN_KEY}+Drag to select multiple vehicles. Click on an empty space to select the whole vehicle. {FN_KEY}+Click to select a vehicle and the following chain ###length VEHICLE_TYPES STR_REFIT_TRAIN_LIST_TOOLTIP :{BLACK}Select type of cargo for train to carry @@ -4543,7 +4551,7 @@ STR_ORDERS_CAPTION :{WHITE}{VEHICLE STR_ORDERS_TIMETABLE_VIEW :{BLACK}Timetable STR_ORDERS_TIMETABLE_VIEW_TOOLTIP :{BLACK}Switch to the timetable view -STR_ORDERS_LIST_TOOLTIP :{BLACK}Order list - click on an order to highlight it. Ctrl+Click to scroll to the order's destination +STR_ORDERS_LIST_TOOLTIP :{BLACK}Order list - click on an order to highlight it. {FN_KEY}+Click to scroll to the order's destination STR_ORDER_INDEX :{COMMA}:{NBSP} STR_ORDER_TEXT :{STRING4} {STRING2} {STRING} @@ -4573,9 +4581,9 @@ STR_ORDER_DROP_NO_UNLOADING :No unloading STR_ORDER_TOOLTIP_UNLOAD :{BLACK}Change the unloading behaviour of the highlighted order STR_ORDER_REFIT :{BLACK}Refit -STR_ORDER_REFIT_TOOLTIP :{BLACK}Select what cargo type to refit to in this order. Ctrl+Click to remove refit instruction +STR_ORDER_REFIT_TOOLTIP :{BLACK}Select what cargo type to refit to in this order. {FN_KEY}+Click to remove refit instruction STR_ORDER_REFIT_AUTO :{BLACK}Refit at station -STR_ORDER_REFIT_AUTO_TOOLTIP :{BLACK}Select what cargo type to refit to in this order. Ctrl+Click to remove refit instruction. Refitting at stations will only be done if the vehicle allows it +STR_ORDER_REFIT_AUTO_TOOLTIP :{BLACK}Select what cargo type to refit to in this order. {FN_KEY}+Click to remove refit instruction. Refitting at stations will only be done if the vehicle allows it STR_ORDER_DROP_REFIT_AUTO :Fixed cargo STR_ORDER_DROP_REFIT_AUTO_ANY :Available cargo @@ -4613,20 +4621,20 @@ STR_ORDER_CONDITIONAL_VALUE_TOOLTIP :{BLACK}The valu STR_ORDER_CONDITIONAL_VALUE_CAPT :{WHITE}Enter value to compare against STR_ORDERS_SKIP_BUTTON :{BLACK}Skip -STR_ORDERS_SKIP_TOOLTIP :{BLACK}Skip the current order, and start the next. Ctrl+Click to skip to the selected order +STR_ORDERS_SKIP_TOOLTIP :{BLACK}Skip the current order, and start the next. {FN_KEY}+Click to skip to the selected order STR_ORDERS_DELETE_BUTTON :{BLACK}Delete STR_ORDERS_DELETE_TOOLTIP :{BLACK}Delete the highlighted order STR_ORDERS_DELETE_ALL_TOOLTIP :{BLACK}Delete all orders STR_ORDERS_STOP_SHARING_BUTTON :{BLACK}Stop sharing -STR_ORDERS_STOP_SHARING_TOOLTIP :{BLACK}Stop sharing the order list. Ctrl+Click to additionally delete all orders for this vehicle +STR_ORDERS_STOP_SHARING_TOOLTIP :{BLACK}Stop sharing the order list. {FN_KEY}+Click to additionally delete all orders for this vehicle STR_ORDERS_GO_TO_BUTTON :{BLACK}Go To STR_ORDER_GO_TO_NEAREST_DEPOT :Go to nearest depot STR_ORDER_GO_TO_NEAREST_HANGAR :Go to nearest hangar STR_ORDER_CONDITIONAL :Conditional order jump STR_ORDER_SHARE :Share orders -STR_ORDERS_GO_TO_TOOLTIP :{BLACK}Insert a new order before the highlighted order, or add to end of list. Ctrl+Click on a station for 'full load any cargo', on a waypoint for 'non-stop', or on a depot for 'service'. Click on another vehicle to copy its orders or Ctrl+Click to share orders. A depot order disables automatic servicing of the vehicle +STR_ORDERS_GO_TO_TOOLTIP :{BLACK}Insert a new order before the highlighted order, or add to end of list. {FN_KEY}+Click on a station for 'full load any cargo', on a waypoint for 'non-stop', or on a depot for 'service'. Click on another vehicle to copy its orders or {FN_KEY}+Click to share orders. A depot order disables automatic servicing of the vehicle STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP :{BLACK}Show all vehicles that share this schedule @@ -4732,27 +4740,27 @@ STR_TIMETABLE_STATUS_START_AT_DATE :{BLACK}This tim STR_TIMETABLE_STATUS_START_IN_SECONDS :{BLACK}This timetable will start in {COMMA} seconds STR_TIMETABLE_START :{BLACK}Start Timetable -STR_TIMETABLE_START_TOOLTIP :{BLACK}Select when this timetable starts. Ctrl+Click to evenly distribute the start of all vehicles sharing this order based on their relative order, if the order is completely timetabled +STR_TIMETABLE_START_TOOLTIP :{BLACK}Select when this timetable starts. {FN_KEY}+Click to evenly distribute the start of all vehicles sharing this order based on their relative order, if the order is completely timetabled STR_TIMETABLE_START_SECONDS_QUERY :Seconds until timetable starts STR_TIMETABLE_CHANGE_TIME :{BLACK}Change Time -STR_TIMETABLE_WAIT_TIME_TOOLTIP :{BLACK}Change the amount of time that the highlighted order should take. Ctrl+Click to set the time for all orders +STR_TIMETABLE_WAIT_TIME_TOOLTIP :{BLACK}Change the amount of time that the highlighted order should take. {FN_KEY}+Click to set the time for all orders STR_TIMETABLE_CLEAR_TIME :{BLACK}Clear Time -STR_TIMETABLE_CLEAR_TIME_TOOLTIP :{BLACK}Clear the amount of time for the highlighted order. Ctrl+Click to clear the time for all orders +STR_TIMETABLE_CLEAR_TIME_TOOLTIP :{BLACK}Clear the amount of time for the highlighted order. {FN_KEY}+Click to clear the time for all orders STR_TIMETABLE_CHANGE_SPEED :{BLACK}Change Speed Limit -STR_TIMETABLE_CHANGE_SPEED_TOOLTIP :{BLACK}Change the maximum travel speed of the highlighted order. Ctrl+Click to set the speed for all orders +STR_TIMETABLE_CHANGE_SPEED_TOOLTIP :{BLACK}Change the maximum travel speed of the highlighted order. {FN_KEY}+Click to set the speed for all orders STR_TIMETABLE_CLEAR_SPEED :{BLACK}Clear Speed Limit -STR_TIMETABLE_CLEAR_SPEED_TOOLTIP :{BLACK}Clear the maximum travel speed of the highlighted order. Ctrl+Click to clear the speed for all orders +STR_TIMETABLE_CLEAR_SPEED_TOOLTIP :{BLACK}Clear the maximum travel speed of the highlighted order. {FN_KEY}+Click to clear the speed for all orders STR_TIMETABLE_RESET_LATENESS :{BLACK}Reset Late Counter -STR_TIMETABLE_RESET_LATENESS_TOOLTIP :{BLACK}Reset the lateness counter, so the vehicle will be on time. Ctrl+Click to reset the entire group so the latest vehicle will be on time and all others will be early +STR_TIMETABLE_RESET_LATENESS_TOOLTIP :{BLACK}Reset the lateness counter, so the vehicle will be on time. {FN_KEY}+Click to reset the entire group so the latest vehicle will be on time and all others will be early STR_TIMETABLE_AUTOFILL :{BLACK}Autofill -STR_TIMETABLE_AUTOFILL_TOOLTIP :{BLACK}Fill the timetable automatically with the values from the next journey. Ctrl+Click to try to keep waiting times +STR_TIMETABLE_AUTOFILL_TOOLTIP :{BLACK}Fill the timetable automatically with the values from the next journey. {FN_KEY}+Click to try to keep waiting times STR_TIMETABLE_EXPECTED :{BLACK}Expected STR_TIMETABLE_SCHEDULED :{BLACK}Scheduled @@ -4789,9 +4797,9 @@ STR_AI_DEBUG_MATCH_CASE :{BLACK}Match ca STR_AI_DEBUG_MATCH_CASE_TOOLTIP :{BLACK}Toggle matching case when comparing AI log messages against the break string STR_AI_DEBUG_CONTINUE :{BLACK}Continue STR_AI_DEBUG_CONTINUE_TOOLTIP :{BLACK}Unpause and continue the AI -STR_AI_DEBUG_SELECT_AI_TOOLTIP :{BLACK}View debug output of this AI. Ctrl-Click to open in a new window +STR_AI_DEBUG_SELECT_AI_TOOLTIP :{BLACK}View debug output of this AI. {FN_KEY}-Click to open in a new window STR_AI_GAME_SCRIPT :{BLACK}Game Script -STR_AI_GAME_SCRIPT_TOOLTIP :{BLACK}Check the Game Script log. Ctrl-Click to open in a new window +STR_AI_GAME_SCRIPT_TOOLTIP :{BLACK}Check the Game Script log. {FN_KEY}-Click to open in a new window STR_ERROR_AI_NO_AI_FOUND :No suitable AI found to load.{}This AI is a dummy AI and won't do anything.{}You can download several AIs via the 'Online Content' system STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}One of the running scripts crashed. Please report this to the script author with a screenshot of the AI/Game Script Debug Window @@ -4820,7 +4828,7 @@ STR_AI_CONFIG_AI :{SILVER}AIs STR_AI_CONFIG_CHANGE_AI :{BLACK}Select AI STR_AI_CONFIG_CHANGE_GAMESCRIPT :{BLACK}Select Game Script -STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Load another script. Ctrl+Click to show all available versions +STR_AI_CONFIG_CHANGE_TOOLTIP :{BLACK}Load another script. {FN_KEY}+Click to show all available versions STR_AI_CONFIG_CONFIGURE :{BLACK}Configure STR_AI_CONFIG_CONFIGURE_TOOLTIP :{BLACK}Configure the parameters of the Script diff --git a/src/strings.cpp b/src/strings.cpp index e75e7fac13..9d3f133fcc 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -556,6 +556,12 @@ static void FormatGenericCurrency(StringBuilder &builder, const CurrencySpec *sp } } +static void FormatModifierKey(StringBuilder &builder, ModifierKey key) +{ + auto tmp_params = MakeParameters(); + return FormatString(builder, GetStringPtr(STR_MODIFIER_KEY_UNASSIGNED + key), tmp_params); +} + /** * Determine the "plural" index given a plural form and a number. * @param count The number to get the plural index of. @@ -1695,6 +1701,21 @@ static void FormatString(StringBuilder &builder, const char *str_arg, StringPara break; } + case SCC_FN_KEY: { // {FN_KEY} + FormatModifierKey(builder, _settings_client.gui.fn_modifier); + break; + } + + case SCC_REMOVE_KEY: { // {REMOVE_KEY} + FormatModifierKey(builder, _settings_client.gui.remove_modifier); + break; + } + + case SCC_ESTIMATE_KEY: { // {ESTIMATE_KEY} + FormatModifierKey(builder, _settings_client.gui.estimate_modifier); + break; + } + default: builder.Utf8Encode(b); break; diff --git a/src/table/control_codes.h b/src/table/control_codes.h index d2022c3cec..318dd343a1 100644 --- a/src/table/control_codes.h +++ b/src/table/control_codes.h @@ -101,6 +101,11 @@ enum StringControlCode { SCC_SET_CASE, SCC_SWITCH_CASE, + /* Modifier keys */ + SCC_FN_KEY, + SCC_REMOVE_KEY, + SCC_ESTIMATE_KEY, + /* Colour codes */ SCC_BLUE, SCC_SILVER, diff --git a/src/table/strgen_tables.h b/src/table/strgen_tables.h index badab707bd..610fdfe5b4 100644 --- a/src/table/strgen_tables.h +++ b/src/table/strgen_tables.h @@ -155,6 +155,11 @@ static const CmdStruct _cmd_structs[] = { {"LRO", EmitSingleChar, CHAR_TD_LRO, 0, -1, C_DONTCOUNT}, {"RLO", EmitSingleChar, CHAR_TD_RLO, 0, -1, C_DONTCOUNT}, {"PDF", EmitSingleChar, CHAR_TD_PDF, 0, -1, C_DONTCOUNT}, + + /* Control codes to insert the name of a modifier key. */ + {"FN_KEY", EmitSingleChar, SCC_FN_KEY, 0, -1, C_NONE}, + {"REMOVE_KEY", EmitSingleChar, SCC_REMOVE_KEY, 0, -1, C_NONE}, + {"ESTIMATE_KEY", EmitSingleChar, SCC_ESTIMATE_KEY, 0, -1, C_NONE}, }; /** Description of a plural form */