2024-10-18 16:17:39 -06:00
|
|
|
# TODO: convert to just combat UI, instancing appropriate zone/area
|
2024-10-21 09:51:28 -06:00
|
|
|
# BUG: elements not adjusting properly when moving to second monitor
|
2024-10-08 20:51:11 -06:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var deltaCount := 0
|
|
|
|
var enemyMoveSpeed := 5.0
|
2024-10-18 14:30:41 -06:00
|
|
|
# var questComplete := false
|
|
|
|
var canContinue := false
|
2024-10-08 20:51:11 -06:00
|
|
|
|
2024-10-09 20:55:46 -06:00
|
|
|
var middleX
|
|
|
|
var playerPos
|
|
|
|
|
2024-10-08 20:51:11 -06:00
|
|
|
|
|
|
|
func _ready() -> void:
|
2024-10-21 09:51:28 -06:00
|
|
|
if OS.is_debug_build():
|
2024-10-18 16:17:39 -06:00
|
|
|
%DebugMenu.show()
|
2024-10-20 16:44:08 -06:00
|
|
|
Engine.time_scale = 10.0
|
2024-10-17 16:50:40 -06:00
|
|
|
|
2024-10-21 09:51:28 -06:00
|
|
|
SignalBus.quest_generated.connect(_on_quest_generated)
|
2024-10-17 16:50:40 -06:00
|
|
|
SignalBus.quest_completed.connect(_on_quest_completed)
|
2024-10-18 14:05:31 -06:00
|
|
|
|
2024-10-21 09:51:28 -06:00
|
|
|
_create_area()
|
2024-10-15 15:04:40 -06:00
|
|
|
|
|
|
|
|
2024-10-17 16:50:40 -06:00
|
|
|
func _process(_delta: float) -> void:
|
2024-10-18 09:11:15 -06:00
|
|
|
deltaCount += 1
|
2024-10-21 09:51:28 -06:00
|
|
|
if canContinue:
|
|
|
|
_continue_show()
|
2024-10-09 20:55:46 -06:00
|
|
|
|
2024-10-08 20:51:11 -06:00
|
|
|
|
2024-10-21 09:51:28 -06:00
|
|
|
func _create_area() -> void:
|
|
|
|
var worldArea = load("res://scenes/world_area.tscn").instantiate()
|
|
|
|
add_child(worldArea)
|
|
|
|
move_child(worldArea, 0)
|
2024-10-08 20:51:11 -06:00
|
|
|
|
|
|
|
func _on_button_test_pressed() -> void:
|
2024-10-18 16:17:39 -06:00
|
|
|
%DebugMenu/ButtonTest.text = "pass"
|
2024-10-17 16:50:40 -06:00
|
|
|
pass
|
2024-10-08 20:51:11 -06:00
|
|
|
|
|
|
|
|
|
|
|
func _on_button_exit_pressed() -> void:
|
|
|
|
get_tree().quit()
|
|
|
|
|
|
|
|
|
2024-10-21 09:51:28 -06:00
|
|
|
func _continue_show() -> void:
|
|
|
|
%UITop/ContinueButton.modulate.a += 0.05
|
2024-10-18 16:17:39 -06:00
|
|
|
|
|
|
|
|
2024-10-21 09:51:28 -06:00
|
|
|
func _on_quest_generated(quest) -> void:
|
|
|
|
%QuestsContainer.add_child(quest)
|
2024-10-17 16:50:40 -06:00
|
|
|
|
|
|
|
|
2024-10-18 14:30:41 -06:00
|
|
|
# TODO: move all quest stuff to quest class?
|
2024-10-17 16:50:40 -06:00
|
|
|
func _on_quest_completed() -> void:
|
2024-10-21 09:51:28 -06:00
|
|
|
if %UITop/AutoCheck.button_pressed:
|
|
|
|
# TODO: eventually add new area progress trigger
|
|
|
|
pass
|
|
|
|
else:
|
2024-10-18 14:30:41 -06:00
|
|
|
canContinue = true
|