mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
Implement corpse reclaim: store death position and show Resurrect button
When a player releases spirit, the server sends SMSG_DEATH_RELEASE_LOC with the corpse map and position. Store this so the ghost can reclaim. New flow: - SMSG_DEATH_RELEASE_LOC now stores corpseMapId_/corpseX_/Y_/Z_ instead of logging and discarding - canReclaimCorpse(): true when ghost is on same map within 40 yards of stored corpse position - reclaimCorpse(): sends CMSG_RECLAIM_CORPSE (no payload) - renderReclaimCorpseButton(): shows "Resurrect from Corpse" button at bottom-center when canReclaimCorpse() is true
This commit is contained in:
parent
c6e39707de
commit
c44477fbee
4 changed files with 61 additions and 6 deletions
|
|
@ -433,6 +433,7 @@ void GameScreen::render(game::GameHandler& gameHandler) {
|
|||
// renderQuestMarkers(gameHandler); // Disabled - using 3D billboard markers now
|
||||
renderMinimapMarkers(gameHandler);
|
||||
renderDeathScreen(gameHandler);
|
||||
renderReclaimCorpseButton(gameHandler);
|
||||
renderResurrectDialog(gameHandler);
|
||||
renderChatBubbles(gameHandler);
|
||||
renderEscapeMenu();
|
||||
|
|
@ -7013,6 +7014,34 @@ void GameScreen::renderDeathScreen(game::GameHandler& gameHandler) {
|
|||
ImGui::PopStyleVar();
|
||||
}
|
||||
|
||||
void GameScreen::renderReclaimCorpseButton(game::GameHandler& gameHandler) {
|
||||
if (!gameHandler.isPlayerGhost() || !gameHandler.canReclaimCorpse()) return;
|
||||
|
||||
auto* window = core::Application::getInstance().getWindow();
|
||||
float screenW = window ? static_cast<float>(window->getWidth()) : 1280.0f;
|
||||
float screenH = window ? static_cast<float>(window->getHeight()) : 720.0f;
|
||||
|
||||
float btnW = 220.0f, btnH = 36.0f;
|
||||
ImGui::SetNextWindowPos(ImVec2(screenW / 2 - btnW / 2, screenH * 0.72f), ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize(ImVec2(btnW + 16.0f, btnH + 16.0f), ImGuiCond_Always);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 6.0f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8.0f, 8.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 0.7f));
|
||||
if (ImGui::Begin("##ReclaimCorpse", nullptr,
|
||||
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove |
|
||||
ImGuiWindowFlags_NoBringToFrontOnFocus)) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.15f, 0.35f, 0.15f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.25f, 0.55f, 0.25f, 1.0f));
|
||||
if (ImGui::Button("Resurrect from Corpse", ImVec2(btnW, btnH))) {
|
||||
gameHandler.reclaimCorpse();
|
||||
}
|
||||
ImGui::PopStyleColor(2);
|
||||
}
|
||||
ImGui::End();
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PopStyleVar(2);
|
||||
}
|
||||
|
||||
void GameScreen::renderResurrectDialog(game::GameHandler& gameHandler) {
|
||||
if (!gameHandler.showResurrectDialog()) return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue