Navpanel, basic navigation to space station

This commit is contained in:
ToasterPanic 2025-12-06 17:03:58 -05:00
parent d0880655cd
commit 1d2332d9bd
12 changed files with 344 additions and 34 deletions

View file

@ -58,11 +58,28 @@ ui_select={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":3,"pressure":0.0,"pressed":false,"script":null)
] ]
} }
ui_left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
]
}
ui_right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
]
}
ui_up={ ui_up={
"deadzone": 0.5, "deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null) ]
}
ui_down={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"location":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)
] ]
} }
turn_left={ turn_left={
@ -176,6 +193,12 @@ dialogue_continue={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":true,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":true,"script":null)
] ]
} }
navpanel={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194306,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":4,"pressure":0.0,"pressed":true,"script":null)
]
}
[physics] [physics]

View file

@ -44,6 +44,7 @@ script = ExtResource("1_xwavj")
[node name="Boost" type="AudioStreamPlayer" parent="."] [node name="Boost" type="AudioStreamPlayer" parent="."]
stream = ExtResource("2_nenq2") stream = ExtResource("2_nenq2")
volume_db = -5.0
pitch_scale = 0.75 pitch_scale = 0.75
bus = &"Sound Effects" bus = &"Sound Effects"

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=33 format=4 uid="uid://bauklhpieuivd"] [gd_scene load_steps=39 format=4 uid="uid://bauklhpieuivd"]
[ext_resource type="Script" uid="uid://d0qswyhwbhdua" path="res://scripts/game.gd" id="1_u5sy4"] [ext_resource type="Script" uid="uid://d0qswyhwbhdua" path="res://scripts/game.gd" id="1_u5sy4"]
[ext_resource type="Texture2D" uid="uid://dtwo7g0ipc4k" path="res://textures/ship_1.png" id="1_uwrxv"] [ext_resource type="Texture2D" uid="uid://dtwo7g0ipc4k" path="res://textures/ship_1.png" id="1_uwrxv"]
@ -8,6 +8,8 @@
[ext_resource type="AudioStream" uid="uid://5tr30e1tmdp6" path="res://sounds/collision.mp3" id="2_lbhrr"] [ext_resource type="AudioStream" uid="uid://5tr30e1tmdp6" path="res://sounds/collision.mp3" id="2_lbhrr"]
[ext_resource type="AudioStream" uid="uid://b6tyof2j3ytbv" path="res://sounds/concrete_halls.mp3" id="3_0tnpc"] [ext_resource type="AudioStream" uid="uid://b6tyof2j3ytbv" path="res://sounds/concrete_halls.mp3" id="3_0tnpc"]
[ext_resource type="AudioStream" uid="uid://b1ung55xg31l3" path="res://sounds/boost_finish.mp3" id="3_p57ef"] [ext_resource type="AudioStream" uid="uid://b1ung55xg31l3" path="res://sounds/boost_finish.mp3" id="3_p57ef"]
[ext_resource type="AudioStream" uid="uid://cwidt34ehvre4" path="res://sounds/ui_select.mp3" id="4_5newe"]
[ext_resource type="PackedScene" uid="uid://gofibd3kwx3r" path="res://scenes/navigation_marker.tscn" id="5_264po"]
[ext_resource type="AudioStream" uid="uid://y7lhonymtk3t" path="res://sounds/fire.mp3" id="8_vtaks"] [ext_resource type="AudioStream" uid="uid://y7lhonymtk3t" path="res://sounds/fire.mp3" id="8_vtaks"]
[ext_resource type="Texture2D" uid="uid://dsdd1830ilu1" path="res://textures/navigation_ring.png" id="10_dinhu"] [ext_resource type="Texture2D" uid="uid://dsdd1830ilu1" path="res://textures/navigation_ring.png" id="10_dinhu"]
[ext_resource type="Texture2D" uid="uid://yfsqc4i52c6k" path="res://textures/space_station_1.png" id="12_dinhu"] [ext_resource type="Texture2D" uid="uid://yfsqc4i52c6k" path="res://textures/space_station_1.png" id="12_dinhu"]
@ -17,6 +19,7 @@
[ext_resource type="Script" uid="uid://b2maxk5g6yb0i" path="res://addons/super_awesome_input_icons/classes/input_icon_texture_rect.gd" id="15_ca42v"] [ext_resource type="Script" uid="uid://b2maxk5g6yb0i" path="res://addons/super_awesome_input_icons/classes/input_icon_texture_rect.gd" id="15_ca42v"]
[ext_resource type="Theme" uid="uid://dtc7h6gpwpend" path="res://scenes/ui.tres" id="15_ir15t"] [ext_resource type="Theme" uid="uid://dtc7h6gpwpend" path="res://scenes/ui.tres" id="15_ir15t"]
[ext_resource type="Script" uid="uid://dqiaioigmj5wb" path="res://scripts/pause_menu.gd" id="15_rysoc"] [ext_resource type="Script" uid="uid://dqiaioigmj5wb" path="res://scripts/pause_menu.gd" id="15_rysoc"]
[ext_resource type="FontFile" uid="uid://donsvh2l775rb" path="res://fonts/Doto.ttf" id="16_1kice"]
[ext_resource type="PackedScene" uid="uid://cy4nbqbm222os" path="res://scenes/settings.tscn" id="17_ssvqc"] [ext_resource type="PackedScene" uid="uid://cy4nbqbm222os" path="res://scenes/settings.tscn" id="17_ssvqc"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ir15t"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ir15t"]
@ -51,6 +54,10 @@ outline_color = Color(0, 0, 0, 1)
bg_color = Color(1, 0, 0, 1) bg_color = Color(1, 0, 0, 1)
corner_detail = 1 corner_detail = 1
[sub_resource type="LabelSettings" id="LabelSettings_5newe"]
font = ExtResource("16_1kice")
font_size = 28
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ir15t"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ir15t"]
bg_color = Color(0.5421658, 0.0015220869, 0.72708863, 1) bg_color = Color(0.5421658, 0.0015220869, 0.72708863, 1)
corner_detail = 1 corner_detail = 1
@ -58,9 +65,13 @@ corner_detail = 1
[sub_resource type="LabelSettings" id="LabelSettings_ca42v"] [sub_resource type="LabelSettings" id="LabelSettings_ca42v"]
outline_size = 2 outline_size = 2
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rysoc"] [sub_resource type="LabelSettings" id="LabelSettings_e1j6l"]
bg_color = Color(1, 0, 0, 1) font_size = 12
corner_detail = 1
[sub_resource type="LabelSettings" id="LabelSettings_37s47"]
[sub_resource type="LabelSettings" id="LabelSettings_bt5mj"]
font_size = 14
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_264po"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_264po"]
bg_color = Color(0, 0, 0, 1) bg_color = Color(0, 0, 0, 1)
@ -98,10 +109,12 @@ stream = ExtResource("3_0tnpc")
volume_db = -10.0 volume_db = -10.0
bus = &"Music" bus = &"Music"
[node name="UiSelect" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_5newe")
[node name="Stars" type="Node2D" parent="."] [node name="Stars" type="Node2D" parent="."]
[node name="Navring" type="Sprite2D" parent="."] [node name="Unloadables" type="Node2D" parent="."]
texture = ExtResource("10_dinhu")
[node name="Orbits" type="Node2D" parent="."] [node name="Orbits" type="Node2D" parent="."]
@ -129,7 +142,12 @@ shape = SubResource("RectangleShape2D_kvuet")
position = Vector2(0, 245.5) position = Vector2(0, 245.5)
rotation = 3.1415927 rotation = 3.1415927
[node name="Unloadables" type="Node2D" parent="."] [node name="Navring" type="Sprite2D" parent="."]
position = Vector2(0, -9000)
texture = ExtResource("10_dinhu")
[node name="NavigationMarker" parent="Navring" node_paths=PackedStringArray("destination") instance=ExtResource("5_264po")]
destination = NodePath("../../Orbits/SpaceStation1/SpaceStation1")
[node name="Player" type="RigidBody2D" parent="."] [node name="Player" type="RigidBody2D" parent="."]
position = Vector2(-78, -9043) position = Vector2(-78, -9043)
@ -138,6 +156,7 @@ script = ExtResource("1_yqjtg")
[node name="Boost" type="AudioStreamPlayer" parent="Player"] [node name="Boost" type="AudioStreamPlayer" parent="Player"]
stream = ExtResource("2_iywne") stream = ExtResource("2_iywne")
volume_db = -5.0
bus = &"Sound Effects" bus = &"Sound Effects"
[node name="BoostFinish" type="AudioStreamPlayer" parent="Player"] [node name="BoostFinish" type="AudioStreamPlayer" parent="Player"]
@ -260,28 +279,37 @@ anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
[node name="PanelContainer" type="PanelContainer" parent="UI/Control"] [node name="Navpanel" type="PanelContainer" parent="UI/Control"]
visible = false
layout_mode = 1 layout_mode = 1
anchors_preset = 2 anchors_preset = 4
anchor_top = 1.0 anchor_top = 0.5
anchor_bottom = 1.0 anchor_bottom = 0.5
offset_top = -52.0 offset_top = -83.0
offset_right = 260.0 offset_right = 260.0
grow_vertical = 0 offset_bottom = 83.0
grow_vertical = 2
theme = ExtResource("15_ir15t") theme = ExtResource("15_ir15t")
[node name="HFlowContainer" type="HFlowContainer" parent="UI/Control/PanelContainer"] [node name="Start" type="HFlowContainer" parent="UI/Control/Navpanel"]
layout_mode = 2 layout_mode = 2
theme_override_constants/v_separation = 0 theme_override_constants/v_separation = 0
[node name="Fuel" type="ProgressBar" parent="UI/Control/PanelContainer/HFlowContainer"] [node name="Label3" type="Label" parent="UI/Control/Navpanel/Start"]
layout_mode = 2
size_flags_horizontal = 3
text = "METERS"
label_settings = SubResource("LabelSettings_5newe")
horizontal_alignment = 1
[node name="Fuel" type="ProgressBar" parent="UI/Control/Navpanel/Start"]
custom_minimum_size = Vector2(256, 24) custom_minimum_size = Vector2(256, 24)
layout_mode = 2 layout_mode = 2
theme_override_styles/fill = SubResource("StyleBoxFlat_ir15t") theme_override_styles/fill = SubResource("StyleBoxFlat_ir15t")
value = 100.0 value = 100.0
show_percentage = false show_percentage = false
[node name="Label" type="Label" parent="UI/Control/PanelContainer/HFlowContainer/Fuel"] [node name="Label" type="Label" parent="UI/Control/Navpanel/Start/Fuel"]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -293,25 +321,107 @@ label_settings = SubResource("LabelSettings_ca42v")
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="Health" type="ProgressBar" parent="UI/Control/PanelContainer/HFlowContainer"] [node name="Label2" type="Label" parent="UI/Control/Navpanel/Start"]
custom_minimum_size = Vector2(256, 24)
layout_mode = 2 layout_mode = 2
theme_override_styles/fill = SubResource("StyleBoxFlat_rysoc") size_flags_horizontal = 3
value = 50.0 text = "SYSTEM"
fill_mode = 1 label_settings = SubResource("LabelSettings_5newe")
show_percentage = false
[node name="Label" type="Label" parent="UI/Control/PanelContainer/HFlowContainer/Health"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
text = "+1000 HEALTH"
label_settings = SubResource("LabelSettings_ca42v")
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1
[node name="Navigation" type="Button" parent="UI/Control/Navpanel/Start"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "navigation"
[node name="Button2" type="Button" parent="UI/Control/Navpanel/Start"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "test"
[node name="Cheery" type="Label" parent="UI/Control/Navpanel/Start"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "NAVMAX CHEERY V7.3.4.0."
label_settings = SubResource("LabelSettings_e1j6l")
horizontal_alignment = 1
autowrap_mode = 3
[node name="Cheery2" type="Label" parent="UI/Control/Navpanel/Start"]
layout_mode = 2
size_flags_horizontal = 3
text = "ALL RIGHTS RESERVED"
label_settings = SubResource("LabelSettings_e1j6l")
horizontal_alignment = 1
autowrap_mode = 3
[node name="Navigation" type="HFlowContainer" parent="UI/Control/Navpanel"]
visible = false
layout_mode = 2
theme_override_constants/v_separation = 0
[node name="Label3" type="Label" parent="UI/Control/Navpanel/Navigation"]
layout_mode = 2
size_flags_horizontal = 3
text = "NAVIGATION"
label_settings = SubResource("LabelSettings_5newe")
horizontal_alignment = 1
[node name="CurrentRoute" type="Label" parent="UI/Control/Navpanel/Navigation"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "CURRENT ROUTE:"
label_settings = SubResource("LabelSettings_37s47")
horizontal_alignment = 1
autowrap_mode = 3
[node name="Destination" type="Label" parent="UI/Control/Navpanel/Navigation"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "Space Station 1 (1000u)"
label_settings = SubResource("LabelSettings_bt5mj")
horizontal_alignment = 1
autowrap_mode = 3
[node name="NewRoute" type="Button" parent="UI/Control/Navpanel/Navigation"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "new route"
[node name="CancelRoute" type="Button" parent="UI/Control/Navpanel/Navigation"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "cancel route"
[node name="NavpanelBack" type="Button" parent="UI/Control/Navpanel/Navigation"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "back"
[node name="NavigationRoutes" type="HFlowContainer" parent="UI/Control/Navpanel"]
visible = false
layout_mode = 2
theme_override_constants/v_separation = 0
[node name="Label3" type="Label" parent="UI/Control/Navpanel/NavigationRoutes"]
layout_mode = 2
size_flags_horizontal = 3
text = "PICK ROUTE"
label_settings = SubResource("LabelSettings_5newe")
horizontal_alignment = 1
[node name="NavpanelBack" type="Button" parent="UI/Control/Navpanel/NavigationRoutes"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "back"
[node name="PauseMenu" type="Panel" parent="UI/Control"] [node name="PauseMenu" type="Panel" parent="UI/Control"]
process_mode = 3 process_mode = 3
@ -443,4 +553,9 @@ color = Color(1, 1, 1, 0)
[connection signal="area_entered" from="Orbits/SpaceStation1/SpaceStation1/EnterHitbox" to="Orbits/SpaceStation1/SpaceStation1" method="_on_enter_hitbox_area_entered"] [connection signal="area_entered" from="Orbits/SpaceStation1/SpaceStation1/EnterHitbox" to="Orbits/SpaceStation1/SpaceStation1" method="_on_enter_hitbox_area_entered"]
[connection signal="body_entered" from="Orbits/SpaceStation1/SpaceStation1/EnterHitbox" to="Orbits/SpaceStation1/SpaceStation1" method="_on_enter_hitbox_body_entered"] [connection signal="body_entered" from="Orbits/SpaceStation1/SpaceStation1/EnterHitbox" to="Orbits/SpaceStation1/SpaceStation1" method="_on_enter_hitbox_body_entered"]
[connection signal="body_shape_entered" from="Player/Hitbox" to="Player" method="_on_hitbox_body_shape_entered"] [connection signal="body_shape_entered" from="Player/Hitbox" to="Player" method="_on_hitbox_body_shape_entered"]
[connection signal="pressed" from="UI/Control/Navpanel/Start/Navigation" to="." method="_on_navigation_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/Navigation/NewRoute" to="." method="_on_new_route_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/Navigation/CancelRoute" to="." method="_on_cancel_route_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/Navigation/NavpanelBack" to="." method="_on_navpanel_back_pressed"]
[connection signal="pressed" from="UI/Control/Navpanel/NavigationRoutes/NavpanelBack" to="." method="_on_navpanel_back_pressed"]
[connection signal="pressed" from="UI/Control/PauseMenu/Panel/Flow/Resume" to="UI/Control/PauseMenu" method="_on_resume_pressed"] [connection signal="pressed" from="UI/Control/PauseMenu/Panel/Flow/Resume" to="UI/Control/PauseMenu" method="_on_resume_pressed"]

View file

@ -0,0 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://gofibd3kwx3r"]
[ext_resource type="Texture2D" uid="uid://cfuclgb21yw7n" path="res://textures/navigation_marker.png" id="1_ux3yp"]
[ext_resource type="Script" uid="uid://ddwxm6i060srm" path="res://scripts/navigation_marker.gd" id="2_vk7ji"]
[node name="NavigationMarker" type="Sprite2D"]
texture = ExtResource("1_ux3yp")
script = ExtResource("2_vk7ji")

View file

@ -14,6 +14,14 @@ var star_scene = preload("res://scenes/star.tscn")
"SpaceStation1": $Orbits/SpaceStation1/SpaceStation1/ExitPoint "SpaceStation1": $Orbits/SpaceStation1/SpaceStation1/ExitPoint
} }
@onready var navigation_points = [
{
"name": "Space Station 1",
"id": "ss1",
"point": $Orbits/SpaceStation1/SpaceStation1
}
]
func ship_health(health: float = 1000) -> void: func ship_health(health: float = 1000) -> void:
$Player.health = health $Player.health = health
@ -97,6 +105,33 @@ func _ready() -> void:
func _process(delta: float) -> void: func _process(delta: float) -> void:
if get_tree().paused: if get_tree().paused:
return return
if global.stats.navigation_goal:
if not global.stats.navigation_goal.point:
global.stats.navigation_goal = null
else:
if !$Navring.has_node("NavigationMarker"):
var navigation_marker = preload("res://scenes/navigation_marker.tscn").instantiate()
navigation_marker.destination = global.stats.navigation_goal.point
$Navring.add_child(navigation_marker)
if $UI/Control/Navpanel/Navigation.visible:
$UI/Control/Navpanel/Navigation/CurrentRoute.visible = true
$UI/Control/Navpanel/Navigation/Destination.visible = true
var goal_distance = (global.stats.navigation_goal.point.position - $Player.position).length()
$UI/Control/Navpanel/Navigation/Destination.text = global.stats.navigation_goal.name + " (" + str(floori(goal_distance)) + "u)"
else:
if $Navring.has_node("NavigationMarker"):
$Navring.get_node("NavigationMarker").queue_free()
if $UI/Control/Navpanel/Navigation.visible:
$UI/Control/Navpanel/Navigation/CurrentRoute.visible = false
$UI/Control/Navpanel/Navigation/Destination.visible = false
$Navring.position = $Player.position $Navring.position = $Player.position
@ -172,6 +207,18 @@ func _process(delta: float) -> void:
n.queue_free() n.queue_free()
elif abs(n_pos.y - player_chunk.y) > chunk_process_distance: elif abs(n_pos.y - player_chunk.y) > chunk_process_distance:
n.queue_free() n.queue_free()
func _set_navpanel_menu(menu: String) -> void:
for n in $UI/Control/Navpanel.get_children():
if n.get_name() == menu:
n.visible = true
for o in n.get_children():
if o.is_class("Button"):
o.grab_focus()
break
else:
n.visible = false
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if event.is_action_pressed("pause"): if event.is_action_pressed("pause"):
@ -180,8 +227,35 @@ func _input(event: InputEvent) -> void:
$UI/Control/PauseMenu/Panel/Flow/Resume.grab_focus() $UI/Control/PauseMenu/Panel/Flow/Resume.grab_focus()
get_tree().paused = true get_tree().paused = true
elif event.is_action_pressed("navpanel"):
if $UI/Control/Navpanel.visible:
$UI/Control/Navpanel.visible = false
else:
$UI/Control/Navpanel.visible = true
_set_navpanel_menu("Start")
func _on_tree_exiting() -> void: func _on_tree_exiting() -> void:
LimboConsole.unregister_command(ship_health) LimboConsole.unregister_command(ship_health)
LimboConsole.unregister_command(summon_enemy) LimboConsole.unregister_command(summon_enemy)
func _on_navigation_pressed() -> void:
$UiSelect.play()
_set_navpanel_menu("Navigation")
func _on_navpanel_back_pressed() -> void:
$UiSelect.play()
_set_navpanel_menu("Start")
func _on_new_route_pressed() -> void:
$UiSelect.play()
global.stats.navigation_goal = navigation_points[0]
func _on_cancel_route_pressed() -> void:
$UiSelect.play()
global.stats.navigation_goal = null

View file

@ -100,6 +100,7 @@ var default_stats = {
"ship_position": Vector2(), "ship_position": Vector2(),
"ship_rotation": 0, "ship_rotation": 0,
"story_progress": 1, "story_progress": 1,
"navigation_goal": null,
} }
var stats = default_stats.duplicate_deep() var stats = default_stats.duplicate_deep()

View file

@ -0,0 +1,7 @@
extends Sprite2D
@export var destination: Node2D = null
func _process(delta: float) -> void:
look_at(destination.global_position)
rotation += deg_to_rad(90)

View file

@ -0,0 +1 @@
uid://ddwxm6i060srm

BIN
textures/enemy_marker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cb8vib78fhpk1"
path="res://.godot/imported/enemy_marker.png-0a4635901a8d9931743f35bbc1887539.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://textures/enemy_marker.png"
dest_files=["res://.godot/imported/enemy_marker.png-0a4635901a8d9931743f35bbc1887539.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cfuclgb21yw7n"
path="res://.godot/imported/navigation_marker.png-5fa9547837f93dd7619ce383fd3f44b9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://textures/navigation_marker.png"
dest_files=["res://.godot/imported/navigation_marker.png-5fa9547837f93dd7619ce383fd3f44b9.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1