Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
cc21653
add Open DHC + Pedestal goal
eternalcode0 Aug 10, 2025
e0ca741
Add options for Universal Maps and Compasses
Catobat Jul 6, 2025
8127ac8
Add option for Universal Big Keys
Catobat Jul 6, 2025
9f8da38
Add option for Universal Small Keys with multiplier setting
Catobat Jul 13, 2025
4ea45e0
Make Universal Big Keys compatible with DHC BK Requirement Reward
Catobat Jul 17, 2025
7bfe268
Add setting for buyable Universal Small Keys
Catobat Jul 13, 2025
7f9ffe7
Update presets with universal dungeon item options
Catobat Jul 19, 2025
9c4233e
Add logic for buying keys
Myth197 Jul 22, 2025
7f1f1e3
Add Shop Key Rupee Logic as an optional setting
Myth197 Jul 30, 2025
3162dd9
Update barlov code to make you win after opening only one chest
Dreamie-TMC Aug 9, 2025
093ae00
Add settings for starting with small keys
Catobat Jul 20, 2025
f732bce
Add settings for starting with big keys
Catobat Jul 20, 2025
e92e611
Add settings for starting with heart containers and pieces
Catobat Jul 21, 2025
d27b97c
Update presets with new starting inventory settings
Catobat Jul 22, 2025
e9bf106
Update logic AccessMinishWoods
deoxis9001 Aug 8, 2025
981e8c4
fix LonLon_RanchPot
deoxis9001 Aug 8, 2025
9aeb502
fix accessLonLon
deoxis9001 Aug 8, 2025
8ef7db6
fix Goron Cave cases and typos
Myth197 Aug 9, 2025
4163727
Fix butterfly altitude
Catobat Aug 27, 2025
0be505b
Fix butterfly Z speed and unobtainable items with subtype 2
Catobat Aug 27, 2025
921de10
Fix a bad character in the logic file
Catobat Aug 27, 2025
247e2a3
Refactor handling of Selection in LogicDropdown
Catobat Jul 22, 2025
feff82b
Implement compact settings with UI support
Catobat Aug 3, 2025
a218b36
Add CLI support for compact settings
Catobat Aug 3, 2025
4756e69
Add CLI support for loading cosmetics strings
Catobat Aug 3, 2025
9740899
Fix some key logic flexibility not getting applied with Small Keys in…
Catobat Sep 14, 2025
96f0e71
Fix self-locking keychain in Deepwood Shrine with Vanilla Small Keys
Catobat Sep 14, 2025
9049e74
Fix key logic issue in Palace of Winds with Vanilla Small Keys
Catobat Sep 14, 2025
66a860d
Fix key logic issue in Palace of Winds with Vanilla Big Keys
Catobat Sep 14, 2025
e4057b3
Fix missing logical requirement for Melari reachability
Catobat Sep 16, 2025
9ef8c4f
fix: remove dhc boss door in favor of blocker
eternalcode0 Jan 5, 2026
c94f654
fix blocker pointer and add back dhc bk
eternalcode0 Mar 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion MinishCapRandomizerCLI/CommandFileParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ internal static void ParseCommandsFile(string filename)
case "LoadSettings":
GenericCommands.LoadSettings(inputs[1]);
break;
case "LoadCosmetics":
GenericCommands.LoadCosmetics(inputs[1]);
break;
case "Logging":
GenericCommands.Logging(inputs[1], inputs.Length > 2 ? inputs[2] : null, inputs.Length > 2 ? inputs[2] : null);
break;
Expand Down Expand Up @@ -87,6 +90,7 @@ internal static void ParseCommandsFile(string filename)
totalSeeds++;

GenericCommands.Seed("R");
GenericCommands.SettingsMode("1");

if (shuffleSettingsEachAttempt && !lastRunFailure) ShuffleAllOptions();

Expand Down Expand Up @@ -155,7 +159,7 @@ private static void ShuffleAllOptions()
lf.Active = rand.Next() % 2 == 0;
break;
case LogicDropdown ld:
ld.Selection = ld.Selections.Keys.ToList()[rand.Next() % ld.Selections.Keys.Count];
ld.Selection = ld.SelectionOptions[rand.Next() % ld.SelectionOptions.Length];
break;
// case LogicNumberBox lnb:
// lnb.Value = $"{rand.Next(lnb.MinValue, lnb.MaxValue + 1)}";
Expand Down
114 changes: 104 additions & 10 deletions MinishCapRandomizerCLI/GenericCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ internal static class GenericCommands
private static string? _cachedYAMLPathLogic;
private static string? _cachedYAMLPathCosmetics;
private static bool _cachedUseGlobalYAML = false;
private static bool _useCompactSettings = false;
private static bool _strict = false;

internal static void LoadRom(string? path = null)
Expand Down Expand Up @@ -192,23 +193,44 @@ internal static void LoadYAML(string? yamlFile = null, string? optionTypes = nul
ShufflerController.LoadCosmeticsFromCosmeticsString(YamlController.GetSelectedCosmeticsString());
break;
}

if (number != 0)
{
SwitchToNormalSettingsIfIncompatible();
}

Console.WriteLine("Settings loaded successfully!");
}

internal static void LoadSettings(string? settings = null)
{
Console.Write("Please enter the setting string to load: ");
var input = settings ?? Console.ReadLine();
if (!string.IsNullOrEmpty(input)) ShufflerController.LoadSettingsFromSettingString(input);
if (!string.IsNullOrEmpty(input))
{
ShufflerController.LoadSettingsFromSettingString(input);
SwitchToNormalSettingsIfIncompatible();
}
Console.WriteLine("Settings loaded successfully!");
}

// This option is not supported for use by command files, use the settings string option instead
internal static void LoadCosmetics(string? cosmetics = null)
{
Console.Write("Please enter the cosmetics string to load: ");
var input = cosmetics ?? Console.ReadLine();
if (!string.IsNullOrEmpty(input))
{
ShufflerController.LoadCosmeticsFromCosmeticsString(input);
SwitchToNormalSettingsIfIncompatible();
}
Console.WriteLine("Cosmetics loaded successfully!");
}

// This option is not supported for use by command files, use the settings string or YAML option instead
internal static void Options()
{
Console.WriteLine("Options for current logic file:");
var options = ShufflerController.GetSelectedOptions();
var settingsModeDescription = ShufflerController.IsCompactModeSupported() ? (_useCompactSettings ? " (compact settings mode)" : " (normal settings mode)") : "";
Console.WriteLine($"Options for current logic file{settingsModeDescription}:");
var options = _useCompactSettings && ShufflerController.IsCompactModeSupported() ? ShufflerController.GetCompactOptions() : ShufflerController.GetSelectedOptions();
for (var i = 0; i < options.Count; )
{
var option = options[i];
Expand Down Expand Up @@ -270,6 +292,60 @@ internal static void Options()
}
}

internal static void SettingsMode(string? option = null)
{
if (_useCompactSettings)
{
Console.WriteLine("Currently in compact settings mode.");
}
else
{
Console.WriteLine("Currently in normal settings mode.");
var isCompatible = !ShufflerController.IsCompactModeSupported() || ShufflerController.UpdateCompactOptionValues(false);
if (isCompatible)
{
Console.WriteLine("Switching to compact mode would not affect the currently selected options.");
}
else
{
Console.WriteLine("Warning: The currently selected options are not compatible with compact mode, so switching to compact mode would reset conflicting settings to their default values.");
}
}
if (!ShufflerController.IsCompactModeSupported())
{
Console.WriteLine("Note: The current logic file does not support compact mode, so this will have no effect unless you load a different logic file.");
}
Console.WriteLine("With which settings mode would you like to continue?");
Console.WriteLine("1) Normal settings");
Console.WriteLine("2) Compact settings");
Console.Write("Please enter the number of the mode you would like to use, or enter \"Exit\" to stop editing: ");
var input = option ?? Console.ReadLine();
if (!string.IsNullOrEmpty(input))
{
if (input.Equals("exit", StringComparison.OrdinalIgnoreCase))
{
return;
}
if (!int.TryParse(input, out var i) || i < 1 || i > 2)
{
PrintError("Invalid Input!");
return;
}
if (i == 1)
{
_useCompactSettings = false;
Console.WriteLine("Successfully enabled normal settings mode!");
}
else
{
ShufflerController.UpdateCompactOptionValues(true);
_useCompactSettings = true;
Console.WriteLine("Successfully enabled compact settings mode!");
}
}
else PrintError("Invalid Input!");
}

internal static void Logging(string? option = null, string? verbosityOption = null, string? logPath = null)
{
Console.WriteLine("1) Logger verbosity");
Expand Down Expand Up @@ -529,7 +605,7 @@ internal static string GetOptionValue(LogicOptionBase option)
}
case LogicDropdown dropdown:
{
return dropdown.Selection;
return dropdown.OptionsToNames[dropdown.Selection];
}
case LogicColorPicker colorPicker:
{
Expand Down Expand Up @@ -568,8 +644,8 @@ internal static void EditOption(LogicOptionBase option)
}
case LogicDropdown dropdown:
{
var keys = dropdown.Selections.Keys.ToList();
for (var i = 0; i < keys.Count; )
var keys = dropdown.SelectionOptionNames;
for (var i = 0; i < keys.Length; )
{
var selection = keys[i];
Console.WriteLine($"{++i}) {selection}");
Expand All @@ -578,7 +654,7 @@ internal static void EditOption(LogicOptionBase option)
Console.Write("Enter the number of the option you want for the dropdown: ");
var input = Console.ReadLine();

if (string.IsNullOrEmpty(input) || !int.TryParse(input, out var o) || o < 1 || o > keys.Count)
if (string.IsNullOrEmpty(input) || !int.TryParse(input, out var o) || o < 1 || o > keys.Length)
{
if (!input!.Equals("exit", StringComparison.OrdinalIgnoreCase))
{
Expand All @@ -587,7 +663,7 @@ internal static void EditOption(LogicOptionBase option)
break;
}

dropdown.Selection = keys[o - 1];
dropdown.Selection = dropdown.SelectionOptions[o - 1];
Console.WriteLine("Dropdown option set successfully!");
break;
}
Expand Down Expand Up @@ -672,6 +748,7 @@ internal static void EditOption(LogicOptionBase option)
break;
}
}
option.NotifyChildren();
}

internal static void PrintError(string msg)
Expand All @@ -683,6 +760,23 @@ internal static void PrintError(string msg)
}
}

private static void SwitchToNormalSettingsIfIncompatible()
{
if (_useCompactSettings && ShufflerController.IsCompactModeSupported())
{
var isCompatible = ShufflerController.UpdateCompactOptionValues(false);
if (!isCompatible)
{
_useCompactSettings = false;
Console.WriteLine("Note: Settings mode was switched to normal to avoid incompatibilities with the loaded options.");
}
else
{
ShufflerController.UpdateCompactOptionValues(true);
}
}
}

private static bool ValidatePreviouslyUsedController()
{
if (PreviouslyUsedController == null)
Expand Down
17 changes: 16 additions & 1 deletion MinishCapRandomizerCLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ private static void LoadCommands()
{"UseYAML", UseYAML},
{"LoadYAML", LoadYAML},
{"LoadSettings", LoadSettings},
{"LoadCosmetics", LoadCosmetics},
{"Options", Options},
{"SettingsMode", SettingsMode},
{"Logging", Logging},
{"Randomize", Randomize},
{"SaveRom", SaveRom},
Expand All @@ -88,8 +90,10 @@ LoadPatch Load custom patch file
ClearYAML Clears the cached YAML options and resets all logic options to defaults
LoadYAML Load YAML file to use as a Preset, replaces the selected options
UseYAML Use YAML file to use as a Preset or Mystery weights, instead of using the selected options
LoadSettings Load a setting string, replaces the selected options
LoadSettings Load a setting string, replaces the selected logic options
LoadCosmetics Load a cosmetics string, replaces the selected cosmetic options
Options Display options, allows editing of option values
SettingsMode Allows switching between normal and compact settings mode and shows whether there are any incompatibilities
Logging Allows you to change logger settings
Randomize Generates a randomized ROM
SaveRom Saves and patches the ROM, requires Randomize to have been called
Expand Down Expand Up @@ -125,6 +129,7 @@ private static void LoadPatch()
{
GenericCommands.LoadPatch();
}

private static void ClearYAML()
{
GenericCommands.ClearYAMLConfig();
Expand All @@ -145,11 +150,21 @@ private static void LoadSettings()
GenericCommands.LoadSettings();
}

private static void LoadCosmetics()
{
GenericCommands.LoadCosmetics();
}

private static void Options()
{
GenericCommands.Options();
}

private static void SettingsMode()
{
GenericCommands.SettingsMode();
}

private static void Logging()
{
GenericCommands.Logging();
Expand Down
13 changes: 9 additions & 4 deletions MinishCapRandomizerUI/Elements/ColorPickerWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,12 @@ public override List<Control> GetControls(int initialX, int initialY)
_selectColorButton.Enabled = !_checkBox.Checked;
_selectRandomColorButton.Enabled = !_checkBox.Checked;
_useDefaultColorButton.Enabled = !_checkBox.Checked;
if (_checkBox.Checked) _colorPreview.BackColor = Color.Transparent;
else _colorPreview.BackColor = _colorPicker.DefinedColor;
_colorPreview.BackColor = _checkBox.Checked ? Color.Transparent : _colorPicker.DefinedColor;
_colorPicker.NotifyChildren();
};

if (_colorPicker.UseRandomColor) _checkBox.Checked = true;

tip.SetToolTip(_checkBox, CheckboxToolTip);

return new List<Control>
Expand Down Expand Up @@ -191,30 +193,33 @@ private void SelectColor()
if (colorPicker.ShowDialog() != DialogResult.OK) return;
_colorPicker.DefinedColor = new GbaColor(colorPicker.Color).ToColor();
UpdateColorPreview();
_colorPicker.NotifyChildren();
}

private void SelectRandomColor()
{
_colorPicker.PickRandomColor();
UpdateColorPreview();
_colorPicker.NotifyChildren();
}

private void SelectDefaultColor()
{
_colorPicker.DefinedColor = _colorPicker.BaseColor;
UpdateColorPreview();
_colorPicker.NotifyChildren();
}

private void UpdateColorPreview()
{
if (_colorPreview == null) return;

_colorPreview.BackColor = _colorPicker.DefinedColor;
_colorPreview.BackColor = _checkBox!.Checked ? Color.Transparent : _colorPicker.DefinedColor;
}

public void NotifyObserver()
{
UpdateColorPreview();
_checkBox!.Checked = _colorPicker.UseRandomColor;
UpdateColorPreview();
}
}
15 changes: 9 additions & 6 deletions MinishCapRandomizerUI/Elements/DropdownWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ public override List<Control> GetControls(int initialX, int initialY)
};

var selectedDefaultItem = false;
foreach (var key in _dropdown.Selections.Keys)
var selectionName = _dropdown.OptionsToNames[_dropdown.Selection];
foreach (var key in _dropdown.SelectionOptionNames)
{
_comboBox.Items.Add(key);
if (!selectedDefaultItem && key == _dropdown.Selection)
if (!selectedDefaultItem && key == selectionName)
{
_comboBox.SelectedItem = _dropdown.Selection;
_comboBox.SelectedItem = selectionName;
selectedDefaultItem = true;
}
}
Expand All @@ -82,12 +83,14 @@ public override List<Control> GetControls(int initialX, int initialY)

_comboBox.SelectedIndexChanged += (object? sender, EventArgs e) =>
{
_dropdown.Selection = (string)_comboBox.SelectedItem!;
_dropdown.Selection = _dropdown.NamesToOptions[(string)_comboBox.SelectedItem!];
_dropdown.NotifyChildren();
};

_comboBox.SelectedValueChanged += (object? sender, EventArgs e) =>
{
_dropdown.Selection = (string)_comboBox.SelectedItem!;
_dropdown.Selection = _dropdown.NamesToOptions[(string)_comboBox.SelectedItem!];
_dropdown.NotifyChildren();
};

_comboBox.KeyPress += (object? sender, KeyPressEventArgs e) =>
Expand All @@ -100,7 +103,7 @@ public override List<Control> GetControls(int initialX, int initialY)

public void NotifyObserver()
{
var index = _dropdown.Selections.Keys.ToList().IndexOf(_dropdown.Selection);
var index = _dropdown.SelectionOptions.ToList().IndexOf(_dropdown.Selection);
_comboBox!.SelectedIndex = index;
}
}
1 change: 1 addition & 0 deletions MinishCapRandomizerUI/Elements/FlagWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public override List<Control> GetControls(int initialX, int initialY)
_checkBox.CheckedChanged += (object? sender, EventArgs e) =>
{
_flag.Active = _checkBox.Checked;
_flag.NotifyChildren();
};

return new List<Control> { _checkBox };
Expand Down
Loading