Added Setting that prompts compiling upon startup

This commit is contained in:
Maruno17
2023-10-01 18:52:48 +01:00
parent cd32b5e725
commit a6c7e2c1ff
4 changed files with 15 additions and 1 deletions

View File

@@ -452,6 +452,13 @@ module Settings
"Pizza" "Pizza"
] ]
end 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 end
# DO NOT EDIT THESE! # DO NOT EDIT THESE!

View File

@@ -555,6 +555,7 @@ module PluginManager
def self.needCompiling?(order, plugins) def self.needCompiling?(order, plugins)
# fixed actions # fixed actions
return false if !$DEBUG || FileTest.exist?("Game.rgssad") return false if !$DEBUG || FileTest.exist?("Game.rgssad")
return true if $full_compile
return true if !FileTest.exist?("Data/PluginScripts.rxdata") return true if !FileTest.exist?("Data/PluginScripts.rxdata")
Input.update Input.update
return true if Input.press?(Input::SHIFT) || Input.press?(Input::CTRL) return true if Input.press?(Input::SHIFT) || Input.press?(Input::CTRL)

View File

@@ -1078,7 +1078,7 @@ module Compiler
mustCompile |= (latestTextTime >= latestDataTime) mustCompile |= (latestTextTime >= latestDataTime)
# Should recompile if holding Ctrl # Should recompile if holding Ctrl
Input.update 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 # Delete old data files in preparation for recompiling
if mustCompile if mustCompile
data_files.each do |filename| data_files.each do |filename|

View File

@@ -25,6 +25,12 @@ end
def mainFunctionDebug def mainFunctionDebug
begin begin
MessageTypes.load_default_messages if FileTest.exist?("Data/messages_core.dat") 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 PluginManager.runPlugins
Compiler.main Compiler.main
Game.initialize Game.initialize