This commit is contained in:
PC-20230316NUNE\Administrator
2024-10-16 20:41:40 +08:00
parent 44c3ea001a
commit 6da2f9e691
1866 changed files with 36068 additions and 25732 deletions

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: cccf8f03bd08441fbe4c9f253a62a4a2
timeCreated: 1729067678

View File

@@ -5,7 +5,7 @@ using Launcher;
using SHFrame;
using YooAsset;
namespace HotScripts.GameLauncher.FGui.Scripts
namespace HotScripts.GameLauncher.FGui.Scripts.Launcher
{
public class LauncherUI : UIBase
{
@@ -29,10 +29,12 @@ namespace HotScripts.GameLauncher.FGui.Scripts
if (totalDownloadBytes <= 0)
{
UIView.m_title.text = "资源已经最新";
EventUtil.DispatchEvent(HotMainEvent.StartDownloader);
}
else
{
UIView.m_title.text = $"需更新 {totalDownloadBytes} 字节资源";
UIView.m_Type.selectedIndex = 1;
}
}
@@ -44,22 +46,42 @@ namespace HotScripts.GameLauncher.FGui.Scripts
UIView.m_downloader.onClick.Add(OnDownloader);
EventUtil.AddListener(HotMainEvent.DownloaderProgressUpdate,OnDownloaderProgressUpdate);
EventUtil.AddListener(HotLauncherEvent.InitSuccess,OnInitSuccess);
}
public override void RemoveListener()
{
UIView.m_downloader.onClick.Add(OnDownloader);
EventUtil.RemoveListener(HotMainEvent.DownloaderProgressUpdate,OnDownloaderProgressUpdate);
EventUtil.RemoveListener(HotLauncherEvent.InitSuccess,OnInitSuccess);
}
private void OnDownloader(EventContext context)
{
EventUtil.DispatchEvent(HotMainEvent.StartDownloader);
if (UIView.m_Type.selectedIndex != 2)
{
EventUtil.DispatchEvent(HotMainEvent.StartDownloader);
}
else
{
EventUtil.DispatchEvent(HotLauncherEvent.GoGameMain);
SHFrameModule.UI.Close("Launcher", "Launcher");
}
}
/// <summary>
/// 初始化完成 进入游戏
/// </summary>
/// <param name="eventargs"></param>
private void OnInitSuccess(EventArgs eventargs)
{
UIView.m_Type.selectedIndex = 2;
}
/// <summary>
/// 资源更新进度