summaryrefslogtreecommitdiffstats
path: root/src/CompositeChat.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-19 21:40:56 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-19 21:40:56 +0200
commit42c36429d7cd1e6c3f879b6749e18e912deefe0d (patch)
treecd6f9a0ddf88a738596018311702d19d07fc0b5c /src/CompositeChat.h
parentMerge pull request #1010 from mc-server/cactidamage (diff)
downloadcuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.gz
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.bz2
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.lz
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.xz
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.zst
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.zip
Diffstat (limited to 'src/CompositeChat.h')
-rw-r--r--src/CompositeChat.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/CompositeChat.h b/src/CompositeChat.h
index 5b9c5f612..a0264d864 100644
--- a/src/CompositeChat.h
+++ b/src/CompositeChat.h
@@ -38,6 +38,7 @@ public:
ptUrl,
ptRunCommand,
ptSuggestCommand,
+ ptShowAchievement,
} ;
class cBasePart
@@ -106,6 +107,15 @@ public:
public:
cSuggestCommandPart(const AString & a_Text, const AString & a_Command, const AString & a_Style = "");
} ;
+
+ class cShowAchievementPart :
+ public cBasePart
+ {
+ typedef cBasePart super;
+ public:
+ AString m_PlayerName;
+ cShowAchievementPart(const AString & a_PlayerName, const AString & a_Achievement, const AString & a_Style = "");
+ } ;
typedef std::vector<cBasePart *> cParts;
@@ -148,6 +158,11 @@ public:
/** Adds a part that suggests a command (enters it into the chat message area, but doesn't send) when clicked.
The default style is underlined yellow text. */
void AddSuggestCommandPart(const AString & a_Text, const AString & a_SuggestedCommand, const AString & a_Style = "u@b");
+
+ /** Adds a part that fully formats a specified achievement using client translatable strings
+ Takes achievement name and player awarded to. Displays as {player} has earned the achievement {achievement_name}.
+ */
+ void AddShowAchievementPart(const AString & a_PlayerName, const AString & a_Achievement, const AString & a_Style = "");
/** Parses text into various parts, adds those.
Recognizes "http:" and "https:" URLs and @color-codes. */