From a80d9e64b60403c71ff7ff32c9e94e6833f50ace Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 10 九月 2025 22:28:26 +0800
Subject: [PATCH] 0312 优化删除物品的通知
---
Main/System/Main/HomeWin.cs | 177 +++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 147 insertions(+), 30 deletions(-)
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index eefb2ad..4b6d0cd 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -12,6 +12,7 @@
//缁忛獙鍖�
[SerializeField] Text playerLevelText;
[SerializeField] SmoothSlider expSlider;
+ [SerializeField] Button officialUpBtn;
//浠诲姟鍖�
[SerializeField] Button taskButton; //寮曞鎴栬�呴鍙栦换鍔″鍔�
@@ -24,18 +25,29 @@
//鍏冲崱
[SerializeField] Button bossBtn;
+ [SerializeField] MainLevelWaveCell[] mainLevelWaves;
+ [SerializeField] ScrollRect mainLevelScrollRect;
+ [SerializeField] Text levelName;
+ [SerializeField] GameObject restMark;
+ [SerializeField] Button restBtn;
+ [SerializeField] GameObject fightMark;
+ [SerializeField] ScaleTween bossTween;
+ [SerializeField] GameObject bossmask; //瀹屾垚杩涘害閬尅绠¢亾 绾樉绀�
+ [SerializeField] GameObject bossActiveGo;
+ [SerializeField] GameObject bitemeGo;
+ [SerializeField] Text processText;
+
+
+ //鍗$墝
+ [SerializeField] HeroFightingCardCell[] heroFightingCardCells;
[SerializeField] Button changeHeroPosBtn;
-
- //绛夌骇
- [SerializeField] Button officialUpBtn;
-
//搴曢儴鍔熻兘
[SerializeField] Button autoBtn;
[SerializeField] Image autoCloseImg;
[SerializeField] UIEffectPlayer autoOpenEffect;
- [SerializeField] Button blessLVBtn;
+ [SerializeField] Button blessLVBtn;
[SerializeField] Text blessLVText;
//鍏朵粬鍔熻兘鍏ュ彛
@@ -60,25 +72,6 @@
autoBtn.AddListener(() =>
{
- // //娴嬭瘯鎷惧彇鎵�鏈夌墿鍝�
- // var items = PackManager.Instance.GetItems(PackType.DropItem);
- // List<int> dropindexs = new List<int>();
- // for (int i = 0; i < items.Count; i++)
- // {
- // var item = items[i];
- // if (dropindexs.Count > 5)
- // {
- // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>());
- // dropindexs.Clear();
- // }
-
- // dropindexs.Add(item.gridIndex);
- // }
- // if (dropindexs.Count > 0)
- // {
- // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>());
- // dropindexs.Clear();
- // }
if (!FuncOpen.Instance.IsFuncOpen(108, true))
{
return;
@@ -97,12 +90,14 @@
UIManager.Instance.OpenWindow<BlessLVWin>();
});
- officialUpBtn.AddListener(()=>
+ officialUpBtn.AddListener(() =>
{
if (RealmConfig.GetKeys().Count <= PlayerDatas.Instance.baseData.realmLevel)
return;
UIManager.Instance.OpenWindow<OfficialUpWin>();
});
+
+ restBtn.AddListener(GotoRest);
}
@@ -115,6 +110,10 @@
RefreshRecharge();
ShowBlessLV();
DisplayAutoFight();
+ DisplayCard(TeamType.Story);
+ DisplayLevel();
+ DisplayRestState();
+
}
protected override void OnPreOpen()
@@ -123,6 +122,9 @@
TaskManager.Instance.OnTaskUpdate += UpdateTask;
BlessLVManager.Instance.OnBlessLVUpdateEvent += ShowBlessLV;
AutoFightModel.Instance.ChangeAutoEvent += DisplayAutoFight;
+ AutoFightModel.Instance.OnFightEvent += ChangeMode;
+ TeamManager.Instance.OnTeamChange += DisplayCard;
+ UIManager.Instance.OnCloseWindow += OnCloseWindow;
Display();
// var battleWin = UIManager.Instance.OpenWindow<BattleWin>();
// battleWin.SetBattleField(BattleManager.Instance.storyBattleField);
@@ -136,6 +138,9 @@
TaskManager.Instance.OnTaskUpdate -= UpdateTask;
BlessLVManager.Instance.OnBlessLVUpdateEvent -= ShowBlessLV;
AutoFightModel.Instance.ChangeAutoEvent -= DisplayAutoFight;
+ AutoFightModel.Instance.OnFightEvent -= ChangeMode;
+ TeamManager.Instance.OnTeamChange -= DisplayCard;
+ UIManager.Instance.OnCloseWindow -= OnCloseWindow;
// 鍏抽棴鐨勬椂鍊欐妸鎴樻枟鐣岄潰涔熺粰鍏充簡 铏界劧鏄湪澶栭潰寮�鐨�
UIManager.Instance.CloseWindow<BattleWin>();
@@ -152,13 +157,17 @@
case PlayerDataType.LV:
playerLevelText.text = PlayerDatas.Instance.baseData.LV.ToString();
break;
+ case PlayerDataType.ExAttr1:
+ case PlayerDataType.ExAttr2:
+ DisplayLevel();
+ break;
}
}
void RefreshRecharge()
- {
+ {
monthCardBtn.SetActive(!InvestModel.Instance.IsInvested(InvestModel.monthCardType));
}
@@ -180,8 +189,10 @@
autoCloseImg.SetActive(true);
autoOpenEffect.Stop();
}
+
+
}
-
+
/// <summary>
/// 鏇存柊鐜╁淇℃伅
/// </summary>
@@ -201,7 +212,7 @@
void UpdateTask()
- {
+ {
var task = TaskManager.Instance.mainTask;
if (task.TaskID == 0)
{
@@ -213,9 +224,9 @@
var taskConfig = TaskConfig.Get(task.TaskID);
taskText.text = taskConfig.TaskDescribe;
taskNumText.text = string.Format("({0}/{1})", task.CurValue, taskConfig.NeedValue);
- taskNumText.color = task.CurValue >= taskConfig.NeedValue ? UIHelper.GetUIColor(TextColType.NavyYellow) : UIHelper.GetUIColor(TextColType.Red);
+ taskNumText.color = task.CurValue >= taskConfig.NeedValue ? UIHelper.GetUIColor(TextColType.NavyYellow) : UIHelper.GetUIColor(TextColType.Red);
if (TaskManager.Instance.GetMainTaskState() == 2)
- {
+ {
taskEffect.Play();
}
else
@@ -242,4 +253,110 @@
//鏍规嵁浠诲姟绫诲瀷寮曞
}
}
+
+ void DisplayCard(TeamType teamType)
+ {
+ if (teamType != TeamType.Story)
+ return;
+ //鏄剧ず鍗$墝
+ for (int i = 0; i < heroFightingCardCells.Length; i++)
+ {
+ heroFightingCardCells[i].Display(i);
+ }
+ }
+
+ private void OnCloseWindow(UIBase closeUI)
+ {
+ //鍏朵粬姝﹀皢鍔熻兘浜х敓鏁版嵁鍙樺寲锛岄渶瑕佸埛鏂版灏嗗垪琛�
+ if (closeUI is HeroTrainWin)
+ {
+ DisplayCard(TeamType.Story);
+ }
+ }
+
+
+ private void DisplayLevel()
+ {
+ var value = PlayerDatas.Instance.baseData.ExAttr2;
+ var chapterID = value / 10000;
+ var levelNum = value % 10000 / 100;
+ var waveID = value % 100;
+
+ var config = MainLevelConfig.GetMainLevelConfig(chapterID, levelNum);
+ var totalWave = MainLevelConfig.GetwaveCount(config);
+ for (int i = 0; i < mainLevelWaves.Length; i++)
+ {
+ if (i < totalWave)
+ {
+ mainLevelWaves[i].SetActive(true);
+ mainLevelWaves[i].Display(i);
+ }
+ else
+ {
+ mainLevelWaves[i].SetActive(false);
+ }
+ }
+
+ mainLevelScrollRect.normalizedPosition = new Vector2(waveID > 3 ? 1 : 0, 0);
+
+ var chapterConfig = MainChapterConfig.Get(chapterID);
+ //銆愭櫘閫氥�戝叧鍗″悕瀛�1-6
+ levelName.text = Language.Get("mainui7", chapterConfig.Level, chapterConfig.ChapterName, chapterID, levelNum);
+
+ bool canChallengeBoss = AutoFightModel.Instance.CanChallengeBoss();
+ //BOSS
+ if (canChallengeBoss)
+ {
+ bossActiveGo.SetActive(true);
+ processText.SetActive(false);
+ bossTween.Play();
+ bitemeGo.SetActive(true);
+ bossmask.SetActive(true);
+ }
+ else
+ {
+ bossActiveGo.SetActive(false);
+ processText.SetActive(true);
+ processText.text = (waveID - 1) * 100 / totalWave + "%";
+ bossTween.Stop();
+ bitemeGo.SetActive(false);
+ bossmask.SetActive(false);
+ }
+
+ }
+
+ void DisplayRestState()
+ {
+ if (BattleManager.Instance.storyBattleField != null &&
+ BattleManager.Instance.storyBattleField.GetBattleMode() == BattleMode.Stop)
+ {
+ //浼戞伅涓�
+ restMark.SetActive(true);
+ fightMark.SetActive(false);
+ }
+ else
+ {
+ //鎴樻枟涓�
+ restMark.SetActive(false);
+ fightMark.SetActive(true);
+ }
+
+ }
+
+ void ChangeMode(bool isFight)
+ {
+ if (isFight)
+ return;
+ DisplayRestState();
+ DisplayLevel();
+ }
+
+ void GotoRest()
+ {
+ if (BattleManager.Instance.storyBattleField != null &&
+ BattleManager.Instance.storyBattleField.GetBattleMode() != BattleMode.Stop)
+ {
+ BattleManager.Instance.storyBattleField.HaveRest();
+ }
+ }
}
\ No newline at end of file
--
Gitblit v1.8.0