| | |
| | | |
| | | public class PackManager : GameSystemManager<PackManager> |
| | | { |
| | | public event Action<PackType> refrechPackEvent; //刷新整个背包数据 |
| | | |
| | | //物品(创建)刷新,可能批量创建注意效率; bool:true代表创建 false 刷新; 注意0707物品数量刷新不包含在此事件 |
| | | public event Action<PackType, string, bool> ChangeItemEvent; // 背包类型,GUID,是否创建 |
| | | |
| | | //删除物品,可能批量删除注意效率 |
| | | public event Action<PackType, string> DeleteItemEvent; // 背包类型,GUID |
| | | |
| | | // 单物品刷新 在得到新物品、物品数量的改变,清理该物品时均会触发 ; 但0725整个背包刷新不触发,如果有需要单独数量刷新事件另外处理 |
| | | // 触发比较频繁,界面使用时可以做个汇总后延迟刷新 |
| | | public event Action<PackType, int, int> RefreshItemEvent; //背包类型,位置索引,物品id |
| | | public event Action<PackType> gridRefreshEvent; //背包可用格子数刷新 |
| | | public event Action<int, int> useItemSuccessEvent; //物品使用成功 int 位置索引 int物品id |
| | | |
| | | public event Action<int> refreshItemDayUseCountEvent; //刷新物品每日使用数量 |
| | | public event Action<int> refreshItemSumUseCountEvent; //刷新物品总使用数量 |
| | | |
| | | public bool isPlayBetterEquipEffect { get; set; } //整理背包时是否播放特效 |
| | | |
| | | |
| | | private Dictionary<PackType, SinglePack> playerPackDict = new Dictionary<PackType, SinglePack>(); |
| | | private Dictionary<string, ItemModel> itemGUIDDict = new Dictionary<string, ItemModel>(); |
| | | |
| | | private Dictionary<int, int> PackGirdServerBuyCountDict = new Dictionary<int, int>(); //背包类型:购买格子的次数 |
| | | |
| | | //读表数据 |
| | | public Dictionary<int, int> PackMaxCountDict = new Dictionary<int, int>(); //背包类型:背包格子最大数量 |
| | | public Dictionary<int, int> PackInitCountDict = new Dictionary<int, int>(); //背包类型:初始数量 |
| | | public int initBagGridCount { get; private set; } //初始物品背包格子数 |
| | | public int[] itemPackSortTyps { get; private set; } //背包物品的按类型排序 |
| | | public List<string> composeItemGuidList = new List<string>(); //合成列表物品guid |
| | | |
| | | //开格子 |
| | | public Dictionary<int, int> openGirdMoneyDict = new Dictionary<int, int>(); //背包类型:消耗货币类型 |
| | | public Dictionary<int, int[]> openGirdMoneyValueDict = new Dictionary<int, int[]>(); //背包类型:消耗货币值(按次数定价) |
| | | public Dictionary<int, int[]> openGirdCountDict = new Dictionary<int, int[]>(); //背包类型:每次开的格子数量 |
| | | public static string StrengthAttrShift_RecordKey = ""; |
| | | public const string RecordKnapsackTitle = "RecordKnapsackTitle"; |
| | | |
| | |
| | | Dictionary<int, List<int>> sharedUseCountItemDict { get; set; } |
| | | bool isUpdatePlayerLv = false; |
| | | |
| | | //AlchemyModel alchemyModel { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } } |
| | | //ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } |
| | | |
| | | |
| | | |
| | | public int[] gameCashShow; //代金券特殊显示 除以100 |
| | | public int[] autoUseItemIDs; |
| | | public override void Init() |
| | | { |
| | |
| | | // } |
| | | // } |
| | | |
| | | ParseItemCount(); |
| | | |
| | | autoUseItemIDs = JsonMapper.ToObject<int[]>(FuncConfigConfig.Get("ItemTipsNum").Numerical2); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | // SysNotifyMgr.Instance.sysNotifyEvent -= RefreshSysInfo; |
| | | } |
| | | |
| | | public Dictionary<int, string> textCountShow = new Dictionary<int, string>(); |
| | | public int[] textCountShow2; |
| | | public List<int> gameCashShow = new List<int>(); |
| | | |
| | | public void ParseItemCount() |
| | | { |
| | | var textConfig = FuncConfigConfig.Get("ItemCountShow"); |
| | | var json = JsonMapper.ToObject(textConfig.Numerical1); |
| | | foreach (var key in json.Keys) |
| | | { |
| | | var itemID = int.Parse(key); |
| | | textCountShow[itemID] = json[key].ToString(); |
| | | } |
| | | |
| | | textCountShow2 = JsonMapper.ToObject<int[]>(textConfig.Numerical2); |
| | | gameCashShow = JsonMapper.ToObject<List<int>>(textConfig.Numerical3); |
| | | } |
| | | |
| | | |
| | | |
| | | private void OnFuncStateChangeEvent(int id) |
| | |
| | | // } |
| | | } |
| | | |
| | | public event Action<PackType> refrechPackEvent; //刷新整个背包数据 |
| | | |
| | | //物品(创建)刷新,可能批量创建注意效率; bool:true代表创建 false 刷新; 注意0707物品数量刷新不包含在此事件 |
| | | public event Action<PackType, string, bool> ChangeItemEvent; // 背包类型,GUID,是否创建 |
| | | |
| | | //删除物品,可能批量删除注意效率 |
| | | public event Action<PackType, string> DeleteItemEvent; // 背包类型,GUID |
| | | |
| | | // 单物品刷新 在得到新物品、物品数量的改变,清理该物品时均会触发 ; 但0725整个背包刷新不触发,如果有需要单独数量刷新事件另外处理 |
| | | // 触发比较频繁,界面使用时可以做个汇总后延迟刷新 |
| | | public event Action<PackType, int, int> RefreshItemEvent; //背包类型,位置索引,物品id |
| | | public event Action<PackType> gridRefreshEvent; //背包可用格子数刷新 |
| | | public event Action<int, int> useItemSuccessEvent; //物品使用成功 int 位置索引 int物品id |
| | | |
| | | public event Action<int> refreshItemDayUseCountEvent; //刷新物品每日使用数量 |
| | | public event Action<int> refreshItemSumUseCountEvent; //刷新物品总使用数量 |
| | | |
| | | public bool isPlayBetterEquipEffect { get; set; } //整理背包时是否播放特效 |
| | | |
| | | #region 接收服务端数据 |
| | | private Dictionary<PackType, SinglePack> playerPackDict = new Dictionary<PackType, SinglePack>(); |
| | | private Dictionary<string, ItemModel> itemGUIDDict = new Dictionary<string, ItemModel>(); |
| | | |
| | | |
| | | public void UpdatePack(H0725_tagRolePackRefreshEx packInfo) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | public void UpdateBuyPackGirdCount(HA207_tagSCPackBuyInfo netPack) |
| | | { |
| | | for (int i = 0; i < netPack.BuyInfoList.Length; i++) |
| | | { |
| | | PackGirdServerBuyCountDict[netPack.BuyInfoList[i].PackType] = netPack.BuyInfoList[i].BuyCnt; |
| | | } |
| | | } |
| | | |
| | | public int[] BuyPackGirdNeedData(PackType packType) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | public void UpdateUnlockedGridCount(H0724_tagRolePackCanUseCount useCount) |
| | | { |
| | |
| | | // } |
| | | // } |
| | | |
| | | #endregion |
| | | |
| | | #region 玩家装备特殊逻辑 |
| | | void ParseConfig() |
| | | { |
| | | |
| | | |
| | | ParsePackConfigIni(); |
| | | autoUseItemIDs = JsonMapper.ToObject<int[]>(FuncConfigConfig.Get("AutoUseItem").Numerical1); |
| | | var config= FuncConfigConfig.Get("InitBagCellCount"); |
| | | initBagGridCount = int.Parse(config.Numerical1); |
| | | PackInitCountDict = ConfigParse.ParseIntDict(config.Numerical2); |
| | | |
| | | config = FuncConfigConfig.Get("PackageSortPriority"); |
| | | itemPackSortTyps = ConfigParse.GetMultipleStr<int>(config.Numerical1); |
| | | ParsePackConfigIni(); |
| | | |
| | | config = FuncConfigConfig.Get("OpenPack"); |
| | | openGirdMoneyDict = ConfigParse.ParseIntDict(config.Numerical1); |
| | | openGirdMoneyValueDict = ConfigParse.ParseIntArrayDict(config.Numerical2); |
| | | openGirdCountDict = ConfigParse.ParseIntArrayDict(config.Numerical3); |
| | | |
| | | config = FuncConfigConfig.Get("ItemCountShow"); |
| | | gameCashShow = JsonMapper.ToObject<int[]>(config.Numerical1); |
| | | } |
| | | |
| | | void ParsePackConfigIni() |
| | |
| | | } |
| | | |
| | | return File.ReadAllLines(path); |
| | | } |
| | | |
| | | public int GetCanBuyPackGirdCount(PackType type) |
| | | { |
| | | if (!PackMaxCountDict.ContainsKey((int)type)) |
| | | { |
| | | return 0; |
| | | } |
| | | return PackMaxCountDict[(int)type] - GetSinglePack(type).unlockedGridCount; |
| | | } |
| | | |
| | | |
| | |
| | | const int ITEMPACK_REDKEY = 102011003; |
| | | Redpoint redpointItemPack = new Redpoint(MainRedDot.RedPoint_BagFuncKey, ITEMPACK_REDKEY); |
| | | |
| | | const int LS_REDKEY = 102011015; |
| | | Redpoint redpointLS = new Redpoint(MainRedDot.RedPoint_BagFuncKey, LS_REDKEY); |
| | | |
| | | |
| | | private void UpdatePackRedpoint(PackType type) |
| | | { |
| | |
| | | } |
| | | |
| | | break; |
| | | case PackType.Warehouse: |
| | | if (singlePack.GetEmptyGridCount() <= 0) |
| | | { |
| | | MainRedDot.Instance.redPointDepotFunc.state = RedPointState.Full; |
| | | } |
| | | else |
| | | { |
| | | MainRedDot.Instance.redPointDepotFunc.state = RedPointState.None; |
| | | } |
| | | break; |
| | | |
| | | } |
| | | } |
| | | |