From 2636bf475c8b4b03ee869a5db2f5fdd891ed9f97 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 04 十二月 2025 09:19:35 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/Main/HomeWin.cs | 126 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 120 insertions(+), 6 deletions(-)
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index d486a3e..bdd24a0 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -11,7 +11,6 @@
/// </summary>
public class HomeWin : UIBase
{
-
//缁忛獙鍖�
[SerializeField] Text playerLevelText;
[SerializeField] SmoothSlider expSlider;
@@ -68,7 +67,24 @@
[SerializeField] Button horseBtn;
[SerializeField] HorseController horseImg;
[SerializeField] Text horseLVText;
-
+
+ //鑱婂ぉ
+ [SerializeField] Button chatBtn;
+ [SerializeField] Transform transFastChat;
+ [SerializeField] InputField inputFastChat;
+ [SerializeField] ButtonEx btnFastChatSend;
+ [SerializeField] ImageEx imgFastChatSend;
+ [SerializeField] TextEx txtFastChatSend;
+ [SerializeField] ButtonEx btnFastChatClose;
+ [SerializeField] ButtonEx btnChatWin;
+ [SerializeField] TextEx txtChatChannel;
+
+
+ [SerializeField] Transform transChatBulletView;
+ GameObject chatBulletViewPrefab;
+
+
+
/// <summary>
/// 鍒濆鍖栫粍浠�
/// </summary>
@@ -122,12 +138,55 @@
});
restBtn.AddListener(GotoRest);
- funcColBtn.AddListener(()=>
+ funcColBtn.AddListener(() =>
{
rightFuncInHome.ShowFuncCol(true);
});
horseBtn.AddListener(OpenHorse);
+
+ chatBtn.SetListener(() =>
+ {
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Chat, true))
+ return;
+
+ transFastChat.SetActive(true);
+ chatBtn.SetActive(false);
+ UpdateChat(ChatManager.Instance.nowChatTab);
+
+ });
+ btnFastChatClose.SetListener(() =>
+ {
+ transFastChat.SetActive(false);
+ chatBtn.SetActive(true);
+ });
+ btnChatWin.SetListener(() =>
+ {
+ transFastChat.SetActive(false);
+ chatBtn.SetActive(true);
+ UIManager.Instance.OpenWindow<ChatWin>();
+ });
+
+ btnFastChatSend.SetListener(() =>
+ {
+ // 濡傛灉鍦ㄨ亰澶╄緭鍏ョ晫闈㈡棤杈撳叆鏂囧瓧鐐瑰嚮鍙戦�侊紝鍒欏叧闂亰澶╄緭鍏ョ晫闈�
+ if (string.IsNullOrEmpty(inputFastChat.text))
+ {
+ transFastChat.SetActive(false);
+ chatBtn.SetActive(true);
+ return;
+ }
+
+ if (!ChatManager.Instance.CheckChatLimit(inputFastChat.text, out int errorCode))
+ {
+ ChatManager.Instance.ShowChatErrorTip(errorCode);
+ return;
+ }
+ ChatManager.Instance.SendChatInfo(ChatManager.Instance.nowChatChannel, inputFastChat.text);
+ ChatManager.Instance.AddChatChannelSendTime(ChatManager.Instance.nowChatChannel, TimeUtility.AllSeconds);
+ UpdateSendButton();
+ inputFastChat.text = string.Empty;
+ });
}
@@ -148,6 +207,12 @@
officialTip.SetActive(OfficialRankManager.Instance.CanOfficialLVUP());
DisplayHorse();
+
+ DisplayChatBulletView();
+ chatBtn.SetActive(true);
+ transFastChat.SetActive(false);
+ inputFastChat.characterLimit = ChatManager.Instance.characterLimit;
+ UpdateSendButton();
}
protected override void OnPreOpen()
@@ -167,6 +232,8 @@
FirstChargeManager.Instance.OnFirstChargeTaskUpdateEvent += OnFirstChargeTaskUpdateEvent;
OfficialRankManager.Instance.RealmMissionRefreshEvent += OnOfficialCanLVUpEvent;
HorseManager.Instance.OnHorseUpdateEvent += DisplayHorse;
+ ChatManager.Instance.OnChatTabChangeEvent += OnChatTabChangeEvent;
+ GuildManager.Instance.EnterOrQuitGuildEvent += EnterOrQuitGuildEvent;
Display();
DisplayFirstChargeBtn();
@@ -195,8 +262,54 @@
FirstChargeManager.Instance.OnFirstChargeTaskUpdateEvent -= OnFirstChargeTaskUpdateEvent;
OfficialRankManager.Instance.RealmMissionRefreshEvent -= OnOfficialCanLVUpEvent;
HorseManager.Instance.OnHorseUpdateEvent -= DisplayHorse;
+ ChatManager.Instance.OnChatTabChangeEvent -= OnChatTabChangeEvent;
+ GuildManager.Instance.EnterOrQuitGuildEvent -= EnterOrQuitGuildEvent;
+
// 鍏抽棴鐨勬椂鍊欐妸鎴樻枟鐣岄潰涔熺粰鍏充簡 铏界劧鏄湪澶栭潰寮�鐨�
UIManager.Instance.CloseWindow<BattleWin>();
+ }
+
+ private void UpdateSendButton()
+ {
+ bool isCanSend = ChatManager.Instance.IsCanSend(ChatManager.Instance.nowChatChannel, out int remainingSeconds);
+ btnFastChatSend.interactable = isCanSend;
+ imgFastChatSend.gray = !isCanSend;
+ txtFastChatSend.text = isCanSend ? Language.Get("Chat11") : Language.Get("Chat14", remainingSeconds);
+ txtFastChatSend.colorType = isCanSend ? TextColType.NavyBrown : TextColType.LightWhite;
+ }
+
+
+ private void EnterOrQuitGuildEvent(bool obj)
+ {
+ if (!obj)
+ {
+ UpdateChat(ChatManager.Instance.nowChatTab);
+ }
+ }
+
+ private void OnChatTabChangeEvent(ChatTab tab)
+ {
+ UpdateChat(tab);
+ }
+
+ void UpdateChat(ChatTab tab)
+ {
+ txtChatChannel.text = ChatManager.Instance.GetChatTabName(tab);
+ }
+
+ void DisplayChatBulletView()
+ {
+ if (chatBulletViewPrefab == null)
+ {
+ chatBulletViewPrefab = UIUtility.CreateWidget("ChatBulletView", "ChatBulletView");
+ }
+ chatBulletViewPrefab.transform.SetParentEx(transChatBulletView.transform, Vector3.zero, Quaternion.identity, Vector3.one);
+ // 鏂板锛氱‘淇� ChatBulletView 缁勪欢鍚敤
+ // var chatBulletView = chatBulletViewPrefab.GetComponent<ChatBulletView>();
+ // if (chatBulletView != null)
+ // {
+ // chatBulletView.enabled = true;
+ // }
}
void OnOfficialCanLVUpEvent()
@@ -308,7 +421,7 @@
if (showEffect)
{
headEffect.transform.DOLocalMove(new Vector3(400 * expSlider.value - 200 - 24, 0, 0), 0.5f);
- headEffect.Play(closePMA:true);
+ headEffect.Play(closePMA: true);
}
}
@@ -358,7 +471,7 @@
GameNetSystem.Instance.SendInfo(getReward);
return;
}
-
+
TaskManager.Instance.ClickTask();
}
@@ -509,6 +622,7 @@
private void OnSecondEvent()
{
DisplayFirstChargeBtn();
+ UpdateSendButton();
}
void OnUnLockHeroCountEvent()
@@ -525,7 +639,7 @@
//equipShowSwitch;//褰撳墠閰嶇疆鐨勫潗楠戝瑙侷D瀛樺偍鍦紙鏈�澶ф敮鎸� 1~999锛�
var skinConfig = HorseSkinConfig.Get(HorseManager.Instance.GetUsingHorseSkinID(true));
horseImg.Create(skinConfig.SkinID, 0, 0.6f);
- horseLVText.text = Language.Get("Horse8",HorseManager.Instance.classLV, HorseManager.Instance.horseLV);
+ horseLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV, HorseManager.Instance.horseLV);
}
else
{
--
Gitblit v1.8.0