Skip to content

Commit

Permalink
Updated more speaker entries in cinematics
Browse files Browse the repository at this point in the history
  • Loading branch information
calebneuf committed Oct 17, 2023
1 parent 74a1ccb commit 2f8b362
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import me.gabber235.typewriter.entry.Query
import me.gabber235.typewriter.entry.entries.CinematicAction
import me.gabber235.typewriter.entry.entries.CinematicEntry
import me.gabber235.typewriter.entry.entries.SpeakerEntry
import me.gabber235.typewriter.extensions.placeholderapi.parsePlaceholders
import me.gabber235.typewriter.interaction.acceptActionBarMessage
import me.gabber235.typewriter.snippets.snippet
import me.gabber235.typewriter.utils.*
Expand Down Expand Up @@ -106,7 +107,7 @@ private fun displayActionBar(player: Player, speakerName: String, text: String,
val padding = " ".repeat(paddingSize)

val component = actionBarFormat.asMiniWithResolvers(
Placeholder.parsed("speaker", speakerName),
Placeholder.parsed("speaker", speakerName.parsePlaceholders(player)),
Placeholder.component("message", message),
Placeholder.unparsed("padding", padding),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class DisplayDialogueCinematicAction(

val text = segment.text.parsePlaceholders(player)

display(player, speaker?.displayName ?: "", text, displayPercentage)
display(player, speaker?.displayName?.parsePlaceholders(player) ?: "", text, displayPercentage)
}

override suspend fun teardown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private fun displaySpokenDialogue(player: Player, speakerName: String, text: Str
)

val component = spokenFormat.asMiniWithResolvers(
Placeholder.parsed("speaker", speakerName),
Placeholder.parsed("speaker", speakerName.parsePlaceholders(player)),
Placeholder.component("message", message),
Placeholder.parsed("padding", spokenPadding),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import me.gabber235.typewriter.entry.Query
import me.gabber235.typewriter.entry.entries.CinematicAction
import me.gabber235.typewriter.entry.entries.CinematicEntry
import me.gabber235.typewriter.entry.entries.SpeakerEntry
import me.gabber235.typewriter.extensions.placeholderapi.parsePlaceholders
import me.gabber235.typewriter.interaction.acceptActionBarMessage
import me.gabber235.typewriter.snippets.snippet
import me.gabber235.typewriter.utils.Icons
Expand Down Expand Up @@ -115,7 +116,7 @@ private fun displaySubTitle(player: Player, speakerName: String, text: String, d
)

val actionBarComponent = subtitleSpeakerFormat.asMiniWithResolvers(
Placeholder.parsed("speaker", speakerName),
Placeholder.parsed("speaker", speakerName.parsePlaceholders(player)),
)

player.showTitle(Title.title(Component.empty(), component, times))
Expand Down

0 comments on commit 2f8b362

Please sign in to comment.