Pull up IChartDetail.

This commit is contained in:
2023-12-19 15:23:40 +08:00
parent 81d458f7de
commit b7f5dbc4da
11 changed files with 59 additions and 20 deletions

View File

@@ -0,0 +1,34 @@
using Cryville.Common;
using Cryville.Crtr.Extension;
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Cryville.Crtr.Browsing.Legacy {
public class LegacyChartDetail : IChartDetail, IResourceMeta {
public AsyncDelivery<Texture2D> Cover { get; set; }
public ChartMeta Meta { get; set; }
public string RulesetId { get { return Meta.ruleset; } }
public string Name { get { return Meta.name; } }
public string SongName { get { return Meta.song.name; } }
public TimeSpan Length { get { return TimeSpan.FromSeconds(Meta.length); } }
public IEnumerable<MetaProperty> Properties {
get {
if (Meta == null) yield break;
yield return new MetaProperty("Name", new Dictionary<string, object> {
{ "", string.Format("{0} - {1}", SongName, Name) },
{ "short", Name },
{ "distinct-primary", SongName },
{ "distinct-secondary", Name },
});
yield return new MetaProperty("Image", Cover);
yield return new MetaProperty("Song.Author", Meta.song.author);
yield return new MetaProperty("Author", Meta.author);
yield return new MetaProperty("Length", Length);
yield return new MetaProperty("NoteCount", Meta.note_count);
}
}
}
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: aac40491bc6619e47a5b81e6d9f1a5d3
timeCreated: 1637975898
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: