EventOptionUI

Overview

Renders a single response option of a Chairman Event: background color/hue by personality, a line of effect icons with +/- signs, a localized description, and interactivity state. Displays a “tap to confirm” prompt when selected, and a “missing tokens” message when invalid. fileciteturn24file1

Serialized

Sprites:

  • PoliceSeverity, CartelSeverity, Control, Money, Loyalty, Demand
  • MobsterTokens, SchemerTokens, SubterfugeTokens
  • Backgrounds: mobsterBackground, schemerBackground, subterfugeBackground

UI:

  • Image background, Button button, TextMeshProUGUI optionDesc
  • List<Image> effectIcons (icons are paired with a small TMP text for +/-) fileciteturn24file1

Behavior

  • UpdateUI(EventResponse response, bool valid):
    • Saves isValid = valid, sets optionDesc to either the cached localized string or EVENT_MISSING_TOKENS (I2).
    • Enables/disables button and fades text/background alpha when invalid.
    • Picks the background sprite from the last effect: Mobster/Schemer/Subterfuge affinity ⇒ corresponding background.
    • Populates effectIcons[i] for each effect with correct sprite and a +/- sign by value; hides extra slots. fileciteturn24file1
  • OnSelected() / OnUnselected(): swaps description to EVENT_TAP_CONFIRM and back.
  • Localize(localizedDesc, selected): stores text and re-applies according to selected and isValid. fileciteturn24file1