From 586b3f55dcf565f79c057314f8b553e468fced25 Mon Sep 17 00:00:00 2001 From: Ategon Date: Fri, 13 Sep 2024 20:32:06 -0400 Subject: [PATCH] Icons --- tile_map.gd | 10 ++++++---- ui/essence_icon.png.import | 34 ++++++++++++++++++++++++++++++++++ ui/stone_icon.png | Bin 336 -> 316 bytes ui/stone_icon.png.import | 34 ++++++++++++++++++++++++++++++++++ ui/wood_icon.png.import | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 ui/essence_icon.png.import create mode 100644 ui/stone_icon.png.import create mode 100644 ui/wood_icon.png.import diff --git a/tile_map.gd b/tile_map.gd index 0d4512e..d7fe002 100644 --- a/tile_map.gd +++ b/tile_map.gd @@ -100,7 +100,7 @@ func _on_mouse_handler_clicked(): func show_info_building(): var tile = local_to_map(get_global_mouse_position()) - if Dic[str(tile)]["Placed"]: + if Dic.has(str(tile)) and Dic[str(tile)]["Placed"]: Triggerer.trigger("show_info", Dic[str(tile)]) func select_building(data): @@ -119,13 +119,15 @@ func drag_building(data): func release_mouse(): if Drag_Mode and Building_Mode: place_building() - Drag_Mode = false func place_building(): var tile = local_to_map(get_global_mouse_position()) - Building_Mode = false - Dic[str(tile)]["Placed"] = true + if Dic.has(str(tile)): + Building_Mode = false + Dic[str(tile)]["Placed"] = true + + Drag_Mode = false func _on_mouse_handler_rclicked(): diff --git a/ui/essence_icon.png.import b/ui/essence_icon.png.import new file mode 100644 index 0000000..cd738c0 --- /dev/null +++ b/ui/essence_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://baxweme4kyald" +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/stone_icon.png b/ui/stone_icon.png index 7bbcf6d6a42929d393bade4a08a798cc5b9e5257..8cc09623da07fb6feda80d5c90f75bad81c74910 100644 GIT binary patch delta 290 zcmV+-0p0%40=xo{BYyw^b5ch_0Itp)=>Px#_DMuRR9J=WmOBoEFbqIL)KehTZnWyq z8}txeI3x>);06o`*g%MDq)UyQvwlRXAYXzAcCA|+7DE(3;j8~XU{3?sGz6#Eevn%4U6t6Emz7t`29A_8vq z7Hq)$07*qoM6N<$f?c9~Z~y=R delta 310 zcmV-60m=Tn0?-1GBYy!GNkl`$G?TJ4F$SwZlNq0VS)Bl6nYA@908|31NMug)4@|fV=t45+O!g1wUIAsL zCh@l+a~->TuP+xw8*_ktm}or*%5zO>e30mX=<-sYHEUG;05my-Bc+Jb6#xJL07*qo IM6N<$g8!+2vj6}9 diff --git a/ui/stone_icon.png.import b/ui/stone_icon.png.import new file mode 100644 index 0000000..6fb102b --- /dev/null +++ b/ui/stone_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cngxjjfl3i0b3" +path="res://.godot/imported/stone_icon.png-71774b19e906290b7d47dfd58bfc7e58.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/stone_icon.png" +dest_files=["res://.godot/imported/stone_icon.png-71774b19e906290b7d47dfd58bfc7e58.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/wood_icon.png.import b/ui/wood_icon.png.import new file mode 100644 index 0000000..d195c2b --- /dev/null +++ b/ui/wood_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c554jwofq0tdf" +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