mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 12:06:41 +00:00
Cleanup: Expose last built types in the toolbar gui header.
This commit is contained in:
+1
-3
@@ -35,6 +35,7 @@
|
||||
#include "vehicle_func.h"
|
||||
#include "zoom_func.h"
|
||||
#include "rail_gui.h"
|
||||
#include "toolbar_gui.h"
|
||||
#include "station_cmd.h"
|
||||
#include "tunnelbridge_cmd.h"
|
||||
#include "waypoint_cmd.h"
|
||||
@@ -838,7 +839,6 @@ struct BuildRailToolbarWindow : Window {
|
||||
static EventState RailToolbarGlobalHotkeys(int hotkey)
|
||||
{
|
||||
if (_game_mode != GM_NORMAL) return ES_NOT_HANDLED;
|
||||
extern RailType _last_built_railtype;
|
||||
Window *w = ShowBuildRailToolbar(_last_built_railtype);
|
||||
if (w == nullptr) return ES_NOT_HANDLED;
|
||||
return w->OnHotkey(hotkey);
|
||||
@@ -1929,7 +1929,6 @@ void InitializeRailGui()
|
||||
*/
|
||||
void ReinitGuiAfterToggleElrail(bool disable)
|
||||
{
|
||||
extern RailType _last_built_railtype;
|
||||
if (disable && _last_built_railtype == RAILTYPE_ELECTRIC) {
|
||||
_last_built_railtype = _cur_railtype = RAILTYPE_RAIL;
|
||||
BuildRailToolbarWindow *w = dynamic_cast<BuildRailToolbarWindow *>(FindWindowById(WC_BUILD_TOOLBAR, TRANSPORT_RAIL));
|
||||
@@ -1943,7 +1942,6 @@ static void SetDefaultRailGui()
|
||||
{
|
||||
if (_local_company == COMPANY_SPECTATOR || !Company::IsValidID(_local_company)) return;
|
||||
|
||||
extern RailType _last_built_railtype;
|
||||
RailType rt;
|
||||
switch (_settings_client.gui.default_rail_type) {
|
||||
case 2: {
|
||||
|
||||
Reference in New Issue
Block a user