Advertisement
Guest User

Untitled

a guest
May 20th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. void CMisc::OnRenderSpectatorList() // Roshly#7550
  2. {
  3. if (Settings::Misc::misc_Spectators)
  4. {
  5. int specs = 0;
  6. int modes = 0;
  7. std::string spect = "";
  8. std::string mode = "";
  9. int DrawIndex = 1;
  10. for (int playerId : GetObservervators(Interfaces::Engine()->GetLocalPlayer()))
  11. {
  12. if (playerId == Interfaces::Engine()->GetLocalPlayer())
  13. continue;
  14. CBaseEntity * pPlayer = (CBaseEntity *)Interfaces::EntityList()->GetClientEntity(playerId);
  15. if (!pPlayer)
  16. continue;
  17. PlayerInfo Pinfo;
  18. Interfaces::Engine()->GetPlayerInfo(playerId, &Pinfo);
  19. if (Pinfo.m_bIsFakePlayer)
  20. continue;
  21. if (g_pRender)
  22. {
  23. spect += Pinfo.m_szPlayerName;
  24. spect += "\n";
  25. specs++;
  26. if (spect != "")
  27. {
  28. Color PlayerObsColor;
  29. // [junk_disable /]
  30. switch (pPlayer->GetObserverMode())
  31. {
  32. case ObserverMode_t::OBS_MODE_IN_EYE:
  33. mode += ("Perspective");
  34. PlayerObsColor = Color::White();
  35. break;
  36. case ObserverMode_t::OBS_MODE_CHASE:
  37. mode += ("3rd Person");
  38. PlayerObsColor = Color::White();
  39. break;
  40. case ObserverMode_t::OBS_MODE_ROAMING:
  41. mode += ("Free look");
  42. PlayerObsColor = Color::Red();
  43. break;
  44. case ObserverMode_t::OBS_MODE_DEATHCAM:
  45. mode += ("Deathcam");
  46. PlayerObsColor = Color::Yellow();
  47. break;
  48. case ObserverMode_t::OBS_MODE_FREEZECAM:
  49. mode += ("Freezecam");
  50. PlayerObsColor = Color::LimeGreen();
  51. break;
  52. case ObserverMode_t::OBS_MODE_FIXED:
  53. mode += ("Fixed");
  54. PlayerObsColor = Color::Orange();
  55. break;
  56. default:
  57. break;
  58. }
  59. mode += "\n";
  60. modes++;
  61. }
  62. }
  63. }
  64.  
  65. if(bIsGuiVisible)
  66. {
  67. if (ImGui::Begin("Spectators", &Settings::Misc::misc_Spectators, ImVec2(30, 30), .9f, ImGuiWindowFlags_NoScrollbar |
  68. ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize))
  69. {
  70. if (specs> 0) spect += "\n";
  71. ImVec2 size = ImGui::CalcTextSize(spect.c_str());
  72. ImGui::Columns(1);
  73. ImGui::Text(spect.c_str());
  74. DrawIndex++;
  75. }
  76. }
  77. else
  78. {
  79. if (ImGui::Begin("Spectators", &Settings::Misc::misc_Spectators, ImVec2(30, 30), .0f, ImGuiWindowFlags_NoScrollbar |
  80. ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize))
  81. {
  82. if (specs> 0) spect += "\n";
  83. ImVec2 size = ImGui::CalcTextSize(spect.c_str());
  84. ImGui::Columns(1);
  85. ImGui::Text(spect.c_str());
  86. DrawIndex++;
  87. }
  88. }
  89.  
  90. /*if (ImGui::Begin("Spectator List", &Settings::Misc::misc_Spectators, ImVec2(200, 100), .0f, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse))
  91. {
  92. if (specs> 0) spect += "\n";
  93. if (modes> 0) mode += "\n";
  94. ImVec2 size = ImGui::CalcTextSize(spect.c_str());
  95. ImGui::Columns(2);
  96. ImGui::Text("Name");
  97. ImGui::NextColumn();
  98. ImGui::Text("Mode");
  99. ImGui::NextColumn();
  100. ImGui::Separator();
  101. ImGui::Text(spect.c_str());
  102. ImGui::NextColumn();
  103. ImGui::Text(mode.c_str());
  104. ImGui::Columns(1);
  105. DrawIndex++;
  106. }*/
  107. ImGui::End();
  108. }
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement