Release 0.2.0: device-aware controls, spear, settings, shaders
Show touch controls only on touch platforms and keyboard hints only on desktop, via a shared Controls.use_touch_ui() gate (is_touchscreen_available is unreliable with emulate_touch_from_mouse). Bumps version to 0.2.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+47
-3
@@ -57,23 +57,26 @@ const ACTION_LABELS: Dictionary = {
|
||||
&"move_left": "Move Left",
|
||||
&"move_right": "Move Right",
|
||||
&"ability_kick": "Kick",
|
||||
&"ability_slam": "Slam",
|
||||
&"ability_dash": "Dash",
|
||||
&"ability_slam": "Slam",
|
||||
&"ability_roll": "Roll",
|
||||
}
|
||||
|
||||
@onready var main_panel: Control = $MainPanel
|
||||
@onready var options_panel: Control = $OptionsPanel
|
||||
@onready var credits_panel: Control = $CreditsPanel
|
||||
@onready var options_vbox: VBoxContainer = $OptionsPanel/VBox
|
||||
@onready var options_scroll: ScrollContainer = $OptionsPanel/VBox/Scroll
|
||||
@onready var rebind_list: VBoxContainer = $OptionsPanel/VBox/Scroll/RebindList
|
||||
@onready var fade_rect: ColorRect = $FadeRect
|
||||
@onready var play_button: Button = $MainPanel/PlayButton
|
||||
@onready var play_button: Button = $VideoAspect/CapeLayer/PlayButton
|
||||
@onready var options_button: Button = $MainPanel/OptionsButton
|
||||
@onready var credits_button: Button = $MainPanel/CreditsButton
|
||||
@onready var exit_button: Button = $MainPanel/ExitButton
|
||||
@onready var options_back: Button = $OptionsPanel/VBox/BackButton
|
||||
@onready var credits_back: Button = $CreditsPanel/VBox/BackButton
|
||||
@onready var video: VideoStreamPlayer = $VideoStreamPlayer
|
||||
@onready var video: VideoStreamPlayer = $VideoAspect/VideoStreamPlayer
|
||||
@onready var blur_video: VideoStreamPlayer = $VideoBlur/BlurVideo
|
||||
|
||||
var _listening_action: StringName = &""
|
||||
var _listening_button: Button = null
|
||||
@@ -87,6 +90,9 @@ func _ready() -> void:
|
||||
if video.stream != null:
|
||||
video.play()
|
||||
video.finished.connect(video.play) # loop the background clip
|
||||
if blur_video.stream != null:
|
||||
blur_video.play()
|
||||
blur_video.finished.connect(blur_video.play) # loop the blurred backdrop
|
||||
|
||||
play_button.pressed.connect(_on_play_pressed)
|
||||
options_button.pressed.connect(_on_options_pressed)
|
||||
@@ -96,6 +102,7 @@ func _ready() -> void:
|
||||
credits_back.pressed.connect(_close_subpanels)
|
||||
_apply_theme()
|
||||
_build_version_label()
|
||||
_build_options_toggles()
|
||||
_build_rebind_rows()
|
||||
play_button.grab_focus()
|
||||
|
||||
@@ -183,6 +190,40 @@ func _process(_delta: float) -> void:
|
||||
play_button.anchor_bottom = cape.y
|
||||
|
||||
|
||||
# Player-facing option toggles, seated above the rebind list in the Options panel:
|
||||
# the master screen-shake switch and the gore toggle (both persisted via Settings).
|
||||
func _build_options_toggles() -> void:
|
||||
var scroll_idx := options_scroll.get_index()
|
||||
# Insert in reverse so both land directly above the rebind scroll, in listed order.
|
||||
_add_toggle_row("Blood & Gore", Settings.gore, Settings.set_gore, scroll_idx)
|
||||
_add_toggle_row("Screen Shake", Settings.screen_shake, Settings.set_screen_shake, scroll_idx)
|
||||
|
||||
|
||||
func _add_toggle_row(label_text: String, value: bool, setter: Callable, at_index: int) -> void:
|
||||
var row := HBoxContainer.new()
|
||||
row.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
|
||||
var name_label := Label.new()
|
||||
name_label.text = label_text
|
||||
name_label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
name_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
name_label.add_theme_font_override("font", UiFonts.body())
|
||||
name_label.add_theme_font_size_override("font_size", 20)
|
||||
name_label.add_theme_color_override("font_color", MENU_CREAM)
|
||||
name_label.add_theme_color_override("font_outline_color", Color.BLACK)
|
||||
name_label.add_theme_constant_override("outline_size", 5)
|
||||
row.add_child(name_label)
|
||||
|
||||
var toggle := CheckButton.new()
|
||||
toggle.button_pressed = value
|
||||
toggle.add_theme_color_override("font_color", MENU_GOLD)
|
||||
toggle.toggled.connect(func(on: bool) -> void: setter.call(on))
|
||||
row.add_child(toggle)
|
||||
|
||||
options_vbox.add_child(row)
|
||||
options_vbox.move_child(row, at_index)
|
||||
|
||||
|
||||
func _build_rebind_rows() -> void:
|
||||
for child in rebind_list.get_children():
|
||||
child.queue_free()
|
||||
@@ -221,12 +262,14 @@ func _on_play_pressed() -> void:
|
||||
|
||||
func _on_options_pressed() -> void:
|
||||
main_panel.visible = false
|
||||
play_button.visible = false
|
||||
options_panel.visible = true
|
||||
options_back.grab_focus()
|
||||
|
||||
|
||||
func _on_credits_pressed() -> void:
|
||||
main_panel.visible = false
|
||||
play_button.visible = false
|
||||
credits_panel.visible = true
|
||||
credits_back.grab_focus()
|
||||
|
||||
@@ -240,6 +283,7 @@ func _close_subpanels() -> void:
|
||||
options_panel.visible = false
|
||||
credits_panel.visible = false
|
||||
main_panel.visible = true
|
||||
play_button.visible = true
|
||||
play_button.grab_focus()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user