Improve precision of dialogue box confirm/canceling

This commit is contained in:
Kyle Coburn 2015-05-12 12:48:39 -07:00
parent 391b7628c9
commit 838d276820
3 changed files with 18 additions and 15 deletions

View File

@ -631,11 +631,12 @@ Strategies.functions = {
return interact(data.dir, data.long)
end,
confirm = function(data)
dialogue = function(data)
if Battle.handleWild() then
if Textbox.isActive() then
status.talked = true
Input.cancel(data.type or "A")
if Input.cancel(data.decline and "B" or "A") then
status.talked = true
end
else
if status.talked then
return true
@ -1981,7 +1982,7 @@ Strategies.functions = {
end
Bridge.chat("is taking the Center to heal for Lorelei.")
end
return strategyFunctions.confirm({dir="Up"})
return strategyFunctions.dialogue({dir="Up"})
end,
prepareForLance = function()

View File

@ -62,19 +62,20 @@ function Input.press(button, frames, walk)
end
function Input.cancel(accept)
if accept and Memory.value("menu", "shop_current") == 20 then
if accept and Memory.value("menu", "option_dialogue") == 20 then
Input.press(accept)
else
local button
if bCancel then
button = "B"
else
button = "A"
end
remainingFrames = 0
sendButton(button, true)
bCancel = not bCancel
return true
end
local button
if bCancel then
button = "B"
else
button = "A"
end
remainingFrames = 0
sendButton(button, true)
bCancel = not bCancel
end
function Input.escape()

View File

@ -26,6 +26,7 @@ local memoryNames = {
text_input = 0x04B6,
text_length = 0x0EE9,
main = 0x1FF5,
option_dialogue = 0x1125,
},
player = {
name = 0x1158,