using Cthangover.Mods.Interface.Base.Lists; using Cthangover.Mods.Dialog.Action.Impls; using Godot; using Cthangover.Core.UI; using Cthangover.Core.UI.Dialog; using Cthangover.Core.UI.Event; using Cthangover.Core.UI.Executable; using Cthangover.Core.Scenarios; using Cthangover.Core.Scenes; using Cthangover.Core.Interactive; namespace Cthangover.Mods.Dialog { /// /// Renders a single dialog choice option. Walks up the scene tree in OnReady /// to find the nearest IDialogBox parent — this avoids coupling to a specific /// dialog implementation and lets answer items work regardless of nesting depth. /// On click, calls SelectVariant on the found dialog box, passing the bound /// SelectVariant model (which carries the GoTo target and display text). /// public partial class AnswerItem : ListItem { [Export] private Label textField; private DialogBox dialogBox; /// Binds the choice button from the answer_item scene prefab and finds the owning dialog box by walking up the tree, so items work at any nesting depth. protected override void OnReady() { textField ??= GetNode