System/CrossServerOneVsOne/CrossServerArenaWin.cs
New file @@ -0,0 +1,62 @@ using System; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { [XLua.Hotfix] public class CrossServerArenaWin : Window { [SerializeField] Button matchBtn; [SerializeField] Button dayAwardBtn; [SerializeField] Text winRateText; [SerializeField] Text winNumText; [SerializeField] Text failNumText; [SerializeField] Text sumNumText; [SerializeField] Text reaminNumText; [SerializeField] Text dayScoreText; [SerializeField] Text openTimeText; #region Built-in protected override void BindController() { } protected override void AddListeners() { matchBtn.AddListener(ClickMatch); dayAwardBtn.AddListener(ClickDayAward); } protected override void OnPreOpen() { } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnAfterClose() { } #endregion private void ClickDayAward() { WindowCenter.Instance.Open<CrossServerDayAwardsWin>(); } private void ClickMatch() { } } } System/CrossServerOneVsOne/CrossServerArenaWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 1fcdddcabf8b0604d94987ceff98d209 timeCreated: 1544517109 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/CrossServerOneVsOne/CrossServerDayAwardsWin.cs
New file @@ -0,0 +1,102 @@ using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TableConfig; using System.Linq; namespace Snxxz.UI { public class CrossServerDayAwardsWin : Window { [SerializeField] ScrollerController achieveCtrl; [SerializeField] Button closeBtn; HeavenBattleModel battleModel { get { return ModelCenter.Instance.GetModel<HeavenBattleModel>(); } } List<XMZZAchievementConfig> achievelist; protected override void BindController() { achieveCtrl.OnRefreshCell += RefreshAchieveCell; achieveCtrl.lockType = EnhanceLockType.KeepVertical; } protected override void AddListeners() { closeBtn.AddListener(CloseClick); } protected override void OnPreOpen() { battleModel.AchieveModel.achievementCompletedEvent += RefreshComplete; CreateCell(); } protected override void OnAfterOpen() { this.transform.SetAsLastSibling(); achieveCtrl.JumpIndex(0); } protected override void OnPreClose() { battleModel.AchieveModel.achievementCompletedEvent -= RefreshComplete; } protected override void OnAfterClose() { } private void RefreshComplete(int id) { if (achievelist != null) { for (int i = 0; i < achievelist.Count; i++) { if (achievelist[i].AchieveID.Contains(id)) { achievelist = battleModel.GetAchievelist(); CreateCell(); } } } } private void CreateCell() { achievelist = battleModel.GetAchievelist(); achieveCtrl.Refresh(); int i = 0; for (i = 0; i < achievelist.Count; i++) { Achievement achieve = null; battleModel.SetAchievement(achievelist[i].AchieveID, out achieve); if(achieve != null) { if(!achieve.completed) { achieveCtrl.AddCell(ScrollerDataType.Header,achieve.id); } else { achieveCtrl.AddCell(ScrollerDataType.Normal,achieve.id); } } } achieveCtrl.Restart(); } private void RefreshAchieveCell(ScrollerDataType type, CellView cell) { switch (type) { case ScrollerDataType.Header: XMZZAchieveCell achieveCell = cell.GetComponent<XMZZAchieveCell>(); achieveCell.Init(cell.index); break; } } } } System/CrossServerOneVsOne/CrossServerDayAwardsWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 978eff4a70f12874c91645029a565657 timeCreated: 1544521450 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/CrossServerOneVsOne/CrossServerModel.cs
New file @@ -0,0 +1,47 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Snxxz.UI { [XLua.Hotfix] [XLua.LuaCallCSharp] public class CrossServerModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk { public override void Init() { } public void OnBeforePlayerDataInitialize() { } public void OnAfterPlayerDataInitialize() { } public void OnPlayerLoginOk() { } public override void UnInit() { } #region 表数据 #endregion #region 协议 public int curRank { get; private set; } //当前段位 public int curScore { get; private set; } //当前积分 #endregion } } System/CrossServerOneVsOne/CrossServerModel.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: d77f964d13692ba4db7322068b1532aa timeCreated: 1544513299 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/CrossServerOneVsOne/CrossServerWin.cs
New file @@ -0,0 +1,151 @@ using System; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { [XLua.Hotfix] public class CrossServerWin : Window { [SerializeField] Button leftBtn; [SerializeField] Button rightBtn; [SerializeField] Button closeBtn; [SerializeField] FunctionButton arenaFunc; [SerializeField] FunctionButton bossFunc; [SerializeField] FunctionButtonGroup funcGroup; [SerializeField] Image headImg; [SerializeField] Text nameText; [SerializeField] Text lvText; [SerializeField] Text rankText; [SerializeField] Text curScoreText; [SerializeField] Text honorText; [SerializeField] Slider scoreSlider; [SerializeField] Text scorePerText; [SerializeField] Button scoreRankBtn; [SerializeField] Button rankAwardBtn; [SerializeField] Button arenaBtn; [SerializeField] Button seasonAwardBtn; [SerializeField] Button honorStoreBtn; #region Built-in protected override void BindController() { } protected override void AddListeners() { closeBtn.AddListener(ClickClose); leftBtn.AddListener(ClickLeft); rightBtn.AddListener(ClickRight); arenaFunc.AddListener(ClickArenaFunc); bossFunc.AddListener(ClickBossFunc); scoreRankBtn.AddListener(ClickScoreRank); rankAwardBtn.AddListener(ClickRankAward); arenaBtn.AddListener(ClickArena); seasonAwardBtn.AddListener(ClickSeasonAward); honorStoreBtn.AddListener(ClickHonorStore); } protected override void OnPreOpen() { } protected override void OnActived() { base.OnActived(); funcGroup.TriggerByOrder(functionOrder); } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnAfterClose() { } #endregion private void SetDisplay() { var playerData = PlayerDatas.Instance.baseData; headImg.SetSprite(GeneralDefine.GetOtherJobHeadPortrait(playerData.Job, 0)); nameText.text = playerData.PlayerName; lvText.text = StringUtility.Contact("Lv.",playerData.LV); } #region 点击事件 private void ClickBossFunc() { CloseSubWindows(); } private void ClickArenaFunc() { CloseSubWindows(); } private void ClickRight() { funcGroup.TriggerNext(); } private void ClickLeft() { funcGroup.TriggerLast(); } private void ClickHonorStore() { CloseSubWindows(); WindowCenter.Instance.Open<HonorStoreWin>(); } private void ClickSeasonAward() { CloseSubWindows(); } private void ClickArena() { CloseSubWindows(); WindowCenter.Instance.Open<CrossServerArenaWin>(); } private void ClickRankAward() { CloseSubWindows(); } private void ClickScoreRank() { CloseSubWindows(); } private void ClickClose() { CloseSubWindows(); CloseImmediately(); } private void CloseSubWindows() { //var children = WindowConfig.Get().FindChildWindows("CrossServerWin"); //foreach (var window in children) //{ // WindowCenter.Instance.Close(window); //} WindowCenter.Instance.CloseImmediately<CrossServerArenaWin>(); WindowCenter.Instance.CloseImmediately<HonorStoreWin>(); } #endregion } } System/CrossServerOneVsOne/CrossServerWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 9a296aad4e1be7c45a7a6ed27905ab16 timeCreated: 1544511637 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/CrossServerOneVsOne/HonorShopCell.cs
New file @@ -0,0 +1,104 @@ using UnityEngine; using UnityEngine.UI; using TableConfig; using System; namespace Snxxz.UI { public class HonorShopCell : MonoBehaviour { [SerializeField] ItemCell itemCell; [SerializeField] Text nameText; [SerializeField] Image moneyIcon; [SerializeField] Text moneyCntText; [SerializeField] Text vipText; [SerializeField] Image stateImg; [SerializeField] Image sellImg; [SerializeField] Button shopCellBtn; StoreModel _storeModel; StoreModel m_storeModel { get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); } } ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } public void SetDisplay(StoreConfig storeConfig) { ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(m_storeModel.GetReplaceId(storeConfig.ID,storeConfig.ItemID)); if (itemConfig == null) return; ItemCellModel cellModel = new ItemCellModel(itemConfig.ID, false, 0, storeConfig.IsBind,"",PackType.rptDeleted,true); itemCell.Init(cellModel); nameText.text = itemConfig.ItemName; nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor, true); moneyIcon.SetIconWithMoneyType(storeConfig.MoneyType); ulong shopCost = (ulong)(storeConfig.MoneyNumber); moneyCntText.text = UIHelper.ReplaceLargeNum(shopCost); sellImg.gameObject.SetActive(false); if (!string.IsNullOrEmpty(storeConfig.SalesStatus)) { stateImg.gameObject.SetActive(true); stateImg.SetSprite(storeConfig.SalesStatus); stateImg.SetNativeSize(); } else { stateImg.gameObject.SetActive(false); } int canBuyCnt = 0; int addBuyCnt = 0; int curVipIndex = -1; int nextVipIndex = -1; bool isVipBuy = BuyItemPopModel.Instance.CheckIsVipBuy(storeConfig, out curVipIndex, out nextVipIndex); bool isLimitBuy = BuyItemPopModel.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt); bool isShowBuyPrice = true; if(isVipBuy) { if (curVipIndex == -1 && nextVipIndex != -1) { vipText.text = Language.Get("StoreWin101", storeConfig.VIPLV[nextVipIndex]); nameText.color = UIHelper.GetUIColor(TextColType.Red, true); vipText.color = UIHelper.GetUIColor(TextColType.Red, true); isShowBuyPrice = false; } } vipText.gameObject.SetActive(!isShowBuyPrice); moneyIcon.gameObject.SetActive(isShowBuyPrice); if (canBuyCnt > 0) { itemCell.countText.gameObject.SetActive(true); BuyShopItemLimit shopItemLimit = m_storeModel.GetBuyShopLimit((uint)storeConfig.ID); int remainNum = canBuyCnt; if (shopItemLimit != null) { remainNum = canBuyCnt - shopItemLimit.BuyCnt; } if (remainNum > 0) { itemCell.countText.text = StringUtility.Contact(remainNum.ToString(), "/" + canBuyCnt.ToString()); } else { sellImg.gameObject.SetActive(true); itemCell.countText.text = StringUtility.Contact(UIHelper.AppendStringColor(TextColType.Red, remainNum.ToString()), "/" + canBuyCnt.ToString()); } } else { itemCell.countText.gameObject.SetActive(false); } shopCellBtn.RemoveAllListeners(); shopCellBtn.AddListener(()=> { m_storeModel.OnClickShopCell(storeConfig); }); } } } System/CrossServerOneVsOne/HonorShopCell.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 9cf6af8c24040cf4d8159893d9842374 timeCreated: 1544519211 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: System/CrossServerOneVsOne/HonorStoreWin.cs
New file @@ -0,0 +1,96 @@ using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TableConfig; namespace Snxxz.UI { public class HonorStoreWin : Window { [SerializeField] ScrollerController shopCtrl; StoreModel _storeModel; StoreModel m_storeModel { get { return _storeModel ?? (_storeModel = ModelCenter.Instance.GetModel<StoreModel>()); } } List<StoreModel.StoreData> shoplist; int SingleLineCnt = 2; protected override void BindController() { shopCtrl.OnRefreshCell += RefreshShopCell; shopCtrl.lockType = EnhanceLockType.KeepVertical; } protected override void AddListeners() { } protected override void OnPreOpen() { m_storeModel.storeFuncType = StoreFunc.XBEquipStore; CreateShopCell(); } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnAfterClose() { } private void CreateShopCell() { shopCtrl.Refresh(); shoplist = m_storeModel.TryGetStoreDatas((int)m_storeModel.storeFuncType); if (shoplist.Count > 0) { int i = 0; int remain = shoplist.Count % SingleLineCnt; int line = (int)shoplist.Count / SingleLineCnt; if (remain > 0) { line += 1; } for (i = 0; i < line; i++) { shopCtrl.AddCell(ScrollerDataType.Header, i); } } shopCtrl.Restart(); shopCtrl.JumpIndex(0); } private void RefreshShopCell(ScrollerDataType type, CellView cell) { int length = cell.transform.childCount; for(int i = 0; i < length;i++) { int cellCount = length * cell.index + (i + 1); HonorShopCell shopCell = cell.transform.GetChild(i).GetComponent<HonorShopCell>(); if(shoplist.Count >= cellCount) { shopCell.gameObject.SetActive(true); shopCell.SetDisplay(shoplist[cellCount-1].storeConfig); } else { shopCell.gameObject.SetActive(false); } } } } } System/CrossServerOneVsOne/HonorStoreWin.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 0a55881508d5cf049b119964a7221ad0 timeCreated: 1544518841 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: