Refactor game window and shader management; add fog shader implementation and update configuration settings

This commit is contained in:
2026-03-29 04:44:55 +00:00
parent 3dbeadf976
commit 2064232226
6 changed files with 296 additions and 171 deletions
+13 -4
View File
@@ -8,16 +8,25 @@ module Config
@config = {
debug: ARGV.include?("--debug"),
fog: true,
torches_lightup: false
torches_lightup: true,
}
$bus.on(:settings) do |k|
next @config[k]
if File.exist?("config.json")
data = JSON.parse(File.read("config.json"))
@config.merge!(data.transform_keys(&:to_sym))
end
$bus.on(:settings) { |k| @config[k] }
module_function
def toggle(key)
@config[key] = !@config[key]
end
def persist!
File.open("config.json", "w") do |f|
f.write(JSON.pretty_generate(@config))
end
end
end