From be79d12966dac2b5e3ec4ce711b8d4e2372cef7d Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 24 Dec 2013 10:14:33 +0000 Subject: Update chat colours @madmaxoft, is this right? fixes #467 --- src/ChatColor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ChatColor.cpp b/src/ChatColor.cpp index 2b223ee76..dca274d76 100644 --- a/src/ChatColor.cpp +++ b/src/ChatColor.cpp @@ -1,4 +1,3 @@ - #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "ChatColor.h" @@ -29,9 +28,9 @@ const std::string cChatColor::Underlined = cChatColor::Color + "n"; const std::string cChatColor::Italic = cChatColor::Color + "o"; const std::string cChatColor::Plain = cChatColor::Color + "r"; -const std::string cChatColor::MakeColor( char a_Color ) +const std::string cChatColor::MakeColor( std::string a_Color ) { - return cChatColor::Color + a_Color; + return a_Color; } -- cgit v1.2.3 From 085008ff8c20e553933a840280244f0462fb16b1 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 24 Dec 2013 10:17:44 +0000 Subject: Update as per xoft's instructions. --- src/ChatColor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChatColor.cpp b/src/ChatColor.cpp index dca274d76..f42fa2f4d 100644 --- a/src/ChatColor.cpp +++ b/src/ChatColor.cpp @@ -28,7 +28,7 @@ const std::string cChatColor::Underlined = cChatColor::Color + "n"; const std::string cChatColor::Italic = cChatColor::Color + "o"; const std::string cChatColor::Plain = cChatColor::Color + "r"; -const std::string cChatColor::MakeColor( std::string a_Color ) +const std::string cChatColor::MakeColor( const AString & a_Color ) { return a_Color; } -- cgit v1.2.3 From b397dc438b3f6b908b688e2699f5b9293db66f8a Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 24 Dec 2013 10:24:08 +0000 Subject: Updated MakeColour's defenition in the header. --- src/ChatColor.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ChatColor.h b/src/ChatColor.h index 85b10f400..e2a9044f3 100644 --- a/src/ChatColor.h +++ b/src/ChatColor.h @@ -29,15 +29,15 @@ public: static const std::string Yellow; static const std::string White; - // Styles ( source: http://wiki.vg/Chat ) - static const std::string Random; - static const std::string Bold; - static const std::string Strikethrough; - static const std::string Underlined; - static const std::string Italic; - static const std::string Plain; - - static const std::string MakeColor( char a_Color ); + // Styles ( source: http://wiki.vg/Chat ) + static const std::string Random; + static const std::string Bold; + static const std::string Strikethrough; + static const std::string Underlined; + static const std::string Italic; + static const std::string Plain; + + static const std::string MakeColor( const AString & a_Color ); }; // tolua_end -- cgit v1.2.3 From 8674c6800fc904606c6f53408aaae95474b0d7b0 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 24 Dec 2013 10:29:18 +0000 Subject: updated another file... --- src/GroupManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index 1ffe3812f..3d454603b 100644 --- a/src/GroupManager.cpp +++ b/src/GroupManager.cpp @@ -77,13 +77,13 @@ cGroupManager::cGroupManager() LOGD("Loading group: %s", KeyName.c_str() ); Group->SetName( KeyName ); - char Color = IniFile.GetValue( KeyName, "Color", "-" )[0]; + AString Color = IniFile.GetValue( KeyName, "Color", "-" )[0]; if( Color != '-' ) - Group->SetColor( cChatColor::MakeColor(Color) ); + Group->SetColor( cChatColor::Color + Color ); else Group->SetColor( cChatColor::White ); - std::string Commands = IniFile.GetValue( KeyName, "Commands", "" ); + AString Commands = IniFile.GetValue( KeyName, "Commands", "" ); if( Commands.size() > 0 ) { AStringVector Split = StringSplit( Commands, "," ); @@ -93,7 +93,7 @@ cGroupManager::cGroupManager() } } - std::string Permissions = IniFile.GetValue( KeyName, "Permissions", "" ); + AString Permissions = IniFile.GetValue( KeyName, "Permissions", "" ); if( Permissions.size() > 0 ) { AStringVector Split = StringSplit( Permissions, "," ); -- cgit v1.2.3 From af6389ea7ab79663d687e22a18d21b3db86cd71c Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 24 Dec 2013 10:30:36 +0000 Subject: finally removed them all? --- src/Entities/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 948a259ff..b923a094e 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1294,7 +1294,7 @@ AString cPlayer::GetColor(void) const { if ( m_Color != '-' ) { - return cChatColor::MakeColor( m_Color ); + return cChatColor::Color + m_Color; } if ( m_Groups.size() < 1 ) -- cgit v1.2.3 From 8c91f7062af78f5b88bf96a35c1e67ecf7280dcf Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 24 Dec 2013 10:36:06 +0000 Subject: fixed compile? --- src/GroupManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GroupManager.cpp b/src/GroupManager.cpp index 3d454603b..792acc2c3 100644 --- a/src/GroupManager.cpp +++ b/src/GroupManager.cpp @@ -77,7 +77,7 @@ cGroupManager::cGroupManager() LOGD("Loading group: %s", KeyName.c_str() ); Group->SetName( KeyName ); - AString Color = IniFile.GetValue( KeyName, "Color", "-" )[0]; + char Color = IniFile.GetValue( KeyName, "Color", "-" )[0]; if( Color != '-' ) Group->SetColor( cChatColor::Color + Color ); else -- cgit v1.2.3 From 8c6337ff202d81b65cb45b81c60b5d780853e6e7 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 24 Dec 2013 13:25:03 +0000 Subject: Removed documentation for cChatColour:MakeColor() --- MCServer/Plugins/APIDump/APIDesc.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 5bc4a5f39..d69dd14cd 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -1,4 +1,3 @@ - -- APIDesc.lua -- Contains the API objects' descriptions @@ -308,18 +307,15 @@ g_APIDesc = A wrapper class for constants representing colors or effects. ]], - Functions = - { - MakeColor = { Params = "ColorCodeConstant", Return = "string", Notes = "Creates the complete color-code-sequence from the color or effect constant" }, - }, + Functions = {}, Constants = { Black = { Notes = "" }, Blue = { Notes = "" }, Bold = { Notes = "" }, - Color = { Notes = "The first character of the color-code-sequence, §" }, + Color = { Notes = "The first character of the color-code-sequence, �" }, DarkPurple = { Notes = "" }, - Delimiter = { Notes = "The first character of the color-code-sequence, §" }, + Delimiter = { Notes = "The first character of the color-code-sequence, �" }, Gold = { Notes = "" }, Gray = { Notes = "" }, Green = { Notes = "" }, -- cgit v1.2.3 From e1d3b201bd7a22f2924182f0243bb51433080c79 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 24 Dec 2013 13:25:58 +0000 Subject: Finally removed the function. --- src/ChatColor.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/ChatColor.cpp b/src/ChatColor.cpp index f42fa2f4d..72a0a6928 100644 --- a/src/ChatColor.cpp +++ b/src/ChatColor.cpp @@ -28,11 +28,5 @@ const std::string cChatColor::Underlined = cChatColor::Color + "n"; const std::string cChatColor::Italic = cChatColor::Color + "o"; const std::string cChatColor::Plain = cChatColor::Color + "r"; -const std::string cChatColor::MakeColor( const AString & a_Color ) -{ - return a_Color; -} - - -- cgit v1.2.3 From 200f37c41f20baddf63e9ad6c3098c144a00d0d7 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Tue, 24 Dec 2013 13:26:54 +0000 Subject: removed the function def also --- src/ChatColor.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ChatColor.h b/src/ChatColor.h index e2a9044f3..643c4d5d8 100644 --- a/src/ChatColor.h +++ b/src/ChatColor.h @@ -37,7 +37,6 @@ public: static const std::string Italic; static const std::string Plain; - static const std::string MakeColor( const AString & a_Color ); }; // tolua_end -- cgit v1.2.3