Options Creator: Fix handling of options with random default - #6317
Open
duckboycool wants to merge 4 commits into
Open
Options Creator: Fix handling of options with random default#6317duckboycool wants to merge 4 commits into
duckboycool wants to merge 4 commits into
Conversation
… for things like underscores in choice name
duckboycool
commented
Jul 7, 2026
| if issubclass(option, Range): | ||
| self.options[name] = option.range_start | ||
| elif issubclass(option, Choice): | ||
| self.options[name] = list(option.options.values())[0] |
Collaborator
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this fixing or adding?
Currently, an option which defaults to
randomwill be shown as such in the Options Creator, but if it is unselected, its underlying value remains asrandom(and it will be exported as such) even though the displayed value is now something else. Example: https://discord.com/channels/731205301247803413/1522543645826355271This 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
TextChoicethe "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.
🎲