Пример #1
0
        public void UpdateRuneStoreData(cmd_Rune_InStore_Item storeItemdata)
        {
            int nRuneId = storeItemdata.nRuneId;
            SSchemeRuneConfig runeConfig = RunePage.Instance.allRunePageTable[nRuneId] as SSchemeRuneConfig;

            if (runeConfig == null)
            {
                return;
            }

            if (!dicRuneInlayTypeStoreInfo.ContainsKey((int)runeConfig.nRuneInlayType))
            {
                return;
            }

            int  nRuneInlayType = (int)runeConfig.nRuneInlayType;
            bool bHasRune       = false;

            foreach (RuneItemInfo runeItemInfo in dicRuneInlayTypeStoreInfo[nRuneInlayType])
            {
                if (runeItemInfo.nRuneId == nRuneId)
                {
                    runeItemInfo.nRuneNum += storeItemdata.nRuneNum;
                    bHasRune = true;
                    break;
                }
            }

            if (!bHasRune)
            {
                RuneItemInfo runeItemInfo = new RuneItemInfo();
                runeItemInfo.nRuneId  = nRuneId;
                runeItemInfo.nRuneNum = storeItemdata.nRuneNum;

                dicRuneInlayTypeStoreInfo[nRuneInlayType].Add(runeItemInfo);
            }

            UpdateRuneInlayTypeLeftStore();
            SetRuneChangeMessage();
        }
Пример #2
0
        // 更新左侧剩余符文缓存
        public void UpdateRuneInlayTypeLeftStore()
        {
            return;

            dicRuneInlayTypeLeftStoreInfo[(int)RuneType.ENUM_RUNETYPE_HALLMARK].Clear();
            dicRuneInlayTypeLeftStoreInfo[(int)RuneType.ENUM_RUNETYPE_GLYPH].Clear();
            dicRuneInlayTypeLeftStoreInfo[(int)RuneType.ENUM_RUNETYPE_SIGIL].Clear();
            dicRuneInlayTypeLeftStoreInfo[(int)RuneType.ENUM_RUNETYPE_CREAM].Clear();
            foreach (int nRuneInlayType in dicRuneInlayTypeStoreInfo.Keys)
            {
                foreach (RuneItemInfo runeItemInfo in dicRuneInlayTypeStoreInfo[nRuneInlayType])
                {
                    int nSlotRuneCount = 0;
                    foreach (int nRuneId in uCurRunePageData.dRuneTempSlotInfo.Values)
                    {
                        if (nRuneId == runeItemInfo.nRuneId)
                        {
                            nSlotRuneCount++;
                        }
                    }

                    int nRuneCount = runeItemInfo.nRuneNum - nSlotRuneCount;
                    if (nRuneCount <= 0)
                    {
                        continue;
                    }

                    RuneItemInfo newRuneItemInfo = new RuneItemInfo();
                    newRuneItemInfo.nRuneId  = runeItemInfo.nRuneId;
                    newRuneItemInfo.nRuneNum = nRuneCount;
                    dicRuneInlayTypeLeftStoreInfo[nRuneInlayType].Add(newRuneItemInfo);
                }
            }

            SetRuneChangeMessage();
        }
Пример #3
0
        /////////////////////////////////////////////////////数据载入区///////////////////////////////////////////////////////

        public bool ReceiveSelfEntityViewRuneInfo(ref IntPtr ptrParam, int nPtrLen)
        {
            runePageDataManager.Clear();
            // 先压出个人全部符文store
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);
            cmd_count storeCountData      = helper.get <cmd_count>();
            int       nStoreCount         = storeCountData.nCount;

            for (int k = 0; k < nStoreCount; k++)
            {
                cmd_Rune_InStore_Item storeItemdata = helper.get <cmd_Rune_InStore_Item>();
                int nRuneId = storeItemdata.nRuneId;
                SSchemeRuneConfig runeConfig = RunePage.Instance.allRunePageTable[nRuneId] as SSchemeRuneConfig;
                if (runeConfig == null)
                {
                    continue;
                }

                RuneItemInfo runeItemInfo = new RuneItemInfo();
                runeItemInfo.nRuneId  = nRuneId;
                runeItemInfo.nRuneNum = storeItemdata.nRuneNum;

                dicRuneInlayTypeStoreInfo[(int)runeConfig.nRuneInlayType].Add(runeItemInfo);
            }

            // 再压出每个符文页的详细信息
            cmd_count runePagedata   = helper.get <cmd_count>();
            int       nRunePageCount = runePagedata.nCount;

            this.nMaxSortIndex = nRunePageCount;
            for (int i = 0; i < runePagedata.nCount; ++i)
            {
                NewPagePointsItem(i + 1);
                if (uCurRunePageData == null)
                {
                    continue;
                }

                cmd_Rune_Single_PageInfo data = helper.get <cmd_Rune_Single_PageInfo>();
                for (int j = 0; j < data.nRuneGroove.Length; j++)
                {
                    int nRuneId = data.nRuneGroove[j];
                    SetRunePagePointsInfo(j + 1, nRuneId, true);
                }

                if (data.sRunePageName == "")
                {
                    uCurRunePageData.sTempName = "RunePage" + (i + 1);
                }
                else
                {
                    uCurRunePageData.sTempName = data.sRunePageName;
                }

                this.SetRunePageChange(true, true);
                uCurRunePageData.SetSaveData();                                // 必须有数据改变才保存
                this.SetRunePageChange(false, true);
                int nDataBaseIndex = data.nPageIndex;
                lTopButtonDataIndex.Add(nDataBaseIndex);                        // 储存数据库页数 因为数据库创建删除都是根据数据库页数来的,避免重复

                if (nMaxDataIndex < nDataBaseIndex)
                {
                    nMaxDataIndex = nDataBaseIndex;
                }
            }

            uCurRunePageData = runePageDataManager[0];
            CopySelfRunePageDateManagerInfo();
            UpdateRuneInlayTypeLeftStore();
            SetRuneChangeMessage();
            return(true);
        }