diff --git a/assets/materials/glass.tres b/assets/materials/glass.tres new file mode 100644 index 0000000..367d6b2 --- /dev/null +++ b/assets/materials/glass.tres @@ -0,0 +1,10 @@ +[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://b2w5ybx51vuwf"] + +[ext_resource type="Texture2D" uid="uid://dbgq50hfo3qyi" path="res://assets/textures/glass-block.png" id="1_wmskm"] + +[resource] +transparency = 1 +albedo_texture = ExtResource("1_wmskm") +metallic_specular = 0.0 +roughness = 0.0 +texture_filter = 0 diff --git a/assets/textures/glass-block.png b/assets/textures/glass-block.png new file mode 100644 index 0000000..bd52d37 Binary files /dev/null and b/assets/textures/glass-block.png differ diff --git a/assets/textures/glass-block.png.import b/assets/textures/glass-block.png.import new file mode 100644 index 0000000..ce0e975 --- /dev/null +++ b/assets/textures/glass-block.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dbgq50hfo3qyi" +path.s3tc="res://.godot/imported/glass-block.png-044c3715bdfecbc3ecf8d63721050d0b.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/textures/glass-block.png" +dest_files=["res://.godot/imported/glass-block.png-044c3715bdfecbc3ecf8d63721050d0b.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +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=0 diff --git a/assets/textures/glass.png b/assets/textures/glass.png new file mode 100644 index 0000000..cf36cb0 Binary files /dev/null and b/assets/textures/glass.png differ diff --git a/assets/textures/glass.png.import b/assets/textures/glass.png.import new file mode 100644 index 0000000..4e81f74 --- /dev/null +++ b/assets/textures/glass.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cpllegyqnfnrh" +path="res://.godot/imported/glass.png-bc5a76edb61031570869d2267fdb76fd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/textures/glass.png" +dest_files=["res://.godot/imported/glass.png-bc5a76edb61031570869d2267fdb76fd.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/autoloads/db_items.gd b/autoloads/db_items.gd index 9149021..30347b9 100644 --- a/autoloads/db_items.gd +++ b/autoloads/db_items.gd @@ -7,4 +7,5 @@ extends Node "003": preload("res://resources/blocks/003_wood.tres"), "004": preload("res://resources/blocks/004_leaves.tres"), "005": preload("res://resources/blocks/005_grass.tres"), + "006": preload("res://resources/blocks/006_glass.tres"), } diff --git a/resources/blocks/006_glass.tres b/resources/blocks/006_glass.tres new file mode 100644 index 0000000..7fe0ae2 --- /dev/null +++ b/resources/blocks/006_glass.tres @@ -0,0 +1,14 @@ +[gd_resource type="Resource" script_class="BlockResource" load_steps=3 format=3 uid="uid://bfrbhymu4iqu8"] + +[ext_resource type="Material" uid="uid://b2w5ybx51vuwf" path="res://assets/materials/glass.tres" id="1_6luft"] +[ext_resource type="Script" uid="uid://dwrmy4mx0mw18" path="res://resources/block_resource.gd" id="2_jygkk"] + +[resource] +script = ExtResource("2_jygkk") +material_texture = ExtResource("1_6luft") +id = "006" +name = "Glass" +amount = 0 +description = "Glass block" +item_texture = "uid://cpllegyqnfnrh" +metadata/_custom_type_script = "uid://dwrmy4mx0mw18" diff --git a/scenes/ui/quick_slots.gd b/scenes/ui/quick_slots.gd index 1f5d443..852aa69 100644 --- a/scenes/ui/quick_slots.gd +++ b/scenes/ui/quick_slots.gd @@ -6,7 +6,7 @@ extends Node @onready var slots_container: GridContainer = $GridContainer -var _items: Array[String] = ["001", "005", "002", "003", "004"] +var _items: Array[String] = ["001", "005", "002", "003", "004", "006"] var _previous_selected_item: int = 0 var _selected_item: int = 0 : set(new_item_index): diff --git a/scenes/ui/quick_slots.tscn b/scenes/ui/quick_slots.tscn index 5912fac..6022528 100644 --- a/scenes/ui/quick_slots.tscn +++ b/scenes/ui/quick_slots.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=3 uid="uid://cbiygbgpfk220"] +[gd_scene load_steps=9 format=3 uid="uid://cbiygbgpfk220"] [ext_resource type="Script" uid="uid://bcq6vexsmyeol" path="res://scenes/ui/quick_slots.gd" id="1_cqw2g"] [ext_resource type="Texture2D" uid="uid://li36txj7oweq" path="res://assets/textures/dirt.png" id="2_kotkb"] @@ -7,6 +7,7 @@ [ext_resource type="Texture2D" uid="uid://bgo4mb3atmbot" path="res://assets/textures/grass.png" id="3_yyyxx"] [ext_resource type="Texture2D" uid="uid://0mw651622h01" path="res://assets/textures/wood.png" id="4_yyyxx"] [ext_resource type="Texture2D" uid="uid://goygbpyqhych" path="res://assets/textures/leaves.png" id="5_ps55n"] +[ext_resource type="Texture2D" uid="uid://cpllegyqnfnrh" path="res://assets/textures/glass.png" id="8_bup65"] [node name="QuickSlots" type="MarginContainer"] anchors_preset = 7 @@ -30,7 +31,7 @@ highlight_theme = ExtResource("2_ps55n") layout_mode = 2 theme_override_constants/h_separation = 8 theme_override_constants/v_separation = 8 -columns = 5 +columns = 10 [node name="Slot0" type="Panel" parent="GridContainer"] custom_minimum_size = Vector2(64, 64) @@ -136,3 +137,24 @@ theme_override_constants/margin_bottom = 4 texture_filter = 1 layout_mode = 2 texture = ExtResource("5_ps55n") + +[node name="Slot6" type="Panel" parent="GridContainer"] +custom_minimum_size = Vector2(64, 64) +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="GridContainer/Slot6"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 4 +theme_override_constants/margin_top = 4 +theme_override_constants/margin_right = 4 +theme_override_constants/margin_bottom = 4 + +[node name="TextureRect" type="TextureRect" parent="GridContainer/Slot6/MarginContainer"] +texture_filter = 1 +layout_mode = 2 +texture = ExtResource("8_bup65") diff --git a/scenes/world/world.gd b/scenes/world/world.gd index 5a04e9d..edbd476 100644 --- a/scenes/world/world.gd +++ b/scenes/world/world.gd @@ -38,7 +38,7 @@ func _create_dropped_block(id: String, block_position: Vector3) -> void: block.initialize(id, block_position) func _create_test_blocks() -> void: - var test_blocks: Array = ["001", "002", "003", "004", "005"] + var test_blocks: Array = ["001", "002", "003", "004", "005", "006"] for index: int in range(1, test_blocks.size() + 1): _create_block("00" + str(index), Vector3(index, 1, -3)) _create_block("00" + str(index), Vector3(index, 2, -4))