Files
Shipwright/soh/soh/Enhancements/RogueLike/GUI/StartingSelectionWindow.cpp
T
Garrett Cox f5af415098 Reindeer games additions (#33)
* Remove hat from darunia

* Update some stuffs

* Remove custom collectible (in favor of CustomItem)

* Roguelike

Co-authored-by: Caladius <Caladius@users.noreply.github.com>
Co-authored-by: Eblo <7004497+Eblo@users.noreply.github.com>

* Fix a bunch of stuff

* Persist roguelike data

* Experimental anchor tweaks

* Stop freeze from scrubs & fix pablo cvar

---------

Co-authored-by: Caladius <Caladius@users.noreply.github.com>
Co-authored-by: Eblo <7004497+Eblo@users.noreply.github.com>
2025-12-06 09:45:43 -07:00

72 lines
2.1 KiB
C++

#include "soh/Enhancements/RogueLike/RogueLike.h"
extern "C" {
#include "variables.h"
#include "macros.h"
#include "functions.h"
extern PlayState* gPlayState;
}
typedef enum {
WINDOW_STATE_LOCATION,
WINDOW_STATE_ITEM,
WINDOW_STATE_SONG,
WINDOW_STATE_APPLY,
} StartingSelectionWindowState;
static StartingSelectionWindowState state = WINDOW_STATE_LOCATION;
static RogueLike::Choices::ChoiceCard* locationChoice = nullptr;
static RogueLike::Choices::ChoiceCard* itemChoice = nullptr;
static RogueLike::Choices::ChoiceCard* songChoice = nullptr;
void RogueLike::GUI::StartingSelectionWindow::Draw() {
if (!IsVisible()) {
return;
}
BeginFullscreenDimmed("RogueLike Starting Selection");
switch (state) {
case WINDOW_STATE_LOCATION: {
locationChoice = DrawChooseScreen("Where will you begin your journey?", RogueLike::Choices::Locations, 20);
if (locationChoice != nullptr) {
state = WINDOW_STATE_ITEM;
}
} break;
case WINDOW_STATE_ITEM: {
itemChoice = DrawChooseScreen("What will you take?", RogueLike::Choices::Items, 20);
if (itemChoice != nullptr) {
state = WINDOW_STATE_SONG;
}
} break;
case WINDOW_STATE_SONG: {
songChoice = DrawChooseScreen("What is your tune of choice?", RogueLike::Choices::Songs, 20);
if (songChoice != nullptr) {
state = WINDOW_STATE_APPLY;
}
} break;
default: {
// Apply choices
locationChoice->onSelect(locationChoice->value);
itemChoice->onSelect(itemChoice->value);
songChoice->onSelect(songChoice->value);
// Close window and reload game state
this->Hide();
SET_NEXT_GAMESTATE(&gPlayState->state, Play_Init, PlayState);
gPlayState->state.running = false;
// Reset state
state = WINDOW_STATE_LOCATION;
locationChoice = nullptr;
itemChoice = nullptr;
songChoice = nullptr;
} break;
}
ImGui::End();
}