private string GetGiftResponse(string npcRelationship, GiftResponse response) { npcRelationship += Config.gift + ": ";; switch (response) { case GiftResponse.Love: { return(npcRelationship + Config.giftLoves); } case GiftResponse.Like: { return(npcRelationship + Config.giftLikes); } case GiftResponse.Neutral: { return(npcRelationship + Config.giftNeutral); } case GiftResponse.Dislike: { return(npcRelationship + Config.giftDislikes); } case GiftResponse.Hate: { return(npcRelationship + Config.giftHates); } case GiftResponse.QuestItem: { return(npcRelationship + Config.giftQuestItem); } case GiftResponse.Unknown: { return(npcRelationship + Config.giftUnknown); } case GiftResponse.Null: { return(npcRelationship + "null"); } default: { return(npcRelationship + $"Unmapped Gift Response '{response.ToString()}'(Report this, likely a version mismatch)"); } } }
public override void Load(Action <ResultCode> callback) { GiftsService.Instance.GetGiftInfo(this._userIds, (Action <BackendResult <GiftResponse, ResultCode> >)(result => { ResultCode resultCode = result.ResultCode; if (resultCode == ResultCode.Succeeded) { Execute.ExecuteOnUIThread((Action)(() => { GiftResponse resultData = result.ResultData; this._balance = resultData.balance; this.UpdateUsers((IEnumerable <User>)resultData.users); this.NotifyProperties(); })); } Action <ResultCode> action = callback; if (action == null) { return; } int num = (int)resultCode; action((ResultCode)num); })); }
public override string GetDisplayText <T>(string currentDisplay, T character, Item item = null) { NPC selectedNPC = character as NPC ?? throw new ArgumentNullException("character", "Cannot display information about gifts for null Character"); string npcRelationship = base.GetDisplayText(currentDisplay, character, item); GiftResponse response = (GiftResponse)selectedNPC.getGiftTasteForThisItem(item); if (Game1.player.friendshipData.TryGetValue(selectedNPC.Name, out Friendship friendship)) { if (IsItemQuestGift(selectedNPC, item)) { response = GiftResponse.QuestItem; } else if (!KnowsAll) { if (!Record) { return(npcRelationship);//This is an ambiguous case, at this point we don't know what the user wants and just return the base implementation } else { if ((friendship.Points / NPC.friendshipPointsPerHeartLevel) < Config.heartLevelToKnowAllGifts) { if (!GiftLog.PlayerHasGifted(selectedNPC.Name, item.Name)) { response = GiftResponse.Unknown; } } } } npcRelationship += Environment.NewLine; npcRelationship = GetGiftResponse(npcRelationship, response); npcRelationship += AddGiftMiscInfo(friendship); return(npcRelationship); } return(npcRelationship); }