Add character calls, settings controls, and gameplay fixes

This commit is contained in:
Alexander Sellite 2026-08-09 11:22:35 -04:00
parent 7b2898c11a
commit 40696b6bd9
33 changed files with 1120 additions and 78 deletions

View file

@ -7,6 +7,8 @@ const MIN_MOUSE_SENSITIVITY: float = 0.001
const MAX_MOUSE_SENSITIVITY: float = 0.012
const MIN_CONTROLLER_SENSITIVITY: float = 0.5
const MAX_CONTROLLER_SENSITIVITY: float = 5.0
const MIN_AUDIO_VOLUME: float = 0.0
const MAX_AUDIO_VOLUME: float = 1.0
const MIN_WORLD_PIXEL_SIZE: int = 1
const MAX_WORLD_PIXEL_SIZE: int = 5
const DEFAULT_WORLD_PIXEL_SIZE: int = 3
@ -33,6 +35,11 @@ const UI_COMPACT_RENDER_HEIGHTS: Array[int] = [0, 408, 336, 264, 192]
@export var chat_dock_right: bool = false
@export var chat_mobile_mode: bool = false
@export var paint_dock_right: bool = true
@export var fullscreen_enabled: bool = false
@export_range(0.0, 1.0, 0.01) var master_volume: float = 1.0
@export_range(0.0, 1.0, 0.01) var music_volume: float = 1.0
@export_range(0.0, 1.0, 0.01) var effects_volume: float = 1.0
@export_range(0.0, 1.0, 0.01) var environment_volume: float = 1.0
@export_range(1, 5, 1) var world_pixel_size: int = DEFAULT_WORLD_PIXEL_SIZE
@export_range(1, 5, 1) var ui_pixel_size: int = DEFAULT_UI_PIXEL_SIZE
@ -48,6 +55,10 @@ func is_valid() -> bool:
and is_finite(controller_camera_sensitivity)
and controller_camera_sensitivity >= MIN_CONTROLLER_SENSITIVITY
and controller_camera_sensitivity <= MAX_CONTROLLER_SENSITIVITY
and _is_valid_audio_volume(master_volume)
and _is_valid_audio_volume(music_volume)
and _is_valid_audio_volume(effects_volume)
and _is_valid_audio_volume(environment_volume)
and chat_draft.length() <= MAX_CHAT_DRAFT_CHARACTERS
and world_pixel_size >= MIN_WORLD_PIXEL_SIZE
and world_pixel_size <= MAX_WORLD_PIXEL_SIZE
@ -70,11 +81,24 @@ func copy() -> PlayerSettings:
result.chat_dock_right = chat_dock_right
result.chat_mobile_mode = chat_mobile_mode
result.paint_dock_right = paint_dock_right
result.fullscreen_enabled = fullscreen_enabled
result.master_volume = master_volume
result.music_volume = music_volume
result.effects_volume = effects_volume
result.environment_volume = environment_volume
result.world_pixel_size = world_pixel_size
result.ui_pixel_size = ui_pixel_size
return result
static func _is_valid_audio_volume(value: float) -> bool:
return (
is_finite(value)
and value >= MIN_AUDIO_VOLUME
and value <= MAX_AUDIO_VOLUME
)
static func get_world_grid_height(
pixel_size: int,
displayed_height: int,