fix(mail): tell the mailbox OpenMail and CloseMail like live

Live followed pushGameState with NotifyClientObject OpenMail to the mailbox, and
ToggleMail with CloseMail. The mailbox's client script uses them to mark itself
in use (no interact icon, no second use) while the Mail UI is open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-30 02:34:17 -05:00
parent 7f96a0a406
commit 3ea08daa19

View File

@@ -2,6 +2,7 @@
#include "Amf3.h"
#include "GameMessages.h"
#include "EffectsMessages.h"
#include "ObjectMessages.h"
#include "Entity.h"
void MailBoxServer::OnUse(Entity* self, Entity* user) {
@@ -14,6 +15,9 @@ void MailBoxServer::OnUse(Entity* self, Entity* user) {
uiMessage.strMessageName = "pushGameState";
uiMessage.args = std::move(args);
uiMessage.SendToClient(user->GetSystemAddress());
// The mailbox's client script marks itself in use (hides the interact icon, refuses another use) until CloseMail
GameMessages::NotifyClientObject(self->GetObjectID(), u"OpenMail").Send(user->GetSystemAddress());
}
void MailBoxServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
@@ -25,5 +29,7 @@ void MailBoxServer::OnFireEventServerSide(Entity* self, Entity* sender, std::str
uiMessage.strMessageName = "ToggleMail";
uiMessage.args = std::move(args);
uiMessage.SendToClient(sender->GetSystemAddress());
GameMessages::NotifyClientObject(self->GetObjectID(), u"CloseMail").Send(sender->GetSystemAddress());
}
}