mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-14 10:13:33 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user