mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-26 00:40:15 +00:00
Fix talent tab crash and missing talent points at level 10
Unique child window and button IDs per tab prevent ImGui state corruption when switching talent tabs. Parse SMSG_INSPECT_TALENT type=0 properly to populate unspentTalentPoints_ and learnedTalents_ from the server response.
This commit is contained in:
parent
6ab9ba65f9
commit
40a98f2436
2 changed files with 51 additions and 5 deletions
|
|
@ -216,7 +216,9 @@ void TalentScreen::renderTalentTree(game::GameHandler& gameHandler, uint32_t tab
|
|||
float availW = ImGui::GetContentRegionAvail().x;
|
||||
float offsetX = std::max(0.0f, (availW - gridWidth) * 0.5f);
|
||||
|
||||
ImGui::BeginChild("TalentGrid", ImVec2(0, 0), false);
|
||||
char childId[32];
|
||||
snprintf(childId, sizeof(childId), "TalentGrid_%u", tabId);
|
||||
ImGui::BeginChild(childId, ImVec2(0, 0), false);
|
||||
|
||||
ImVec2 gridOrigin = ImGui::GetCursorScreenPos();
|
||||
gridOrigin.x += offsetX;
|
||||
|
|
@ -326,8 +328,9 @@ void TalentScreen::renderTalentTree(game::GameHandler& gameHandler, uint32_t tab
|
|||
renderTalent(gameHandler, *talent, pointsInTree);
|
||||
} else {
|
||||
// Empty cell — invisible placeholder
|
||||
ImGui::InvisibleButton(("e_" + std::to_string(row) + "_" + std::to_string(col)).c_str(),
|
||||
ImVec2(iconSize, iconSize));
|
||||
char emptyId[32];
|
||||
snprintf(emptyId, sizeof(emptyId), "e_%u_%u_%u", tabId, row, col);
|
||||
ImGui::InvisibleButton(emptyId, ImVec2(iconSize, iconSize));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue