少年修仙传客户端代码仓库
client_Wu Xijin
2019-03-25 380ee8316db3bf7c7c80380db88404ce2c766e37
3335 添加新获得拍品的弹窗提示。
2个文件已修改
4个文件已添加
216 ■■■■■ 已修改文件
System/Auction/AuctionNewGetBehaviour.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Auction/AuctionNewGetBehaviour.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Auction/AuctionNewGetShowModel.cs 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Auction/AuctionNewGetShowModel.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/InGamePushContainer.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowBase/ModelCenter.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Auction/AuctionNewGetBehaviour.cs
New file
@@ -0,0 +1,66 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, March 25, 2019
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class AuctionNewGetBehaviour : MonoBehaviour
    {
        [SerializeField] ItemCell m_Auction;
        [SerializeField] Text m_AuctionName;
        [SerializeField] Button m_Close;
        [SerializeField] Button m_Use;
        PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        AuctionNewGetShowModel model { get { return ModelCenter.Instance.GetModel<AuctionNewGetShowModel>(); } }
        AuctionHelpModel auctionHelpModel = ModelCenter.Instance.GetModel<AuctionHelpModel>();
        string guid;
        public void Display(string guid)
        {
            this.guid = guid;
            var item = packModel.GetItemByGuid(guid);
            if (item != null)
            {
                this.gameObject.SetActive(true);
                m_Auction.Init(item);
                m_AuctionName.text = item.config.ItemName;
                m_AuctionName.color = UIHelper.GetUIColor(item.config.ItemColor, true);
            }
            else
            {
                this.gameObject.SetActive(false);
            }
        }
        private void Awake()
        {
            m_Close.SetListener(Close);
            m_Use.SetListener(Use);
        }
        private void Close()
        {
            model.ReportConfirmAuction(this.guid);
        }
        private void Use()
        {
            var item = packModel.GetItemByGuid(this.guid);
            auctionHelpModel.ItemModel = item;
            WindowCenter.Instance.Open<AuctionShelfWin>();
            model.ReportConfirmAuction(this.guid);
        }
    }
}
System/Auction/AuctionNewGetBehaviour.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 65c2fbc81ec040b46a7707fda2592dfb
timeCreated: 1553481548
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/Auction/AuctionNewGetShowModel.cs
New file
@@ -0,0 +1,110 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
namespace Snxxz.UI
{
    public class AuctionNewGetShowModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
    {
        List<string> newAuctions = new List<string>();
        string m_ShowingAuction = string.Empty;
        public string showingAuction {
            get { return m_ShowingAuction; }
            private set {
                if (m_ShowingAuction != value)
                {
                    m_ShowingAuction = value;
                    if (newAcutionRefreshEvent != null)
                    {
                        newAcutionRefreshEvent();
                    }
                }
            }
        }
        bool serverInited = false;
        public event Action newAcutionRefreshEvent;
        PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        public override void Init()
        {
            packModel.refreshItemCountEvent += OnGetItem;
        }
        public override void UnInit()
        {
            packModel.refreshItemCountEvent -= OnGetItem;
        }
        public void ReportConfirmAuction(string guid)
        {
            if (!string.IsNullOrEmpty(guid))
            {
                if (newAuctions.Contains(guid))
                {
                    newAuctions.Remove(guid);
                }
                RefreshShowingAuction();
            }
        }
        private void OnGetItem(PackType type, int index, int itemId)
        {
            if (!serverInited)
            {
                return;
            }
            if (type != PackType.Item)
            {
                return;
            }
            var item = packModel.GetItemByIndex(type, index);
            if (item == null)
            {
                return;
            }
            if (!item.isAuction)
            {
                return;
            }
            if (!newAuctions.Contains(item.guid))
            {
                newAuctions.Add(item.guid);
            }
            RefreshShowingAuction();
        }
        private void RefreshShowingAuction()
        {
            if (!newAuctions.IsNullOrEmpty())
            {
                showingAuction = newAuctions[0];
            }
            else
            {
                showingAuction = string.Empty;
            }
        }
        public void OnBeforePlayerDataInitialize()
        {
            serverInited = false;
        }
        public void OnPlayerLoginOk()
        {
            serverInited = true;
        }
    }
}
System/Auction/AuctionNewGetShowModel.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0b777b7eca46d994c94f446b754362ff
timeCreated: 1553480332
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/MainInterfacePanel/InGamePushContainer.cs
@@ -29,16 +29,12 @@
        [SerializeField] InSevenDayBehavior m_InSevenDayBehavior;
        [SerializeField] FBHelpPointExchageNotify m_HelpPointExchangeNotify;
        [SerializeField] MyFocusBehavior m_MyFocusBehavio;
        [SerializeField] AuctionNewGetBehaviour m_AuctionNewGetBehaviour;
        WorldBossModel worldBossModel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } }
        BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
        ElderGodAreaModel elderGodAreaModel { get { return ModelCenter.Instance.GetModel<ElderGodAreaModel>(); } }
        DemonJarModel demonJarModel { get { return ModelCenter.Instance.GetModel<DemonJarModel>(); } }
        DogzDungeonModel dogzDungeonModel { get { return ModelCenter.Instance.GetModel<DogzDungeonModel>(); } }
        CrossServerBossModel crossServerBossModel { get { return ModelCenter.Instance.GetModel<CrossServerBossModel>(); } }
        JadeDynastyBossModel jadeDynastyBossModel { get { return ModelCenter.Instance.GetModel<JadeDynastyBossModel>(); } }
        VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        FBHelpPointExchageModel exchageModel { get { return ModelCenter.Instance.GetModel<FBHelpPointExchageModel>(); } }
        FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
@@ -55,6 +51,7 @@
        FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
        DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
        InSevenDayModel inSevenDayModel { get { return ModelCenter.Instance.GetModel<InSevenDayModel>(); } }
        AuctionNewGetShowModel auctionNewGetShowModel { get { return ModelCenter.Instance.GetModel<AuctionNewGetShowModel>(); } }
        public void Init()
        {
@@ -73,6 +70,7 @@
            CheckDogzNotify();
            InSevenDayShow();
            CheckHelpPointExchange();
            CheckNewAuction();
            m_MyFocusBehavio.Init();
            exchageModel.UpdateHelpPointShopEvent += CheckHelpPointExchange;
            playerPack.RefreshDecomAttrAct += CheckEquipDecompose;
@@ -87,6 +85,7 @@
            firstTimeRechargeModel.IsTipShowEvent += FirstChargeTrialShow;
            fairyGrabBossModel.fairyGrabBossHelpUpdate += CheckFairyGrabBossHelp;
            dogzModel.UpdateDogzPutRedEvent += CheckDogzNotify;
            auctionNewGetShowModel.newAcutionRefreshEvent += CheckNewAuction;
        }
        public void UnInit()
@@ -105,6 +104,7 @@
            realmEquipModel.showEquipRefreshEvent -= CheckRealmBetterEquip;
            fairyGrabBossModel.fairyGrabBossHelpUpdate -= CheckFairyGrabBossHelp;
            dogzModel.UpdateDogzPutRedEvent -= CheckDogzNotify;
            auctionNewGetShowModel.newAcutionRefreshEvent -= CheckNewAuction;
        }
        private void CheckHelpPointExchange()
@@ -167,6 +167,11 @@
            m_DogzNotifyBehaviour.SetDisplay();
        }
        private void CheckNewAuction()
        {
            m_AuctionNewGetBehaviour.Display(auctionNewGetShowModel.showingAuction);
        }
        private void CheckPreciousItem()
        {
            if (preciousItemGetModel.currentShowItem == default(PreciousItemGetModel.PreciousItem))
System/WindowBase/ModelCenter.cs
@@ -230,6 +230,7 @@
            RegisterModel<EquipStrengthModel>();
            RegisterModel<RuneModel>();
            RegisterModel<RuneResolveModel>();
            RegisterModel<AuctionNewGetShowModel>();
            inited = true;
        }