| | |
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class PreciousItemGetModel : Model, IBeforePlayerDataInitialize, ISwitchAccount
|
| | | public class PreciousItemGetModel : Model, IBeforePlayerDataInitialize,ISwitchAccount,IPlayerLoginOk
|
| | | {
|
| | | Dictionary<string, PreciousItem> itemStack = new Dictionary<string, PreciousItem>();
|
| | | List<string> itemGuids = new List<string>();
|
| | |
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | isGetNewItem = false;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= RefreshRealm;
|
| | | }
|
| | |
|
| | | public void OnSwitchAccount()
|
| | | {
|
| | | currentShowItem = default(PreciousItem);
|
| | | }
|
| | |
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += RefreshRealm;
|
| | | }
|
| | |
|
| | |
|
| | | public bool TryGetItem(string _guid, out PreciousItem _itemModel)
|
| | | {
|
| | |
| | | {
|
| | | var item = playerPack.GetItemModelByGUID(currentShowItem.guid);
|
| | | return item == null ? 0 : item.chinItemModel.ID;
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshRealm(PlayerDataRefresh type)
|
| | | {
|
| | | int realmLv = PlayerDatas.Instance.baseData.realmLevel;
|
| | | if (type != PlayerDataRefresh.OfficialRank
|
| | | || NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | List<ItemModel> druglist = modelInterface.GetDruglistByRealm();
|
| | | for(int i = 0; i < druglist.Count; i++)
|
| | | {
|
| | | OnGetPreciousItem(druglist[i].packType,druglist[i].itemInfo.ItemGUID);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var lineId = PlayerDatas.Instance.baseData.dungeonLineId;
|
| | | var dungeonId = dungeonModel.DungeonMap(dungeonModel.GetDungeonDataIdByMapId(mapId), lineId);
|
| | | var dungeonId = dungeonModel.GetDungeonId(dungeonModel.GetDataMapIdByMapId(mapId), lineId);
|
| | | if (dungeonId == 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<DungeonConfig>(dungeonId);
|
| | | var config = Config.Instance.Get<DungeonConfig>(dungeonId);
|
| | | return config.ShowNewItemTip == 1;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public struct PreciousItem
|
| | | {
|