summaryrefslogtreecommitdiffstats
path: root/src/CompositeChat.cpp
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
commit6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch)
tree7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/CompositeChat.cpp
parentMerge pull request #2958 from LogicParrot/fence (diff)
parentBulk clearing of whitespace (diff)
downloadcuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip
Diffstat (limited to 'src/CompositeChat.cpp')
-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: