summaryrefslogtreecommitdiffstats
path: root/src/CompositeChat.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-02-05 22:45:45 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-02-05 22:50:18 +0100
commitca6ef58b1ee8521e4b940ee4883dee714960e413 (patch)
tree8532add455224b07c07a759e3d906f50c0695888 /src/CompositeChat.cpp
parentMerge pull request #2972 from marvinkopf/PlayerAutoComplete (diff)
downloadcuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.zip
Diffstat (limited to '')
-rw-r--r--src/CompositeChat.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/CompositeChat.cpp b/src/CompositeChat.cpp
index 353835039..82e3d09f2 100644
--- a/src/CompositeChat.cpp
+++ b/src/CompositeChat.cpp
@@ -26,7 +26,7 @@ public:
cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser4), "CompositeChat parser test 4");
cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser5), "CompositeChat parser test 5");
}
-
+
static void TestParser1(void)
{
cCompositeChat Msg;
@@ -42,7 +42,7 @@ public:
assert_test(Parts[2]->m_Style == "@2");
assert_test(Parts[3]->m_Style == "@2");
}
-
+
static void TestParser2(void)
{
cCompositeChat Msg;
@@ -58,7 +58,7 @@ public:
assert_test(Parts[2]->m_Style == "@5");
assert_test(Parts[3]->m_Style == "@5");
}
-
+
static void TestParser3(void)
{
cCompositeChat Msg;
@@ -70,7 +70,7 @@ public:
assert_test(Parts[0]->m_Style == "");
assert_test(Parts[1]->m_Style == "");
}
-
+
static void TestParser4(void)
{
cCompositeChat Msg;
@@ -82,7 +82,7 @@ public:
assert_test(Parts[0]->m_Style == "");
assert_test(Parts[1]->m_Style == "");
}
-
+
static void TestParser5(void)
{
cCompositeChat Msg;
@@ -92,7 +92,7 @@ public:
assert_test(Parts[0]->m_PartType == cCompositeChat::ptUrl);
assert_test(Parts[0]->m_Style == "");
}
-
+
} gTest;
#endif // SELF_TEST
@@ -244,7 +244,7 @@ void cCompositeChat::ParseText(const AString & a_ParseText)
}
break;
}
-
+
case ':':
{
const char * LinkPrefixes[] =
@@ -271,7 +271,7 @@ void cCompositeChat::ParseText(const AString & a_ParseText)
AddTextPart(CurrentText, CurrentStyle);
CurrentText.clear();
}
-
+
// Go till the last non-whitespace char in the text:
for (; i < len; i++)
{
@@ -419,7 +419,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
AddChatPartStyle(Part, (*itr)->m_Style);
break;
}
-
+
case cCompositeChat::ptClientTranslated:
{
const cCompositeChat::cClientTranslatedPart & p = static_cast<const cCompositeChat::cClientTranslatedPart &>(**itr);
@@ -436,7 +436,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
AddChatPartStyle(Part, p.m_Style);
break;
}
-
+
case cCompositeChat::ptUrl:
{
const cCompositeChat::cUrlPart & p = static_cast<const cCompositeChat::cUrlPart &>(**itr);
@@ -448,7 +448,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
AddChatPartStyle(Part, p.m_Style);
break;
}
-
+
case cCompositeChat::ptSuggestCommand:
case cCompositeChat::ptRunCommand:
{
@@ -470,7 +470,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
Json::Value Ach;
Ach["action"] = "show_achievement";
Ach["value"] = p.m_Text;
-
+
Json::Value AchColourAndName;
AchColourAndName["color"] = "green";
AchColourAndName["translate"] = p.m_Text;
@@ -514,35 +514,35 @@ void cCompositeChat::AddChatPartStyle(Json::Value & a_Value, const AString & a_P
a_Value["bold"] = Json::Value(true);
break;
}
-
+
case 'i':
{
// italic
a_Value["italic"] = Json::Value(true);
break;
}
-
+
case 'u':
{
// Underlined
a_Value["underlined"] = Json::Value(true);
break;
}
-
+
case 's':
{
// strikethrough
a_Value["strikethrough"] = Json::Value(true);
break;
}
-
+
case 'o':
{
// obfuscated
a_Value["obfuscated"] = Json::Value(true);
break;
}
-
+
case '@':
{
// Color, specified by the next char: