Making automash a settings option

This commit is contained in:
mshirt 2019-09-05 22:49:55 -07:00
parent 7c580aa109
commit 3ee6bf7356
5 changed files with 36 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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