More quest progress work
This commit is contained in:
@@ -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)
|
||||
|
||||
1
guild.gd
1
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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user