Adding a proper UI panel for dev panel, with original background

This commit is contained in:
yannk 2022-04-16 19:03:44 +02:00
parent e019d8bb3e
commit 8ca53f8687
6 changed files with 118 additions and 30 deletions

View file

@ -11,4 +11,4 @@ func _process(delta):
pass pass
func _on_quit_pressed(): func _on_quit_pressed():
$Window.visible = false get_node("../developper_panel").visible = false

View file

@ -1,43 +1,101 @@
[gd_scene load_steps=2 format=3 uid="uid://cua4782cbjhla"] [gd_scene load_steps=4 format=3 uid="uid://cua4782cbjhla"]
[ext_resource type="Script" path="res://scenes/developper/developper.gd" id="1_qf0rd"] [ext_resource type="Script" path="res://scenes/developper/developper.gd" id="1_qf0rd"]
[ext_resource type="Texture2D" uid="uid://se0t5xwdxyq7" path="res://scenes/themes/textures/base_panel.png" id="2_fmcto"]
[ext_resource type="Theme" uid="uid://bi1js53ni6ehd" path="res://UI/themes/khanat/khanat.theme" id="3_ols6l"]
[node name="Control" type="Control"] [node name="developper_panel" type="Control"]
script = ExtResource( "1_qf0rd" )
[node name="Window" type="Window" parent="."]
title = "win_developper"
visible = false visible = false
minimum_size = Vector2(350, 250)
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -175.0
offset_top = -125.0
offset_right = 175.0
offset_bottom = 125.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource( "1_qf0rd" )
metadata/_edit_use_custom_anchors = false
[node name="VBoxContainer" type="VBoxContainer" parent="Window"] [node name="NinePatchRect" type="NinePatchRect" parent="."]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
texture = ExtResource( "2_fmcto" )
patch_margin_left = 50
patch_margin_top = 10
patch_margin_right = 25
patch_margin_bottom = 25
axis_stretch_horizontal = 2
axis_stretch_vertical = 2
metadata/_edit_layout_mode = 1
metadata/_edit_use_custom_anchors = false
[node name="header" type="VBoxContainer" parent="."]
offset_left = 50.0
offset_top = 4.0
offset_right = 347.0
offset_bottom = 31.0
metadata/_edit_layout_mode = 0
metadata/_edit_use_custom_anchors = false
[node name="Label" type="Label" parent="header"]
offset_top = -1.0
offset_right = 297.0
offset_bottom = 26.4
theme = ExtResource( "3_ols6l" )
text = "win_developper"
[node name="main" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 5.0
offset_top = 33.0
offset_right = -17.0
offset_bottom = -11.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
metadata/_edit_use_custom_anchors = false metadata/_edit_use_custom_anchors = false
metadata/_edit_layout_mode = 1
[node name="VBoxContainer2" type="VBoxContainer" parent="Window/VBoxContainer"] [node name="VBoxContainer2" type="VBoxContainer" parent="main"]
offset_right = 40.0 offset_right = 328.0
offset_bottom = 40.0 offset_bottom = 27.0
size_flags_vertical = 0
[node name="TabBar" type="TabBar" parent="Window/VBoxContainer/VBoxContainer2"] [node name="TabBar" type="TabBar" parent="main/VBoxContainer2"]
anchor_right = 1.0 offset_right = 328.0
anchor_bottom = 1.0 offset_bottom = 27.0
offset_top = 31.0 theme = ExtResource( "3_ols6l" )
offset_bottom = 22.0
tab_count = 2 tab_count = 2
tab_0/title = "tab_sky" tab_0/title = "tab_sky"
tab_1/title = "tab_weather" tab_1/title = "tab_weather"
[node name="Quit" type="Button" parent="Window/VBoxContainer"] [node name="footer" type="VBoxContainer" parent="."]
offset_top = 35.0 minimum_size = Vector2(0, 30)
offset_right = 43.0 offset_left = 3.0
offset_bottom = 66.0 offset_top = 213.0
offset_right = 347.0
offset_bottom = 247.0
size_flags_vertical = 10
metadata/_edit_layout_mode = 0
metadata/_edit_use_custom_anchors = false
[node name="Quit" type="Button" parent="footer"]
minimum_size = Vector2(75, 0)
offset_left = 134.0
offset_top = 7.0
offset_right = 209.0
offset_bottom = 26.0
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 8 size_flags_vertical = 6
theme = ExtResource( "3_ols6l" )
text = "Quit" text = "Quit"
[connection signal="close_requested" from="Window" to="." method="_on_quit_pressed"] [connection signal="pressed" from="footer/Quit" to="." method="_on_quit_pressed"]
[connection signal="pressed" from="Window/VBoxContainer/Quit" to="." method="_on_quit_pressed"]

View file

@ -67,8 +67,7 @@ func _on_themes_pressed():
$MenuTheme/Window.visible = true $MenuTheme/Window.visible = true
func _on_dev_pressed(): func _on_dev_pressed():
$MenuDev/Window.popup_centered() $developper_panel.visible = true
$MenuDev/Window.visible = true
func _on_about_pressed(): func _on_about_pressed():
var aboutmessage:String var aboutmessage:String

View file

@ -15,6 +15,7 @@ theme = ExtResource( "1_iq3fo" )
script = ExtResource( "1_s6f6d" ) script = ExtResource( "1_s6f6d" )
[node name="Message" type="HBoxContainer" parent="."] [node name="Message" type="HBoxContainer" parent="."]
visible = false
anchor_right = 1.0 anchor_right = 1.0
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
@ -28,6 +29,7 @@ size_flags_vertical = 1
text = "Echap = Menu" text = "Echap = Menu"
[node name="Menu" type="HBoxContainer" parent="."] [node name="Menu" type="HBoxContainer" parent="."]
visible = false
anchor_right = 1.0 anchor_right = 1.0
offset_right = 40.0 offset_right = 40.0
offset_bottom = 40.0 offset_bottom = 40.0
@ -98,11 +100,7 @@ visible = false
[node name="MusicManager" parent="." instance=ExtResource( "6_0ivsi" )] [node name="MusicManager" parent="." instance=ExtResource( "6_0ivsi" )]
visible = false visible = false
[node name="MenuDev" parent="." instance=ExtResource( "7_45giw" )] [node name="developper_panel" parent="." instance=ExtResource( "7_45giw" )]
offset_left = 174.0
offset_top = 4.0
offset_right = 174.0
offset_bottom = 4.0
[connection signal="pressed" from="Menu/Keys" to="." method="_on_keys_pressed"] [connection signal="pressed" from="Menu/Keys" to="." method="_on_keys_pressed"]
[connection signal="pressed" from="Menu/Themes" to="." method="_on_themes_pressed"] [connection signal="pressed" from="Menu/Themes" to="." method="_on_themes_pressed"]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,33 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://se0t5xwdxyq7"
path="res://.godot/imported/base_panel.png-2a8a839c6032022981731374105e51fc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://scenes/themes/textures/base_panel.png"
dest_files=["res://.godot/imported/base_panel.png-2a8a839c6032022981731374105e51fc.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/size_limit=0
detect_3d/compress_to=1