39 lines
928 B
GDScript
39 lines
928 B
GDScript
class_name UISystem extends Control
|
|
|
|
var QUEST_MENU:QuestMenu
|
|
var DEBUG_MENU:DebugMenu
|
|
var INVENTORY_MENU:FullInventoryMenu
|
|
var EVENT_FLAG_MENU:EventFlagMenu
|
|
var VN_TEXTBOX:VNTextbox
|
|
|
|
func _ready() -> void:
|
|
QUEST_MENU = $QuestMenu
|
|
DEBUG_MENU = $DebugMenu
|
|
INVENTORY_MENU = $FullInventory
|
|
EVENT_FLAG_MENU = $EventFlagMenu
|
|
VN_TEXTBOX = $VNTextbox
|
|
|
|
func _process(delta: float) -> void:
|
|
# This needs to always be at the end of the parent node's tree
|
|
get_parent().move_child(self, get_parent().get_child_count() - 1)
|
|
|
|
func hasInteractionFocus() -> bool:
|
|
# Returns true if the UI system has focus, basically if any UI menu or
|
|
# element is open in a way that prevents interaction with the game world.
|
|
|
|
if QUEST_MENU.isOpen():
|
|
return true
|
|
|
|
if DEBUG_MENU.isOpen():
|
|
return true
|
|
|
|
if INVENTORY_MENU.isOpen():
|
|
return true
|
|
|
|
if EVENT_FLAG_MENU.isOpen():
|
|
return true
|
|
|
|
if !VN_TEXTBOX.isClosed:
|
|
return true
|
|
|
|
return false |