Conversation
When adding a status highlight rule via status_hilite_menu_add(), canceling (ESC / -1) at the color selection dialog (query_color) for non-value fields (e.g. string fields like BL_DUNGEON or BL_TITLE with BL_TH_UPDOWN, BL_TH_CONDITION, BL_TH_TEXTMATCH, or BL_TH_ALWAYS_HILITE) caused a jump to 'goto choose_value;'. Because those options do not perform any value input prompt in choose_value, execution immediately fell through back to choose_color, creating an infinite loop that prompted for color repeatedly until retry limit was exceeded. Fix this by jumping to 'goto choose_behavior;' upon color selection cancel when the selected behavior does not prompt for a numeric value, allowing the user to cleanly step back to the behavior selection menu.
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.
When adding a status highlight rule via status_hilite_menu_add(), canceling (ESC / -1) at the color selection dialog (query_color) for non-value fields (e.g. string fields like BL_DUNGEON or BL_TITLE with BL_TH_UPDOWN, BL_TH_CONDITION, BL_TH_TEXTMATCH, or BL_TH_ALWAYS_HILITE) caused a jump to 'goto choose_value;'.
Because those options do not perform any value input prompt in choose_value, execution immediately fell through back to choose_color, creating an infinite loop that prompted for color repeatedly until retry limit was exceeded.
Fix this by jumping to 'goto choose_behavior;' upon color selection cancel when the selected behavior does not prompt for a numeric value, allowing the user to cleanly step back to the behavior selection menu.
Summary
What changed?
Modified the cancel handling (
clr == -1) instatus_hilite_menu_add()withinsrc/botl.c. When color selection is canceled, execution now jumps tochoose_behaviorinstead ofchoose_valueif the selected rule/field does not prompt for numeric threshold values (specifically:BL_TH_UPDOWNonANY_STRfields,BL_TH_CONDITION,BL_TH_TEXTMATCH, andBL_TH_ALWAYS_HILITE).Why is this needed?
Fixes an infinite prompt loop when canceling color selection in the
#status_hilitemenu for non-numeric/string fields (e.g.dungeon level,title, or condition/textmatch rules). Previously, canceling color selection jumped togoto choose_value;. Sincechoose_value:performs no user prompts for these field/behavior types, execution immediately fell through back tochoose_color:, re-opening the color picker continuously until exceeding the retry threshold ("Too many retries.").Scope
src/,include/,sys/)dat/,docs/, README)Validation
Commands run (if any):
Reproduction & Verification Steps:
Checklist
[x] Security-sensitive changes reviewed
[x] License/notice impact checked
[x] Related issue linked