Example #1
0
    public static void ShowEquipWindowByPos(EPosType posType, int pos)
    {
        GTWindowManager.Instance.OpenWindow(EWindowID.UIEquip);
        UIEquip window = (UIEquip)GTWindowManager.Instance.GetWindow(EWindowID.UIEquip);

        window.ShowEquipWindowByPos(posType, pos);
    }
Example #2
0
    public Dictionary <int, XItem> GetItemDataByPosType(EPosType posType)
    {
        switch (posType)
        {
        case EPosType.BagItem:
            return(DataDBSBagItem.Dict);

        case EPosType.BagChip:
            return(DataDBSBagChip.Dict);

        case EPosType.BagFashion:
            return(DataDBSBagFashion.Dict);

        case EPosType.BagGem:
            return(DataDBSBagGem.Dict);

        case EPosType.BagRune:
            return(DataDBSBagRune.Dict);

        case EPosType.RoleEquip:
            return(DataDBSDressEquip.Dict);

        case EPosType.RoleFashion:
            return(DataDBSDressFashion.Dict);

        case EPosType.RoleGem:
            return(DataDBSDressGem.Dict);

        case EPosType.RoleRune:
            return(DataDBSDressRune.Dict);

        default:
            return(new Dictionary <int, XItem>());
        }
    }
Example #3
0
        protected override void LoadDescribe(byte[] data, EPosType ePosType)
        {
            base.LoadDescribe(data, ePosType);

            UpdaterMgr.CodeData = data;
            FinishHandle?.Invoke(this);
        }
Example #4
0
    public void ShowViewByPos(EPosType posType, int pos)
    {
        this.mPos     = pos;
        this.mPosType = posType;
        ShowDress(posType == EPosType.RoleEquip);
        XEquip equip = GTDataManager.Instance.GetEquipDataByPos(mPosType, mPos);

        if (equip == null)
        {
            return;
        }
        int itemID = equip.Id;

        ShowBaseView(itemID);
        equipFightValue.text   = GTTools.Format("战斗力 {0}", GTAttrHelper.GetFightValue(equip));
        equipAdvanceLevel.text = MLEquip.Instance.GetEquipAdvanceNameByLevel(equip.AdvanceLevel);
        Dictionary <EAttr, int> propertys = GTAttrHelper.GetPropertys(equip);

        title3.text = GTTools.Format("装备星级 {0}", equip.StarLevel);
        title2.text = GTTools.Format("进阶等级 {0}", equip.AdvanceLevel);
        title1.text = GTTools.Format("强化等级 {0}", equip.StrengthenLevel);
        GTItemHelper.ShowPropertyText(this.equipPropertys, propertys, true);
        GTItemHelper.ShowEquipStrengthText(text1, itemID, equip.StrengthenLevel);
        GTItemHelper.ShowEquipAdvanceText(text2, itemID, equip.AdvanceLevel);
        GTItemHelper.ShowEquipStarText(text3, itemID, equip.StarLevel);
    }
Example #5
0
    public void ShowInfoByPos(EPosType posType, int pos)
    {
        this.mPos     = pos;
        this.mPosType = posType;
        bool isDress = (posType == EPosType.RoleGem);

        ShowDress(isDress);
        XGem gem    = GTDataManager.Instance.GetGemDataByPos(posType, pos);
        int  itemID = gem.Id;
        DGem gemDB  = ReadCfgGem.GetDataById(itemID);

        gemLevel.text      = GTTools.Format("等级 {0}", gem.StrengthenLevel);
        gemFightValue.text = GTTools.Format("战斗力 {0}", AttrHelper.GetFightValue(gem));
        ShowBaseView(itemID);
        GTItemHelper.ShowGemPropertyText(gemPropertys, itemID, gem.StrengthenLevel);
        DGemSuit suitDB        = ReadCfgGemSuit.GetDataById(gemDB.Suit);
        int      activeSuitNum = isDress ? GemModule.Instance.GetActiveSameSuitsCountByPos(pos) : 0;
        bool     hasSuit       = ReadCfgGemSuit.ContainsKey(gemDB.Suit);

        if (hasSuit)
        {
            ShowHasSuit(gemDB);
            ShowSuitPropertysView(activeSuitNum, suitDB);
            ShowSameSuitGemsView(gemDB.Id);
        }
        else
        {
            ShowNoSuit();
        }
    }
Example #6
0
    public static void ShowGemWindowByPos(EPosType posType, int pos)
    {
        GTWindowManager.Instance.OpenWindow(EWindowID.UIGem);
        UIGem window = (UIGem)GTWindowManager.Instance.GetWindow(EWindowID.UIGem);

        window.ShowWindowByPos(posType, pos);
    }
Example #7
0
 public float DoComp(float value, EConType conType, EPosType posType, EAxis pointType)
 {
     if (ContainsKey(conType))
     {
         value = this[conType].DoComp(value, posType, pointType);
     }
     return(value);
 }
Example #8
0
    public static void ShowItemDialogByPosType(EPosType posType, int pos)
    {
        Dictionary <int, XItem> dict = GTDataManager.Instance.GetItemDataByPosType(posType);

        if (!dict.ContainsKey(pos))
        {
            return;
        }
        switch (posType)
        {
        case EPosType.RoleEquip:
            GTWindowManager.Instance.OpenWindow(EWindowID.UIEquipInfo);
            UIEquipInfo window1 = (UIEquipInfo)GTWindowManager.Instance.GetWindow(EWindowID.UIEquipInfo);
            window1.ShowViewByPos(EPosType.RoleEquip, pos);
            break;

        case EPosType.RoleGem:
            GTWindowManager.Instance.OpenWindow(EWindowID.UIGemInfo);
            UIGemInfo window2 = (UIGemInfo)GTWindowManager.Instance.GetWindow(EWindowID.UIGemInfo);
            window2.ShowViewByPos(EPosType.RoleGem, pos);
            break;

        case EPosType.RoleFashion:
            break;

        case EPosType.RoleRune:
            break;

        case EPosType.BagItem:
            ShowItemDialogByBagType(EBagType.ITEM, pos);
            break;

        case EPosType.BagGem:
            GTWindowManager.Instance.OpenWindow(EWindowID.UIGemInfo);
            UIGemInfo window6 = (UIGemInfo)GTWindowManager.Instance.GetWindow(EWindowID.UIGemInfo);
            window6.ShowViewByPos(EPosType.BagGem, pos);
            break;

        case EPosType.BagChip:
            GTWindowManager.Instance.OpenWindow(EWindowID.UIChipInfo);
            UIChipInfo window7 = (UIChipInfo)GTWindowManager.Instance.GetWindow(EWindowID.UIChipInfo);
            window7.ShowViewByPos(pos);
            break;

        case EPosType.BagFashion:

            break;

        case EPosType.BagRune:
            break;

        default:
            break;
        }
    }
Example #9
0
    public XEquip GetEquipDataByPos(EPosType posType, int pos)
    {
        Dictionary <int, XItem> dict = GetItemDataByPosType(posType);
        XItem item = null;

        dict.TryGetValue(pos, out item);
        if (item == null)
        {
            return(null);
        }
        XEquip equip = null;

        DataDBSEquip.Dict.TryGetValue(item.Instance, out equip);
        return(equip);
    }
Example #10
0
        public void Set(float value, EConType conType, EPosType posType, EAxis pointType)
        {
            CompPOS pos;

            if (ContainsKey(conType))
            {
                pos = this[conType];
            }
            else
            {
                pos = new CompPOS();
                Add(conType, pos);
            }
            pos.Set(value, posType, pointType);
        }
Example #11
0
    public XGem   GetGemDataByPos(EPosType posType, int pos)
    {
        Dictionary <int, XItem> dict = GetItemDataByPosType(posType);
        XItem item = null;

        dict.TryGetValue(pos, out item);
        if (item == null)
        {
            return(null);
        }
        XGem gem = null;

        DataDBSGem.Dict.TryGetValue(item.Instance, out gem);
        return(gem);
    }
Example #12
0
    private void OnAck_StrengthGem(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        AckStrengthGem         ack = Serializer.Deserialize <AckStrengthGem>(ms);
        XGem         gem           = ack.TarGem;
        List <XItem> list          = ack.UseItems;

        DGem gemDB           = ReadCfgGem.GetDataById(gem.Id);
        int  addExpNum       = MLGem.Instance.GetExpByStrengthMatList(list);
        int  strengthenLevel = gem.StrengthenLevel;

        int       levelID = gemDB.Quality * 1000 + strengthenLevel + 1;
        DGemLevel db      = ReadCfgGemLevel.GetDataById(levelID);
        int       expNum  = db.RequireExp - gem.StrengthenExp;

        while (addExpNum >= expNum)
        {
            strengthenLevel++;
            levelID = gemDB.Quality * 1000 + strengthenLevel + 1;
            db      = ReadCfgGemLevel.GetDataById(levelID);
            expNum += db.RequireExp;
        }
        gem.StrengthenLevel = strengthenLevel;
        gem.StrengthenExp   = addExpNum + db.RequireExp - expNum;

        DataDBSGem.Update(gem.Instance, gem);
        GTDataManager.Instance.UseMoney(db.CostMoneyId, expNum);
        for (int i = 0; i < list.Count; i++)
        {
            XItem    item    = list[i];
            EPosType posType = (EPosType)item.PosType;
            switch (posType)
            {
            case EPosType.BagItem:
                GTDataManager.Instance.UseItemById(item.Id, item.Num);
                break;

            case EPosType.BagGem:
                GTDataManager.Instance.DelBagGem(item.Pos);
                break;
            }
        }

        GTWorld.Instance.SyncMainPlayerData(ESyncDataType.TYPE_BASEATTR);
        GTEventCenter.FireEvent(GTEventID.TYPE_BAG_STRENGTHEN_GEM);
        GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_FIGHTVALUE);
    }
Example #13
0
    public XEquip GetXEquipByPos(EPosType posType, int pos)
    {
        Dictionary <int, XItem> dict = GetItemDataByPosType(posType);

        if (!dict.ContainsKey(pos))
        {
            return(null);
        }
        XItem  itemPos = dict[pos];
        XEquip equip   = null;

        if (Equips.ContainsKey(itemPos.Instance))
        {
            equip = Equips[itemPos.Instance];
        }
        return(equip);
    }
Example #14
0
    public int[] GetPosByType(EPosType type)
    {
        switch (type)
        {
        case EPosType.Medical: return(MedicalType);

        case EPosType.Repair:  return(RepairType);

        case EPosType.Computer: return(ComputerType);

        case EPosType.Tent: return(TentType);

        default:
            return(null);
        }
        //return null;
    }
Example #15
0
    public XGem GetXGemByPos(EPosType posType, int pos)
    {
        Dictionary <int, XItem> dict = GetItemDataByPosType(posType);

        if (!dict.ContainsKey(pos))
        {
            return(null);
        }
        XItem itemPos = dict[pos];
        XGem  gem     = null;

        if (Gems.ContainsKey(itemPos.Instance))
        {
            gem = Gems[itemPos.Instance];
        }
        return(gem);
    }
Example #16
0
 //加载资源文件
 protected virtual void LoadDescribe(byte[] data, EPosType ePosType)
 {
 }
Example #17
0
        protected override void LoadDescribe(byte[] data, EPosType ePosType)
        {
            base.LoadDescribe(data, ePosType);

            Dictionary <uint, long> tmpNewestDescDict = ResourcesSystem.LoadResDescInfo(data);

            mResInfoDict = tmpNewestDescDict;

            //包内资源 不需要作比对
            if (EPosType.ApkInner == ePosType)
            {
                Finish();
                return;
            }

            TextAsset tmpTextAsset = Resources.Load <TextAsset>(ApkVersionData.ResDescCrc.ToString());

            if (null == tmpTextAsset)
            {
                Logger.LogError($"包内找不到资源描述文件 {ApkVersionData.ResDescCrc}");
                Failed();
                return;
            }

            Dictionary <uint, long> tmpApkResDescDict    = ResourcesSystem.LoadResDescInfo(tmpTextAsset.bytes);
            List <uint>             tmpInLocalResKeyList = new List <uint>();

            var tmpIter = tmpNewestDescDict.GetEnumerator();

            while (tmpIter.MoveNext())
            {
                var tmpKV      = tmpIter.Current;
                var tmpResInfo = ResourcesSystem.ResFlag2Info(tmpKV.Value);

                long tmpApkResFlag = 0;
                //此资源在初始包资源里
                if (tmpApkResDescDict.TryGetValue(tmpKV.Key, out tmpApkResFlag))
                {
                    //此资源hash值未变动/资源未变更
                    if (tmpResInfo.FileHash == (uint)tmpApkResFlag)
                    {
                        continue;
                    }
                }

                //更改此资源位置描述 ->本地
                tmpInLocalResKeyList.Add(tmpKV.Key);

                //如此资源不存在于本地 需从资源服下载
                if (!File.Exists($"{LocalPath}/{tmpResInfo.FileHash}"))
                {
                    mBeDownloadResKey.Enqueue(tmpKV.Key);
                    TotalSize += tmpResInfo.ResSize;
                }

                tmpResInfo.Dispose();
            }

            //更改资源位置描述 -> 本地
            for (int i = 0, max = tmpInLocalResKeyList.Count; i < max; ++i)
            {
                uint tmpKey     = tmpInLocalResKeyList[i];
                long tmpResFlag = tmpNewestDescDict[tmpKey];
                var  tmpResInfo = ResourcesSystem.ResFlag2Info(tmpResFlag);
                tmpResInfo.ResPos = ResourcesSystem.EResPos.Persistent;

                tmpNewestDescDict[tmpKey] = ResourcesSystem.ResInfo2Flag(tmpResInfo);
                tmpResInfo.Dispose();
            }

            if (TotalSize > 1)
            {
                CheckFinishHandle?.Invoke(this);
            }
            else
            {
                Finish();
            }
        }
Example #18
0
 public void ShowEquipWindowByPos(EPosType posType, int pos)
 {
     mPosType = posType;
     mPos     = pos;
     ShowView();
 }