Added empty Playnite library plugin

dashboard
Pat Hartl 2023-01-04 19:23:32 -06:00
parent 3000985a53
commit 1163173c0f
13 changed files with 312 additions and 1 deletions

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary>
<Style x:Key="BaseTextBlockStyle" TargetType="TextBlock" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Localization/en_US.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F9EB13D4-8FD9-4095-B934-F7EC681E6901}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LANCommander.Playnite.Extension</RootNamespace>
<AssemblyName>LANCommander.Playnite.Extension</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\Games\Playnite\Extensions\LANCommander\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Playnite.SDK, Version=6.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\PlayniteSDK.6.8.0\lib\net462\Playnite.SDK.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="PlayniteClient.cs" />
<Compile Include="PlayniteLibraryPlugin.cs" />
<Compile Include="PlayniteSettings.cs" />
<Compile Include="PlayniteSettingsView.xaml.cs">
<DependentUpon>PlayniteSettingsView.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="extension.yaml" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Page Include="App.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Localization\en_US.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PlayniteSettingsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
</ResourceDictionary>

View File

@ -0,0 +1,19 @@
using Playnite.SDK;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LANCommander.Playnite.Extension
{
public class PlayniteClient : LibraryClient
{
public override bool IsInstalled => true;
public override void Open()
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,47 @@
using Playnite.SDK;
using Playnite.SDK.Models;
using Playnite.SDK.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
namespace LANCommander.Playnite.Extension
{
public class PlayniteLibraryPlugin : LibraryPlugin
{
public static readonly ILogger Logger = LogManager.GetLogger();
private SettingsViewModel Settings { get; set; }
public override Guid Id { get; } = Guid.Parse("48e1bac7-e0a0-45d7-ba83-36f5e9e959fc");
public override string Name => "LANCommander";
public override LibraryClient Client { get; } = new PlayniteClient();
public PlayniteLibraryPlugin(IPlayniteAPI api) : base(api)
{
Settings = new SettingsViewModel(this);
Properties = new LibraryPluginProperties
{
HasSettings = true,
};
}
public override IEnumerable<GameMetadata> GetGames(LibraryGetGamesArgs args)
{
// Implement LANCommander client here
return new List<GameMetadata>();
}
public override ISettings GetSettings(bool firstRunSettings)
{
return base.GetSettings(firstRunSettings);
}
public override UserControl GetSettingsView(bool firstRunView)
{
return base.GetSettingsView(firstRunView);
}
}
}

View File

@ -0,0 +1,58 @@
using Playnite.SDK;
using Playnite.SDK.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LANCommander.Playnite.Extension
{
public class PlayniteSettings : ObservableObject
{
private string Option1 = String.Empty;
private bool Option2 = false;
private bool OptionThatWontBeSaved = false;
}
public class SettingsViewModel : ObservableObject, ISettings
{
private readonly PlayniteLibraryPlugin Plugin;
private PlayniteSettings EditingClone { get; set; }
private PlayniteSettings Settings { get; set; }
public SettingsViewModel(PlayniteLibraryPlugin plugin)
{
Plugin = plugin;
var savedSettings = Plugin.LoadPluginSettings<PlayniteSettings>();
if (savedSettings != null)
Settings = savedSettings;
else
Settings = new PlayniteSettings();
}
public void BeginEdit()
{
EditingClone = Serialization.GetClone(Settings);
}
public void CancelEdit()
{
Settings = EditingClone;
}
public void EndEdit()
{
Plugin.SavePluginSettings(Settings);
}
public bool VerifySettings(out List<string> errors)
{
errors = new List<string>();
return true;
}
}
}

View File

@ -0,0 +1,14 @@
<UserControl x:Class="LANCommander.Playnite.Extension.PlayniteSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="600">
<StackPanel>
<TextBlock Text="Description for Option1:"/>
<TextBox Text="{Binding Settings.Option1}"/>
<TextBlock Text="Description for Option2:"/>
<CheckBox IsChecked="{Binding Settings.Option2}"/>
</StackPanel>
</UserControl>

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace LANCommander.Playnite.Extension
{
public partial class PlayniteSettingsView : UserControl
{
public PlayniteSettingsView()
{
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LANCommander.Playnite.Extension")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LANCommander.Playnite.Extension")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f9eb13d4-8fd9-4095-b934-f7ec681e6901")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,7 @@
Id: LANCommander.Playnite.Extension_48e1bac7-e0a0-45d7-ba83-36f5e9e959fc
Name: LANCommander Playnite Extension
Author: Pat Hartl
Version: 1.0
Module: LANCommander.Playnite.Extension.dll
Type: GameLibrary
Icon: icon.png

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="PlayniteSDK" version="6.8.0" targetFramework="net462" />
</packages>

BIN
LANCommander.db.bak Normal file

Binary file not shown.

View File

@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.1.32328.378 VisualStudioVersion = 17.1.32328.378
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LANCommander", "LANCommander.csproj", "{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander", "LANCommander.csproj", "{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LANCommander.Playnite.Extension", "LANCommander.Playnite.Extension\LANCommander.Playnite.Extension.csproj", "{F9EB13D4-8FD9-4095-B934-F7EC681E6901}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -15,6 +17,10 @@ Global
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Debug|Any CPU.Build.0 = Debug|Any CPU {C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Release|Any CPU.ActiveCfg = Release|Any CPU {C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Release|Any CPU.Build.0 = Release|Any CPU {C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Release|Any CPU.Build.0 = Release|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE