Merge pull request 'master' (#86) from Alienjack/AxibugEmuOnline:master into master

Reviewed-on: sin365/AxibugEmuOnline#86
This commit is contained in:
sin365 2025-01-09 14:38:14 +08:00
commit e649104475
9 changed files with 2101 additions and 850 deletions

View File

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

View File

@ -889,7 +889,7 @@ MonoBehaviour:
DownProgress: {fileID: 1484915906009859069}
FileReadyFlag: {fileID: 6316945668089981796}
DownloadComplete: {fileID: 6633045760783967661}
Star: {fileID: 0}
Star: {fileID: 2970190240800710577}
--- !u!114 &5700455559359757662
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -23,7 +23,14 @@ namespace AxibugEmuOnline.Client.ClientCore
public static UserDataManager user;
//public static AppNetGame netgame;
public static AppEmu emu;
/// <summary>
/// nes Rom库
/// </summary>
public static RomLib nesRomLib;
/// <summary>
/// 收藏 Rom库
/// </summary>
public static RomLib starRomLib;
public static HttpAPI httpAPI;
public static CacheManager CacheMgr;
public static AppRoom roomMgr;
@ -68,6 +75,7 @@ namespace AxibugEmuOnline.Client.ClientCore
if (bUseLocalWebApi)
httpAPI.WebHost = mLocalWebApi;
nesRomLib = new RomLib(RomPlatformType.Nes);
starRomLib = new RomLib();
CacheMgr = new CacheManager();
roomMgr = new AppRoom();
share = new AppShare();

View File

@ -13,6 +13,7 @@ namespace AxibugEmuOnline.Client
public delegate void GetRomListAPI(Action<int, Resp_GameList> callback, AxibugProtobuf.RomPlatformType Platform, int page, int pageSize = 10);
public delegate void SearchRomListAPI(Action<int, Resp_GameList> callback, AxibugProtobuf.RomPlatformType Platform, string searchKey, int page, int pageSize = 10);
public delegate void GetStarRomListAPI(Action<int, Resp_GameList> callback, AxibugProtobuf.RomPlatformType platform, int page, int pageSize = 10);
public void GetRomList(Action<int, Resp_GameList> callback, AxibugProtobuf.RomPlatformType platform, int page, int pageSize = 10)
{

View File

@ -28,17 +28,19 @@ namespace AxibugEmuOnline.Client
public RomLib(RomPlatformType platform)
{
m_platform = platform;
switch (platform)
{
case RomPlatformType.Nes:
m_romGetFunc = App.httpAPI.GetRomList;
m_romSearchFunc = App.httpAPI.SearchRomList;
break;
}
Eventer.Instance.RegisterEvent<int, bool>(EEvent.OnRomStarStateChanged, OnRomStarStateChanged);
}
/// <summary> 无参构造函数将会创建一个管理收藏的Rom列表 </summary>
public RomLib() : this(RomPlatformType.All)
{
m_romGetFunc = App.httpAPI.GetMarkList;
m_romSearchFunc = App.httpAPI.SearchMarkList;
}
private void OnRomStarStateChanged(int romID, bool star)
{
var targetRom = nesRomFetchList.FirstOrDefault(rom => rom.ID == romID);
@ -71,7 +73,6 @@ namespace AxibugEmuOnline.Client
/// <summary>
/// 获得所有Rom文件
/// </summary>
/// <param name="callback"></param>
public void FetchRomCount(Action<RomFile[]> callback, string searchKey = null)
{
lastSearchKey = searchKey;

View File

@ -7,12 +7,17 @@ namespace AxibugEmuOnline.Client
{
public class RomListMenuItem : VirtualSubMenuItem
{
[SerializeField]
protected bool StarRom;
[SerializeField]
protected RomPlatformType Platform;
private RomLib RomLib
{
get
{
if (StarRom) return App.starRomLib;
else
{
switch (Platform)
{
@ -23,6 +28,7 @@ namespace AxibugEmuOnline.Client
}
}
}
}
private List<OptionMenu> m_options;