summaryrefslogtreecommitdiff
path: root/mm/2s2h/DeveloperTools/SaveEditor.cpp
diff options
context:
space:
mode:
authormckinlee <mckinlee@ymail.com>2026-01-05 20:52:39 -0500
committerGitHub <noreply@github.com>2026-01-05 20:52:39 -0500
commit2b139c215f478ef5deca007dfa6f9b6052db3d1d (patch)
treefe84164b375f7bdb9ede52359efb1d1b3060100d /mm/2s2h/DeveloperTools/SaveEditor.cpp
parent51209378530531e237893ef78cda16f5b6a4b186 (diff)
[Rando] Clock Shuffle + Logic (#1275)
* Add Clocks as Items feature * refactor * some clean up * forgot to clangify * use proper randoinf flags and some fixes * proper skipsotcutscene fix * Animated Clock Item (Thank you Caladius!) * Close attempt at animating the clock, not perfect but a good start. * Git gud Clock * fix clock item get crash Co-Authored-By: Caladius <Caladius@users.noreply.github.com> * some enhancements * logic refactor, minor changes, and new enhancements * huge rework * clang * fix a oops; any day, not current day * housekeeping and starting items menu support * splits up some milkroad regions and fixes a audio bug * i suck at merging * feedback update * scarecrow dance fix * add clocks to new item tracker * day 2 bean patches * add time logic to enemy drops and simplify day 2 bean macro * rebrand to "Shuffle Time" * more eblo feedback * some more feedback * rename feedback * pauseSaveEntrance fix * fix take 2 * Time Shuffle cleanup Fix pause save Time Shuffle bug Fix event queue daytelop bug Finish merge commit header include Clean up with shouldRegister Co-authored-by: mckinlee <mckinlee@ymail.com> --------- Co-authored-by: Caladius <Caladius@users.noreply.github.com> Co-authored-by: Eblo <7004497+Eblo@users.noreply.github.com>
Diffstat (limited to 'mm/2s2h/DeveloperTools/SaveEditor.cpp')
-rw-r--r--mm/2s2h/DeveloperTools/SaveEditor.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/mm/2s2h/DeveloperTools/SaveEditor.cpp b/mm/2s2h/DeveloperTools/SaveEditor.cpp
index 8fbdcddca..a4a111b34 100644
--- a/mm/2s2h/DeveloperTools/SaveEditor.cpp
+++ b/mm/2s2h/DeveloperTools/SaveEditor.cpp
@@ -2,6 +2,7 @@
#include "2s2h/BenGui/UIWidgets.hpp"
#include "2s2h/GameInteractor/GameInteractor.h"
#include "2s2h/Rando/Rando.h"
+#include "2s2h/Rando/MiscBehavior/ClockShuffle.h"
#include "2s2h/CustomMessage/CustomMessage.h"
#include "2s2h/CustomItem/CustomItem.h"
#include "2s2h/BenGui/Notification.h"
@@ -896,6 +897,72 @@ void DrawItemsAndMasksTab() {
UIWidgets::Checkbox("Safe Mode", &safeMode);
if (gSaveContext.save.shipSaveInfo.saveType == SAVETYPE_RANDO) {
+ if (RANDO_SAVE_OPTIONS[RO_CLOCK_SHUFFLE]) {
+ // Time Items Management Section
+ ImGui::SeparatorText("Time Items");
+
+ // Individual time items in 3x2 grid with static positioning
+ RandoItemId clockItems[] = { RI_TIME_DAY_1, RI_TIME_DAY_2, RI_TIME_DAY_3,
+ RI_TIME_NIGHT_1, RI_TIME_NIGHT_2, RI_TIME_NIGHT_3 };
+
+ const char* clockNames[] = { "Day 1", "Day 2", "Day 3", "Night 1", "Night 2", "Night 3" };
+
+ // Use table for static positioning - 3 columns, 2 rows
+ if (ImGui::BeginTable("ClockItemsTable", 3, ImGuiTableFlags_None)) {
+ ImGui::TableSetupColumn("Day 1", ImGuiTableColumnFlags_WidthStretch);
+ ImGui::TableSetupColumn("Day 2", ImGuiTableColumnFlags_WidthStretch);
+ ImGui::TableSetupColumn("Day 3", ImGuiTableColumnFlags_WidthStretch);
+
+ // First row - Day items
+ ImGui::TableNextRow();
+ for (int i = 0; i < 3; i++) {
+ ImGui::TableNextColumn();
+ RandoItemId clockItem = clockItems[i];
+ int halfIndex = Rando::ClockItems::GetHalfDayIndexFromClockItem(clockItem);
+ bool isOwned = Flags_GetRandoInf(static_cast<RandoInf>(RANDO_INF_OBTAINED_CLOCK_DAY_1 + halfIndex));
+
+ std::string buttonText =
+ isOwned ? ("Remove " + std::string(clockNames[i])) : ("No Item##" + std::to_string(i));
+ std::string tooltipText = "";
+ if (!isOwned) {
+ tooltipText = "You don't own " + std::string(clockNames[i]);
+ }
+ UIWidgets::ButtonOptions buttonOpts;
+ buttonOpts.disabled = !isOwned;
+ buttonOpts.disabledTooltip = !isOwned ? tooltipText.c_str() : "";
+ if (UIWidgets::Button(buttonText.c_str(), buttonOpts)) {
+ Rando::RemoveItem(clockItem);
+ }
+ }
+
+ // Second row - Night items
+ ImGui::TableNextRow();
+ for (int i = 3; i < 6; i++) {
+ ImGui::TableNextColumn();
+ RandoItemId clockItem = clockItems[i];
+ int halfIndex = Rando::ClockItems::GetHalfDayIndexFromClockItem(clockItem);
+ bool isOwned = Flags_GetRandoInf(static_cast<RandoInf>(RANDO_INF_OBTAINED_CLOCK_DAY_1 + halfIndex));
+
+ std::string buttonText =
+ isOwned ? ("Remove " + std::string(clockNames[i])) : ("No Item##" + std::to_string(i));
+ std::string tooltipText = "";
+ if (!isOwned) {
+ tooltipText = "You don't own " + std::string(clockNames[i]);
+ }
+ UIWidgets::ButtonOptions buttonOpts;
+ buttonOpts.disabled = !isOwned;
+ buttonOpts.disabledTooltip = !isOwned ? tooltipText.c_str() : "";
+ if (UIWidgets::Button(buttonText.c_str(), buttonOpts)) {
+ Rando::RemoveItem(clockItem);
+ }
+ }
+
+ ImGui::EndTable();
+ }
+ }
+
+ // Queue Randomizer Item Gives section
+ ImGui::Spacing();
ImGui::SeparatorText("Queue Randomizer Item Gives");
static ImGuiTextFilter riFilter;