in-world ui textboxes

This commit is contained in:
2026-06-12 09:08:13 -05:00
parent a4d47d7f00
commit b364fae1c7
16 changed files with 265 additions and 27 deletions
+24 -3
View File
@@ -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