Cleaned and improved some event stuff
This commit is contained in:
@@ -1,11 +1,25 @@
|
||||
class_name EventTextbox extends "res://scripts/Event/Event.gd"
|
||||
|
||||
# @export var text:Array[String] = [ "Hello Text" ];
|
||||
@export_multiline var text:String = "Hello Text"
|
||||
@export_multiline var text:String = ""
|
||||
|
||||
var textPlural:String = ""
|
||||
var count:int = 1
|
||||
var transContext:TransContext = null
|
||||
|
||||
func start() -> void:
|
||||
super.start()
|
||||
VN.getTextbox().setText(self.text);
|
||||
|
||||
if text.is_empty() && transContext == null:
|
||||
push_error("EventTextbox text is empty and no TransContext provided.")
|
||||
return
|
||||
|
||||
if transContext == null:
|
||||
transContext = TransContext.new()
|
||||
|
||||
if textPlural.is_empty():
|
||||
VN.getTextbox().setText(transContext.trans(text))
|
||||
else:
|
||||
VN.getTextbox().setText(transContext.transPlural(text, textPlural, count));
|
||||
|
||||
func isDone() -> bool:
|
||||
return super.isDone() && VN.getTextbox().isClosed;
|
||||
|
Reference in New Issue
Block a user