From e8cddd9bb6ee2f35b2fe104d5a03a6f64a335a82 Mon Sep 17 00:00:00 2001 From: yannk Date: Mon, 18 Apr 2022 11:46:28 +0200 Subject: [PATCH] Adding display of celestial objects parameters in dev panel --- locales/en.po | 18 ++++ locales/fr.po | 18 ++++ locales/messages.mo | Bin 5640 -> 5824 bytes locales/messages.pot | 17 +++ maps/basic_setup.gd | 6 +- maps/basic_setup.tscn | 4 +- scenes/developper/developper.gd | 1 + scenes/developper/developper.tscn | 172 +++++++++++++++++++++++++++--- scenes/developper/sky_panel.gd | 17 +++ 9 files changed, 234 insertions(+), 19 deletions(-) create mode 100644 scenes/developper/sky_panel.gd diff --git a/locales/en.po b/locales/en.po index 8b6b17d..cf726d8 100644 --- a/locales/en.po +++ b/locales/en.po @@ -307,3 +307,21 @@ msgstr "Nothing" msgid "win_developper" msgstr "Developper" + +msgid "stigi_name" +msgstr "stigi" + +msgid "samayun_name" +msgstr "samayun" + +msgid "zabr_name" +msgstr "zabr" + +msgid "lab_sky_panel" +msgstr "Sky parameters" + +msgid "lab_position" +msgstr "Position" + +msgid "lab_size" +msgstr "Size" diff --git a/locales/fr.po b/locales/fr.po index 462a0dc..0de8ac5 100644 --- a/locales/fr.po +++ b/locales/fr.po @@ -307,3 +307,21 @@ msgstr "Rien n'est sélectionné" msgid "win_developper" msgstr "Développeur" + +msgid "stigi_name" +msgstr "stigi" + +msgid "samayun_name" +msgstr "samayun" + +msgid "zabr_name" +msgstr "zabr" + +msgid "lab_sky_panel" +msgstr "Paramètres célestes" + +msgid "lab_position" +msgstr "Position" + +msgid "lab_size" +msgstr "Taille" diff --git a/locales/messages.mo b/locales/messages.mo index 6862cf4abad5ab06f2a7124bb7fcf096863c4256..73b2808b67c191a1d695779329c50f799644f2a6 100644 GIT binary patch delta 2400 zcmY+_eP~s69LMpmHg~mb&YP_^TT^q+xoO+9hgr^?n{(#lR-3xz^=_Wr*zRrI*~2Du zr2fbdM)*WUASj~rK!u?~L{UhYRQ@vvlq?F_AN#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XL zTg$B0fvvP1UC?}@Qjg}4zXVGkDJcASbkaWZ}!_J>E}`kC+?PUpUV za2igVkWxuXnN&e#CMRle1~%iBxB;)g*Q31~FQ?rf{(w&SEIQYmi78d$M4XS+=mgvF zI^2Yg(~At8_F)m@r*EmyM>>xA_!Bb8G=#2rIIjO4=f{x_s;LlNQ7K-Fl~|4q=)fD% z0k_~3+!g2dg$J>O@zcq;;Vins^XSSak!Le87ftcfun}E(8(JAoaX(2vjo`Y{iWg{RO7p22ZAjCTA7&c*^RW?uoi;s!J`8_>+W z8ty`$`wGqQ$;sqDyAn<~ff3}F#*+rJmP(ODrR&j6wh$RJEyn!IQd*9@t+bjK?tSaf z=hmZppqqpJZACM*GyDMg(9$QFsCZ4LGVJDi27sDQO zg0DsU&1k=k_VXT^;XPp=7BPMrpyJ9;gr~znG?hc)Z)gX9qM5lE=J2gLkqKxfrlQYH z$1_3{-rO|dGmTQPd zvo$_rbT7<{_D#P38)@7}+(E1$<`8a>#|b|bO9SC|zr+T`ER_>=HYhAOTl`zLJTXdI zhwlE{qHWqORYWE62;*NW?bPlj)(}q-^9jo>gzs}Uv5>H|5bo|)!qh)Z_($_J@g(uz zayyM`;!fg0VmaY!ol9hzIW!Tq#QnrtVi_@3{JXUHzRQT!#45t~ek_1%aeSYyv>z{9ZrlYi;+IyUV;J*6+Nu>Mjz{R_Q9 Busi?& diff --git a/locales/messages.pot b/locales/messages.pot index 103d3b2..cfc4346 100644 --- a/locales/messages.pot +++ b/locales/messages.pot @@ -299,3 +299,20 @@ msgstr "" msgid "win_developper" msgstr "" +msgid "stigi_name" +msgstr "" + +msgid "samayun_name" +msgstr "" + +msgid "zabr_name" +msgstr "" + +msgid "lab_sky_panel" +msgstr "" + +msgid "lab_position" +msgstr "" + +msgid "lab_size" +msgstr "" diff --git a/maps/basic_setup.gd b/maps/basic_setup.gd index 8d099f7..002d99b 100644 --- a/maps/basic_setup.gd +++ b/maps/basic_setup.gd @@ -1,15 +1,15 @@ extends Node3D + # Called when the node enters the scene tree for the first time. func _ready(): - var celestial_positions = get_celestial_position() - print(celestial_positions) + pass # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): pass -func get_celestial_position(): +func get_celestial_coordinates(): var stigi_pos = get_node("WorldEnvironment").environment.sky.sky_material.get_shader_param("stigi_position") var stigi_arc = get_node("WorldEnvironment").environment.sky.sky_material.get_shader_param("stigi_arc") diff --git a/maps/basic_setup.tscn b/maps/basic_setup.tscn index 24d5bb3..9358e56 100644 --- a/maps/basic_setup.tscn +++ b/maps/basic_setup.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=24 format=3 uid="uid://b8p2h0rmwy7qn"] +[gd_scene load_steps=25 format=3 uid="uid://b8p2h0rmwy7qn"] [ext_resource type="Material" uid="uid://dpegsmygxcfmv" path="res://maps/materials/basic_ground.material" id="1_lodye"] [ext_resource type="Shader" path="res://maps/shaders/khanat_sky.gdshader" id="1_mheqi"] +[ext_resource type="Script" path="res://maps/basic_setup.gd" id="1_narkk"] [ext_resource type="Texture2D" uid="uid://b5jer2nm17ld" path="res://maps/textures/samayun_tex_001.png" id="1_thm7k"] [ext_resource type="PackedScene" uid="uid://cveshwnu272vf" path="res://maps/objects/ramp-complex.tscn" id="2_4eueh"] [ext_resource type="Texture2D" uid="uid://y0ka7tysfp6b" path="res://maps/textures/zabr_tex_001.png" id="3_bgghj"] @@ -59,6 +60,7 @@ material = ExtResource( "1_lodye" ) data = PackedVector3Array(-0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, 0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, -0.5) [node name="basic_setup" type="Node3D"] +script = ExtResource( "1_narkk" ) [node name="sunlight" type="DirectionalLight3D" parent="."] transform = Transform3D(1, 0, 0, 0, 0.278991, 0.960294, 0, -0.960294, 0.278991, -1.75049, 15.9707, 4.39927) diff --git a/scenes/developper/developper.gd b/scenes/developper/developper.gd index ed6211c..aab1323 100644 --- a/scenes/developper/developper.gd +++ b/scenes/developper/developper.gd @@ -2,6 +2,7 @@ extends Control + # Called when the node enters the scene tree for the first time. func _ready(): pass diff --git a/scenes/developper/developper.tscn b/scenes/developper/developper.tscn index 88b5e80..11e2a8b 100644 --- a/scenes/developper/developper.tscn +++ b/scenes/developper/developper.tscn @@ -1,11 +1,12 @@ -[gd_scene load_steps=4 format=3 uid="uid://cua4782cbjhla"] +[gd_scene load_steps=5 format=3 uid="uid://cua4782cbjhla"] [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/zbasu/zbasu.theme" id="3_ols6l"] +[ext_resource type="Script" path="res://scenes/developper/sky_panel.gd" id="4_b4n1m"] [node name="developper_panel" type="Control"] -minimum_size = Vector2(350, 250) +minimum_size = Vector2(350, 400) anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 @@ -26,7 +27,7 @@ grow_horizontal = 2 grow_vertical = 2 texture = ExtResource( "2_fmcto" ) patch_margin_left = 50 -patch_margin_top = 10 +patch_margin_top = 25 patch_margin_right = 25 patch_margin_bottom = 25 axis_stretch_horizontal = 2 @@ -63,25 +64,166 @@ size_flags_vertical = 3 metadata/_edit_use_custom_anchors = false metadata/_edit_layout_mode = 1 -[node name="VBoxContainer2" type="VBoxContainer" parent="main"] +[node name="sky_panel" type="VBoxContainer" parent="main"] offset_right = 328.0 -offset_bottom = 27.0 +offset_bottom = 296.0 size_flags_vertical = 0 +script = ExtResource( "4_b4n1m" ) -[node name="TabBar" type="TabBar" parent="main/VBoxContainer2"] +[node name="sky_panel" type="Label" parent="main/sky_panel"] offset_right = 328.0 -offset_bottom = 27.0 -theme = ExtResource( "3_ols6l" ) -tab_count = 2 -tab_0/title = "tab_sky" -tab_1/title = "tab_weather" +offset_bottom = 26.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +text = "lab_sky_panel" + +[node name="stigi_panel" type="VBoxContainer" parent="main/sky_panel"] +offset_top = 30.0 +offset_right = 328.0 +offset_bottom = 116.0 + +[node name="stigi_name" type="Label" parent="main/sky_panel/stigi_panel"] +offset_right = 328.0 +offset_bottom = 26.0 +text = "stigi_name" + +[node name="position_panel" type="HBoxContainer" parent="main/sky_panel/stigi_panel"] +offset_top = 30.0 +offset_right = 328.0 +offset_bottom = 56.0 + +[node name="lab_position" type="Label" parent="main/sky_panel/stigi_panel/position_panel"] +offset_right = 94.0 +offset_bottom = 26.0 +size_flags_horizontal = 0 +text = "lab_position" + +[node name="stigi_pos" type="Label" parent="main/sky_panel/stigi_panel/position_panel"] +offset_left = 98.0 +offset_top = 1.0 +offset_right = 328.0 +offset_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="size_panel" type="HBoxContainer" parent="main/sky_panel/stigi_panel"] +offset_top = 60.0 +offset_right = 328.0 +offset_bottom = 86.0 + +[node name="lab_size" type="Label" parent="main/sky_panel/stigi_panel/size_panel"] +offset_right = 60.0 +offset_bottom = 26.0 +size_flags_horizontal = 0 +text = "lab_size" + +[node name="stigi_arc" type="Label" parent="main/sky_panel/stigi_panel/size_panel"] +offset_left = 64.0 +offset_top = 1.0 +offset_right = 328.0 +offset_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="samayun_panel" type="VBoxContainer" parent="main/sky_panel"] +offset_top = 120.0 +offset_right = 328.0 +offset_bottom = 206.0 + +[node name="samayun_name" type="Label" parent="main/sky_panel/samayun_panel"] +offset_right = 328.0 +offset_bottom = 26.0 +text = "samayun_name" + +[node name="position_panel" type="HBoxContainer" parent="main/sky_panel/samayun_panel"] +offset_top = 30.0 +offset_right = 328.0 +offset_bottom = 56.0 + +[node name="lab_position" type="Label" parent="main/sky_panel/samayun_panel/position_panel"] +offset_right = 94.0 +offset_bottom = 26.0 +size_flags_horizontal = 0 +text = "lab_position" + +[node name="samayun_pos" type="Label" parent="main/sky_panel/samayun_panel/position_panel"] +offset_left = 98.0 +offset_top = 1.0 +offset_right = 328.0 +offset_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="size_panel" type="HBoxContainer" parent="main/sky_panel/samayun_panel"] +offset_top = 60.0 +offset_right = 328.0 +offset_bottom = 86.0 + +[node name="lab_size" type="Label" parent="main/sky_panel/samayun_panel/size_panel"] +offset_right = 60.0 +offset_bottom = 26.0 +size_flags_horizontal = 0 +text = "lab_size" + +[node name="samayun_arc" type="Label" parent="main/sky_panel/samayun_panel/size_panel"] +offset_left = 64.0 +offset_top = 1.0 +offset_right = 328.0 +offset_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="zabr_panel" type="VBoxContainer" parent="main/sky_panel"] +offset_top = 210.0 +offset_right = 328.0 +offset_bottom = 296.0 + +[node name="zabr_name" type="Label" parent="main/sky_panel/zabr_panel"] +offset_right = 328.0 +offset_bottom = 26.0 +text = "zabr_name" + +[node name="position_panel" type="HBoxContainer" parent="main/sky_panel/zabr_panel"] +offset_top = 30.0 +offset_right = 328.0 +offset_bottom = 56.0 + +[node name="lab_position" type="Label" parent="main/sky_panel/zabr_panel/position_panel"] +offset_right = 94.0 +offset_bottom = 26.0 +size_flags_horizontal = 0 +text = "lab_position" + +[node name="zabr_pos" type="Label" parent="main/sky_panel/zabr_panel/position_panel"] +offset_left = 98.0 +offset_top = 1.0 +offset_right = 328.0 +offset_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="size_panel" type="HBoxContainer" parent="main/sky_panel/zabr_panel"] +offset_top = 60.0 +offset_right = 328.0 +offset_bottom = 86.0 + +[node name="lab_size" type="Label" parent="main/sky_panel/zabr_panel/size_panel"] +offset_right = 60.0 +offset_bottom = 26.0 +size_flags_horizontal = 0 +text = "lab_size" + +[node name="zabr_arc" type="Label" parent="main/sky_panel/zabr_panel/size_panel"] +offset_left = 64.0 +offset_top = 1.0 +offset_right = 328.0 +offset_bottom = 24.0 +size_flags_horizontal = 3 [node name="footer" type="VBoxContainer" parent="."] minimum_size = Vector2(0, 30) -offset_left = 3.0 -offset_top = 213.0 -offset_right = 347.0 -offset_bottom = 247.0 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -172.0 +offset_top = -34.0 +offset_right = 172.0 size_flags_vertical = 10 metadata/_edit_layout_mode = 0 metadata/_edit_use_custom_anchors = false diff --git a/scenes/developper/sky_panel.gd b/scenes/developper/sky_panel.gd new file mode 100644 index 0000000..1f675e2 --- /dev/null +++ b/scenes/developper/sky_panel.gd @@ -0,0 +1,17 @@ +extends VBoxContainer + + +# Called when the node enters the scene tree for the first time. +func _ready(): + var positions = get_parent().get_parent().get_parent().get_parent().get_node("terrain_basic_setup").get_celestial_coordinates() + get_node("stigi_panel/position_panel/stigi_pos").text = str(positions["stigi_pos"]) + get_node("samayun_panel/position_panel/samayun_pos").text = str(positions["samayun_pos"]) + get_node("zabr_panel/position_panel/zabr_pos").text = str(positions["zabr_pos"]) + get_node("stigi_panel/size_panel/stigi_arc").text = str(positions["stigi_arc"]) + get_node("samayun_panel/size_panel/samayun_arc").text = str(positions["samayun_arc"]) + get_node("zabr_panel/size_panel/zabr_arc").text = str(positions["zabr_arc"]) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass