Reduce vendor thank you message spam and add variety (#23746)

* Moved vendor thank you messages into AdvertisementPack, making them vendor-specific.
Wrote a few example messages.

* Only display thank yous when closing the UI after a purchase.

* Tweaked a few messages

* More custom messages

* Missed one
This commit is contained in:
Tayrtahn
2024-01-08 20:34:47 -05:00
committed by GitHub
parent efb1c58a13
commit eb9770efb9
63 changed files with 208 additions and 15 deletions

View File

@@ -74,6 +74,17 @@ namespace Content.Server.Advertise
_chat.TrySendInGameICMessage(uid, Loc.GetString(_random.Pick(advertisements.Advertisements)), InGameICChatType.Speak, true);
}
public void SayThankYou(EntityUid uid, AdvertiseComponent? advertise = null)
{
if (!Resolve(uid, ref advertise))
return;
if (_prototypeManager.TryIndex(advertise.PackPrototypeId, out AdvertisementsPackPrototype? advertisements))
{
_chat.TrySendInGameICMessage(uid, Loc.GetString(_random.Pick(advertisements.ThankYous), ("name", Name(uid))), InGameICChatType.Speak, true);
}
}
public void SetEnabled(EntityUid uid, bool enable, AdvertiseComponent? advertise = null)
{
if (!Resolve(uid, ref advertise))