Skip to content

Commit

Permalink
Fix nations chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Gutin1 committed Jan 30, 2025
1 parent 7debb9d commit edf6698
Show file tree
Hide file tree
Showing 10 changed files with 381 additions and 299 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ abstract class AbstractPlayerCache : ManualCache() {
var hitmarkerOnHull: Boolean = true,

var shortenChatChannels: Boolean = false,

var hideUserPrefixes: Boolean = false,
var hideGlobalPrefixes: Boolean = false,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ data class SLPlayer(
var hitmarkerOnHull: Boolean = true,

var shortenChatChannels: Boolean = false,

var hideUserPrefixes: Boolean = false,
var hideGlobalPrefixes: Boolean = false,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package net.horizonsend.ion.common.utils.text

import net.horizonsend.ion.common.database.Oid
import net.horizonsend.ion.common.database.cache.nations.NationCache
import net.horizonsend.ion.common.database.cache.nations.SettlementCache
import net.horizonsend.ion.common.database.schema.nations.Nation
import net.horizonsend.ion.common.database.schema.nations.Settlement
import net.horizonsend.ion.common.utils.text.colors.HEColorScheme
import net.horizonsend.ion.common.utils.text.colors.HEColorScheme.Companion.HE_DARK_GRAY
import net.horizonsend.ion.common.utils.text.colors.HEColorScheme.Companion.HE_LIGHT_GRAY
Expand Down Expand Up @@ -290,6 +292,11 @@ fun formatNationName(id: Oid<Nation>): Component {
return text(cached.name, TextColor.color(cached.color))
}

fun formatSettlementName(id: Oid<Settlement>): Component {
val cached = SettlementCache[id]
return text(cached.name, NamedTextColor.AQUA)
}

fun formatException(throwable: Throwable): Component {
val stackTrace = "$throwable\n" + throwable.stackTrace.joinToString(separator = "\n")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ object ChatCommand : SLCommand() {

ChannelSelections.switchChannel(ChannelSelections[sender], chatChannel, sender)
}
}
}
Loading

0 comments on commit edf6698

Please sign in to comment.