diff --git a/design/ui/feedback.md b/design/ui/feedback.md new file mode 100644 index 0000000..dbf46c4 --- /dev/null +++ b/design/ui/feedback.md @@ -0,0 +1,4 @@ +# Feedback on UI + +- Too large (on small screens?) +- Unit Info has a lot of empty space below, shrink perhaps? diff --git a/design/ui/menu.svg b/design/ui/menu.svg index 82039c3..c8e653a 100644 --- a/design/ui/menu.svg +++ b/design/ui/menu.svg @@ -155,11 +155,11 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1.979899" - inkscape:cx="948.30839" - inkscape:cy="536.45358" + inkscape:zoom="1.4" + inkscape:cx="922.14063" + inkscape:cy="463.8584" inkscape:document-units="px" - inkscape:current-layer="layer2" + inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1920" inkscape:window-height="1020" @@ -181,7 +181,7 @@ image/svg+xml - + @@ -189,8 +189,7 @@ inkscape:label="Panel" inkscape:groupmode="layer" id="layer1" - style="display:inline;opacity:0.5" - sodipodi:insensitive="true"> + style="display:inline;opacity:0.5"> + + style="display:inline" + sodipodi:insensitive="true"> diff --git a/designer/designer.gd b/designer/designer.gd index bfd6692..d139f47 100644 --- a/designer/designer.gd +++ b/designer/designer.gd @@ -45,11 +45,11 @@ func _process(_delta): func set_enabled(var p_enabled): enabled = p_enabled if p_enabled: - $HUD/Menu.visible = false - $HUD/Inventory.visible = false - $HUD/SaveVehicle.visible = false - $HUD/LoadVehicle.visible = false - $HUD/Tint.visible = not enabled + $GUI/Menu.visible = false + $GUI/Inventory.visible = false + $GUI/SaveVehicle.visible = false + $GUI/LoadVehicle.visible = false + #$GUI/Tint.visible = not enabled $Camera.enabled = enabled set_process(enabled) set_process_input(enabled) @@ -59,10 +59,10 @@ func set_enabled(var p_enabled): func process_actions(): if Input.is_action_just_pressed("ui_cancel"): set_enabled(false) - $HUD/Menu.visible = true + $GUI/Menu.visible = true elif Input.is_action_pressed("designer_open_inventory"): set_enabled(false) - $HUD/Inventory.visible = true + $GUI/Inventory.visible = true elif Input.is_action_just_pressed("designer_place_block"): if ray_voxel_valid: var coordinate = _v2a(_a2v(ray.voxel) + _a2v(ray.get_normal())) diff --git a/designer/designer.tscn b/designer/designer.tscn index e81807a..e5f55f2 100644 --- a/designer/designer.tscn +++ b/designer/designer.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=26 format=2] +[gd_scene load_steps=29 format=2] [ext_resource path="res://camera/free_camera.gd" type="Script" id=1] [ext_resource path="res://designer/designer.gd" type="Script" id=2] @@ -8,12 +8,11 @@ [ext_resource path="res://designer/save_vehicle.gd" type="Script" id=6] [ext_resource path="res://addons/crosshairs/image0018.png" type="Texture" id=7] [ext_resource path="res://menu/good_times_rg.ttf" type="DynamicFontData" id=8] -[ext_resource path="res://menu/load_vehicle.tscn" type="PackedScene" id=9] [ext_resource path="res://addons/arrow.png" type="Texture" id=10] [ext_resource path="res://menu/main.tscn" type="PackedScene" id=11] [ext_resource path="res://designer/map.tscn" type="PackedScene" id=12] - - +[ext_resource path="res://menu/dialog/independent_panel.tscn" type="PackedScene" id=13] +[ext_resource path="res://designer/load_vehicle.gd" type="Script" id=14] [sub_resource type="SpatialMaterial" id=1] flags_transparent = true @@ -35,12 +34,6 @@ action = "ui_cancel" [sub_resource type="ShortCut" id=6] shortcut = SubResource( 5 ) -[sub_resource type="InputEventAction" id=7] -action = "ui_cancel" - -[sub_resource type="ShortCut" id=8] -shortcut = SubResource( 7 ) - [sub_resource type="DynamicFont" id=9] font_data = ExtResource( 8 ) @@ -56,6 +49,18 @@ action = "ui_accept" [sub_resource type="ShortCut" id=13] shortcut = SubResource( 12 ) +[sub_resource type="InputEventAction" id=14] +action = "ui_cancel" + +[sub_resource type="ShortCut" id=15] +shortcut = SubResource( 14 ) + +[sub_resource type="InputEventAction" id=16] +action = "ui_accept" + +[sub_resource type="ShortCut" id=17] +shortcut = SubResource( 16 ) + [node name="Designer" type="Node"] script = ExtResource( 2 ) main_menu = ExtResource( 11 ) @@ -104,38 +109,21 @@ width = 0.75 height = 0.75 depth = 3.0 -[node name="HUD" type="Control" parent="."] -anchor_right = 1.0 -anchor_bottom = 1.0 -theme = ExtResource( 4 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Tint" type="ColorRect" parent="HUD"] -visible = false -anchor_right = 1.0 -anchor_bottom = 1.0 -color = Color( 0, 0, 0, 0.392157 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Overlay" type="CenterContainer" parent="HUD"] +[node name="HUD" type="CenterContainer" parent="."] anchor_right = 1.0 anchor_bottom = 1.0 __meta__ = { "_edit_use_anchors_": false } -[node name="TextureRect" type="TextureRect" parent="HUD/Overlay"] +[node name="TextureRect" type="TextureRect" parent="HUD"] margin_left = 928.0 margin_top = 508.0 margin_right = 992.0 margin_bottom = 572.0 texture = ExtResource( 7 ) -[node name="Menu" type="CenterContainer" parent="HUD"] +[node name="GUI" type="Control" parent="."] anchor_right = 1.0 anchor_bottom = 1.0 theme = ExtResource( 4 ) @@ -143,291 +131,330 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Panel" type="PanelContainer" parent="HUD/Menu"] -margin_left = 877.0 -margin_top = 384.0 -margin_right = 1042.0 -margin_bottom = 695.0 - -[node name="MarginContainer" type="MarginContainer" parent="HUD/Menu/Panel"] -margin_left = 2.0 -margin_top = 2.0 -margin_right = 165.0 -margin_bottom = 311.0 -custom_constants/margin_right = 20 -custom_constants/margin_top = 20 -custom_constants/margin_left = 20 -custom_constants/margin_bottom = 20 +[node name="Menu" parent="GUI" instance=ExtResource( 13 )] +visible = false +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -160.0 +margin_top = -190.0 +margin_right = 160.0 +margin_bottom = 190.0 +title = "Menu" + +[node name="VBoxContainer" type="VBoxContainer" parent="GUI/Menu"] +margin_left = 40.0 +margin_top = 40.0 +margin_right = 305.0 +custom_constants/separation = 10 __meta__ = { "_edit_use_anchors_": false } -[node name="VBoxContainer" type="VBoxContainer" parent="HUD/Menu/Panel/MarginContainer"] -margin_left = 20.0 -margin_top = 20.0 -margin_right = 143.0 -margin_bottom = 289.0 -custom_constants/separation = 10 -alignment = 1 - -[node name="Title" type="Label" parent="HUD/Menu/Panel/MarginContainer/VBoxContainer"] -margin_right = 123.0 -margin_bottom = 53.0 -text = "Menu -" -align = 1 - -[node name="Continue" type="Button" parent="HUD/Menu/Panel/MarginContainer/VBoxContainer"] -margin_top = 63.0 -margin_right = 123.0 -margin_bottom = 89.0 +[node name="Continue" type="Button" parent="GUI/Menu/VBoxContainer"] +margin_right = 265.0 +margin_bottom = 41.6293 shortcut = SubResource( 6 ) text = "Continue" -[node name="Test" type="Button" parent="HUD/Menu/Panel/MarginContainer/VBoxContainer"] -margin_top = 99.0 -margin_right = 123.0 -margin_bottom = 125.0 +[node name="Test" type="Button" parent="GUI/Menu/VBoxContainer"] +margin_top = 51.0 +margin_right = 265.0 +margin_bottom = 92.6293 text = "Test" -[node name="Save" type="Button" parent="HUD/Menu/Panel/MarginContainer/VBoxContainer"] -margin_top = 135.0 -margin_right = 123.0 -margin_bottom = 161.0 +[node name="Save" type="Button" parent="GUI/Menu/VBoxContainer"] +margin_top = 102.0 +margin_right = 265.0 +margin_bottom = 143.629 text = "Save" -[node name="Load" type="Button" parent="HUD/Menu/Panel/MarginContainer/VBoxContainer"] -margin_top = 171.0 -margin_right = 123.0 -margin_bottom = 197.0 +[node name="Load" type="Button" parent="GUI/Menu/VBoxContainer"] +margin_top = 153.0 +margin_right = 265.0 +margin_bottom = 194.629 text = "Load" -[node name="Settings" type="Button" parent="HUD/Menu/Panel/MarginContainer/VBoxContainer"] -margin_top = 207.0 -margin_right = 123.0 -margin_bottom = 233.0 +[node name="Settings" type="Button" parent="GUI/Menu/VBoxContainer"] +margin_top = 204.0 +margin_right = 265.0 +margin_bottom = 245.629 text = "Settings" -[node name="Exit" type="Button" parent="HUD/Menu/Panel/MarginContainer/VBoxContainer"] -margin_top = 243.0 -margin_right = 123.0 -margin_bottom = 269.0 +[node name="Exit" type="Button" parent="GUI/Menu/VBoxContainer"] +margin_top = 255.0 +margin_right = 265.0 +margin_bottom = 296.629 text = "Exit" -[node name="Inventory" type="VBoxContainer" parent="HUD"] -visible = false +[node name="Inventory" parent="GUI" instance=ExtResource( 13 )] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 40.0 +margin_top = 40.0 +margin_right = -40.0 +margin_bottom = -40.0 +title = "Inventory" + +[node name="Inventory" type="VBoxContainer" parent="GUI/Inventory"] anchor_right = 1.0 anchor_bottom = 1.0 +margin_left = 40.0 +margin_top = 40.0 +margin_right = -40.0 +margin_bottom = -40.0 script = ExtResource( 5 ) __meta__ = { "_edit_use_anchors_": false } -category_button_template = NodePath("HBoxContainer2/HBoxContainer/Categories/VBoxContainer/Template") -block_button_template = NodePath("HBoxContainer2/HBoxContainer/Blocks/GridContainer/Template") -preview_mesh = NodePath("HBoxContainer2/HBoxContainer2/ViewportContainer/Viewport/Camera/MeshInstance") - -[node name="PanelContainer" type="PanelContainer" parent="HUD/Inventory"] -margin_right = 1920.0 -margin_bottom = 49.0 - -[node name="Title" type="Label" parent="HUD/Inventory/PanelContainer"] -margin_left = 7.0 -margin_top = 10.0 -margin_right = 1913.0 -margin_bottom = 39.0 -size_flags_horizontal = 3 -text = "Inventory" -align = 1 -__meta__ = { -"_edit_use_anchors_": false -} +category_button_template = NodePath("../../Inventory/Inventory/HBoxContainer2/HBoxContainer/Categories/VBoxContainer/Template") +block_button_template = NodePath("../../Inventory/Inventory/HBoxContainer2/HBoxContainer/Blocks/GridContainer/Template") +preview_mesh = NodePath("../../Inventory/Inventory/HBoxContainer2/HBoxContainer2/ViewportContainer/Viewport/Camera/MeshInstance") -[node name="HBoxContainer" type="HBoxContainer" parent="HUD/Inventory/PanelContainer"] -margin_left = 7.0 -margin_top = 7.0 -margin_right = 1913.0 -margin_bottom = 42.0 -alignment = 2 - -[node name="Exit" type="Button" parent="HUD/Inventory/PanelContainer/HBoxContainer"] -margin_left = 1870.0 -margin_right = 1906.0 -margin_bottom = 35.0 -shortcut = SubResource( 8 ) -text = "X" - -[node name="HBoxContainer2" type="HBoxContainer" parent="HUD/Inventory"] -margin_top = 53.0 -margin_right = 1920.0 -margin_bottom = 1080.0 +[node name="HBoxContainer2" type="HBoxContainer" parent="GUI/Inventory/Inventory"] +margin_right = 1760.0 +margin_bottom = 920.0 size_flags_vertical = 3 -[node name="HBoxContainer" type="HBoxContainer" parent="HUD/Inventory/HBoxContainer2"] -margin_right = 958.0 -margin_bottom = 1027.0 +[node name="HBoxContainer" type="HBoxContainer" parent="GUI/Inventory/Inventory/HBoxContainer2"] +margin_right = 878.0 +margin_bottom = 920.0 size_flags_horizontal = 3 -[node name="Categories" type="ScrollContainer" parent="HUD/Inventory/HBoxContainer2/HBoxContainer"] -margin_right = 179.0 -margin_bottom = 1027.0 +[node name="Categories" type="ScrollContainer" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer"] +margin_right = 144.0 +margin_bottom = 920.0 size_flags_vertical = 3 scroll_horizontal_enabled = false -[node name="VBoxContainer" type="VBoxContainer" parent="HUD/Inventory/HBoxContainer2/HBoxContainer/Categories"] -margin_right = 141.0 -margin_bottom = 1027.0 +[node name="VBoxContainer" type="VBoxContainer" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer/Categories"] +margin_right = 144.0 +margin_bottom = 920.0 size_flags_vertical = 3 -[node name="Template" type="Button" parent="HUD/Inventory/HBoxContainer2/HBoxContainer/Categories/VBoxContainer"] -margin_right = 179.0 -margin_bottom = 35.0 +[node name="Template" type="Button" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer/Categories/VBoxContainer"] +margin_right = 144.454 +margin_bottom = 41.6293 text = "Category" -[node name="Blocks" type="ScrollContainer" parent="HUD/Inventory/HBoxContainer2/HBoxContainer"] -margin_left = 183.0 -margin_right = 297.0 -margin_bottom = 1027.0 +[node name="Blocks" type="ScrollContainer" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer"] +margin_left = 148.0 +margin_right = 247.0 +margin_bottom = 920.0 scroll_horizontal_enabled = false -[node name="GridContainer" type="GridContainer" parent="HUD/Inventory/HBoxContainer2/HBoxContainer/Blocks"] -margin_right = 87.0 -margin_bottom = 26.0 +[node name="GridContainer" type="GridContainer" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer/Blocks"] +margin_right = 99.0 +margin_bottom = 41.0 columns = 2 -[node name="Template" type="Button" parent="HUD/Inventory/HBoxContainer2/HBoxContainer/Blocks/GridContainer"] -margin_right = 114.0 -margin_bottom = 35.0 +[node name="Template" type="Button" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer/Blocks/GridContainer"] +margin_right = 99.4545 +margin_bottom = 41.6293 text = "Block" -[node name="HBoxContainer2" type="HBoxContainer" parent="HUD/Inventory/HBoxContainer2"] -margin_left = 962.0 -margin_right = 1920.0 -margin_bottom = 1027.0 +[node name="HBoxContainer2" type="HBoxContainer" parent="GUI/Inventory/Inventory/HBoxContainer2"] +margin_left = 882.0 +margin_right = 1760.0 +margin_bottom = 920.0 size_flags_horizontal = 3 -[node name="ViewportContainer" type="ViewportContainer" parent="HUD/Inventory/HBoxContainer2/HBoxContainer2"] -margin_right = 958.0 -margin_bottom = 1027.0 +[node name="ViewportContainer" type="ViewportContainer" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer2"] +margin_right = 878.0 +margin_bottom = 920.0 size_flags_horizontal = 3 stretch = true -[node name="Viewport" type="Viewport" parent="HUD/Inventory/HBoxContainer2/HBoxContainer2/ViewportContainer"] -size = Vector2( 958, 1027 ) +[node name="Viewport" type="Viewport" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer2/ViewportContainer"] +size = Vector2( 878, 920 ) handle_input_locally = false -render_target_update_mode = 0 +render_target_update_mode = 3 -[node name="Camera" type="Camera" parent="HUD/Inventory/HBoxContainer2/HBoxContainer2/ViewportContainer/Viewport"] +[node name="Camera" type="Camera" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer2/ViewportContainer/Viewport"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 42.9181, 16.5937, 0 ) -[node name="MeshInstance" type="MeshInstance" parent="HUD/Inventory/HBoxContainer2/HBoxContainer2/ViewportContainer/Viewport/Camera"] +[node name="MeshInstance" type="MeshInstance" parent="GUI/Inventory/Inventory/HBoxContainer2/HBoxContainer2/ViewportContainer/Viewport/Camera"] transform = Transform( 2.71817, 0.145894, 2.93091, 1.28558, 3.53209, -1.36808, -2.63796, 1.87165, 2.35332, 0, 0, -2 ) -[node name="SaveVehicle" type="CenterContainer" parent="HUD"] +[node name="SaveVehicle" parent="GUI" instance=ExtResource( 13 )] visible = false -anchor_right = 1.0 -anchor_bottom = 1.0 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -160.0 +margin_top = -190.0 +margin_right = 160.0 +margin_bottom = 190.0 +size_flags_vertical = 3 script = ExtResource( 6 ) +title = "Save" + +[node name="VBoxContainer" type="VBoxContainer" parent="GUI/SaveVehicle"] +anchor_left = 0.125 +anchor_top = 0.105 +anchor_right = 0.953 +anchor_bottom = 0.933 +margin_top = 0.0999985 +margin_right = 0.039978 +margin_bottom = -0.540009 +size_flags_vertical = 3 __meta__ = { "_edit_use_anchors_": false } -[node name="PanelContainer" type="PanelContainer" parent="HUD/SaveVehicle"] -margin_left = 760.0 -margin_top = 390.0 -margin_right = 1160.0 -margin_bottom = 690.0 -rect_min_size = Vector2( 400, 300 ) - -[node name="VBoxContainer" type="VBoxContainer" parent="HUD/SaveVehicle/PanelContainer"] -margin_left = 7.0 -margin_top = 7.0 -margin_right = 393.0 -margin_bottom = 293.0 - -[node name="Label" type="Label" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer"] -margin_right = 386.0 -margin_bottom = 25.0 -text = "Save Vehicle" -align = 1 - -[node name="Name" type="LineEdit" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer"] -margin_top = 29.0 -margin_right = 386.0 -margin_bottom = 64.0 +[node name="Name" type="LineEdit" parent="GUI/SaveVehicle/VBoxContainer"] +margin_right = 265.0 +margin_bottom = 42.0 expand_to_text_length = true placeholder_text = "Name" caret_blink = true -[node name="Path" type="Label" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer"] -margin_top = 68.0 -margin_right = 386.0 -margin_bottom = 88.0 +[node name="Path" type="Label" parent="GUI/SaveVehicle/VBoxContainer"] +margin_top = 46.0 +margin_right = 265.0 +margin_bottom = 66.0 custom_fonts/font = SubResource( 9 ) +autowrap = true -[node name="PanelContainer" type="PanelContainer" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer"] -margin_top = 92.0 -margin_right = 386.0 -margin_bottom = 251.0 +[node name="PanelContainer" type="PanelContainer" parent="GUI/SaveVehicle/VBoxContainer"] +margin_top = 70.0 +margin_right = 265.0 +margin_bottom = 269.0 size_flags_vertical = 3 -[node name="ScrollContainer" type="ScrollContainer" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer/PanelContainer"] -margin_left = 7.0 -margin_top = 7.0 -margin_right = 379.0 -margin_bottom = 152.0 -scroll_vertical_enabled = false +[node name="ScrollContainer" type="ScrollContainer" parent="GUI/SaveVehicle/VBoxContainer/PanelContainer"] +margin_left = 16.0 +margin_top = 11.0 +margin_right = 249.0 +margin_bottom = 188.0 +scroll_horizontal_enabled = false -[node name="Files" type="VBoxContainer" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer/PanelContainer/ScrollContainer"] -margin_right = 372.0 -margin_bottom = 26.0 +[node name="Files" type="VBoxContainer" parent="GUI/SaveVehicle/VBoxContainer/PanelContainer/ScrollContainer"] +margin_right = 233.0 +margin_bottom = 41.0 size_flags_horizontal = 3 -[node name="Template" type="Button" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer/PanelContainer/ScrollContainer/Files"] -margin_right = 372.0 -margin_bottom = 31.0 +[node name="Template" type="Button" parent="GUI/SaveVehicle/VBoxContainer/PanelContainer/ScrollContainer/Files"] +margin_right = 233.0 +margin_bottom = 41.6293 size_flags_horizontal = 3 text = "Vehicle name" align = 0 -[node name="HBoxContainer" type="HBoxContainer" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer"] -margin_top = 255.0 -margin_right = 386.0 -margin_bottom = 286.0 +[node name="HBoxContainer" type="HBoxContainer" parent="GUI/SaveVehicle/VBoxContainer"] +margin_top = 273.0 +margin_right = 265.0 +margin_bottom = 314.0 size_flags_horizontal = 3 __meta__ = { "_edit_use_anchors_": false } -[node name="Cancel" type="Button" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer/HBoxContainer"] -anchor_top = 0.0322581 -anchor_bottom = 0.0322581 -margin_right = 191.0 -margin_bottom = 31.0 +[node name="Cancel" type="Button" parent="GUI/SaveVehicle/VBoxContainer/HBoxContainer"] +margin_right = 130.0 +margin_bottom = 41.6293 size_flags_horizontal = 3 shortcut = SubResource( 11 ) text = "Cancel" -[node name="Save" type="Button" parent="HUD/SaveVehicle/PanelContainer/VBoxContainer/HBoxContainer"] -margin_left = 195.0 -margin_right = 386.0 -margin_bottom = 31.0 +[node name="Save" type="Button" parent="GUI/SaveVehicle/VBoxContainer/HBoxContainer"] +margin_left = 134.0 +margin_right = 265.0 +margin_bottom = 41.6293 size_flags_horizontal = 3 shortcut = SubResource( 13 ) text = "Save" -[node name="LoadVehicle" parent="HUD" instance=ExtResource( 9 )] -[connection signal="pressed" from="HUD/Menu/Panel/MarginContainer/VBoxContainer/Continue" to="." method="set_enabled" binds= [ true ]] -[connection signal="pressed" from="HUD/Menu/Panel/MarginContainer/VBoxContainer/Test" to="." method="_on_Test_pressed"] -[connection signal="pressed" from="HUD/Menu/Panel/MarginContainer/VBoxContainer/Save" to="HUD/Menu" method="set_visible" binds= [ false ]] -[connection signal="pressed" from="HUD/Menu/Panel/MarginContainer/VBoxContainer/Save" to="HUD/SaveVehicle" method="set_visible" binds= [ true ]] -[connection signal="pressed" from="HUD/Menu/Panel/MarginContainer/VBoxContainer/Load" to="HUD/LoadVehicle" method="set_visible" binds= [ true ]] -[connection signal="pressed" from="HUD/Menu/Panel/MarginContainer/VBoxContainer/Exit" to="." method="_on_Exit_pressed"] -[connection signal="pressed" from="HUD/Inventory/PanelContainer/HBoxContainer/Exit" to="." method="set_enabled" binds= [ true ]] -[connection signal="save_vehicle" from="HUD/SaveVehicle" to="." method="save_vehicle"] -[connection signal="text_changed" from="HUD/SaveVehicle/PanelContainer/VBoxContainer/Name" to="HUD/SaveVehicle" method="_on_Name_text_changed"] -[connection signal="pressed" from="HUD/SaveVehicle/PanelContainer/VBoxContainer/HBoxContainer/Cancel" to="." method="set_enabled" binds= [ true ]] -[connection signal="pressed" from="HUD/SaveVehicle/PanelContainer/VBoxContainer/HBoxContainer/Save" to="." method="set_enabled" binds= [ true ]] -[connection signal="pressed" from="HUD/SaveVehicle/PanelContainer/VBoxContainer/HBoxContainer/Save" to="HUD/SaveVehicle" method="_on_Save_pressed"] -[connection signal="cancel" from="HUD/LoadVehicle" to="." method="set_enabled" binds= [ true ]] -[connection signal="load_vehicle" from="HUD/LoadVehicle" to="." method="_on_LoadVehicle_load_vehicle"] -[connection signal="load_vehicle" from="HUD/LoadVehicle" to="HUD/SaveVehicle" method="set_full_path"] +[node name="LoadVehicle" parent="GUI" instance=ExtResource( 13 )] +visible = false +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -160.0 +margin_top = -190.0 +margin_right = 160.0 +margin_bottom = 190.0 +script = ExtResource( 14 ) +title = "Load" + +[node name="VBoxContainer" type="VBoxContainer" parent="GUI/LoadVehicle"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 40.0 +margin_top = 40.0 +margin_right = -15.0 +margin_bottom = -15.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Name" type="Label" parent="GUI/LoadVehicle/VBoxContainer"] +margin_right = 265.0 +margin_bottom = 20.0 + +[node name="PanelContainer" type="PanelContainer" parent="GUI/LoadVehicle/VBoxContainer"] +margin_top = 24.0 +margin_right = 265.0 +margin_bottom = 280.0 +size_flags_vertical = 3 + +[node name="ScrollContainer" type="ScrollContainer" parent="GUI/LoadVehicle/VBoxContainer/PanelContainer"] +margin_left = 16.0 +margin_top = 11.0 +margin_right = 249.0 +margin_bottom = 245.0 +scroll_horizontal_enabled = false + +[node name="Files" type="VBoxContainer" parent="GUI/LoadVehicle/VBoxContainer/PanelContainer/ScrollContainer"] +margin_right = 233.0 +margin_bottom = 41.0 +size_flags_horizontal = 3 + +[node name="Template" type="Button" parent="GUI/LoadVehicle/VBoxContainer/PanelContainer/ScrollContainer/Files"] +margin_right = 233.0 +margin_bottom = 41.6293 +size_flags_horizontal = 3 +text = "Vehicle name" +align = 0 + +[node name="HBoxContainer" type="HBoxContainer" parent="GUI/LoadVehicle/VBoxContainer"] +margin_top = 284.0 +margin_right = 265.0 +margin_bottom = 325.0 +size_flags_horizontal = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Cancel" type="Button" parent="GUI/LoadVehicle/VBoxContainer/HBoxContainer"] +margin_right = 130.0 +margin_bottom = 41.6293 +size_flags_horizontal = 3 +shortcut = SubResource( 15 ) +text = "Cancel" + +[node name="Load" type="Button" parent="GUI/LoadVehicle/VBoxContainer/HBoxContainer"] +margin_left = 134.0 +margin_right = 265.0 +margin_bottom = 41.6293 +size_flags_horizontal = 3 +shortcut = SubResource( 17 ) +text = "Load" +[connection signal="pressed" from="GUI/Menu/VBoxContainer/Continue" to="." method="set_enabled" binds= [ true ]] +[connection signal="pressed" from="GUI/Menu/VBoxContainer/Test" to="." method="_on_Test_pressed"] +[connection signal="pressed" from="GUI/Menu/VBoxContainer/Save" to="GUI/Menu" method="set_visible" binds= [ false ]] +[connection signal="pressed" from="GUI/Menu/VBoxContainer/Save" to="GUI/SaveVehicle" method="set_visible" binds= [ true ]] +[connection signal="pressed" from="GUI/Menu/VBoxContainer/Load" to="GUI/LoadVehicle" method="set_visible" binds= [ true ]] +[connection signal="pressed" from="GUI/Menu/VBoxContainer/Load" to="GUI/Menu" method="set_visible" binds= [ false ]] +[connection signal="pressed" from="GUI/Menu/VBoxContainer/Exit" to="." method="_on_Exit_pressed"] +[connection signal="hide" from="GUI/Inventory" to="." method="set_enabled" binds= [ true ]] +[connection signal="pressed" from="GUI/SaveVehicle/VBoxContainer/HBoxContainer/Cancel" to="." method="set_enabled" binds= [ true ]] +[connection signal="pressed" from="GUI/SaveVehicle/VBoxContainer/HBoxContainer/Save" to="." method="set_enabled" binds= [ true ]] +[connection signal="load_vehicle" from="GUI/LoadVehicle" to="." method="load_vehicle"] +[connection signal="load_vehicle" from="GUI/LoadVehicle" to="GUI/SaveVehicle" method="set_full_path"] +[connection signal="pressed" from="GUI/LoadVehicle/VBoxContainer/HBoxContainer/Cancel" to="." method="set_enabled" binds= [ true ]] +[connection signal="pressed" from="GUI/LoadVehicle/VBoxContainer/HBoxContainer/Load" to="." method="set_enabled" binds= [ true ]] +[connection signal="pressed" from="GUI/LoadVehicle/VBoxContainer/HBoxContainer/Load" to="GUI/LoadVehicle" method="_on_Load_pressed"] diff --git a/designer/inventory.gd b/designer/inventory.gd index c241d26..9a9d817 100644 --- a/designer/inventory.gd +++ b/designer/inventory.gd @@ -13,6 +13,7 @@ var _block_button_template: Button var _block_container: Node var _preview_mesh: MeshInstance var _designer: Node +var _escape_pressed := false func _ready(): @@ -22,6 +23,17 @@ func _ready(): for c in categories: show_category(c) break + + +func _unhandled_input(event): + if not $"..".visible: + return + if event.is_action("ui_cancel") or event.is_action("designer_open_inventory"): + if event.pressed: + _escape_pressed = true + elif _escape_pressed: + $"..".visible = false + _escape_pressed = false func show_category(var category): diff --git a/designer/vehicle_selector.gd b/designer/vehicle_selector.gd index 7efee5b..0b951fd 100644 --- a/designer/vehicle_selector.gd +++ b/designer/vehicle_selector.gd @@ -1,4 +1,4 @@ -extends Control +extends "res://menu/dialog/independent_panel.gd" const VEHICLE_DIRECTORY = "vehicles" diff --git a/menu/dialog/independent_panel.gd b/menu/dialog/independent_panel.gd new file mode 100644 index 0000000..87afa2e --- /dev/null +++ b/menu/dialog/independent_panel.gd @@ -0,0 +1,10 @@ +tool +extends Control + + +export var title := "Title" setget set_title + + +func set_title(p_title): + title = p_title + $Title.text = title diff --git a/menu/load_vehicle.tscn b/menu/load_vehicle.tscn index abeba83..38504cc 100644 --- a/menu/load_vehicle.tscn +++ b/menu/load_vehicle.tscn @@ -2,8 +2,6 @@ [ext_resource path="res://designer/load_vehicle.gd" type="Script" id=1] - - [sub_resource type="InputEventAction" id=1] action = "ui_cancel" diff --git a/menu/panel/subpanel.png b/menu/panel/subpanel.png new file mode 100644 index 0000000..48ce01a Binary files /dev/null and b/menu/panel/subpanel.png differ diff --git a/menu/panel/subpanel.png.import b/menu/panel/subpanel.png.import new file mode 100644 index 0000000..5f628bd --- /dev/null +++ b/menu/panel/subpanel.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/subpanel.png-870b4ad0bb5e861553f8369b2aa25097.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://menu/panel/subpanel.png" +dest_files=[ "res://.import/subpanel.png-870b4ad0bb5e861553f8369b2aa25097.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=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/menu/panel/subpanel.tres b/menu/panel/subpanel.tres new file mode 100644 index 0000000..c0725da --- /dev/null +++ b/menu/panel/subpanel.tres @@ -0,0 +1,11 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=2] + +[ext_resource path="res://menu/panel/subpanel.png" type="Texture" id=1] + +[resource] +texture = ExtResource( 1 ) +region_rect = Rect2( 0, 0, 200, 60 ) +margin_left = 16.0 +margin_right = 16.0 +margin_top = 11.0 +margin_bottom = 11.0 diff --git a/menu/theme/theme.tres b/menu/theme/theme.tres index 3fc1a26..968e8ce 100644 --- a/menu/theme/theme.tres +++ b/menu/theme/theme.tres @@ -1,10 +1,11 @@ -[gd_resource type="Theme" load_steps=8 format=2] +[gd_resource type="Theme" load_steps=9 format=2] [ext_resource path="res://menu/good_times_rg.ttf" type="DynamicFontData" id=1] [ext_resource path="res://menu/dialog/dialog.tres" type="StyleBox" id=2] [ext_resource path="res://menu/button/button.tres" type="StyleBox" id=3] [ext_resource path="res://menu/button/button_hover.tres" type="StyleBox" id=4] [ext_resource path="res://menu/button/button_pressed.tres" type="StyleBox" id=5] +[ext_resource path="res://menu/panel/subpanel.tres" type="StyleBox" id=6] [sub_resource type="StyleBoxFlat" id=1] bg_color = Color( 0.207843, 0.2, 0.239216, 1 ) @@ -193,7 +194,7 @@ LineEdit/constants/minimum_spaces = 12 LineEdit/fonts/font = null LineEdit/icons/clear = null LineEdit/styles/focus = null -LineEdit/styles/normal = null +LineEdit/styles/normal = ExtResource( 6 ) LineEdit/styles/read_only = null LinkButton/colors/font_color = Color( 0, 0, 0, 1 ) LinkButton/colors/font_color_hover = Color( 0, 0, 0, 1 ) @@ -230,7 +231,7 @@ OptionButton/styles/hover = null OptionButton/styles/normal = null OptionButton/styles/pressed = null Panel/styles/panel = ExtResource( 2 ) -PanelContainer/styles/panel = ExtResource( 2 ) +PanelContainer/styles/panel = ExtResource( 6 ) PopupDialog/styles/panel = null PopupMenu/colors/font_color = Color( 0, 0, 0, 1 ) PopupMenu/colors/font_color_accel = Color( 0, 0, 0, 1 )