Fix presentation of messages with items (rewards & insurance returns) (#265)

This commit is contained in:
hulkhan22
2025-05-21 23:29:34 +02:00
committed by GitHub
parent e941213e0e
commit aef3a4202f
14 changed files with 50 additions and 50 deletions
@@ -147,7 +147,7 @@ public class DialogueController(
var result = new DialogueInfo
{
Id = dialogueId,
Type = dialogue?.Type ?? MessageType.NPC_TRADER,
Type = dialogue?.Type ?? MessageType.NpcTraderMessage,
Message = _dialogueHelper.GetMessagePreview(dialogue),
New = dialogue?.New,
AttachmentsNew = dialogue?.AttachmentsNew,
@@ -173,7 +173,7 @@ public class DialogueController(
var profile = _saveServer.GetProfile(sessionId);
// User to user messages are special in that they need the player to exist in them, add if they don't
if (messageType == MessageType.USER_MESSAGE &&
if (messageType == MessageType.UserMessage &&
dialog?.Users is not null &&
dialog.Users.All(userDialog => userDialog.Id != profile.CharacterData?.PmcData?.SessionId))
{
@@ -253,7 +253,7 @@ public class DialogueController(
Type = request.Type
};
if (request.Type != MessageType.USER_MESSAGE)
if (request.Type != MessageType.UserMessage)
{
return profile.DialogueRecords[request.DialogId!];
}
@@ -599,7 +599,7 @@ public class InsuranceController(
_mailSendService.SendLocalisedNpcMessageToPlayer(
sessionId,
insurance.TraderId,
insurance.MessageType ?? MessageType.SYSTEM_MESSAGE,
insurance.MessageType ?? MessageType.SystemMessage,
insurance.MessageTemplateId,
insurance.Items,
insurance.MaxStorageTime,
@@ -111,7 +111,7 @@ public class QuestController(
_mailSendService.SendLocalisedNpcMessageToPlayer(
sessionID,
questFromDb.TraderId,
MessageType.QUEST_START,
MessageType.QuestStart,
messageId,
startedQuestRewardItems.ToList(),
_timeUtil.GetHoursAsSeconds((int) _questHelper.GetMailItemRedeemTimeHoursForProfile(pmcData))
@@ -321,7 +321,7 @@ public class TradeController(
_mailSendService.SendLocalisedNpcMessageToPlayer(
sessionId,
trader,
MessageType.MESSAGE_WITH_ITEMS,
MessageType.MessageWithItems,
_randomUtil.GetArrayValue(_databaseService.GetTrader(trader).Dialogue.TryGetValue("soldItems", out var items) ? items : new List<string>()),
curencyReward.SelectMany(x => x).ToList(),
_timeUtil.GetHoursAsSeconds(72)