From 4ffdf60e2b8c6c816330c3a3954de2c91b87bf9b Mon Sep 17 00:00:00 2001 From: Bo Thompson Date: Fri, 8 Aug 2025 14:08:58 -0400 Subject: [PATCH] More quest progress work --- game_manager.gd | 5 ++++- guild.gd | 1 - main_panel.gd | 3 +++ main_panel.tscn | 34 +++++++++++++++++++--------------- quest_board.tscn | 1 + 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/game_manager.gd b/game_manager.gd index 53ac87a..e25c5f5 100644 --- a/game_manager.gd +++ b/game_manager.gd @@ -8,6 +8,7 @@ var active : bool = true var end_shift_confirmation : ConfirmationDialog var end_shift_confirm_template = preload("res://end_shift_confirmation.tscn") func _ready() -> void: + DisplayServer.register_additional_output(self) end_shift_confirmation = end_shift_confirm_template.instantiate() add_child(end_shift_confirmation) #var file =FileAccess.open("res://name.txt",FileAccess.READ) @@ -18,7 +19,6 @@ func _process(delta: float) -> void: if active and Input.is_action_just_pressed("switch modes"): confirm_end_shift() - func add_quest_progress_bar(quest : Quest) -> void: panel.add_quest_progress_bar(quest) @@ -39,6 +39,9 @@ func end_shift() -> void: top_menu.hide() panel.get_parent().global_position = Vector2i(5,5) window.size = Vector2i(345,500) + for quest in Guild.quests: + if quest.taken: + add_quest_progress_bar(quest) func notice(msg : String, time : float = 1) -> void: panel.notice(msg, time) diff --git a/guild.gd b/guild.gd index f75da8d..79b5d3b 100644 --- a/guild.gd +++ b/guild.gd @@ -70,7 +70,6 @@ func add_quest(quest : Quest) -> void: func assign_quest(member : AdventurerData, quest : Quest) -> void: member.assign_quest(quest) quests[quest] = true #Mark it as active - Game.add_quest_progress_bar(quest) func spawn_visitor(pos : Vector2) -> void: var data : AdventurerData = visitors["test"].data.instantiate() diff --git a/main_panel.gd b/main_panel.gd index 24de89b..77cce54 100644 --- a/main_panel.gd +++ b/main_panel.gd @@ -26,7 +26,10 @@ func add_quest_progress_bar(quest : Quest) -> void: func switch_panel(active : bool) -> void: %OpenShift.visible = active %WorkingShift.visible = !active + %Timer.wait_time = 1500 if active else 300 +func _on_show_quests_pressed() -> void: + %QuestProgressList.visible = !%QuestProgressList.visible func _on_end_shift_pressed() -> void: Game.confirm_end_shift() diff --git a/main_panel.tscn b/main_panel.tscn index bf0f5a8..95cc893 100644 --- a/main_panel.tscn +++ b/main_panel.tscn @@ -27,20 +27,9 @@ theme_override_constants/margin_right = 0 script = ExtResource("1_pdekv") [node name="Timer" type="Timer" parent="."] -wait_time = 400000.0 -autostart = true - -[node name="QuestProgressList" type="ScrollContainer" parent="."] -visible = false -clip_contents = false -custom_minimum_size = Vector2(260, 100) -layout_mode = 2 -horizontal_scroll_mode = 0 - -[node name="QuestList" type="VBoxContainer" parent="QuestProgressList"] unique_name_in_owner = true -custom_minimum_size = Vector2(300, 100) -layout_mode = 2 +wait_time = 300.0 +autostart = true [node name="VBoxContainer" type="VBoxContainer" parent="."] layout_mode = 2 @@ -116,10 +105,25 @@ layout_mode = 2 theme_override_styles/normal = SubResource("StyleBoxFlat_q6wja") text = "Show Quests" +[node name="QuestProgressList" type="ScrollContainer" parent="VBoxContainer"] +unique_name_in_owner = true +visible = false +clip_contents = false +custom_minimum_size = Vector2(260, 100) +layout_mode = 2 +horizontal_scroll_mode = 0 + +[node name="QuestList" type="VBoxContainer" parent="VBoxContainer/QuestProgressList"] +unique_name_in_owner = true +custom_minimum_size = Vector2(300, 100) +layout_mode = 2 +alignment = 1 + [node name="Notices" type="VBoxContainer" parent="VBoxContainer"] unique_name_in_owner = true layout_mode = 2 [connection signal="time_changed" from="." to="VBoxContainer/OpenShift/Margin/OpenList/TimerLabel" method="_on_time_changed"] -[connection signal="pressed" from="VBoxContainer/OpenShift/Margin/OpenList/Button" to="VBoxContainer/OpenShift" method="_on_end_shift_pressed"] -[connection signal="pressed" from="VBoxContainer/WorkingShift/MarginContainer/WorkingList/Button" to="VBoxContainer/OpenShift" method="_on_end_shift_pressed"] +[connection signal="time_changed" from="." to="VBoxContainer/WorkingShift/MarginContainer/WorkingList/TimerLabel" method="_on_time_changed"] +[connection signal="pressed" from="VBoxContainer/OpenShift/Margin/OpenList/Button" to="." method="_on_end_shift_pressed"] +[connection signal="pressed" from="VBoxContainer/WorkingShift/MarginContainer/WorkingList/Button" to="." method="_on_show_quests_pressed"] diff --git a/quest_board.tscn b/quest_board.tscn index 10ab907..b9e0915 100644 --- a/quest_board.tscn +++ b/quest_board.tscn @@ -12,6 +12,7 @@ script = ExtResource("1_38mwx") [node name="QuestBoardWindow" parent="." instance=ExtResource("1_4poi3")] +visible = false [node name="Sprite2D" type="Sprite2D" parent="."] position = Vector2(0, -64)