private void NewbieGuideCompleteHandler() { if (null != this.mCurrentScriptControl) { uint currentNewbieGuideId = this.currentNewbieGuideId; this.SetNewbieGuideComplete(this.currentNewbieGuideId, true, true); NewbieGuideMainLineConf newbieGuideMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConf(currentNewbieGuideId); if (newbieGuideMainLineConf != null) { int length = newbieGuideMainLineConf.astSetCompleteId.Length; for (int i = 0; i < length; i++) { if (newbieGuideMainLineConf.astSetCompleteId[i].dwID != 0) { uint dwID = newbieGuideMainLineConf.astSetCompleteId[i].dwID; if (dwID <= WEAKGUIDE_BIT_OFFSET) { this.SetNewbieGuideComplete(dwID, false, true); } else { this.SetWeakGuideComplete(dwID - ((uint)WEAKGUIDE_BIT_OFFSET), true); } } } } this.AddSingleBattleCompleteID(currentNewbieGuideId); this.DestroyCurrentScriptControl(); uint[] param = new uint[] { currentNewbieGuideId }; this.CheckTriggerTime(NewbieGuideTriggerTimeType.preNewbieGuideComplete, param); } }
public void ForceCompleteNewbieGuideAll(bool bReset) { if (null != this.mCurrentScriptControl) { this.mCurrentScriptControl.Stop(); this.DestroyCurrentScriptControl(); } List <uint> list = new List <uint>(); Dictionary <uint, bool> .KeyCollection.Enumerator enumerator = this.mCompleteCacheDic.Keys.GetEnumerator(); while (enumerator.MoveNext()) { uint current = enumerator.Current; if (!this.mCompleteCacheDic[current]) { NewbieGuideMainLineConf newbieGuideMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConf(current); if ((newbieGuideMainLineConf != null) && (newbieGuideMainLineConf.bOldPlayerGuide != 1)) { list.Add(newbieGuideMainLineConf.dwID); } } } List <uint> .Enumerator enumerator2 = list.GetEnumerator(); while (enumerator2.MoveNext()) { this.SetNewbieGuideComplete(enumerator2.Current, bReset, false); } }
private void CheckForceSkipCondition(NewbieGuideSkipConditionType type, params uint[] param) { ListView <NewbieGuideMainLineConf> newbieGuideMainLineConfListBySkipType = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConfListBySkipType(type); int count = newbieGuideMainLineConfListBySkipType.get_Count(); for (int i = 0; i < count; i++) { NewbieGuideMainLineConf newbieGuideMainLineConf = newbieGuideMainLineConfListBySkipType.get_Item(i); if (!this.IsMianLineComplete(newbieGuideMainLineConf.dwID)) { for (int j = 0; j < newbieGuideMainLineConf.astSkipCondition.Length; j++) { if ((NewbieGuideSkipConditionType)newbieGuideMainLineConf.astSkipCondition[j].wType == type && NewbieGuideCheckSkipConditionUtil.CheckSkipCondition(newbieGuideMainLineConf.astSkipCondition[j], param)) { if (!(null != this.mCurrentScriptControl)) { this.SetNewbieGuideComplete(newbieGuideMainLineConf.dwID, false, false, true); break; } if (this.mCurrentScriptControl.currentMainLineId != newbieGuideMainLineConf.dwID) { this.SetNewbieGuideComplete(newbieGuideMainLineConf.dwID, false, false, true); break; } } } } } }
public void ForceCompleteNewbieGuideAll(bool bReset, bool setOldPlayerBit = false, bool sync = true) { if (null != this.mCurrentScriptControl) { this.mCurrentScriptControl.Stop(); this.DestroyCurrentScriptControl(); } List <uint> list = new List <uint>(); Dictionary <uint, bool> .KeyCollection.Enumerator enumerator = this.mCompleteCacheDic.get_Keys().GetEnumerator(); while (enumerator.MoveNext()) { uint current = enumerator.get_Current(); if (!this.mCompleteCacheDic.get_Item(current)) { NewbieGuideMainLineConf newbieGuideMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConf(current); if (newbieGuideMainLineConf != null && newbieGuideMainLineConf.bOldPlayerGuide != 1) { list.Add(newbieGuideMainLineConf.dwID); } if (setOldPlayerBit && newbieGuideMainLineConf != null && newbieGuideMainLineConf.bOldPlayerGuide == 1) { list.Add(newbieGuideMainLineConf.dwID); } } } List <uint> .Enumerator enumerator2 = list.GetEnumerator(); while (enumerator2.MoveNext()) { this.SetNewbieGuideComplete(enumerator2.get_Current(), bReset, false, sync); } }
private void CheckForceSkipCondition(NewbieGuideSkipConditionType type, params uint[] param) { ListView <NewbieGuideMainLineConf> newbieGuideMainLineConfListBySkipType = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConfListBySkipType(type); int count = newbieGuideMainLineConfListBySkipType.Count; for (int i = 0; i < count; i++) { NewbieGuideMainLineConf conf = newbieGuideMainLineConfListBySkipType[i]; if (!this.IsMianLineComplete(conf.dwID)) { for (int j = 0; j < conf.astSkipCondition.Length; j++) { if ((((NewbieGuideSkipConditionType)conf.astSkipCondition[j].wType) == type) && NewbieGuideCheckSkipConditionUtil.CheckSkipCondition(conf.astSkipCondition[j], param)) { if (null != this.mCurrentScriptControl) { if (this.mCurrentScriptControl.currentMainLineId == conf.dwID) { continue; } this.SetNewbieGuideComplete(conf.dwID, false, false); } else { this.SetNewbieGuideComplete(conf.dwID, false, false); } break; } } } } }
private void Start() { OpenGuideForm(); this.mConfList = Singleton <NewbieGuideDataManager> .GetInstance().GetScriptList(this.currentMainLineId); if (this.mConfList == null) { this.CompleteAll(); } else { NewbieGuideMainLineConf newbieGuideMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConf(this.currentMainLineId); if (newbieGuideMainLineConf != null) { this.mSavePoint = newbieGuideMainLineConf.iSavePoint; if (this.startIndex > 0) { this.SetCurrentScriptIndex(this.startIndex - 1); } else { this.SetCurrentScriptIndex(0); } this.CheckNext(); } } }
private bool CheckTrigger(NewbieGuideTriggerTimeType type, NewbieGuideMainLineConf conf) { if (this.CheckTriggerTime(conf) && this.CheckTriggerCondition(conf.dwID, conf.astTriggerCondition)) { int startIndexByTriggerTime = this.GetStartIndexByTriggerTime(type, conf); this.TriggerNewbieGuide(conf, startIndexByTriggerTime); return(true); } return(false); }
private void CompleteAll() { NewbieGuideScriptControl.CloseGuideForm(); this.curMainLineConf = null; this.currentMainLineId = 0u; if (this.CompleteEvent != null) { this.CompleteEvent(); } }
private void CompleteAll() { CloseGuideForm(); this.curMainLineConf = null; this.currentMainLineId = 0; if (this.CompleteEvent != null) { this.CompleteEvent(); } }
public List <uint> GetMainLineIDList() { List <uint> list = new List <uint>(); int length = this.mMainLineCacheArr.Length; for (int i = 0; i < length; i++) { NewbieGuideMainLineConf conf = this.mMainLineCacheArr[i]; list.Add(conf.dwID); } return(list); }
private bool SortMainLineConf(NewbieGuideMainLineConf confA, NewbieGuideMainLineConf confB) { if (confA.dwPriority > confB.dwPriority) { return(false); } if ((confA.dwPriority >= confB.dwPriority) && (confA.dwID < confB.dwID)) { return(false); } return(true); }
private void TriggerNewbieGuide(NewbieGuideMainLineConf conf, int startIndex) { if (Singleton <NetworkModule> .GetInstance().lobbySvr.connected || (conf.bIndependentNet == 1)) { this.SetCurrentNewbieGuideId(conf.dwID); this.mCurrentScriptControl = base.gameObject.AddComponent <NewbieGuideScriptControl>(); this.mCurrentScriptControl.CompleteEvent += new NewbieGuideScriptControl.NewbieGuideScriptControlDelegate(this.NewbieGuideCompleteHandler); this.mCurrentScriptControl.SaveEvent += new NewbieGuideScriptControl.NewbieGuideScriptControlDelegate(this.NewbieGuideSaveHandler); this.mCurrentScriptControl.SetData(conf.dwID, startIndex); this.mCurrentScriptControl.addScriptDelegate = addScriptDelegate; } }
public NewbieGuideMainLineConf GetNewbieGuideMainLineConf(uint id) { int length = this.mMainLineCacheArr.Length; for (int i = 0; i < length; i++) { NewbieGuideMainLineConf conf = this.mMainLineCacheArr[i]; if (conf.dwID == id) { return(conf); } } return(null); }
public bool IsContainsTriggerTimeType(NewbieGuideMainLineConf data, NewbieGuideTriggerTimeType type, uint[] param) { int num = data.astTriggerTime.Length; for (int i = 0; i < num; i++) { NewbieGuideTriggerTimeItem newbieGuideTriggerTimeItem = data.astTriggerTime[i]; if (type == (NewbieGuideTriggerTimeType)newbieGuideTriggerTimeItem.wType && NewbieGuideCheckTriggerTimeUtil.CheckTriggerTime(newbieGuideTriggerTimeItem, param)) { return(true); } } return(false); }
public bool IsContainsTriggerTimeType(NewbieGuideMainLineConf data, NewbieGuideTriggerTimeType type, uint[] param) { int length = data.astTriggerTime.Length; for (int i = 0; i < length; i++) { NewbieGuideTriggerTimeItem time = data.astTriggerTime[i]; if ((type == ((NewbieGuideTriggerTimeType)time.wType)) && NewbieGuideCheckTriggerTimeUtil.CheckTriggerTime(time, param)) { return(true); } } return(false); }
private void SortMainLineList(NewbieGuideMainLineConf[] list) { for (int i = 1; i < list.Length; i++) { NewbieGuideMainLineConf newbieGuideMainLineConf = list[i]; int num = i; while (num > 0 && this.SortMainLineConf(list[num - 1], newbieGuideMainLineConf)) { list[num] = list[num - 1]; num--; } list[num] = newbieGuideMainLineConf; } }
private void SortMainLineList(NewbieGuideMainLineConf[] list) { for (int i = 1; i < list.Length; i++) { NewbieGuideMainLineConf confB = list[i]; int index = i; while ((index > 0) && this.SortMainLineConf(list[index - 1], confB)) { list[index] = list[index - 1]; index--; } list[index] = confB; } }
private int GetStartIndexByTriggerTime(NewbieGuideTriggerTimeType type, NewbieGuideMainLineConf conf) { int length = conf.astTriggerTime.Length; for (int i = 0; i < length; i++) { NewbieGuideTriggerTimeItem item = conf.astTriggerTime[i]; if (type == ((NewbieGuideTriggerTimeType)item.wType)) { return((int)item.dwStartIndex); } } return(0); }
public ListView <NewbieGuideMainLineConf> GetNewbieGuideMainLineConfListByTriggerTimeType(NewbieGuideTriggerTimeType type, uint[] param) { this.mCacheMainLineSourceList.Clear(); this.mCacheMainLineSourceList.AddRange(this.mMainLineCacheArr); this.mCacheMainLineTargetList.Clear(); int count = this.mCacheMainLineSourceList.Count; for (int i = 0; i < count; i++) { NewbieGuideMainLineConf data = this.mCacheMainLineSourceList[i]; if (this.IsContainsTriggerTimeType(data, type, param)) { this.mCacheMainLineTargetList.Add(data); } } return(this.mCacheMainLineTargetList); }
public bool CheckTriggerTime(NewbieGuideTriggerTimeType type, params uint[] param) { if (!this.newbieGuideEnable) { return(false); } if (!this.m_IsCheckSkip) { return(false); } if (this.currentNewbieGuideId == 0u) { ListView <NewbieGuideMainLineConf> newbieGuideMainLineConfListByTriggerTimeType = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConfListByTriggerTimeType(type, param); int count = newbieGuideMainLineConfListByTriggerTimeType.get_Count(); for (int i = 0; i < count; i++) { NewbieGuideMainLineConf conf = newbieGuideMainLineConfListByTriggerTimeType.get_Item(i); if (this.CheckTrigger(type, conf)) { if (Singleton <NewbieWeakGuideControl> .get_instance().isGuiding) { Singleton <NewbieWeakGuideControl> .get_instance().RemoveAllEffect(); } return(true); } } ListView <NewbieWeakGuideMainLineConf> newBieGuideWeakMainLineConfListByTiggerTimeType = Singleton <NewbieGuideDataManager> .GetInstance().GetNewBieGuideWeakMainLineConfListByTiggerTimeType(type, param); count = newBieGuideWeakMainLineConfListByTiggerTimeType.get_Count(); for (int j = 0; j < count; j++) { NewbieWeakGuideMainLineConf conf2 = newBieGuideWeakMainLineConfListByTiggerTimeType.get_Item(j); if (this.TriggerWeakNewbieGuide(conf2, type, true)) { return(true); } } } return(false); }
public ListView <NewbieGuideMainLineConf> GetNewbieGuideMainLineConfListBySkipType(NewbieGuideSkipConditionType type) { this.mCacheMainLineSourceList.Clear(); this.mCacheMainLineSourceList.AddRange(this.mMainLineCacheArr); ListView <NewbieGuideMainLineConf> listView = new ListView <NewbieGuideMainLineConf>(); int count = this.mCacheMainLineSourceList.get_Count(); for (int i = 0; i < count; i++) { NewbieGuideMainLineConf newbieGuideMainLineConf = this.mCacheMainLineSourceList.get_Item(i); for (int j = 0; j < newbieGuideMainLineConf.astSkipCondition.Length; j++) { if ((NewbieGuideSkipConditionType)newbieGuideMainLineConf.astSkipCondition[j].wType == type) { listView.Add(newbieGuideMainLineConf); break; } } } return(listView); }
public ListView <NewbieGuideMainLineConf> GetNewbieGuideMainLineConfListBySkipType(NewbieGuideSkipConditionType type) { this.mCacheMainLineSourceList.Clear(); this.mCacheMainLineSourceList.AddRange(this.mMainLineCacheArr); ListView <NewbieGuideMainLineConf> view = new ListView <NewbieGuideMainLineConf>(); int count = this.mCacheMainLineSourceList.Count; for (int i = 0; i < count; i++) { NewbieGuideMainLineConf item = this.mCacheMainLineSourceList[i]; for (int j = 0; j < item.astSkipCondition.Length; j++) { if (((NewbieGuideSkipConditionType)item.astSkipCondition[j].wType) == type) { view.Add(item); break; } } } return(view); }
private bool CheckTriggerTime(NewbieGuideMainLineConf conf) { if ((this.IsMianLineComplete(conf.dwID) && (conf.iSavePoint != -1)) || Singleton <WatchController> .instance.IsWatching) { return(false); } bool flag = true; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { if (conf.wTriggerLevelUpperLimit > 0) { flag &= masterRoleInfo.PvpLevel <= conf.wTriggerLevelUpperLimit; } if (conf.wTriggerLevelLowerLimit > 0) { flag &= masterRoleInfo.PvpLevel >= conf.wTriggerLevelLowerLimit; } } return(flag); }
public void ForceCompleteNewbieGuide() { if (this.mCompleteCacheDic.ContainsKey(this.mCurrentNewbieGuideId) && !this.mCompleteCacheDic[this.mCurrentNewbieGuideId]) { NewbieGuideMainLineConf newbieGuideMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConf(this.mCurrentNewbieGuideId); if (newbieGuideMainLineConf != null) { int length = newbieGuideMainLineConf.astSetCompleteId.Length; for (int i = 0; i < length; i++) { if (newbieGuideMainLineConf.astSetCompleteId[i].dwID != 0) { uint dwID = newbieGuideMainLineConf.astSetCompleteId[i].dwID; if (dwID <= WEAKGUIDE_BIT_OFFSET) { this.SetNewbieGuideComplete(dwID, false, true); } else { this.SetWeakGuideComplete(dwID - ((uint)WEAKGUIDE_BIT_OFFSET), true); } } } } if (newbieGuideMainLineConf != null) { this.SetNewbieGuideComplete(this.mCurrentNewbieGuideId, true, false); } } if (null != this.mCurrentScriptControl) { this.mCurrentScriptControl.Stop(); this.DestroyCurrentScriptControl(); } }
private bool SortMainLineConf(NewbieGuideMainLineConf confA, NewbieGuideMainLineConf confB) { return(confA.dwPriority <= confB.dwPriority && (confA.dwPriority < confB.dwPriority || confA.dwID >= confB.dwID)); }
public void SetData(uint id, int startIndex) { this.currentMainLineId = id; this.startIndex = startIndex; this.curMainLineConf = Singleton <NewbieGuideDataManager> .GetInstance().GetNewbieGuideMainLineConf(this.currentMainLineId); }