feat: Introduce comprehensive settings management with UI for video, audio, and remappable controls.
This commit is contained in:
@@ -18,12 +18,22 @@ func _process(delta):
|
||||
if TurnManager.turn_based_mode:
|
||||
return
|
||||
|
||||
# Continuous movement input
|
||||
var move_vec = Vector2i.ZERO
|
||||
if Input.is_action_pressed("move_north"): move_vec.y -= 1
|
||||
if Input.is_action_pressed("move_south"): move_vec.y += 1
|
||||
if Input.is_action_pressed("move_east"): move_vec.x += 1
|
||||
if Input.is_action_pressed("move_west"): move_vec.x -= 1
|
||||
# 1. Controller / Joystick Movement
|
||||
if SettingsManager and SettingsManager.settings.controls.get("use_controller", false):
|
||||
var joystick_vec = Input.get_vector("move_west", "move_east", "move_north", "move_south")
|
||||
if joystick_vec.length() > 0.3: # Deadzone
|
||||
if abs(joystick_vec.x) > abs(joystick_vec.y):
|
||||
move_vec.x = 1 if joystick_vec.x > 0 else -1
|
||||
else:
|
||||
move_vec.y = 1 if joystick_vec.y > 0 else -1
|
||||
|
||||
# 2. Keyboard Movement (Fallback)
|
||||
if move_vec == Vector2i.ZERO:
|
||||
if Input.is_action_pressed("move_north"): move_vec.y -= 1
|
||||
if Input.is_action_pressed("move_south"): move_vec.y += 1
|
||||
if Input.is_action_pressed("move_east"): move_vec.x += 1
|
||||
if Input.is_action_pressed("move_west"): move_vec.x -= 1
|
||||
|
||||
# Fallback for explicit diagonal actions (if mapped)
|
||||
if move_vec == Vector2i.ZERO:
|
||||
@@ -33,7 +43,7 @@ func _process(delta):
|
||||
elif Input.is_action_pressed("move_northwest"): move_vec = Vector2i(-1, -1)
|
||||
|
||||
|
||||
# Action inputs (still momentary)
|
||||
# 3. Action inputs (momentary)
|
||||
if Input.is_action_just_pressed("action_grab"):
|
||||
player.grab_item(player.current_position)
|
||||
elif Input.is_action_just_pressed("action_put"):
|
||||
|
||||
Reference in New Issue
Block a user