From ed4ddfdf5db8716715fd0d6f155a4b1b92d5f4de Mon Sep 17 00:00:00 2001 From: Bo Thompson Date: Thu, 7 Aug 2025 10:24:47 -0400 Subject: [PATCH] Work on full profile and on switching the window state --- ai/trees/adventurer.tres | 2 - game_manager.gd | 7 ++ guild.gd | 4 ++ player.gd | 2 +- profile_window.gd | 1 + profile_window.gd.uid | 1 + profile_window.tscn | 142 +++++++++++++++++++++++++++++++++++++++ project.godot | 8 ++- 8 files changed, 163 insertions(+), 4 deletions(-) create mode 100644 profile_window.gd create mode 100644 profile_window.gd.uid create mode 100644 profile_window.tscn diff --git a/ai/trees/adventurer.tres b/ai/trees/adventurer.tres index 4a8d2ca..e1a869d 100644 --- a/ai/trees/adventurer.tres +++ b/ai/trees/adventurer.tres @@ -122,14 +122,12 @@ custom_name = "Idle" [sub_resource type="BTProbability" id="BTProbability_gc1l4"] children = [SubResource("BTWait_8lwgx")] -_enabled = false [sub_resource type="BTAction" id="BTAction_jq6fo"] script = ExtResource("2_fe6jf") [sub_resource type="BTProbability" id="BTProbability_8lwgx"] children = [SubResource("BTAction_jq6fo")] -_enabled = false [sub_resource type="BTProbabilitySelector" id="BTProbabilitySelector_mtixs"] children = [SubResource("BTProbability_s3kkm"), SubResource("BTProbability_1441p"), SubResource("BTProbability_gc1l4"), SubResource("BTProbability_8lwgx")] diff --git a/game_manager.gd b/game_manager.gd index 98b45ac..53ac87a 100644 --- a/game_manager.gd +++ b/game_manager.gd @@ -32,6 +32,13 @@ func setup_visitor_ui(spawner: VisitorSpawner)-> void: func end_shift() -> void: active = false panel.switch_panel(active) + var window = get_window() + window.mode = Window.MODE_WINDOWED + window.position = Vector2i(800,800) + window.content_scale_size = Vector2i(345,500) + top_menu.hide() + panel.get_parent().global_position = Vector2i(5,5) + window.size = Vector2i(345,500) func notice(msg : String, time : float = 1) -> void: panel.notice(msg, time) diff --git a/guild.gd b/guild.gd index 12b0dc7..f75da8d 100644 --- a/guild.gd +++ b/guild.gd @@ -24,6 +24,10 @@ var members : Array[AdventurerData] = [] var quests : Dictionary[Quest,bool] = {} var hall : Guildhall = null var visitor_spawner : VisitorSpawner = null +var gold : int +var vault : Array = [] + + func _ready() -> void: var file = FileAccess.open("res://data/names/surnames.txt", FileAccess.READ) diff --git a/player.gd b/player.gd index bf6b550..4ddeb04 100644 --- a/player.gd +++ b/player.gd @@ -55,7 +55,7 @@ func approach(pos : Vector2) -> void: func approach_and_interact(obj : Interactable) -> void: var t : Vector2 = obj.global_position - if obj.has("queue") and obj.queue != null: + if "queue" in obj and obj.queue != null: t = obj.queue.global_position set_movement_target(obj.global_position) nav_agent.target_desired_distance = interaction_range - 5 diff --git a/profile_window.gd b/profile_window.gd new file mode 100644 index 0000000..d248fb8 --- /dev/null +++ b/profile_window.gd @@ -0,0 +1 @@ +extends Window diff --git a/profile_window.gd.uid b/profile_window.gd.uid new file mode 100644 index 0000000..533f49e --- /dev/null +++ b/profile_window.gd.uid @@ -0,0 +1 @@ +uid://dpws8rq811nt8 diff --git a/profile_window.tscn b/profile_window.tscn new file mode 100644 index 0000000..b96c6b8 --- /dev/null +++ b/profile_window.tscn @@ -0,0 +1,142 @@ +[gd_scene load_steps=2 format=3 uid="uid://djhq68y24p5px"] + +[ext_resource type="Texture2D" uid="uid://biir7hjo6b4nl" path="res://adventurer-profile-pic.png" id="1_4aa5t"] + +[node name="Profile Window" type="Window"] +oversampling_override = 1.0 +size = Vector2i(210, 265) +wrap_controls = true +unresizable = true +popup_window = true + +[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("1_4aa5t") + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +theme_override_constants/separation = -4 + +[node name="ClassLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/line_spacing = 0 +text = "Class" + +[node name="LevelLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] +layout_mode = 2 +text = "Lv ##" + +[node name="ExpLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] +layout_mode = 2 +theme_override_constants/line_spacing = 0 +text = "Exp: ##/##" + +[node name="LifeLabel" type="Label" parent="MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +text = "Life: ####/####" + +[node name="EnergyLabel" type="Label" parent="MarginContainer/VBoxContainer"] +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"] +layout_mode = 2 +text = "Stat: ##" + +[node name="INTLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer"] +layout_mode = 2 +text = "Stat: ##" + +[node name="DEXLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer"] +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"] +layout_mode = 2 +text = "Stat: ##" + +[node name="FAILabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +layout_mode = 2 +text = "Stat: ##" + +[node name="LUKLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer2/VBoxContainer2"] +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("1_4aa5t") + +[node name="ArmorIcon" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +texture = ExtResource("1_4aa5t") + +[node name="AccessoryIcon" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +texture = ExtResource("1_4aa5t") + +[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("1_4aa5t") +expand_mode = 1 + +[node name="Sprite2D2" type="TextureRect" parent="MarginContainer/VBoxContainer/ConsumableList"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +texture = ExtResource("1_4aa5t") +expand_mode = 1 + +[node name="Sprite2D3" type="TextureRect" parent="MarginContainer/VBoxContainer/ConsumableList"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +texture = ExtResource("1_4aa5t") +expand_mode = 1 + +[node name="Sprite2D4" type="TextureRect" parent="MarginContainer/VBoxContainer/ConsumableList"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +texture = ExtResource("1_4aa5t") +expand_mode = 1 + +[node name="Sprite2D5" type="TextureRect" parent="MarginContainer/VBoxContainer/ConsumableList"] +custom_minimum_size = Vector2(32, 32) +layout_mode = 2 +texture = ExtResource("1_4aa5t") +expand_mode = 1 diff --git a/project.godot b/project.godot index f9ee753..872f216 100644 --- a/project.godot +++ b/project.godot @@ -24,7 +24,8 @@ Game="*res://game_manager.gd" window/size/viewport_width=1920 window/size/viewport_height=1080 window/size/resizable=false -window/stretch/mode="canvas_items" +window/size/maximize_disabled=true +window/stretch/mode="viewport" [dotnet] @@ -37,6 +38,11 @@ project/assembly_name="pomchronicles" "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194332,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } +test={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194333,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} [limbo_ai]