From b48fac77d0466b79d5f57fbd7d154614dcb99632 Mon Sep 17 00:00:00 2001 From: notgoodusename <57305491+notgoodusename@users.noreply.github.com> Date: Thu, 24 Mar 2022 15:26:02 -0300 Subject: [PATCH] Add money to player list --- Osiris/GUI.cpp | 2 +- Osiris/GameData.cpp | 3 ++- Osiris/GameData.h | 1 + Osiris/Hacks/Misc.cpp | 7 ++++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Osiris/GUI.cpp b/Osiris/GUI.cpp index f03b5bd4..b2bf59d2 100644 --- a/Osiris/GUI.cpp +++ b/Osiris/GUI.cpp @@ -1541,7 +1541,7 @@ void GUI::renderMiscWindow() noexcept ImGui::Checkbox("Steam ID", &config->misc.playerList.steamID); //ImGui::Checkbox("Rank", &config->misc.playerList.rank); ImGui::Checkbox("Wins", &config->misc.playerList.wins); - //ImGui::Checkbox("Money", &config->misc.playerList.money); + ImGui::Checkbox("Money", &config->misc.playerList.money); ImGui::Checkbox("Health", &config->misc.playerList.health); ImGui::Checkbox("Armor", &config->misc.playerList.armor); ImGui::EndPopup(); diff --git a/Osiris/GameData.cpp b/Osiris/GameData.cpp index 7666359e..4e48f885 100644 --- a/Osiris/GameData.cpp +++ b/Osiris/GameData.cpp @@ -391,7 +391,7 @@ void ProjectileData::update(Entity* projectile) noexcept trajectory.emplace_back(memory->globalVars->realtime, pos); } -PlayerData::PlayerData(Entity* entity) noexcept : BaseData{ entity }, userId{ entity->getUserId() }, steamID{ entity->getSteamId() }, handle{ entity->handle() } +PlayerData::PlayerData(Entity* entity) noexcept : BaseData{ entity }, userId{ entity->getUserId() }, steamID{ entity->getSteamId() }, handle{ entity->handle() }, money{ entity->money() } { if (steamID) { const auto ctx = interfaces->engine->getSteamAPIContext(); @@ -435,6 +435,7 @@ void PlayerData::update(Entity* entity) noexcept return; } + money = entity->money(); team = entity->getTeamNumber(); static_cast(*this) = { entity }; origin = entity->getAbsOrigin(); diff --git a/Osiris/GameData.h b/Osiris/GameData.h index 932ec69c..6f85d3be 100644 --- a/Osiris/GameData.h +++ b/Osiris/GameData.h @@ -143,6 +143,7 @@ struct PlayerData : BaseData { int armor; int userId; int handle; + int money; int competitiveWins; Team team; std::uint64_t steamID; diff --git a/Osiris/Hacks/Misc.cpp b/Osiris/Hacks/Misc.cpp index 0c73f3a7..d2069847 100644 --- a/Osiris/Hacks/Misc.cpp +++ b/Osiris/Hacks/Misc.cpp @@ -99,19 +99,21 @@ void Misc::drawPlayerList() noexcept ImGui::SetNextWindowSize(ImVec2(300.0f, 300.0f), ImGuiCond_Once); if (ImGui::Begin("Player List", nullptr, windowFlags)) { - if (ImGui::beginTable("", 7, ImGuiTableFlags_Borders | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY | ImGuiTableFlags_Resizable)) { + if (ImGui::beginTable("", 8, ImGuiTableFlags_Borders | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY | ImGuiTableFlags_Resizable)) { ImGui::TableSetupColumn("Index", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHide); ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoHide, 120.0f); ImGui::TableSetupColumn("Steam ID", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize); ImGui::TableSetupColumn("Wins", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize); ImGui::TableSetupColumn("Health", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize); ImGui::TableSetupColumn("Armor", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize); + ImGui::TableSetupColumn("Money", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize); ImGui::TableSetupColumn("Actions", ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize); ImGui::TableSetupScrollFreeze(0, 1); ImGui::TableSetColumnEnabled(2, config->misc.playerList.steamID); ImGui::TableSetColumnEnabled(3, config->misc.playerList.wins); ImGui::TableSetColumnEnabled(4, config->misc.playerList.health); ImGui::TableSetColumnEnabled(5, config->misc.playerList.armor); + ImGui::TableSetColumnEnabled(6, config->misc.playerList.money); ImGui::TableHeadersRow(); @@ -156,6 +158,9 @@ void Misc::drawPlayerList() noexcept if (ImGui::TableNextColumn()) ImGui::Text("%d", player.armor); + if (ImGui::TableNextColumn()) + ImGui::TextColored({ 0.0f, 1.0f, 0.0f, 1.0f }, "$%d", player.money); + if (ImGui::TableNextColumn()){ if (ImGui::smallButtonFullWidth("...", false)) ImGui::OpenPopup("");