Skip to content

Commit

Permalink
Add feature for touchscreen support (#39)
Browse files Browse the repository at this point in the history
* Add feature for touchscreen support

* Add feature for touchscreen support

* Add feature for touchscreen support
  • Loading branch information
sharkusmanch authored Aug 1, 2022
1 parent 756e786 commit 83b5cb2
Show file tree
Hide file tree
Showing 7 changed files with 851 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ jobs:
mkdir tmp
curl -O https://playnite.link/update/stable/9.19/Playnite919.zip
unzip Playnite914.zip -d tmp/playnite
unzip Playnite919.zip -d tmp/playnite
invoke pack --toolbox ./tmp/playnite/Toolbox.exe
Expand Down
2 changes: 1 addition & 1 deletion extension.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Id: PCGamingWikiMetadata_c038558e-427b-4551-be4c-be7009ce5a8d
Name: PCGamingWiki Metadata Provider
Author: sharkusmanch
Version: 1.1.3
Version: 1.1.4
Module: PCGamingWikiMetadata.dll
Type: MetadataProvider
Icon: icon.png
6 changes: 6 additions & 0 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
AddonId: PCGamingWikiMetadata_c038558e-427b-4551-be4c-be7009ce5a8d
Packages:
- Version: 1.1.4
RequiredApiVersion: 6.2.2
ReleaseDate: 2022-08-01
PackageUrl: https://github.com/sharkusmanch/playnite-pcgamingwiki-metadata-provider/releases/download/v1.1.4/PCGamingWiki_Metadata_Provider_v1.1.4.pext
Changelog:
- Add feature for touchscreen support
- Version: 1.1.3
RequiredApiVersion: 6.2.2
ReleaseDate: 2022-04-28
Expand Down
8 changes: 8 additions & 0 deletions src/PCGWGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ public void AddFullControllerSupport(string description)
}
}

public void AddTouchscreenSupport(string description)
{
if (description == PCGamingWikiType.Rating.NativeSupport)
{
this.AddFeature("Touchscreen optimised");
}
}

public void AddControllerSupport(string description)
{
if (description == PCGamingWikiType.Rating.NativeSupport)
Expand Down
3 changes: 3 additions & 0 deletions src/PCGamingWikiHTMLParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ private void ParseInput()
case "Controller support":
this.gameController.Game.AddControllerSupport(child.FirstChild.Attributes["title"].Value);
break;
case "Touchscreen optimised":
this.gameController.Game.AddTouchscreenSupport(child.FirstChild.Attributes["title"].Value);
break;
default:
break;

Expand Down
38 changes: 38 additions & 0 deletions tests/PCGWGame_Test_CATLADY.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Xunit;
using PCGamingWikiMetadata;
using System;
using System.Linq;
using FluentAssertions;

public class PCGWGame_Test_CATLADY : IDisposable
{
private PCGWGame testGame;
private LocalPCGWClient client;
private TestMetadataRequestOptions options;


public PCGWGame_Test_CATLADY()
{
this.testGame = new PCGWGame("cat_lady", -1);
this.options = new TestMetadataRequestOptions();
this.options.SetGameSourceSteam();
this.client = new LocalPCGWClient(this.options);
// this.client.GetSettings().ImportTagNoCloudSaves = false;
// this.client.GetSettings().ImportFeatureFramerate60 = true;
// this.client.GetSettings().ImportFeatureFramerate120 = true;
// this.client.GetSettings().ImportFeatureVR = true;
this.client.FetchGamePageContent(this.testGame);
}

[Fact]
public void TestTouchscreenSupport()
{
var features = this.testGame.Features.Select(i => i.ToString()).ToArray();
features.Should().Contain("Touchscreen optimised");
}

public void Dispose()
{

}
}
793 changes: 793 additions & 0 deletions tests/data/cat_lady.json

Large diffs are not rendered by default.

0 comments on commit 83b5cb2

Please sign in to comment.