|
VoltMod
C++23 framework for CS2 server plugins
|
Classes | |
| struct | NamedColor |
Functions | |
| std::string_view | ParseNamed (std::string_view name) |
| std::string | Strip (std::string_view text) |
| std::vector< Labeled< std::string > > | PaletteChoices (std::function< std::string(std::string_view canonicalName)> labelFor) |
Variables | |
| constexpr std::string_view | Default = "\x01" |
| constexpr std::string_view | White = "\x01" |
| constexpr std::string_view | DarkRed = "\x02" |
| constexpr std::string_view | LightPurple = "\x03" |
| constexpr std::string_view | Green = "\x04" |
| constexpr std::string_view | Olive = "\x05" |
| constexpr std::string_view | Lime = "\x06" |
| constexpr std::string_view | Red = "\x07" |
| constexpr std::string_view | Gray = "\x08" |
| constexpr std::string_view | Grey = "\x08" |
| constexpr std::string_view | Yellow = "\x09" |
| constexpr std::string_view | LightYellow = "\x09" |
| constexpr std::string_view | Silver = "\x0A" |
| constexpr std::string_view | BlueGrey = "\x0A" |
| constexpr std::string_view | LightBlue = "\x0B" |
| constexpr std::string_view | Blue = "\x0B" |
| constexpr std::string_view | DarkBlue = "\x0C" |
| constexpr std::string_view | Purple = "\x0E" |
| constexpr std::string_view | Magenta = "\x0E" |
| constexpr std::string_view | LightRed = "\x0F" |
| constexpr std::string_view | Gold = "\x10" |
| constexpr std::string_view | Orange = "\x10" |
| constexpr std::array< NamedColor, 15 > | Palette |
| static const std::unordered_map< std::string, std::string_view > | kNameTable |
| std::vector< Labeled< std::string > > VoltMod::ChatColors::PaletteChoices | ( | std::function< std::string(std::string_view canonicalName)> | labelFor | ) |
Palette as labeled canonical names, so a colour picker grows as the palette does rather than repeating its contents.
labelFor supplies the localized label for each canonical name; returning "" falls back to the name itself. Shaped for a ChoiceRow<std::string>, but it names no menu type - a caller that wants the list for anything else gets the same answer.
Definition at line 43 of file ChatColors.cpp.
References Palette, and VoltMod::ReadFile().
| std::string_view VoltMod::ChatColors::ParseNamed | ( | std::string_view | name | ) |
Map a human color name (case-insensitive) to its escape sequence. Returns Default for unknown names. Empty input also returns Default.
Definition at line 18 of file ChatColors.cpp.
References Default, kNameTable, VoltMod::ReadFile(), and VoltMod::Strings::ToLower().
| std::string VoltMod::ChatColors::Strip | ( | std::string_view | text | ) |
Strip all CS2 color escape bytes (0x01..0x10) from text for safe console/log output.
Definition at line 29 of file ChatColors.cpp.
References VoltMod::ReadFile().
|
inlineconstexpr |
Definition at line 30 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 28 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 31 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 17 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 15 of file ChatColors.hpp.
Referenced by VoltMod::EnsureColorPrefix(), and ParseNamed().
|
inlineconstexpr |
Definition at line 35 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 23 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 19 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 24 of file ChatColors.hpp.
|
static |
|
inlineconstexpr |
Definition at line 29 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 18 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 34 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 26 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 21 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 33 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 20 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 36 of file ChatColors.hpp.
|
inlineconstexpr |
Canonical, deduplicated list of every named color recognized by ParseNamed, one entry per distinct escape byte. Aliases (e.g. grey/gray, magenta/purple) collapse to a single canonical name. Useful for building color-picker UIs that stay in sync with the framework as new colors are added.
Definition at line 51 of file ChatColors.hpp.
Referenced by PaletteChoices().
|
inlineconstexpr |
Definition at line 32 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 22 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 27 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 16 of file ChatColors.hpp.
|
inlineconstexpr |
Definition at line 25 of file ChatColors.hpp.