少年修仙传客户端代码仓库
client_linchunjie
2019-03-25 0c52af038fdc092d09880b89b494df916b944579
Merge remote-tracking branch 'origin/master' into ReikiRoot

Conflicts:
System/WindowBase/ModelCenter.cs
4个文件已添加
4个文件已修改
229 ■■■■■ 已修改文件
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/Equip/CandidateEquipBehaviour.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Equip/EquipSlotBehaviour.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | 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/Equip/CandidateEquipBehaviour.cs
@@ -11,6 +11,7 @@
    public class CandidateEquipBehaviour : ScrollItem
    {
        [SerializeField] ImageEx m_BackGround;
        [SerializeField] Image m_UnLockLabel;
        [SerializeField] ItemCell m_ItemCell;
        [SerializeField] Text m_EquipName;
@@ -47,7 +48,10 @@
        {
            var equip = packModel.GetItemByGuid(this.candidateEquip.guid);
            m_ItemCell.Init(equip, true);
            m_UnLockLabel.gameObject.SetActive(!model.IsLevelUnLocked(equip.config.LV));
            var isEquipLevelUnlocked = model.IsLevelUnLocked(equip.config.LV);
            m_BackGround.gray=!isEquipLevelUnlocked;
            m_UnLockLabel.gameObject.SetActive(!isEquipLevelUnlocked);
            m_EquipName.text = equip.config.ItemName;
            m_EquipName.color = UIHelper.GetUIColor(equip.config.ItemColor, true);
            m_EquipSorce.text = string.Format("评分:{0}", equip.score);
System/Equip/EquipSlotBehaviour.cs
@@ -30,6 +30,7 @@
        public void Display(int level, int place)
        {
            this.level = level;
            this.place = place;
            var set = model.GetEquipSet(level);
            slot = set.GetEquipSlot(place);
@@ -90,13 +91,13 @@
                var equip = packModel.GetItemByGuid(equipGuid);
                if (equip == null)
                {
                    m_SlotName.gameObject.SetActive(false);
                    m_SlotName.gameObject.SetActive(true);
                    m_Icon.SetSprite(GetDefaultEquipIcon(slot.equipPosition.y));
                    m_IconFrame.SetItemBackGround(0);
                    m_IconFrame.SetSprite("ItemNormal_a");
                }
                else
                {
                    m_SlotName.gameObject.SetActive(slot.unLocked);
                    m_SlotName.gameObject.SetActive(false);
                    m_Icon.SetSprite(equip.config.IconKey);
                    m_IconFrame.SetItemBackGround(equip.config.ItemColor);
                }
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
@@ -231,6 +231,7 @@
            RegisterModel<RuneModel>();
            RegisterModel<RuneResolveModel>();
            RegisterModel<ReikiRootModel>();
            RegisterModel<AuctionNewGetShowModel>();
            inited = true;
        }