Class ClientChatSettings
How large the text in the chat log is drawn, so that a player who cannot comfortably read the default can make it larger without moving every other panel on the screen.
public static class ClientChatSettings
- Inheritance
-
ClientChatSettings
- Inherited Members
Remarks
Why this is not the interface scale. The UI tab already offers one, and it is the wrong control for this. It works by dividing the panel asset's authored reference resolution, so it resizes every panel and every word in every one of them, and it stops at 1.5x. A player who can read the rest of the HUD and not the chat log gets nothing from it: turning it up pushes panels off the screen to fix one list of text, and 1.5x of a 12px line is 18px whether or not 18px is the size they needed.
Points, not a multiplier. The control names the size it sets, so "16 pt" means sixteen points the way it would in any other application. A multiplier over the default was the other option and it reads worse: the number a player wants to see is the size they are choosing, not the ratio between it and a default they are not thinking about.
What it deliberately does not cover. The chat tabs and the channel selector stay at their authored sizes. Both sit in containers of fixed height — the tab strip is 24 units and the selector 20 — so a font that grew inside either would clip rather than enlarge, and a setting that visibly breaks the panel is worse than one with a boundary. They are chrome; the message log and the input field are the text a player reads and writes, and those are what this covers.
Why the range stops where it does. The panel is a fixed 222 units tall, a
number chosen against the bands above and below it that UIChat.uss documents at
length. At twenty points the log shows roughly eight lines, and past that it stops being a
log and becomes a window onto one. The ceiling is a property of the panel's height rather
than of legibility, which is why it is here and not at some larger round number.
Fields
DefaultFontSize
Chat text size a fresh install uses, in points.
public const float DefaultFontSize = 12
Field Value
Remarks
Twelve, matching what UIChat.uss authored before this setting existed, so a
fresh install draws exactly what it drew before.
DefaultGroupMessages
Grouping is on on a fresh install, as it always was.
public const bool DefaultGroupMessages = true
Field Value
DefaultShowChannelTags
Channel tags are on on a fresh install, as they always were.
public const bool DefaultShowChannelTags = true
Field Value
DefaultShowTimestamps
Timestamps are off on a fresh install, so the log reads exactly as it did.
public const bool DefaultShowTimestamps = false
Field Value
MaximumFontSize
Largest chat text size offered, in points.
public const float MaximumFontSize = 20
Field Value
MinimumFontSize
Smallest chat text size offered, in points.
public const float MinimumFontSize = 10
Field Value
TimestampFormatLabels
Option labels for ClientChatSettings.TimestampFormat, indexed by its value.
public static readonly string[] TimestampFormatLabels
Field Value
- string[]
Properties
FontSize
The chosen chat text size, in points.
public static float FontSize { get; }
Property Value
Format
The chosen timestamp format; an out-of-range stored value reads as the default.
public static ClientChatSettings.TimestampFormat Format { get; }
Property Value
GroupMessages
Whether consecutive lines from the same sender on the same channel drop the repeated name. Off, every line carries its sender.
public static bool GroupMessages { get; }
Property Value
ShowChannelTags
Whether a line names its channel, e.g. [Tell].
public static bool ShowChannelTags { get; }
Property Value
ShowTimestamps
Whether every chat line starts with the local time it arrived.
public static bool ShowTimestamps { get; }
Property Value
Methods
FormatTimestamp(DateTime, TimestampFormat)
Writes a time in the chosen format, e.g. [14:05].
public static string FormatTimestamp(DateTime localTime, ClientChatSettings.TimestampFormat format)
Parameters
localTimeDateTimeThe local time the message arrived.
formatClientChatSettings.TimestampFormatThe format to write it in.
Returns
SetFontSize(float)
Writes the chat text size and notifies the panel.
public static void SetFontSize(float value)
Parameters
valuefloat
Remarks
Rounded, because the slider is continuous and a size is not. A stored 14.37 would render identically to 14 and would be a value no control could produce again — so the file would disagree with the read-out beside the slider that named it.
SetFormat(TimestampFormat)
Writes the timestamp format and notifies the panel.
public static void SetFormat(ClientChatSettings.TimestampFormat value)
Parameters
SetGroupMessages(bool)
Writes the grouping toggle and notifies the panel.
public static void SetGroupMessages(bool value)
Parameters
valuebool
SetShowChannelTags(bool)
Writes the channel tag toggle and notifies the panel.
public static void SetShowChannelTags(bool value)
Parameters
valuebool
SetShowTimestamps(bool)
Writes the timestamp toggle and notifies the panel.
public static void SetShowTimestamps(bool value)
Parameters
valuebool
Events
OnChanged
Raised when the chat text size changes.
public static event Action OnChanged
Event Type
Remarks
The panel subscribes so that a change reaches the messages already on screen. Without that it would take effect only on the next row built — and since a log is only ever appended to, the lines a player is looking at while they drag the slider are exactly the ones that would not change.
OnFormatChanged
Raised when anything about how a chat line is laid out changes: timestamps, their format, channel tags or grouping.
public static event Action OnFormatChanged
Event Type
Remarks
Separate from OnChanged because the panel answers it by rebuilding every row, where a font change only restyles them — and the font slider raises on every step of a drag.