Reordering the trigger on custom message boxes

With frame perfect inputs, you could close these on the same frame as
they open, which in some cases leads to a soft lock of the game.
This commit is contained in:
mshirt 2016-12-12 17:44:48 -06:00
parent ae846e0976
commit f9a43eff45
3 changed files with 21 additions and 18 deletions

View file

@ -176,6 +176,13 @@ class Desktop_Message
return
end
if visible
if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL)
terminate_message
@fade_out = true
end
end
# Message is over and should be hidden or advanced to next
if $game_temp.message_desktop_text == nil
@fade_out = true if @viewport.visible
@ -189,12 +196,6 @@ class Desktop_Message
end
end
if visible
if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL)
terminate_message
@fade_out = true
end
end
end
#--------------------------------------------------------------------------
# * Variables

View file

@ -191,6 +191,13 @@ class Doc_Message
return
end
if visible
if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL)
terminate_message
@fade_out = true
end
end
# Message is over and should be hidden or advanced to next
if $game_temp.message_doc_text == nil
@fade_out = true if @viewport.visible
@ -204,12 +211,6 @@ class Doc_Message
end
end
if visible
if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL)
terminate_message
@fade_out = true
end
end
end
#--------------------------------------------------------------------------
# * Variables

View file

@ -179,6 +179,13 @@ class Ed_Message
return
end
if visible
if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL)
terminate_message
@fade_out_text = true
end
end
# Message is over and should be hidden or advanced to next
if $game_temp.message_ed_text == nil
@fade_out = true if @viewport.visible
@ -213,12 +220,6 @@ class Ed_Message
return
end
if visible
if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL)
terminate_message
@fade_out_text = true
end
end
end
#--------------------------------------------------------------------------
# * Variables