From e1753a15879211f8574db8e850d8a5641c940c85 Mon Sep 17 00:00:00 2001 From: Ategon Date: Wed, 11 Sep 2024 22:40:54 -0400 Subject: [PATCH] Add building icons to build menu --- Main.tscn | 23 ++++++++---- basic_tiles.png | Bin 0 -> 768 bytes basic_tiles.png.import | 34 ++++++++++++++++++ parts/buildings/images/essencecompressor.png | Bin 0 -> 401 bytes .../images/essencecompressor.png.import | 34 ++++++++++++++++++ parts/buildings/images/foodgathering.png | Bin 0 -> 401 bytes .../buildings/images/foodgathering.png.import | 34 ++++++++++++++++++ parts/buildings/images/foodprocessing.png | Bin 0 -> 401 bytes .../images/foodprocessing.png.import | 34 ++++++++++++++++++ parts/buildings/images/house.png | Bin 0 -> 401 bytes parts/buildings/images/house.png.import | 34 ++++++++++++++++++ parts/buildings/images/quarter.png | Bin 0 -> 401 bytes parts/buildings/images/quarter.png.import | 34 ++++++++++++++++++ parts/buildings/images/stoneminer.png | Bin 0 -> 401 bytes parts/buildings/images/stoneminer.png.import | 34 ++++++++++++++++++ parts/buildings/images/tents.png | Bin 0 -> 401 bytes parts/buildings/images/tents.png.import | 34 ++++++++++++++++++ parts/buildings/images/waterprocessor.png | Bin 0 -> 401 bytes .../images/waterprocessor.png.import | 34 ++++++++++++++++++ parts/buildings/images/waterpump.png | Bin 0 -> 401 bytes parts/buildings/images/waterpump.png.import | 34 ++++++++++++++++++ parts/buildings/images/woodcutter.png | Bin 0 -> 401 bytes parts/buildings/images/woodcutter.png.import | 34 ++++++++++++++++++ theme.tres | 6 ++-- tile_map.gd | 4 +-- ui/BuildingIcon.tscn | 21 ++++++++++- ui/building_icon.gd | 3 ++ ui/building_menu.gd | 9 +++-- 28 files changed, 423 insertions(+), 17 deletions(-) create mode 100644 basic_tiles.png create mode 100644 basic_tiles.png.import create mode 100644 parts/buildings/images/essencecompressor.png create mode 100644 parts/buildings/images/essencecompressor.png.import create mode 100644 parts/buildings/images/foodgathering.png create mode 100644 parts/buildings/images/foodgathering.png.import create mode 100644 parts/buildings/images/foodprocessing.png create mode 100644 parts/buildings/images/foodprocessing.png.import create mode 100644 parts/buildings/images/house.png create mode 100644 parts/buildings/images/house.png.import create mode 100644 parts/buildings/images/quarter.png create mode 100644 parts/buildings/images/quarter.png.import create mode 100644 parts/buildings/images/stoneminer.png create mode 100644 parts/buildings/images/stoneminer.png.import create mode 100644 parts/buildings/images/tents.png create mode 100644 parts/buildings/images/tents.png.import create mode 100644 parts/buildings/images/waterprocessor.png create mode 100644 parts/buildings/images/waterprocessor.png.import create mode 100644 parts/buildings/images/waterpump.png create mode 100644 parts/buildings/images/waterpump.png.import create mode 100644 parts/buildings/images/woodcutter.png create mode 100644 parts/buildings/images/woodcutter.png.import create mode 100644 ui/building_icon.gd diff --git a/Main.tscn b/Main.tscn index 61f4c74..4bece17 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=12 format=3 uid="uid://5ske2hm55rce"] +[gd_scene load_steps=14 format=3 uid="uid://5ske2hm55rce"] [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="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"] @@ -21,15 +22,27 @@ 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="CircleShape2D" id="CircleShape2D_s8q4l"] -radius = 134.7 +radius = 150.083 [node name="Main" type="Node2D"] @@ -52,7 +65,7 @@ layer_5/name = "Layer5" script = ExtResource("5_v47eg") [node name="MouseHandler" parent="TileMap" instance=ExtResource("5_6lpdu")] -position = Vector2(318, 178) +position = Vector2(319, 177) [node name="CollisionShape2D" type="CollisionShape2D" parent="TileMap/MouseHandler"] shape = SubResource("CircleShape2D_s8q4l") @@ -65,10 +78,6 @@ offset = Vector2(50, 150) [node name="InfoWindow" parent="CanvasLayer" instance=ExtResource("7_f4xfy")] -[node name="ColorRect" type="ColorRect" parent="CanvasLayer"] -offset_right = 40.0 -offset_bottom = 40.0 - [node name="BuildingMenu" parent="CanvasLayer" instance=ExtResource("7_hnxcf")] [connection signal="clicked" from="TileMap/MouseHandler" to="TileMap" method="_on_mouse_handler_clicked"] diff --git a/basic_tiles.png b/basic_tiles.png new file mode 100644 index 0000000000000000000000000000000000000000..d521c9dca06265e6d8951c5eba7507278ef88f5b GIT binary patch literal 768 zcmV+b1ONPqP)Px%ph-kQRCt{2+A&NMQ5?tdpTwkz6B9b1B^_9ZiPF);$yuT-vavKFalxr1P7av5 zv0zMC+;9;BL!-t?W5QA-X|4l9Q@}y%VoW4qItTKa>+@dkdhh>l5q_Vg6z=ZPZ|-{S z-2;e-h=_=Yh=_=Y1k7*Gh4b5U;jsS?O_ww_>WcRI{<_L|!zB8G((Y~NDWu2?$$FTc zhma$_8z}EQ$^0JYv+h}O*>?j$J;2n>DFDEa_V-llTphax0C>Ot!FTwcruSAu0NB0t zSZz=D4hWn^1dteV(BbUo8X>&{=4yGI6b}HnL%PBpe;xH5zKb2s^>@jTB72~TXddm5 zapA7q{v|OqfaGwln-Xl&BLyl2^z$ww_P+0 z=!pS6c?W#^YAy4JQHj}F-yXimybaC|w8VX=jys8PeqaL54-~@rfkZ?^L_|bHL_{R% yFWgc$)Id~TDF6Tf4rN$LW=%~1DgXcg2mk;800000(o>TF0000o literal 0 HcmV?d00001 diff --git a/basic_tiles.png.import b/basic_tiles.png.import new file mode 100644 index 0000000..93e4bcc --- /dev/null +++ b/basic_tiles.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bdmao1k7ngu2m" +path="res://.godot/imported/basic_tiles.png-ab6e820af8e93675a192b178dda8db52.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://basic_tiles.png" +dest_files=["res://.godot/imported/basic_tiles.png-ab6e820af8e93675a192b178dda8db52.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/parts/buildings/images/essencecompressor.png b/parts/buildings/images/essencecompressor.png new file mode 100644 index 0000000000000000000000000000000000000000..4a600362c6138a46b38cb69c210d07b0dbd78f06 GIT binary patch literal 401 zcmV;C0dD?@P)Px$OG!jQRA_jK+@xCns=nT784x#IqK7DWRGpKrU>@4`w~b>>ps4XAD6)aQ{+63gIq zua#CuK-O9Ui$*+n!6x~%r?UEhhK0%m5n+WBo8;4;YC6E`AWOReo8ke>llVc11!#Hs zUQ|0!hZwPdthEGCUnfKY+;CKR1-L~_d;TK2&WJywClMoT-d0!NIHiRb`86gfPx$OG!jQRA_jK+@xCns=nT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