code clean 2

This commit is contained in:
CatWindow 2026-08-19 20:01:06 +03:00
parent 62532c4509
commit dcd7c362a5
2 changed files with 115 additions and 102 deletions

View File

@ -2,14 +2,14 @@ module Settings
class << self
def reset!
@data = {
# Audio
# ------------ Audio ------------
:master_volume => 100,
:bgm_volume => 100,
:sfx_volume => 100,
:fight_crime_track => false,
:old_reprise_song => false,
# Video
# ------------ Video ------------
:fullscreen => false,
:resolution => 0,
:colorblind => false,
@ -20,13 +20,13 @@ module Settings
:vsync => 0,
:max_firefly_count => 30,
# UI
# ------------- UI --------------
:in_game_timer => false,
:language => 0,
:fasttravel_ui => 0,
:mainmenu_background => 0,
# Gameplay
# ---------- Gameplay -----------
:movement => 0,
:skip_text => false,
:en_purple_messagebox => true,
@ -37,18 +37,18 @@ module Settings
:disable_api_puzzles => false, #disable_pizzles_for_fuckin_gayland_users_gayland_devs_fix_your_bullshit_already
:wallpaper_mode => 0,
# Advanced
# ---------- Advanced -----------
:crashlog_privacy => false,
:streamer_privacy => false,
:invalid_param_checks => false,
#controls
# ---------- Сontrols -----------
:gamepad_type => -1,
:gamepad_face_style => 0,
:gamepad_led => true,
:gamepad_deadzone => 5,
# Debug
# ------------ Debug ------------
:debug => false,
:debug_character => false,
:debug_text_scene_title => true,

View File

@ -8,22 +8,24 @@ module Settings
# name must be same as the parameter identifier
def crashlog_privacy(value)
Sunshine.crash_privacy = value
end
# ---------------------------------------------- Audio --------------------------------------------
def master_volume(value)
Audio.master_volume = value / 100.0
end
def bgm_volume(value)
Audio.bgm_volume = value
end
def sfx_volume(value)
Audio.sfx_volume = value
end
# ---------------------------------------------- Video --------------------------------------------
def fullscreen(value)
Graphics.fullscreen = $console = value
end
def resolution(value)
if (!Graphics::RESOLUTION_OVERRIDDEN)
res_data = Graphics::RESOLUTIONS&.[](value) || {:width => 480, :height => 640}
@ -36,39 +38,16 @@ module Settings
end
end
def scaling_mode(value)
Graphics.smooth = value != 0
end
def colorblind(value)
$game_switches[252] = value
end
# UI
def in_game_timer(value)
$game_temp.igt_timer_visible = value
if $scene.is_a?(Scene_Map) && $scene&.in_game_timer
$scene.in_game_timer.visible = $game_temp.igt_timer_visible
end
end
def language(value)
$persistent.lang = Language::LANGUAGES[value]
$scene&.redraw
end
def movement(value)
$game_switches[251] = value != 0
end
def skip_text(value)
$game_switches[253] = value != 0
end
def frameskip(value)
Graphics.frameskip = value
end
def invalid_param_checks(value)
Sunshine.set_sdl_hint("SDL_HINT_INVALID_PARAM_CHECKS", value ? "1" : "2")
def scaling_mode(value)
Graphics.smooth = value != 0
end
VSYNC_MODES = [1, -1, 0]
@ -76,6 +55,43 @@ module Settings
Graphics.setVsync(VSYNC_MODES[value])
end
# ----------------------------------------------- UI -----------------------------------------------
def in_game_timer(value)
$game_temp.igt_timer_visible = value
if $scene.is_a?(Scene_Map) && $scene&.in_game_timer
$scene.in_game_timer.visible = $game_temp.igt_timer_visible
end
end
def language(value)
$persistent.lang = Language::LANGUAGES[value]
$scene&.redraw
end
# -------------------------------------------- Gameplay --------------------------------------------
def movement(value)
$game_switches[251] = value != 0
end
def skip_text(value)
$game_switches[253] = value != 0
end
WALLPAPER_MODES = ["normal", "fallback", "disbled"]
def wallpaper_mode(value)
Sunshine.wallpaper_mode = WALLPAPER_MODES[value]
end
# -------------------------------------------- Advanced --------------------------------------------
def crashlog_privacy(value)
Sunshine.crash_privacy = value
end
def invalid_param_checks(value)
Sunshine.set_sdl_hint("SDL_HINT_INVALID_PARAM_CHECKS", value ? "1" : "2")
end
# --------------------------------------------- Debug ----------------------------------------------
def shutdown_dbus_on_quit(value)
Sunshine.set_sdl_hint("SDL_HINT_SHUTDOWN_DBUS_ON_QUIT", value ? "1" : "0")
end
@ -84,10 +100,7 @@ module Settings
Profiler.set(value)
end
WALLPAPER_MODES = ["normal", "fallback", "disbled"]
def wallpaper_mode(value)
Sunshine.wallpaper_mode = WALLPAPER_MODES[value]
end
# --------------------------------------------- End :3 ---------------------------------------------
end
end
end