Exemplo n.º 1
0
    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);
        }
    }
    /// <summary>
    /// 点击正式开始约会按钮
    /// </summary>
    private void OnClickStartDating()
    {
        if (moduleNPCDating.curDatingNpc != null)
        {
            if (moduleNPCDating.curDatingNpc.datingEnd == 0)
            {
                moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.SelectDatingNpc, 17));                                            //正在约会中
            }
            else
            {
                moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.SelectDatingNpc, 22)); //约会已经结束
            }
            return;
        }

        if (m_curClickNpcData == null)
        {
            moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.SelectDatingNpc, 6));
            return;
        }
        //判断与当前Npc是否可以进行约会
        if (m_curClickNpcData.isUnlockEngagement)
        {
            if (m_curClickNpcData.fetterLv < m_curClickNpcData.maxFetterLv)
            {
                OnOpenAlertPanel(StrText(0), true, true, true, Open2ConfirmCallBack, null, StrText(1), StrText(2));
            }
            else
            {
                OnOpenAlertPanel(StrText(3), true, true, true, Open1ConfirmCallBack, null, StrText(1), StrText(2));
            }
        }
        else
        {
            m_tfFetterTipPanel.SafeSetActive(true);

            if (m_curClickNpcData.npcType != NpcTypeID.PoliceNpc)
            {
                Util.SetText(m_txtFetterTipContent, StrText(21), m_curClickNpcData.name);                                                  //如果不是伊利丝,弹出不能约会提示
            }
            else
            {
                var unLockLv    = m_curClickNpcData.npcInfo.unlockLv;
                var curLv       = m_curClickNpcData.fetterLv;
                var unLockExp   = ConfigManager.Get <NpcGoodFeelingInfo>(unLockLv).exp;
                var curTotalExp = ConfigManager.Get <NpcGoodFeelingInfo>(curLv).exp + m_curClickNpcData.nowFetterValue;

                var dVal = unLockExp - curTotalExp;

                var curStageName          = m_curClickNpcData.GetStageName(m_curClickNpcData.fetterStage);
                var unLockDatingStageName = m_curClickNpcData.GetStageName(m_curClickNpcData.datingFetterStage);

                if (dVal > 0)
                {
                    Util.SetText(m_txtFetterTipContent, StrText(4), m_curClickNpcData.name, unLockDatingStageName, curStageName, dVal);
                }
                else
                {
                    Util.SetText(m_txtFetterTipContent, Util.Format(StrText(20), m_curClickNpcData.name));
                }
            }
        }
    }