Skip to content

Options Creator: Fix handling of options with random default - #6317

Open
duckboycool wants to merge 4 commits into
ArchipelagoMW:mainfrom
duckboycool:options_creator_random_default
Open

Options Creator: Fix handling of options with random default#6317
duckboycool wants to merge 4 commits into
ArchipelagoMW:mainfrom
duckboycool:options_creator_random_default

Conversation

@duckboycool

Copy link
Copy Markdown
Collaborator

What is this fixing or adding?

Currently, an option which defaults to random will be shown as such in the Options Creator, but if it is unselected, its underlying value remains as random (and it will be exported as such) even though the displayed value is now something else. Example: https://discord.com/channels/731205301247803413/1522543645826355271
This sets the value upon initialization to the same thing that is being displayed so there isn't a mismatch.

Also while doing this, I noticed that the random button can appear (and seemingly just error if used) for option types the creator can't actually display, that it's apparently possible to click on the edge of a disabled Choice option and set it to something else while randomized (which also causes a mismatch between display and actual value), and that on a TextChoice the "Custom" text doesn't show unless you press enter, whereas the value updates upon any text change, so I changed these things as well.

How was this tested?

Exporting options from ALttP and The Witness, which have default-random Choices/Ranges, and also testing changing other option types to default to random to make sure they also work.

If this makes graphical changes, please attach screenshots.

🎲

@github-actions github-actions Bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Jul 7, 2026
Comment thread OptionsCreator.py
if issubclass(option, Range):
self.options[name] = option.range_start
elif issubclass(option, Choice):
self.options[name] = list(option.options.values())[0]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TextChoices here keep the random text in the textbox, which I guess is fine but doesn't seem super preferable. I tried to change this and also make it so picking an option from the dropdown clears the textbox, but this kind of brings madness since it doesn't seem like there's a way in kivy to distinguish the user changing the text compared to modifying .text manually in the program. Gotta love kivy.

This also does technically change how the exported options may look in the yaml compared to selecting them normally, but it should at least give a correct way of representing the value.

@duckboycool duckboycool added the is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. label Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects: core Issues/PRs that touch core and may need additional validation. is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant