From a3d3e05edd2cff98bea353880a5126d035474b29 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Thu, 23 Jan 2025 16:24:06 +0800 Subject: [PATCH] =?UTF-8?q?UI=E8=84=9A=E6=9C=AC=20RoomItem=E4=BF=AE?= =?UTF-8?q?=E6=94=B9,=E4=BF=9D=E6=8C=81=E5=92=8CRomItem=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RoomItemTemplate.prefab | 35 +++++++++++++++++++ .../Script/AppMain/UI/RoomUI/RoomItem.cs | 23 +++++++++++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab index 286ffaf8..f87dac02 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/VirtualItemTemplates/RoomItemTemplate.prefab @@ -738,6 +738,7 @@ MonoBehaviour: m_downloadProgress: {fileID: 1484915906009859069} m_downloadingFlag: {fileID: 1252956242765037133} m_romReadyFlag: {fileID: 6316945668089981796} + DownloadComplete: {fileID: 8449502431356192113} --- !u!114 &5700455559359757662 MonoBehaviour: m_ObjectHideFlags: 0 @@ -888,6 +889,7 @@ GameObject: - component: {fileID: 8105925540140519754} - component: {fileID: 1377401926964550360} - component: {fileID: 67125096702760250} + - component: {fileID: 8449502431356192113} m_Layer: 5 m_Name: PreviewImg m_TagString: Untagged @@ -955,6 +957,39 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &8449502431356192113 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4643603390456494410} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f19b7e2285c104f6ca47d583f3e5444f, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 300 + m_EffectMaterial: {fileID: 2100000, guid: 9dc7e810a87b444ab96919f3215c2fe5, type: 2} + m_EffectFactor: 0 + m_Width: 0.25 + m_Rotation: -41 + m_Softness: 1 + m_Brightness: 1 + m_Gloss: 1 + m_EffectArea: 0 + m_Player: + play: 0 + initialPlayDelay: 0 + duration: 0.5 + loop: 0 + loopDelay: 1 + updateMode: 0 + m_Play: 0 + m_Loop: 0 + m_Duration: 1 + m_LoopDelay: 1 + m_UpdateMode: 0 --- !u!1 &5340761592919397836 GameObject: m_ObjectHideFlags: 0 diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomItem.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomItem.cs index df018675..c46e20a2 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/RoomUI/RoomItem.cs @@ -3,7 +3,7 @@ using AxibugEmuOnline.Client.Event; using AxibugEmuOnline.Client.Manager; using AxibugEmuOnline.Client.UI; using AxibugProtobuf; -using Sony.Vita.Dialog; +using Coffee.UIExtensions; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; @@ -17,6 +17,8 @@ namespace AxibugEmuOnline.Client [SerializeField] Slider m_downloadProgress; [SerializeField] GameObject m_downloadingFlag; [SerializeField] GameObject m_romReadyFlag; + [SerializeField] + UIShiny DownloadComplete; private RomFile m_romFile; @@ -30,6 +32,25 @@ namespace AxibugEmuOnline.Client Eventer.Instance.RegisterEvent(EEvent.OnRoomListSingleUpdate, OnRoomSignelUpdate); } + protected override void OnEnable() + { + Eventer.Instance.RegisterEvent(EEvent.OnRomFileDownloaded, OnRomDownloaded); + } + + protected override void OnDisable() + { + Eventer.Instance.UnregisterEvent(EEvent.OnRomFileDownloaded, OnRomDownloaded); + } + + private void OnRomDownloaded(int romID) + { + if (m_romFile == null) return; + + m_romFile.CheckLocalFileState(); + if (m_romFile.RomReady) + DownloadComplete.Play(); + } + private void OnRoomSignelUpdate(int roomID) { if (this.RoomID != roomID) return;