wolf and tooltips
This commit is contained in:
parent
3644800a64
commit
b8333f5ac3
@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dl0d1m1gfcd4o"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://dl0d1m1gfcd4o"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://f7n8gd1wlv4v" path="res://Scenes/Player/UI/spawnable_button.tscn" id="1_tvnet"]
|
||||
[ext_resource type="PackedScene" uid="uid://brnx3xyyd0e71" path="res://Scenes/Spawnables/bat_spawnable.tscn" id="2_borla"]
|
||||
[ext_resource type="Texture2D" uid="uid://ddvr5ltbo8ome" path="res://Assets/Bat/noBKG_BatFlight_strip.png" id="3_5io10"]
|
||||
[ext_resource type="Theme" uid="uid://dr1h7to56a2pv" path="res://Themes/base_theme.tres" id="4_nd7nb"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_if561"]
|
||||
resource_local_to_scene = true
|
||||
@ -18,5 +19,32 @@ texture = SubResource("AtlasTexture_if561")
|
||||
[node name="Label" parent="." index="2"]
|
||||
text = "Bat"
|
||||
|
||||
[node name="ToolTip" type="PanelContainer" parent="." index="3"]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 12
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -10.0
|
||||
offset_top = -91.0
|
||||
offset_right = -10.0
|
||||
offset_bottom = -55.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("4_nd7nb")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="ToolTipLabel" type="Label" parent="ToolTip" index="0"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 1
|
||||
text = "Attack : 100
|
||||
HP: 30
|
||||
"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 2
|
||||
|
||||
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://dmvukn3rl6gbx"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://dmvukn3rl6gbx"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scenes/Player/UI/player_ui.gd" id="1_4nwdk"]
|
||||
[ext_resource type="PackedScene" uid="uid://dl0d1m1gfcd4o" path="res://Scenes/Player/UI/bat_button.tscn" id="1_tnnk6"]
|
||||
@ -9,6 +9,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://djjqhipuo3byw" path="res://Assets/Knight/noBKG_KnightShield_strip.png" id="5_t0ay2"]
|
||||
[ext_resource type="Texture2D" uid="uid://iy5flm8rgj60" path="res://Assets/Inverted hourglass1.png" id="5_vr1sw"]
|
||||
[ext_resource type="Texture2D" uid="uid://p3scltkq3g87" path="res://Assets/16.png" id="6_id56p"]
|
||||
[ext_resource type="PackedScene" uid="uid://5yfkysexanoh" path="res://Scenes/Player/UI/wolf_button.tscn" id="10_igs07"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_v6oad"]
|
||||
bg_color = Color(0.243137, 0.713726, 0.0627451, 0.301961)
|
||||
@ -297,13 +298,12 @@ layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="SpawnableButton" parent="UIRoot/ControlPanel/ButtonPanel" instance=ExtResource("1_tnnk6")]
|
||||
[node name="BatButton" parent="UIRoot/ControlPanel/ButtonPanel" instance=ExtResource("1_tnnk6")]
|
||||
layout_mode = 2
|
||||
button_group = ExtResource("3_7a133")
|
||||
|
||||
[node name="SpawnableButton2" parent="UIRoot/ControlPanel/ButtonPanel" instance=ExtResource("1_tnnk6")]
|
||||
[node name="WolfButton" parent="UIRoot/ControlPanel/ButtonPanel" instance=ExtResource("10_igs07")]
|
||||
layout_mode = 2
|
||||
button_group = ExtResource("3_7a133")
|
||||
|
||||
[node name="SpawnableButton3" parent="UIRoot/ControlPanel/ButtonPanel" instance=ExtResource("1_tnnk6")]
|
||||
layout_mode = 2
|
||||
|
@ -5,6 +5,8 @@ extends Button
|
||||
|
||||
@onready var animationPlayer : AnimationPlayer = $AnimationPlayer
|
||||
@onready var label : Label = $Label
|
||||
@onready var toolTip : Control = $ToolTip
|
||||
@onready var toolTipLabel : Label = $ToolTip/ToolTipLabel
|
||||
|
||||
func _ready():
|
||||
if spawnableScene == null:
|
||||
@ -12,12 +14,26 @@ func _ready():
|
||||
|
||||
var temp : TemplateSpawnable = spawnableScene.instantiate()
|
||||
label.text = str(temp.monsterName) + " (" + str(temp.cost) + ")"
|
||||
generate_tooltip(temp)
|
||||
temp.queue_free()
|
||||
|
||||
|
||||
func _on_mouse_entered():
|
||||
animationPlayer.play("AnimateTextureRect")
|
||||
|
||||
toolTip.visible = true
|
||||
|
||||
func _on_mouse_exited():
|
||||
animationPlayer.stop()
|
||||
toolTip.visible = false
|
||||
|
||||
func generate_tooltip(monster : TemplateSpawnable):
|
||||
var toolTipText = """-{monsterName}-
|
||||
HP: {hp}
|
||||
Mv. Spd: {spd}
|
||||
Dmg: {dmg}
|
||||
Atk Spd: {atkSpd}
|
||||
Cost: {cost}
|
||||
Blud Gen: {bludGen}/s
|
||||
"""
|
||||
|
||||
toolTipLabel.text = toolTipText.format({"monsterName" : monster.monsterName, "hp" : monster.maxHp, "spd" : monster.speed, "dmg" : monster.damage, "atkSpd" : monster.attackSpeed, "cost" : monster.cost, "bludGen" : monster.BludGen})
|
||||
|
132
Scenes/Player/UI/wolf_button.tscn
Normal file
132
Scenes/Player/UI/wolf_button.tscn
Normal file
@ -0,0 +1,132 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://5yfkysexanoh"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://dr1h7to56a2pv" path="res://Themes/base_theme.tres" id="1_kk4l4"]
|
||||
[ext_resource type="ButtonGroup" uid="uid://gjbbywsr8n8b" path="res://Scenes/Player/UI/spawnables_button_group.tres" id="2_auklo"]
|
||||
[ext_resource type="Script" path="res://Scenes/Player/UI/spawnable_button.gd" id="2_okrsl"]
|
||||
[ext_resource type="Texture2D" uid="uid://dd1cbeyvlpn53" path="res://Assets/Wolf/noBKG_WolfIdle_strip.png" id="3_fyifb"]
|
||||
[ext_resource type="PackedScene" uid="uid://35re5c6wyhp5" path="res://Scenes/Spawnables/wolf_spawnable.tscn" id="3_t78cg"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ys2lk"]
|
||||
atlas = ExtResource("3_fyifb")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_r6yl2"]
|
||||
resource_name = "AnimateTextureRect"
|
||||
length = 1.00001
|
||||
loop_mode = 1
|
||||
step = 0.0833333
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("AnimatedTextureRect:texture:region")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666667, 0.75, 0.833333, 0.916667),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [Rect2(0, 0, 64, 64), Rect2(64, 0, 64, 64), Rect2(128, 0, 64, 64), Rect2(192, 0, 64, 64), Rect2(256, 0, 64, 64), Rect2(320, 0, 64, 64), Rect2(384, 0, 64, 64), Rect2(448, 0, 64, 64), Rect2(512, 0, 64, 64), Rect2(576, 0, 64, 64), Rect2(640, 0, 64, 64), Rect2(704, 0, 64, 64)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_tak1b"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("AnimatedTextureRect:texture:region")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Rect2(0, 0, 64, 64)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_0o4ue"]
|
||||
_data = {
|
||||
"AnimateTextureRect": SubResource("Animation_r6yl2"),
|
||||
"RESET": SubResource("Animation_tak1b")
|
||||
}
|
||||
|
||||
[node name="WolfButton" type="Button"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -854.0
|
||||
offset_bottom = -499.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
focus_mode = 0
|
||||
mouse_default_cursor_shape = 2
|
||||
theme = ExtResource("1_kk4l4")
|
||||
toggle_mode = true
|
||||
button_group = ExtResource("2_auklo")
|
||||
script = ExtResource("2_okrsl")
|
||||
spawnableScene = ExtResource("3_t78cg")
|
||||
|
||||
[node name="AnimatedTextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = -1.78302
|
||||
anchor_top = -0.414634
|
||||
anchor_right = 2.78302
|
||||
anchor_bottom = 1.14634
|
||||
offset_left = 210.0
|
||||
offset_right = -210.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = SubResource("AtlasTexture_ys2lk")
|
||||
stretch_mode = 5
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_0o4ue")
|
||||
}
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 12
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -18.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
theme = ExtResource("1_kk4l4")
|
||||
text = "Wolf"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ToolTip" type="PanelContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 12
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -10.0
|
||||
offset_top = -91.0
|
||||
offset_right = -10.0
|
||||
offset_bottom = -55.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("1_kk4l4")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="ToolTipLabel" type="Label" parent="ToolTip"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 1
|
||||
text = "Attack : 100
|
||||
HP: 30
|
||||
"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 2
|
||||
|
||||
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
|
@ -1,10 +1,11 @@
|
||||
[gd_scene load_steps=54 format=3 uid="uid://35re5c6wyhp5"]
|
||||
[gd_scene load_steps=55 format=3 uid="uid://35re5c6wyhp5"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://kkfxguj0lr5a" path="res://Scenes/Spawnables/template_spawnable.tscn" id="1_t7ryl"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnch5lviqbpka" path="res://Assets/Wolf/noBKG_WolfRun_strip.png" id="2_35toa"]
|
||||
[ext_resource type="Texture2D" uid="uid://bvscc18reoyoo" path="res://Assets/Wolf/noBKG_WolfAttack_strip.png" id="2_arbvu"]
|
||||
[ext_resource type="Texture2D" uid="uid://dd1cbeyvlpn53" path="res://Assets/Wolf/noBKG_WolfIdle_strip.png" id="2_bk8d7"]
|
||||
[ext_resource type="Texture2D" uid="uid://cowhod231qvc7" path="res://Assets/Wolf/noBKG_WolfDeath_strip.png" id="3_tbpyw"]
|
||||
[ext_resource type="Script" path="res://Scenes/Spawnables/AIs/ai_bat.gd" id="6_g2ost"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_n1jpo"]
|
||||
atlas = ExtResource("2_bk8d7")
|
||||
@ -353,7 +354,8 @@ offset_bottom = 2.0
|
||||
[node name="AnimatedSprite2D" parent="." index="1"]
|
||||
sprite_frames = SubResource("SpriteFrames_iknep")
|
||||
animation = &"default"
|
||||
frame_progress = 0.996176
|
||||
frame = 0
|
||||
frame_progress = 0.398233
|
||||
|
||||
[node name="BodyCollision" parent="." index="2"]
|
||||
shape = SubResource("CapsuleShape2D_oxc6d")
|
||||
@ -366,6 +368,9 @@ shape = SubResource("CapsuleShape2D_sx05l")
|
||||
position = Vector2(14, 1)
|
||||
shape = SubResource("CapsuleShape2D_dmcm0")
|
||||
|
||||
[node name="AI" parent="." index="5"]
|
||||
script = ExtResource("6_g2ost")
|
||||
|
||||
[node name="LightOccluder2D" parent="." index="7"]
|
||||
position = Vector2(3, 0)
|
||||
occluder = SubResource("OccluderPolygon2D_jmta4")
|
||||
|
@ -1,7 +1,19 @@
|
||||
[gd_resource type="Theme" load_steps=4 format=3 uid="uid://dr1h7to56a2pv"]
|
||||
[gd_resource type="Theme" load_steps=5 format=3 uid="uid://dr1h7to56a2pv"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://01mccw37teq2" path="res://Assets/Fonts/alagard.ttf" id="1_i16b1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yxoll"]
|
||||
bg_color = Color(0.231373, 0.254902, 0.588235, 0.396078)
|
||||
skew = Vector2(-0.25, -0.01)
|
||||
border_color = Color(0, 0, 0, 1)
|
||||
corner_radius_bottom_left = 25
|
||||
corner_detail = 1
|
||||
expand_margin_bottom = 10.0
|
||||
shadow_color = Color(0.258824, 0.258824, 0.258824, 0.678431)
|
||||
shadow_size = 3
|
||||
shadow_offset = Vector2(3, 3)
|
||||
anti_aliasing_size = 0.776
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hf10d"]
|
||||
bg_color = Color(0.403922, 0.0117647, 0.0627451, 0.188235)
|
||||
|
||||
@ -10,5 +22,6 @@ bg_color = Color(0.803922, 0.152941, 0.188235, 1)
|
||||
|
||||
[resource]
|
||||
Label/fonts/font = ExtResource("1_i16b1")
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxFlat_yxoll")
|
||||
ProgressBar/styles/background = SubResource("StyleBoxFlat_hf10d")
|
||||
ProgressBar/styles/fill = SubResource("StyleBoxFlat_jy7e3")
|
||||
|
Loading…
Reference in New Issue
Block a user