This commit is contained in:
wuwenbo 2026-01-07 19:38:10 +08:00
commit 1e701fa910
31 changed files with 12302 additions and 13 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f3a5e531e5f317248a26bfdacb5626b4
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f952a5cafa5fe0b43b9ab55364834bef
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2e8245f985487944d808a5d0aec4c8f5
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1090,7 +1090,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 295, y: -464.99097}
m_AnchoredPosition: {x: 295, y: -867.506}
m_SizeDelta: {x: 510, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7006890349929909733
@ -2768,7 +2768,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 295, y: -402.29425}
m_AnchoredPosition: {x: 295, y: -464.79425}
m_SizeDelta: {x: 510, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8922829779812078697
@ -3708,7 +3708,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 295, y: -464.99097}
m_AnchoredPosition: {x: 295, y: -682.496}
m_SizeDelta: {x: 510, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4195437168228183862
@ -5023,7 +5023,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 112.01
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_AnchoredPosition.x
@ -5873,7 +5873,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 112.01
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_AnchoredPosition.x
@ -6605,7 +6605,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 112.01
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_AnchoredPosition.x
@ -6658,7 +6658,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2365984522426908685, guid: f86e4a833ab26224b81a81d2f6069e99, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 352.19
objectReference: {fileID: 0}
- target: {fileID: 2365984522426908685, guid: f86e4a833ab26224b81a81d2f6069e99, type: 3}
propertyPath: m_AnchoredPosition.x
@ -7132,7 +7132,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 112.01
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_AnchoredPosition.x
@ -7313,7 +7313,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_SizeDelta.x
value: 0
value: 112.01
objectReference: {fileID: 0}
- target: {fileID: 7227718700235663662, guid: 499a3c18e0e84bf499b81078c2552a22, type: 3}
propertyPath: m_AnchoredPosition.x

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f5eb813ccfa9cd940b720b24cae3796a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,114 @@
fileFormatVersion: 2
guid: c856837c87f026a40ac82ffbbeb82b51
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 48, y: 0, z: 185, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 1537655665
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -0,0 +1,114 @@
fileFormatVersion: 2
guid: 426951db4c69f954daa898ca5a143545
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 38, y: 0, z: 38, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 1537655665
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 KiB

View File

@ -0,0 +1,114 @@
fileFormatVersion: 2
guid: 0a8606cb5abad0247a7321764b6d1554
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -62,6 +62,9 @@ namespace TH1_Core.Events
EventManager.Subscribe<ShowUIOutsideMenu>(HandleShowUIOutsideMenu);
EventManager.Subscribe<HideUIOutsideMenu>(HandleHideUIOutsideMenu);
EventManager.Subscribe<HideUIOutsideAll>(HandleHideUIOutsideAll);
EventManager.Subscribe<ShowUIOutsideHistory>(HandleShowUIOutsideHistory);
EventManager.Subscribe<HideUIOutsideHistory>(HandleHideUIOutsideHistory);
EventManager.Subscribe<ShowUIBottomBottomBar>(HandleShowUIBottomBottomBar);
@ -120,6 +123,8 @@ namespace TH1_Core.Events
EventManager.Unsubscribe<ShowUIOutsideMenu>(HandleShowUIOutsideMenu);
EventManager.Unsubscribe<HideUIOutsideMenu>(HandleHideUIOutsideMenu);
EventManager.Unsubscribe<HideUIOutsideAll>(HandleHideUIOutsideAll);
EventManager.Unsubscribe<ShowUIOutsideHistory>(HandleShowUIOutsideHistory);
EventManager.Unsubscribe<HideUIOutsideHistory>(HandleHideUIOutsideHistory);
EventManager.Unsubscribe<ShowUIBottomBottomBar>(HandleShowUIBottomBottomBar);
@ -302,6 +307,19 @@ namespace TH1_Core.Events
UIManager.Instance.UIOutsideManager.HideLoadingTask();
}
private void HandleShowUIOutsideHistory(ShowUIOutsideHistory evt)
{
if (UIManager.Instance.UIOutsideManager == null) return;
UIManager.Instance.UIOutsideManager.StartNewTask(new UIOutsideTask(ViewControllerManager.UIOutsideHistoryController,evt));
}
private void HandleHideUIOutsideHistory(HideUIOutsideHistory evt)
{
if (UIManager.Instance.UIOutsideManager == null) return;
UIManager.Instance.UIOutsideManager.HideCurTask();
}
private void HandleUpdateUIOutsideMultiplayRoomSetting(UpdateUIOutsideMultiplayRoomSetting evt)
{

View File

@ -142,6 +142,12 @@ namespace TH1_Core.Events
public struct HideUIOutsideAll { };
public struct ShowUIOutsideHistory { }
public struct HideUIOutsideHistory { }
public struct ShowUIOutsideLibrary { }
public struct HideUIOutsideLibrary { }
// ------------------------------------------------ UIBottom 相关的事件 ------------------------------------
public struct ShowUIBottomBottomBar { }

View File

@ -0,0 +1,114 @@
// 文件位置建议: Assets/Scripts/TH1_UI/Controller/UIAnnounceMajorEventController.cs
using Logic;
using Logic.Action;
using TH1_Core.Events;
using TH1_Core.Managers;
using TH1_Logic.Action;
using TH1_Logic.Core;
using TH1_UI.Controller.Base;
using TH1_UI.View.Interaction;
using TH1_UI.View.Outside;
using TH1Resource;
using UnityEngine;
// 确保这里引用了View脚本的命名空间
namespace TH1_UI.Controller.Interaction
{
/// <summary>
/// 重大事件公告界面的控制器。
/// 它的职责是处理玩家相遇、玩家被消灭之类的宣告
/// </summary>
public class UIOutsideHistoryController : ViewController<UIOutsideHistoryView> // 泛型参数是对应的View脚本
{
public UIOutsideHistoryController() { }
private ShowUIOutsideHistory _evt;
protected override void RegisterEventCallback()
{
base.RegisterEventCallback();
if (WindowScript != null)
{
WindowScript.OnBtnCloseClick += _OnBtnCloseClick;
}
}
public override void UpdateView()
{
if (WindowScript != null)
{
//Debug.Log("Update View Success!!!!");
}
base.UpdateView();
}
protected override void UnregisterEventCallback()
{
if (WindowScript != null)
{
WindowScript.OnBtnCloseClick -= _OnBtnCloseClick;
}
base.UnregisterEventCallback();
}
protected override void OnOpen()
{
base.OnOpen();
// 检查暂存的参数是否存在且类型正确
if (_openParameter is ShowUIOutsideHistory evt)
{
_evt = evt;
// 使用接收到的数据设置UI内容
if (WindowScript != null)
{
//Param1 = cid Param2 = cityLv
WindowScript.SetContent(evt);
}
}
else
{
// 如果没有参数或参数类型不符,可以提供默认内容或打印警告
Debug.LogWarning("[UIAnnounceMajorEventController] Opened without valid parameters.");
if (WindowScript != null)
{
//WindowScript.SetContent("警告", "内容未提供");
}
}
}
void _OnBtnCloseClick()
{
EventManager.Publish(new ShowUIOutsideHistory());
Close();
}
void _OnStartGameClick()
{
EventManager.Publish(new ShowUIOutsideLoading());
float fadeout = ResourceCache.Instance.AnimCache.UICommonPanelFadeOut.length;
float prepare = 2f;
Timer.Instance.TimerRegister(this, () =>
{
Close();
Main.Instance.StartMatch();
EventManager.Publish(new HideUIOutsideHistory());
},fadeout,"UIOutsideHistoryController");
Timer.Instance.TimerRegister(this, () =>
{
EventManager.Publish(new HideUIOutsideLoading());
},prepare + fadeout,"UIOutsideHistoryController");
}
public override bool Close()
{
WindowScript?.OnCloseView();
return base.Close();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2fe297797dbc02c4092b08182fc7bc06
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,114 @@
// 文件位置建议: Assets/Scripts/TH1_UI/Controller/UIAnnounceMajorEventController.cs
using Logic;
using Logic.Action;
using TH1_Core.Events;
using TH1_Core.Managers;
using TH1_Logic.Action;
using TH1_Logic.Core;
using TH1_UI.Controller.Base;
using TH1_UI.View.Interaction;
using TH1_UI.View.Outside;
using TH1Resource;
using UnityEngine;
// 确保这里引用了View脚本的命名空间
namespace TH1_UI.Controller.Interaction
{
/// <summary>
/// 重大事件公告界面的控制器。
/// 它的职责是处理玩家相遇、玩家被消灭之类的宣告
/// </summary>
public class UIOutsideLibraryController : ViewController<UIOutsideLibraryView> // 泛型参数是对应的View脚本
{
public UIOutsideLibraryController() { }
private ShowUIOutsideLibrary _evt;
protected override void RegisterEventCallback()
{
base.RegisterEventCallback();
if (WindowScript != null)
{
WindowScript.OnBtnCloseClick += _OnBtnCloseClick;
}
}
public override void UpdateView()
{
if (WindowScript != null)
{
//Debug.Log("Update View Success!!!!");
}
base.UpdateView();
}
protected override void UnregisterEventCallback()
{
if (WindowScript != null)
{
WindowScript.OnBtnCloseClick -= _OnBtnCloseClick;
}
base.UnregisterEventCallback();
}
protected override void OnOpen()
{
base.OnOpen();
// 检查暂存的参数是否存在且类型正确
if (_openParameter is ShowUIOutsideLibrary evt)
{
_evt = evt;
// 使用接收到的数据设置UI内容
if (WindowScript != null)
{
//Param1 = cid Param2 = cityLv
WindowScript.SetContent(evt);
}
}
else
{
// 如果没有参数或参数类型不符,可以提供默认内容或打印警告
Debug.LogWarning("[UIAnnounceMajorEventController] Opened without valid parameters.");
if (WindowScript != null)
{
//WindowScript.SetContent("警告", "内容未提供");
}
}
}
void _OnBtnCloseClick()
{
EventManager.Publish(new ShowUIOutsideLibrary());
Close();
}
void _OnStartGameClick()
{
EventManager.Publish(new ShowUIOutsideLoading());
float fadeout = ResourceCache.Instance.AnimCache.UICommonPanelFadeOut.length;
float prepare = 2f;
Timer.Instance.TimerRegister(this, () =>
{
Close();
Main.Instance.StartMatch();
EventManager.Publish(new HideUIOutsideLibrary());
},fadeout,"UIOutsideLibraryController");
Timer.Instance.TimerRegister(this, () =>
{
EventManager.Publish(new HideUIOutsideLoading());
},prepare + fadeout,"UIOutsideLibraryController");
}
public override bool Close()
{
WindowScript?.OnCloseView();
return base.Close();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 537e5ef4033d9c247a64443f8f3d3a7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -129,7 +129,7 @@ namespace TH1_UI.Core
_task.Execute(() => OnTaskCompleted(task));
}
public void HideCurTask()
{
if (_task == null) return;

View File

@ -27,6 +27,9 @@ namespace TH1_UI.Core
public static readonly string ViewOutsideSelect = "UIOutsideSelect";
public static readonly string ViewOutsideLoading = "UIOutsideLoading";
public static readonly string ViewOutsideMenu = "UIOutsideMenu";
public static readonly string ViewOutsideHistory = "UIOutsideHistory";
public static readonly string ViewOutsideLibrary = "UIOutsideLibrary";
public static readonly string ViewBottomBottomBar = "UIBottomBottomBar";
public static readonly string ViewBottomRanking = "UIBottomRanking";

View File

@ -51,6 +51,8 @@ namespace TH1_UI.Core
public static UIOutsideSelectController UIOutsideSelectController { get { return _outsideSelectController; } }
public static UIOutsideLoadingController UIOutsideLoadingController { get { return _outsideLoadingController; } }
public static UIOutsideMenuController UIOutsideMenuController { get { return _outsideMenuController; } }
public static UIOutsideHistoryController UIOutsideHistoryController { get { return _outsideHistoryController; } }
public static UIOutsideLibraryController UIOutsideLibraryController { get { return _outsideLibraryController; } }
// ================================================= Bottom ================================================================
@ -107,6 +109,8 @@ namespace TH1_UI.Core
_outsideSelectController = _CreateView<UIOutsideSelectController>("Outside", UIResourceName.ViewOutsideSelect, ViewDestroyDomain.None,UIRootType.OutsideUI);
_outsideLoadingController = _CreateView<UIOutsideLoadingController>("Outside", UIResourceName.ViewOutsideLoading, ViewDestroyDomain.None,UIRootType.OutsideUI);
_outsideMenuController = _CreateView<UIOutsideMenuController>("Outside", UIResourceName.ViewOutsideMenu, ViewDestroyDomain.None,UIRootType.OutsideUI);
_outsideHistoryController = _CreateView<UIOutsideHistoryController>("Outside", UIResourceName.ViewOutsideHistory, ViewDestroyDomain.None,UIRootType.OutsideUI);
_outsideLibraryController = _CreateView<UIOutsideLibraryController>("Outside", UIResourceName.ViewOutsideLibrary, ViewDestroyDomain.None,UIRootType.OutsideUI);
// ================================================= Bottom ================================================================
_bottomBottomBarController = _CreateView<UIBottomBottomBarController>("Bottom", UIResourceName.ViewBottomBottomBar, ViewDestroyDomain.None,UIRootType.BottomUI);
@ -250,6 +254,8 @@ namespace TH1_UI.Core
private static UIOutsideSelectController _outsideSelectController = null;
private static UIOutsideLoadingController _outsideLoadingController = null;
private static UIOutsideMenuController _outsideMenuController = null;
private static UIOutsideHistoryController _outsideHistoryController = null;
private static UIOutsideLibraryController _outsideLibraryController = null;
private static UIBottomBottomBarController _bottomBottomBarController = null;
private static UIBottomRankingController _bottomRankingController = null;

View File

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using Animancer;
using Logic;
using Logic.Action;
using Logic.AI;
using Logic.Audio;
using Logic.Config;
using Logic.Multilingual;
using ParadoxNotion;
using RuntimeData;
using Steamworks;
using TH1_Core.Events;
using TH1_Core.Managers;
using TH1_Logic.Action;
using TH1_Logic.Config;
using TH1_Logic.Core;
using TH1_Logic.Net;
using TH1_Logic.Steam;
using TH1_UI.View.Announce;
using TH1Resource;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
using ConfigManager = TH1_Logic.Config.ConfigManager;
namespace TH1_UI.View.Outside
{
public class UIOutsideHistoryItemMono : MonoBehaviour
{
public Image Avatar;
public TextMeshProUGUI EmpireName;
public TextMeshProUGUI Difficulty;
public TextMeshProUGUI Time;
public TextMeshProUGUI Turn;
public TextMeshProUGUI Score;
public TextMeshProUGUI PlayerCount;
public TextMeshProUGUI Coe;
//关闭时执行的委托
public ViDelegateAssisstant.Dele OnBtnCloseClick;
//开始游戏时执行的委托(目前委托内容就是执行controller的Close())
public ViDelegateAssisstant.Dele OnStartGame;
public void SetContent(GameRecord record)
{
Turn.text = record.Turn.ToString();
Score.text = record.Score.ToString();
Table.Instance.PlayerDataAssets.GetPlayerInfoByCivId(record.PlayerCivId, record.PlayerForceId, out var info);
Avatar.sprite = info.LeaderIllustration;
EmpireName.text = MultilingualManager.Instance.GetMultilingualTextSafe(info.ForceName);
PlayerCount.text = record.PlayerCount.ToString();
Coe.text = "×1.0";
Difficulty.text = record.AIDiff.ToString();
if(DateTime.TryParse(record.Time,out var dateTime))
Time.text = dateTime.ToString("yyyy.MM.dd HH:MM");
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2d202efd60083d844a1e0a7d104eacf6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using Animancer;
using Logic;
using Logic.Action;
using Logic.AI;
using Logic.Audio;
using Logic.Multilingual;
using ParadoxNotion;
using RuntimeData;
using Steamworks;
using TH1_Core.Events;
using TH1_Core.Managers;
using TH1_Logic.Action;
using TH1_Logic.Config;
using TH1_Logic.Core;
using TH1_Logic.Net;
using TH1_Logic.Steam;
using TH1_UI.View.Announce;
using TH1Resource;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
namespace TH1_UI.View.Outside
{
public class UIOutsideHistoryView : Base.View
{
[Header("按钮")]
//public Button CloseButton;
public Button CloseButton;
public Transform ItemList;
public GameObject ItemPrefab;
//关闭时执行的委托
public ViDelegateAssisstant.Dele OnBtnCloseClick;
private List<UIOutsideHistoryItemMono> _items = new List<UIOutsideHistoryItemMono>();
protected override void OnInit()
{
base.OnInit();
CloseButton.onClick.RemoveAllListeners();
CloseButton.onClick.AddListener(OnClose);
}
private void SetItemList()
{
var dataSize = GameRecordManager.Instance.GameRecordData.Records.Count;
var dataList = GameRecordManager.Instance.GameRecordData.Records;
if (dataSize > 100) dataSize = 100;
while (_items.Count < dataSize)
{
var obj = Instantiate(ItemPrefab, ItemList);
var cpn = obj?.GetComponent<UIOutsideHistoryItemMono>();
if (cpn == null) break;
_items.Add(cpn);
}
for (int i = 0; i < _items.Count; i++)
{
_items[i].gameObject.SetActive(i < dataSize);
_items[i].SetContent(dataList[i]);
}
}
public void SetContent(ShowUIOutsideHistory evt)
{
SetItemList();
//如果数量不够先clone row补足
}
//在Controller 调用Close的时候会先调用这个closeview
public void OnCloseView()
{
}
public void OnSettingClicked()
{
}
public void OnStartClicked()
{
EventManager.Publish(new ShowUIOutsideSelect());
}
public void OnClose()
{
OnBtnCloseClick.Invoke();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3bd45bdc3b9d8394fb07307d19eeaa2a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using Animancer;
using Logic;
using Logic.Action;
using Logic.AI;
using Logic.Audio;
using Logic.Multilingual;
using ParadoxNotion;
using RuntimeData;
using Steamworks;
using TH1_Core.Events;
using TH1_Core.Managers;
using TH1_Logic.Action;
using TH1_Logic.Config;
using TH1_Logic.Core;
using TH1_Logic.Net;
using TH1_Logic.Steam;
using TH1_UI.View.Announce;
using TH1Resource;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
namespace TH1_UI.View.Outside
{
public class UIOutsideLibraryView : Base.View
{
[Header("按钮")]
//public Button CloseButton;
public Button CloseButton;
public Transform ItemList;
public GameObject ItemPrefab;
//关闭时执行的委托
public ViDelegateAssisstant.Dele OnBtnCloseClick;
protected override void OnInit()
{
base.OnInit();
CloseButton.onClick.RemoveAllListeners();
CloseButton.onClick.AddListener(OnClose);
}
private void SetItemList()
{
var dataSize = GameRecordManager.Instance.GameRecordData.Records.Count;
var dataList = GameRecordManager.Instance.GameRecordData.Records;
if (dataSize > 100) dataSize = 100;
}
public void SetContent(ShowUIOutsideLibrary evt)
{
SetItemList();
//如果数量不够先clone row补足
}
//在Controller 调用Close的时候会先调用这个closeview
public void OnCloseView()
{
}
public void OnSettingClicked()
{
}
public void OnStartClicked()
{
EventManager.Publish(new ShowUIOutsideSelect());
}
public void OnClose()
{
OnBtnCloseClick.Invoke();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bef8a9b6337ef4c40aa816345ae2c1cd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -134,7 +134,7 @@ namespace TH1_UI.View.Outside
public void OnLibraryClicked()
{
EventManager.Publish(new ShowUIOutsideLibrary());
}
public void OnMultiplayClicked()
@ -149,7 +149,7 @@ namespace TH1_UI.View.Outside
public void OnHistoryClicked()
{
EventManager.Publish(new ShowUIOutsideHistory(){});
}
public void OnAnnouncementClicked()
{

View File

@ -86,7 +86,7 @@ public class WinUI
if (tt != null)
{
tt.text = "失败...";
tt.color = Color.gray;
tt.color = new Color32(0xC7, 0xC7, 0xC7, 255);
if (Table.Instance.PlayerDataAssets.GetPlayerInfo(Main.MapData.PlayerMap.SelfPlayerData, out var info))
{
MultilingualManager.Instance.SetUIText(_chatText,info.GetRandomLoseChat());