Implement various manager resets (#1112)
This commit is contained in:
parent
51789bd329
commit
f4f3d0d72c
|
@ -4,6 +4,7 @@
|
|||
#include "Math/Vector.hpp"
|
||||
#include "Objects/IndustryObject.h"
|
||||
#include "OpenLoco.h"
|
||||
#include "Ui/WindowManager.h"
|
||||
|
||||
using namespace OpenLoco::Interop;
|
||||
|
||||
|
@ -14,7 +15,11 @@ namespace OpenLoco::IndustryManager
|
|||
// 0x00453214
|
||||
void reset()
|
||||
{
|
||||
call(0x00453214);
|
||||
for (auto& industry : _industries)
|
||||
{
|
||||
industry.name = StringIds::null;
|
||||
}
|
||||
Ui::Windows::IndustryList::reset();
|
||||
}
|
||||
|
||||
LocoFixedVector<Industry> industries()
|
||||
|
|
|
@ -24,7 +24,11 @@ namespace OpenLoco::StationManager
|
|||
// 0x0048B1D8
|
||||
void reset()
|
||||
{
|
||||
call(0x0048B1D8);
|
||||
for (auto& station : _stations)
|
||||
{
|
||||
station.name = StringIds::null;
|
||||
}
|
||||
Ui::Windows::Station::reset();
|
||||
}
|
||||
|
||||
LocoFixedVector<Station> stations()
|
||||
|
|
|
@ -167,6 +167,7 @@ namespace OpenLoco::Ui::Windows
|
|||
namespace IndustryList
|
||||
{
|
||||
Window* open();
|
||||
void reset();
|
||||
}
|
||||
|
||||
namespace KeyboardShortcuts
|
||||
|
@ -280,6 +281,7 @@ namespace OpenLoco::Ui::Windows
|
|||
namespace Station
|
||||
{
|
||||
Window* open(uint16_t id);
|
||||
void reset();
|
||||
void showStationCatchment(uint16_t windowNumber);
|
||||
}
|
||||
|
||||
|
|
|
@ -116,10 +116,19 @@ namespace OpenLoco::Ui::Windows::Construction::Construction
|
|||
static std::optional<TrackPieceId> getRoadPieceId(uint8_t trackPiece, uint8_t gradient, uint8_t rotation);
|
||||
static std::optional<TrackPieceId> getTrackPieceId(uint8_t trackPiece, uint8_t gradient, uint8_t rotation);
|
||||
|
||||
static loco_global<uint8_t, 0x00525FB0> _pickupDirection; // From Vehicle.cpp window
|
||||
|
||||
// 0x0049B50C
|
||||
void reset()
|
||||
{
|
||||
call(0x0049B50C);
|
||||
std::fill(std::begin(_scenarioSignals), std::end(_scenarioSignals), 0xFF);
|
||||
std::fill(std::begin(_scenarioBridges), std::end(_scenarioBridges), 0xFF);
|
||||
std::fill(std::begin(_scenarioTrainStations), std::end(_scenarioTrainStations), 0xFF);
|
||||
std::fill(std::begin(_scenarioTrackMods), std::end(_scenarioTrackMods), 0xFF);
|
||||
|
||||
_lastAirport = 0xFF;
|
||||
_lastShipPort = 0xFF;
|
||||
_pickupDirection = 0;
|
||||
}
|
||||
|
||||
// 0x0049F92D
|
||||
|
|
|
@ -570,6 +570,11 @@ namespace OpenLoco::Ui::Windows::IndustryList
|
|||
return window;
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
_lastSelectedIndustry = 0xFF;
|
||||
}
|
||||
|
||||
namespace NewIndustries
|
||||
{
|
||||
|
||||
|
|
|
@ -310,6 +310,11 @@ namespace OpenLoco::Ui::Windows::Station
|
|||
return window;
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
_lastSelectedStation = StationId::null;
|
||||
}
|
||||
|
||||
namespace Cargo
|
||||
{
|
||||
enum widx
|
||||
|
|
Loading…
Reference in New Issue