From 9a66671e5cc3f26e19bb5cb3bb20f52eff3d33f1 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期五, 12 四月 2019 14:53:49 +0800
Subject: [PATCH] 6490 【2.0】【前端】打宝界面和境界压制调整
---
System/WindowJump/WindowJumpMgr.cs | 5 +
System/FindPrecious/FindPreciousFrameWin.cs | 19 ++++-
System/FindPrecious/FindPreciousModel.cs | 23 +++----
System/FindPrecious/LootPreciousFrameWin.cs | 12 ----
UI/Common/FunctionButtonGroup.cs | 66 ++++++++++++++--------
5 files changed, 70 insertions(+), 55 deletions(-)
diff --git a/System/FindPrecious/FindPreciousFrameWin.cs b/System/FindPrecious/FindPreciousFrameWin.cs
index 5267b64..c64e12e 100644
--- a/System/FindPrecious/FindPreciousFrameWin.cs
+++ b/System/FindPrecious/FindPreciousFrameWin.cs
@@ -15,6 +15,7 @@
public class FindPreciousFrameWin : Window
{
[SerializeField] FunctionButtonGroup m_FunctionGroup;
+ [SerializeField] FunctionButton m_DemonJar;
[SerializeField] FunctionButton m_WorldBoss;
[SerializeField] FunctionButton m_BossHome;
[SerializeField] FunctionButton m_PersonalBoss;
@@ -32,6 +33,7 @@
protected override void AddListeners()
{
+ m_DemonJar.AddListener(ShowDemonJar);
m_WorldBoss.AddListener(ShowWorldBoss);
m_BossHome.AddListener(ShowBossHome);
m_PersonalBoss.AddListener(ShowPersonalBoss);
@@ -72,9 +74,16 @@
m_Right.gameObject.SetActive(m_FunctionGroup.unLockedCount > 1);
m_FunctionGroup.TriggerByOrder(functionOrder);
+ m_FunctionGroup.GotoOrder(functionOrder);
}
#endregion
+ private void ShowDemonJar()
+ {
+ CloseSubWindows();
+ WindowCenter.Instance.Open<DemonJarWin>();
+ functionOrder = m_DemonJar.order;
+ }
private void ShowWorldBoss()
{
@@ -113,11 +122,11 @@
private void CloseSubWindows()
{
- WindowCenter.Instance.Close<WorldBossWin>();
- WindowCenter.Instance.Close<BossHomeWin>();
- WindowCenter.Instance.Close<PersonalBossWin>();
- WindowCenter.Instance.Close<ElderGodAreaWin>();
- WindowCenter.Instance.Close<PreciousDropRecordWin>();
+ var subWindows = WindowConfig.Get().FindChildWindows("FindPreciousFrameWin");
+ foreach ( var window in subWindows )
+ {
+ WindowCenter.Instance.Close(window);
+ }
}
private void ShowLastFunction()
diff --git a/System/FindPrecious/FindPreciousModel.cs b/System/FindPrecious/FindPreciousModel.cs
index cea77cd..4053990 100644
--- a/System/FindPrecious/FindPreciousModel.cs
+++ b/System/FindPrecious/FindPreciousModel.cs
@@ -18,8 +18,7 @@
Redpoint lootPreciousRedpoint = new Redpoint(LOOTPRECIOUs_REDPOINTID);
int m_ViewKillRecordsBoss = 0;
- public int ViewKillRecordsBoss
- {
+ public int ViewKillRecordsBoss {
get { return this.m_ViewKillRecordsBoss; }
set { this.m_ViewKillRecordsBoss = value; }
}
@@ -28,11 +27,9 @@
public List<BossNotify> bossNotifies = new List<BossNotify>();
BossNotify m_CurrentBossNotify = default(BossNotify);
- public BossNotify currentBossNotify
- {
+ public BossNotify currentBossNotify {
get { return m_CurrentBossNotify; }
- private set
- {
+ private set {
if (m_CurrentBossNotify != value)
{
m_CurrentBossNotify = value;
@@ -425,23 +422,25 @@
private void UpdateRedpoint(int _redpointId)
{
if (_redpointId == WorldBossModel.WORLDBOSS_REDPOINT ||
- _redpointId == PersonalBossModel.PERSONAL_REDPOINTID)
+ _redpointId == PersonalBossModel.PERSONAL_REDPOINTID ||
+ _redpointId == DemonJarModel.DEMONJAR_REDPOINTID
+ )
{
var worldBossRedpointCount = worldBossModel.worldBossRedPoint.count;
var personalBossRedpointCount = personalBossModel.personalRedpoint.count;
- var totalCount = worldBossRedpointCount + personalBossRedpointCount;
+ var demonJarRedpointCount = demonJarModel.redpoint.count;
+
+ var totalCount = worldBossRedpointCount + personalBossRedpointCount + demonJarRedpointCount;
findPreciousRedpoint.state = totalCount > 0 ? RedPointState.Quantity : RedPointState.None;
findPreciousRedpoint.count = totalCount;
}
- if (_redpointId == DemonJarModel.DEMONJAR_REDPOINTID ||
- _redpointId == DogzDungeonModel.DOGZDUNGEON_REDPOINT ||
+ if (_redpointId == DogzDungeonModel.DOGZDUNGEON_REDPOINT ||
_redpointId == JadeDynastyBossModel.JADEDYNASTY_REDPOINTID)
{
- var demonJarRedpointCount = demonJarModel.redpoint.count;
var dogzDungeonRedpointCount = dogzDungeonModel.redpoint.count;
var jadeDynastyBossRedpointCount = jadeDynastyBossModel.redpoint.count;
- var totalCount = demonJarRedpointCount + dogzDungeonRedpointCount + jadeDynastyBossRedpointCount;
+ var totalCount = dogzDungeonRedpointCount + jadeDynastyBossRedpointCount;
lootPreciousRedpoint.count = totalCount;
lootPreciousRedpoint.state = totalCount > 0 ? RedPointState.Quantity : RedPointState.None;
diff --git a/System/FindPrecious/LootPreciousFrameWin.cs b/System/FindPrecious/LootPreciousFrameWin.cs
index b8d0557..3a1755b 100644
--- a/System/FindPrecious/LootPreciousFrameWin.cs
+++ b/System/FindPrecious/LootPreciousFrameWin.cs
@@ -14,7 +14,6 @@
{
[SerializeField] FunctionButtonGroup m_FunctionGroup;
- [SerializeField] FunctionButton m_DemonJar;
[SerializeField] FunctionButton m_FairyGrabBoss;
[SerializeField] FunctionButton m_DogzDungeon;
[SerializeField] FunctionButton m_JadeDynastyBoss;
@@ -34,7 +33,6 @@
protected override void AddListeners()
{
- m_DemonJar.AddListener(ShowDemonJar);
m_DogzDungeon.AddListener(ShowDogzDungeon);
m_RidingPetContention.AddListener(ShowRidingPetContention);
m_FairyGrabBoss.AddListener(FairyGrabBoss);
@@ -77,16 +75,6 @@
m_FunctionGroup.TriggerByOrder(functionOrder);
}
#endregion
-
- private void ShowDemonJar()
- {
- CloseSubWindows();
-
- m_NormalBottom.gameObject.SetActive(true);
-
- WindowCenter.Instance.Open<DemonJarWin>();
- functionOrder = m_DemonJar.order;
- }
private void FairyGrabBoss()
{
diff --git a/System/WindowJump/WindowJumpMgr.cs b/System/WindowJump/WindowJumpMgr.cs
index 0d2f1d3..7d09d46 100644
--- a/System/WindowJump/WindowJumpMgr.cs
+++ b/System/WindowJump/WindowJumpMgr.cs
@@ -367,11 +367,11 @@
case JumpUIType.FindPreciousFrameFunc3:
case JumpUIType.FindPreciousFrameFunc4:
case JumpUIType.FindPreciousFrameFunc5:
+ case JumpUIType.FindPreciousFrameFunc6:
case JumpUIType.FindPreciousFrameFunc2Type2:
case JumpUIType.FindPreciousFrameFunc4Type2:
SetJumpLogic<FindPreciousFrameWin>(_tagWinSearchModel.TABID);
break;
- case JumpUIType.LootPreciousFrameFunc1:
case JumpUIType.DogzDungeon:
case JumpUIType.FairyGrabBoss:
case JumpUIType.JadeDynastyBoss290:
@@ -1441,6 +1441,8 @@
FindPreciousFrameFunc3 = 84,
FindPreciousFrameFunc4 = 85,
FindPreciousFrameFunc5 = 86,
+ FindPreciousFrameFunc6 = 104,//灏侀瓟鍧�
+
MarketFunc1 = 87,
MarketFunc2 = 88,
MarketFunc3 = 89,
@@ -1451,7 +1453,6 @@
RuneTower = 99,//绗﹀嵃濉�
WelfareFunc1 = 102, //绛惧埌
WelfareFunc2 = 103, //绁堟効
- LootPreciousFrameFunc1 = 104, //灏侀瓟鍧�
DogzDungeon = 242, //寮傚吔涔嬪湴
SystemSettingFunc1 = 109,//鎸傛満璁剧疆
diff --git a/UI/Common/FunctionButtonGroup.cs b/UI/Common/FunctionButtonGroup.cs
index 4f0ddc3..af06211 100644
--- a/UI/Common/FunctionButtonGroup.cs
+++ b/UI/Common/FunctionButtonGroup.cs
@@ -12,10 +12,12 @@
public class FunctionButtonGroup : MonoBehaviour
{
+ [SerializeField] ScrollRect m_ScrollRect;
+
public int unLockedCount {
get {
var count = 0;
- foreach (var button in toggleButtons.Values)
+ foreach (var button in functionButtons.Values)
{
if (button.state != TitleBtnState.Locked)
{
@@ -29,57 +31,57 @@
int currentOrder = 0;
List<int> orders = new List<int>();
- Dictionary<int, FunctionButton> toggleButtons = new Dictionary<int, FunctionButton>();
+ Dictionary<int, FunctionButton> functionButtons = new Dictionary<int, FunctionButton>();
- public void Register(FunctionButton _toggleButton)
+ public void Register(FunctionButton button)
{
- toggleButtons[_toggleButton.order] = _toggleButton;
- if (!orders.Contains(_toggleButton.order))
+ functionButtons[button.order] = button;
+ if (!orders.Contains(button.order))
{
- orders.Add(_toggleButton.order);
+ orders.Add(button.order);
orders.Sort(OrderCompare);
}
}
- public void UnRegister(FunctionButton _toggleButton)
+ public void UnRegister(FunctionButton button)
{
- if (toggleButtons.ContainsKey(_toggleButton.order))
+ if (functionButtons.ContainsKey(button.order))
{
- toggleButtons.Remove(_toggleButton.order);
+ functionButtons.Remove(button.order);
}
- if (orders.Contains(_toggleButton.order))
+ if (orders.Contains(button.order))
{
- orders.Remove(_toggleButton.order);
+ orders.Remove(button.order);
orders.Sort(OrderCompare);
}
}
- public void NotifyToggleOn(FunctionButton _toggleButton)
+ public void NotifyToggleOn(FunctionButton button)
{
- if (_toggleButton.state == TitleBtnState.Click)
+ if (button.state == TitleBtnState.Click)
{
- currentOrder = _toggleButton.order;
+ currentOrder = button.order;
for (int i = 0; i < orders.Count; i++)
{
- var toggleButton = toggleButtons[orders[i]];
- if (toggleButton != _toggleButton && toggleButton.state != TitleBtnState.Locked)
+ var functionButton = functionButtons[orders[i]];
+ if (functionButton != button && functionButton.state != TitleBtnState.Locked)
{
- toggleButton.state = TitleBtnState.Normal;
+ functionButton.state = TitleBtnState.Normal;
}
}
}
}
- public void TriggerByOrder(int _order)
+ public void TriggerByOrder(int targetOrder)
{
for (int i = 0; i < orders.Count; i++)
{
var order = orders[i];
- if (order == _order)
+ if (order == targetOrder)
{
- toggleButtons[order].Invoke(true);
+ functionButtons[order].Invoke(true);
break;
}
}
@@ -104,9 +106,9 @@
}
var next = orders[index];
- if (toggleButtons[next].state != TitleBtnState.Locked)
+ if (functionButtons[next].state != TitleBtnState.Locked)
{
- toggleButtons[next].Invoke(false);
+ functionButtons[next].Invoke(false);
break;
}
}
@@ -132,9 +134,9 @@
}
var next = orders[index];
- if (toggleButtons[next].state != TitleBtnState.Locked)
+ if (functionButtons[next].state != TitleBtnState.Locked)
{
- toggleButtons[next].Invoke(false);
+ functionButtons[next].Invoke(false);
break;
}
}
@@ -150,6 +152,22 @@
return orders.Count > 0 && currentOrder == orders[orders.Count - 1];
}
+ public void GotoOrder(int order)
+ {
+ if (m_ScrollRect != null)
+ {
+ var index = orders.IndexOf(order);
+ if (m_ScrollRect.horizontal)
+ {
+ m_ScrollRect.horizontalNormalizedPosition = (float)index / orders.Count;
+ }
+ else
+ {
+ m_ScrollRect.verticalNormalizedPosition = (float)index / orders.Count;
+ }
+ }
+ }
+
private int OrderCompare(int a, int b)
{
return a < b ? -1 : 1;
--
Gitblit v1.8.0