fix: sync player appearance after barber shop or polymorph

PLAYER_BYTES and PLAYER_BYTES_2 changes in SMSG_UPDATE_OBJECT now
update the Character struct's appearanceBytes and facialFeatures,
and fire an appearance-changed callback that resets the inventory
screen preview so it reloads with the new hair/face values.
This commit is contained in:
Kelsi 2026-03-18 12:17:00 -07:00
parent 2e134b686d
commit 801f29f043
4 changed files with 40 additions and 2 deletions

View file

@ -401,6 +401,14 @@ void GameScreen::render(game::GameHandler& gameHandler) {
ghostStateCallbackSet_ = true;
}
// Set up appearance-changed callback to refresh inventory preview (barber shop, etc.)
if (!appearanceCallbackSet_) {
gameHandler.setAppearanceChangedCallback([this]() {
inventoryScreenCharGuid_ = 0; // force preview re-sync on next frame
});
appearanceCallbackSet_ = true;
}
// Set up UI error frame callback (once)
if (!uiErrorCallbackSet_) {
gameHandler.setUIErrorCallback([this](const std::string& msg) {