diff options
| author | Anson Bridges <bridges.anson@gmail.com> | 2025-08-11 22:42:00 -0700 |
|---|---|---|
| committer | Anson Bridges <bridges.anson@gmail.com> | 2025-08-11 22:42:00 -0700 |
| commit | d558a9add0e183219a7a9ff482807bdcd677e21a (patch) | |
| tree | 49e454649a4b45ce02c419894109de55f7f2e465 /objects/PlaneControlBoard.tscn | |
Initialize repo from local files
Diffstat (limited to 'objects/PlaneControlBoard.tscn')
| -rw-r--r-- | objects/PlaneControlBoard.tscn | 292 |
1 files changed, 292 insertions, 0 deletions
diff --git a/objects/PlaneControlBoard.tscn b/objects/PlaneControlBoard.tscn new file mode 100644 index 0000000..4c58d5d --- /dev/null +++ b/objects/PlaneControlBoard.tscn @@ -0,0 +1,292 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://resources/PlaneControlBoard.theme" type="Theme" id=1] +[ext_resource path="res://scripts/PlaneControlBoard.gd" type="Script" id=2] +[ext_resource path="res://textures/airport_indicator_2.png" type="Texture" id=3] +[ext_resource path="res://textures/airport_indicator_3.png" type="Texture" id=4] +[ext_resource path="res://textures/airport_indicator_1.png" type="Texture" id=5] + +[sub_resource type="GDScript" id=3] +resource_name = "action_func" +script/source = "extends VBoxContainer + +var move_first = true + +# 0 = nothing, 1 = forward, 2 = CCW, 3 = CW, 4 = ascend, 5 = descend +func get_action(): + var action = [$ActionOption.get_selected_id()] + if move_first: + action.push_front(1) + else: + action.push_back(1) + +func reset(): + $ActionOption.select(0) + $MoveFirstButton.text = \"\" + $MoveLastButton.text = \"\" + +func disable(): + $MoveFirstButton.disabled = true + $MoveLastButton.disabled = true + $ActionOption.disabled = true + +func enable(): + reset() + set_move_first() + $MoveFirstButton.disabled = false + $MoveLastButton.disabled = false + $ActionOption.disabled = false + +func set_move_first(first = true): + if first: + move_first = true + $MoveFirstButton.text = \">>\" + $MoveLastButton.text = \"\" + else: + move_first = false + $MoveFirstButton.text = \"\" + $MoveLastButton.text = \">>\" +" + +[node name="PlaneControlBoard" type="ColorRect"] +margin_right = 400.0 +margin_bottom = 250.0 +size_flags_horizontal = 0 +size_flags_vertical = 0 +color = Color( 0.988235, 0.984314, 0.972549, 1 ) +script = ExtResource( 2 ) + +[node name="DestinationHBOX" type="HBoxContainer" parent="."] +anchor_left = 0.05 +anchor_top = 0.3 +anchor_right = 0.941 +anchor_bottom = 0.3 +margin_left = -2.0 +margin_top = -70.0 +margin_right = -2.0 +margin_bottom = -6.0 + +[node name="Label" type="Label" parent="DestinationHBOX"] +margin_top = 24.0 +margin_right = 111.0 +margin_bottom = 40.0 +theme = ExtResource( 1 ) +custom_colors/font_color = Color( 0, 0, 0, 1 ) +text = "DESTINATION: " + +[node name="DestinationIcon" type="TextureRect" parent="DestinationHBOX"] +margin_left = 115.0 +margin_right = 179.0 +margin_bottom = 64.0 +texture = ExtResource( 5 ) + +[node name="AltitudeHBox" type="HBoxContainer" parent="."] +anchor_left = 0.05 +anchor_top = 0.3 +anchor_right = 0.941 +anchor_bottom = 0.3 + +[node name="Label" type="Label" parent="AltitudeHBox"] +margin_top = 24.0 +margin_right = 109.0 +margin_bottom = 40.0 +theme = ExtResource( 1 ) +custom_colors/font_color = Color( 0, 0, 0, 1 ) +text = "ALTITUDE: " + +[node name="Altitude1" type="TextureRect" parent="AltitudeHBox"] +margin_left = 113.0 +margin_right = 177.0 +margin_bottom = 64.0 +texture = ExtResource( 5 ) + +[node name="Altitude2" type="TextureRect" parent="AltitudeHBox"] +modulate = Color( 0.3, 0.3, 0.3, 1 ) +margin_left = 181.0 +margin_right = 245.0 +margin_bottom = 64.0 +texture = ExtResource( 3 ) + +[node name="Altitude3" type="TextureRect" parent="AltitudeHBox"] +modulate = Color( 0.3, 0.3, 0.3, 1 ) +margin_left = 249.0 +margin_right = 313.0 +margin_bottom = 64.0 +size_flags_horizontal = 0 +size_flags_vertical = 0 +texture = ExtResource( 4 ) + +[node name="ActionHBox" type="HBoxContainer" parent="."] +anchor_left = 0.05 +anchor_top = 0.647 +anchor_right = 0.95 +anchor_bottom = 0.9 + +[node name="ActionSquare1" type="VBoxContainer" parent="ActionHBox"] +margin_right = 50.0 +margin_bottom = 74.0 +script = SubResource( 3 ) + +[node name="MoveFirstButton" type="Button" parent="ActionHBox/ActionSquare1"] +margin_right = 50.0 +margin_bottom = 22.0 +theme = ExtResource( 1 ) +text = ">>" + +[node name="ActionOption" type="OptionButton" parent="ActionHBox/ActionSquare1"] +margin_top = 26.0 +margin_right = 50.0 +margin_bottom = 48.0 +rect_min_size = Vector2( 50, 0 ) +theme = ExtResource( 1 ) +items = [ "", null, false, 0, null, "←", null, false, 2, null, "→", null, false, 3, null, "↑", null, false, 4, null, "↓", null, false, 5, null ] +selected = 0 + +[node name="MoveLastButton" type="Button" parent="ActionHBox/ActionSquare1"] +margin_top = 52.0 +margin_right = 50.0 +margin_bottom = 74.0 +theme = ExtResource( 1 ) + +[node name="Spacer1" type="Control" parent="ActionHBox"] +margin_left = 54.0 +margin_right = 73.0 +margin_bottom = 74.0 +size_flags_horizontal = 3 + +[node name="ActionSquare2" type="VBoxContainer" parent="ActionHBox"] +margin_left = 77.0 +margin_right = 127.0 +margin_bottom = 74.0 +script = SubResource( 3 ) + +[node name="MoveFirstButton" type="Button" parent="ActionHBox/ActionSquare2"] +margin_right = 50.0 +margin_bottom = 22.0 +theme = ExtResource( 1 ) +text = ">>" + +[node name="ActionOption" type="OptionButton" parent="ActionHBox/ActionSquare2"] +margin_top = 26.0 +margin_right = 50.0 +margin_bottom = 48.0 +rect_min_size = Vector2( 50, 0 ) +theme = ExtResource( 1 ) +items = [ "", null, false, 0, null, "←", null, false, 2, null, "→", null, false, 3, null, "↑", null, false, 4, null, "↓", null, false, 5, null ] +selected = 0 + +[node name="MoveLastButton" type="Button" parent="ActionHBox/ActionSquare2"] +margin_top = 52.0 +margin_right = 50.0 +margin_bottom = 74.0 +theme = ExtResource( 1 ) + +[node name="Spacer2" type="Control" parent="ActionHBox"] +margin_left = 131.0 +margin_right = 151.0 +margin_bottom = 74.0 +size_flags_horizontal = 3 + +[node name="ActionSquare3" type="VBoxContainer" parent="ActionHBox"] +margin_left = 155.0 +margin_right = 205.0 +margin_bottom = 74.0 +script = SubResource( 3 ) + +[node name="MoveFirstButton" type="Button" parent="ActionHBox/ActionSquare3"] +margin_right = 50.0 +margin_bottom = 22.0 +theme = ExtResource( 1 ) +text = ">>" + +[node name="ActionOption" type="OptionButton" parent="ActionHBox/ActionSquare3"] +margin_top = 26.0 +margin_right = 50.0 +margin_bottom = 48.0 +rect_min_size = Vector2( 50, 0 ) +theme = ExtResource( 1 ) +items = [ "", null, false, 0, null, "←", null, false, 2, null, "→", null, false, 3, null, "↑", null, false, 4, null, "↓", null, false, 5, null ] +selected = 0 + +[node name="MoveLastButton" type="Button" parent="ActionHBox/ActionSquare3"] +margin_top = 52.0 +margin_right = 50.0 +margin_bottom = 74.0 +theme = ExtResource( 1 ) + +[node name="Spacer3" type="Control" parent="ActionHBox"] +margin_left = 209.0 +margin_right = 228.0 +margin_bottom = 74.0 +size_flags_horizontal = 3 + +[node name="ActionSquare4" type="VBoxContainer" parent="ActionHBox"] +margin_left = 232.0 +margin_right = 282.0 +margin_bottom = 74.0 +script = SubResource( 3 ) + +[node name="MoveFirstButton" type="Button" parent="ActionHBox/ActionSquare4"] +margin_right = 50.0 +margin_bottom = 22.0 +theme = ExtResource( 1 ) +text = ">>" + +[node name="ActionOption" type="OptionButton" parent="ActionHBox/ActionSquare4"] +margin_top = 26.0 +margin_right = 50.0 +margin_bottom = 48.0 +rect_min_size = Vector2( 50, 0 ) +theme = ExtResource( 1 ) +items = [ "", null, false, 0, null, "←", null, false, 2, null, "→", null, false, 3, null, "↑", null, false, 4, null, "↓", null, false, 5, null ] +selected = 0 + +[node name="MoveLastButton" type="Button" parent="ActionHBox/ActionSquare4"] +margin_top = 52.0 +margin_right = 50.0 +margin_bottom = 74.0 +theme = ExtResource( 1 ) + +[node name="Spacer4" type="Control" parent="ActionHBox"] +margin_left = 286.0 +margin_right = 306.0 +margin_bottom = 74.0 +size_flags_horizontal = 3 + +[node name="ActionSquare5" type="VBoxContainer" parent="ActionHBox"] +margin_left = 310.0 +margin_right = 360.0 +margin_bottom = 74.0 +script = SubResource( 3 ) + +[node name="MoveFirstButton" type="Button" parent="ActionHBox/ActionSquare5"] +margin_right = 50.0 +margin_bottom = 22.0 +theme = ExtResource( 1 ) +text = ">>" + +[node name="ActionOption" type="OptionButton" parent="ActionHBox/ActionSquare5"] +margin_top = 26.0 +margin_right = 50.0 +margin_bottom = 48.0 +rect_min_size = Vector2( 50, 0 ) +theme = ExtResource( 1 ) +items = [ "", null, false, 0, null, "←", null, false, 2, null, "→", null, false, 3, null, "↑", null, false, 4, null, "↓", null, false, 5, null ] +selected = 0 + +[node name="MoveLastButton" type="Button" parent="ActionHBox/ActionSquare5"] +margin_top = 52.0 +margin_right = 50.0 +margin_bottom = 74.0 +theme = ExtResource( 1 ) + +[connection signal="pressed" from="ActionHBox/ActionSquare1/MoveFirstButton" to="ActionHBox/ActionSquare1" method="set_move_first" binds= [ true ]] +[connection signal="pressed" from="ActionHBox/ActionSquare1/MoveLastButton" to="ActionHBox/ActionSquare1" method="set_move_first" binds= [ false ]] +[connection signal="pressed" from="ActionHBox/ActionSquare2/MoveFirstButton" to="ActionHBox/ActionSquare2" method="set_move_first" binds= [ true ]] +[connection signal="pressed" from="ActionHBox/ActionSquare2/MoveLastButton" to="ActionHBox/ActionSquare2" method="set_move_first" binds= [ false ]] +[connection signal="pressed" from="ActionHBox/ActionSquare3/MoveFirstButton" to="ActionHBox/ActionSquare3" method="set_move_first" binds= [ true ]] +[connection signal="pressed" from="ActionHBox/ActionSquare3/MoveLastButton" to="ActionHBox/ActionSquare3" method="set_move_first" binds= [ false ]] +[connection signal="pressed" from="ActionHBox/ActionSquare4/MoveFirstButton" to="ActionHBox/ActionSquare4" method="set_move_first" binds= [ true ]] +[connection signal="pressed" from="ActionHBox/ActionSquare4/MoveLastButton" to="ActionHBox/ActionSquare4" method="set_move_first" binds= [ false ]] +[connection signal="pressed" from="ActionHBox/ActionSquare5/MoveFirstButton" to="ActionHBox/ActionSquare5" method="set_move_first" binds= [ true ]] +[connection signal="pressed" from="ActionHBox/ActionSquare5/MoveLastButton" to="ActionHBox/ActionSquare5" method="set_move_first" binds= [ false ]] |
