UI and other changes
This commit is contained in:
parent
87b5c11fcf
commit
215e24e246
79 changed files with 70023 additions and 2201 deletions
|
|
@ -195,7 +195,7 @@ func _settings(r: GameTestRunner) -> void:
|
|||
_clean()
|
||||
var fresh := GameSettings.load_from(SETTINGS)
|
||||
r.check(fresh.volume == GameSettings.DEFAULT_VOLUME and fresh.show_tips and fresh.vsync and not fresh.fullscreen
|
||||
and fresh.resolution_scale == 1.0, "no settings file: the defaults")
|
||||
and fresh.resolution_scale == 1.0 and fresh.pixel_size == 4, "no settings file: the defaults")
|
||||
var g := GameSettings.new()
|
||||
g.volume = {"Master": 0.5, "Music": 0.25, "SFX": 0.0, "Ambience": 1.0, "Voice": 0.6}
|
||||
g.move_dead_zone = 0.35
|
||||
|
|
@ -203,6 +203,7 @@ func _settings(r: GameTestRunner) -> void:
|
|||
g.fullscreen = true
|
||||
g.vsync = false
|
||||
g.resolution_scale = 0.75
|
||||
g.pixel_size = 2
|
||||
g.show_tips = false
|
||||
g.player_name = "Ana"
|
||||
g.microphone = false
|
||||
|
|
@ -210,16 +211,27 @@ func _settings(r: GameTestRunner) -> void:
|
|||
var back := GameSettings.load_from(SETTINGS)
|
||||
r.check(back.volume == g.volume and back.move_dead_zone == 0.35 and back.aim_dead_zone == 0.15 and back.fullscreen
|
||||
and not back.vsync and back.resolution_scale == 0.75 and not back.show_tips and back.player_name == "Ana"
|
||||
and not back.microphone, "and load back unchanged (co-op name and microphone too)")
|
||||
and not back.microphone and back.pixel_size == 2, "and load back unchanged (co-op name, microphone, pixel size too)")
|
||||
var f := ConfigFile.new()
|
||||
f.set_value("audio", "master", 7.0)
|
||||
f.set_value("audio", "music", "loud")
|
||||
f.set_value("display", "fullscreen", "yes")
|
||||
f.set_value("display", "resolution_scale", 0.1)
|
||||
f.set_value("display", "pixel_size", 40)
|
||||
f.save(SETTINGS)
|
||||
var odd := GameSettings.load_from(SETTINGS)
|
||||
r.check(odd.volume["Master"] == 1.0 and odd.volume["Music"] == GameSettings.DEFAULT_VOLUME["Music"] and not odd.fullscreen
|
||||
and odd.resolution_scale == 0.5, "out-of-range and wrong-typed values are clamped or fall back")
|
||||
and odd.resolution_scale == 0.5 and odd.pixel_size == GameSettings.MAX_PIXEL_SIZE,
|
||||
"out-of-range and wrong-typed values are clamped or fall back")
|
||||
var view := SubViewport.new()
|
||||
g.apply_pixels(view)
|
||||
r.check(view.scaling_3d_mode == Viewport.SCALING_3D_MODE_NEAREST and is_equal_approx(view.scaling_3d_scale, 0.5)
|
||||
and view.msaa_3d == Viewport.MSAA_DISABLED, "pixel size 2 renders the 3D view at half size, sharp-scaled, no MSAA")
|
||||
g.pixel_size = 1
|
||||
g.apply_pixels(view)
|
||||
r.check(view.scaling_3d_mode == Viewport.SCALING_3D_MODE_BILINEAR and is_equal_approx(view.scaling_3d_scale, 0.75),
|
||||
"pixel size 1 turns that off and uses the resolution scale")
|
||||
view.free()
|
||||
var cfg := (load("res://game/resources/game_config.tres") as GameConfig).duplicate() as GameConfig
|
||||
g.apply(null, cfg)
|
||||
var music := AudioServer.get_bus_index("Music")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue