示例#1
0
 protected override void OnInitialize()
 {
     base.OnInitialize();
     storyId   = 0;
     orderData = null;
     diviData  = null;
 }
示例#2
0
 public void RefreshDialogReviewData(StoryInfo.StoryItem item, DatingFoodOrder order, DivinationData divination)
 {
     storyItem      = item;
     orderData      = order;
     divinationData = divination;
     RefreshDialogReviewData();
 }
示例#3
0
 private void UpdateNpcIcon(Image img, PDatingDivinationResultData data, Module_Npc.NpcMessage npc)
 {
     if (npc == null)
     {
         return;
     }
     AtlasHelper.SetNpcDateInfo(img, npc.icon);
 }
示例#4
0
    public static ReviewSourceData Create(int storyId, DatingFoodOrder order, DivinationData divination)
    {
        var review = Create();

        review.storyId   = storyId;
        review.orderData = order;
        review.diviData  = divination;
        return(review);
    }
示例#5
0
 private void UpdateTextMood(Text t, int id, PDatingDivinationResultData data, Module_Npc.NpcMessage npc = null)
 {
     if (npc == null)
     {
         Util.SetText(t, id, data.addMood.ToString(), data.addMood.ToString());
     }
     else
     {
         Util.SetText(t, id, npc.name, data.addMood.ToString(), data.addMood.ToString());
     }
 }
示例#6
0
    private void UpdateResult(PDatingDivinationResultData data, EnumDivinationType divType)
    {
        if (data == null)
        {
            return;
        }
        int curDatingNpcId = moduleNPCDating.curDatingNpc != null ? moduleNPCDating.curDatingNpc.npcId : 0;

        Module_Npc.NpcMessage npc = moduleNpc.GetTargetNpc((NpcTypeID)curDatingNpcId);

        if (divType == EnumDivinationType.CrystalDevine)
        {
            UpdateTextResult(m_textCrystalDevineResult, data);
            UpdateTextMood(m_textCrystalDevineMood, 275, data);
            UpdateNpcIcon(m_CrystalDevineMoodNpcIcon, data, npc);
        }
        else if (divType == EnumDivinationType.LotDevine)
        {
            UpdateTextResult(m_textLotDevineResult, data);
            UpdateTextMood(m_textLotDevineMood, 276, data, npc);
            UpdateNpcIcon(m_LotDevineMoodNpcIcon, data, npc);
        }
    }
示例#7
0
    public List <DialogReviewData> GetDialogReviewDatas(int storyId, DatingFoodOrder order = null, DivinationData divination = null)
    {
        var info = ConfigManager.Get <StoryInfo>(storyId);

        if (info == null)
        {
            Logger.LogError("story data is null, and storyId={0} in storyinfo", storyId);
        }
        if (!info || info.storyItems == null || info.storyItems.Length == 0)
        {
            return(null);
        }

        var isCurrentDialog = currentStory && storyId == currentStory.ID;

        var list = new List <DialogReviewData>();

        for (int i = 0; i < info.storyItems.Length; i++)
        {
            var item = info.storyItems[i];
            //必须检测回顾的是否是当前对话,由策划保证一个约会事件下的所有对化ID不重复
            if (string.IsNullOrEmpty(item.content) || (isCurrentDialog && i > currentStoryIndex))
            {
                continue;
            }

            var data = DialogReviewData.Create();
            data.RefreshDialogReviewData(item, order, divination);
            list.Add(data);
        }
        return(list);
    }
示例#8
0
    public static string GetReplaceContent(StoryInfo.StoryItem item, DatingFoodOrder order, DivinationData divination)
    {
        if (item == null)
        {
            return(string.Empty);
        }

        string str = item.content.Replace(StoryConst.PLAYER_NAME_PARAM, modulePlayer.name_);

        str = str.Replace(StoryConst.PLAYER_GENDER_PARAM, genderDialogContent);

        if (divination != null)
        {
            var type = (EnumDivinationType)divination.type;
            str = str.Replace(StoryConst.DEVINE_TYPE_PARAM, GetDivinationName(type));

            if (type == EnumDivinationType.CrystalDevine)
            {
                str = str.Replace(StoryConst.CRYSTAL_DEVINE_RESULT_PARAM, Util.GetString(divination.contentId));
            }
            else if (type == EnumDivinationType.LotDevine)
            {
                str = str.Replace(StoryConst.LOT_DEVINE_RESULT_PARAM, Util.GetString(divination.contentId));
            }
            else
            {
                str = str.Replace(StoryConst.CRYSTAL_DEVINE_RESULT_PARAM, string.Empty);
                str = str.Replace(StoryConst.LOT_DEVINE_RESULT_PARAM, string.Empty);
            }

            str = str.Replace(StoryConst.DEVINE_INT_PARAM, divination.addMood.ToString());
            str = str.Replace(StoryConst.DEVINE_PERCENT_PARAM, divination.addMood.ToString("P"));
        }
        else
        {
            str = str.Replace(StoryConst.DEVINE_TYPE_PARAM, string.Empty);
            str = str.Replace(StoryConst.CRYSTAL_DEVINE_RESULT_PARAM, string.Empty);
            str = str.Replace(StoryConst.LOT_DEVINE_RESULT_PARAM, string.Empty);
            str = str.Replace(StoryConst.DEVINE_INT_PARAM, "0");
            str = str.Replace(StoryConst.DEVINE_PERCENT_PARAM, "0%");
        }

        var p = order == null ? string.Empty : order.itemName;

        str = str.Replace(StoryConst.SHOPITEM_NAME_PARAM, p);
        p   = order == null ? string.Empty : order.currencyNum.ToString();
        str = str.Replace(StoryConst.SHOPITEM_PRICE_PARAM, p);

        return(str);
    }
示例#9
0
 public static ReviewSourceData Create(int storyId, DivinationData divination)
 {
     return(Create(storyId, null, divination));
 }
示例#10
0
 private void UpdateTextResult(Text t, PDatingDivinationResultData data)
 {
     Util.SetText(t, data.contentId);
 }