public void UpdateCrownAllPageData(IntPtr ptrParam, int nPtrLen) { CrownPageDic.Clear(); //curPageItemData = null; IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen); cmd_count countData = helper.get <cmd_count>(); int nCount = countData.nCount; for (int i = 0; i < nCount; i++) { cmd_Crown_Page_Item_Info data = helper.get <cmd_Crown_Page_Item_Info>(); CrownPageItemData pageData = new CrownPageItemData(); pageData.nPageTextIndex = i + 1; pageData.reviseData = data; pageData.DoSaveData(); CrownPageDic[data.nPageDBID] = pageData; if (curPageItemData == null) { curPageItemData = pageData; } } UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CROWNPAGE_UPDATEVIEW, null); RefreshGemstoneRedPoint(); }
public void DeleteCurCrownPage() { if (curPageItemData == null || CrownPageDic == null || CrownPageDic.Count <= 2) { return; } CrownPageItemData newPageItemData = null; int nSeachIndex = curPageItemData.nPageTextIndex == CrownPageDic.Count - 1?curPageItemData.nPageTextIndex - 1:curPageItemData.nPageTextIndex + 1; foreach (CrownPageItemData item in CrownPageDic.Values) { if (item.nPageTextIndex == nSeachIndex) { newPageItemData = item; break; } } if (newPageItemData == null) { return; } SendDeleteCrownPageMessage(); CrownPageDic.Remove(curPageItemData.nPageDBID); curPageItemData = newPageItemData; SendCrownViewUpdateMessage(); }
public void Clear() { CrownPageDic.Clear(); m_gemStoneDic.Clear(); m_crownOtherPageDic.Clear(); m_gemStoneOtherDic.Clear(); }
public bool ChangeCrownPage(int nPageIndex) { if (nPageIndex <= 0) { return(false); } if (CrownPageDic == null || CrownPageDic.Count <= 0) { return(false); } if (curPageItemData != null && curPageItemData.nPageTextIndex == nPageIndex) { return(false); } if (curPageItemData != null) { if (curPageItemData.IsChange()) { SaveCurCrownPage(); } } int nPageDBID = 0; foreach (CrownPageItemData pageItem in CrownPageDic.Values) { if (pageItem.nPageTextIndex == nPageIndex) { nPageDBID = pageItem.nPageDBID; break; } } if (nPageDBID <= 0) { return(false); } CrownPageDic.TryGetValue(nPageDBID, out curPageItemData); SendCrownViewUpdateMessage(); RefreshGemstoneRedPoint(); return(true); }
public bool OtherChangeCrownPage(int nPageIndex) { if (nPageIndex <= 0) { return(false); } if (CrownPageDic == null || CrownPageDic.Count <= 0) { return(false); } if (otherCurPageItemData != null && otherCurPageItemData.nPageTextIndex == nPageIndex) { return(false); } int nPageDBID = 0; foreach (CrownPageItemData pageItem in CrownPageDic.Values) { if (pageItem.nPageTextIndex == nPageIndex) { nPageDBID = pageItem.nPageDBID; break; } } if (nPageDBID <= 0) { return(false); } CrownPageDic.TryGetValue(nPageDBID, out otherCurPageItemData); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CROWNPAGE_UPDATEVIEW, null); return(true); }