From a37e8f5976f99b50f0af2c8616c07650b8477c43 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 4 Aug 2020 19:29:16 +0200 Subject: [PATCH] Added weapon damage stats. Also work on the character window. --- game/project.godot | 2 +- game/ui/player_ui/player_ui.tscn | 2 +- game/ui/windows/CharacterWindow.gd | 12 ++++++++++++ game/ui/windows/CharacterWindow.tscn | 25 +++++-------------------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/game/project.godot b/game/project.godot index 5148e6aa..f5e4bed3 100644 --- a/game/project.godot +++ b/game/project.godot @@ -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" +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 ) diff --git a/game/ui/player_ui/player_ui.tscn b/game/ui/player_ui/player_ui.tscn index 2685173a..f3bfcfaf 100644 --- a/game/ui/player_ui/player_ui.tscn +++ b/game/ui/player_ui/player_ui.tscn @@ -368,7 +368,7 @@ anchor_right = 0.0 anchor_bottom = 0.0 margin_left = 66.0 margin_top = 44.0 -margin_right = 681.0 +margin_right = 323.0 margin_bottom = 474.0 opener_button_path = NodePath("../../Buttons/CharacterButton") diff --git a/game/ui/windows/CharacterWindow.gd b/game/ui/windows/CharacterWindow.gd index 08b058d2..3ad8c3a9 100644 --- a/game/ui/windows/CharacterWindow.gd +++ b/game/ui/windows/CharacterWindow.gd @@ -3,9 +3,21 @@ extends PanelContainer export(NodePath) var opener_button_path : NodePath var opener_button : BaseButton +export(NodePath) var container_path : NodePath +var container : Node + +var _player : Entity + func _ready(): opener_button = get_node_or_null(opener_button_path) as BaseButton + container = get_node(container_path) +func set_player(p_player: Entity) -> void: + _player = p_player + + for c in container.get_children(): + if c.has_method("set_player"): + c.set_player(_player) func _on_CharacterButton_toggled(button_pressed): if button_pressed: diff --git a/game/ui/windows/CharacterWindow.tscn b/game/ui/windows/CharacterWindow.tscn index 5f0f88b6..825a3bcc 100644 --- a/game/ui/windows/CharacterWindow.tscn +++ b/game/ui/windows/CharacterWindow.tscn @@ -11,6 +11,7 @@ script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false } +container_path = NodePath("VBoxContainer/HBoxContainer2/ScrollContainer/VBoxContainer") [node name="VBoxContainer" type="VBoxContainer" parent="."] margin_left = 4.0 @@ -47,29 +48,13 @@ margin_bottom = 592.0 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/HBoxContainer2"] -margin_right = 387.0 -margin_bottom = 554.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -size_flags_stretch_ratio = 0.62 - -[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2/PanelContainer"] -margin_left = 4.0 -margin_top = 4.0 -margin_right = 383.0 -margin_bottom = 550.0 - -[node name="PanelContainer2" type="PanelContainer" parent="VBoxContainer/HBoxContainer2"] -margin_left = 391.0 +[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/HBoxContainer2"] margin_right = 1016.0 margin_bottom = 554.0 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2/PanelContainer2"] -margin_left = 4.0 -margin_top = 4.0 -margin_right = 621.0 -margin_bottom = 550.0 +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2/ScrollContainer"] +margin_right = 1016.0 +size_flags_horizontal = 3 [connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="_on_Button_pressed"]