コード例 #1
0
    //===================================================================================
    //
    // Method
    //
    //===================================================================================
    public void Init(CDispatch DispatchData)
    {
        m_bDispatchSuccess = false;

        m_DispatchRecvData  = DispatchData;
        m_DispatchStartTime = m_DispatchRecvData.kStartTime.GetDateTime();
        m_DispatchEndTime   = m_DispatchRecvData.kEndTime.GetDateTime();

        m_DispatchTableData = CDATA_DISPATCH.Get(m_DispatchRecvData.kMissionCategory, m_DispatchRecvData.kDispatchSubID);

        // 6728	임무\n완료
        m_SuccessLabel.text   = StringTableManager.GetData(6728);
        _BigSuccessLabel.text = StringTableManager.GetData(6728);

        // 보상정보 표시 (새로들어감)
        {
            _RewardObj.SetActive(false);                            // 보상정보를 일단 끄고.

            if (m_DispatchRecvData.kMissionCategory == DATA_DISPATCH_CATEGORY._enCategory.Dispatch_World_None ||
                m_DispatchRecvData.kMissionCategory == DATA_DISPATCH_CATEGORY._enCategory._enCategory_Max)
            {
                return;
            }

            if (m_DispatchRecvData.kDispatchSubID == DATA_DISPATCH_ENUM._enDispatchEnum.Dispatch_None ||
                m_DispatchRecvData.kDispatchSubID == DATA_DISPATCH_ENUM._enDispatchEnum._enDispatchEnum_Max)
            {
                return;
            }

            Dictionary <int, DATA_REWARD_NEW> RewardData = CDATA_REWARD_NEW.Get(m_DispatchTableData.RewardItemEnum);
            if (RewardData == null)
            {
                return;     // error.
            }
            foreach (KeyValuePair <int, DATA_REWARD_NEW> data in RewardData)
            {
                DATA_ITEM_NEW item = CDATA_ITEM_NEW.Get(data.Value.RewardValue);
                if (item == null)
                {
                    continue;
                }

                _RewardIcon.sprite2D   = UIResourceMgr.CreateSprite(BUNDLELIST.TEXTURE_ICON_ITEMICON, item.m_szIconName);
                _RewardCountLabel.text = data.Value.RewardCount.ToString();
            }

            _RewardObj.SetActive(true);                             // 보상정보 있으면 킨다.
            _RewardLabel.text = StringTableManager.GetData(86);     // 86    보상
        }
    }
コード例 #2
0
    private void SetDispatchMissionInfo()
    {
        SetTeamCount(0);

        m_DispatchMissionTitleLabel.text = StringTableManager.GetData(int.Parse(m_DispatchTableData.String_Name));

        // 6847    Lv {0} 이상 {1}성 이상
        m_DispatchMissionConditionLabel.text = string.Format(StringTableManager.GetData(6847), m_DispatchTableData.RequireLevel, (int)m_DispatchTableData.RequireGrade);

        int ihour    = m_DispatchTableData.RequireTime / 60;
        int iMinutes = m_DispatchTableData.RequireTime - (60 * ihour);

        if (ihour > 0)
        {
            // 6740	소요 시간 : {0}시간 {1}분
            m_DispatchMissionTimeLabel.text = string.Format(StringTableManager.GetData(6740), ihour, iMinutes);
        }
        else
        {
            // 6741	소요 시간 : {0}분
            m_DispatchMissionTimeLabel.text = string.Format(StringTableManager.GetData(6741), iMinutes);
        }

        Dictionary <int, DATA_REWARD_NEW> RewardData = CDATA_REWARD_NEW.Get(m_DispatchTableData.RewardItemEnum);

        if (RewardData == null)
        {
            return;     // error.
        }
        foreach (KeyValuePair <int, DATA_REWARD_NEW> data in RewardData)
        {
            DATA_ITEM_NEW item = CDATA_ITEM_NEW.Get(data.Value.RewardValue);
            if (item == null)
            {
                continue;
            }

            m_DispatchMissionRewardSprite.sprite2D = UIResourceMgr.CreateSprite(BUNDLELIST.TEXTURE_ICON_ITEMICON, item.m_szIconName);
            m_DispatchMissionRewardLabel.text      = data.Value.RewardCount.ToString();
        }
        //m_DispatchMissionRewardSprite
        //m_DispatchMissionRewardLabel.text = m_DispatchTableData.QuickCost.ToString();
    }
コード例 #3
0
    //===================================================================================
    //
    // Method
    //
    //===================================================================================
    public void SetData(DATA_GUILD_TRIBUTE._enTributeEnum enTribute)
    {
        DestroyTributeRewardItem();

        DATA_GUILD_TRIBUTE GuildTributeData = CDATA_GUILD_TRIBUTE.Get(enTribute);

        if (GuildTributeData == null)
        {
#if DEBUG_LOG
            Debug.Log("<color=red> CDATA_GUILD_TRIBUTE.Get(enTribute) is Null  </color>");
#endif
            return;
        }

        Dictionary <int, DATA_REWARD_NEW> RewardData = CDATA_REWARD_NEW.Get(GuildTributeData.enTributeReward);
        if (RewardData == null)
        {
#if DEBUG_LOG
            Debug.Log("<color=red> CDATA_REWARD_NEW.Get(GuildTributeData.enTributeReward) is Null  </color>");
#endif
            return;
        }

        foreach (KeyValuePair <int, DATA_REWARD_NEW> data in RewardData)
        {
            DATA_REWARD_NEW reward = data.Value;
            if (reward == null)
            {
                continue;
            }

            GuildTributeRewardItem TributeRewardItem = UIResourceMgr.CreatePrefab <GuildTributeRewardItem>(BUNDLELIST.PREFABS_UI_GUILD, _ItemInfoGrid.transform, "GuildTributeRewardItem");
            TributeRewardItem.Init(reward);

            _TributeRewardItems.Add(TributeRewardItem);
        }

        ResetPosition();
    }
コード例 #4
0
    /// <summary>
    /// Rmi_DispatchReward(_stDispatchRewardAck stAck) 패킷 받음.
    /// </summary>
    /// <param name="stAck"></param>
    public void DispatchReward(_stDispatchRewardAck stAck, DATA_DISPATCH_CATEGORY._enCategory dispatchMissionCategory, DATA_DISPATCH_ENUM._enDispatchEnum dispatchsubID)
    {
        if (SetDispatchCardEmpty(stAck.kDispatch.kTeamIndex) == false)
        {
#if DEBUG_LOG
            Debug.Log("Rmi_DispatchReward - 파견카드를 빈 카드로 만들려고 하는데 카드 인덱스를 찾지못했다!!!");
#endif
        }
        //m_DispatchRewardInfo = stAck.kDispatch;

        // 6733	임무 재파견
        // 6734	보상은 우편함에서 수령하실 수 있습니다.\n동일한 임무에 다시 파견하시겠습니까?
        //SystemPopupWindow.Instance.OpenSystemPopUp(enSystemPopupType.YesNo, StringTableManager.GetData(6733), StringTableManager.GetData(6734), ReDispatchStart);

        DATA_DISPATCH m_DispatchTableData = CDATA_DISPATCH.Get(dispatchMissionCategory, dispatchsubID);
        if (stAck.kRewardState == _enDispatchState.eDispatchState_BIGCOMPLETE)   // 대박사건
        {
            Dictionary <int, DATA_REWARD_NEW> RewardData = CDATA_REWARD_NEW.Get(m_DispatchTableData.RewardItemDoubleEnum);
            if (RewardData != null)
            {
                foreach (KeyValuePair <int, DATA_REWARD_NEW> data in RewardData)
                {
                    DATA_ITEM_NEW item = CDATA_ITEM_NEW.Get(data.Value.RewardValue);
                    if (item == null)
                    {
                        continue;
                    }
                    // 대박 터지면 대박 마크 찍어줌
                    //-----------------------------------------------------------------------------------------------------------------------------
                    // 재화일 경우 팝업창
                    AbyssRewardConfirmPopup rewardPopup = UIResourceMgr.CreatePrefab <AbyssRewardConfirmPopup>(BUNDLELIST.PREFABS_UI_ABYSSRING, gameObject.transform, "AbyssRewardConfirmPopup", SetTransformType.OriginValue);
                    rewardPopup.SetUI(item
                                      , data.Value.RewardCount
                                      , StringTableManager.GetData(6734), ReDispatchStart, true);
                    rewardPopup.OpenUI();
                }

                //-----------------------------------------------------------------------------------------------------------------------------
            }
        }
        else if (stAck.kRewardState == _enDispatchState.eDispatchState_COMPLETE)
        {
            // 대박 안터지면 그냥 마크 찍어줌
            Dictionary <int, DATA_REWARD_NEW> RewardData = CDATA_REWARD_NEW.Get(m_DispatchTableData.RewardItemEnum);
            if (RewardData != null)
            {
                foreach (KeyValuePair <int, DATA_REWARD_NEW> data in RewardData)
                {
                    DATA_ITEM_NEW item = CDATA_ITEM_NEW.Get(data.Value.RewardValue);
                    if (item == null)
                    {
                        continue;
                    }
                    // 대박 터지면 대박 마크 찍어줌
                    //-----------------------------------------------------------------------------------------------------------------------------
                    // 재화일 경우 팝업창
                    AbyssRewardConfirmPopup rewardPopup = UIResourceMgr.CreatePrefab <AbyssRewardConfirmPopup>(BUNDLELIST.PREFABS_UI_ABYSSRING, gameObject.transform, "AbyssRewardConfirmPopup", SetTransformType.OriginValue);
                    rewardPopup.SetUI(item
                                      , data.Value.RewardCount
                                      , StringTableManager.GetData(6734), ReDispatchStart, false);
                    rewardPopup.OpenUI();
                }

                //-----------------------------------------------------------------------------------------------------------------------------
            }
        }
    }
コード例 #5
0
    private void SetDispatchInfo()
    {
        // 스테이지 조건 검사.
        {
            _ClearStage.SetActive(false);
            _ClearStageLabel.gameObject.SetActive(false);

            CUserGameStageInfo stagetInfo = UserInfo.Instance.UserGameStageInfo;

            if (stagetInfo.IsClearStage(m_DispatchTableData.RequireStage) == false)
            {
                UIEventListener.Get(gameObject).onClick = null;

                _ClearStage.SetActive(true);
                _ClearStageLabel.gameObject.SetActive(true);

                DATA_MAP_STAGE MapStageTableData = CDATA_MAP_STAGE.Get(m_DispatchTableData.RequireStage);
                if (MapStageTableData != null)
                {
                    int iAreaID  = UtilFunc.GetRegionIndex(MapStageTableData.m_iIndex);
                    int iStageID = UtilFunc.GetStageIndex(MapStageTableData.m_iIndex);
                    _ClearStageLabel.text = string.Format("{0} {1} - {2}", StringTableManager.GetData(MapStageTableData.iAreaName), iAreaID, iStageID + 1);
                }
            }
        }

        m_DispatchingObj.SetActive(false);

        // 6849	(최소 {0}인)
        string str = string.Format(StringTableManager.GetData(6849), m_DispatchTableData.RequireNumber);

        m_titleLabel.text = string.Format("{0} {1}", StringTableManager.GetData(int.Parse(m_DispatchTableData.String_Name)), str);

        // 6847    Lv {0} 이상 {1}성 이상
        m_ConditionLabel.text = string.Format(StringTableManager.GetData(6847), m_DispatchTableData.RequireLevel, (int)m_DispatchTableData.RequireGrade);

        int ihour    = m_DispatchTableData.RequireTime / 60;
        int iMinutes = m_DispatchTableData.RequireTime - (60 * ihour);

        if (ihour > 0)
        {
            // 6740	소요 시간 : {0}시간 {1}분
            m_TimeLabel.text = string.Format(StringTableManager.GetData(6740), ihour, iMinutes);
        }
        else
        {
            // 6741	소요 시간 : {0}분
            m_TimeLabel.text = string.Format(StringTableManager.GetData(6741), iMinutes);
        }

        Dictionary <int, DATA_REWARD_NEW> RewardData = CDATA_REWARD_NEW.Get(m_DispatchTableData.RewardItemEnum);

        if (RewardData == null)
        {
            return;     // error.
        }
        foreach (KeyValuePair <int, DATA_REWARD_NEW> data in RewardData)
        {
            DATA_ITEM_NEW item = CDATA_ITEM_NEW.Get(data.Value.RewardValue);
            if (item == null)
            {
                continue;
            }

            m_RewardSprite.sprite2D = UIResourceMgr.CreateSprite(BUNDLELIST.TEXTURE_ICON_ITEMICON, item.m_szIconName);
            m_RewardLabel.text      = data.Value.RewardCount.ToString();
        }

        //m_RewardSprite.spriteName
        //m_RewardLabel.text = m_DispatchTableData.QuickCost.ToString();

        _stDispatchInfoAck stDispatchInfoAck = UserInfo.Instance.DispatchInfoAck;

        if (stDispatchInfoAck == null)
        {
            return;     // error.
        }
        int iCount = stDispatchInfoAck.vDispatch.Count;

        for (int i = 0; i < iCount; ++i)
        {
            CDispatch dispatch = stDispatchInfoAck.vDispatch[i];
            if (dispatch == null)
            {
                continue;
            }

            if (dispatch.kDispatchState == _enDispatchState.eDispatchState_None)
            {
                continue;
            }

            if (m_DispatchTableData.DispatchCategory == dispatch.kMissionCategory && m_DispatchTableData.DispatchEnum == dispatch.kDispatchSubID)
            {
                UIEventListener.Get(gameObject).onClick = null;
                m_DispatchingObj.SetActive(true);

                DateTime kEndTime     = dispatch.kEndTime.GetDateTime();
                DateTime kCurrentTime = TimeManager.Instance.GetServerTime();
                TimeSpan timeresult   = kEndTime - kCurrentTime;

                if (kCurrentTime.Ticks >= kEndTime.Ticks)       // 임무완료.
                {
                    m_DispatchingGageSprtie.fillAmount = 1;

                    m_DispatchingGageLabel.text  = StringTableManager.GetData(3395);        // 3395	완료.
                    m_DispatchingTitleLabel.text = StringTableManager.GetData(6848);        // 6848	임무 완료.
                }
                else
                {
                    m_DispatchingTitleLabel.text = StringTableManager.GetData(6742);            // 6742	임무 수행 중

                    m_DispatchingGageSprtie.fillAmount = 1 - (float)(timeresult.TotalSeconds / (m_DispatchTableData.RequireTime * 60));

                    if (timeresult.Hours > 0)
                    {
                        // 4915	{0}시간 {1}분 남음
                        m_DispatchingGageLabel.text = string.Format(StringTableManager.GetData(4915), timeresult.Hours, timeresult.Minutes);
                    }
                    else if (timeresult.Minutes > 0)
                    {
                        // 4916	{0}분 남음
                        m_DispatchingGageLabel.text = string.Format(StringTableManager.GetData(4916), timeresult.Minutes);
                    }
                    else if (timeresult.Seconds > 0)
                    {
                        // 4959	1분 미만
                        m_DispatchingGageLabel.text = StringTableManager.GetData(4959);
                    }
                }
            }
        }
    }