Skip to content

Commit

Permalink
Update DialogueNode.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
HollowHorizon committed Feb 6, 2024
1 parent cf944a1 commit 8146580
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class DialogueContext(val action: ChoiceAction, stateMachine: StoryStateMachine)

override fun NPCProperty.say(text: () -> String): SimpleNode {
if (action == ChoiceAction.WORLD) {
wait { (text().length / 14 + 15).sec }
return next {
val component =
Component.literal("§6[§7" + this@say().displayName.string + "§6]§7 ").append(text().mcTranslate)
Expand All @@ -171,6 +172,7 @@ class DialogueContext(val action: ChoiceAction, stateMachine: StoryStateMachine)
@JvmName("playerSay")
override fun PlayerProperty.say(text: () -> String): SimpleNode {
if (action == ChoiceAction.WORLD) {
wait { (text().length / 14 + 15).sec }
return next {
val component =
Component.literal("§6[§7" + this@say().displayName.string + "§6]§7 ").append(text().mcTranslate)
Expand All @@ -192,6 +194,7 @@ class DialogueContext(val action: ChoiceAction, stateMachine: StoryStateMachine)

override fun Team.send(text: () -> String): SimpleNode {
if (action == ChoiceAction.WORLD) {
wait { (text().length / 14 + 15).sec }
return next {
stateMachine.team.onlineMembers.forEach { it.sendSystemMessage(text().mcTranslate) }
}
Expand Down

0 comments on commit 8146580

Please sign in to comment.