From 3b50d06d004ecc31df7ecaa57927fa35c1ea608e Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期日, 28 四月 2019 16:59:23 +0800
Subject: [PATCH] 3335 修改界面功能框架。
---
Core/NetworkPackage/ServerPack/HAD_SaleActivity.meta | 9
System/WindowBase/Window.cs | 19 +
System/YinJi.meta | 9
System/Welfare/WelfareWin.cs | 2
System/CrossServerOneVsOne/CrossServerWin.cs | 2
System/FairyAu/UnionPanel.cs | 2
System/WindowBase/OneLevelWin.cs.meta | 12 +
Core/NetworkPackage/ServerPack/HAE_Truck.meta | 9
System/Vip/VipRechargeWin.cs | 2
System/Auction/AuctionHouseWin.cs | 140 +++++-----
System/Role/RolePanel.cs | 2
System/Skill/SkillWin.cs | 2
System/KnapSack/New/KnapSackWin.cs | 2
System/Rune/RunePanel.cs | 2
System/Compose/New/ComposeWin.cs | 2
System/Treasure/TreasureBaseWin.cs | 4
System/HappyXB/HappyXBWin.cs | 2
Core/NetworkPackage/ServerPack/HB0_Event.meta | 9
System/FindPrecious/LootPreciousFrameWin.cs | 2
System/Equip/EquipFrameWin.cs | 6
System/FriendSystem/New/SocialWin.cs | 2
Core/NetworkPackage/DTCFile/ServerPack/HAF_Merge.meta | 9
System/WindowBase/WindowCenter.cs | 8
Core/NetworkPackage/DTCFile/ServerPack/HAD_SaleActivity.meta | 9
System/FindPrecious/FindPreciousFrameWin.cs | 73 +----
System/Dogz/DogzWin.cs | 2
UI/Common/FunctionButtonGroup.cs | 38 +++
Core/NetworkPackage/DTCFile/ServerPack/HAE_Truck.meta | 9
System/FairylandCeremony/FairylandCeremonyWin.cs | 2
UI/Common/WindowConfig.cs | 141 ++++++++---
System/JadeDynastyTower/TowerWin.cs | 2
System/Alchemy/AlchemyBaseWin.cs | 30 +-
System/NewBieGuidance/NewBieCenter.cs | 2
System/NewYearFairylandCeremony/NewYearFairylandCeremonyWin.cs | 2
System/OpenServerActivity/OpenServerActivityWin.cs | 2
Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta | 9
System/WindowBase/OneLevelWin.cs | 102 ++++++++
Core/NetworkPackage/ServerPack/HAF_Merge.meta | 9
38 files changed, 473 insertions(+), 217 deletions(-)
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HAD_SaleActivity.meta b/Core/NetworkPackage/DTCFile/ServerPack/HAD_SaleActivity.meta
new file mode 100644
index 0000000..56e5988
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HAD_SaleActivity.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 3e05761d690b75440a6be79207d0fb01
+folderAsset: yes
+timeCreated: 1547643019
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HAE_Truck.meta b/Core/NetworkPackage/DTCFile/ServerPack/HAE_Truck.meta
new file mode 100644
index 0000000..1044caa
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HAE_Truck.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 1d70ccd06161e0443b7a802ad94292f8
+folderAsset: yes
+timeCreated: 1547643019
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HAF_Merge.meta b/Core/NetworkPackage/DTCFile/ServerPack/HAF_Merge.meta
new file mode 100644
index 0000000..314efd1
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HAF_Merge.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 71e878ac60c49ad4f964dd2dbc725739
+folderAsset: yes
+timeCreated: 1547643019
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta b/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta
new file mode 100644
index 0000000..6ed37c0
--- /dev/null
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: eed34091b0568664b9fb42f0634496c1
+folderAsset: yes
+timeCreated: 1547643019
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HAD_SaleActivity.meta b/Core/NetworkPackage/ServerPack/HAD_SaleActivity.meta
new file mode 100644
index 0000000..418ee88
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HAD_SaleActivity.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 32ceb8b7faf99f84a8b73ce53c5e3e4d
+folderAsset: yes
+timeCreated: 1547643019
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HAE_Truck.meta b/Core/NetworkPackage/ServerPack/HAE_Truck.meta
new file mode 100644
index 0000000..ea614a3
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HAE_Truck.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 77f69c2b862d1704299a32d0d8eeb71e
+folderAsset: yes
+timeCreated: 1547643019
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HAF_Merge.meta b/Core/NetworkPackage/ServerPack/HAF_Merge.meta
new file mode 100644
index 0000000..86e4eea
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HAF_Merge.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: fa14960fa44b0d1439bab471a764e34f
+folderAsset: yes
+timeCreated: 1547643019
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Core/NetworkPackage/ServerPack/HB0_Event.meta b/Core/NetworkPackage/ServerPack/HB0_Event.meta
new file mode 100644
index 0000000..95487fc
--- /dev/null
+++ b/Core/NetworkPackage/ServerPack/HB0_Event.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: d914565b65f8e8145988734c4d915834
+folderAsset: yes
+timeCreated: 1547643019
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/Alchemy/AlchemyBaseWin.cs b/System/Alchemy/AlchemyBaseWin.cs
index f67cd31..763b8dd 100644
--- a/System/Alchemy/AlchemyBaseWin.cs
+++ b/System/Alchemy/AlchemyBaseWin.cs
@@ -28,17 +28,17 @@
protected override void AddListeners()
{
- m_AlchemyNormal.AddListener(ShowAlchemyNormal);
- m_AlchemyFairy.AddListener(ShowAlchemyFairy);
- m_AlchemyDrug.AddListener(ShowAlchemyDrug);
- m_Left.AddListener(()=>
+ m_AlchemyNormal.AddListener(ShowAlchemyNormal);
+ m_AlchemyFairy.AddListener(ShowAlchemyFairy);
+ m_AlchemyDrug.AddListener(ShowAlchemyDrug);
+ m_Left.AddListener(()=>
{
m_FuncGroup.TriggerLast();
- });
- m_Right.AddListener(()=>
+ });
+ m_Right.AddListener(()=>
{
m_FuncGroup.TriggerNext();
- });
+ });
m_Close.AddListener(CloseClick);
}
@@ -58,10 +58,10 @@
protected override void OnPreClose()
{
- CloseSubWindows();
- if (!WindowJumpMgr.Instance.IsJumpState)
- {
- WindowCenter.Instance.Open<MainInterfaceWin>();
+ CloseSubWindows();
+ if (!WindowJumpMgr.Instance.IsJumpState)
+ {
+ WindowCenter.Instance.Open<MainInterfaceWin>();
}
}
@@ -93,10 +93,10 @@
private void CloseSubWindows()
{
- var children = WindowConfig.Get().FindChildWindows("AlchemyBaseWin");
- foreach (var window in children)
- {
- WindowCenter.Instance.Close(window);
+ var children = WindowConfig.GetChildWindows("AlchemyBaseWin");
+ foreach (var window in children)
+ {
+ WindowCenter.Instance.Close(window);
}
}
diff --git a/System/Auction/AuctionHouseWin.cs b/System/Auction/AuctionHouseWin.cs
index 2ff278e..2a3f222 100644
--- a/System/Auction/AuctionHouseWin.cs
+++ b/System/Auction/AuctionHouseWin.cs
@@ -1,112 +1,112 @@
-锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
-// [ Date ]: Wednesday, February 27, 2019
-//--------------------------------------------------------
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace Snxxz.UI {
-
- public class AuctionHouseWin : Window
- {
-
- #region Built-in
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Wednesday, February 27, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI {
+
+ public class AuctionHouseWin : Window
+ {
+
+ #region Built-in
[SerializeField] FunctionButtonGroup m_FuncBtnGroup;
[SerializeField] Button m_CloseBtn;
[SerializeField] Button m_LeftBtn;
[SerializeField] Button m_RightBtn;
- [SerializeField] FunctionButton m_FullServiceAuctionWin;//鍏ㄦ湇鎷嶅崠
- [SerializeField] FunctionButton m_FamilyAuctionWin;//浠欑洘鎷嶅崠
- [SerializeField] FunctionButton m_MyAuction;//鎴戠殑鎷嶅崠
- [SerializeField] FunctionButton m_MyFocus;//鎴戠殑鍏虫敞
- [SerializeField] Button m_AttentionButton;//鎴戠殑鍏虫敞鍟嗗搧
- [SerializeField] Button m_TransactionRecordButton;//鎴愪氦璁板綍
- [SerializeField] Text m_MoneyText;
- protected override void BindController()
+ [SerializeField] FunctionButton m_FullServiceAuctionWin;//鍏ㄦ湇鎷嶅崠
+ [SerializeField] FunctionButton m_FamilyAuctionWin;//浠欑洘鎷嶅崠
+ [SerializeField] FunctionButton m_MyAuction;//鎴戠殑鎷嶅崠
+ [SerializeField] FunctionButton m_MyFocus;//鎴戠殑鍏虫敞
+ [SerializeField] Button m_AttentionButton;//鎴戠殑鍏虫敞鍟嗗搧
+ [SerializeField] Button m_TransactionRecordButton;//鎴愪氦璁板綍
+ [SerializeField] Text m_MoneyText;
+ protected override void BindController()
{
- AuctionInquiry.Instance.SendQueryAttentionAuctionItem();//鏌ヨ鎷嶅崠琛岀殑鍏虫敞鐗╁搧
- }
-
- protected override void AddListeners()
+ AuctionInquiry.Instance.SendQueryAttentionAuctionItem();//鏌ヨ鎷嶅崠琛岀殑鍏虫敞鐗╁搧
+ }
+
+ protected override void AddListeners()
{
m_CloseBtn.AddListener(OnClickClose);
m_LeftBtn.AddListener(OnClickLeftBtn);
- m_RightBtn.AddListener(OnClickRight);
- m_FullServiceAuctionWin.AddListener(OnClickFullServiceAuction);
+ m_RightBtn.AddListener(OnClickRight);
+ m_FullServiceAuctionWin.AddListener(OnClickFullServiceAuction);
m_FamilyAuctionWin.AddListener(OnClickFamilyAuction);
m_MyAuction.AddListener(OnClickMyAuction);
- m_MyFocus.AddListener(OnClickMyFocus);
+ m_MyFocus.AddListener(OnClickMyFocus);
- m_AttentionButton.AddListener(OnClickAttentionButton);
- m_TransactionRecordButton.AddListener(OnClickTransactionRecordButton);
+ m_AttentionButton.AddListener(OnClickAttentionButton);
+ m_TransactionRecordButton.AddListener(OnClickTransactionRecordButton);
}
- AuctionModel model { get { return ModelCenter.Instance.GetModel<AuctionModel>(); } }
-
- protected override void OnPreOpen()
- {
- m_MoneyText.text = UIHelper.GetMoneyCnt(1).ToString();
- model.SetDayRemind();
+ AuctionModel model { get { return ModelCenter.Instance.GetModel<AuctionModel>(); } }
+
+ protected override void OnPreOpen()
+ {
+ m_MoneyText.text = UIHelper.GetMoneyCnt(1).ToString();
+ model.SetDayRemind();
}
protected override void OnActived()
{
//OnClickFullServiceAuction();
m_FuncBtnGroup.TriggerByOrder(functionOrder);
- }
-
- protected override void OnAfterOpen()
+ }
+
+ protected override void OnAfterOpen()
{
- PlayerDatas.Instance.playerDataRefreshEvent += Updatefighting;
- }
-
- protected override void OnPreClose()
+ PlayerDatas.Instance.playerDataRefreshEvent += Updatefighting;
+ }
+
+ protected override void OnPreClose()
{
CloseChild();
if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>())
{
WindowCenter.Instance.Open<MainInterfaceWin>();
- }
- }
-
- protected override void OnAfterClose()
+ }
+ }
+
+ protected override void OnAfterClose()
{
- PlayerDatas.Instance.playerDataRefreshEvent -= Updatefighting;
+ PlayerDatas.Instance.playerDataRefreshEvent -= Updatefighting;
}
- #endregion
+ #endregion
private void Updatefighting(PlayerDataType info)
{
if (info == PlayerDataType.Gold)
{
m_MoneyText.text = UIHelper.GetMoneyCnt(1).ToString();
}
- }
+ }
private void OnClickClose()
{
CloseImmediately();
- }
+ }
private void OnClickLeftBtn()
{
m_FuncBtnGroup.TriggerLast();
- }
-
+ }
+
private void OnClickRight()
{
m_FuncBtnGroup.TriggerNext();
- }
-
+ }
+
private void OnClickFullServiceAuction()
{
CloseChild();
WindowCenter.Instance.Open<FullServiceAuctionWin>(true);
functionOrder = m_FullServiceAuctionWin.order;
- }
-
+ }
+
private void OnClickFamilyAuction()
{
CloseChild();
@@ -139,16 +139,16 @@
private void CloseChild()
{
- var children = WindowConfig.Get().FindChildWindows("AuctionHouseWin");
+ var children = WindowConfig.GetChildWindows("AuctionHouseWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
}
- }
- }
-
-}
-
-
-
-
+ }
+ }
+
+}
+
+
+
+
diff --git a/System/Compose/New/ComposeWin.cs b/System/Compose/New/ComposeWin.cs
index f1d27d2..e82faca 100644
--- a/System/Compose/New/ComposeWin.cs
+++ b/System/Compose/New/ComposeWin.cs
@@ -244,7 +244,7 @@
private void CloseSubWindows()
{
- var children = WindowConfig.Get().FindChildWindows("ComposeWin");
+ var children = WindowConfig.GetChildWindows("ComposeWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/CrossServerOneVsOne/CrossServerWin.cs b/System/CrossServerOneVsOne/CrossServerWin.cs
index b9c8583..de86fbf 100644
--- a/System/CrossServerOneVsOne/CrossServerWin.cs
+++ b/System/CrossServerOneVsOne/CrossServerWin.cs
@@ -98,7 +98,7 @@
private void CloseSubWindows()
{
- var children = WindowConfig.Get().FindChildWindows("CrossServerWin");
+ var children = WindowConfig.GetChildWindows("CrossServerWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/Dogz/DogzWin.cs b/System/Dogz/DogzWin.cs
index 2bdc6a9..1179ec1 100644
--- a/System/Dogz/DogzWin.cs
+++ b/System/Dogz/DogzWin.cs
@@ -124,7 +124,7 @@
void CloseChild()
{
- var children = WindowConfig.Get().FindChildWindows("DogzWin");
+ var children = WindowConfig.GetChildWindows("DogzWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/Equip/EquipFrameWin.cs b/System/Equip/EquipFrameWin.cs
index 78994b1..eb7c562 100644
--- a/System/Equip/EquipFrameWin.cs
+++ b/System/Equip/EquipFrameWin.cs
@@ -73,7 +73,7 @@
private void CloseSubWindows()
{
- var children = WindowConfig.Get().FindChildWindows("EquipFrameWin");
+ var children = WindowConfig.GetChildWindows("EquipFrameWin");
foreach (var item in children)
{
WindowCenter.Instance.Close(item);
@@ -89,8 +89,8 @@
private void OpenStrengthenWin()
{
- CloseSubWindows();
- WindowCenter.Instance.Open<EquipStrengthWin>();
+ CloseSubWindows();
+ WindowCenter.Instance.Open<EquipStrengthWin>();
functionOrder = m_Strengthen.order;
}
diff --git a/System/FairyAu/UnionPanel.cs b/System/FairyAu/UnionPanel.cs
index 34f6081..d626f95 100644
--- a/System/FairyAu/UnionPanel.cs
+++ b/System/FairyAu/UnionPanel.cs
@@ -134,7 +134,7 @@
void CloseChildWin()
{
funcPanel.SetActive(false);
- var children = WindowConfig.Get().FindChildWindows("UnionPanel");
+ var children = WindowConfig.GetChildWindows("UnionPanel");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/FairylandCeremony/FairylandCeremonyWin.cs b/System/FairylandCeremony/FairylandCeremonyWin.cs
index e2a029e..0e59c79 100644
--- a/System/FairylandCeremony/FairylandCeremonyWin.cs
+++ b/System/FairylandCeremony/FairylandCeremonyWin.cs
@@ -112,7 +112,7 @@
private void CloseChildWin()
{
- var children = WindowConfig.Get().FindChildWindows("FairylandCeremonyWin");
+ var children = WindowConfig.GetChildWindows("FairylandCeremonyWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/FindPrecious/FindPreciousFrameWin.cs b/System/FindPrecious/FindPreciousFrameWin.cs
index c64e12e..46f4edd 100644
--- a/System/FindPrecious/FindPreciousFrameWin.cs
+++ b/System/FindPrecious/FindPreciousFrameWin.cs
@@ -12,37 +12,20 @@
namespace Snxxz.UI
{
- public class FindPreciousFrameWin : Window
+ public class FindPreciousFrameWin : OneLevelWin
{
- [SerializeField] FunctionButtonGroup m_FunctionGroup;
- [SerializeField] FunctionButton m_DemonJar;
- [SerializeField] FunctionButton m_WorldBoss;
- [SerializeField] FunctionButton m_BossHome;
- [SerializeField] FunctionButton m_PersonalBoss;
- [SerializeField] FunctionButton m_ElderGodArea;
- [SerializeField] FunctionButton m_DropRecord;
-
- [SerializeField] Button m_Left;
- [SerializeField] Button m_Right;
- [SerializeField] Button m_Close;
#region Built-in
- protected override void BindController()
- {
- }
protected override void AddListeners()
{
- m_DemonJar.AddListener(ShowDemonJar);
- m_WorldBoss.AddListener(ShowWorldBoss);
- m_BossHome.AddListener(ShowBossHome);
- m_PersonalBoss.AddListener(ShowPersonalBoss);
- m_ElderGodArea.AddListener(ShowElderGodArea);
- m_DropRecord.AddListener(ShowDropRecord);
-
- m_Left.AddListener(ShowLastFunction);
- m_Right.AddListener(ShowNextFunction);
- m_Close.AddListener(CloseClick);
+ base.AddListeners();
+ SetFunctionListener(0, ShowDemonJar);
+ SetFunctionListener(1, ShowWorldBoss);
+ SetFunctionListener(2, ShowBossHome);
+ SetFunctionListener(3, ShowPersonalBoss);
+ SetFunctionListener(4, ShowElderGodArea);
+ SetFunctionListener(5, ShowDropRecord);
}
protected override void OnPreOpen()
@@ -61,20 +44,11 @@
protected override void OnAfterClose()
{
- if (!WindowJumpMgr.Instance.IsJumpState)
- {
- WindowCenter.Instance.Open<MainInterfaceWin>();
- }
}
protected override void OnActived()
{
base.OnActived();
- m_Left.gameObject.SetActive(m_FunctionGroup.unLockedCount > 1);
- m_Right.gameObject.SetActive(m_FunctionGroup.unLockedCount > 1);
-
- m_FunctionGroup.TriggerByOrder(functionOrder);
- m_FunctionGroup.GotoOrder(functionOrder);
}
#endregion
@@ -82,61 +56,42 @@
{
CloseSubWindows();
WindowCenter.Instance.Open<DemonJarWin>();
- functionOrder = m_DemonJar.order;
+ functionOrder = 0;
}
private void ShowWorldBoss()
{
CloseSubWindows();
WindowCenter.Instance.Open<WorldBossWin>();
- functionOrder = m_WorldBoss.order;
+ functionOrder = 1;
}
private void ShowBossHome()
{
CloseSubWindows();
WindowCenter.Instance.Open<BossHomeWin>();
- functionOrder = m_BossHome.order;
+ functionOrder = 2;
}
private void ShowPersonalBoss()
{
CloseSubWindows();
WindowCenter.Instance.Open<PersonalBossWin>();
- functionOrder = m_PersonalBoss.order;
+ functionOrder = 3;
}
private void ShowElderGodArea()
{
CloseSubWindows();
WindowCenter.Instance.Open<ElderGodAreaWin>();
- functionOrder = m_ElderGodArea.order;
+ functionOrder = 4;
}
private void ShowDropRecord()
{
CloseSubWindows();
WindowCenter.Instance.Open<PreciousDropRecordWin>();
- functionOrder = m_DropRecord.order;
- }
-
- private void CloseSubWindows()
- {
- var subWindows = WindowConfig.Get().FindChildWindows("FindPreciousFrameWin");
- foreach ( var window in subWindows )
- {
- WindowCenter.Instance.Close(window);
- }
- }
-
- private void ShowLastFunction()
- {
- m_FunctionGroup.TriggerLast();
- }
-
- private void ShowNextFunction()
- {
- m_FunctionGroup.TriggerNext();
+ functionOrder = 5;
}
}
diff --git a/System/FindPrecious/LootPreciousFrameWin.cs b/System/FindPrecious/LootPreciousFrameWin.cs
index 3a1755b..77a1cd5 100644
--- a/System/FindPrecious/LootPreciousFrameWin.cs
+++ b/System/FindPrecious/LootPreciousFrameWin.cs
@@ -118,7 +118,7 @@
{
m_NormalBottom.gameObject.SetActive(false);
- var children = WindowConfig.Get().FindChildWindows("LootPreciousFrameWin");
+ var children = WindowConfig.GetChildWindows("LootPreciousFrameWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/FriendSystem/New/SocialWin.cs b/System/FriendSystem/New/SocialWin.cs
index 1b1bfba..9896e4e 100644
--- a/System/FriendSystem/New/SocialWin.cs
+++ b/System/FriendSystem/New/SocialWin.cs
@@ -89,7 +89,7 @@
void CloseChild()
{
friendTipsObj.SetActive(false);
- var children = WindowConfig.Get().FindChildWindows("SocialWin");
+ var children = WindowConfig.GetChildWindows("SocialWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/HappyXB/HappyXBWin.cs b/System/HappyXB/HappyXBWin.cs
index 46c3394..70cbb78 100644
--- a/System/HappyXB/HappyXBWin.cs
+++ b/System/HappyXB/HappyXBWin.cs
@@ -133,7 +133,7 @@
private void CloseSubWindows()
{
- var children = WindowConfig.Get().FindChildWindows("HappyXBWin");
+ var children = WindowConfig.GetChildWindows("HappyXBWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/JadeDynastyTower/TowerWin.cs b/System/JadeDynastyTower/TowerWin.cs
index a479e86..aecb1a6 100644
--- a/System/JadeDynastyTower/TowerWin.cs
+++ b/System/JadeDynastyTower/TowerWin.cs
@@ -83,7 +83,7 @@
private void CloseSubWindows()
{
- var windows = WindowConfig.Get().FindChildWindows("TowerWin");
+ var windows = WindowConfig.GetChildWindows("TowerWin");
foreach (var item in windows)
{
WindowCenter.Instance.Close(item);
diff --git a/System/KnapSack/New/KnapSackWin.cs b/System/KnapSack/New/KnapSackWin.cs
index f1557fc..3a3e3f0 100644
--- a/System/KnapSack/New/KnapSackWin.cs
+++ b/System/KnapSack/New/KnapSackWin.cs
@@ -177,7 +177,7 @@
private void CloseSubWindows()
{
- var children = WindowConfig.Get().FindChildWindows("KnapSackWin");
+ var children = WindowConfig.GetChildWindows("KnapSackWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/NewBieGuidance/NewBieCenter.cs b/System/NewBieGuidance/NewBieCenter.cs
index fc67c0b..2ad05e0 100644
--- a/System/NewBieGuidance/NewBieCenter.cs
+++ b/System/NewBieGuidance/NewBieCenter.cs
@@ -179,7 +179,7 @@
ignoreWindows.Add(triggerWindows[currentGuide].name);
var parent = string.Empty;
- if (WindowConfig.Get().FindParentWindow(triggerWindows[currentGuide].name, out parent))
+ if (WindowConfig.FindParentWindow(triggerWindows[currentGuide].name, out parent))
{
ignoreWindows.Add(parent);
}
diff --git a/System/NewYearFairylandCeremony/NewYearFairylandCeremonyWin.cs b/System/NewYearFairylandCeremony/NewYearFairylandCeremonyWin.cs
index 918733a..de42303 100644
--- a/System/NewYearFairylandCeremony/NewYearFairylandCeremonyWin.cs
+++ b/System/NewYearFairylandCeremony/NewYearFairylandCeremonyWin.cs
@@ -112,7 +112,7 @@
private void CloseChildWin()
{
- var children = WindowConfig.Get().FindChildWindows(this.GetType().Name);
+ var children = WindowConfig.GetChildWindows(this.GetType().Name);
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/OpenServerActivity/OpenServerActivityWin.cs b/System/OpenServerActivity/OpenServerActivityWin.cs
index ff70b3f..3d809a3 100644
--- a/System/OpenServerActivity/OpenServerActivityWin.cs
+++ b/System/OpenServerActivity/OpenServerActivityWin.cs
@@ -618,7 +618,7 @@
private void CloseOtherWin()
{
- var children = WindowConfig.Get().FindChildWindows("OpenServerActivityWin");
+ var children = WindowConfig.GetChildWindows("OpenServerActivityWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/Role/RolePanel.cs b/System/Role/RolePanel.cs
index c65e020..0a187cd 100644
--- a/System/Role/RolePanel.cs
+++ b/System/Role/RolePanel.cs
@@ -371,7 +371,7 @@
OnDisableRole();
m_RoleInfoRt.gameObject.SetActive(false);
}
- var children = WindowConfig.Get().FindChildWindows("RolePanel");
+ var children = WindowConfig.GetChildWindows("RolePanel");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/Rune/RunePanel.cs b/System/Rune/RunePanel.cs
index 2085e96..2abcf13 100644
--- a/System/Rune/RunePanel.cs
+++ b/System/Rune/RunePanel.cs
@@ -86,7 +86,7 @@
private void CloseChild()
{
- var children = WindowConfig.Get().FindChildWindows("RunePanel");
+ var children = WindowConfig.GetChildWindows("RunePanel");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/Skill/SkillWin.cs b/System/Skill/SkillWin.cs
index e9b8e84..180f92d 100644
--- a/System/Skill/SkillWin.cs
+++ b/System/Skill/SkillWin.cs
@@ -113,7 +113,7 @@
void CloseChild()
{
- var children = WindowConfig.Get().FindChildWindows("SkillWin");
+ var children = WindowConfig.GetChildWindows("SkillWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/Treasure/TreasureBaseWin.cs b/System/Treasure/TreasureBaseWin.cs
index 9e81fce..c92e524 100644
--- a/System/Treasure/TreasureBaseWin.cs
+++ b/System/Treasure/TreasureBaseWin.cs
@@ -244,7 +244,7 @@
private void Back()
{
- var childrens = WindowConfig.Get().FindChildWindows("TreasureBaseWin");
+ var childrens = WindowConfig.GetChildWindows("TreasureBaseWin");
bool existAnyChildWindow = false;
foreach (var window in childrens)
{
@@ -327,7 +327,7 @@
private void CloseSubWindows()
{
- var childrens = WindowConfig.Get().FindChildWindows("TreasureBaseWin");
+ var childrens = WindowConfig.GetChildWindows("TreasureBaseWin");
foreach (var window in childrens)
{
WindowCenter.Instance.Close(window);
diff --git a/System/Vip/VipRechargeWin.cs b/System/Vip/VipRechargeWin.cs
index 87496b2..182e318 100644
--- a/System/Vip/VipRechargeWin.cs
+++ b/System/Vip/VipRechargeWin.cs
@@ -117,7 +117,7 @@
private void CloseChildWin()
{
- var children = WindowConfig.Get().FindChildWindows("VipRechargeWin");
+ var children = WindowConfig.GetChildWindows("VipRechargeWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/Welfare/WelfareWin.cs b/System/Welfare/WelfareWin.cs
index 9022c5f..72f3a58 100644
--- a/System/Welfare/WelfareWin.cs
+++ b/System/Welfare/WelfareWin.cs
@@ -118,7 +118,7 @@
#endregion
private void CloseChildWin()
{
- var children = WindowConfig.Get().FindChildWindows("WelfareWin");
+ var children = WindowConfig.GetChildWindows("WelfareWin");
foreach (var window in children)
{
WindowCenter.Instance.Close(window);
diff --git a/System/WindowBase/OneLevelWin.cs b/System/WindowBase/OneLevelWin.cs
new file mode 100644
index 0000000..a7c1974
--- /dev/null
+++ b/System/WindowBase/OneLevelWin.cs
@@ -0,0 +1,102 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Sunday, April 28, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using UnityEngine.Events;
+
+namespace Snxxz.UI
+{
+
+ public class OneLevelWin : Window
+ {
+ Image m_TitleIcon;
+ FunctionButtonGroup m_Group;
+ Button m_Left;
+ Button m_Right;
+ Button m_Close;
+
+ RectTransform m_SubWindowContainer;
+ public RectTransform subWindowContainer { get { return m_SubWindowContainer; } }
+
+ #region Built-in
+ protected override void BindController()
+ {
+ m_TitleIcon = this.GetComponent<Image>("Pivot/Container_BackGround/Img_Title");
+ m_Group = this.GetComponent<FunctionButtonGroup>("Pivot/Container_Functions");
+ m_Left = this.GetComponent<Button>("Pivot/Container_Buttons/Btn_Left");
+ m_Right = this.GetComponent<Button>("Pivot/Container_Buttons/Btn_Right");
+ m_Close = this.GetComponent<Button>("Pivot/Container_Buttons/Btn_Close");
+
+ m_SubWindowContainer = this.GetComponent<RectTransform>("Container_SubWindow");
+
+ var name = this.GetType().Name;
+ var children = WindowConfig.GetChildWindows(name);
+ foreach (var child in children)
+ {
+ var info = WindowConfig.GetWindowFunctionInfo(name, child);
+ m_Group.AddFunction(info.order, info.functionId, Language.Get(info.titleKey), info.redPointId);
+ }
+
+ m_TitleIcon.SetSprite(WindowConfig.GetTitleIconKey(name));
+ m_TitleIcon.SetNativeSize();
+ }
+
+ protected override void AddListeners()
+ {
+ m_Close.SetListener(() => { WindowCenter.Instance.Close(this.GetType().Name); });
+ m_Left.SetListener(() => { m_Group.TriggerLast(); });
+ m_Right.SetListener(() => { m_Group.TriggerNext(); });
+ }
+
+ protected override void OnPreOpen()
+ {
+ }
+
+ protected override void OnAfterOpen()
+ {
+ }
+
+ protected override void OnPreClose()
+ {
+ }
+
+ protected override void OnAfterClose()
+ {
+ }
+
+ protected override void OnActived()
+ {
+ base.OnActived();
+ m_Left.gameObject.SetActive(m_Group.unLockedCount > 1);
+ m_Right.gameObject.SetActive(m_Group.unLockedCount > 1);
+ }
+
+ #endregion
+
+ protected virtual void CloseSubWindows()
+ {
+ var subWindows = WindowConfig.GetChildWindows(this.GetType().Name);
+ foreach (var window in subWindows)
+ {
+ WindowCenter.Instance.Close(window);
+ }
+ }
+
+ protected void SetFunctionListener(int order, UnityAction callBack)
+ {
+ m_Group.SetFunctionListener(order, callBack);
+ }
+
+ }
+
+}
+
+
+
+
diff --git a/System/WindowBase/OneLevelWin.cs.meta b/System/WindowBase/OneLevelWin.cs.meta
new file mode 100644
index 0000000..fd8b995
--- /dev/null
+++ b/System/WindowBase/OneLevelWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 5463ece122afcd648bffd43c15a2db3a
+timeCreated: 1556421570
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/WindowBase/Window.cs b/System/WindowBase/Window.cs
index 862711b..3a90bf5 100644
--- a/System/WindowBase/Window.cs
+++ b/System/WindowBase/Window.cs
@@ -72,15 +72,24 @@
{
windowTimer = 0f;
var parentName = string.Empty;
- if (WindowConfig.Get().FindParentWindow(this.gameObject.name, out parentName))
+ if (WindowConfig.FindParentWindow(this.gameObject.name, out parentName))
{
var parentWindow = WindowCenter.Instance.Get(parentName);
- if (parentWindow != null)
+ if (parentWindow is OneLevelWin)
+ {
+ parent = (parentWindow as OneLevelWin).subWindowContainer;
+ }
+ else
{
parent = parentWindow.transform as RectTransform;
+ }
+
+ if (parent != null)
+ {
rectTransform.MatchWhith(parent);
}
}
+
OnPreOpen();
WindowCenter.Instance.NotifyBeforeOpen(this);
}
@@ -450,11 +459,11 @@
try
{
- var isChildWindow = WindowConfig.Get().IsChildWindow(this.gameObject.name);
+ var isChildWindow = WindowConfig.IsChildWindow(this.gameObject.name);
if (isChildWindow)
{
var parentName = string.Empty;
- WindowConfig.Get().FindParentWindow(this.gameObject.name, out parentName);
+ WindowConfig.FindParentWindow(this.gameObject.name, out parentName);
var parentWindow = WindowCenter.Instance.Get(parentName);
if (parentWindow != null && parentWindow.executedActiveWindow)
{
@@ -466,7 +475,7 @@
{
OnActived();
executedActiveWindow = true;
- var childWindows = WindowConfig.Get().FindChildWindows(this.gameObject.name);
+ var childWindows = WindowConfig.GetChildWindows(this.gameObject.name);
var isParentWindow = childWindows != null;
if (isParentWindow)
{
diff --git a/System/WindowBase/WindowCenter.cs b/System/WindowBase/WindowCenter.cs
index 8fc9dc4..2e7901d 100644
--- a/System/WindowBase/WindowCenter.cs
+++ b/System/WindowBase/WindowCenter.cs
@@ -164,7 +164,7 @@
public void Close(string name)
{
- if (WindowConfig.Get().IsChildWindow(name))
+ if (WindowConfig.IsChildWindow(name))
{
CloseImmediately(name);
}
@@ -241,7 +241,7 @@
break;
}
- isIgnore = isIgnore || WindowConfig.Get().IsChildWindow(name);
+ isIgnore = isIgnore || WindowConfig.IsChildWindow(name);
if (!isIgnore)
{
if (window.windowState == Window.WindowState.Opened || window.windowState == Window.WindowState.Opening)
@@ -265,7 +265,7 @@
continue;
}
- var isIgnore = WindowConfig.Get().IsChildWindow(name);
+ var isIgnore = WindowConfig.IsChildWindow(name);
if (isIgnore)
{
continue;
@@ -314,7 +314,7 @@
break;
}
- isIgnore = isIgnore || WindowConfig.Get().IsChildWindow(name);
+ isIgnore = isIgnore || WindowConfig.IsChildWindow(name);
if (!isIgnore)
{
if (window.windowState == Window.WindowState.Opened || window.windowState == Window.WindowState.Opening)
diff --git a/System/YinJi.meta b/System/YinJi.meta
new file mode 100644
index 0000000..2a7b37c
--- /dev/null
+++ b/System/YinJi.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 80212c8f087439f4a8bd063acaf6d098
+folderAsset: yes
+timeCreated: 1556337107
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/UI/Common/FunctionButtonGroup.cs b/UI/Common/FunctionButtonGroup.cs
index af06211..73ac4f1 100644
--- a/UI/Common/FunctionButtonGroup.cs
+++ b/UI/Common/FunctionButtonGroup.cs
@@ -6,6 +6,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
+using UnityEngine.Events;
namespace Snxxz.UI
{
@@ -13,6 +14,7 @@
public class FunctionButtonGroup : MonoBehaviour
{
[SerializeField] ScrollRect m_ScrollRect;
+ [SerializeField] RectTransform m_Container;
public int unLockedCount {
get {
@@ -41,6 +43,11 @@
orders.Add(button.order);
orders.Sort(OrderCompare);
}
+
+ if (m_ScrollRect != null)
+ {
+ m_ScrollRect.horizontal = functionButtons.Count > 5;
+ }
}
public void UnRegister(FunctionButton button)
@@ -56,6 +63,10 @@
orders.Sort(OrderCompare);
}
+ if (m_ScrollRect != null)
+ {
+ m_ScrollRect.horizontal = functionButtons.Count > 5;
+ }
}
public void NotifyToggleOn(FunctionButton button)
@@ -172,6 +183,33 @@
{
return a < b ? -1 : 1;
}
+
+ public FunctionButton AddFunction(int order, int functionId, string title, int redpointId)
+ {
+ if (m_Container == null)
+ {
+ return null;
+ }
+
+ var instance = UIUtility.CreateWidget("FunctionButton", string.Concat("Function_", order));
+ var functionButton = instance.GetComponent<FunctionButton>();
+ functionButton.functionId = functionId;
+ functionButton.order = order;
+ functionButton.title.text = title;
+
+ functionButton.group = this;
+ functionButtons[order] = functionButton;
+ return functionButton;
+ }
+
+ public void SetFunctionListener(int order, UnityAction callBack)
+ {
+ if (functionButtons.ContainsKey(order))
+ {
+ functionButtons[order].SetListener(callBack);
+ }
+ }
+
}
}
diff --git a/UI/Common/WindowConfig.cs b/UI/Common/WindowConfig.cs
index f1cbefe..0c6a29e 100644
--- a/UI/Common/WindowConfig.cs
+++ b/UI/Common/WindowConfig.cs
@@ -6,25 +6,23 @@
[CreateAssetMenu(menuName = "Config/WindowConfig")]
public class WindowConfig : ScriptableObject
{
-
public WindowTable[] windows;
[NonSerialized] public Dictionary<string, List<string>> parentChildrenTable = new Dictionary<string, List<string>>();
[NonSerialized] public List<string> childWindows = new List<string>();
static WindowConfig config;
- public static WindowConfig Get()
+ static WindowConfig Get()
{
if (config == null)
{
config = BuiltInLoader.LoadScriptableObject<WindowConfig>("WindowConfig");
- for (int i = 0; i < config.windows.Length; i++)
+ foreach (var table in config.windows)
{
- var table = config.windows[i];
var children = config.parentChildrenTable[table.parent] = new List<string>();
- for (int j = 0; j < table.orderTables.Length; j++)
+ foreach (var info in table.orderTables)
{
- children.Add(table.orderTables[j].window);
+ children.Add(info.window);
}
config.childWindows.AddRange(children);
@@ -39,53 +37,29 @@
config = null;
}
- public bool FindChildWindow(string _parent, int _order, out string _child)
+ public static bool FindParentWindow(string child, out string parent)
{
- for (int i = 0; i < windows.Length; i++)
+ foreach (var table in Get().windows)
{
- var table = windows[i];
- if (table.parent == _parent)
+ foreach (var orderTable in table.orderTables)
{
- for (int j = 0; j < table.orderTables.Length; j++)
+ if (orderTable.window == child)
{
- if (table.orderTables[j].order == _order)
- {
- _child = table.orderTables[j].window;
- return true;
- }
- }
- }
- }
-
- _child = string.Empty;
- return false;
- }
-
- public bool FindParentWindow(string _child, out string _parent)
- {
- for (int i = 0; i < windows.Length; i++)
- {
- var table = windows[i];
- for (int j = 0; j < table.orderTables.Length; j++)
- {
- var orderTable = table.orderTables[j];
- if (orderTable.window == _child)
- {
- _parent = table.parent;
+ parent = table.parent;
return true;
}
}
}
- _parent = string.Empty;
+ parent = string.Empty;
return false;
}
- public List<string> FindChildWindows(string _parent)
+ public static List<string> GetChildWindows(string parent)
{
- if (parentChildrenTable.ContainsKey(_parent))
+ if (Get().parentChildrenTable.ContainsKey(parent))
{
- return parentChildrenTable[_parent];
+ return Get().parentChildrenTable[parent];
}
else
{
@@ -93,15 +67,89 @@
}
}
- public bool IsChildWindow(string _name)
+ public static bool IsParentWindow(string name)
{
- return childWindows.Contains(_name);
+ foreach (var window in Get().windows)
+ {
+ if (window.parent == name)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsChildWindow(string name)
+ {
+ return Get().childWindows.Contains(name);
+ }
+
+ public static WindowLevel GetWindowLevel(string name)
+ {
+ foreach (var window in Get().windows)
+ {
+ if (window.parent == name)
+ {
+ return window.level;
+ }
+ }
+
+ return WindowLevel.None;
+ }
+
+ public static string GetWindowPattern(string name)
+ {
+ foreach (var window in Get().windows)
+ {
+ if (window.parent == name)
+ {
+ return window.pattern;
+ }
+ }
+
+ return string.Empty;
+ }
+
+ public static OrderTable GetWindowFunctionInfo(string parent, string child)
+ {
+ foreach (var table in Get().windows)
+ {
+ if (table.parent == parent)
+ {
+ foreach (var info in table.orderTables)
+ {
+ if (info.window == child)
+ {
+ return info;
+ }
+ }
+ }
+ }
+
+ return default(OrderTable);
+ }
+
+ public static string GetTitleIconKey(string name)
+ {
+ foreach (var window in Get().windows)
+ {
+ if (window.parent == name)
+ {
+ return window.titleIconKey;
+ }
+ }
+
+ return string.Empty;
}
[Serializable]
public struct WindowTable
{
public string parent;
+ public string titleIconKey;
+ public WindowLevel level;
+ public string pattern;
public OrderTable[] orderTables;
}
@@ -109,7 +157,18 @@
public struct OrderTable
{
public int order;
+ public int functionId;
+ public int redPointId;
+ public string titleKey;
public string window;
}
+ public enum WindowLevel
+ {
+ None,
+ OneLevel,
+ SecondLevel,
+ ThirdLevel,
+ }
+
}
--
Gitblit v1.8.0