/// <summary> /// 파견보냈던 데이터 그대로 재파견. /// </summary> /// <param name="state"></param> private void ReDispatchStart() { // 파견보냈던 데이터의 크리쳐 정보를 지운다. _vDispatch DispatchInfo = UserInfo.Instance.DispatchInfoAck.vDispatch; for (int i = 0; i < DispatchInfo.Count; ++i) { CDispatch dispatch = DispatchInfo[i]; if (dispatch == null) { continue; } if (m_DispatchRewardInfo.kTeamIndex == dispatch.kTeamIndex) { dispatch.vCreatureKey.Clear(); break; } } for (int i = 0; i < m_DispatchCardList.Count; ++i) { DispatchCardItem cardItem = m_DispatchCardList[i]; if (cardItem == null) { continue; } if (cardItem.DispatchRecvData.kTeamIndex == m_DispatchRewardInfo.kTeamIndex) { cardItem.Init(m_DispatchRewardInfo); // 데이터 변경. OpenDispatchTeamWindow(m_DispatchRewardInfo, cardItem.DispatchTableData); m_DispatchTeamWindow.ReSetDispatchTeam(); //OnClickDispatchCard(cardItem); break; } } //_stDispatchStartReq stDispatchStartReq = new _stDispatchStartReq(); //stDispatchStartReq.kTeamIndex = m_DispatchRewardInfo.kTeamIndex; //stDispatchStartReq.kMissionCategory = m_DispatchRewardInfo.kMissionCategory; //stDispatchStartReq.kDispatchSubID = m_DispatchRewardInfo.kDispatchSubID; //stDispatchStartReq.vUseCreatureKey = new _vCreatureKey(); //for (int i = 0; i < m_DispatchRewardInfo.vCreatureKey.Count - 1; ++i) //{ // stDispatchStartReq.vUseCreatureKey.Add(m_DispatchRewardInfo.vCreatureKey[i]); //} //// 다시 보내는 데이터에는 친구 x //stDispatchStartReq.kUseFriendCharKey = 0; //CNetManager.Instance.DispatchProxy.DispatchStart(stDispatchStartReq); //UIControlManager.instance.ShowLoading(true); }
//=================================================================================== // // 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 보상 } }
public void OpenDispatchTeamWindow(CDispatch DispatchRecvData, DATA_DISPATCH DispatchTableData) { if (m_DispatchTeamWindow == null) { m_DispatchTeamWindow = UIResourceMgr.CreatePrefab <DispatchTeamWindow>(BUNDLELIST.PREFABS_UI_DISPATCH, transform, "DispatchTeamWindow"); UIControlManager.instance.AddWindow(enUIType.DISPATCHTEAMWINDOW, m_DispatchTeamWindow); } _DispatchRecvData = DispatchRecvData; _DispatchTableData = DispatchTableData; m_DispatchTeamWindow.Init(DispatchRecvData, DispatchTableData); m_DispatchTeamWindow.OpenUI(); }
public void SetData(CDispatch DispatchRecvData) { m_DispatchRecvData = DispatchRecvData; DestroySelectRegion(); DestroySelectMission(); List <DATA_DISPATCH_CATEGORY._enCategory> DispatchCategoryList = new List <DATA_DISPATCH_CATEGORY._enCategory>(); int iDispatchCount = m_DispatchTableData.Count; for (int i = 0; i < iDispatchCount; ++i) { DATA_DISPATCH DispatchTableData = m_DispatchTableData[i]; if (DispatchTableData == null) { continue; } DATA_DISPATCH_CATEGORY._enCategory DispatchCategory = DispatchTableData.DispatchCategory; if (DispatchCategory == DATA_DISPATCH_CATEGORY._enCategory.Dispatch_World_None || DispatchCategory == DATA_DISPATCH_CATEGORY._enCategory._enCategory_Max) { continue; } if (DispatchCategoryList.Contains(DispatchCategory) == true) { continue; } DispatchCategoryList.Add(DispatchCategory); DispatchMissionItemLeft regin = UIResourceMgr.CreatePrefab <DispatchMissionItemLeft>(BUNDLELIST.PREFABS_UI_DISPATCH, m_SelectRegionGrid.transform, "DispatchMissionItemLeft"); regin.Init(DispatchTableData); UIEventListener.Get(regin.gameObject).onClick = OnSelectRegion; m_SelectRegionList.Add(regin); } if (m_SelectRegionList.Count > 0) { OnSelectRegion(m_SelectRegionList[0].gameObject); } DispatchCategoryList.Clear(); ResetPositionRegion(); }
//=================================================================================== // // Method // //=================================================================================== public void Init(CDispatch DispatchRecvData, DATA_DISPATCH DispatchTableData) { m_iTeamCount = 0; m_iPanelDepth = GetComponent <UIPanel>().depth; m_DispatchRecvData = DispatchRecvData; m_DispatchTableData = DispatchTableData; InitDispatchTeamCreature(); SetDispatchMissionInfo(); CreateFriendCreatureIcon(); MakeUseCreatureData(); _DispatchInfiniteScrollView.Init(SetDispatchCreature, 620.0f, 152.0f); _DispatchInfiniteScrollView.SetData(_CreatureList); }
/// <summary> /// Rmi_DispatchCheck(_stDispatchCheckEndAck stAck) 패킷 받음. /// </summary> public void SetPreDispatchInfo(CDispatch kDispatch) { if (m_DispatchRewardInfo != null) { m_DispatchRewardInfo = null; } m_DispatchRewardInfo = new CDispatch(); m_DispatchRewardInfo.vCreatureKey = new _vCreatureKey(); m_DispatchRewardInfo.vCreatureKey.Clear(); m_DispatchRewardInfo.kTeamIndex = kDispatch.kTeamIndex; m_DispatchRewardInfo.kMissionCategory = kDispatch.kMissionCategory; m_DispatchRewardInfo.kDispatchSubID = kDispatch.kDispatchSubID; m_DispatchRewardInfo.kDispatchState = kDispatch.kDispatchState; m_DispatchRewardInfo.vCreatureKey.AddRange(kDispatch.vCreatureKey); m_DispatchRewardInfo.kFriendCreatureID = kDispatch.kFriendCreatureID; m_DispatchRewardInfo.kStartTime = kDispatch.kStartTime; m_DispatchRewardInfo.kEndTime = kDispatch.kEndTime; //Init(); }
//=================================================================================== // // Default Method // //=================================================================================== public override void Init() { m_TitleLabel.text = StringTableManager.GetData(6722); // 6722 파견 m_TitleContentLabel.text = StringTableManager.GetData(6723); // 6723 임무 카드 // 서버에 값이 있는 만큼만 생성하고 없으면 empty 슬롯으로 초기화. _stDispatchInfoAck stDispatchInfoAck = UserInfo.Instance.DispatchInfoAck; if (stDispatchInfoAck == null) { #if DEBUG_LOG Debug.LogError("서버에서 파견정보 안줌!! - UserInfo.Instance.DispatchInfoAck is NULL"); #endif return; // error; } _vDispatch vDispatch = stDispatchInfoAck.vDispatch; if (vDispatch == null) { #if DEBUG_LOG Debug.LogError("서버에서 파견정보 안줌!! - stDispatchInfoAck.vDispatch is NULL"); #endif return; // error; } DestroyDispatchCard(); int iPanelDepth = m_DispatchCardScrollView.panel.depth; vDispatch.Sort((a, b) => a.kTeamIndex.CompareTo(b.kTeamIndex)); for (int i = 0; i < vDispatch.Count; ++i) { CDispatch Dispatch = vDispatch[i]; if (Dispatch == null) { #if DEBUG_LOG Debug.LogError(string.Format("서버에서 파견정보 안줌!! - stDispatchInfoAck.vDispatch Number : {0} is NULL", i)); #endif continue; } DispatchCardItem cardItem = UIResourceMgr.CreatePrefab <DispatchCardItem>(BUNDLELIST.PREFABS_UI_DISPATCH, m_DispatchCardGrid.transform, "DispatchCardItem"); cardItem.Init(Dispatch); if (Dispatch.kDispatchState == _enDispatchState.eDispatchState_None) // 빈 카드 생성. { cardItem.SetCard(OnClickDispatchCard); } else // 진행중, 성공, 대성공 카드 생성. { cardItem.SetCard(iPanelDepth); } m_DispatchCardList.Add(cardItem); } ResetPosition(); #if TUTORIAL SetTutorialButtonEvent(); #endif }
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); } } } } }