Skip to content

Commit

Permalink
pls
Browse files Browse the repository at this point in the history
  • Loading branch information
NopoTheGamer committed Dec 25, 2024
1 parent 20be841 commit 93ce36d
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,32 @@ object ModifyVisualWords {
// Replacements the user added manually via /shwords
var userModifiedWords = mutableListOf<VisualWord>()

// Replacements the mod added automatically for some features, april jokes, etc
var modModifiedWords = mutableListOf<VisualWord>()
private var finalWordsList = listOf<VisualWord>()
private var debug = false

fun update() {
finalWordsList = modModifiedWords + userModifiedWords
textCache.clear()
}

@HandleEvent
fun onCommandRegistration(event: CommandRegistrationEvent) {
event.register("shdebugvisualwords") {
description = "Prints in the console all replaced words by /shwords"
callback { toggleDebug() }
}
}

private fun toggleDebug() {
debug = !debug
ChatUtils.chat("Visual Words debug ${if (debug) "enabled" else "disabled"}")
if (debug) {
update()
}
}

fun modifyText(originalText: String?): String? {
var modifiedText = originalText ?: return null
if (!LorenzUtils.onHypixel) return originalText
Expand Down

0 comments on commit 93ce36d

Please sign in to comment.