forked from team-sg/hero-mark-2
progress on new options screen
This commit is contained in:
parent
6ed5743144
commit
69d6a4b4f7
12 changed files with 1000 additions and 39 deletions
14
objects/hud/labeled_slider.gd
Normal file
14
objects/hud/labeled_slider.gd
Normal file
|
@ -0,0 +1,14 @@
|
|||
extends HSlider
|
||||
|
||||
|
||||
export var label: NodePath
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
connect("value_changed", self, "_on_value_changed")
|
||||
|
||||
|
||||
func _on_value_changed(value: float) -> void:
|
||||
var l = get_node(label)
|
||||
if l is Label:
|
||||
l.text = str(value)
|
|
@ -53,6 +53,7 @@ margin_bottom = 152.0
|
|||
theme = ExtResource( 2 )
|
||||
|
||||
[node name="Game" type="VBoxContainer" parent="Tabs"]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = 10.0
|
||||
|
@ -123,8 +124,7 @@ align = 0
|
|||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = 7.0
|
||||
margin_bottom = -17.0
|
||||
margin_top = 10.0
|
||||
focus_neighbour_bottom = NodePath("Fullscreen")
|
||||
|
||||
[node name="Spacer" type="Control" parent="Tabs/Video"]
|
||||
|
@ -374,11 +374,9 @@ group = SubResource( 5 )
|
|||
text = "Fast"
|
||||
|
||||
[node name="Audio" type="VBoxContainer" parent="Tabs"]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = 7.0
|
||||
margin_bottom = -37.0
|
||||
margin_top = 10.0
|
||||
focus_neighbour_bottom = NodePath("MasterVolume/MasterSlider")
|
||||
|
||||
[node name="Spacer" type="Control" parent="Tabs/Audio"]
|
||||
|
|
101
objects/hud/options_screen_scholar.gd
Normal file
101
objects/hud/options_screen_scholar.gd
Normal file
|
@ -0,0 +1,101 @@
|
|||
extends Control
|
||||
|
||||
|
||||
onready var tabs: TabContainer = $"%Tabs"
|
||||
onready var select_tab: HBoxContainer = $"%SelectTab"
|
||||
# options nodes
|
||||
onready var rumble: HBoxContainer = $"%SelectRumble"
|
||||
onready var gore: HBoxContainer = $"%SelectGore"
|
||||
onready var fullscreen: HBoxContainer = $"%SelectFullscreen"
|
||||
onready var window_size: HBoxContainer = $"%SelectWindowSize"
|
||||
onready var scaling: HBoxContainer = $"%SelectScaling"
|
||||
onready var fade_speed: HBoxContainer = $"%SelectFadeSpeed"
|
||||
onready var border: Button = $"%SelectBorder"
|
||||
onready var scanlines: HBoxContainer = $"%SelectScanlines"
|
||||
onready var master_vol: HSlider = $"%SelectMasterVol"
|
||||
onready var music_vol: HSlider = $"%SelectMusicVol"
|
||||
onready var sound_vol: HSlider = $"%SelectSoundVol"
|
||||
onready var landing_sound: HBoxContainer = $"%SelectLandingSound"
|
||||
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_init_values()
|
||||
yield(get_tree(), "idle_frame")
|
||||
$"%SelectTab".grab_focus()
|
||||
|
||||
|
||||
func _init_values() -> void:
|
||||
# game
|
||||
rumble.selection = Options.rumble
|
||||
gore.selection = Options.gore
|
||||
# video
|
||||
fullscreen.selection = 1 if Options.fullscreen else 0
|
||||
window_size.selection = int(Options.window_size) - 1
|
||||
scaling.selection = Options.scaling_mode
|
||||
fade_speed.selection = Options.transition_speed
|
||||
border._update()
|
||||
scanlines.selection = Options.scanlines
|
||||
# audio
|
||||
master_vol.value = Options.master_volume * 100.0
|
||||
music_vol.value = Options.music_volume * 100.0
|
||||
sound_vol.value = Options.sound_volume * 100.0
|
||||
landing_sound.selection = 1 if Options.landing_sound else 0
|
||||
|
||||
func _on_tab_selected(selection: int) -> void:
|
||||
tabs.current_tab = selection
|
||||
var tab = tabs.get_current_tab_control()
|
||||
var next = tab.get_node(tab.focus_next)
|
||||
if next:
|
||||
select_tab.focus_neighbour_bottom = select_tab.get_path_to(next)
|
||||
else:
|
||||
select_tab.focus_neighbour_bottom = @"."
|
||||
select_tab.update_focus_targets()
|
||||
|
||||
|
||||
#
|
||||
# GAME
|
||||
#
|
||||
func _on_Rumble_selected(selection) -> void:
|
||||
Options.rumble = selection
|
||||
|
||||
func _on_Gore_selected(selection) -> void:
|
||||
Options.gore = selection
|
||||
|
||||
|
||||
#
|
||||
# VIDEO
|
||||
#
|
||||
func _on_Fullscreen_selected(selection) -> void:
|
||||
Options.fullscreen = selection == 1 # true if 1, false otherwise
|
||||
|
||||
func _on_WindowSize_selected(selection) -> void:
|
||||
Options.window_size = float(selection + 1)
|
||||
|
||||
func _on_Scaling_selected(selection) -> void:
|
||||
Options.scaling_mode = selection
|
||||
|
||||
func _on_FadeSpeed_selected(selection) -> void:
|
||||
Options.transition_speed = selection
|
||||
|
||||
func _on_Border_selected(selection) -> void:
|
||||
Options.border = selection
|
||||
|
||||
func _on_Scanlines_selected(selection) -> void:
|
||||
Options.scanlines = selection
|
||||
|
||||
|
||||
#
|
||||
# AUDIO
|
||||
#
|
||||
func _on_MasterVol_value_changed(value: float) -> void:
|
||||
Options.master_volume = value * 0.01
|
||||
|
||||
func _on_MusicVol_value_changed(value: float) -> void:
|
||||
Options.music_volume = value * 0.01
|
||||
|
||||
func _on_SoundVol_value_changed(value: float) -> void:
|
||||
Options.sound_volume = value * 0.01
|
||||
|
||||
func _on_LandingSound_selected(selection) -> void:
|
||||
Options.landing_sound = selection == 1
|
650
objects/hud/options_screen_scholar.tscn
Normal file
650
objects/hud/options_screen_scholar.tscn
Normal file
|
@ -0,0 +1,650 @@
|
|||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://objects/hud/options_screen_scholar.gd" type="Script" id=1]
|
||||
[ext_resource path="res://ui/theme.tres" type="Theme" id=2]
|
||||
[ext_resource path="res://objects/hud/radio_buttons.gd" type="Script" id=3]
|
||||
[ext_resource path="res://shaders/wibble_wobble.gdshader" type="Shader" id=4]
|
||||
[ext_resource path="res://graphics/hud/pause_arrow.png" type="Texture" id=5]
|
||||
[ext_resource path="res://objects/hud/select_border.gd" type="Script" id=6]
|
||||
[ext_resource path="res://objects/hud/labeled_slider.gd" type="Script" id=7]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
shader = ExtResource( 4 )
|
||||
shader_param/speed = Vector2( 4, 0 )
|
||||
shader_param/ammount = Vector2( 2, 0 )
|
||||
shader_param/offset = Vector2( 0, 0 )
|
||||
shader_param/delay = Vector2( 0, 0 )
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
shader = ExtResource( 4 )
|
||||
shader_param/speed = Vector2( 4, 0 )
|
||||
shader_param/ammount = Vector2( 2, 0 )
|
||||
shader_param/offset = Vector2( 0, 0 )
|
||||
shader_param/delay = Vector2( 4, 0 )
|
||||
|
||||
[node name="OptionsScreen" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="CenterContainer"]
|
||||
margin_left = 8.0
|
||||
margin_top = 16.0
|
||||
margin_right = 248.0
|
||||
margin_bottom = 176.0
|
||||
rect_min_size = Vector2( 240, 160 )
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/PanelContainer"]
|
||||
margin_left = 3.0
|
||||
margin_top = 3.0
|
||||
margin_right = 237.0
|
||||
margin_bottom = 157.0
|
||||
custom_constants/margin_right = 8
|
||||
custom_constants/margin_top = 4
|
||||
custom_constants/margin_left = 8
|
||||
custom_constants/margin_bottom = 4
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer"]
|
||||
margin_left = 8.0
|
||||
margin_top = 4.0
|
||||
margin_right = 226.0
|
||||
margin_bottom = 150.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
text = "-options-"
|
||||
align = 1
|
||||
|
||||
[node name="SelectTab" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
margin_top = 14.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 24.0
|
||||
focus_mode = 2
|
||||
alignment = 1
|
||||
script = ExtResource( 3 )
|
||||
condense = true
|
||||
options = [ "game", "video", "audio", "input" ]
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
margin_top = 28.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 32.0
|
||||
|
||||
[node name="Tabs" type="TabContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
margin_top = 36.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 132.0
|
||||
focus_mode = 2
|
||||
tabs_visible = false
|
||||
|
||||
[node name="Game" type="VBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs"]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
focus_next = NodePath("Rumble/SelectRumble")
|
||||
|
||||
[node name="Rumble" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Game"]
|
||||
margin_right = 218.0
|
||||
margin_bottom = 12.0
|
||||
rect_min_size = Vector2( 0, 12 )
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Game/Rumble"]
|
||||
margin_top = 1.0
|
||||
margin_right = 49.0
|
||||
margin_bottom = 11.0
|
||||
text = "Rumble:"
|
||||
|
||||
[node name="SelectRumble" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Game/Rumble"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 53.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 12.0
|
||||
focus_neighbour_top = NodePath("../../../../SelectTab")
|
||||
focus_neighbour_bottom = NodePath("../../Gore/SelectGore")
|
||||
focus_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 3 )
|
||||
options = [ "off", "deaths", "full" ]
|
||||
|
||||
[node name="Gore" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Game"]
|
||||
margin_top = 16.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 28.0
|
||||
rect_min_size = Vector2( 0, 12 )
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Game/Gore"]
|
||||
margin_top = 1.0
|
||||
margin_right = 35.0
|
||||
margin_bottom = 11.0
|
||||
text = "Gore:"
|
||||
|
||||
[node name="SelectGore" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Game/Gore"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 39.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 12.0
|
||||
focus_neighbour_top = NodePath("../../Rumble/SelectRumble")
|
||||
focus_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 3 )
|
||||
options = [ "none", "no stains", "full" ]
|
||||
|
||||
[node name="Video" type="VBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs"]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
focus_next = NodePath("Fullscreen/SelectFullscreen")
|
||||
|
||||
[node name="Fullscreen" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video"]
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Fullscreen"]
|
||||
margin_right = 140.0
|
||||
margin_bottom = 10.0
|
||||
text = "Start In fullscreen:"
|
||||
|
||||
[node name="SelectFullscreen" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Fullscreen"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 144.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
focus_neighbour_top = NodePath("../../../../SelectTab")
|
||||
focus_neighbour_bottom = NodePath("../../WindowSize/SelectWindowSize")
|
||||
focus_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 3 )
|
||||
options = [ "off", "on" ]
|
||||
|
||||
[node name="WindowSize" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video"]
|
||||
margin_top = 14.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/WindowSize"]
|
||||
margin_right = 84.0
|
||||
margin_bottom = 10.0
|
||||
text = "window size:"
|
||||
|
||||
[node name="SelectWindowSize" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/WindowSize"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 88.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
focus_neighbour_top = NodePath("../../Fullscreen/SelectFullscreen")
|
||||
focus_neighbour_bottom = NodePath("../../Scaling/SelectScaling")
|
||||
focus_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 3 )
|
||||
options = [ "1x", "2x", "3x", "4x", "5x" ]
|
||||
|
||||
[node name="Scaling" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video"]
|
||||
margin_top = 28.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 38.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Scaling"]
|
||||
margin_right = 56.0
|
||||
margin_bottom = 10.0
|
||||
text = "scaling:"
|
||||
|
||||
[node name="SelectScaling" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Scaling"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 60.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
focus_neighbour_top = NodePath("../../WindowSize/SelectWindowSize")
|
||||
focus_neighbour_bottom = NodePath("../../FadeSpeed/SelectFadeSpeed")
|
||||
focus_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 3 )
|
||||
options = [ "integer", "aspect", "stretch" ]
|
||||
|
||||
[node name="FadeSpeed" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video"]
|
||||
margin_top = 42.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 52.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/FadeSpeed"]
|
||||
margin_right = 35.0
|
||||
margin_bottom = 10.0
|
||||
text = "fade:"
|
||||
|
||||
[node name="SelectFadeSpeed" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/FadeSpeed"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 39.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
focus_neighbour_top = NodePath("../../Scaling/SelectScaling")
|
||||
focus_neighbour_bottom = NodePath("../../Border/HBoxContainer/SelectBorder")
|
||||
focus_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 3 )
|
||||
options = [ "slow", "medium", "fast", "instant" ]
|
||||
|
||||
[node name="Border" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video"]
|
||||
margin_top = 56.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 66.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border"]
|
||||
margin_right = 49.0
|
||||
margin_bottom = 10.0
|
||||
text = "border:"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border"]
|
||||
margin_left = 53.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="BorderBackArrow" type="TextureRect" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
material = SubResource( 1 )
|
||||
margin_left = 30.0
|
||||
margin_top = 1.0
|
||||
margin_right = 36.0
|
||||
margin_bottom = 9.0
|
||||
size_flags_vertical = 4
|
||||
texture = ExtResource( 5 )
|
||||
flip_h = true
|
||||
|
||||
[node name="SelectBorder" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 40.0
|
||||
margin_right = 124.0
|
||||
margin_bottom = 10.0
|
||||
focus_neighbour_left = NodePath(".")
|
||||
focus_neighbour_top = NodePath("../../../FadeSpeed/SelectFadeSpeed")
|
||||
focus_neighbour_right = NodePath(".")
|
||||
theme = ExtResource( 2 )
|
||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||
text = "trans rights"
|
||||
script = ExtResource( 6 )
|
||||
|
||||
[node name="BorderNextArrow" type="TextureRect" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
material = SubResource( 2 )
|
||||
margin_left = 128.0
|
||||
margin_top = 1.0
|
||||
margin_right = 134.0
|
||||
margin_bottom = 9.0
|
||||
size_flags_vertical = 4
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
[node name="Scanlines" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video"]
|
||||
margin_top = 70.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 80.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Scanlines"]
|
||||
margin_right = 70.0
|
||||
margin_bottom = 10.0
|
||||
text = "scanlines:"
|
||||
|
||||
[node name="SelectScanlines" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Scanlines"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 74.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
focus_neighbour_top = NodePath("../../Scaling/SelectScaling")
|
||||
focus_neighbour_bottom = NodePath("../../Border/HBoxContainer/SelectBorder")
|
||||
focus_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 3 )
|
||||
options = [ "none", "lcd", "crt" ]
|
||||
|
||||
[node name="Audio" type="VBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs"]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
focus_next = NodePath("Master/SelectMasterVol")
|
||||
|
||||
[node name="Master" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio"]
|
||||
margin_right = 218.0
|
||||
margin_bottom = 12.0
|
||||
rect_min_size = Vector2( 0, 12 )
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Master"]
|
||||
margin_top = 1.0
|
||||
margin_right = 94.0
|
||||
margin_bottom = 11.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Master vol.:"
|
||||
|
||||
[node name="SelectMasterVol" type="HSlider" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Master"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 98.0
|
||||
margin_right = 193.0
|
||||
margin_bottom = 10.0
|
||||
focus_neighbour_top = NodePath("../../../../SelectTab")
|
||||
focus_neighbour_bottom = NodePath("../../Music/SelectMusicVol")
|
||||
size_flags_horizontal = 3
|
||||
step = 5.0
|
||||
value = 100.0
|
||||
scrollable = false
|
||||
script = ExtResource( 7 )
|
||||
label = NodePath("../Volume")
|
||||
|
||||
[node name="Volume" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Master"]
|
||||
margin_left = 197.0
|
||||
margin_top = 1.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 11.0
|
||||
rect_min_size = Vector2( 21, 0 )
|
||||
size_flags_horizontal = 9
|
||||
text = "100"
|
||||
align = 2
|
||||
|
||||
[node name="Music" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio"]
|
||||
margin_top = 16.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 28.0
|
||||
rect_min_size = Vector2( 0, 12 )
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Music"]
|
||||
margin_top = 1.0
|
||||
margin_right = 94.0
|
||||
margin_bottom = 11.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Music vol.:"
|
||||
|
||||
[node name="SelectMusicVol" type="HSlider" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Music"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 98.0
|
||||
margin_right = 193.0
|
||||
margin_bottom = 10.0
|
||||
focus_neighbour_top = NodePath("../../Master/SelectMasterVol")
|
||||
focus_neighbour_bottom = NodePath("../../Sound/SelectSoundVol")
|
||||
size_flags_horizontal = 3
|
||||
step = 5.0
|
||||
value = 100.0
|
||||
scrollable = false
|
||||
script = ExtResource( 7 )
|
||||
label = NodePath("../Volume")
|
||||
|
||||
[node name="Volume" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Music"]
|
||||
margin_left = 197.0
|
||||
margin_top = 1.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 11.0
|
||||
rect_min_size = Vector2( 21, 0 )
|
||||
size_flags_horizontal = 9
|
||||
text = "100"
|
||||
align = 2
|
||||
|
||||
[node name="Sound" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio"]
|
||||
margin_top = 32.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 44.0
|
||||
rect_min_size = Vector2( 0, 12 )
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Sound"]
|
||||
margin_top = 1.0
|
||||
margin_right = 94.0
|
||||
margin_bottom = 11.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Sound vol.:"
|
||||
|
||||
[node name="SelectSoundVol" type="HSlider" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Sound"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 98.0
|
||||
margin_right = 193.0
|
||||
margin_bottom = 10.0
|
||||
focus_neighbour_top = NodePath("../../Music/SelectMusicVol")
|
||||
focus_neighbour_bottom = NodePath("../../LandingSound/SelectLandingSound")
|
||||
size_flags_horizontal = 3
|
||||
step = 5.0
|
||||
value = 100.0
|
||||
scrollable = false
|
||||
script = ExtResource( 7 )
|
||||
label = NodePath("../Volume")
|
||||
|
||||
[node name="Volume" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Sound"]
|
||||
margin_left = 197.0
|
||||
margin_top = 1.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 11.0
|
||||
rect_min_size = Vector2( 21, 0 )
|
||||
size_flags_horizontal = 9
|
||||
text = "100"
|
||||
align = 2
|
||||
|
||||
[node name="LandingSound" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio"]
|
||||
margin_top = 48.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 60.0
|
||||
rect_min_size = Vector2( 0, 12 )
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/LandingSound"]
|
||||
margin_top = 1.0
|
||||
margin_right = 98.0
|
||||
margin_bottom = 11.0
|
||||
text = "Landing sound:"
|
||||
|
||||
[node name="SelectLandingSound" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/LandingSound"]
|
||||
unique_name_in_owner = true
|
||||
margin_left = 102.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 12.0
|
||||
focus_neighbour_top = NodePath("../../Sound/SelectSoundVol")
|
||||
focus_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
script = ExtResource( 3 )
|
||||
options = [ "off", "on" ]
|
||||
|
||||
[node name="Input" type="VBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
focus_next = NodePath("Left/Keyboard")
|
||||
|
||||
[node name="Header" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input"]
|
||||
margin_right = 218.0
|
||||
margin_bottom = 12.0
|
||||
rect_min_size = Vector2( 0, 12 )
|
||||
|
||||
[node name="Spacer" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Header"]
|
||||
margin_top = 1.0
|
||||
margin_right = 92.0
|
||||
margin_bottom = 11.0
|
||||
rect_min_size = Vector2( 92, 0 )
|
||||
align = 1
|
||||
|
||||
[node name="Keyboard" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Header"]
|
||||
margin_left = 96.0
|
||||
margin_top = 1.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 11.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Keyboard"
|
||||
align = 1
|
||||
|
||||
[node name="Gamepad" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Header"]
|
||||
margin_left = 159.0
|
||||
margin_top = 1.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 11.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Gamepad"
|
||||
align = 1
|
||||
|
||||
[node name="Left" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input"]
|
||||
margin_top = 16.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 26.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Left"]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 10.0
|
||||
rect_min_size = Vector2( 92, 0 )
|
||||
text = "left"
|
||||
align = 1
|
||||
|
||||
[node name="Keyboard" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Left"]
|
||||
margin_left = 96.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Gamepad" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Left"]
|
||||
margin_left = 159.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Right" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input"]
|
||||
margin_top = 30.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 40.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Right"]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 10.0
|
||||
rect_min_size = Vector2( 92, 0 )
|
||||
text = "right"
|
||||
align = 1
|
||||
|
||||
[node name="Keyboard" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Right"]
|
||||
margin_left = 96.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Gamepad" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Right"]
|
||||
margin_left = 159.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Up" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input"]
|
||||
margin_top = 44.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 54.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Up"]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 10.0
|
||||
rect_min_size = Vector2( 92, 0 )
|
||||
text = "up"
|
||||
align = 1
|
||||
|
||||
[node name="Keyboard" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Up"]
|
||||
margin_left = 96.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Gamepad" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Up"]
|
||||
margin_left = 159.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Down" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input"]
|
||||
margin_top = 58.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 68.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Down"]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 10.0
|
||||
rect_min_size = Vector2( 92, 0 )
|
||||
text = "down"
|
||||
align = 1
|
||||
|
||||
[node name="Keyboard" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Down"]
|
||||
margin_left = 96.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Gamepad" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Down"]
|
||||
margin_left = 159.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Jump" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input"]
|
||||
margin_top = 72.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 82.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Jump"]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 10.0
|
||||
rect_min_size = Vector2( 92, 0 )
|
||||
text = "jump/confirm"
|
||||
align = 1
|
||||
|
||||
[node name="Keyboard" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Jump"]
|
||||
margin_left = 96.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Gamepad" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Jump"]
|
||||
margin_left = 159.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Attack" type="HBoxContainer" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input"]
|
||||
margin_top = 86.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 96.0
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Attack"]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 10.0
|
||||
rect_min_size = Vector2( 92, 0 )
|
||||
text = "attack/back"
|
||||
align = 1
|
||||
|
||||
[node name="Keyboard" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Attack"]
|
||||
margin_left = 96.0
|
||||
margin_right = 155.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[node name="Gamepad" type="Button" parent="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Input/Attack"]
|
||||
margin_left = 159.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 10.0
|
||||
size_flags_horizontal = 3
|
||||
text = "-"
|
||||
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/SelectTab" to="." method="_on_tab_selected"]
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Game/Rumble/SelectRumble" to="." method="_on_Rumble_selected"]
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Game/Gore/SelectGore" to="." method="_on_Gore_selected"]
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Fullscreen/SelectFullscreen" to="." method="_on_Fullscreen_selected"]
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/WindowSize/SelectWindowSize" to="." method="_on_WindowSize_selected"]
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Scaling/SelectScaling" to="." method="_on_Scaling_selected"]
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/FadeSpeed/SelectFadeSpeed" to="." method="_on_FadeSpeed_selected"]
|
||||
[connection signal="focus_entered" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border/HBoxContainer/SelectBorder" to="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border/HBoxContainer/SelectBorder" method="_on_focus_entered"]
|
||||
[connection signal="focus_exited" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border/HBoxContainer/SelectBorder" to="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border/HBoxContainer/SelectBorder" method="_on_focus_exited"]
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Border/HBoxContainer/SelectBorder" to="." method="_on_Border_selected"]
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Video/Scanlines/SelectScanlines" to="." method="_on_Scanlines_selected"]
|
||||
[connection signal="value_changed" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Master/SelectMasterVol" to="." method="_on_MasterVol_value_changed"]
|
||||
[connection signal="value_changed" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Music/SelectMusicVol" to="." method="_on_MusicVol_value_changed"]
|
||||
[connection signal="value_changed" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/Sound/SelectSoundVol" to="." method="_on_SoundVol_value_changed"]
|
||||
[connection signal="selected" from="CenterContainer/PanelContainer/MarginContainer/VBoxContainer/Tabs/Audio/LandingSound/SelectLandingSound" to="." method="_on_LandingSound_selected"]
|
101
objects/hud/radio_buttons.gd
Normal file
101
objects/hud/radio_buttons.gd
Normal file
|
@ -0,0 +1,101 @@
|
|||
tool
|
||||
class_name RadioButtons
|
||||
extends HBoxContainer
|
||||
|
||||
|
||||
signal selected(selection)
|
||||
|
||||
|
||||
export var condense: bool = false
|
||||
export var default_selection: int = 0 setget _set_default_selection
|
||||
export (Array, String) var options: Array = [] setget _set_options
|
||||
|
||||
|
||||
onready var selection: int = default_selection setget _set_selection
|
||||
|
||||
|
||||
var _buttons: Array = []
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
focus_mode = FOCUS_ALL
|
||||
connect("focus_entered", self, "_on_focus_entered")
|
||||
|
||||
|
||||
func _set_default_selection(value: int) -> void:
|
||||
if value < 0:
|
||||
value = 0
|
||||
elif value >= options.size() and value != 0:
|
||||
value = options.size() - 1
|
||||
default_selection = value
|
||||
if not _buttons.empty():
|
||||
_buttons[default_selection].pressed = true
|
||||
|
||||
|
||||
func _set_options(value: Array) -> void:
|
||||
options = value
|
||||
_init_buttons()
|
||||
|
||||
|
||||
func _set_selection(value: int) -> void:
|
||||
selection = value
|
||||
_buttons[selection].pressed = true
|
||||
|
||||
|
||||
func update_focus_targets() -> void:
|
||||
for b in _buttons:
|
||||
b.focus_neighbour_top = "../%s" % focus_neighbour_top
|
||||
b.focus_neighbour_bottom = "../%s" % focus_neighbour_bottom
|
||||
|
||||
|
||||
func _init_buttons() -> void:
|
||||
# initialize buttons array
|
||||
for child in get_children():
|
||||
remove_child(child)
|
||||
child.queue_free()
|
||||
_buttons.clear()
|
||||
_buttons.resize(options.size())
|
||||
|
||||
# set up new buttons
|
||||
var group := ButtonGroup.new()
|
||||
for i in options.size():
|
||||
# create new button
|
||||
var b := Button.new()
|
||||
b.text = options[i]
|
||||
b.toggle_mode = true
|
||||
b.group = group
|
||||
# size flags
|
||||
if condense:
|
||||
b.size_flags_horizontal = 0
|
||||
else:
|
||||
b.size_flags_horizontal = SIZE_EXPAND | SIZE_SHRINK_CENTER
|
||||
b.size_flags_vertical = 0
|
||||
# connect signal with index as payload
|
||||
b.connect("focus_entered", self, "_on_button_selected", [i])
|
||||
# add button to children and array
|
||||
_buttons[i] = b
|
||||
add_child(b)
|
||||
# sync top/bottom focus to self
|
||||
b.focus_neighbour_top = "../%s" % focus_neighbour_top
|
||||
b.focus_neighbour_bottom = "../%s" % focus_neighbour_bottom
|
||||
# set up focus between buttons
|
||||
if i > 0:
|
||||
var prev_b: Button = _buttons[i - 1]
|
||||
b.focus_neighbour_left = b.get_path_to(prev_b)
|
||||
prev_b.focus_neighbour_right = prev_b.get_path_to(b)
|
||||
elif i == 0:
|
||||
b.focus_neighbour_left = @"."
|
||||
elif i == options.size() - 1:
|
||||
b.focus_neighbour_right = @"."
|
||||
_buttons[default_selection].pressed = true
|
||||
|
||||
|
||||
func _on_focus_entered() -> void:
|
||||
_buttons[selection].grab_focus()
|
||||
|
||||
|
||||
func _on_button_selected(i: int) -> void:
|
||||
if i != selection:
|
||||
selection = i
|
||||
emit_signal("selected", i)
|
||||
_buttons[i].pressed = true
|
36
objects/hud/select_border.gd
Normal file
36
objects/hud/select_border.gd
Normal file
|
@ -0,0 +1,36 @@
|
|||
extends Button
|
||||
|
||||
|
||||
signal selected(selection)
|
||||
|
||||
|
||||
onready var back_arrow: TextureRect = $"%BorderBackArrow"
|
||||
onready var next_arrow: TextureRect = $"%BorderNextArrow"
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
text = Border.names[Border.current_border]
|
||||
|
||||
|
||||
func _gui_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("ui_left"):
|
||||
Border.current_border -= 1
|
||||
_update()
|
||||
elif event.is_action_pressed("ui_right"):
|
||||
Border.current_border += 1
|
||||
_update()
|
||||
|
||||
|
||||
func _update() -> void:
|
||||
emit_signal("selected", Border.current_border)
|
||||
text = Border.names[Border.current_border]
|
||||
|
||||
|
||||
func _on_focus_entered() -> void:
|
||||
back_arrow.visible = true
|
||||
next_arrow.visible = true
|
||||
|
||||
|
||||
func _on_focus_exited() -> void:
|
||||
back_arrow.visible = false
|
||||
next_arrow.visible = false
|
Loading…
Add table
Add a link
Reference in a new issue