mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: fire BARBER_SHOP_OPEN and BARBER_SHOP_CLOSE events
Fire BARBER_SHOP_OPEN when the barber shop UI is enabled (SMSG_ENABLE_BARBER_SHOP). Fire BARBER_SHOP_CLOSE when the barber shop completes or is dismissed. Used by UI customization addons.
This commit is contained in:
parent
5ee2b55f4b
commit
2da0883544
2 changed files with 3 additions and 1 deletions
|
|
@ -1300,7 +1300,7 @@ public:
|
||||||
|
|
||||||
// Barber shop
|
// Barber shop
|
||||||
bool isBarberShopOpen() const { return barberShopOpen_; }
|
bool isBarberShopOpen() const { return barberShopOpen_; }
|
||||||
void closeBarberShop() { barberShopOpen_ = false; }
|
void closeBarberShop() { barberShopOpen_ = false; if (addonEventCallback_) addonEventCallback_("BARBER_SHOP_CLOSE", {}); }
|
||||||
void sendAlterAppearance(uint32_t hairStyle, uint32_t hairColor, uint32_t facialHair);
|
void sendAlterAppearance(uint32_t hairStyle, uint32_t hairColor, uint32_t facialHair);
|
||||||
|
|
||||||
// Instance difficulty (0=5N, 1=5H, 2=25N, 3=25H for WotLK)
|
// Instance difficulty (0=5N, 1=5H, 2=25N, 3=25H for WotLK)
|
||||||
|
|
|
||||||
|
|
@ -2772,6 +2772,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
// Sent by server when player sits in barber chair — triggers barber shop UI
|
// Sent by server when player sits in barber chair — triggers barber shop UI
|
||||||
LOG_INFO("SMSG_ENABLE_BARBER_SHOP: barber shop available");
|
LOG_INFO("SMSG_ENABLE_BARBER_SHOP: barber shop available");
|
||||||
barberShopOpen_ = true;
|
barberShopOpen_ = true;
|
||||||
|
if (addonEventCallback_) addonEventCallback_("BARBER_SHOP_OPEN", {});
|
||||||
break;
|
break;
|
||||||
case Opcode::SMSG_FEIGN_DEATH_RESISTED:
|
case Opcode::SMSG_FEIGN_DEATH_RESISTED:
|
||||||
addUIError("Your Feign Death was resisted.");
|
addUIError("Your Feign Death was resisted.");
|
||||||
|
|
@ -5125,6 +5126,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
addSystemChatMessage("Hairstyle changed.");
|
addSystemChatMessage("Hairstyle changed.");
|
||||||
barberShopOpen_ = false;
|
barberShopOpen_ = false;
|
||||||
|
if (addonEventCallback_) addonEventCallback_("BARBER_SHOP_CLOSE", {});
|
||||||
} else {
|
} else {
|
||||||
const char* msg = (result == 1) ? "Not enough money for new hairstyle."
|
const char* msg = (result == 1) ? "Not enough money for new hairstyle."
|
||||||
: (result == 2) ? "You are not at a barber shop."
|
: (result == 2) ? "You are not at a barber shop."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue