mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-04-29 10:02:56 +12:00
Add mod author column to the mods list, add a few hardcoded author names
This commit is contained in:
parent
6cc5510c5d
commit
29ebdd82f9
|
@ -97,5 +97,26 @@ namespace VRCMelonAssistant
|
|||
{
|
||||
return CategoryDescriptions.TryGetValue(category, out var result) ? result : "";
|
||||
}
|
||||
|
||||
private static List<(string Original, string Replace)> ourAuthorReplaces =
|
||||
new()
|
||||
{
|
||||
("<@!170953680718266369>", "ImTiara"),
|
||||
("<@!286669951987613706>", "Rafa"),
|
||||
("<@!168795588366696450>", "Grummus"),
|
||||
("<@!167335587488071682>", "KortyBoi/Lily"),
|
||||
("<@!127978642981650432>", "tetra"),
|
||||
("<@!155396491853168640>", "Dawn/arion")
|
||||
};
|
||||
|
||||
public static string FixupAuthor(string authorName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(authorName) || !authorName.Contains("@")) return authorName;
|
||||
|
||||
foreach (var authorReplace in ourAuthorReplaces)
|
||||
authorName = authorName.Replace(authorReplace.Original, authorReplace.Replace);
|
||||
|
||||
return authorName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
<!-- Mods Page -->
|
||||
<sys:String x:Key="Mods:Title">Mods</sys:String>
|
||||
<sys:String x:Key="Mods:Header:Name">Name</sys:String>
|
||||
<sys:String x:Key="Mods:Header:Author">Author</sys:String>
|
||||
<sys:String x:Key="Mods:Header:Installed">Installed</sys:String>
|
||||
<sys:String x:Key="Mods:Header:Latest">Latest</sys:String>
|
||||
<sys:String x:Key="Mods:Header:Description">Description</sys:String>
|
||||
|
|
|
@ -80,6 +80,16 @@
|
|||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn DisplayMemberBinding="{Binding ModName}" Header="{DynamicResource Mods:Header:Name}" />
|
||||
<GridViewColumn Header="{DynamicResource Mods:Header:Author}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Text="{Binding ModAuthor}"
|
||||
MaxWidth="150" TextWrapping="NoWrap" TextTrimming="WordEllipsis"
|
||||
/>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
|
||||
<GridViewColumn x:Name="InstalledColumn" Header="{DynamicResource Mods:Header:Installed}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
|
|
|
@ -209,7 +209,8 @@ namespace VRCMelonAssistant.Pages
|
|||
{
|
||||
name = modInfo.ModName,
|
||||
modversion = modInfo.ModVersion,
|
||||
description = "",
|
||||
author = modInfo.ModAuthor,
|
||||
description = ""
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -219,7 +220,7 @@ namespace VRCMelonAssistant.Pages
|
|||
}
|
||||
}
|
||||
|
||||
private (string ModName, string ModVersion) ExtractModVersions(string dllPath)
|
||||
private (string ModName, string ModVersion, string ModAuthor) ExtractModVersions(string dllPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -228,9 +229,7 @@ namespace VRCMelonAssistant.Pages
|
|||
if (attr.AttributeType.Name == "MelonInfoAttribute" ||
|
||||
attr.AttributeType.Name == "MelonModInfoAttribute")
|
||||
return ((string) attr.ConstructorArguments[1].Value,
|
||||
(string) attr.ConstructorArguments[2].Value);
|
||||
|
||||
return (null, null);
|
||||
(string) attr.ConstructorArguments[2].Value, (string) attr.ConstructorArguments[3].Value);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -249,9 +248,9 @@ namespace VRCMelonAssistant.Pages
|
|||
Utils.ShowErrorMessageBox($"Unable to delete file {dllPath}", ex2);
|
||||
}
|
||||
}
|
||||
|
||||
return (null, null);
|
||||
}
|
||||
|
||||
return (null, null, null);
|
||||
}
|
||||
|
||||
public async Task PopulateModsList()
|
||||
|
@ -287,6 +286,7 @@ namespace VRCMelonAssistant.Pages
|
|||
IsEnabled = true,
|
||||
ModName = latestVersion.name,
|
||||
ModVersion = latestVersion.modversion,
|
||||
ModAuthor = HardcodedCategories.FixupAuthor(latestVersion.author),
|
||||
ModDescription = latestVersion.description.Replace("\r\n", " ").Replace("\n", " "),
|
||||
ModInfo = mod,
|
||||
IsInstalled = mod.installedFilePath != null,
|
||||
|
@ -356,6 +356,7 @@ namespace VRCMelonAssistant.Pages
|
|||
{
|
||||
public string ModName { get; set; }
|
||||
public string ModVersion { get; set; }
|
||||
public string ModAuthor { get; set; }
|
||||
public string ModDescription { get; set; }
|
||||
public bool PreviousState { get; set; }
|
||||
|
||||
|
|
|
@ -51,5 +51,5 @@ using System.Windows;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.1.19.1029")]
|
||||
[assembly: AssemblyFileVersion("1.1.19.1029+vrc")]
|
||||
[assembly: AssemblyVersion("1.1.20.1029")]
|
||||
[assembly: AssemblyFileVersion("1.1.20.1029+vrc")]
|
||||
|
|
Loading…
Reference in a new issue