Fix eliminated-choice strikethrough disappearing on wrong/correct reveal
A choice that was crossed out (right-click) and also happened to be locked as the submitted-wrong choice, or revealed as the correct answer, silently lost its strikethrough because the percentage-badge branches took precedence over the elimination check in the same if/elif chain. Decoupled the two so a choice can show both the strikethrough and its reveal percentage at once.
This commit is contained in:
@@ -2968,17 +2968,11 @@ func _set_choice_button_text(index: int, choice: Dictionary) -> void:
|
||||
choice_buttons[index].custom_minimum_size = Vector2(0, 54)
|
||||
_set_choice_percent_label(index, "")
|
||||
_set_choice_top_label(index, "")
|
||||
if locked_wrong_choice_ids.has(choice_id):
|
||||
if locked_wrong_choice_ids.has(choice_id) or _should_show_correct_choice_percentage(choice_id):
|
||||
var percentage := _get_choice_selection_percentage(choice_id)
|
||||
if percentage >= 0:
|
||||
_set_choice_percent_label(index, "%d%%" % percentage)
|
||||
choice_buttons[index].text = choice_text
|
||||
elif _should_show_correct_choice_percentage(choice_id):
|
||||
var correct_percentage := _get_choice_selection_percentage(choice_id)
|
||||
if correct_percentage >= 0:
|
||||
_set_choice_percent_label(index, "%d%%" % correct_percentage)
|
||||
choice_buttons[index].text = choice_text
|
||||
elif eliminated.has(choice_id):
|
||||
if eliminated.has(choice_id):
|
||||
choice_buttons[index].text = ""
|
||||
_set_choice_top_label(index, "[s]%s[/s]" % _escape_bbcode(choice_text))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user