Refactored cChatColor
- Changed std::string fields to const char-pointers in order to wipe out potential issues with static initialization and global destructors - Deprecated cChatColor::Color() because the name does not match the value
This commit is contained in:
parent
e612d07eea
commit
dd7df28844
@ -2,31 +2,31 @@
|
|||||||
|
|
||||||
#include "ChatColor.h"
|
#include "ChatColor.h"
|
||||||
|
|
||||||
const std::string cChatColor::Color = "\xc2\xa7"; // or in other words: "§" in UTF-8
|
const char * cChatColor::Color = "\xc2\xa7"; // or in other words: "§" in UTF-8
|
||||||
const std::string cChatColor::Delimiter = "\xc2\xa7"; // or in other words: "§" in UTF-8
|
const char * cChatColor::Delimiter = "\xc2\xa7"; // or in other words: "§" in UTF-8
|
||||||
const std::string cChatColor::Black = cChatColor::Color + "0";
|
const char * cChatColor::Black = "\xc2\xa7""0";
|
||||||
const std::string cChatColor::Navy = cChatColor::Color + "1";
|
const char * cChatColor::Navy = "\xc2\xa7""1";
|
||||||
const std::string cChatColor::Green = cChatColor::Color + "2";
|
const char * cChatColor::Green = "\xc2\xa7""2";
|
||||||
const std::string cChatColor::Blue = cChatColor::Color + "3";
|
const char * cChatColor::Blue = "\xc2\xa7""3";
|
||||||
const std::string cChatColor::Red = cChatColor::Color + "4";
|
const char * cChatColor::Red = "\xc2\xa7""4";
|
||||||
const std::string cChatColor::Purple = cChatColor::Color + "5";
|
const char * cChatColor::Purple = "\xc2\xa7""5";
|
||||||
const std::string cChatColor::Gold = cChatColor::Color + "6";
|
const char * cChatColor::Gold = "\xc2\xa7""6";
|
||||||
const std::string cChatColor::LightGray = cChatColor::Color + "7";
|
const char * cChatColor::LightGray = "\xc2\xa7""7";
|
||||||
const std::string cChatColor::Gray = cChatColor::Color + "8";
|
const char * cChatColor::Gray = "\xc2\xa7""8";
|
||||||
const std::string cChatColor::DarkPurple = cChatColor::Color + "9";
|
const char * cChatColor::DarkPurple = "\xc2\xa7""9";
|
||||||
const std::string cChatColor::LightGreen = cChatColor::Color + "a";
|
const char * cChatColor::LightGreen = "\xc2\xa7""a";
|
||||||
const std::string cChatColor::LightBlue = cChatColor::Color + "b";
|
const char * cChatColor::LightBlue = "\xc2\xa7""b";
|
||||||
const std::string cChatColor::Rose = cChatColor::Color + "c";
|
const char * cChatColor::Rose = "\xc2\xa7""c";
|
||||||
const std::string cChatColor::LightPurple = cChatColor::Color + "d";
|
const char * cChatColor::LightPurple = "\xc2\xa7""d";
|
||||||
const std::string cChatColor::Yellow = cChatColor::Color + "e";
|
const char * cChatColor::Yellow = "\xc2\xa7""e";
|
||||||
const std::string cChatColor::White = cChatColor::Color + "f";
|
const char * cChatColor::White = "\xc2\xa7""f";
|
||||||
|
|
||||||
const std::string cChatColor::Random = cChatColor::Color + "k";
|
const char * cChatColor::Random = "\xc2\xa7""k";
|
||||||
const std::string cChatColor::Bold = cChatColor::Color + "l";
|
const char * cChatColor::Bold = "\xc2\xa7""l";
|
||||||
const std::string cChatColor::Strikethrough = cChatColor::Color + "m";
|
const char * cChatColor::Strikethrough = "\xc2\xa7""m";
|
||||||
const std::string cChatColor::Underlined = cChatColor::Color + "n";
|
const char * cChatColor::Underlined = "\xc2\xa7""n";
|
||||||
const std::string cChatColor::Italic = cChatColor::Color + "o";
|
const char * cChatColor::Italic = "\xc2\xa7""o";
|
||||||
const std::string cChatColor::Plain = cChatColor::Color + "r";
|
const char * cChatColor::Plain = "\xc2\xa7""r";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,33 +9,35 @@
|
|||||||
class cChatColor
|
class cChatColor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const std::string Color;
|
static const char * Color;
|
||||||
static const std::string Delimiter;
|
|
||||||
|
|
||||||
static const std::string Black;
|
/** @deprecated use ChatColor::Delimiter instead */
|
||||||
static const std::string Navy;
|
static const char * Delimiter;
|
||||||
static const std::string Green;
|
|
||||||
static const std::string Blue;
|
static const char * Black;
|
||||||
static const std::string Red;
|
static const char * Navy;
|
||||||
static const std::string Purple;
|
static const char * Green;
|
||||||
static const std::string Gold;
|
static const char * Blue;
|
||||||
static const std::string LightGray;
|
static const char * Red;
|
||||||
static const std::string Gray;
|
static const char * Purple;
|
||||||
static const std::string DarkPurple;
|
static const char * Gold;
|
||||||
static const std::string LightGreen;
|
static const char * LightGray;
|
||||||
static const std::string LightBlue;
|
static const char * Gray;
|
||||||
static const std::string Rose;
|
static const char * DarkPurple;
|
||||||
static const std::string LightPurple;
|
static const char * LightGreen;
|
||||||
static const std::string Yellow;
|
static const char * LightBlue;
|
||||||
static const std::string White;
|
static const char * Rose;
|
||||||
|
static const char * LightPurple;
|
||||||
|
static const char * Yellow;
|
||||||
|
static const char * White;
|
||||||
|
|
||||||
// Styles ( source: http://wiki.vg/Chat )
|
// Styles ( source: http://wiki.vg/Chat )
|
||||||
static const std::string Random;
|
static const char * Random;
|
||||||
static const std::string Bold;
|
static const char * Bold;
|
||||||
static const std::string Strikethrough;
|
static const char * Strikethrough;
|
||||||
static const std::string Underlined;
|
static const char * Underlined;
|
||||||
static const std::string Italic;
|
static const char * Italic;
|
||||||
static const std::string Plain;
|
static const char * Plain;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user