feat: Implement core game systems including settings management, player input, and initial gameplay mechanics with associated UI.
This commit is contained in:
@@ -146,7 +146,7 @@ func _update_btn_shortcut(_effect_id: int, btn: Button):
|
||||
return
|
||||
|
||||
# Show only Shortcut 1 as per single-slot request
|
||||
sc_lbl.text = "[%s]" % SettingsManager.get_control_text("powerup_1")
|
||||
sc_lbl.text = "[%s]" % SettingsManager.get_control_text("use_powerup")
|
||||
|
||||
func _on_btn_pressed(effect_id: int):
|
||||
print("[PowerUpUI] Clicked Button %d" % effect_id)
|
||||
@@ -228,21 +228,6 @@ func _on_powerup_unlocked(effect: int, level: int):
|
||||
else:
|
||||
print("[PowerUpUI] ERROR: Unlocked Effect %d but no UI button found! Keys: %s" % [effect, icon_containers.keys()])
|
||||
|
||||
func _on_cooldown_updated(effect: int, time_left: float, max_time: float):
|
||||
if icon_containers.has(effect):
|
||||
var btn = icon_containers[effect]
|
||||
var cd_lbl = btn.get_node_or_null("CooldownLabel")
|
||||
if cd_lbl:
|
||||
if time_left > 0:
|
||||
cd_lbl.text = "%d" % int(time_left)
|
||||
btn.disabled = true
|
||||
btn.modulate = Color(0.7, 0.7, 0.7, 0.8)
|
||||
else:
|
||||
cd_lbl.text = ""
|
||||
# Re-enable if we own it
|
||||
if special_manager_ref and special_manager_ref.inventory.get(effect, false):
|
||||
btn.disabled = false
|
||||
btn.modulate = Color.WHITE
|
||||
|
||||
func _on_inventory_updated(inventory: Dictionary):
|
||||
# Update UI icons (Only show ONE active slot as per user request)
|
||||
|
||||
@@ -105,16 +105,26 @@ func _connect_signals():
|
||||
# Close
|
||||
close_button.pressed.connect(func(): visible = false)
|
||||
|
||||
# Connect remapping buttons (exclude non-keybinds like use_controller)
|
||||
# Connect remapping buttons
|
||||
for action_name in SettingsManager.settings.controls.keys():
|
||||
if action_name == "use_controller":
|
||||
continue
|
||||
|
||||
var btn = get_node_or_null("%" + action_name.to_pascal_case() + "Btn")
|
||||
if btn:
|
||||
if btn.pressed.is_connected(_on_remap_button_pressed):
|
||||
btn.pressed.disconnect(_on_remap_button_pressed)
|
||||
btn.pressed.connect(_on_remap_button_pressed.bind(action_name))
|
||||
# Check Primary Button
|
||||
var primary_btn = get_node_or_null("%" + action_name.to_pascal_case() + "Btn")
|
||||
if primary_btn:
|
||||
if primary_btn.pressed.is_connected(_on_remap_button_pressed):
|
||||
primary_btn.pressed.disconnect(_on_remap_button_pressed)
|
||||
primary_btn.pressed.connect(_on_remap_button_pressed.bind(action_name))
|
||||
|
||||
# Check Alt Button
|
||||
if not action_name.ends_with("_alt"):
|
||||
var alt_action = action_name + "_alt"
|
||||
var alt_btn = get_node_or_null("%" + action_name.to_pascal_case() + "AltBtn")
|
||||
if alt_btn:
|
||||
if alt_btn.pressed.is_connected(_on_remap_button_pressed):
|
||||
alt_btn.pressed.disconnect(_on_remap_button_pressed)
|
||||
alt_btn.pressed.connect(_on_remap_button_pressed.bind(alt_action))
|
||||
|
||||
func _on_video_setting_changed(_unused = false):
|
||||
SettingsManager.settings.video.fullscreen = fullscreen_toggle.button_pressed
|
||||
|
||||
Reference in New Issue
Block a user