mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
feat: add WotLK equipment set UI to character screen
- Expose equipment sets via public EquipmentSetInfo getter - Populate equipmentSetInfo_ from handleEquipmentSetList() - Implement useEquipmentSet() sending CMSG_EQUIPMENT_SET_USE - Add "Outfits" tab in character screen listing saved sets with Equip button
This commit is contained in:
parent
882cb1bae3
commit
6df8c72cf7
3 changed files with 58 additions and 0 deletions
|
|
@ -7914,6 +7914,14 @@ void GameHandler::sendRequestVehicleExit() {
|
|||
vehicleId_ = 0; // Optimistically clear; server will confirm via SMSG_PLAYER_VEHICLE_DATA(0)
|
||||
}
|
||||
|
||||
void GameHandler::useEquipmentSet(uint32_t setId) {
|
||||
if (state != WorldState::IN_WORLD) return;
|
||||
// CMSG_EQUIPMENT_SET_USE: uint32 setId
|
||||
network::Packet pkt(wireOpcode(Opcode::CMSG_EQUIPMENT_SET_USE));
|
||||
pkt.writeUInt32(setId);
|
||||
socket->send(pkt);
|
||||
}
|
||||
|
||||
void GameHandler::sendMinimapPing(float wowX, float wowY) {
|
||||
if (state != WorldState::IN_WORLD) return;
|
||||
|
||||
|
|
@ -20633,6 +20641,17 @@ void GameHandler::handleEquipmentSetList(network::Packet& packet) {
|
|||
}
|
||||
equipmentSets_.push_back(std::move(es));
|
||||
}
|
||||
// Populate public-facing info
|
||||
equipmentSetInfo_.clear();
|
||||
equipmentSetInfo_.reserve(equipmentSets_.size());
|
||||
for (const auto& es : equipmentSets_) {
|
||||
EquipmentSetInfo info;
|
||||
info.setGuid = es.setGuid;
|
||||
info.setId = es.setId;
|
||||
info.name = es.name;
|
||||
info.iconName = es.iconName;
|
||||
equipmentSetInfo_.push_back(std::move(info));
|
||||
}
|
||||
LOG_INFO("SMSG_EQUIPMENT_SET_LIST: ", equipmentSets_.size(), " equipment sets received");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1342,6 +1342,34 @@ void InventoryScreen::renderCharacterScreen(game::GameHandler& gameHandler) {
|
|||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
// Equipment Sets tab (WotLK only)
|
||||
const auto& eqSets = gameHandler.getEquipmentSets();
|
||||
if (!eqSets.empty()) {
|
||||
if (ImGui::BeginTabItem("Outfits")) {
|
||||
ImGui::Spacing();
|
||||
ImGui::TextDisabled("Saved Equipment Sets");
|
||||
ImGui::Separator();
|
||||
ImGui::BeginChild("##EqSetsList", ImVec2(0, 0), false);
|
||||
for (const auto& es : eqSets) {
|
||||
ImGui::PushID(static_cast<int>(es.setId));
|
||||
// Icon placeholder or name
|
||||
const char* displayName = es.name.empty() ? "(Unnamed)" : es.name.c_str();
|
||||
ImGui::Text("%s", displayName);
|
||||
if (!es.iconName.empty()) {
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled("(%s)", es.iconName.c_str());
|
||||
}
|
||||
ImGui::SameLine(ImGui::GetContentRegionAvail().x - 60.0f);
|
||||
if (ImGui::SmallButton("Equip")) {
|
||||
gameHandler.useEquipmentSet(es.setId);
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
ImGui::EndChild();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndTabBar();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue