mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
Add Set Raid Mark submenu to target, party, and raid frame context menus
Implements setRaidMark() using the existing RaidTargetUpdatePacket and exposes it via right-click on target frame, party member frames, and raid cell frames.
This commit is contained in:
parent
c0f19f5883
commit
c13e18cb55
3 changed files with 70 additions and 0 deletions
|
|
@ -1031,6 +1031,8 @@ public:
|
||||||
if (raidTargetGuids_[i] == guid) return static_cast<uint8_t>(i);
|
if (raidTargetGuids_[i] == guid) return static_cast<uint8_t>(i);
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
}
|
}
|
||||||
|
// Set or clear a raid mark on a guid (icon 0-7, or 0xFF to clear)
|
||||||
|
void setRaidMark(uint64_t guid, uint8_t icon);
|
||||||
|
|
||||||
// ---- LFG / Dungeon Finder ----
|
// ---- LFG / Dungeon Finder ----
|
||||||
enum class LfgState : uint8_t {
|
enum class LfgState : uint8_t {
|
||||||
|
|
|
||||||
|
|
@ -10546,6 +10546,29 @@ void GameHandler::clearMainAssist() {
|
||||||
LOG_INFO("Cleared main assist");
|
LOG_INFO("Cleared main assist");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameHandler::setRaidMark(uint64_t guid, uint8_t icon) {
|
||||||
|
if (state != WorldState::IN_WORLD || !socket) return;
|
||||||
|
|
||||||
|
static const char* kMarkNames[] = {
|
||||||
|
"Star", "Circle", "Diamond", "Triangle", "Moon", "Square", "Cross", "Skull"
|
||||||
|
};
|
||||||
|
|
||||||
|
if (icon == 0xFF) {
|
||||||
|
// Clear mark: find which slot this guid holds and send 0 GUID
|
||||||
|
for (int i = 0; i < 8; ++i) {
|
||||||
|
if (raidTargetGuids_[i] == guid) {
|
||||||
|
auto packet = RaidTargetUpdatePacket::build(static_cast<uint8_t>(i), 0);
|
||||||
|
socket->send(packet);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (icon < 8) {
|
||||||
|
auto packet = RaidTargetUpdatePacket::build(icon, guid);
|
||||||
|
socket->send(packet);
|
||||||
|
LOG_INFO("Set raid mark %s on guid %llu", kMarkNames[icon], (unsigned long long)guid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GameHandler::requestRaidInfo() {
|
void GameHandler::requestRaidInfo() {
|
||||||
if (state != WorldState::IN_WORLD || !socket) {
|
if (state != WorldState::IN_WORLD || !socket) {
|
||||||
LOG_WARNING("Cannot request raid info: not in world or not connected");
|
LOG_WARNING("Cannot request raid info: not in world or not connected");
|
||||||
|
|
|
||||||
|
|
@ -2594,6 +2594,21 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) {
|
||||||
gameHandler.addIgnore(name);
|
gameHandler.addIgnore(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ImGui::Separator();
|
||||||
|
if (ImGui::BeginMenu("Set Raid Mark")) {
|
||||||
|
static const char* kRaidMarkNames[] = {
|
||||||
|
"{*} Star", "{O} Circle", "{<>} Diamond", "{^} Triangle",
|
||||||
|
"{)} Moon", "{ } Square", "{x} Cross", "{8} Skull"
|
||||||
|
};
|
||||||
|
for (int mi = 0; mi < 8; ++mi) {
|
||||||
|
if (ImGui::MenuItem(kRaidMarkNames[mi]))
|
||||||
|
gameHandler.setRaidMark(tGuid, static_cast<uint8_t>(mi));
|
||||||
|
}
|
||||||
|
ImGui::Separator();
|
||||||
|
if (ImGui::MenuItem("Clear Mark"))
|
||||||
|
gameHandler.setRaidMark(tGuid, 0xFF);
|
||||||
|
ImGui::EndMenu();
|
||||||
|
}
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6258,6 +6273,21 @@ void GameScreen::renderPartyFrames(game::GameHandler& gameHandler) {
|
||||||
if (ImGui::MenuItem("Kick from Raid"))
|
if (ImGui::MenuItem("Kick from Raid"))
|
||||||
gameHandler.uninvitePlayer(m.name);
|
gameHandler.uninvitePlayer(m.name);
|
||||||
}
|
}
|
||||||
|
ImGui::Separator();
|
||||||
|
if (ImGui::BeginMenu("Set Raid Mark")) {
|
||||||
|
static const char* kRaidMarkNames[] = {
|
||||||
|
"{*} Star", "{O} Circle", "{<>} Diamond", "{^} Triangle",
|
||||||
|
"{)} Moon", "{ } Square", "{x} Cross", "{8} Skull"
|
||||||
|
};
|
||||||
|
for (int mi = 0; mi < 8; ++mi) {
|
||||||
|
if (ImGui::MenuItem(kRaidMarkNames[mi]))
|
||||||
|
gameHandler.setRaidMark(m.guid, static_cast<uint8_t>(mi));
|
||||||
|
}
|
||||||
|
ImGui::Separator();
|
||||||
|
if (ImGui::MenuItem("Clear Mark"))
|
||||||
|
gameHandler.setRaidMark(m.guid, 0xFF);
|
||||||
|
ImGui::EndMenu();
|
||||||
|
}
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
|
@ -6438,6 +6468,21 @@ void GameScreen::renderPartyFrames(game::GameHandler& gameHandler) {
|
||||||
gameHandler.uninvitePlayer(member.name);
|
gameHandler.uninvitePlayer(member.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ImGui::Separator();
|
||||||
|
if (ImGui::BeginMenu("Set Raid Mark")) {
|
||||||
|
static const char* kRaidMarkNames[] = {
|
||||||
|
"{*} Star", "{O} Circle", "{<>} Diamond", "{^} Triangle",
|
||||||
|
"{)} Moon", "{ } Square", "{x} Cross", "{8} Skull"
|
||||||
|
};
|
||||||
|
for (int mi = 0; mi < 8; ++mi) {
|
||||||
|
if (ImGui::MenuItem(kRaidMarkNames[mi]))
|
||||||
|
gameHandler.setRaidMark(member.guid, static_cast<uint8_t>(mi));
|
||||||
|
}
|
||||||
|
ImGui::Separator();
|
||||||
|
if (ImGui::MenuItem("Clear Mark"))
|
||||||
|
gameHandler.setRaidMark(member.guid, 0xFF);
|
||||||
|
ImGui::EndMenu();
|
||||||
|
}
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue