Esempio n. 1
0
        public bool AddCurCrownPage()
        {
            if (curPageItemData == null || CrownPageDic.Count >= 10)
            {
                return(false);
            }

            int nDBUniquePageIndexMax = 0;

            foreach (CrownPageItemData item in CrownPageDic.Values)
            {
                if (item.nPageDBID > nDBUniquePageIndexMax)
                {
                    nDBUniquePageIndexMax = item.nPageDBID;
                }
            }

            CrownPageItemData newPageData = new CrownPageItemData();

            newPageData.nPageDBID         = nDBUniquePageIndexMax + 1;
            newPageData.reviseData.szName = ULocalizationService.Instance.Get("UIView", "CrownGem", "GemPageName") + (CrownPageDic.Count + 1);
            newPageData.nPageTextIndex    = CrownPageDic.Count + 1;
            newPageData.DoSaveData();
            CrownPageDic[newPageData.nPageDBID] = newPageData;
            curPageItemData = newPageData;
            SendSaveCrownPageMessage();
            SendCrownViewUpdateMessage();
            RefreshGemstoneRedPoint();

            return(true);
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        public void RequestOtherPlayerCrownPageData()
        {
            if (EntityFactory.MainHeroView == null)
            {
                return;
            }

            if (LogicDataCenter.playerSystemDataManager.bRequestSelf)
            {
                return;
            }

            if (LogicDataCenter.playerSystemDataManager.nRequestPDBID == EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID))
            {
                return;
            }

            m_crownOtherPageDic.Clear();
            m_gemStoneOtherDic.Clear();
            otherCurPageItemData = null;

            cmd_Crown_Request_Other_Page msgInfo = new cmd_Crown_Request_Other_Page();

            msgInfo.RequestFriendID = (uint)LogicDataCenter.playerSystemDataManager.nRequestPDBID;
            EntityEventHelper.Instance.SendCommand <cmd_Crown_Request_Other_Page>(EntityFactory.MainHeroID, EntityLogicDef.ENTITY_CMD_CROWN_DOTHER_PAGE, ref msgInfo);
        }
Esempio n. 5
0
        public void ShowOfCrownPage()
        {
            CrownPageItemData pageData = LogicDataCenter.crownPageDataManager.curPageItemData;

            if (pageData == null)
            {
                return;
            }

            CreatureProperty Property = EntityFactory.MainHeroView.Property;

            if (Property == null)
            {
                return;
            }

            ChatSubItemText_CrownGemstoneInfo.ShareToInputField(Property.CreatureName, pageData.nFaceValue, pageData.nPowerValue,
                                                                Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID));
        }
Esempio n. 6
0
        public void UpdateOtherCrownAllPageData(IntPtr ptrParam, int nPtrLen)
        {
            m_crownOtherPageDic.Clear();
            m_gemStoneOtherDic.Clear();
            otherCurPageItemData = 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();

                m_crownOtherPageDic[data.nPageDBID] = pageData;

                if (otherCurPageItemData == null)
                {
                    otherCurPageItemData = pageData;
                }
            }

            cmd_count countData2 = helper.get <cmd_count>();

            for (int i = 0; i < countData2.nCount; i++)
            {
                cmd_Crown_Gemstone_Item_Info data = helper.get <cmd_Crown_Gemstone_Item_Info>();
                data.nSlotID = i;
                m_gemStoneOtherDic[data.nGemstoneDBID] = data;
            }

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CROWNPAGE_OTHERUPDATEVIEW, null);
        }