Advertisement
Guest User

[C++] IsLeaderOnGuild

a guest
Jan 7th, 2017
1,314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.38 KB | None | 0 0
  1. //@Svn/Client/UserInterface/PythonTextTail.cpp
  2. //1.) Search:
  3. void CPythonTextTail::RenderTextTailName(TTextTail * pTextTail)
  4. {
  5.     [......]
  6. }
  7. //2.) Add after:
  8. #ifdef ENABLE_SHOW_LEADER_GUILD
  9. std::string CPythonTextTail::IsLeaderOnGuild(std::string * strConvertGuildName)
  10. {
  11. /*************************************
  12. * Date            : 08.01.2017
  13. * FileName        : PythonTextTail.cpp
  14. * TitleName       : IsLeaderOnGuild
  15. * Author          : VegaS
  16. * Description     :
  17.     When you are leader on your guild will appear in front [leader].
  18.     You can and enable color on textLine when you are leader with ENABLE_SHOW_LEADER_GUILD_COLOR.
  19. */
  20.     #define LEADER_GUILD_COLOR  "|cFFd0ffcc" //Change color from http://www.color-hex.com/color/ccffff
  21.  
  22.     CPythonGuild::TGuildInfo & rGuildData = CPythonGuild::Instance().GetGuildInfoRef();
  23.     CPythonGuild::TGuildMemberData * pInfo;
  24.  
  25.     const char* masterName;
  26.     const char* mainCharacterName;
  27.     std::string masterGuild;
  28.  
  29.     if (!CPythonGuild::Instance().GetMemberDataPtrByPID(rGuildData.dwMasterPID, &pInfo))
  30.         masterName = "Noname";
  31.  
  32.     mainCharacterName = CPythonPlayer::Instance().GetName();
  33.     masterName = pInfo->strName.c_str();
  34.     masterGuild = *strConvertGuildName;
  35.  
  36.     if (!strcmp(mainCharacterName, masterName))
  37.     {
  38.         masterGuild.insert(0,
  39.             #ifdef ENABLE_SHOW_LEADER_GUILD_COLOR
  40.                 LEADER_GUILD_COLOR
  41.             #endif
  42.                 "[Leader] "
  43.         );
  44.     }
  45.  
  46.     return masterGuild.c_str();
  47. }
  48. #endif
  49.  
  50. //1.) Search for:
  51.             strGuildName = "Noname";
  52. //2.) Add after:
  53. #ifdef ENABLE_SHOW_LEADER_GUILD
  54.         std::string strConvertGuildName = CPythonTextTail::Instance().IsLeaderOnGuild(&strGuildName);
  55. #endif
  56.  
  57. //1.) Search for:
  58.         prGuildNameInstance->SetValue(strGuildName.c_str());
  59. //2.) Add after:
  60. #ifdef ENABLE_SHOW_LEADER_GUILD
  61.         prGuildNameInstance->SetValue(strConvertGuildName.c_str());
  62. #else
  63.         prGuildNameInstance->SetValue(strGuildName.c_str());
  64. #endif
  65.  
  66. //1.) Search for:
  67. #include "PythonGuild.h"
  68. //2.) Add after:
  69. #ifdef ENABLE_SHOW_LEADER_GUILD
  70.     #include "PythonPlayer.h"
  71. #endif
  72.  
  73. //@Svn/Client/UserInterface/PythonTextTail.h
  74. //1.) Search:
  75.         void DetachTitle(DWORD dwVID);
  76. //2.) Add after:
  77. #ifdef ENABLE_SHOW_LEADER_GUILD
  78.         std::string IsLeaderOnGuild(std::string * strConvertGuildName);
  79. #endif
  80.  
  81. //@Svn/Client/UserInterface/Locale_inc.h
  82. //Add where you want:
  83. #define ENABLE_SHOW_LEADER_GUILD
  84. #define ENABLE_SHOW_LEADER_GUILD_COLOR // Enable color textLine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement