Stuff
This commit is contained in:
@@ -6,6 +6,7 @@ const quest_progress_bar_template = preload("res://templates/quest_progress_bar.
|
||||
signal time_changed(time : float)
|
||||
|
||||
@onready var timer : Timer = $Timer
|
||||
@onready var audioplayer : AudioStreamPlayer = $AudioStreamPlayer
|
||||
|
||||
func _ready() -> void:
|
||||
Game.panel = self
|
||||
@@ -26,7 +27,9 @@ func add_quest_progress_bar(quest : Quest) -> void:
|
||||
func switch_panel(active : bool) -> void:
|
||||
%OpenShift.visible = active
|
||||
%WorkingShift.visible = !active
|
||||
%QuestView.visible = !active
|
||||
%Timer.start(300 if active else 1500)
|
||||
audioplayer.play()
|
||||
|
||||
func _on_show_quests_pressed() -> void:
|
||||
%QuestProgressList.visible = !%QuestProgressList.visible
|
||||
@@ -58,4 +61,22 @@ func notice(msg : String, time : float) -> void:
|
||||
%Notices.add_child(ntc)
|
||||
ntc.message = msg
|
||||
ntc.duration = time
|
||||
|
||||
|
||||
var dragging : bool = false
|
||||
var drag_pos : Vector2
|
||||
func _on_drag_region_gui_input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_LEFT:
|
||||
dragging = event.pressed
|
||||
if dragging:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
drag_pos = event.global_position
|
||||
else:
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
Input.warp_mouse(drag_pos)
|
||||
elif dragging and event is InputEventMouseMotion:
|
||||
var window = get_window()
|
||||
window.position += Vector2i(event.screen_relative)
|
||||
|
||||
func _on_quest_viewer_button_pressed() -> void:
|
||||
%QuestView.visible = !%QuestView.visible
|
||||
|
||||
Reference in New Issue
Block a user