in-world ui textboxes
This commit is contained in:
+24
-3
@@ -6,16 +6,18 @@ var rootUi:RootUI = null
|
||||
# between lines where the textbox is momentarily closed.
|
||||
var dialogueActive:bool = false
|
||||
|
||||
var _chatBoxes:Array = []
|
||||
|
||||
var DEBUG_MENU:
|
||||
get():
|
||||
if rootUi && rootUi.debugMenu:
|
||||
return rootUi.debugMenu
|
||||
return null
|
||||
|
||||
var TEXTBOX:
|
||||
var MAIN_CHATBOX:
|
||||
get():
|
||||
if rootUi && rootUi.textBox:
|
||||
return rootUi.textBox
|
||||
if rootUi && rootUi.mainChatBox:
|
||||
return rootUi.mainChatBox
|
||||
return null
|
||||
|
||||
var GAME_MENU:
|
||||
@@ -29,3 +31,22 @@ var PAUSE_MENU:
|
||||
if rootUi && rootUi.pauseMenu:
|
||||
return rootUi.pauseMenu
|
||||
return null
|
||||
|
||||
func addChatBox(box:WorldChatBox) -> void:
|
||||
_chatBoxes.append(box)
|
||||
|
||||
func removeChatBox(box:WorldChatBox) -> void:
|
||||
_chatBoxes.erase(box)
|
||||
|
||||
func hasAdvanceableChatBox() -> bool:
|
||||
for box in _chatBoxes:
|
||||
if box.mode == WorldChatBox.Mode.ADVANCEABLE:
|
||||
return true
|
||||
return false
|
||||
|
||||
func spawnWorldChatBox(target:Node3D = null) -> WorldChatBox:
|
||||
assert(rootUi != null)
|
||||
var chatbox:WorldChatBox = WorldChatBox.SCENE.instantiate()
|
||||
rootUi.chatBoxContainer.add_child(chatbox)
|
||||
chatbox.worldTarget = target
|
||||
return chatbox
|
||||
|
||||
Reference in New Issue
Block a user