| | |
| | | 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);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return config.ShowNewItemTip == 1;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public struct PreciousItem
|
| | | {
|