diff options
author | madmaxoft <github@xoft.cz> | 2014-08-09 17:36:19 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-08-09 17:36:19 +0200 |
commit | 0001a7c9fc2359078968565a8ab464509362b776 (patch) | |
tree | e075ad4035364380a3ee26aa1714996a7ff364bb /src/Bindings/ManualBindings_RankManager.cpp | |
parent | Merge remote-tracking branch 'origin/master' into Ranks (diff) | |
download | cuberite-0001a7c9fc2359078968565a8ab464509362b776.tar cuberite-0001a7c9fc2359078968565a8ab464509362b776.tar.gz cuberite-0001a7c9fc2359078968565a8ab464509362b776.tar.bz2 cuberite-0001a7c9fc2359078968565a8ab464509362b776.tar.lz cuberite-0001a7c9fc2359078968565a8ab464509362b776.tar.xz cuberite-0001a7c9fc2359078968565a8ab464509362b776.tar.zst cuberite-0001a7c9fc2359078968565a8ab464509362b776.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/ManualBindings_RankManager.cpp | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/Bindings/ManualBindings_RankManager.cpp b/src/Bindings/ManualBindings_RankManager.cpp index daa810cd4..d17672dcb 100644 --- a/src/Bindings/ManualBindings_RankManager.cpp +++ b/src/Bindings/ManualBindings_RankManager.cpp @@ -100,8 +100,8 @@ static int tolua_cRankManager_AddRank(lua_State * L) cLuaState S(L); if ( !S.CheckParamUserTable(1, "cRankManager") || - !S.CheckParamString(2) || - !S.CheckParamEnd(3) + !S.CheckParamString(2, 5) || + !S.CheckParamEnd(6) ) { return 0; @@ -396,6 +396,41 @@ static int tolua_cRankManager_GetRankGroups(lua_State * L) +/** Binds cRankManager::GetRankVisuals */ +static int tolua_cRankManager_GetRankVisuals(lua_State * L) +{ + // function signature: + // cRankManager:GetRankVisuals(RankName) -> MsgPrefix, MsgSuffix, MsgNameColorCode + + cLuaState S(L); + if ( + !S.CheckParamUserTable(1, "cRankManager") || + !S.CheckParamString(2) || + !S.CheckParamEnd(3) + ) + { + return 0; + } + + // Get the params: + AString RankName; + S.GetStackValue(2, RankName); + + // Get the visuals: + AString MsgPrefix, MsgSuffix, MsgNameColorCode; + cRoot::Get()->GetRankManager().GetRankVisuals(RankName, MsgPrefix, MsgSuffix, MsgNameColorCode); + + // Push the results: + S.Push(MsgPrefix); + S.Push(MsgSuffix); + S.Push(MsgNameColorCode); + return 3; +} + + + + + /** Binds cRankManager::GetRankPermissions */ static int tolua_cRankManager_GetRankPermissions(lua_State * L) { @@ -848,6 +883,7 @@ void ManualBindings::BindRankManager(lua_State * tolua_S) tolua_function(tolua_S, "GetPlayerPermissions", tolua_cRankManager_GetPlayerPermissions); tolua_function(tolua_S, "GetPlayerRankName", tolua_cRankManager_GetPlayerRankName); tolua_function(tolua_S, "GetRankGroups", tolua_cRankManager_GetRankGroups); + tolua_function(tolua_S, "GetRankVisuals", tolua_cRankManager_GetRankVisuals); tolua_function(tolua_S, "GetRankPermissions", tolua_cRankManager_GetRankPermissions); tolua_function(tolua_S, "GroupExists", tolua_cRankManager_GroupExists); tolua_function(tolua_S, "IsGroupInRank", tolua_cRankManager_IsGroupInRank); |