From 7cfc81b16c4d56d823bba336a91b98ff75c1087e Mon Sep 17 00:00:00 2001 From: zcembbi Date: Sat, 14 Sep 2024 04:16:14 +0300 Subject: [PATCH] Changed UI layout --- ui/UI.tscn | 174 +++++++++++------- ui/buildingmeny.png | Bin 0 -> 469 bytes ui/buildingmeny.png.import | 34 ++++ ui/counters.gd | 42 +++++ ui/essence_icon.png | Bin 0 -> 557 bytes ui/essence_icon.png.import | 34 ++++ ui/number.gd | 13 -- ui/stone_icon.png | Bin 0 -> 316 bytes ...ments.png.import => stone_icon.png.import} | 8 +- ui/ui-elements.png | Bin 4459 -> 0 bytes ui/wood_icon.png | Bin 0 -> 405 bytes ui/wood_icon.png.import | 34 ++++ 12 files changed, 255 insertions(+), 84 deletions(-) create mode 100644 ui/buildingmeny.png create mode 100644 ui/buildingmeny.png.import create mode 100644 ui/counters.gd create mode 100644 ui/essence_icon.png create mode 100644 ui/essence_icon.png.import delete mode 100644 ui/number.gd create mode 100644 ui/stone_icon.png rename ui/{ui-elements.png.import => stone_icon.png.import} (68%) delete mode 100644 ui/ui-elements.png create mode 100644 ui/wood_icon.png create mode 100644 ui/wood_icon.png.import diff --git a/ui/UI.tscn b/ui/UI.tscn index e0ee260..ed9964c 100644 --- a/ui/UI.tscn +++ b/ui/UI.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=3 format=3 uid="uid://bxctpr0tfqidf"] +[gd_scene load_steps=6 format=3 uid="uid://bxctpr0tfqidf"] -[ext_resource type="Texture2D" uid="uid://dsy18stvo2pu5" path="res://ui/ui-elements.png" id="1_cx752"] -[ext_resource type="Script" path="res://ui/number.gd" id="2_ei01o"] +[ext_resource type="Texture2D" uid="uid://da07wjahj050a" path="res://ui/buildingmeny.png" id="1_xpu1e"] +[ext_resource type="Script" path="res://ui/counters.gd" id="2_ei01o"] +[ext_resource type="Texture2D" uid="uid://cnylchr2m3lx1" path="res://ui/stone_icon.png" id="2_vo570"] +[ext_resource type="Texture2D" uid="uid://baqdyxvrx4655" path="res://ui/wood_icon.png" id="3_ohuq3"] +[ext_resource type="Texture2D" uid="uid://54f6pl5653xw" path="res://ui/essence_icon.png" id="4_7fjj4"] [node name="UI" type="MarginContainer"] +custom_minimum_size = Vector2(640, 360) anchors_preset = 10 anchor_right = 1.0 offset_bottom = 44.0 @@ -16,90 +20,126 @@ layout_mode = 2 layout_mode = 2 size_flags_horizontal = 3 -[node name="FloodLevel" type="MarginContainer" parent="HBoxContainer/LeftCounters"] +[node name="Resources" type="MarginContainer" parent="HBoxContainer/LeftCounters"] layout_mode = 2 -[node name="Background" type="NinePatchRect" parent="HBoxContainer/LeftCounters/FloodLevel"] -custom_minimum_size = Vector2(160, 40) +[node name="Background" type="NinePatchRect" parent="HBoxContainer/LeftCounters/Resources"] +custom_minimum_size = Vector2(168, 24) layout_mode = 2 -texture = ExtResource("1_cx752") -region_rect = Rect2(779.878, 10.1175, 231.253, 25.8529) +size_flags_vertical = 0 +texture = ExtResource("1_xpu1e") +region_rect = Rect2(-0.458088, -0.349636, 186.046, 47.2991) -[node name="Title" type="Label" parent="HBoxContainer/LeftCounters/FloodLevel/Background"] -layout_mode = 2 -offset_top = 9.0 -offset_right = 112.0 -offset_bottom = 32.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -text = "Flood Level:" -horizontal_alignment = 1 +[node name="StoneIcon" type="TextureRect" parent="HBoxContainer/LeftCounters/Resources/Background"] +layout_mode = 0 +offset_left = 10.0 +offset_right = 34.0 +offset_bottom = 24.0 +texture = ExtResource("2_vo570") +expand_mode = 2 -[node name="Number" type="Label" parent="HBoxContainer/LeftCounters/FloodLevel/Background"] +[node name="WoodIcon" type="TextureRect" parent="HBoxContainer/LeftCounters/Resources/Background"] +layout_mode = 0 +offset_left = 65.0 +offset_right = 89.0 +offset_bottom = 24.0 +texture = ExtResource("3_ohuq3") +expand_mode = 2 + +[node name="EssenceIcon" type="TextureRect" parent="HBoxContainer/LeftCounters/Resources/Background"] +layout_mode = 0 +offset_left = 120.0 +offset_right = 144.0 +offset_bottom = 24.0 +texture = ExtResource("4_7fjj4") +expand_mode = 2 + +[node name="StoneCountLabel" type="Label" parent="HBoxContainer/LeftCounters/Resources/Background"] +unique_name_in_owner = true layout_mode = 2 -offset_left = 112.0 -offset_top = 9.0 -offset_right = 148.0 -offset_bottom = 32.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) +offset_right = 55.0 +offset_bottom = 24.0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 12 +text = "000" horizontal_alignment = 2 +vertical_alignment = 1 +script = ExtResource("2_ei01o") + +[node name="WoodCountLabel" type="Label" parent="HBoxContainer/LeftCounters/Resources/Background"] +unique_name_in_owner = true +layout_mode = 2 +offset_left = 55.0 +offset_right = 110.0 +offset_bottom = 24.0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 12 +text = "000" +horizontal_alignment = 2 +vertical_alignment = 1 +script = ExtResource("2_ei01o") + +[node name="EssenceCountLabel" type="Label" parent="HBoxContainer/LeftCounters/Resources/Background"] +unique_name_in_owner = true +layout_mode = 2 +offset_left = 110.0 +offset_right = 165.0 +offset_bottom = 24.0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 12 +text = "000" +horizontal_alignment = 2 +vertical_alignment = 1 script = ExtResource("2_ei01o") [node name="RightCounters" type="VBoxContainer" parent="HBoxContainer"] layout_direction = 2 layout_mode = 2 -[node name="Population" type="MarginContainer" parent="HBoxContainer/RightCounters"] +[node name="RightCounters" type="MarginContainer" parent="HBoxContainer/RightCounters"] layout_mode = 2 -[node name="Background" type="NinePatchRect" parent="HBoxContainer/RightCounters/Population"] -custom_minimum_size = Vector2(160, 20) +[node name="Background" type="NinePatchRect" parent="HBoxContainer/RightCounters/RightCounters"] +custom_minimum_size = Vector2(113, 24) layout_mode = 2 -texture = ExtResource("1_cx752") -region_rect = Rect2(779.878, 10.1175, 231.253, 25.8529) +texture = ExtResource("1_xpu1e") +region_rect = Rect2(1.19859, 0.999939, 182.287, 45.1203) -[node name="Title" type="Label" parent="HBoxContainer/RightCounters/Population/Background"] -layout_mode = 2 -offset_top = -2.0 -offset_right = 112.0 -offset_bottom = 21.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -text = "Population:" -horizontal_alignment = 1 +[node name="PopulationIcon" type="TextureRect" parent="HBoxContainer/RightCounters/RightCounters/Background"] +layout_mode = 0 +offset_left = 10.0 +offset_right = 34.0 +offset_bottom = 24.0 +expand_mode = 2 -[node name="Number" type="Label" parent="HBoxContainer/RightCounters/Population/Background"] +[node name="FloodLevelIcon" type="TextureRect" parent="HBoxContainer/RightCounters/RightCounters/Background"] +layout_mode = 0 +offset_left = 65.0 +offset_right = 89.0 +offset_bottom = 24.0 +expand_mode = 2 + +[node name="PopulationCountLabel" type="Label" parent="HBoxContainer/RightCounters/RightCounters/Background"] +unique_name_in_owner = true layout_mode = 2 -offset_left = 112.0 -offset_top = -1.0 -offset_right = 148.0 -offset_bottom = 22.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -text = "10" +offset_right = 55.0 +offset_bottom = 24.0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 12 +text = "000" horizontal_alignment = 2 +vertical_alignment = 1 +script = ExtResource("2_ei01o") -[node name="Resources" type="MarginContainer" parent="HBoxContainer/RightCounters"] +[node name="FloodLevelCountLabel" type="Label" parent="HBoxContainer/RightCounters/RightCounters/Background"] +unique_name_in_owner = true layout_mode = 2 - -[node name="Background" type="NinePatchRect" parent="HBoxContainer/RightCounters/Resources"] -custom_minimum_size = Vector2(160, 20) -layout_mode = 2 -texture = ExtResource("1_cx752") -region_rect = Rect2(779.878, 10.1175, 231.253, 25.8529) - -[node name="Title" type="Label" parent="HBoxContainer/RightCounters/Resources/Background"] -layout_mode = 2 -offset_top = -2.0 -offset_right = 112.0 -offset_bottom = 21.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -text = "Resources:" -horizontal_alignment = 1 - -[node name="Number" type="Label" parent="HBoxContainer/RightCounters/Resources/Background"] -layout_mode = 2 -offset_left = 112.0 -offset_top = -1.0 -offset_right = 148.0 -offset_bottom = 22.0 -theme_override_colors/font_color = Color(0, 0, 0, 1) -text = "10" +offset_left = 55.0 +offset_right = 110.0 +offset_bottom = 24.0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 12 +text = "000" horizontal_alignment = 2 +vertical_alignment = 1 +script = ExtResource("2_ei01o") diff --git a/ui/buildingmeny.png b/ui/buildingmeny.png new file mode 100644 index 0000000000000000000000000000000000000000..a67b42ff780e5f21fdffdceed076fc31253259be GIT binary patch literal 469 zcmV;`0V@89P)Px$k4Z#9RCt{2*vodpFbqXencwcX->nXsrg@YEJ1&u~&mORV1UrPgWSQchAMS3G zVs2*N55?xEUVct6x3WJzy*EFfJ~I#d$8lebQ9JKEu5Yekdf|(4Pv>2H_vU$hac+ls z*W=dByBl{kubF#!dc1kw?QeZD?@Pb+lX+`0W@h#<#Ng+rjG>&LQh|U&nqa{DR)AI% z4K9v~TZ3z|kbjVo@3J@hSjvqk>~COKE=5rGSgw3kafucSHLY z5dnuZ0uE^e`~Z85M!Oq#U;9SDAuUP3*}$Pql7Itk2>8H4?=d=E905;{_U#A(hcp5X zX%7$Ghyhm=Dmb(ea7ZKIhxmsgyFLLA+{XvLG`s;79MT9l8s%u;2sotO81PL6pjmFh zZ97HX{2slE!y2sE8I6E$EXayVtsB7O+1f0T*Rw)AB7aO>d3>fee zEEiG;IHVEq0OBkfdhHtlhqTTC*Q)?c;*{j!QNbaNfaBlYxuAUkS9x|iuzw<#00000 LNkvXXu0mjfR`$d* literal 0 HcmV?d00001 diff --git a/ui/buildingmeny.png.import b/ui/buildingmeny.png.import new file mode 100644 index 0000000..a001c43 --- /dev/null +++ b/ui/buildingmeny.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://da07wjahj050a" +path="res://.godot/imported/buildingmeny.png-ec30ba3f3cfa707d601ffd2165a5ab3d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/buildingmeny.png" +dest_files=["res://.godot/imported/buildingmeny.png-ec30ba3f3cfa707d601ffd2165a5ab3d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/ui/counters.gd b/ui/counters.gd new file mode 100644 index 0000000..c1942fa --- /dev/null +++ b/ui/counters.gd @@ -0,0 +1,42 @@ +extends Label + +@onready var stone_count_label: Label = %StoneCountLabel +@onready var wood_count_label: Label = %WoodCountLabel +@onready var essence_count_label: Label = %EssenceCountLabel +@onready var population_count_label: Label = %PopulationCountLabel +@onready var flood_level_count_label: Label = %FloodLevelCountLabel + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + var stone_count = 1 + var wood_count = 2 + var essence_count = 3 + var population_count = 4 + var flood_count = Persister.get_value("flood_level") + + if stone_count: + stone_count_label.set_text(str(stone_count)) + else: + stone_count_label.set_text(str(0)) + + if wood_count: + wood_count_label.set_text(str(wood_count)) + else: + wood_count_label.set_text(str(0)) + + if essence_count: + essence_count_label.set_text(str(essence_count)) + else: + essence_count_label.set_text(str(0)) + + if population_count: + population_count_label.set_text(str(population_count)) + else: + population_count_label.set_text(str(0)) + + if flood_count: + flood_level_count_label.set_text(str(flood_count)) + else: + flood_level_count_label.set_text(str(0)) + diff --git a/ui/essence_icon.png b/ui/essence_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..379c30be48e9531732c46f54fd8afa480e0a123f GIT binary patch literal 557 zcmV+|0@D47P)NklAp^~%|1)+j;5eMnkQ4m_{UvTT-Ul6)EI182vo$FRg5tkxZ=u~V1 zg-#CbcohP1h_9x{-6d_YF8v?`Uhcj3<=uDh9k9U$e+=EQeBH48)M5U9VJF?N{6&+A z;yCO=8f!}yq(9CGgYpFFJO3t794Tp$k(~PD4AN#-NU)M{u$K*Ng}UtnK(#qRDYr9Q z>oHeLn^0C!NFWN8gaZH=b%65Fp8LycvxQR5@=vp8M!Wqm^_Z(IM1W@<4xk&B|8(hK z)S355n_cwB8N9u>X13SP3j?4`4hS?rN$H`)G7(WVXsg0o5C@SAb;I&0i3;VR4FJd( zfiSwPgQ)TYk_s$?O2R=LqOl1q(+3_uivWVZrx;N_!V-m#+Oi0fQEi2^0;?nkfUDga zfIt(fN(ejQs>v6DumaTK{)K?YT&+;I=WKMu)|xt_anA`bRv~<^({{Y3$%7je36Hs&OmuW-NFC*iN&>W)NKi13x!R!DxK$Adub1JY_gsr4 v5EYacVtHssCg!hpO2nCB%if$f*nr13Aq4d@XP_*000000NkvXXu0mjf)Y|x> literal 0 HcmV?d00001 diff --git a/ui/essence_icon.png.import b/ui/essence_icon.png.import new file mode 100644 index 0000000..ae5fdde --- /dev/null +++ b/ui/essence_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://54f6pl5653xw" +path="res://.godot/imported/essence_icon.png-2ff4decd1d74f99d981c04fec76d6306.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/essence_icon.png" +dest_files=["res://.godot/imported/essence_icon.png-2ff4decd1d74f99d981c04fec76d6306.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 diff --git a/ui/number.gd b/ui/number.gd deleted file mode 100644 index c1adeb2..0000000 --- a/ui/number.gd +++ /dev/null @@ -1,13 +0,0 @@ -extends Label - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - pass - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - var floodlevel = Persister.get_value("flood_level") - if floodlevel: - set_text(str(floodlevel)) - else: - set_text(str(0)) diff --git a/ui/stone_icon.png b/ui/stone_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8cc09623da07fb6feda80d5c90f75bad81c74910 GIT binary patch literal 316 zcmV-C0mJ@@P)Px#_DMuRR9J=WmOBoEFbqIL)KehTZnWyq8}txeI3x>);06o`*g%MDq)UyQvEJFRB~Z#P1BP`Q z`uOY&Bent*`wGJZl~uH)GLV3cYC-Rr;;(>bN$EK8{)8J9SHZpfPj#uDD+>3SR~Ol zGzEABe>!Y>*9@$KK3WHF7=s{)vFtph;csh^pz{-#rYIT$fsicPRUPZ_X*38>{~m_H z00YKO-Rmvi<9QDZ!PxxKR!Kk9l%16|fW{7#K~18jxd~e`NS0-8{^kS1B2!ba;p?>B z(0Ul9&B5)43{A7lVKkcaK^fy0;Hj?CjEoQiih(uoT=)?$i)Y)gpz5L9a-`vKa!$Y= zRj&9QxPdt&oTIT}1_9k-0QA-NLP3wY8jYCjX`6FPpNd1gQ)VA z3%xa8R}Uirxr-QIz$(h4a7RU-k&=#abme~#>1)VzrwqZX!INy?uobD*+t{MUk<<$V?jn{NQPsRRoPHn> zJMin9zVHbi7VJ-{&BAE(PtQGh6_G>HuT>5g&@oisasKEWMo|8^t?f+T2rZO&cLTvD zc-SS{UOIWLS{0=wG-o{$b7cI9FH&-d#z=6dHUC=++B!6No8SQ6s*@~PMtg_${mvMt zHT-t#q1**$n zp2>I>yE?l9*iypx90z)o*>1>s$zE?4^F{GKW z<$=ALsKz%J_Wh!8=N$+Zl=BxP9z+Vtv=n>NtzlLpr|2A|o~0D3$}v5{7~9I?!IM@V zi8IL7o;ltL&rB0St1XXuTpitbyoslEAD`}X>OL`**e~w6%mVw^xf>Tlc)0ve{v^7e z4OJb#zSp)g2wW zaLD&(3})Sm?4g;N0y9(4{L%xEF}2`N!6N|@f~dbH42ICZvDE&PBmKM8PVfF7bXkh!u!|5KRw{8N3Wb>iv*&V5yuA}O0*oo6gBJ_W zSJZUktD9@LkkQ5d2#L8Sj{^o~>y&xsus8EuH*{4cEF*1CBbL@d4B>*3px?6fS!$0h zJj4#T1GZWOFRjB}Y4O`dA{hgSL9zX&#;I^L8v%El#K;6uF8qC8@p1OR$8|OFLpw)3 z3x{<_1oDGWgWCI!;c8)5PB*6O6v6^_= zppO#GG8D*~+mg=gkAmx#uIS`i7?jVG2)7Nd8;dLtTcJShZcLyd)_@*%q?KLrrV-&* zt85i{e+X6u_prTA9XS$rcunHf``C}r!>%Qz5^Y=p$LxQC|JQ8J1_T0IRO|KOBJgf} zUl@T*=I_!mfwTVZ?M^EL`gg{>+xbJ7FE9gr=IJm`hj}{8 k)4^~tn5V=4g$@Je+b_D!ux8IL0q}#{9vUdvw(p<+1&|#;F#rGn diff --git a/ui/wood_icon.png b/ui/wood_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ceb25ca94b3ec62f11444bc5163cbfe99b147885 GIT binary patch literal 405 zcmV;G0c!qJvuin$RdtI;44)B8rp7t%4}vPz4U1OD)iS`4 literal 0 HcmV?d00001 diff --git a/ui/wood_icon.png.import b/ui/wood_icon.png.import new file mode 100644 index 0000000..2ba067a --- /dev/null +++ b/ui/wood_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://baqdyxvrx4655" +path="res://.godot/imported/wood_icon.png-2710b2152aec1c69f3e7c85f9132128c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/wood_icon.png" +dest_files=["res://.godot/imported/wood_icon.png-2710b2152aec1c69f3e7c85f9132128c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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