From a6c7e2c1ff4c9ccdb61b6f8ed53c784c6192c845 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sun, 1 Oct 2023 18:52:48 +0100 Subject: [PATCH] Added Setting that prompts compiling upon startup --- Data/Scripts/001_Settings.rb | 7 +++++++ Data/Scripts/001_Technical/005_PluginManager.rb | 1 + Data/Scripts/021_Compiler/001_Compiler.rb | 2 +- Data/Scripts/999_Main/999_Main.rb | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index b96e5b924..795152420 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -452,6 +452,13 @@ module Settings "Pizza" ] end + + #============================================================================= + + # Whether the game will ask you if you want to fully compile every time you + # start the game (in Debug mode). You will not need to hold Ctrl/Shift to + # compile anything. + PROMPT_TO_COMPILE = false end # DO NOT EDIT THESE! diff --git a/Data/Scripts/001_Technical/005_PluginManager.rb b/Data/Scripts/001_Technical/005_PluginManager.rb index 2a3947d00..9ef2c3e29 100644 --- a/Data/Scripts/001_Technical/005_PluginManager.rb +++ b/Data/Scripts/001_Technical/005_PluginManager.rb @@ -555,6 +555,7 @@ module PluginManager def self.needCompiling?(order, plugins) # fixed actions return false if !$DEBUG || FileTest.exist?("Game.rgssad") + return true if $full_compile return true if !FileTest.exist?("Data/PluginScripts.rxdata") Input.update return true if Input.press?(Input::SHIFT) || Input.press?(Input::CTRL) diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index 726975986..a050bc5e1 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -1078,7 +1078,7 @@ module Compiler mustCompile |= (latestTextTime >= latestDataTime) # Should recompile if holding Ctrl Input.update - mustCompile = true if Input.press?(Input::CTRL) + mustCompile = true if $full_compile || Input.press?(Input::CTRL) # Delete old data files in preparation for recompiling if mustCompile data_files.each do |filename| diff --git a/Data/Scripts/999_Main/999_Main.rb b/Data/Scripts/999_Main/999_Main.rb index 95cd485d1..1dc013c24 100644 --- a/Data/Scripts/999_Main/999_Main.rb +++ b/Data/Scripts/999_Main/999_Main.rb @@ -25,6 +25,12 @@ end def mainFunctionDebug begin MessageTypes.load_default_messages if FileTest.exist?("Data/messages_core.dat") + if $DEBUG && !FileTest.exist?("Game.rgssad") && Settings::PROMPT_TO_COMPILE + pbSetResizeFactor(1) # Needed to make the message look good + if pbConfirmMessage("\\ts[]" + "Do you want to compile your data and plugins?") + $full_compile = true + end + end PluginManager.runPlugins Compiler.main Game.initialize