feat: implement barber shop UI with hair/facial customization

Adds a functional barber shop window triggered by SMSG_ENABLE_BARBER_SHOP.
Players can adjust hair style, hair color, and facial features using
sliders bounded by race/gender max values. Sends CMSG_ALTER_APPEARANCE
on confirm; server result closes the window on success. Escape key
also closes the barber shop.
This commit is contained in:
Kelsi 2026-03-18 11:58:01 -07:00
parent 8dfd916fe4
commit 64fd7eddf8
6 changed files with 160 additions and 1 deletions

View file

@ -2681,8 +2681,8 @@ void GameHandler::handlePacket(network::Packet& packet) {
}
case Opcode::SMSG_ENABLE_BARBER_SHOP:
// Sent by server when player sits in barber chair — triggers barber shop UI
// No payload; we don't have barber shop UI yet, so just log
LOG_INFO("SMSG_ENABLE_BARBER_SHOP: barber shop available");
barberShopOpen_ = true;
break;
case Opcode::SMSG_FEIGN_DEATH_RESISTED:
addUIError("Your Feign Death was resisted.");
@ -4902,6 +4902,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
uint32_t result = packet.readUInt32();
if (result == 0) {
addSystemChatMessage("Hairstyle changed.");
barberShopOpen_ = false;
} else {
const char* msg = (result == 1) ? "Not enough money for new hairstyle."
: (result == 2) ? "You are not at a barber shop."
@ -19180,6 +19181,13 @@ void GameHandler::confirmTalentWipe() {
talentWipeCost_ = 0;
}
void GameHandler::sendAlterAppearance(uint32_t hairStyle, uint32_t hairColor, uint32_t facialHair) {
if (state != WorldState::IN_WORLD || !socket) return;
auto pkt = AlterAppearancePacket::build(hairStyle, hairColor, facialHair);
socket->send(pkt);
LOG_INFO("sendAlterAppearance: hair=", hairStyle, " color=", hairColor, " facial=", facialHair);
}
// ============================================================
// Phase 4: Group/Party
// ============================================================