Beispiel #1
0
 private void UpdateNpcIcon(Image img, PDatingDivinationResultData data, Module_Npc.NpcMessage npc)
 {
     if (npc == null)
     {
         return;
     }
     AtlasHelper.SetNpcDateInfo(img, npc.icon);
 }
Beispiel #2
0
    private void OnSetMissionFinishedData(Transform node, Task data)
    {
        Text  t    = node.Find("missionName").GetComponent <Text>();
        Image icon = node.Find("missionName/missionIcon").GetComponent <Image>();

        Util.SetText(t, data.taskNameID);

        AtlasHelper.SetNpcDateInfo(icon, data.taskIconID);
    }
Beispiel #3
0
    private void SetTaskItemData(Transform node, Task data)
    {
        Transform markIcon = node.Find("markIcon").GetComponent <Transform>();
        Image     icon     = node.Find("icon").GetComponent <Image>();

        AtlasHelper.SetNpcDateInfo(icon, data.taskIconID);
        bool bShowMark = data.taskState == EnumTaskState.Finish;

        markIcon.SafeSetActive(bShowMark);
        if (m_curClickTask == null)
        {
            ClickTaskItem(node, data);
        }
        if (m_curClickTask.taskID == data.taskID)
        {
            AtlasHelper.SetNpcDateInfo(icon, data.taskPressIcon);
        }
    }
    private void RefreshWindow(Module_Npc.NpcMessage msg)
    {
        if (msg == null)
        {
            return;
        }

        if (msg.npcInfo != null)
        {
            AtlasHelper.SetNpcDateInfo(m_npcName, msg.npcInfo.artNameTwo);
            UIDynamicImage.LoadImage(m_npcIcon, msg.npcInfo.bigBodyIcon);
            Util.SetText(m_cvName, msg.npcInfo.voiceActor);
        }
        Util.SetText(m_curStage, msg.curStageName);

        //当前阶段刷新
        if (msg.belongStageName != null && msg.belongStageName.Length >= 3)
        {
            Util.SetText(m_lvName1, msg.belongStageName[0]);
            Util.SetText(m_lvName2, msg.belongStageName[1]);
            Util.SetText(m_lvName3, msg.belongStageName[2]);
        }

        int remainder = msg.fetterLv % 3;

        m_curImage1.SafeSetActive(remainder == 1);
        m_curImage2.SafeSetActive(remainder == 2);
        m_curImage3.SafeSetActive(remainder == 0);

        //下一阶段刷新
        m_nextStage.SafeSetActive(msg.fetterStage < msg.maxFetterStage);

        if (msg.fetterStage < msg.maxFetterStage)
        {
            Util.SetText(m_nextStage, msg.GetStageName(msg.fetterStage + 1));
        }

        //解锁系统刷新
        m_unlockSystem.SafeSetActive(msg.isUnlockEngagement);
        if (msg.isUnlockEngagement)
        {
            Util.SetText(m_unlockSystem, 177);
        }
    }
Beispiel #5
0
    private void OpenSecondScenePanel(EnumNPCDatingSceneType t)
    {
        m_tfSecondScenePanel.SafeSetActive(true);

        var data = moduleNPCDating.GetDatingSceneData(t);

        if (data == null)
        {
            return;
        }
        m_curOpenSceneData = data;
        Util.SetText(m_textSceneName, data.nameID);
        Util.SetText(m_textSceneOpenTime, data.startTime + "-" + data.endTime);
        Util.SetText(m_textSceneDesc, data.sceneDescID);
        Util.SetText(m_textConsumePower, Util.Format(ConfigText.GetDefalutString(TextForMatType.NpcDating, 15), data.consumePower));
        UIDynamicImage.LoadImage(m_tfSceneImage, data.sceneIcon);
        UIDynamicImage.LoadImage(m_tfSceneBottomImage, data.strBottomMarkImage);
        AtlasHelper.SetNpcDateInfo(m_imgSceneTopImage, data.strTopMarkImage, null, true);

        int[] openEventNameIds = new int[] { };
        for (int i = 0; i < moduleNPCDating.openWindowData.sceneOpenEvent.Length; i++)
        {
            if (moduleNPCDating.openWindowData.sceneOpenEvent[i].datingScene == data.levelId)
            {
                openEventNameIds = moduleNPCDating.openWindowData.sceneOpenEvent[i].openEventIds;
                break;
            }
        }

        for (int i = 0; i < m_tfSceneOpenEvent.childCount; i++)
        {
            if (i <= openEventNameIds.Length - 1)
            {
                m_tfSceneOpenEvent.GetChild(i).SafeSetActive(true);
                Text eventText = m_tfSceneOpenEvent.GetChild(i).GetComponent <Text>();
                Util.SetText(eventText, openEventNameIds[i]);
            }
            else
            {
                m_tfSceneOpenEvent.GetChild(i).SafeSetActive(false);
            }
        }
    }
    private void Refresh()
    {
        Module_NPCDatingSettlement.SettlementData data = moduleNPCDatingSettlement.datingSettlement;
        if (data == null)
        {
            return;
        }

        AtlasHelper.SetNpcDateInfo(m_imgDatingLevel, data.lvIconName);
        Util.SetText(m_textMoodValue, Util.Format("×{0}", data.moodValue.ToString()));

        Module_Npc.NpcMessage npcInfo = moduleNpc.GetTargetNpc((NpcTypeID)moduleNPCDating.curDatingNpc.npcId);
        if (npcInfo != null)
        {
            AtlasHelper.SetAvatar(m_npcIcon, npcInfo.icon);
            Util.SetText(m_textNpcName, npcInfo.name);
            RefreshLastFetter(npcInfo);
        }
        string preStr = data.addGoodFeelValue == 0 ? "" : "+";

        Util.SetText(m_textAddGoodFeelValue, preStr + data.addGoodFeelValue.ToString());

        //刷新事件列表
        List <string> sourcedataList = new List <string>();

        if (data.finishedEventIds != null)
        {
            for (int i = 0; i < data.finishedEventIds.Length; i++)
            {
                sourcedataList.Add(Util.GetString(data.finishedEventIds[i]));
            }
            sourcedataList.Distinct();//去除相同元素的值
        }

        m_dataSource.SetItems(sourcedataList);

        CreateNpcModel(npcInfo.npcId);

        //显示约会完成标记
        m_tfDatingFinishedMark.SafeSetActive(true);
    }
Beispiel #7
0
    /// <summary>
    /// 刷新任务推荐面板
    /// </summary>
    private void RefreshMissonRecommend()
    {
        var list = moduleNPCDating.allMissionsList;

        if (list == null)
        {
            return;
        }
        bool bShow = false;

        for (int i = 0; i < list.Count; i++)
        {
            if (list[i].taskState != EnumTaskState.Finish)
            {
                bShow = true;
                Util.SetText(m_txtTaskRecommendName, list[i].taskNameID);
                AtlasHelper.SetNpcDateInfo(m_imgTaskRecommendIcon, list[i].taskIconID);
                break;
            }
        }
        m_btnTaskRecommend.SafeSetActive(bShow);
    }