mkxp-sunshine/scripts/EdText.rb
Michael Shirt 1cba1adf66 Fixing bug with window prompts and adding credits message box
The game would try to catch up in frames when a window prompt was
opened, so if the window was open for 140 frames the game would process
the next 140 frames instantly after the game was closed.  To fix this, I
have the window prompt time how long it's opened and then I tell the
game to sleep for however many frames it was opened for.

Credits message works but does not yet have all the desired features,
will finish up later.
2016-10-29 18:44:06 -06:00

25 lines
831 B
Ruby

module EdText
def self.blue_understand
Oneshot.msgbox Oneshot::Msg::YESNO, tr("Do you understand what this means?")
end
def self.info(text)
timestart = Time.now
text.gsub!("\\p", $game_oneshot.player_name)
Oneshot.msgbox Oneshot::Msg::INFO, tr(text)
$game_temp.prompt_wait = ((Time.now - timestart) * 60).round
end
def self.yesno(text)
timestart = Time.now
text.gsub!("\\p", $game_oneshot.player_name)
result = Oneshot.msgbox Oneshot::Msg::YESNO, tr(text)
$game_temp.prompt_wait = ((Time.now - timestart) * 60).round
return result
end
def self.err(text)
timestart = Time.now
text.gsub!("\\p", $game_oneshot.player_name)
result = Oneshot.msgbox Oneshot::Msg::ERR, tr(text)
$game_temp.prompt_wait = ((Time.now - timestart) * 60).round
return result
end
end