Godot 4.5.1
This commit is contained in:
@@ -3,10 +3,10 @@ class_name CutsceneItem extends Node
|
||||
var cutscene:Cutscene = null
|
||||
|
||||
func start() -> void:
|
||||
# This method should be overridden by subclasses
|
||||
pass
|
||||
# This method should be overridden by subclasses
|
||||
pass
|
||||
|
||||
func done() -> void:
|
||||
if !cutscene:
|
||||
return
|
||||
cutscene.nextItem()
|
||||
if !cutscene:
|
||||
return
|
||||
cutscene.nextItem()
|
||||
|
||||
@@ -4,21 +4,21 @@ class_name CutsceneText extends CutsceneItem
|
||||
var nextTextIndex:int = 0
|
||||
|
||||
func _enter_tree() -> void:
|
||||
pass
|
||||
pass
|
||||
|
||||
func _exit_tree() -> void:
|
||||
UI.TEXTBOX.textboxClosing.disconnect(onTextboxClosing)
|
||||
UI.TEXTBOX.textboxClosing.disconnect(onTextboxClosing)
|
||||
|
||||
func start() -> void:
|
||||
nextTextIndex = 0
|
||||
UI.TEXTBOX.setText(interactTexts[nextTextIndex])
|
||||
UI.TEXTBOX.textboxClosing.connect(onTextboxClosing)
|
||||
nextTextIndex = 0
|
||||
UI.TEXTBOX.setText(interactTexts[nextTextIndex])
|
||||
UI.TEXTBOX.textboxClosing.connect(onTextboxClosing)
|
||||
|
||||
func onTextboxClosing() -> void:
|
||||
nextTextIndex += 1
|
||||
if nextTextIndex < interactTexts.size():
|
||||
UI.TEXTBOX.setText(interactTexts[nextTextIndex])
|
||||
else:
|
||||
UI.TEXTBOX.textboxClosing.disconnect(onTextboxClosing)
|
||||
UI.TEXTBOX.setText("")
|
||||
done()
|
||||
nextTextIndex += 1
|
||||
if nextTextIndex < interactTexts.size():
|
||||
UI.TEXTBOX.setText(interactTexts[nextTextIndex])
|
||||
else:
|
||||
UI.TEXTBOX.textboxClosing.disconnect(onTextboxClosing)
|
||||
UI.TEXTBOX.setText("")
|
||||
done()
|
||||
Reference in New Issue
Block a user