feat: button navigatable menus, retouched background

This commit is contained in:
Jakob Feldmann 2023-06-06 13:36:02 +02:00
parent def896809e
commit 432c033bcc
24 changed files with 230 additions and 75 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/starry-space-far.png-b1fb6697267828788f7b2c923d988cac.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/environment/background/starry-space-far.png"
dest_files=[ "res://.import/starry-space-far.png-b1fb6697267828788f7b2c923d988cac.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/starry-space-middle.png-75504e07650a05d2baee8bb4a20618ce.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/environment/background/starry-space-middle.png"
dest_files=[ "res://.import/starry-space-middle.png-75504e07650a05d2baee8bb4a20618ce.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/starry-space-near.png-168884049fbff3d5c0a3f34b13ca9f6c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/environment/background/starry-space-near.png"
dest_files=[ "res://.import/starry-space-near.png-168884049fbff3d5c0a3f34b13ca9f6c.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/starry-space.png-2e54f4c5926fa9a5776d9397e5e406b4.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/environment/background/starry-space.png"
dest_files=[ "res://.import/starry-space.png-2e54f4c5926fa9a5776d9397e5e406b4.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -192,23 +192,9 @@ ui_end={
"deadzone": 0.5,
"events": [ ]
}
move_left={
ui_click={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
]
}
jump={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":16777232,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
]
}
pause={
@ -223,27 +209,41 @@ boost_move={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
]
}
up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":87,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
]
}
duck={
"deadzone": 0.5,
"events": [ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":83,"unicode":0,"echo":false,"script":null)
]
}
ui_click={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
]
}
interact={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":69,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
]
}
up={
jump={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":87,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":16777232,"unicode":0,"echo":false,"script":null)
]
}
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
]
}

View File

@ -1,9 +1,9 @@
[gd_scene load_steps=53 format=2]
[ext_resource path="res://src/Actors/BlobbyCam.gd" type="Script" id=1]
[ext_resource path="res://assets/environment/background/Asteroids-Near.png" type="Texture" id=2]
[ext_resource path="res://assets/environment/background/Asteroids-Far.png" type="Texture" id=3]
[ext_resource path="res://assets/environment/background/space.png" type="Texture" id=4]
[ext_resource path="res://assets/environment/background/starry-space-near.png" type="Texture" id=2]
[ext_resource path="res://assets/environment/background/starry-space-far.png" type="Texture" id=3]
[ext_resource path="res://assets/environment/background/starry-space-middle.png" type="Texture" id=4]
[ext_resource path="res://assets/environment/background/Spaceship-Wall.png" type="Texture" id=5]
[ext_resource path="res://assets/environment/background/Spaceship-Wall-Lampsl.png" type="Texture" id=6]
[ext_resource path="res://assets/environment/decor/Robbit-Left.png" type="Texture" id=7]
@ -899,28 +899,21 @@ layer = -2
z_index = -1
motion_scale = Vector2( 0, 0 )
[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"]
z_index = -1
texture = ExtResource( 4 )
[node name="Sprite2" type="Sprite" parent="ParallaxBackground/ParallaxLayer"]
[node name="Sprite3" type="Sprite" parent="ParallaxBackground/ParallaxLayer"]
texture = ExtResource( 3 )
[node name="ParallaxLayer2" type="ParallaxLayer" parent="ParallaxBackground"]
z_index = -1
motion_scale = Vector2( 0, 0 )
motion_scale = Vector2( 0.001, 0.001 )
[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer2"]
visible = false
z_index = -1
texture = ExtResource( 3 )
texture = ExtResource( 4 )
[node name="ParallaxLayer3" type="ParallaxLayer" parent="ParallaxBackground"]
z_index = -1
motion_scale = Vector2( 0.001, 0.001 )
motion_scale = Vector2( 0.002, 0.002 )
[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer3"]
visible = false
z_index = -1
texture = ExtResource( 2 )
[node name="ParallaxLayer4" type="ParallaxLayer" parent="ParallaxBackground"]
@ -931,21 +924,21 @@ material = ExtResource( 38 )
z_index = -1
texture = ExtResource( 5 )
[node name="Emitter3" type="Sprite" parent="ParallaxBackground/ParallaxLayer4" groups=["light"]]
[node name="Emitter3" type="Sprite" parent="ParallaxBackground/ParallaxLayer4"]
visible = false
position = Vector2( -154, 14 )
texture = ExtResource( 40 )
script = ExtResource( 39 )
color = Color( 1, 0, 0, 0.615686 )
[node name="Emitter4" type="Sprite" parent="ParallaxBackground/ParallaxLayer4" groups=["light"]]
[node name="Emitter4" type="Sprite" parent="ParallaxBackground/ParallaxLayer4"]
visible = false
position = Vector2( 1, 14 )
texture = ExtResource( 40 )
script = ExtResource( 39 )
color = Color( 1, 0, 0, 0.615686 )
[node name="Emitter5" type="Sprite" parent="ParallaxBackground/ParallaxLayer4" groups=["light"]]
[node name="Emitter5" type="Sprite" parent="ParallaxBackground/ParallaxLayer4"]
visible = false
position = Vector2( 154, 14 )
texture = ExtResource( 40 )
@ -973,17 +966,15 @@ z_index = -1
texture = ExtResource( 8 )
[node name="Sprite4" type="Sprite" parent="ParallaxBackground/ParallaxLayer5"]
visible = false
z_index = -1
texture = ExtResource( 8 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
visible = false
frames = SubResource( 7 )
frame = 13
frame = 6
playing = true
[node name="AnimatedSprite2" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
frames = SubResource( 8 )
frame = 4
frame = 11
playing = true

View File

@ -113,7 +113,10 @@ visible = true
visible = true
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
frame = 1
frame = 4
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
frame = 11
[node name="Blobby" parent="." instance=ExtResource( 9 )]
unique_name_in_owner = true

View File

@ -0,0 +1,6 @@
extends Button
onready var levelState := get_tree().root.get_child(3).get_node("%LevelState")
func _on_button_up() -> void:
get_parent().get_parent().get_parent().set_paused(false)

View File

@ -1,14 +1,17 @@
extends Control
const InputLine = preload("res://src/UserInterface/Screens/ControlsMenu/InputLine.tscn")
var prev_line = null
func clear():
for child in get_children():
child.free()
func add_input_line(action_name, event):
func add_input_line(action_name, event) -> Control:
var line = InputLine.instance()
add_child(line)
line.focus_mode = Control.FOCUS_ALL
line.initialize(action_name, event)
#!if prev_line != null:
# line.get_child(2).focus_neighbour_top = prev_line.get_child(2).get_path()
prev_line = line
return line

View File

@ -1,6 +0,0 @@
extends ScrollContainer
func _on_focus_entered():
#get_child(0).get_child(0).grab_focus()
pass

View File

@ -12,10 +12,19 @@ func _ready():
func rebuild(input_profile):
_action_list.clear()
var first = true
for input_action in input_profile.keys():
if(input_action.ends_with("_old") || input_action.begins_with(("ui_"))):
continue
var line = _action_list.add_input_line(input_action, input_profile[input_action])
if first:
$ProfilesMenu.focus_neighbour_bottom = line.get_child(2).get_path()
$Back.focus_neighbour_top = line.get_child(2).get_path()
$Save.focus_neighbour_top = line.get_child(2).get_path()
$Reset.focus_neighbour_top = line.get_child(2).get_path()
first = false
line.get_child(2).focus_neighbour_left = $Back.get_path()
line.get_child(2).focus_neighbour_right = $Save.get_path()
line.connect('change_button_pressed', self, '_on_InputLine_change_button_pressed', [input_action, line])
func _on_InputLine_change_button_pressed(action_name, line):

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=24 format=2]
[gd_scene load_steps=23 format=2]
[ext_resource path="res://assets/ui/Screenshot 2023-05-23 160521.png" type="Texture" id=1]
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/ProfilesMenu.gd" type="Script" id=2]
@ -15,7 +15,6 @@
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/KeySelectMenu.gd" type="Script" id=13]
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/SaveButton.gd" type="Script" id=14]
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/Reset.gd" type="Script" id=15]
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/ControlScrollContainerFocus.gd" type="Script" id=16]
[sub_resource type="DynamicFont" id=1]
size = 42
@ -70,6 +69,7 @@ expand = true
stretch_mode = 1
[node name="ProfilesMenu" type="OptionButton" parent="."]
unique_name_in_owner = true
anchor_left = 0.5
anchor_top = 0.165
anchor_right = 0.5
@ -168,17 +168,14 @@ margin_bottom = 202.0
focus_neighbour_top = NodePath("../../ProfilesMenu")
focus_neighbour_bottom = NodePath("../../Save")
focus_previous = NodePath("../../Back")
focus_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
follow_focus = true
script = ExtResource( 16 )
[node name="ActionKeyList" type="VBoxContainer" parent="KeymapViewer/ScrollContainer"]
unique_name_in_owner = true
margin_right = 552.0
margin_bottom = 177.0
focus_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 3 )

View File

@ -27,14 +27,14 @@ func _spawn_level_options(levels: Array):
var first = true
for level in levels:
var check_box = CheckBox.new()
if first:
$"%PlayButton".focus_neighbour_right = check_box.get_path()
$"%Controlls".focus_neighbour_right = check_box.get_path()
$"%QuitButton".focus_neighbour_right = check_box.get_path()
first = false
check_box.focus_mode = Control.FOCUS_ALL
check_box.focus_neighbour_left = $"%PlayButton".get_path()
check_box.text = level.trim_suffix(".tscn")
check_box.set_button_group(BUTTON_GROUP)
vbox.add_child(check_box)
if first:
$"%PlayButton".focus_neighbour_right = check_box.get_path()
$"%Controlls".focus_neighbour_right = check_box.get_path()
$"%QuitButton".focus_neighbour_right = check_box.get_path()
first = false
return

View File

@ -3,7 +3,7 @@
[ext_resource path="res://src/UserInterface/Buttons/QuitButton.tscn" type="PackedScene" id=1]
[ext_resource path="res://src/UserInterface/Buttons/Titel.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/UserInterface/Buttons/ChangeSceneButton.tscn" type="PackedScene" id=3]
[ext_resource path="res://assets/environment/background/space.png" type="Texture" id=4]
[ext_resource path="res://assets/environment/background/starry-space.png" type="Texture" id=4]
[ext_resource path="res://assets/meta/ui_theme.tres" type="Theme" id=5]
[ext_resource path="res://src/UserInterface/Screens/LevelList.gd" type="Script" id=6]
[ext_resource path="res://src/UserInterface/Screens/LevelSelectButtonGroup.tres" type="ButtonGroup" id=7]
@ -30,6 +30,8 @@ theme = ExtResource( 5 )
[node name="background" type="TextureRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = -128.0
margin_bottom = -128.0
texture = ExtResource( 4 )
expand = true
stretch_mode = 1

View File

@ -31,3 +31,5 @@ func set_paused(value: bool) -> void:
paused = value
get_tree().paused = value
pause_overlay.visible = value
if value == true:
$PauseOverlay/VBoxContainer/Continue.grab_focus()

View File

@ -1,10 +1,10 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://assets/meta/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://src/UserInterface/Buttons/QuitButton.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/UserInterface/Buttons/ChangeSceneButton.tscn" type="PackedScene" id=3]
[ext_resource path="res://src/UserInterface/Buttons/RetryButton.tscn" type="PackedScene" id=4]
[ext_resource path="res://src/UserInterface/Screens/PauseScreen.gd" type="Script" id=5]
[ext_resource path="res://src/UserInterface/Screens/Continue.gd" type="Script" id=6]
[node name="PauseScreen" type="Control"]
pause_mode = 2
@ -37,29 +37,35 @@ margin_left = -111.0
margin_top = -125.0
margin_right = 111.0
margin_bottom = 125.0
focus_mode = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Continue" type="Button" parent="PauseOverlay/VBoxContainer"]
margin_right = 222.0
margin_bottom = 80.0
focus_neighbour_top = NodePath("../MainMenuButton")
focus_neighbour_bottom = NodePath("../RetryButton")
size_flags_vertical = 3
text = "Continue"
script = ExtResource( 6 )
[node name="RetryButton" parent="PauseOverlay/VBoxContainer" instance=ExtResource( 4 )]
margin_right = 222.0
margin_bottom = 80.0
focus_neighbour_top = NodePath("../Continue")
focus_neighbour_bottom = NodePath("../MainMenuButton")
[node name="MainMenuButton" parent="PauseOverlay/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 84.0
margin_right = 222.0
margin_bottom = 165.0
focus_neighbour_top = NodePath("../RetryButton")
focus_neighbour_bottom = NodePath("../Continue")
text = "Main Menu"
next_scene_path = "res://src/UserInterface/Screens/MainScreen.tscn"
[node name="QuitButton" parent="PauseOverlay/VBoxContainer" instance=ExtResource( 2 )]
anchor_left = 0.0
anchor_right = 0.0
margin_left = 0.0
margin_top = 169.0
margin_right = 222.0
margin_bottom = 250.0
[node name="PauseLabel" type="Label" parent="PauseOverlay"]
anchor_left = 0.5
anchor_right = 0.5
@ -69,3 +75,5 @@ margin_bottom = 15.0
size_flags_horizontal = 0
size_flags_vertical = 0
text = "Pause"
[connection signal="button_up" from="PauseOverlay/VBoxContainer/Continue" to="PauseOverlay/VBoxContainer/Continue" method="_on_button_up"]