mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
feat: show corpse skull marker on world map when player is a ghost
When the player dies and releases spirit, the world map now renders a bone-white X cross at the corpse's location (matching the existing minimap skull marker). The marker appears only when the player is a ghost with an unclaimed corpse on the same map, and shows a "Your corpse" tooltip on hover. Implemented via setCorpsePos() on WorldMap, called from renderWorldMap() using getCorpseCanonicalPos().
This commit is contained in:
parent
614fcf6b98
commit
d0df6eed2c
3 changed files with 49 additions and 0 deletions
|
|
@ -1096,6 +1096,33 @@ void WorldMap::renderImGuiOverlay(const glm::vec3& playerRenderPos, int screenWi
|
|||
}
|
||||
}
|
||||
|
||||
// Corpse marker — skull X shown when player is a ghost with unclaimed corpse
|
||||
if (hasCorpse_ && currentIdx >= 0 && viewLevel != ViewLevel::WORLD) {
|
||||
glm::vec2 uv = renderPosToMapUV(corpseRenderPos_, currentIdx);
|
||||
if (uv.x >= 0.0f && uv.x <= 1.0f && uv.y >= 0.0f && uv.y <= 1.0f) {
|
||||
float cx = imgMin.x + uv.x * displayW;
|
||||
float cy = imgMin.y + uv.y * displayH;
|
||||
constexpr float R = 5.0f; // cross arm half-length
|
||||
constexpr float T = 1.8f; // line thickness
|
||||
// Dark outline
|
||||
drawList->AddLine(ImVec2(cx - R, cy - R), ImVec2(cx + R, cy + R),
|
||||
IM_COL32(0, 0, 0, 220), T + 1.5f);
|
||||
drawList->AddLine(ImVec2(cx + R, cy - R), ImVec2(cx - R, cy + R),
|
||||
IM_COL32(0, 0, 0, 220), T + 1.5f);
|
||||
// Bone-white X
|
||||
drawList->AddLine(ImVec2(cx - R, cy - R), ImVec2(cx + R, cy + R),
|
||||
IM_COL32(230, 220, 200, 240), T);
|
||||
drawList->AddLine(ImVec2(cx + R, cy - R), ImVec2(cx - R, cy + R),
|
||||
IM_COL32(230, 220, 200, 240), T);
|
||||
// Tooltip on hover
|
||||
ImVec2 mp = ImGui::GetMousePos();
|
||||
float dx = mp.x - cx, dy = mp.y - cy;
|
||||
if (dx * dx + dy * dy < 64.0f) {
|
||||
ImGui::SetTooltip("Your corpse");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hover coordinate display — show WoW coordinates under cursor
|
||||
if (currentIdx >= 0 && viewLevel != ViewLevel::WORLD) {
|
||||
auto& io = ImGui::GetIO();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue