Basic Full Profiles working from log
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -3,4 +3,6 @@
|
|||||||
/android/
|
/android/
|
||||||
#limboai ignores
|
#limboai ignores
|
||||||
/addons/limboai/
|
/addons/limboai/
|
||||||
/demo/
|
/demo/
|
||||||
|
#TODO manager ignores
|
||||||
|
/addons/Todo_Manager/
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
class_name AdventurerData extends Node
|
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{
|
enum Gender{
|
||||||
MASC,
|
MASC,
|
||||||
FEMME,
|
FEMME,
|
||||||
NONBINARY
|
NONBINARY
|
||||||
}
|
}
|
||||||
|
|
||||||
var given_name : String = "Test"
|
var given_name : String = "Test"
|
||||||
var surname : String = "Testing"
|
var surname : String = "Testing"
|
||||||
var gender : Gender = Gender.MASC
|
var gender : Gender = Gender.MASC
|
||||||
@@ -14,9 +23,12 @@ var energy : int = 1
|
|||||||
var max_energy : int = 1
|
var max_energy : int = 1
|
||||||
var level : int = 1
|
var level : int = 1
|
||||||
var job : JobData
|
var job : JobData
|
||||||
|
var stats : StatBlock
|
||||||
var quest : Quest
|
var quest : Quest
|
||||||
|
|
||||||
|
func _init() -> void:
|
||||||
|
stats = StatBlock.new()
|
||||||
|
|
||||||
func assign_quest(quest : Quest) -> void:
|
func assign_quest(quest : Quest) -> void:
|
||||||
self.quest = quest
|
self.quest = quest
|
||||||
quest.initiate(self)
|
quest.initiate(self)
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ func _on_navigation_failed() -> void:
|
|||||||
func interact():
|
func interact():
|
||||||
phase = Phases.INTERACT
|
phase = Phases.INTERACT
|
||||||
wait_time_remaining = randf_range(2,5)
|
wait_time_remaining = randf_range(2,5)
|
||||||
#TODO: Make them both do the talking emoji
|
|
||||||
equipment.busy = true
|
equipment.busy = true
|
||||||
agent.show_speech_bubble("busy")
|
agent.show_speech_bubble("busy")
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ func _on_navigation_failed() -> void:
|
|||||||
func use_service():
|
func use_service():
|
||||||
phase = Phases.SERVICE
|
phase = Phases.SERVICE
|
||||||
wait_time_remaining = randf_range(2,5)
|
wait_time_remaining = randf_range(2,5)
|
||||||
#TODO: Make them both do the talking emoji
|
|
||||||
agent.show_speech_bubble("talk")
|
agent.show_speech_bubble("talk")
|
||||||
employee.show_speech_bubble("talk")
|
employee.show_speech_bubble("talk")
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
extends PanelContainer
|
extends PanelContainer
|
||||||
|
|
||||||
|
const npc_profile_window_template = preload("res://npc_profile_window.tscn")
|
||||||
var _enabled: bool
|
var _enabled: bool
|
||||||
var enabled: bool:
|
var enabled: bool:
|
||||||
get:
|
get:
|
||||||
@@ -29,4 +29,8 @@ func setup(member : AdventurerData) -> void:
|
|||||||
func _on_gui_input(event: InputEvent) -> void:
|
func _on_gui_input(event: InputEvent) -> void:
|
||||||
var evt = event as InputEventMouseButton
|
var evt = event as InputEventMouseButton
|
||||||
if evt and evt.button_index == MOUSE_BUTTON_LEFT and evt.pressed:
|
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()
|
||||||
|
|||||||
39
npc_profile_window.gd
Normal file
39
npc_profile_window.gd
Normal file
@@ -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()
|
||||||
1
npc_profile_window.gd.uid
Normal file
1
npc_profile_window.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://ccsiubi5y75qg
|
||||||
160
npc_profile_window.tscn
Normal file
160
npc_profile_window.tscn
Normal file
@@ -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"]
|
||||||
@@ -31,6 +31,10 @@ window/stretch/mode="viewport"
|
|||||||
|
|
||||||
project/assembly_name="pomchronicles"
|
project/assembly_name="pomchronicles"
|
||||||
|
|
||||||
|
[editor_plugins]
|
||||||
|
|
||||||
|
enabled=PackedStringArray("res://addons/Todo_Manager/plugin.cfg")
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
"switch modes"={
|
"switch modes"={
|
||||||
|
|||||||
Reference in New Issue
Block a user