mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 00:20:16 +00:00
feat: implement self-resurrection (Reincarnation/Twisting Nether)
SMSG_PRE_RESURRECT was silently discarded; Shamans with Reincarnation and Warlocks with Twisting Nether could never see or use the self-res ability. Now: - SMSG_PRE_RESURRECT sets selfResAvailable_ flag when addressed to the local player - Death dialog gains a "Use Self-Resurrection" button (blue, shown above Release Spirit) when the flag is set - Clicking it sends CMSG_SELF_RES (empty body) and clears the flag - selfResAvailable_ is cleared on all resurrection and session-reset paths so it never bleeds across deaths or logins
This commit is contained in:
parent
395a8f77c4
commit
5a5c2dcda3
3 changed files with 43 additions and 3 deletions
|
|
@ -15364,8 +15364,10 @@ void GameScreen::renderDeathScreen(game::GameHandler& gameHandler) {
|
|||
ImGui::PopStyleColor();
|
||||
|
||||
// "Release Spirit" dialog centered on screen
|
||||
const bool hasSelfRes = gameHandler.canSelfRes();
|
||||
float dlgW = 280.0f;
|
||||
float dlgH = 130.0f;
|
||||
// Extra height when self-res button is available
|
||||
float dlgH = hasSelfRes ? 170.0f : 130.0f;
|
||||
ImGui::SetNextWindowPos(ImVec2(screenW / 2 - dlgW / 2, screenH * 0.35f), ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize(ImVec2(dlgW, dlgH), ImGuiCond_Always);
|
||||
|
||||
|
|
@ -15399,6 +15401,19 @@ void GameScreen::renderDeathScreen(game::GameHandler& gameHandler) {
|
|||
ImGui::Spacing();
|
||||
ImGui::Spacing();
|
||||
|
||||
// Self-resurrection button (Reincarnation / Twisting Nether / Deathpact)
|
||||
if (hasSelfRes) {
|
||||
float btnW2 = 220.0f;
|
||||
ImGui::SetCursorPosX((dlgW - btnW2) / 2);
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.15f, 0.35f, 0.55f, 1.0f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.2f, 0.5f, 0.75f, 1.0f));
|
||||
if (ImGui::Button("Use Self-Resurrection", ImVec2(btnW2, 30))) {
|
||||
gameHandler.useSelfRes();
|
||||
}
|
||||
ImGui::PopStyleColor(2);
|
||||
ImGui::Spacing();
|
||||
}
|
||||
|
||||
// Center the Release Spirit button
|
||||
float btnW = 180.0f;
|
||||
ImGui::SetCursorPosX((dlgW - btnW) / 2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue