Skip to content

Commit

Permalink
fix: panel item scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
hero622 committed Nov 2, 2023
1 parent c864b18 commit feced1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Modules/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ DETOUR(Client::SetPanelStats) {

CPortalLeaderboard *m_pLeaderboard = *(CPortalLeaderboard **)((uintptr_t)thisptr + Offsets::m_pLeaderboard);
void *m_pStatList = *(void **)((uintptr_t)thisptr + Offsets::m_pStatList);
int m_nStatHeight = *(int *)((uintptr_t)thisptr + Offsets::m_nStatHeight);

auto map_id = AutoSubmitMod::GetMapId(std::string(m_pLeaderboard->m_szMapName));
auto json = AutoSubmitMod::GetMapJson(*map_id);
Expand Down Expand Up @@ -564,7 +565,7 @@ DETOUR(Client::SetPanelStats) {
data.m_iScore = atoi(time.second["scoreData"]["score"].string_value().c_str());
strncpy(data.m_szName, time.second["userData"]["boardname"].string_value().c_str(), sizeof(data.m_szName));

client->AddAvatarPanelItem(m_pLeaderboard, m_pStatList, &data, data.m_iScore, 1, -1, i, 81, -1, 0);
client->AddAvatarPanelItem(m_pLeaderboard, m_pStatList, &data, data.m_iScore, 1, -1, i, m_nStatHeight, -1, 0);
}

return 0;
Expand Down
1 change: 1 addition & 0 deletions src/OffsetsData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ OFFSET_DEFAULT(ImageFormat, 20, 21)
OFFSET_DEFAULT(CBaseEntity_Create, 130, 145)
OFFSET_DEFAULT(m_pLeaderboard, 2308, 832)
OFFSET_DEFAULT(m_pStatList, 2252, 818)
OFFSET_DEFAULT(m_nStatHeight, 2100, 780)

// Linux mods run on an older build of the game (generally around 8151) which
// has very different codegen - we define their offset overrides here
Expand Down

0 comments on commit feced1d

Please sign in to comment.