mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-14 05:34:38 -04:00
implement basic warp to start button in rando menu
serves as a sort of placeholder until Midna can be properly edited to behave like console rando
This commit is contained in:
@@ -60,6 +60,15 @@ public:
|
||||
// };
|
||||
std::unordered_map<u32, std::string> mTextOverrides{};
|
||||
|
||||
// TODO: hook this up to generator data
|
||||
struct {
|
||||
// for now use hardcoded values for this
|
||||
std::string mapName = "F_SP103"; // (Ordon) Outside Link's House
|
||||
int pointNo = 1;
|
||||
int roomNo = 1;
|
||||
int mapLayer = -1;
|
||||
} mStartLocation;
|
||||
|
||||
std::optional<std::string> WriteToFile();
|
||||
std::optional<std::string> LoadFromHash(const std::string& hash);
|
||||
std::filesystem::path GetSeedDataPath() const;
|
||||
|
||||
@@ -459,6 +459,24 @@ RandomizerWindow::RandomizerWindow() {
|
||||
rando_config_toggle(leftPane, rightPane, "Ball and Chain Webs");
|
||||
rando_config_toggle(leftPane, rightPane, "Logic Transform Anywhere");
|
||||
});
|
||||
|
||||
if (randomizer_IsActive()) {
|
||||
add_tab("In-Game", [this](Rml::Element* content) {
|
||||
auto& leftPane = add_child<Pane>(content, Pane::Type::Controlled);
|
||||
auto& rightPane = add_child<Pane>(content, Pane::Type::Uncontrolled);
|
||||
|
||||
leftPane.add_section("General");
|
||||
|
||||
leftPane.register_control(leftPane.add_button("Warp to Start").on_pressed([] {
|
||||
mDoAud_seStartMenu(kSoundClick);
|
||||
auto& locData = randomizer_GetContext().mStartLocation;
|
||||
dComIfGp_setNextStage(locData.mapName.c_str(), locData.pointNo, locData.roomNo, locData.mapLayer);
|
||||
}), rightPane, [](Pane& pane) {
|
||||
pane.clear();
|
||||
pane.add_rml("Respawns the player at their appropriate starting location.");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void RandomizerWindow::update() {
|
||||
|
||||
Reference in New Issue
Block a user