Skip to content

Commit

Permalink
Merge branch 'curse' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
KimihikoAkayasaki committed Mar 12, 2023
2 parents f1de5fa + 9c3450d commit 0a2d4a9
Show file tree
Hide file tree
Showing 37 changed files with 4,595 additions and 1,480 deletions.
2 changes: 2 additions & 0 deletions Amethyst.Plugins.Contract/Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public interface IPluginMetadata

[DefaultValue(null)] string Publisher { get; }
[DefaultValue(null)] string Website { get; }
[DefaultValue(null)] string UpdateEndpoint { get; }
[DefaultValue("0.0.0.0")] string Version { get; }
}

/// <summary>
Expand Down
16 changes: 12 additions & 4 deletions Amethyst/Amethyst.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.WinUI" Version="7.1.2" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Media" Version="7.1.2" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="5.0.1" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.4.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.230118.102" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.5.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.230217.4" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.25231-preview" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="RestSharp" Version="108.0.3" />
<PackageReference Include="System.ComponentModel.Composition" Version="7.0.0" />
<PackageReference Include="System.ComponentModel.Composition.Registration" Version="7.0.0" />
<PackageReference Include="WinUI.System.Icons" Version="0.0.5" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

Expand All @@ -67,8 +70,7 @@
Explorer "Package and Publish" context menu entry to be enabled for this project even if
the Windows App SDK Nuget package has not yet been restored.
-->
<PropertyGroup
Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
<ItemGroup>
Expand All @@ -78,6 +80,7 @@
<None Remove="Pages\Devices.xaml" />
<None Remove="Pages\General.xaml" />
<None Remove="Pages\Info.xaml" />
<None Remove="Pages\Plugins.xaml" />
<None Remove="Pages\Settings.xaml" />
</ItemGroup>
<ItemGroup>
Expand All @@ -92,6 +95,11 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Page Update="Pages\Plugins.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="Controls\JointSettingsExpander.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down
16 changes: 8 additions & 8 deletions Amethyst/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public App()
$"Amethyst_{DateTime.Now:yyyyMMdd-HHmmss.ffffff}.log"));

// Create an empty file for checking for crashes
Interfacing.CrashFile = new FileInfo(Path.Join(Interfacing.GetProgramLocation().DirectoryName, ".crash"));
Interfacing.CrashFile = new FileInfo(Path.Join(Interfacing.ProgramLocation.DirectoryName, ".crash"));
Interfacing.CrashFile.Create(); // Create the file

try
Expand Down Expand Up @@ -132,7 +132,7 @@ public App()

// Read plugin settings
Logger.Info("Reading custom plugin settings...");
TrackingDevices.PluginSettings.ReadSettings();
AppPlugins.PluginSettings.ReadSettings();

// Run detached to allow for async calls
Task.Run(async () =>
Expand All @@ -151,7 +151,7 @@ public App()

// Create the strings directory in case it doesn't exist yet
Directory.CreateDirectory(Path.Join(
Interfacing.GetProgramLocation().DirectoryName, "Assets", "Strings"));
Interfacing.ProgramLocation.DirectoryName, "Assets", "Strings"));

// Load language resources
Interfacing.LoadJsonStringResourcesEnglish();
Expand All @@ -160,7 +160,7 @@ public App()
// Setup string hot reload watchdog
ResourceWatcher = new FileSystemWatcher
{
Path = Path.Join(Interfacing.GetProgramLocation().DirectoryName, "Assets", "Strings"),
Path = Path.Join(Interfacing.ProgramLocation.DirectoryName, "Assets", "Strings"),
NotifyFilter = NotifyFilters.CreationTime | NotifyFilters.FileName |
NotifyFilters.LastWrite | NotifyFilters.DirectoryName,
IncludeSubdirectories = true,
Expand Down Expand Up @@ -205,20 +205,20 @@ private static void OnWatcherOnChanged(object o, FileSystemEventArgs fileSystemE
Interfacing.LoadJsonStringResources(AppData.Settings.AppLanguage);
// Reload plugins' language resources
foreach (var plugin in TrackingDevices.TrackingDevicesList.Values)
foreach (var plugin in AppPlugins.TrackingDevicesList.Values)
Interfacing.Plugins.SetLocalizationResourcesRoot(
plugin.LocalizationResourcesRoot.Directory, plugin.Guid);
foreach (var plugin in TrackingDevices.ServiceEndpointsList.Values)
foreach (var plugin in AppPlugins.ServiceEndpointsList.Values)
Interfacing.Plugins.SetLocalizationResourcesRoot(
plugin.LocalizationResourcesRoot.Directory, plugin.Guid);
// Reload everything we can
Shared.Devices.DevicesJointsValid = false;
// Reload plugins' interfaces
TrackingDevices.TrackingDevicesList.Values.ToList().ForEach(x => x.OnLoad());
TrackingDevices.ServiceEndpointsList.Values.ToList().ForEach(x => x.OnLoad());
AppPlugins.TrackingDevicesList.Values.ToList().ForEach(x => x.OnLoad());
AppPlugins.ServiceEndpointsList.Values.ToList().ForEach(x => x.OnLoad());
// Request page reloads
Translator.Get.OnPropertyChanged();
Expand Down
72 changes: 67 additions & 5 deletions Amethyst/Assets/Strings/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@
"/DevicesPage/Devices/Manager/Labels/InvalidFactory": "Calling the plugin factory (lazy loading) method failed.",
"/DevicesPage/Devices/Manager/Labels/BadOrDuplicateGuid": "GUID of this plugin is either empty, invalid, or already in use by another one.",
"/DevicesPage/Devices/Manager/Labels/Other": "This plugin doesn't seem to be valid for some reason....",
"/DevicesPage/Devices/Manager/Buttons/Update": "Update on exit",
"/DevicesPage/Devices/Manager/Labels/UpdateAvailable": "Update available!",
"/DevicesPage/Devices/Manager/Labels/UpdateMessage": "{0} will be updated to {1}",

"/InfoPage/AppCaption": "by K2VR Team",
"/InfoPage/AppTitle": "Amethyst",
Expand Down Expand Up @@ -261,10 +264,11 @@
"/SharedStrings/Buttons/Help/Header": "Hilfe",
"/SharedStrings/Buttons/Help/Licenses": "Open-Source-Lizenzen",
"/SharedStrings/Buttons/Info": "Info",
"/SharedStrings/Buttons/Plugins": "Plugins",
"/SharedStrings/Buttons/Settings": "Einstellungen",
"/SharedStrings/Buttons/Updates/Header": "Updates",
"/SharedStrings/Buttons/Updates/Install": "Jetzt installieren",
"/SharedStrings/Buttons/Updates/Skip": "Beim Verlassen installieren",
"/SharedStrings/Buttons/Updates/Install": "Update now",
"/SharedStrings/Buttons/PluginUpdates/Inspect": "Update all on exit",
"/SharedStrings/Joints/Enum/0": "Hand",
"/SharedStrings/Joints/Enum/1": "Linker Fuß",
"/SharedStrings/Joints/Enum/10": "Brust",
Expand Down Expand Up @@ -292,14 +296,72 @@
"/SharedStrings/Toasts/TrackersAutoDisabled/Title": "Eins oder mehrere Tracker wurden deaktiviert",
"/SharedStrings/Toasts/TrackersConfigChanged": "{0} neustarten, damit die Änderungen wirksam werden",
"/SharedStrings/Toasts/TrackersConfigChanged/Title": "Die Tracker-Konfiguration hat sich geändert",
"/SharedStrings/Updates/NewUpdateFound": "Neues Update verfügbar",
"/SharedStrings/Updates/Suggestions": "Teile deine Ideen für das nächste Amethyst-Update mit uns!",
"/SharedStrings/Updates/NewUpdateFound": "New Update Available!",
"/SharedStrings/Updates/NewUpdateMessage": "Restart Amethyst to update it to version v{0}",
"/SharedStrings/Updates/Suggestions": "Please tell us if you have any ideas\nfor the next Amethyst update.",
"/SharedStrings/Updates/PluginUpdates/Message": "New plugin updates found, would you like to install them?",
"/SharedStrings/Updates/UpToDate": "Du bist auf der aktuellsten Version",

"/SharedStrings/Updates/Headers/Downloading": "Downloaden einer Aktualisierung",
"/SharedStrings/Updates/Headers/Downloading": "Updating to Amethyst v{0}",
"/SharedStrings/Updates/Headers/Preparing": "Preparing for the update...",
"/SharedStrings/Updates/Headers/Status": "Status:",
"/SharedStrings/Updates/Statuses/Downloading": "Herunterladen - 0%",
"/SharedStrings/Updates/Statuses/Error": "Fehler beim Herunterladen!",

"/SharedStrings/Plugins/Updates/Headers/Downloading": "Updating {0} to v{1}",
"/SharedStrings/Plugins/Updates/Headers/Preparing": "Preparing for the update...",
"/SharedStrings/Plugins/Updates/Headers/Restart": "{0} will have been updated by the next time Amethyst opens!",
"/SharedStrings/Plugins/Updates/Headers/Status": "Status:",
"/SharedStrings/Plugins/Updates/Statuses/Downloading": "Downloading {0} v{1}...",
"/SharedStrings/Plugins/Updates/Statuses/Error": "Error updating {0}!",
"/SharedStrings/Plugins/Store/Headers/Downloading": "Installing {0} {1}",
"/SharedStrings/Plugins/Store/Headers/Preparing": "Preparing the plugin package...",
"/SharedStrings/Plugins/Store/Headers/Restart": "{0} will have been installed by the next time Amethyst opens!",
"/SharedStrings/Plugins/Store/Headers/Status": "Status:",
"/SharedStrings/Plugins/Store/Statuses/Downloading": "Downloading {0} {1}...",
"/SharedStrings/Plugins/Store/Statuses/Error": "Error installing {0}!",
"/SharedStrings/Plugins/Store/Headers/Search": "Search or paste a link:",
"/SharedStrings/Plugins/Store/Contents/Search": "Search for plugins, or paste the link to a plugin repo",
"/SharedStrings/Plugins/Store/Headers/SearchTip/Search": "Search for plugins using keywords from their names or descriptions, \nor just paste the link to a plugin repository located on GitHub.",
"/SharedStrings/Plugins/Store/Headers/SearchTip/Drag": "You can also drag-and-drop a plugin link/folder/zip here to install it.",
"/SharedStrings/Plugins/Store/Headers/ErrorTip/Content": "A fatal exception occurred whilst executing the plugin search query, \nor you've just exceeded the GitHub API request rate limit.",
"/SharedStrings/Plugins/Store/Headers/ErrorTip/Drag": "You can still install plugins via drag-and-drop or using a link/folder/zip.",
"/SharedStrings/Plugins/Store/Headers/RateTip/Start": "GitHub API rate exceeded. Please wait a while, or",
"/SharedStrings/Plugins/Store/Headers/RateTip/Link": "log in to GitHub",
"/SharedStrings/Plugins/Store/Headers/RateTip/End": "to search for more Amethyst plugins. You can still install plugins using drag-and-drop.",
"/SharedStrings/Plugins/Store/Headers/NoResults": "Your search happened not to return any results. \n...or was it just the wind all along, who knows?",
"/SharedStrings/Plugins/Store/Headers/Login/Instructions": "Paste this code into the prompt your web browser has just shown.",
"/SharedStrings/Plugins/Store/Headers/Login/Message": "This will log you in to the GitHub API, allowing higher query rate.",
"/SharedStrings/Plugins/Store/Tips/Official": "Published by K2VR Team",
"/SharedStrings/Plugins/Store/Tips/AlreadyInstalled": "This plugin is already installed, do you wish to uninstall it?",
"/SharedStrings/Plugins/Store/Labels/Description": "Plugin description:",
"/SharedStrings/Plugins/Store/Labels/NoReleases": "This plugin has no releases and can't be installed using the store.\nFeel free to contact the author about testing or preview releases.",
"/SharedStrings/Plugins/Store/Labels/Title": "Release title:",
"/SharedStrings/Plugins/Store/Labels/Date": "Published on:",
"/SharedStrings/Plugins/Store/Labels/Changelog": "Changelog:",
"/SharedStrings/Plugins/Store/Buttons/Install": "Install",

"/SharedStrings/Plugins/Drop/Headers/Error/Validating": "Error validating {0}!",
"/SharedStrings/Plugins/Drop/Headers/Error/Installing": "Error installing {0}!",
"/SharedStrings/Plugins/Drop/Headers/Error/Exception": "Error installing the package!",
"/SharedStrings/Plugins/Drop/Headers/Downloading": "Downloading {0}...",
"/SharedStrings/Plugins/Drop/Headers/Validating": "Validating {0}...",
"/SharedStrings/Plugins/Drop/Headers/Installing": "Installing {0}...",
"/SharedStrings/Plugins/Drop/Headers/Installed": "Installed {0}!",
"/SharedStrings/Plugins/Drop/Statuses/Error/NotFound": "{0} does not contain a plugin class library file (plugin*.dll) and can't be installed. Please validate the package manually.",
"/SharedStrings/Plugins/Drop/Statuses/Error/NotFound/Plural": "{0} do not contain a plugin class library file (plugin*.dll) and can't be installed. Please validate the package manually.",
"/SharedStrings/Plugins/Drop/Statuses/Error/Invalid": "{0} is not a valid plugin package (has to be a .zip file) and can't be installed. Please validate the package manually.",
"/SharedStrings/Plugins/Drop/Statuses/Error/Exception": "Couldn't process the package due to an exception: {0}. Please install the package manually.",
"/SharedStrings/Plugins/Drop/Statuses/Installed": "Successfully parsed the plugin package! {0} will have been installed by the next time Amethyst opens!",
"/SharedStrings/Plugins/Drop/Resources/Files": "files",
"/SharedStrings/Plugins/Drop/Resources/Folder": "folder",
"/SharedStrings/Plugins/Drop/Resources/Package": "package",

"/PluginStore/Titles/Install": "Install {0} {1}",
"/PluginStore/Titles/Installing/Setup": "Enqueued {0} installation!",
"/PluginStore/Titles/Uninstalling/Notice": "Enqueued {0} removal!",
"/PluginStore/Captions/Uninstalling/Notice": "Amethyst should delete it during the next startup.",
"/PluginStore/Captions/Installing/Setup": "Restart Amethyst to install it.",

"/CrashHandler/Content/AlreadyRunning": "Looks like the app is already running\nand you've tried to launch a second instance,\nthis action is not currently supported.\n\nPlease check if the app isn't opened.\nIf problem persists, press the 'Force Exit' button.",
"/CrashHandler/Content/Crash/NoPlugins": "There were no appropriate plugins available to load and use in Amethyst.\n\nPlease check if you have all dependencies installed, like proper Service or Framework Runtime and other dependency libraries needed by your plugins.",
Expand Down
Loading

0 comments on commit 0a2d4a9

Please sign in to comment.