Implemented the character window. Also fixed a typo with stats.

This commit is contained in:
Relintai 2020-08-04 20:10:01 +02:00
parent a37e8f5976
commit 02b647471b
5 changed files with 385 additions and 6 deletions

View File

@ -199,7 +199,7 @@ spells/use_spell_points=true
level/auto_learn_spells=false
data/ess_resource_db_path="res://data/resource_db.tres"
data/ess_entity_spawner_path="res://player/bs_entity_spawner.tres"
enums/stats="Agility,Strength,Stamina,Intellect,Spirit,Health,Mana,Speed,Global Cooldown,Haste,Haste Rating,Resilience,Armor,Attack Power,Spell Power,Melee Crit,Melee Crit bonus,Spell Crit,Spell Crit Bonus,Block,Parry,Damage Reduction,Melee Damage Reduction,Spell Damage Reduction,Damage Taken,Heal Taken,Melee Damage,Spell Damage,Holy Resist,Shadow Resist,Nature Resist,Fire Resist,Frost Resist,Lightning Resist,Chaos Resist,Silence Resist,Fear Resist,Stun Resist,Energy,Rage,XP Rate,Weapon Damage Min,Weapon Damage Max"
enums/stats="Agility,Strength,Stamina,Intellect,Spirit,Health,Mana,Speed,Global Cooldown,Haste,Haste Rating,Resilience,Armor,Attack Power,Spell Power,Melee Crit,Melee Crit Bonus,Spell Crit,Spell Crit Bonus,Block,Parry,Damage Reduction,Melee Damage Reduction,Spell Damage Reduction,Damage Taken,Heal Taken,Melee Damage,Spell Damage,Holy Resist,Shadow Resist,Nature Resist,Fire Resist,Frost Resist,Lightning Resist,Chaos Resist,Silence Resist,Fear Resist,Stun Resist,Energy,Rage,XP Rate,Weapon Damage Min,Weapon Damage Max"
enums/skeletons_bones=PoolStringArray( "", "root,pelvis,spine,spine_1,spine_2,neck,head,left_clavicle,left_upper_arm,left_forearm,left_hand,left_thumb_base,left_thumb_end,left_fingers_base,left_fingers_end,right_clavicle,right_upper_arm,right_forearm,right_hand,right_thumb_base,right_thumb_end,right_fingers_base,right_fingers_end,left_thigh,left_calf,left_foot,right_thigh,right_calf,right_foot" )
enums/skeletons_bone_attachment_points=PoolStringArray( "", "left_hand,right_hand,torso,root,right_hip,left_hip,spine_2,weapon_left,weapon_right,weapon_left_back,weapon_right_back,weapon_shield_left" )
xp/character_xps=PoolIntArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )

View File

@ -0,0 +1,38 @@
extends HBoxContainer
export(String) var stat_name : String
var stat_id : int
onready var stat_name_label : Label = $StatName as Label
onready var stat_value_label : Label = $Stat as Label
var _player : Entity
func _ready():
stat_id = ESS.stat_get_id(stat_name)
stat_name_label.text = stat_name
connect("visibility_changed", self, "on_visibility_changed")
func on_visibility_changed():
if _player:
stat_value_label.text = str(_player.stat_getc_current(stat_id)) + " "
else:
stat_value_label.text = str(0) + " "
func set_player(p_player: Entity) -> void:
_player = p_player
on_visibility_changed()
"""
Agility,Strength,Stamina,Intellect,Spirit,
Health,Mana,Speed,Global Cooldown,Haste,Haste Rating,
Resilience,Armor,Attack Power,Spell Power,Melee Crit,
Melee Crit Bonus,Spell Crit,Spell Crit Bonus,Block,Parry,Damage Reduction,
Melee Damage Reduction,Spell Damage Reduction,Damage Taken,Heal Taken,
Melee Damage,Spell Damage,Holy Resist,Shadow Resist,Nature Resist,
Fire Resist,Frost Resist,Lightning Resist,Chaos Resist,Silence Resist,Fear Resist,
Stun Resist,Energy,Rage,XP Rate,Weapon Damage Min,Weapon Damage Max
"""

View File

@ -0,0 +1,27 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/character/SingleStatRow.gd" type="Script" id=1]
[node name="SingleStatRow" type="HBoxContainer"]
margin_right = 1016.0
margin_bottom = 15.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="StatName" type="Label" parent="."]
margin_right = 506.0
margin_bottom = 14.0
size_flags_horizontal = 3
size_flags_vertical = 6
valign = 1
[node name="Stat" type="Label" parent="."]
margin_left = 510.0
margin_right = 1016.0
margin_bottom = 14.0
size_flags_horizontal = 3
size_flags_vertical = 6
align = 2
valign = 1

View File

@ -44,7 +44,7 @@ script = ExtResource( 1 )
__meta__ = {
"_edit_lock_": true
}
child_controls = [ NodePath("Unitframes"), NodePath("Actionbars"), NodePath("Windows/SpellBookWindow"), NodePath("Buttons"), NodePath("Castbar"), NodePath("AuraFrame"), NodePath("Windows/Inventory"), NodePath("Windows/LootWindow"), NodePath("Windows/TalentWindow"), NodePath("Windows/CraftingWindow"), NodePath("IngameMenu/KeybindWindow") ]
child_controls = [ NodePath("Unitframes"), NodePath("Actionbars"), NodePath("Windows/SpellBookWindow"), NodePath("Buttons"), NodePath("Castbar"), NodePath("AuraFrame"), NodePath("Windows/Inventory"), NodePath("Windows/LootWindow"), NodePath("Windows/TalentWindow"), NodePath("Windows/CraftingWindow"), NodePath("IngameMenu/KeybindWindow"), NodePath("Windows/CharacterWindow") ]
[node name="TouchTargetControls" type="MarginContainer" parent="GUI"]
visible = false

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/windows/CharacterWindow.gd" type="Script" id=2]
[ext_resource path="res://ui/character/SingleStatRow.tscn" type="PackedScene" id=3]
[node name="CharacterWindow" type="PanelContainer"]
anchor_right = 1.0
@ -11,7 +12,7 @@ script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
container_path = NodePath("VBoxContainer/HBoxContainer2/ScrollContainer/VBoxContainer")
container_path = NodePath("VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
@ -54,7 +55,320 @@ margin_bottom = 554.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2/ScrollContainer"]
margin_right = 1016.0
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer2/ScrollContainer"]
margin_right = 1006.0
margin_bottom = 1066.0
size_flags_horizontal = 3
custom_constants/margin_right = 8
custom_constants/margin_left = 6
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer"]
margin_left = 6.0
margin_right = 998.0
margin_bottom = 1066.0
size_flags_horizontal = 3
[node name="Agility" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_right = 992.0
stat_name = "Agility"
[node name="Strength" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 23.0
margin_right = 992.0
margin_bottom = 38.0
stat_name = "Strength"
[node name="Stamina" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 46.0
margin_right = 992.0
margin_bottom = 61.0
stat_name = "Stamina"
[node name="Intellect" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 69.0
margin_right = 992.0
margin_bottom = 84.0
stat_name = "Intellect"
[node name="Spirit" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 92.0
margin_right = 992.0
margin_bottom = 107.0
stat_name = "Spirit"
[node name="Separator" type="Control" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 115.0
margin_right = 992.0
margin_bottom = 119.0
rect_min_size = Vector2( 0, 4 )
[node name="Health" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 127.0
margin_right = 992.0
margin_bottom = 142.0
stat_name = "Health"
[node name="Mana" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 150.0
margin_right = 992.0
margin_bottom = 165.0
stat_name = "Mana"
[node name="Speed" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 173.0
margin_right = 992.0
margin_bottom = 188.0
stat_name = "Speed"
[node name="Haste" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 196.0
margin_right = 992.0
margin_bottom = 211.0
stat_name = "Haste"
[node name="HasteRating" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 219.0
margin_right = 992.0
margin_bottom = 234.0
stat_name = "Haste Rating"
[node name="Separator2" type="Control" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 242.0
margin_right = 992.0
margin_bottom = 246.0
rect_min_size = Vector2( 0, 4 )
[node name="Resilience" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 254.0
margin_right = 992.0
margin_bottom = 269.0
stat_name = "Resilience"
[node name="Armor" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 277.0
margin_right = 992.0
margin_bottom = 292.0
stat_name = "Armor"
[node name="Separator4" type="Control" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 300.0
margin_right = 992.0
margin_bottom = 304.0
rect_min_size = Vector2( 0, 4 )
[node name="AttackPower" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 312.0
margin_right = 992.0
margin_bottom = 327.0
stat_name = "Attack Power"
[node name="SpellPower" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 335.0
margin_right = 992.0
margin_bottom = 350.0
stat_name = "Spell Power"
[node name="MeleeCrit" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 358.0
margin_right = 992.0
margin_bottom = 373.0
stat_name = "Melee Crit"
[node name="MeleeCritBonus" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 381.0
margin_right = 992.0
margin_bottom = 396.0
stat_name = "Melee Crit Bonus"
[node name="SpellCrit" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 404.0
margin_right = 992.0
margin_bottom = 419.0
stat_name = "Spell Crit"
[node name="SpellCritBonus" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 427.0
margin_right = 992.0
margin_bottom = 442.0
stat_name = "Spell Crit Bonus"
[node name="Separator3" type="Control" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 450.0
margin_right = 992.0
margin_bottom = 454.0
rect_min_size = Vector2( 0, 4 )
[node name="Block" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 462.0
margin_right = 992.0
margin_bottom = 477.0
stat_name = "Block"
[node name="Parry" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 485.0
margin_right = 992.0
margin_bottom = 500.0
stat_name = "Parry"
[node name="DamageReduction" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 508.0
margin_right = 992.0
margin_bottom = 523.0
stat_name = "Damage Reduction"
[node name="MeleeDamageReduction" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 531.0
margin_right = 992.0
margin_bottom = 546.0
stat_name = "Melee Damage Reduction"
[node name="SpellDamageReduction" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 554.0
margin_right = 992.0
margin_bottom = 569.0
stat_name = "Spell Damage Reduction"
[node name="Separator5" type="Control" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 577.0
margin_right = 992.0
margin_bottom = 581.0
rect_min_size = Vector2( 0, 4 )
[node name="DamageTaken" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 589.0
margin_right = 992.0
margin_bottom = 604.0
stat_name = "Damage Taken"
[node name="HealTaken" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 612.0
margin_right = 992.0
margin_bottom = 627.0
stat_name = "Heal Taken"
[node name="Separator6" type="Control" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 635.0
margin_right = 992.0
margin_bottom = 639.0
rect_min_size = Vector2( 0, 4 )
[node name="MeleeDamage" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 647.0
margin_right = 992.0
margin_bottom = 662.0
stat_name = "Melee Damage"
[node name="SpellDamage" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 670.0
margin_right = 992.0
margin_bottom = 685.0
stat_name = "Spell Damage"
[node name="Separator7" type="Control" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 693.0
margin_right = 992.0
margin_bottom = 697.0
rect_min_size = Vector2( 0, 4 )
[node name="HolyResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 705.0
margin_right = 992.0
margin_bottom = 720.0
stat_name = "Holy Resist"
[node name="ShadowResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 728.0
margin_right = 992.0
margin_bottom = 743.0
stat_name = "Shadow Resist"
[node name="NatureResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 751.0
margin_right = 992.0
margin_bottom = 766.0
stat_name = "Nature Resist"
[node name="FireResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 774.0
margin_right = 992.0
margin_bottom = 789.0
stat_name = "Fire Resist"
[node name="FrostResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 797.0
margin_right = 992.0
margin_bottom = 812.0
stat_name = "Frost Resist"
[node name="LightningResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 820.0
margin_right = 992.0
margin_bottom = 835.0
stat_name = "Lightning Resist"
[node name="ChaosResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 843.0
margin_right = 992.0
margin_bottom = 858.0
stat_name = "Chaos Resist"
[node name="SilenceResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 866.0
margin_right = 992.0
margin_bottom = 881.0
stat_name = "Silence Resist"
[node name="FearResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 889.0
margin_right = 992.0
margin_bottom = 904.0
stat_name = "Fear Resist"
[node name="StunResist" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 912.0
margin_right = 992.0
margin_bottom = 927.0
stat_name = "Stun Resist"
[node name="Separator8" type="Control" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 935.0
margin_right = 992.0
margin_bottom = 939.0
rect_min_size = Vector2( 0, 4 )
[node name="Energy" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 947.0
margin_right = 992.0
margin_bottom = 962.0
stat_name = "Energy"
[node name="Rage" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 970.0
margin_right = 992.0
margin_bottom = 985.0
stat_name = "Rage"
[node name="XPRate" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 993.0
margin_right = 992.0
margin_bottom = 1008.0
stat_name = "XP Rate"
[node name="Separator9" type="Control" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 1016.0
margin_right = 992.0
margin_bottom = 1020.0
rect_min_size = Vector2( 0, 4 )
[node name="WeaponDamageMin" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 1028.0
margin_right = 992.0
margin_bottom = 1043.0
stat_name = "Weapon Damage Min"
[node name="WeaponDamageMax" parent="VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 1051.0
margin_right = 992.0
margin_bottom = 1066.0
stat_name = "Weapon Damage Max"
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="_on_Button_pressed"]