| | |
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class PackModelInterface : Model, IBeforePlayerDataInitialize
|
| | | public class PackModelInterface : Model, IBeforePlayerDataInitialize,IPlayerLoginOk
|
| | | {
|
| | | private ItemConfig tagChinModel;
|
| | | private FuncConfigConfig _equipGSFormula;
|
| | |
| | | itemEffectCDDict.Clear();
|
| | | itemEffectTimelist.Clear();
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | |
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return false;
|
| | |
|
| | | int startLockIndex = singlePack.openGridCount - GetInitGridCount(PackType.rptItem);
|
| | | int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt;
|
| | | FuncConfigConfig _tagFuncModel = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("OpenBagItem");
|
| | | int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId);
|
| | | Equation.Instance.Clear();
|
| | |
| | | RefreshPickItemEvent(type,guid);
|
| | | }
|
| | | }
|
| | |
|
| | | Dictionary<int, ItemModel> RealmBetterDict = new Dictionary<int, ItemModel>();
|
| | | public Dictionary<int, ItemModel> CheckBetterEquipByRealm()
|
| | | {
|
| | | RealmBetterDict.Clear();
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlePack == null) return RealmBetterDict;
|
| | |
|
| | | int realmLv = PlayerDatas.Instance.baseData.realmLevel;
|
| | | Dictionary<int,ItemModel> pairs = singlePack.GetPackModelIndexDict();
|
| | | foreach(var model in pairs.Values)
|
| | | {
|
| | | if(model.chinItemModel.EquipPlace > 0
|
| | | && model.chinItemModel.EquipPlace != (int)RoleEquipType.retSpiritAnimal
|
| | | && model.chinItemModel.RealmLimit <= realmLv
|
| | | && !IsOverdue(model.itemInfo.ItemGUID,model.itemId,model.useDataDict)
|
| | | && IsFightUp(model.itemId,model.equipScore) == 1)
|
| | | {
|
| | | if(!RealmBetterDict.ContainsKey(model.EquipPlace))
|
| | | {
|
| | | RealmBetterDict.Add(model.EquipPlace,model);
|
| | | }
|
| | | else
|
| | | {
|
| | | if(model.equipScore > RealmBetterDict[model.EquipPlace].equipScore)
|
| | | {
|
| | | RealmBetterDict[model.EquipPlace] = model;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return RealmBetterDict;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 解锁格子
|
| | |
|
| | | public int GetInitGridCount(PackType type)
|
| | | {
|
| | | FuncConfigConfig initGridCount = null;
|
| | | if (type == PackType.rptItem)
|
| | | initGridCount = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitBagCellCount");
|
| | | else if (type == PackType.rptWarehouse)
|
| | | initGridCount = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitDepotCellCount");
|
| | |
|
| | | return int.Parse(initGridCount.Numerical1);
|
| | | }
|
| | |
|
| | | public void OpenGrid(int chooseGridCount, PackType type)
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(type);
|
| | | int openCount = chooseGridCount - singlePack.openGridCount;
|
| | | int index = chooseGridCount - GetInitGridCount(type);
|
| | | int index = 0;
|
| | | switch(type)
|
| | | {
|
| | | case PackType.rptItem:
|
| | | index = chooseGridCount - playerPack.InitBagGridCnt;
|
| | | break;
|
| | | case PackType.rptWarehouse:
|
| | | index = chooseGridCount - playerPack.InitDepotGridCnt;
|
| | | break;
|
| | | }
|
| | | itemTipsModel.SetExtendGirdModel(openCount,index, type);
|
| | | WindowCenter.Instance.Open<ExtendWin>();
|
| | | }
|