mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: respect loot roll voteMask for button visibility
Store the voteMask from SMSG_LOOT_START_ROLL and use it to conditionally show Need/Greed/Disenchant/Pass buttons. Previously all four buttons were always shown regardless of the server's allowed roll types.
This commit is contained in:
parent
02a1b5cbf3
commit
209f60031e
3 changed files with 25 additions and 13 deletions
|
|
@ -13198,20 +13198,30 @@ void GameScreen::renderLootRollPopup(game::GameHandler& gameHandler) {
|
|||
}
|
||||
ImGui::Spacing();
|
||||
|
||||
if (ImGui::Button("Need", ImVec2(80, 30))) {
|
||||
gameHandler.sendLootRoll(roll.objectGuid, roll.slot, 0);
|
||||
// voteMask bits: 0x01=pass, 0x02=need, 0x04=greed, 0x08=disenchant
|
||||
const uint8_t vm = roll.voteMask;
|
||||
bool first = true;
|
||||
if (vm & 0x02) {
|
||||
if (ImGui::Button("Need", ImVec2(80, 30)))
|
||||
gameHandler.sendLootRoll(roll.objectGuid, roll.slot, 0);
|
||||
first = false;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Greed", ImVec2(80, 30))) {
|
||||
gameHandler.sendLootRoll(roll.objectGuid, roll.slot, 1);
|
||||
if (vm & 0x04) {
|
||||
if (!first) ImGui::SameLine();
|
||||
if (ImGui::Button("Greed", ImVec2(80, 30)))
|
||||
gameHandler.sendLootRoll(roll.objectGuid, roll.slot, 1);
|
||||
first = false;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Disenchant", ImVec2(95, 30))) {
|
||||
gameHandler.sendLootRoll(roll.objectGuid, roll.slot, 2);
|
||||
if (vm & 0x08) {
|
||||
if (!first) ImGui::SameLine();
|
||||
if (ImGui::Button("Disenchant", ImVec2(95, 30)))
|
||||
gameHandler.sendLootRoll(roll.objectGuid, roll.slot, 2);
|
||||
first = false;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Pass", ImVec2(70, 30))) {
|
||||
gameHandler.sendLootRoll(roll.objectGuid, roll.slot, 96);
|
||||
if (vm & 0x01) {
|
||||
if (!first) ImGui::SameLine();
|
||||
if (ImGui::Button("Pass", ImVec2(70, 30)))
|
||||
gameHandler.sendLootRoll(roll.objectGuid, roll.slot, 96);
|
||||
}
|
||||
|
||||
// Live roll results from group members
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue