Compare commits

...

4 commits

Author SHA1 Message Date
Ategon
d994deb90f Merge branch 'top_ui' 2024-09-13 21:24:54 -04:00
Ategon
ac3b0682be Add new tileset 2024-09-13 21:16:28 -04:00
zcembbi
7cfc81b16c Changed UI layout 2024-09-14 04:16:14 +03:00
zcembbi
e116ac4769 Add basic top ui functionality 2024-09-10 16:03:27 +03:00
17 changed files with 365 additions and 100 deletions

View file

@ -3,7 +3,7 @@
[ext_resource type="Theme" uid="uid://d035h7upxrw3h" path="res://theme.tres" id="1_emusj"]
[ext_resource type="Script" path="res://info_window.gd" id="1_oy31s"]
[ext_resource type="PackedScene" uid="uid://bsj3th0rsn7a8" path="res://ResourceAllocation.tscn" id="3_r3oy0"]
[ext_resource type="Texture2D" uid="uid://brrrxrf3phkqv" path="res://ui/buildingmeny.png" id="3_wsa04"]
[ext_resource type="Texture2D" uid="uid://cd205j7rs5ph7" path="res://ui/buildingmeny.png" id="3_wsa04"]
[node name="InfoWindow" type="Control"]
layout_mode = 3

View file

@ -1,51 +1,21 @@
[gd_scene load_steps=14 format=3 uid="uid://5ske2hm55rce"]
[gd_scene load_steps=10 format=4 uid="uid://5ske2hm55rce"]
[ext_resource type="PackedScene" uid="uid://n2lpy72tkyc8" path="res://storm/StormManager.tscn" id="1_gcxt1"]
[ext_resource type="PackedScene" uid="uid://bxctpr0tfqidf" path="res://ui/UI.tscn" id="1_ve2mn"]
[ext_resource type="Theme" uid="uid://d035h7upxrw3h" path="res://theme.tres" id="1_xbn5h"]
[ext_resource type="Texture2D" uid="uid://bsrh0u02bckhy" path="res://iso_building.png" id="3_qa5pv"]
[ext_resource type="Texture2D" uid="uid://bvn5lewpp7pmd" path="res://iso_tile.png" id="4_7pks7"]
[ext_resource type="Texture2D" uid="uid://bdmao1k7ngu2m" path="res://basic_tiles.png" id="4_h72lx"]
[ext_resource type="TileSet" uid="uid://dhy53lakrlutm" path="res://TIleSet.tres" id="2_68wnv"]
[ext_resource type="PackedScene" uid="uid://dykc1mgg5uopw" path="res://components/Cursor/MouseHandler.tscn" id="5_6lpdu"]
[ext_resource type="Script" path="res://tile_map.gd" id="5_v47eg"]
[ext_resource type="PackedScene" uid="uid://byyyhq3x8t2d8" path="res://InfoWindow.tscn" id="7_f4xfy"]
[ext_resource type="PackedScene" uid="uid://b22pr3istdhcv" path="res://ui/BuildingMenu.tscn" id="7_hnxcf"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_dxrqb"]
texture = ExtResource("4_7pks7")
margins = Vector2i(16, 16)
1:1/0 = 0
0:0/0 = 0
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_j7eew"]
texture = ExtResource("3_qa5pv")
margins = Vector2i(15, 14)
texture_region_size = Vector2i(18, 20)
1:1/0 = 0
0:0/0 = 0
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_w6tof"]
texture = ExtResource("4_h72lx")
1:3/0 = 0
3:3/0 = 0
1:6/0 = 0
3:6/0 = 0
1:7/0 = 0
3:7/0 = 0
1:1/0 = 0
3:1/0 = 0
[sub_resource type="TileSet" id="TileSet_2mye8"]
tile_shape = 1
tile_layout = 5
tile_size = Vector2i(16, 8)
sources/0 = SubResource("TileSetAtlasSource_dxrqb")
sources/1 = SubResource("TileSetAtlasSource_j7eew")
sources/2 = SubResource("TileSetAtlasSource_w6tof")
[sub_resource type="RectangleShape2D" id="RectangleShape2D_57goo"]
size = Vector2(324, 314)
[node name="Main" type="Node2D"]
[node name="StormManager" parent="." instance=ExtResource("1_gcxt1")]
[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
@ -53,10 +23,36 @@ offset_right = 40.0
offset_bottom = 40.0
theme = ExtResource("1_xbn5h")
[node name="A5" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAAiAAQAAwABAAMAAAAjAAQAAwABAAMAAAAkAAQAAwABAAMAAAAlAAQAAwABAAMAAAAmAAQAAwABAAMAAAAnAAQAAwABAAMAAAAnAAMAAwABAAMAAAAoAAMAAwABAAMAAAAo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AAwAAMAAwABAAMAAAAwAAQAAwABAAMAAAAwAAUAAwABAAMAAAAwAAYAAwABAAMAAAAwAAcAAwABAAMAAAAwAAgAAwABAAMAAAAwAAkAAwABAAMAAAAwAAoAAwABAAMAAAAwAAsAAwABAAMAAAAwAAwAAwABAAMAAAA=")
tile_set = ExtResource("2_68wnv")
[node name="A4" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAAgAP//AwADAAEAAAAhAP//AwADAAEAAAAiAP//AwADAAEAAAAjAP//AwADAAEAAAAjAP7/AwADAAEAAAAjAP3/AwADAAEAAAAjAPz/AwADAAEAAAAgAAAAAwADAAEAAAAhAAAAAwADAAEAAAAiAAAAAwADAAEAAAAjAAAAAwADAAEAAAAkAP//AwADAAEAAAAkAP7/AwADAAEAAAAkAP3/AwADAAEAAAAkAPz/AwADAAEAAAAiAPz/AwADAAEAAAAiAP3/AwADAAEAAAAiAP7/AwADAAEAAAAkAAAAAwADAAEAAAAhAAIAAwADAAEAAAAiAAIAAwADAAEAAAAjAAIAAwADAAEAAAAkAAIAAwADAAEAAAAkAAEAAwADAAEAAAAlAAEAAwADAAEAAAAlAAIAAwADAAEAAAAmAAIAAwADAAEAAAAmAAEAAwADAAEAAAAmAAAAAwADAAEAAAAmAP//AwADAAEAAAAmAP7/AwADAAEAAAAmAP3/AwADAAEAAAA=")
tile_set = ExtResource("2_68wnv")
[node name="A3" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAAgAP7/AwAFAAEAAAAhAP7/AwAFAAEAAAAiAP7/AwAFAAEAAAAiAP3/AwAFAAEAAAAiAPz/AwAFAAEAAAAgAPz/AwAFAAEAAAAgAP3/AwAFAAEAAAAhAP3/AwAFAAEAAAAhAPz/AwAFAAEAAAAgAP//AwAFAAEAAAAhAP//AwAFAAEAAAAiAP//AwAFAAEAAAAjAP//AwAFAAEAAAAjAP7/AwAFAAEAAAAjAP3/AwAFAAEAAAAjAPz/AwAFAAEAAAAkAPz/AwAFAAEAAAAkAP3/AwAFAAEAAAAkAP7/AwAFAAEAAAAkAP//AwAFAAEAAAAjAAAAAwAFAAEAAAAiAAAAAwAFAAEAAAAhAAAAAwAFAAEAAAAgAAAAAwAFAAEAAAAkAAAAAwAFAAEAAAA=")
tile_set = ExtResource("2_68wnv")
[node name="A2" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAAfAP3/AwAHAAEAAAAgAP3/AwAHAAEAAAAhAP3/AwAHAAEAAAAhAPz/AwAHAAEAAAAhAPv/AwAHAAEAAAAfAP7/AwAHAAEAAAAgAP7/AwAHAAEAAAAhAP7/AwAHAAEAAAAiAP7/AwAHAAEAAAAiAP3/AwAHAAEAAAAiAPz/AwAHAAEAAAAiAPv/AwAHAAEAAAAfAPz/AwAHAAEAAAAfAPv/AwAHAAEAAAAgAPv/AwAHAAEAAAAgAPz/AwAHAAEAAAA=")
tile_set = ExtResource("2_68wnv")
[node name="A" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAAfAPz/AwAJAAEAAAAgAPz/AwAJAAEAAAAgAPv/AwAJAAEAAAAgAPr/AwAJAAEAAAAeAPr/AwAJAAEAAAAeAPv/AwAJAAEAAAAfAPr/AwAJAAEAAAAeAPz/AwAJAAEAAAAfAPv/AwAJAAEAAAA=")
tile_set = ExtResource("2_68wnv")
[node name="TopLevel" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAAdAPn/AwALAAEAAAAdAPr/AwALAAEAAAAeAPr/AwALAAEAAAAeAPn/AwALAAEAAAA=")
tile_set = ExtResource("2_68wnv")
[node name="TileMap" type="TileMap" parent="."]
tile_set = SubResource("TileSet_2mye8")
visible = false
tile_set = ExtResource("2_68wnv")
rendering_quadrant_size = 128
format = 2
layer_0/tile_data = PackedInt32Array(65535, 327683, 1, 131071, 327683, 1, 0, 327683, 1, 65536, 327683, 1)
layer_1/name = "Layer1"
layer_2/name = "Layer2"
layer_3/name = "Layer3"
@ -71,12 +67,15 @@ position = Vector2(319, 177)
rotation = 0.750492
shape = SubResource("RectangleShape2D_57goo")
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(-48, -46)
offset = Vector2(50, 150)
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="UI" parent="CanvasLayer" instance=ExtResource("1_ve2mn")]
anchors_preset = 15
anchor_bottom = 1.0
offset_bottom = 0.0
grow_vertical = 2
theme = ExtResource("1_xbn5h")
[node name="InfoWindow" parent="CanvasLayer" instance=ExtResource("7_f4xfy")]
pivot_offset = Vector2(114, 128)

54
TIleSet.tres Normal file
View file

@ -0,0 +1,54 @@
[gd_resource type="TileSet" load_steps=9 format=3 uid="uid://dhy53lakrlutm"]
[ext_resource type="Texture2D" uid="uid://bvn5lewpp7pmd" path="res://iso_tile.png" id="1_sa4j6"]
[ext_resource type="Texture2D" uid="uid://bsrh0u02bckhy" path="res://iso_building.png" id="2_bubm3"]
[ext_resource type="Texture2D" uid="uid://bdmao1k7ngu2m" path="res://basic_tiles.png" id="3_rchy6"]
[ext_resource type="Texture2D" uid="uid://w1abxk1m0fae" path="res://tiles-v3.png" id="4_p6xw0"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_dxrqb"]
texture = ExtResource("1_sa4j6")
margins = Vector2i(16, 16)
1:1/0 = 0
0:0/0 = 0
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_j7eew"]
texture = ExtResource("2_bubm3")
margins = Vector2i(15, 14)
texture_region_size = Vector2i(18, 20)
1:1/0 = 0
0:0/0 = 0
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_w6tof"]
texture = ExtResource("3_rchy6")
1:3/0 = 0
3:3/0 = 0
1:6/0 = 0
3:6/0 = 0
1:7/0 = 0
3:7/0 = 0
1:1/0 = 0
3:1/0 = 0
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_5o051"]
texture = ExtResource("4_p6xw0")
1:1/0 = 0
1:3/0 = 0
3:3/0 = 0
3:1/0 = 0
5:1/0 = 0
5:3/0 = 0
11:3/0 = 0
11:1/0 = 0
9:1/0 = 0
7:1/0 = 0
7:3/0 = 0
9:3/0 = 0
[resource]
tile_shape = 1
tile_layout = 5
tile_size = Vector2i(16, 8)
sources/0 = SubResource("TileSetAtlasSource_dxrqb")
sources/1 = SubResource("TileSetAtlasSource_j7eew")
sources/2 = SubResource("TileSetAtlasSource_w6tof")
sources/3 = SubResource("TileSetAtlasSource_5o051")

View file

@ -2,6 +2,7 @@ extends Node
@onready var globals = Data.data.globals
var game_time = 0
var last_flood_time = 0
var current_flood_state = 0

View file

@ -31,50 +31,50 @@ func _ready():
Triggerer.listen("select_building", select_building)
Triggerer.listen("drag_building", drag_building)
for x in GridSize:
for y in GridSize:
var layer_number: int
var x_value: int = abs(GridSize/2 - x)
var y_value: int = abs(GridSize/2 - y)
var max_value: int = maxi(x_value, y_value)
match max_value:
16,15:
layer_number = 1
14:
layer_number = generate_percentage([3,1])
13:
layer_number = generate_percentage([2,1])
12:
layer_number = generate_percentage([1,1])
11:
layer_number = generate_percentage([1,2,1])
10:
layer_number = generate_percentage([0,3,2])
9:
layer_number = generate_percentage([0,1,1])
8:
layer_number = generate_percentage([0,1,2,1])
7:
layer_number = generate_percentage([0,0,3,2])
6:
layer_number = generate_percentage([0,0,1,1])
5:
layer_number = generate_percentage([0,0,1,2,1])
4:
layer_number = generate_percentage([0,0,0,3,2])
3:
layer_number = generate_percentage([0,0,0,1,1])
2:
layer_number = generate_percentage([0,0,0,1,2])
1,0:
layer_number = 5
print("x- ",x," y- ",y," layer- ",layer_number)
for layer in layer_number:
set_cell(layer, Vector2(x, y), 2, Vector2i(1, 1), 0)
Dic[str(Vector2(x,y))] = {
"Layer": layer_number,
"Placed": false
}
#for x in GridSize:
#for y in GridSize:
#var layer_number: int
#var x_value: int = abs(GridSize/2 - x)
#var y_value: int = abs(GridSize/2 - y)
#var max_value: int = maxi(x_value, y_value)
#match max_value:
#16,15:
#layer_number = 1
#14:
#layer_number = generate_percentage([3,1])
#13:
#layer_number = generate_percentage([2,1])
#12:
#layer_number = generate_percentage([1,1])
#11:
#layer_number = generate_percentage([1,2,1])
#10:
#layer_number = generate_percentage([0,3,2])
#9:
#layer_number = generate_percentage([0,1,1])
#8:
#layer_number = generate_percentage([0,1,2,1])
#7:
#layer_number = generate_percentage([0,0,3,2])
#6:
#layer_number = generate_percentage([0,0,1,1])
#5:
#layer_number = generate_percentage([0,0,1,2,1])
#4:
#layer_number = generate_percentage([0,0,0,3,2])
#3:
#layer_number = generate_percentage([0,0,0,1,1])
#2:
#layer_number = generate_percentage([0,0,0,1,2])
#1,0:
#layer_number = 5
#print("x- ",x," y- ",y," layer- ",layer_number)
#for layer in layer_number:
#set_cell(layer, Vector2(x, y), 2, Vector2i(1, 1), 0)
#Dic[str(Vector2(x,y))] = {
#"Layer": layer_number,
#"Placed": false
#}
func _process(delta):
if Input.is_action_just_released("lclick"):
@ -85,7 +85,7 @@ func _process(delta):
for x in GridSize:
for y in GridSize:
if !Dic[str(Vector2(x,y))].get("Placed"):
if Dic.has(str(Vector2(x,y))) and !Dic[str(Vector2(x,y))].get("Placed"):
erase_cell(Dic[str(Vector2(x,y))].get("Layer"), Vector2(x,y))
if Dic.has(str(tile)):

BIN
tiles-v3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

34
tiles-v3.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://w1abxk1m0fae"
path="res://.godot/imported/tiles-v3.png-c6fefb34fcf2e018f876a1e8a690296d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://tiles-v3.png"
dest_files=["res://.godot/imported/tiles-v3.png-c6fefb34fcf2e018f876a1e8a690296d.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

View file

@ -2,7 +2,7 @@
[ext_resource type="Theme" uid="uid://d035h7upxrw3h" path="res://theme.tres" id="1_2qpq4"]
[ext_resource type="Script" path="res://ui/building_menu.gd" id="1_nmos7"]
[ext_resource type="Texture2D" uid="uid://brrrxrf3phkqv" path="res://ui/buildingmeny.png" id="2_tml71"]
[ext_resource type="Texture2D" uid="uid://cd205j7rs5ph7" path="res://ui/buildingmeny.png" id="2_tml71"]
[ext_resource type="PackedScene" uid="uid://bqvue0h7wc0mx" path="res://ui/BuildingTab.tscn" id="3_cpcpk"]
[ext_resource type="PackedScene" uid="uid://cqfr8d1b7pd6p" path="res://ui/Spacer.tscn" id="3_ji0ar"]
[ext_resource type="PackedScene" uid="uid://b7o2i7tgirg64" path="res://ui/BuildingIcon.tscn" id="3_ol3gk"]

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=6 format=3 uid="uid://bqvue0h7wc0mx"]
[ext_resource type="Theme" uid="uid://d035h7upxrw3h" path="res://theme.tres" id="1_2kci0"]
[ext_resource type="Texture2D" uid="uid://brrrxrf3phkqv" path="res://ui/buildingmeny.png" id="1_j8r6a"]
[ext_resource type="Texture2D" uid="uid://cd205j7rs5ph7" path="res://ui/buildingmeny.png" id="1_j8r6a"]
[ext_resource type="PackedScene" uid="uid://dykc1mgg5uopw" path="res://components/Cursor/MouseHandler.tscn" id="2_ona0j"]
[ext_resource type="Script" path="res://ui/building_tab.gd" id="2_vatnx"]

142
ui/UI.tscn Normal file
View file

@ -0,0 +1,142 @@
[gd_scene load_steps=7 format=3 uid="uid://bxctpr0tfqidf"]
[ext_resource type="Theme" uid="uid://d035h7upxrw3h" path="res://theme.tres" id="1_fcqle"]
[ext_resource type="Texture2D" uid="uid://cd205j7rs5ph7" 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://6bpdb3npejtx" path="res://ui/stone_icon.png" id="2_vo570"]
[ext_resource type="Texture2D" uid="uid://byx0ivnwice1e" path="res://ui/wood_icon.png" id="3_ohuq3"]
[ext_resource type="Texture2D" uid="uid://rtrb5p3o61i4" 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
grow_horizontal = 2
theme = ExtResource("1_fcqle")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="LeftCounters" type="HBoxContainer" parent="HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Resources" type="MarginContainer" parent="HBoxContainer/LeftCounters"]
layout_mode = 2
[node name="Background" type="NinePatchRect" parent="HBoxContainer/LeftCounters/Resources"]
custom_minimum_size = Vector2(168, 24)
layout_mode = 2
size_flags_vertical = 0
texture = ExtResource("1_xpu1e")
region_rect = Rect2(-0.458088, -0.349636, 186.046, 47.2991)
[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="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_right = 55.0
offset_bottom = 24.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
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)
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)
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="RightCounters" type="MarginContainer" parent="HBoxContainer/RightCounters"]
layout_mode = 2
[node name="Background" type="NinePatchRect" parent="HBoxContainer/RightCounters/RightCounters"]
custom_minimum_size = Vector2(113, 24)
layout_mode = 2
texture = ExtResource("1_xpu1e")
region_rect = Rect2(1.19859, 0.999939, 182.287, 45.1203)
[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="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_right = 55.0
offset_bottom = 24.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "000"
horizontal_alignment = 2
vertical_alignment = 1
script = ExtResource("2_ei01o")
[node name="FloodLevelCountLabel" type="Label" parent="HBoxContainer/RightCounters/RightCounters/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)
text = "000"
horizontal_alignment = 2
vertical_alignment = 1
script = ExtResource("2_ei01o")

View file

@ -16,17 +16,12 @@ func _on_mouse_handler_hovered() -> void:
func _on_mouse_handler_unhovered() -> void:
print(key)
print("DRAG 1")
if clicked:
print("DRAG")
Triggerer.trigger("drag_building", { "key": key })
clicked = false
func _on_mouse_handler_released() -> void:
print("SELECT 1")
if clicked:
print("SELECT")
Triggerer.trigger("select_building", { "key": key })
clicked = false

View file

@ -50,8 +50,6 @@ func swap_to_tab(index):
if i > 0:
spacers[i - 1].visible = false
print(icons.map(func(icon): return icon.key))
func _on_building_tab_clicked() -> void:

View file

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://brrrxrf3phkqv"
uid="uid://cd205j7rs5ph7"
path="res://.godot/imported/buildingmeny.png-ec30ba3f3cfa707d601ffd2165a5ab3d.ctex"
metadata={
"vram_texture": false

42
ui/counters.gd Normal file
View file

@ -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))

View file

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://baxweme4kyald"
uid="uid://rtrb5p3o61i4"
path="res://.godot/imported/essence_icon.png-2ff4decd1d74f99d981c04fec76d6306.ctex"
metadata={
"vram_texture": false

View file

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cngxjjfl3i0b3"
uid="uid://6bpdb3npejtx"
path="res://.godot/imported/stone_icon.png-71774b19e906290b7d47dfd58bfc7e58.ctex"
metadata={
"vram_texture": false

View file

@ -2,7 +2,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://c554jwofq0tdf"
uid="uid://byx0ivnwice1e"
path="res://.godot/imported/wood_icon.png-2710b2152aec1c69f3e7c85f9132128c.ctex"
metadata={
"vram_texture": false