From 4e0b42eb23c7e390eb19ebcfe715686700fe0d3a Mon Sep 17 00:00:00 2001 From: Bo Thompson Date: Fri, 8 Aug 2025 15:01:55 -0400 Subject: [PATCH] Basic Full Profiles working from log --- .gitignore | 4 +- adventurer_data.gd | 14 ++- ai/tasks/actions/use_guild_equipment.gd | 1 - ai/tasks/actions/use_guild_service.gd | 1 - member_panel_entry.gd | 8 +- npc_profile_window.gd | 39 ++++++ npc_profile_window.gd.uid | 1 + npc_profile_window.tscn | 160 ++++++++++++++++++++++++ project.godot | 4 + 9 files changed, 226 insertions(+), 6 deletions(-) create mode 100644 npc_profile_window.gd create mode 100644 npc_profile_window.gd.uid create mode 100644 npc_profile_window.tscn diff --git a/.gitignore b/.gitignore index c026d40..4e2f20c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ /android/ #limboai ignores /addons/limboai/ -/demo/ \ No newline at end of file +/demo/ +#TODO manager ignores +/addons/Todo_Manager/ diff --git a/adventurer_data.gd b/adventurer_data.gd index d954658..4f78244 100644 --- a/adventurer_data.gd +++ b/adventurer_data.gd @@ -1,10 +1,19 @@ class_name AdventurerData extends Node +class StatBlock: + var STR : int = 1 + var DEX : int = 1 + var INT : int = 1 + var CHA : int = 1 + var FAI : int = 1 + var LUK : int = 1 + enum Gender{ MASC, FEMME, NONBINARY } + var given_name : String = "Test" var surname : String = "Testing" var gender : Gender = Gender.MASC @@ -14,9 +23,12 @@ var energy : int = 1 var max_energy : int = 1 var level : int = 1 var job : JobData - +var stats : StatBlock var quest : Quest +func _init() -> void: + stats = StatBlock.new() + func assign_quest(quest : Quest) -> void: self.quest = quest quest.initiate(self) diff --git a/ai/tasks/actions/use_guild_equipment.gd b/ai/tasks/actions/use_guild_equipment.gd index dfe376c..8d73534 100644 --- a/ai/tasks/actions/use_guild_equipment.gd +++ b/ai/tasks/actions/use_guild_equipment.gd @@ -84,7 +84,6 @@ func _on_navigation_failed() -> void: func interact(): phase = Phases.INTERACT wait_time_remaining = randf_range(2,5) - #TODO: Make them both do the talking emoji equipment.busy = true agent.show_speech_bubble("busy") diff --git a/ai/tasks/actions/use_guild_service.gd b/ai/tasks/actions/use_guild_service.gd index c2b7164..b79acf8 100644 --- a/ai/tasks/actions/use_guild_service.gd +++ b/ai/tasks/actions/use_guild_service.gd @@ -84,7 +84,6 @@ func _on_navigation_failed() -> void: func use_service(): phase = Phases.SERVICE wait_time_remaining = randf_range(2,5) - #TODO: Make them both do the talking emoji agent.show_speech_bubble("talk") employee.show_speech_bubble("talk") diff --git a/member_panel_entry.gd b/member_panel_entry.gd index 659c834..003c324 100644 --- a/member_panel_entry.gd +++ b/member_panel_entry.gd @@ -1,6 +1,6 @@ extends PanelContainer - +const npc_profile_window_template = preload("res://npc_profile_window.tscn") var _enabled: bool var enabled: bool: get: @@ -29,4 +29,8 @@ func setup(member : AdventurerData) -> void: func _on_gui_input(event: InputEvent) -> void: var evt = event as InputEventMouseButton if evt and evt.button_index == MOUSE_BUTTON_LEFT and evt.pressed: - print("Member clicked!") + var window : Window = npc_profile_window_template.instantiate() + Game.add_child(window) + window.setup(data) + window.popup_centered() + window.grab_focus() diff --git a/npc_profile_window.gd b/npc_profile_window.gd new file mode 100644 index 0000000..70ade03 --- /dev/null +++ b/npc_profile_window.gd @@ -0,0 +1,39 @@ +extends Window + +var data : AdventurerData +@onready var jobLabel = %JobLabel +@onready var expLabel : Label = %ExpLabel +@onready var levelLabel :Label = %LevelLabel +@onready var lifeLabel :Label = %LifeLabel +@onready var energyLabel :Label = %EnergyLabel + +@onready var strLabel :Label = %STRLabel +@onready var dexLabel :Label = %DEXLabel +@onready var intLabel :Label = %INTLabel +@onready var chaLabel :Label = %CHALabel +@onready var faiLabel :Label = %FAILabel +@onready var lukLabel :Label = %LUKLabel + + +func setup(adv : AdventurerData) -> void: + data = adv + title = data.full_name() + if data.job: + jobLabel.text = data.job.name + else: + jobLabel.text = "ERROR" + levelLabel.text = str(data.level) + #TODO: Implement Experience + expLabel.text = "Exp: 0/10" + lifeLabel.text = "Life: " + str(data.life) + "/" + str(data.max_life) + energyLabel.text = "Energy: " + str(data.energy) + "/" + str(data.max_energy) + strLabel.text = "STR: " + str(data.stats.STR) + dexLabel.text = "DEX: " + str(data.stats.DEX) + intLabel.text = "INT: " + str(data.stats.INT) + chaLabel.text = "CHA: " + str(data.stats.CHA) + faiLabel.text = "FAI: " + str(data.stats.FAI) + lukLabel.text = "LUK: " + str(data.stats.LUK) + #TODO: Show equipment + +func _on_close_requested() -> void: + queue_free() diff --git a/npc_profile_window.gd.uid b/npc_profile_window.gd.uid new file mode 100644 index 0000000..e7db64c --- /dev/null +++ b/npc_profile_window.gd.uid @@ -0,0 +1 @@ +uid://ccsiubi5y75qg diff --git a/npc_profile_window.tscn b/npc_profile_window.tscn new file mode 100644 index 0000000..06b1549 --- /dev/null +++ b/npc_profile_window.tscn @@ -0,0 +1,160 @@ +[gd_scene load_steps=3 format=3 uid="uid://bktxswsjql86p"] + +[ext_resource type="Script" uid="uid://ccsiubi5y75qg" path="res://npc_profile_window.gd" id="1_5tv47"] +[ext_resource type="Texture2D" uid="uid://biir7hjo6b4nl" path="res://adventurer-profile-pic.png" id="2_vyrgt"] + +[node name="Profile Window" type="Window"] +oversampling_override = 1.0 +initial_position = 1 +size = Vector2i(210, 265) +wrap_controls = true +unresizable = true +always_on_top = true +popup_window = true +script = ExtResource("1_5tv47") + +[node name="MarginContainer" type="MarginContainer" parent="."] +anchors_preset = -1 +offset_right = 40.0 +offset_bottom = 50.0 +theme_override_constants/margin_left = 3 +theme_override_constants/margin_top = 4 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 0 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Sprite2D" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +texture = ExtResource("2_vyrgt") + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = -4 + +[node name="JobLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_constants/line_spacing = 0 +text = "Class" + +[node name="LevelLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Lv ##" + +[node name="ExpLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_constants/line_spacing = 0 +text = "Exp: ##/##" + +[node name="LifeLabel" type="Label" parent="MarginContainer/VBoxContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +text = "Life: ####/####" + +[node name="EnergyLabel" type="Label" parent="MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_constants/line_spacing = 0 +text = "Energy: ####/####" + +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_constants/separation = -8 + +[node name="STRLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Stat: ##" + +[node name="INTLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Stat: ##" + +[node name="DEXLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Stat: ##" + +[node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +theme_override_constants/separation = -8 + +[node name="CHALabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +unique_name_in_owner = true +layout_mode = 2 +text = "Stat: ##" + +[node name="FAILabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +unique_name_in_owner = true +layout_mode = 2 +text = "Stat: ##" + +[node name="LUKLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +unique_name_in_owner = true +layout_mode = 2 +text = "Stat: ##" + +[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="WeaponIcon" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +texture = ExtResource("2_vyrgt") + +[node name="ArmorIcon" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +texture = ExtResource("2_vyrgt") + +[node name="AccessoryIcon" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +texture = ExtResource("2_vyrgt") + +[node name="ConsumableList" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +alignment = 1 + +[node name="Sprite2D" type="TextureRect" parent="MarginContainer/VBoxContainer/ConsumableList"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +texture = ExtResource("2_vyrgt") +expand_mode = 1 + +[node name="Sprite2D2" type="TextureRect" parent="MarginContainer/VBoxContainer/ConsumableList"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +texture = ExtResource("2_vyrgt") +expand_mode = 1 + +[node name="Sprite2D3" type="TextureRect" parent="MarginContainer/VBoxContainer/ConsumableList"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +texture = ExtResource("2_vyrgt") +expand_mode = 1 + +[node name="Sprite2D4" type="TextureRect" parent="MarginContainer/VBoxContainer/ConsumableList"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +texture = ExtResource("2_vyrgt") +expand_mode = 1 + +[node name="Sprite2D5" type="TextureRect" parent="MarginContainer/VBoxContainer/ConsumableList"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +texture = ExtResource("2_vyrgt") +expand_mode = 1 + +[connection signal="close_requested" from="." to="." method="_on_close_requested"] +[connection signal="focus_exited" from="." to="." method="_on_close_requested"] diff --git a/project.godot b/project.godot index 872f216..622e577 100644 --- a/project.godot +++ b/project.godot @@ -31,6 +31,10 @@ window/stretch/mode="viewport" project/assembly_name="pomchronicles" +[editor_plugins] + +enabled=PackedStringArray("res://addons/Todo_Manager/plugin.cfg") + [input] "switch modes"={