mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Add right-click context menu to player unit frame
Right-clicking the player name in the unit frame opens a popup with 'Open Character' (opens the character/equipment screen) and 'Toggle PvP' options, consistent with the existing right-click menus on party and raid frames.
This commit is contained in:
parent
18e42c22d4
commit
69fd0b03a2
1 changed files with 10 additions and 1 deletions
|
|
@ -1928,11 +1928,20 @@ void GameScreen::renderPlayerFrame(game::GameHandler& gameHandler) {
|
|||
playerHp = playerMaxHp;
|
||||
}
|
||||
|
||||
// Name in green (friendly player color) — clickable for self-target
|
||||
// Name in green (friendly player color) — clickable for self-target, right-click for menu
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.3f, 1.0f, 0.3f, 1.0f));
|
||||
if (ImGui::Selectable(playerName.c_str(), false, 0, ImVec2(0, 0))) {
|
||||
gameHandler.setTarget(gameHandler.getPlayerGuid());
|
||||
}
|
||||
if (ImGui::BeginPopupContextItem("PlayerSelfCtx")) {
|
||||
if (ImGui::Selectable("Open Character")) {
|
||||
inventoryScreen.setCharacterOpen(true);
|
||||
}
|
||||
if (ImGui::Selectable("Toggle PvP")) {
|
||||
gameHandler.togglePvp();
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled("Lv %u", playerLevel);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue