fix: yes/no box popping up after the question text closes, not over it

several places (Commands.ask, the give-a-nickname prompt, PC box release/
change confirms, start menu save/quit) pushed a bare ChoiceBox after the
preceding text box already popped on an A press, instead of riding
TextBox's opts.choice like the rest of the engine. the YES/NO box now
comes up while the question is still on screen, matching the original.
This commit is contained in:
spiritsnails
2026-08-01 21:36:30 -06:00
parent f205464aa4
commit 2b92562538
5 changed files with 126 additions and 35 deletions
+2 -1
View File
@@ -39,6 +39,7 @@ function TextBox.new(game, text, onDone, opts)
self.onDone = onDone
self.choice = opts and opts.choice
self.defaultNo = opts and opts.defaultNo
self.choiceNoSound = opts and opts.noSound
self.auto = opts and opts.auto
local box = Theme.textBox or {}
self.boxTx = box.tx or BOX_TX
@@ -240,7 +241,7 @@ function TextBox:update(dt)
self.game.stack:push(ChoiceBox.new(self.game, function(yes)
self.game.stack:pop() -- this text box, under the choice
self.choice(yes)
end, { defaultNo = self.defaultNo }))
end, { defaultNo = self.defaultNo, noSound = self.choiceNoSound }))
end
return
end