Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
Add money to player list
Browse files Browse the repository at this point in the history
  • Loading branch information
notgoodusename committed Mar 24, 2022
1 parent 4543a71 commit b48fac7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Osiris/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion Osiris/GameData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -435,6 +435,7 @@ void PlayerData::update(Entity* entity) noexcept
return;
}

money = entity->money();
team = entity->getTeamNumber();
static_cast<BaseData&>(*this) = { entity };
origin = entity->getAbsOrigin();
Expand Down
1 change: 1 addition & 0 deletions Osiris/GameData.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ struct PlayerData : BaseData {
int armor;
int userId;
int handle;
int money;
int competitiveWins;
Team team;
std::uint64_t steamID;
Expand Down
7 changes: 6 additions & 1 deletion Osiris/Hacks/Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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("");
Expand Down

0 comments on commit b48fac7

Please sign in to comment.