Skip to content

Commit

Permalink
Merge pull request YARC-Official#75 from TheNathannator/song-sources
Browse files Browse the repository at this point in the history
Retrieve song sources from the Clone Hero sources list
  • Loading branch information
EliteAsian123 authored Apr 12, 2023
2 parents a46f3be + f219a52 commit 67bd706
Show file tree
Hide file tree
Showing 6 changed files with 501 additions and 214 deletions.
139 changes: 139 additions & 0 deletions Assets/Scenes/MenuScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -8026,6 +8026,7 @@ RectTransform:
- {fileID: 976689291}
- {fileID: 474114361}
- {fileID: 411323886}
- {fileID: 1090956611}
m_Father: {fileID: 874813133}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -8741,6 +8742,7 @@ MonoBehaviour:
settingsContainer: {fileID: 1006802517}
songFolderManager: {fileID: 1458216463}
loadingScreen: {fileID: 784751310}
loadingStatus: {fileID: 1090956613}
progressBar: {fileID: 1649890904}
--- !u!1 &882788346
GameObject:
Expand Down Expand Up @@ -10503,6 +10505,142 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1075810277}
m_CullTransparentMesh: 1
--- !u!1 &1090956610
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1090956611}
- component: {fileID: 1090956612}
- component: {fileID: 1090956613}
m_Layer: 5
m_Name: Current Status
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1090956611
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1090956610}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 784751311}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: -55}
m_SizeDelta: {x: 0, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1090956612
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1090956610}
m_CullTransparentMesh: 1
--- !u!114 &1090956613
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1090956610}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text:
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: ae170e91fd29a90479e906ddffb1d8ee, type: 2}
m_sharedMaterial: {fileID: -5480317595949376055, guid: ae170e91fd29a90479e906ddffb1d8ee,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 16
m_fontSizeBase: 16
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &1126244163
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -15875,6 +16013,7 @@ MonoBehaviour:
settingSpacePrefab: {fileID: 495506203781168666, guid: 94f7a64a42ac51e4eb6af891f99dc193,
type: 3}
settingsContainer: {fileID: 4596674}
inGame: 0
--- !u!1 &1696839234
GameObject:
m_ObjectHideFlags: 0
Expand Down
190 changes: 190 additions & 0 deletions Assets/Script/Data/SongInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,180 @@ public enum DrumType {
{"harmVocals", -1},
};

private static readonly Dictionary<string, string> DEFAULT_SOURCES = new() {
{"gh1", "Guitar Hero"},
{"gh", "Guitar Hero"},
{"gh2", "Guitar Hero II"},
{"gh2dlc", "Guitar Hero II DLC"},
{"gh80s", "Guitar Hero Encore: Rocks the 80s"},
{"gh3", "Guitar Hero III: Legends of Rock"},
{"ghot", "Guitar Hero: On Tour"},
{"gha", "Guitar Hero: Aerosmith"},
{"ghwt", "Guitar Hero: World Tour"},
{"ghm", "Guitar Hero: Metallica"},
{"ghwor", "Guitar Hero: Warriors of Rock"},
{"ghvh", "Guitar Hero: Van Halen"},
{"gh2dx", "Guitar Hero II Deluxe"},
{"gh2dxdlc", "Guitar Hero Rocks the 360"},
{"gh80sdx", "Guitar Hero Encore Deluxe"},
{"gh3dlc", "Guitar Hero III DLC"},
{"ghwtdlc", "Guitar Hero: World Tour DLC"},
{"ghmdlc", "Death Magnetic DLC"},
{"djhero", "DJ Hero"},
{"ghsh", "Guitar Hero: Smash Hits"},
{"ghwordlc", "Guitar Hero: Warriors of Rock DLC"},
{"gh5", "Guitar Hero 5"},
{"gh5dlc", "Guitar Hero 5 DLC"},
{"ghotd", "Guitar Hero On Tour: Decades"},
{"ghotmh", "Guitar Hero On Tour: Modern Hits"},
{"bandhero", "Band Hero"},
{"bh", "Band Hero"},
{"bhds", "Band Hero DS"},
{"ghl", "Guitar Hero Live"},
{"ghtv", "Guitar Hero TV"},

{"rb1", "Rock Band 1"},
{"rb2", "Rock Band 2"},
{"rb3", "Rock Band 3"},
{"rb4", "Rock Band 4"},
{"tbrb", "The Beatles Rock Band"},
{"beatles", "The Beatles Rock Band"},
{"tbrbdlc", "The Beatles: Rock Band DLC"},
{"tbrbcdlc", "The Beatles: Rock Band Custom DLC Project"},
{"rbacdc", "AC/DC Live: Rock Band Track Pack"},
{"lrb", "Lego Rock Band"},
{"rbn", "Rock Band Network"},
{"ugc", "Rock Band Network 1.0"},
{"ugc_plus", "Rock Band Network 2.0"},
{"ugc1", "Rock Band Network 1.0"},
{"ugc2", "Rock Band Network 2.0"},
{"ugc_lost", "Lost Rock Band Network"},
{"rb1dlc", "Rock Band 1 DLC"},
{"rb2dlc", "Rock Band 2 DLC"},
{"rb3dlc", "Rock Band 3 DLC"},
{"rb4dlc", "Rock Band 4 DLC"},
{"rb4_dlc", "Rock Band 4 DLC"},
{"rb4_rivals", "Rock Band Rivals"},
{"rbtp_acdc", "Rock Band Track Pack: AC/DC Live"},
{"rbtp_classic_rock", "Rock Band Track Pack: Classic Rock"},
{"rbtp_country_1", "Rock Band Track Pack: Country 1"},
{"rbtp_country_2", "Rock Band Track Pack: Country 2"},
{"rbtp_metal", "Rock Band Track Pack: Metal"},
{"rbtp_vol_1", "Rock Band Track Pack: Volume 1"},
{"rbtp_vol_2", "Rock Band Track Pack: Volume 2"},
{"rb_blitz", "Rock Band Blitz"},
{"pearljam", "Pearl Jam: Rock Band"},
{"greenday", "Green Day: Rock Band"},
{"gdrb", "Green Day: Rock Band"},
{"rbvr", "Rock Band VR"},

{"311hero", "311 Hero"},
{"a2z", "A-Z Pack"},
{"ah1", "Angevil Hero"},
{"ah2", "Angevil Hero 2"},
{"ah3", "Angevil Hero 3"},
{"ah4", "Angevil Hero 4"},
{"antihero", "Anti Hero"},
{"ahbe", "Anti Hero - Beach Episode"},
{"antihero2", "Anti Hero 2"},
{"a7xmegapack", "Avenged Sevenfold Mega Pack"},
{"bitcrusher", "BITCRUSHER"},
{"bitcrusherdlc", "BITCRUSHER DLC"},
{"blackhole", "Black Hole"},
{"bs", "Blanket Statement"},
{"bleepbloops", "Bleep Bloops"},
{"bleepbloopuc", "Bleep Bloop Undercharts"},
{"ugc_c3", "C3 Customs"},
{"c3customs", "C3 Customs"},
{"c3legacy", "C3 Legacy"},
{"cth1", "Carpal Tunnel Hero"},
{"cth1r", "Carpal Tunnel Hero 1: Remastered"},
{"cth2", "Carpal Tunnel Hero 2"},
{"cth3", "Carpal Tunnel Hero 3"},
{"cth3dlc", "Carpal Tunnel Hero 3 DLC"},
{"charts", "CHARTS"},
{"charts2", "CHARTS 2"},
{"chelhero", "Chel Hero"},
{"cb", "Circuit Breaker"},
{"ch", "Clone Hero"},
{"codered", "Code Red"},
{"comtpi", "Community Track Pack I"},
{"comtpii", "Community Track Pack II"},
{"comtpiii", "Community Track Pack III"},
{"comtpiv", "Community Track Pack IV"},
{"comtp45", "Community Track Pack 4.5"},
{"comtpv", "Community Track Pack V"},
{"cowhero", "Cow Hero"},
{"cowherodlc1", "Cow Hero DLC 1 - Bull Conqueror"},
{"cowherodlc2", "Cow Hero DLC 2 - Bovine Champion"},
{"cowherodlc3", "Cow Hero DLC 3 - Cattle Guardian"},
{"creativech", "Creative Commons Hero"},
{"csc", "Custom Songs Central"},
{"customs", "Custom Songs"},
{"digi", "Digitizer"},
{"dissonancehero", "Dissonance Hero"},
{"djenthero", "Djent Hero"},
{"dhc", "Djent Hero Collection"},
{"djentherodlc", "Djent Hero DLC"},
{"facelift", "Facelift"},
{"tfoth", "The Fall of Troy Hero"},
{"fp", "Focal Point"},
{"fp2", "Focal Point 2"},
{"fp3", "Focal Point 3"},
{"fof", "Frets on Fire"},
{"fuse", "Fuse Box"},
{"gd", "GITADORA"},
{"gf1", "GuitarFreaks"},
{"gf2dm1", "GuitarFreaks 2ndMIX & DrumMania"},
{"addygh", "Guitar Hero II: Addy's Disc"},
{"ghxsetlist", "Guitar Hero X"},
{"ghx2setlist", "Guitar Hero X-II"},
{"praise", "Guitar Praise"},
{"praisedlc", "Guitar Praise: Expansion Pack 1"},
{"stryper", "Guitar Praise: Stryper"},
{"guitarzero2", "Guitar Zero 2"},
{"guitarherodlc", "Guitar Zero 2 DLC"},
{"harmonyhero", "Harmony Hero"},
{"imetal", "Instru-Metal"},
{"kh", "Koreaboo Hero"},
{"kh2", "Koreaboo Hero 2"},
{"marathon", "Marathon Hero"},
{"marathonhero2", "Marathon Hero 2"},
{"ma", "Max Altitude"},
{"meme", "Meme Songs"},
{"milohax", "MiloHax Customs"},
{"miscellaneous", "Miscellaneous Packs"},
{"paradigm", "Paradigm"},
{"paramoremegapack", "Paramore Mega Pack"},
{"phaseshift", "Phase Shift"},
{"psgp4", "Phase Shift Guitar Project 4"},
{"psh", "Plastic Shred Hero: Legends of Apahetic Charting"},
{"psh2", "Plastic Shred Hero 2"},
{"pg", "PowerGig: Rise of the SixString"},
{"pgdlc", "PowerGig: Rise of the SixString DLC"},
{"ph1", "Puppetz Hero I"},
{"ph2", "Puppetz Hero II"},
{"ph3", "Puppetz Hero III"},
{"ph4", "Puppetz Hero IV"},
{"ragequit", "Rage Quit"},
{"ra", "Redemption Arc"},
{"revolved", "REVOLVED"},
{"rr", "Rock Revolution"},
{"rrdlc", "Rock Revolution DLC"},
{"scorespy", "ScoreSpy"},
{"s_hero", "S Hero"},
{"solomedley", "Solo Medleys"},
{"finnish", "Suomibiisit"},
{"se", "Symphonic Effect"},
{"sxdisc", "Symphony X Discography Setlist"},
{"synergy", "Synergy"},
{"vortex_hero", "Vortex Hero"},
{"wcc", "World Charts Community"},
{"zancharted", "Zancharted"},
{"zerogravity", "Zero Gravity"},
{"zgsb", "Zero Gravity - Space Battle"},
};

public bool fetched;

[JsonProperty]
Expand Down Expand Up @@ -93,6 +267,7 @@ public Dictionary<string, int> JsonDiffs {

[JsonProperty]
public string source;
public string SourceFriendlyName => SourceToGameName(source);
[JsonProperty]
public float songLength;
[JsonProperty]
Expand Down Expand Up @@ -145,5 +320,20 @@ public SongInfo(DirectoryInfo folder, string rootFolder) {
public SongInfo Duplicate() {
return (SongInfo) MemberwiseClone();
}

/// <returns>
/// The converted short name (gh1) into the game name (Guitar Hero 1).
/// </returns>
private static string SourceToGameName(string source) {
if (SongLibrary.SourceNames != null && SongLibrary.SourceNames.TryGetValue(source, out string name)) {
return name;
}

if (DEFAULT_SOURCES.TryGetValue(source, out name)) {
return name;
}

return "Unknown Source";
}
}
}
Loading

0 comments on commit 67bd706

Please sign in to comment.