Skip to content

Commit

Permalink
Change from .net Framework 4.7 to .net 6. Now supports MelonLoader v0…
Browse files Browse the repository at this point in the history
….6. (No longer supports MelonLoader v0.5)
  • Loading branch information
DeamonHunter committed Apr 8, 2023
1 parent 9c4eda4 commit 7d772bf
Show file tree
Hide file tree
Showing 40 changed files with 2,100 additions and 2,365 deletions.
4 changes: 4 additions & 0 deletions .idea/.idea.ArchipelagoMuseDash/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.ArchipelagoMuseDash/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions .idea/.idea.ArchipelagoMuseDash/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 5 additions & 14 deletions ArchipelagoMuseDash.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32106.194
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArchipelagoMuseDash", "ArchipelagoMuseDash\ArchipelagoMuseDash.csproj", "{6AA329FC-0CBE-4A61-B134-3BF77DDC61DC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArchipelagoMuseDash", "ArchipelagoMuseDash\ArchipelagoMuseDash.csproj", "{05E7D5E9-53C7-4D12-AF67-D67B35549301}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6AA329FC-0CBE-4A61-B134-3BF77DDC61DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AA329FC-0CBE-4A61-B134-3BF77DDC61DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AA329FC-0CBE-4A61-B134-3BF77DDC61DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AA329FC-0CBE-4A61-B134-3BF77DDC61DC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D75C2A32-9C67-42CB-85EA-B60AAE376CD9}
{05E7D5E9-53C7-4D12-AF67-D67B35549301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{05E7D5E9-53C7-4D12-AF67-D67B35549301}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05E7D5E9-53C7-4D12-AF67-D67B35549301}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05E7D5E9-53C7-4D12-AF67-D67B35549301}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
15 changes: 11 additions & 4 deletions ArchipelagoMuseDash.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=API/@EntryIndexedValue">API</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DB/@EntryIndexedValue">DB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue">URL</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Localisation/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SB/@EntryIndexedValue">SB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SS/@EntryIndexedValue">SS</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Deactive/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=deathlink/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=favourited/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=jank/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Randomiser/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Touhou/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Uids/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=UNPLAYED/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0020sel/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
136 changes: 67 additions & 69 deletions ArchipelagoMuseDash/AlbumDatabase.cs
Original file line number Diff line number Diff line change
@@ -1,78 +1,76 @@
using System;
using System.Collections.Generic;
using Assets.Scripts.Database;
using Assets.Scripts.PeroTools.Managers;

namespace ArchipelagoMuseDash {
/// <summary>
/// Contains information about the game's songs, in a way that is easier to access for us.
/// </summary>
public class AlbumDatabase {
Dictionary<string, MusicInfo> _songsByItemName = new Dictionary<string, MusicInfo>();
Dictionary<string, Il2CppSystem.Collections.Generic.List<MusicInfo>> _songsByAlbum = new Dictionary<string, Il2CppSystem.Collections.Generic.List<MusicInfo>>();

public const int CHINESE_LOC_INDEX = 0;
public const int ENGLISH_LOC_INDEX = 1;
public const string RANDOM_PANEL_UID = "?";

public void Setup() {
_songsByAlbum.Clear();
_songsByItemName.Clear();

var list = new Il2CppSystem.Collections.Generic.List<MusicInfo>();
GlobalDataBase.dbMusicTag.GetAllMusicInfo(list);

_songsByAlbum = new Dictionary<string, Il2CppSystem.Collections.Generic.List<MusicInfo>>();
_songsByItemName = new Dictionary<string, MusicInfo>();

var configManager = ConfigManager.instance;
if (configManager == null)
throw new Exception("Config Manage was null when trying to load songs.");

var albumConfig = configManager.GetConfigObject<DBConfigAlbums>(-1);
var albumLocalisation = configManager.GetConfigObject<DBConfigAlbums>(-1).GetLocal(ENGLISH_LOC_INDEX);

foreach (var musicInfo in list) {
if (musicInfo.uid == RANDOM_PANEL_UID)
continue;

var albumLocal = albumLocalisation.GetLocalTitleByIndex(albumConfig.GetAlbumInfoByAlbumJsonIndex(musicInfo.albumJsonIndex).listIndex);

var songName = GetItemNameFromMusicInfo(musicInfo);
_songsByItemName.Add(songName, musicInfo);

if (!_songsByAlbum.TryGetValue(albumLocal, out var albumList)) {
albumList = new Il2CppSystem.Collections.Generic.List<MusicInfo>();
_songsByAlbum.Add(albumLocal, albumList);
}
albumList.Add(musicInfo);
}
}
using Il2CppAssets.Scripts.Database;
using Il2CppAssets.Scripts.PeroTools.Managers;

public bool TryGetMusicInfo(string itemName, out MusicInfo info) => _songsByItemName.TryGetValue(itemName, out info);
public MusicInfo GetMusicInfo(string itemName) => _songsByItemName[itemName];
namespace ArchipelagoMuseDash;

public bool TryGetAlbum(string itemName, out Il2CppSystem.Collections.Generic.List<MusicInfo> infos) => _songsByAlbum.TryGetValue(itemName, out infos);
/// <summary>
/// Contains information about the game's songs, in a way that is easier to access for us.
/// </summary>
public class AlbumDatabase {
private Dictionary<string, MusicInfo> _songsByItemName = new();
private Dictionary<string, List<MusicInfo>> _songsByAlbum = new();

public Il2CppSystem.Collections.Generic.List<MusicInfo> GetAlbum(string itemName) => _songsByAlbum[itemName];
public const int CHINESE_LOC_INDEX = 0;
public const int ENGLISH_LOC_INDEX = 1;
public const string RANDOM_PANEL_UID = "?";

public string GetItemNameFromMusicInfo(MusicInfo musicInfo) {
var localisedSongName = ArchipelagoStatic.SongNameChanger.GetSongName(musicInfo);
return $"{localisedSongName}";
}
public void Setup() {
_songsByAlbum.Clear();
_songsByItemName.Clear();

public string GetLocalisedSongNameForMusicInfo(MusicInfo musicInfo) {
var configManager = ConfigManager.instance;
var songLocal = configManager.GetConfigObject<DBConfigALBUM>(musicInfo.albumJsonIndex).GetLocal().GetLocalAlbumInfoByIndex(musicInfo.listIndex);
return songLocal.name;
}
var list = new Il2CppSystem.Collections.Generic.List<MusicInfo>();
GlobalDataBase.dbMusicTag.GetAllMusicInfo(list);

_songsByAlbum = new Dictionary<string, List<MusicInfo>>();
_songsByItemName = new Dictionary<string, MusicInfo>();

var configManager = ConfigManager.instance;
if (configManager == null)
throw new Exception("Config Manage was null when trying to load songs.");

var albumConfig = configManager.GetConfigObject<DBConfigAlbums>();
var albumLocalisation = configManager.GetConfigObject<DBConfigAlbums>().GetLocal(ENGLISH_LOC_INDEX);

foreach (var musicInfo in list) {
if (musicInfo.uid == RANDOM_PANEL_UID)
continue;

public string GetLocalisedAlbumNameForMusicInfo(MusicInfo musicInfo) {
var configManager = ConfigManager.instance;
var albumConfig = configManager.GetConfigObject<DBConfigAlbums>(-1);
var albumLocalisation = configManager.GetConfigObject<DBConfigAlbums>(-1).GetLocal();
var albumLocal = albumLocalisation.GetLocalTitleByIndex(albumConfig.GetAlbumInfoByAlbumJsonIndex(musicInfo.albumJsonIndex).listIndex);
return albumLocal;

var songName = GetItemNameFromMusicInfo(musicInfo);
_songsByItemName.Add(songName, musicInfo);

if (!_songsByAlbum.TryGetValue(albumLocal, out var albumList)) {
albumList = new List<MusicInfo>();
_songsByAlbum.Add(albumLocal, albumList);
}
albumList.Add(musicInfo);
}
}
}

public bool TryGetMusicInfo(string itemName, out MusicInfo info) => _songsByItemName.TryGetValue(itemName, out info);
public MusicInfo GetMusicInfo(string itemName) => _songsByItemName[itemName];

public bool TryGetAlbum(string itemName, out List<MusicInfo> infos) => _songsByAlbum.TryGetValue(itemName, out infos);

public List<MusicInfo> GetAlbum(string itemName) => _songsByAlbum[itemName];

public string GetItemNameFromMusicInfo(MusicInfo musicInfo) {
var localisedSongName = ArchipelagoStatic.SongNameChanger.GetSongName(musicInfo);
return $"{localisedSongName}";
}

public string GetLocalisedSongNameForMusicInfo(MusicInfo musicInfo) {
var configManager = ConfigManager.instance;
var songLocal = configManager.GetConfigObject<DBConfigALBUM>(musicInfo.albumJsonIndex).GetLocal().GetLocalAlbumInfoByIndex(musicInfo.listIndex);
return songLocal.name;
}

public string GetLocalisedAlbumNameForMusicInfo(MusicInfo musicInfo) {
var configManager = ConfigManager.instance;
var albumConfig = configManager.GetConfigObject<DBConfigAlbums>();
var albumLocalisation = configManager.GetConfigObject<DBConfigAlbums>().GetLocal();
var albumLocal = albumLocalisation.GetLocalTitleByIndex(albumConfig.GetAlbumInfoByAlbumJsonIndex(musicInfo.albumJsonIndex).listIndex);
return albumLocal;
}
}
Loading

0 comments on commit 7d772bf

Please sign in to comment.