From 3ee6bf7356d26acc31da5ab954abaef57db0e611 Mon Sep 17 00:00:00 2001 From: mshirt Date: Thu, 5 Sep 2019 22:49:55 -0700 Subject: [PATCH] Making automash a settings option --- scripts/Desktop_Message.rb | 2 +- scripts/Doc_Message.rb | 2 +- scripts/Ed_Message.rb | 2 +- scripts/Window_Message.rb | 4 ++-- scripts/Window_Settings.rb | 36 +++++++++++++++++++++++++++++++----- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/scripts/Desktop_Message.rb b/scripts/Desktop_Message.rb index 3690f18..2d10860 100644 --- a/scripts/Desktop_Message.rb +++ b/scripts/Desktop_Message.rb @@ -178,7 +178,7 @@ class Desktop_Message end if visible - if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || Input.press?(Input::R) + if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || (Input.press?(Input::R) && $game_switches[253]) terminate_message @fade_out = true end diff --git a/scripts/Doc_Message.rb b/scripts/Doc_Message.rb index 2e4c23e..4ac521a 100644 --- a/scripts/Doc_Message.rb +++ b/scripts/Doc_Message.rb @@ -233,7 +233,7 @@ class Doc_Message end if visible - if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || Input.press?(Input::R) + if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || (Input.press?(Input::R) && $game_switches[253]) terminate_message @fade_out = true end diff --git a/scripts/Ed_Message.rb b/scripts/Ed_Message.rb index 1e6c319..df601e9 100644 --- a/scripts/Ed_Message.rb +++ b/scripts/Ed_Message.rb @@ -181,7 +181,7 @@ class Ed_Message end if visible - if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || Input.press?(Input::R) + if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || (Input.press?(Input::R) && $game_switches[253]) terminate_message @fade_out_text = true end diff --git a/scripts/Window_Message.rb b/scripts/Window_Message.rb index a7cab21..bbe2dcb 100644 --- a/scripts/Window_Message.rb +++ b/scripts/Window_Message.rb @@ -398,7 +398,7 @@ class Window_Message < Window_Selectable end tick end - if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || Input.press?(Input::R) + if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || (Input.press?(Input::R) && $game_switches[253]) @skip_text = true end else @@ -434,7 +434,7 @@ class Window_Message < Window_Selectable self.pause = true # Advance/Close message - if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || Input.press?(Input::R) + if Input.trigger?(Input::ACTION) || Input.trigger?(Input::CANCEL) || (Input.press?(Input::R) && $game_switches[253]) if @text.length <= 0 terminate_message else diff --git a/scripts/Window_Settings.rb b/scripts/Window_Settings.rb index 51c6940..85e5ae3 100644 --- a/scripts/Window_Settings.rb +++ b/scripts/Window_Settings.rb @@ -15,6 +15,7 @@ class Window_Settings file.puts('fullscreen=' + Graphics.fullscreen.to_s) file.puts('default_run=' + $game_switches[251].to_s) file.puts('colorblind_mode=' + $game_switches[252].to_s) + file.puts('automash_enabled=' + $game_switches[253].to_s) file.puts('frameskip=' + Graphics.frameskip.to_s) end end @@ -57,6 +58,12 @@ class Window_Settings elsif vals[1] == "false" $game_switches[252] = false end + when "automash_enabled" + if vals[1] == "true" + $game_switches[253] = true + elsif vals[1] == "false" + $game_switches[253] = false + end when "frameskip" if vals[1] == "true" Graphics.frameskip = true @@ -119,6 +126,7 @@ class Window_Settings tr('Fullscreen'), tr('Default movement'), tr('Colorblind mode'), + tr('Skip Text (R)'), tr('Frameskip'), tr('Language'), tr('Configure Controls (Press F1)'), @@ -183,13 +191,19 @@ class Window_Settings else spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF")) end - when 5 #frameskip + when 5 #automash + if($game_switches[253] == true) + spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("ON")) + else + spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF")) + end + when 6 #frameskip if(Graphics.frameskip == true) spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("ON")) else spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr("OFF")) end - when 6 # Language + when 7 # Language l = Language::LANGUAGES[@lang_index] rescue Language::LANGUAGES[0] spr.bitmap.draw_text(VALUE_MARGIN, 0, spr.bitmap.width, spr.bitmap.height, tr(l)) end @@ -386,7 +400,19 @@ class Window_Settings redraw_setting_index(4) end - when 5 #frameskip + when 5 #automash + if Input.trigger?(Input::ACTION) || Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT) + + $game_system.se_play($data_system.decision_se) + if $game_switches[253] == true + $game_switches[253] = false + else + $game_switches[253] = true + end + redraw_setting_index(5) + end + + when 6 #frameskip if Input.trigger?(Input::ACTION) || Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT) $game_system.se_play($data_system.decision_se) @@ -395,10 +421,10 @@ class Window_Settings else Graphics.frameskip = true end - redraw_setting_index(5) + redraw_setting_index(6) end - when 6 #language + when 7 #language if Input.trigger?(Input::ACTION) || Input.trigger?(Input::RIGHT) @lang_index += 1 if @lang_index >= Language::LANGUAGES.length