Initial commit
This commit is contained in:
54
prefabs/combat_map.tscn
Normal file
54
prefabs/combat_map.tscn
Normal file
@@ -0,0 +1,54 @@
|
||||
[gd_scene format=3 uid="uid://dkhyh5ce4iuk3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bks7uplgjjdg0" path="res://nodes/combat_map.gd" id="1_jyv1f"]
|
||||
[ext_resource type="Script" uid="uid://c6701vy8h5rfx" path="res://resources/resource_definitions/dl_tileset.gd" id="2_8rn0j"]
|
||||
[ext_resource type="TileSet" uid="uid://dm5wl6d4xkstu" path="res://resources/combat_tileset.tres" id="3_8rn0j"]
|
||||
[ext_resource type="Texture2D" uid="uid://sjsl8q7tkx8" path="res://assets/sprites/grid_highlight.png" id="3_vcj5e"]
|
||||
[ext_resource type="Script" uid="uid://cxl38x2m6sj3w" path="res://scripts/grid_overlay.gd" id="4_jelju"]
|
||||
[ext_resource type="Texture2D" uid="uid://h7nfrjxagqmc" path="res://assets/sprites/selector.png" id="5_muxvo"]
|
||||
[ext_resource type="Script" uid="uid://b31eyqov8w7bm" path="res://scripts/tile_highlight.gd" id="7_tileh"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_vcj5e"]
|
||||
script = ExtResource("2_8rn0j")
|
||||
wall_tile_coords = Vector2i(2, 15)
|
||||
metadata/_custom_type_script = "uid://c6701vy8h5rfx"
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_jelju"]
|
||||
texture = ExtResource("3_vcj5e")
|
||||
texture_region_size = Vector2i(48, 48)
|
||||
0:0/animation_columns = 6
|
||||
0:0/animation_frame_0/duration = 1.0
|
||||
0:0/animation_frame_1/duration = 1.0
|
||||
0:0/animation_frame_2/duration = 1.0
|
||||
0:0/animation_frame_3/duration = 1.0
|
||||
0:0/animation_frame_4/duration = 1.0
|
||||
0:0/animation_frame_5/duration = 1.0
|
||||
0:0/0 = 0
|
||||
|
||||
[sub_resource type="TileSet" id="TileSet_muxvo"]
|
||||
tile_size = Vector2i(48, 48)
|
||||
sources/0 = SubResource("TileSetAtlasSource_jelju")
|
||||
|
||||
[node name="CombatMap" type="Node2D" unique_id=546780706]
|
||||
script = ExtResource("1_jyv1f")
|
||||
tile_set = SubResource("Resource_vcj5e")
|
||||
|
||||
[node name="OverlayLayer" type="TileMapLayer" parent="." unique_id=1335660296]
|
||||
unique_name_in_owner = true
|
||||
tile_set = SubResource("TileSet_muxvo")
|
||||
script = ExtResource("4_jelju")
|
||||
|
||||
[node name="TargetingIndicator" type="Sprite2D" parent="OverlayLayer" unique_id=1836328987]
|
||||
visible = false
|
||||
z_index = 3
|
||||
texture = ExtResource("5_muxvo")
|
||||
offset = Vector2(24, 24)
|
||||
|
||||
[node name="TerrainLayer" type="TileMapLayer" parent="." unique_id=1201875024]
|
||||
unique_name_in_owner = true
|
||||
tile_set = ExtResource("3_8rn0j")
|
||||
|
||||
[node name="TileHighlight" type="ColorRect" parent="." unique_id=211433569]
|
||||
script = ExtResource("7_tileh")
|
||||
|
||||
[connection signal="tile_hovered" from="TileHighlight" to="." method="target_tile"]
|
||||
42
prefabs/combat_ui.tscn
Normal file
42
prefabs/combat_ui.tscn
Normal file
@@ -0,0 +1,42 @@
|
||||
[gd_scene format=3 uid="uid://cy7r0udfcsqbn"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://dx26d6py3n8xi" path="res://resources/main_ui_theme.tres" id="1_2ro41"]
|
||||
[ext_resource type="Script" path="res://scripts/combat_ui.gd" id="2_ui_script"]
|
||||
|
||||
[node name="CombatUI" type="CanvasLayer" unique_id=1093388037]
|
||||
script = ExtResource("2_ui_script")
|
||||
|
||||
[node name="UnitPanel" type="PanelContainer" parent="." unique_id=2000000001]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 8.0
|
||||
offset_top = -78.0
|
||||
offset_right = 208.0
|
||||
offset_bottom = -8.0
|
||||
grow_vertical = 0
|
||||
theme = ExtResource("1_2ro41")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="UnitPanel"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="UnitPanel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="NameLabel" type="Label" parent="UnitPanel/MarginContainer/VBoxContainer" unique_id=2000000002]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Unit"
|
||||
|
||||
[node name="HPBar" type="ProgressBar" parent="UnitPanel/MarginContainer/VBoxContainer" unique_id=2000000003]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
max_value = 100.0
|
||||
value = 100.0
|
||||
show_percentage = false
|
||||
57
prefabs/unit.tscn
Normal file
57
prefabs/unit.tscn
Normal file
@@ -0,0 +1,57 @@
|
||||
[gd_scene format=3 uid="uid://b6a7nlnf58mc4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c016mxgatcpse" path="res://nodes/unit.gd" id="1_cq4v0"]
|
||||
[ext_resource type="Texture2D" uid="uid://cw5su6lignryo" path="res://assets/sprites/flag.png" id="2_fhs1y"]
|
||||
[ext_resource type="Texture2D" uid="uid://c2se5wyly6gr6" path="res://assets/sprites/character.bmp" id="2_on614"]
|
||||
[ext_resource type="Shader" uid="uid://bd8ki8xwym5nc" path="res://shaders/chroma_key.gdshader" id="3_fhs1y"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_fhs1y"]
|
||||
resource_name = "AllegianceIndicatorManager"
|
||||
script/source = "extends Sprite2D
|
||||
|
||||
|
||||
func _on_unit_unit_allegiance_changed(unit: Unit, allegiance: UnitAllegiance) -> void:
|
||||
self_modulate = allegiance.color
|
||||
"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_4j20j"]
|
||||
shader = ExtResource("3_fhs1y")
|
||||
shader_parameter/threshold = 0.01
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_on614"]
|
||||
atlas = ExtResource("2_on614")
|
||||
region = Rect2(144, 240, 48, 48)
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_on614"]
|
||||
resource_name = "UnitSelectorHandler"
|
||||
script/source = "extends ColorRect
|
||||
|
||||
func _unit_selected_changed(_unit: Unit, selected: bool) -> void:
|
||||
visible = selected
|
||||
"
|
||||
|
||||
[node name="Unit" type="Node2D" unique_id=1893234933 groups=["units"]]
|
||||
script = ExtResource("1_cq4v0")
|
||||
metadata/_custom_type_script = "uid://c016mxgatcpse"
|
||||
|
||||
[node name="AllegianceIndicator" type="Sprite2D" parent="." unique_id=1567439632]
|
||||
z_index = 2
|
||||
texture = ExtResource("2_fhs1y")
|
||||
offset = Vector2(24, 24)
|
||||
script = SubResource("GDScript_fhs1y")
|
||||
|
||||
[node name="UnitSprite" type="Sprite2D" parent="." unique_id=350615297]
|
||||
z_index = 1
|
||||
material = SubResource("ShaderMaterial_4j20j")
|
||||
texture = SubResource("AtlasTexture_on614")
|
||||
offset = Vector2(24, 24)
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="." unique_id=1313394023]
|
||||
visible = false
|
||||
offset_right = 48.0
|
||||
offset_bottom = 48.0
|
||||
color = Color(1, 1, 0.3019608, 0.36078432)
|
||||
script = SubResource("GDScript_on614")
|
||||
|
||||
[connection signal="unit_allegiance_changed" from="." to="AllegianceIndicator" method="_on_unit_unit_allegiance_changed"]
|
||||
[connection signal="unit_selected_changed" from="." to="ColorRect" method="_unit_selected_changed"]
|
||||
Reference in New Issue
Block a user