From a2a86b160ae0a0f982edd3749ed4c1fa0d517556 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期五, 21 十一月 2025 11:09:45 +0800
Subject: [PATCH] 262 幻境阁系统-客户端 修复先看静态图再看spine残留静态图
---
Main/System/Guild/GuildJoinWin.cs | 87 +++++++++++++++++++++++++++++++++++++------
1 files changed, 74 insertions(+), 13 deletions(-)
diff --git a/Main/System/Guild/GuildJoinWin.cs b/Main/System/Guild/GuildJoinWin.cs
index db9a591..ce028c5 100644
--- a/Main/System/Guild/GuildJoinWin.cs
+++ b/Main/System/Guild/GuildJoinWin.cs
@@ -4,7 +4,7 @@
using UnityEngine.UI;
/// <summary>
-/// 鍔犲叆鍏細鐣岄潰
+/// 鍔犲叆鍏細鐣岄潰 锛氬叕浼氭煡鎵惧垪琛紝涔熸槸鎺掕姒�
/// </summary>
public class GuildJoinWin : UIBase
{
@@ -19,7 +19,7 @@
int lastPage = 0;
protected override void InitComponent()
{
- findBtn.AddListener(OnFindBtnClick);
+ findBtn.AddListener(() => OnFindBtnClick());
createGuildBtn.AddListener(OnCreateGuildBtnClick);
quicklyJoinGuildBtn.AddListener(OnQuicklyJoinGuildBtnClick);
}
@@ -27,9 +27,30 @@
{
findText.text = "";
//鎵撳紑鐣岄潰榛樿璇锋眰锛屾粴鍔ㄧ殑鏃跺�欓渶瑕佸鐞嗛〉鏁�
- OnFindBtnClick();
+ QueryGuild();
GuildManager.Instance.OnRefreshFairyList += OnRefreshGuildList;
+ GuildManager.Instance.MyRequestJoinEvent += MyRequestJoinEvent;
+ PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += OnRefreshFairyInfo;
+ guildListScroller.OnRefreshCell += RefreshCell;
Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ GuildManager.Instance.OnRefreshFairyList -= OnRefreshGuildList;
+ GuildManager.Instance.MyRequestJoinEvent -= MyRequestJoinEvent;
+ guildListScroller.OnRefreshCell -= RefreshCell;
+ PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= OnRefreshFairyInfo;
+
+ UIManager.Instance.GetUI<MainWin>()?.RestoreFuncBtn();
+
+ }
+
+ void OnRefreshFairyInfo()
+ {
+ //褰撳墠鐣岄潰涓嬫湁鍒锋柊鑷鐨勫叕浼氭暟鎹紝璇存槑涓�瀹氭槸鍔犲叆浜嗗叕浼氾紝闇�涓诲姩璺宠浆鍒板叕浼氱晫闈�
+ CloseWindow();
+ UIManager.Instance.GetUI<MainWin>()?.ClickFunc(4);
}
void Display()
@@ -37,11 +58,25 @@
CreateScroller();
}
+ void MyRequestJoinEvent()
+ {
+ guildListScroller.m_Scorller.RefreshActiveCellViews();
+ }
+
//鍒楄〃鍙樺皬鐨勮瘽 閲嶆柊鍒涘缓锛涘垪琛ㄥ彉澶х殑璇濓紝鍙坊鍔�
void CreateScroller()
{
- var startCount = guildListScroller.GetNumberOfCells();
+ if (GuildManager.Instance.pageIndexList.Count == 0)
+ {
+ noGuildTf.SetActive(true);
+ guildListScroller.SetActive(false);
+ return;
+ }
+ noGuildTf.SetActive(false);
+ guildListScroller.SetActive(true);
+
+ var startCount = guildListScroller.GetCellTotalCount();
if (startCount > GuildManager.Instance.pageIndexList.Count)
{
guildListScroller.Refresh();
@@ -53,12 +88,6 @@
guildListScroller.Restart();
}
- protected override void OnPreClose()
- {
- GuildManager.Instance.OnRefreshFairyList -= OnRefreshGuildList;
- }
-
-
void OnRefreshGuildList()
@@ -66,9 +95,36 @@
CreateScroller();
}
+ void RefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell.GetComponent<GuildViewListCell>();
+ _cell.Display(cell.index);
+ }
+
private void OnFindBtnClick()
{
- lastQuery = findText.text;
+ var nowQuery = findText.text;
+ if (string.IsNullOrEmpty(nowQuery) && string.IsNullOrEmpty(lastQuery))
+ {
+ SysNotifyMgr.Instance.ShowTip("GuildSys5");
+ return;
+ }
+ if (nowQuery.Length < 2 && nowQuery.Length > 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("GuildSys7");
+ return;
+ }
+
+ lastQuery = nowQuery;
+ lastPage = 0;
+ guildListScroller.Refresh();
+ GuildManager.Instance.SendFindGuild(lastQuery);
+ }
+
+
+ void QueryGuild()
+ {
+ lastQuery = "";
lastPage = 0;
guildListScroller.Refresh();
GuildManager.Instance.SendFindGuild(lastQuery);
@@ -76,12 +132,17 @@
private void OnCreateGuildBtnClick()
{
- // TODO: 瀹炵幇鍒涘缓鍏細閫昏緫
+ UIManager.Instance.OpenWindow<GuildCreateWin>();
}
private void OnQuicklyJoinGuildBtnClick()
{
- // TODO: 瀹炵幇蹇�熷姞鍏ュ叕浼氶�昏緫
+ if (GuildManager.Instance.pageIndexList.Count == 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("QuickEnterFamilyFail");
+ return;
+ }
+ GuildManager.Instance.SendApplyGuild(0, 0);
}
--
Gitblit v1.8.0