Add project files.
This commit is contained in:
parent
a41027298e
commit
fddddfe091
22
KurosWhatToPlay.sln
Normal file
22
KurosWhatToPlay.sln
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.12.35527.113 d17.12
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KurosWhatToPlay", "KurosWhatToPlay\KurosWhatToPlay.csproj", "{0A2485B5-EEF4-4E58-9355-CA26DCAF52B3}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{0A2485B5-EEF4-4E58-9355-CA26DCAF52B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{0A2485B5-EEF4-4E58-9355-CA26DCAF52B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{0A2485B5-EEF4-4E58-9355-CA26DCAF52B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{0A2485B5-EEF4-4E58-9355-CA26DCAF52B3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
48
KurosWhatToPlay/Controller/IGDB.cs
Normal file
48
KurosWhatToPlay/Controller/IGDB.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
using IGDB;
|
||||||
|
using IGDB.Models;
|
||||||
|
|
||||||
|
namespace KurosWhatToPlay.Controller {
|
||||||
|
public class IGDB {
|
||||||
|
IGDBClient igdb;
|
||||||
|
|
||||||
|
internal IGDB() {
|
||||||
|
igdb = new IGDBClient("ngtj0oyeb9fz4713uv0nxij7nrnh01", "fjzked4kg1d3a7u1lpw6qsp1a5823u");
|
||||||
|
}
|
||||||
|
|
||||||
|
internal async void getGame(string id) {
|
||||||
|
Game[] games = await igdb.QueryAsync<Game>(IGDBClient.Endpoints.Games, query: "fields *; where id = " + id + ";");
|
||||||
|
Game game = games.First();
|
||||||
|
Console.WriteLine(game.Name); // Thief
|
||||||
|
}
|
||||||
|
internal async void GetGameNames(long last, long amount, DataGridView gameList) {
|
||||||
|
long value = last + amount;
|
||||||
|
|
||||||
|
string request = "(";
|
||||||
|
|
||||||
|
for (long i = last; i <= value; i++) {
|
||||||
|
request += i + ",";
|
||||||
|
}
|
||||||
|
request = request.Remove(request.Length - 1);
|
||||||
|
request = request + ")";
|
||||||
|
|
||||||
|
Game[] games = await igdb.QueryAsync<Game>(IGDBClient.Endpoints.Games, query: "fields id,name; where id = " + request + "; limit " + amount + ";");
|
||||||
|
|
||||||
|
foreach (Game game in games) {
|
||||||
|
if (game.Id != null && game.Id.HasValue) {
|
||||||
|
gameList.Rows.Add(game.Id.Value, game.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal async void GetConsoleNames(ComboBox consoleCbx) {
|
||||||
|
|
||||||
|
Platform[] gameEngines = await igdb.QueryAsync<Platform>(IGDBClient.Endpoints.Platforms, query: "fields id,name; limit 200;");
|
||||||
|
|
||||||
|
foreach (Platform engine in gameEngines) {
|
||||||
|
if (engine.Id != null && engine.Id.HasValue) {
|
||||||
|
consoleCbx.Items.Add(engine.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
15
KurosWhatToPlay/Controller/Program.cs
Normal file
15
KurosWhatToPlay/Controller/Program.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
namespace KurosWhatToPlay.Controller {
|
||||||
|
internal static class Program {
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main() {
|
||||||
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
|
// see https://aka.ms/applicationconfiguration.
|
||||||
|
IGDB igdb = new Controller.IGDB();
|
||||||
|
ApplicationConfiguration.Initialize();
|
||||||
|
Application.Run(new MainForm(igdb));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
15
KurosWhatToPlay/KurosWhatToPlay.csproj
Normal file
15
KurosWhatToPlay/KurosWhatToPlay.csproj
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="IGDB" Version="5.1.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
10
KurosWhatToPlay/Model/GameList.cs
Normal file
10
KurosWhatToPlay/Model/GameList.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace KurosWhatToPlay.Model {
|
||||||
|
internal class GameList {
|
||||||
|
|
||||||
|
long Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public GameList() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
143
KurosWhatToPlay/View/MainForm.Designer.cs
generated
Normal file
143
KurosWhatToPlay/View/MainForm.Designer.cs
generated
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
using IGDB.Models;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace KurosWhatToPlay
|
||||||
|
{
|
||||||
|
partial class MainForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent() {
|
||||||
|
gameList = new DataGridView();
|
||||||
|
Id = new DataGridViewTextBoxColumn();
|
||||||
|
gameName = new DataGridViewTextBoxColumn();
|
||||||
|
backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
|
||||||
|
panel1 = new Panel();
|
||||||
|
consoleCbx = new ComboBox();
|
||||||
|
((System.ComponentModel.ISupportInitialize)gameList).BeginInit();
|
||||||
|
panel1.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// gameList
|
||||||
|
//
|
||||||
|
gameList.AllowUserToAddRows = false;
|
||||||
|
gameList.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
gameList.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader;
|
||||||
|
gameList.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
gameList.Columns.AddRange(new DataGridViewColumn[] { Id, gameName });
|
||||||
|
gameList.Location = new Point(12, 16);
|
||||||
|
gameList.Name = "gameList";
|
||||||
|
gameList.RowHeadersWidth = 51;
|
||||||
|
gameList.Size = new Size(477, 422);
|
||||||
|
gameList.TabIndex = 4;
|
||||||
|
gameList.Scroll += GameListScroll;
|
||||||
|
//
|
||||||
|
// Id
|
||||||
|
//
|
||||||
|
Id.HeaderText = "Id";
|
||||||
|
Id.MinimumWidth = 6;
|
||||||
|
Id.Name = "Id";
|
||||||
|
Id.Width = 6;
|
||||||
|
//
|
||||||
|
// gameName
|
||||||
|
//
|
||||||
|
gameName.HeaderText = "gameName";
|
||||||
|
gameName.MinimumWidth = 6;
|
||||||
|
gameName.Name = "gameName";
|
||||||
|
gameName.Width = 6;
|
||||||
|
//
|
||||||
|
// panel1
|
||||||
|
//
|
||||||
|
panel1.AutoSize = true;
|
||||||
|
panel1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
|
panel1.Controls.Add(consoleCbx);
|
||||||
|
panel1.Dock = DockStyle.Right;
|
||||||
|
panel1.Location = new Point(500, 0);
|
||||||
|
panel1.MaximumSize = new Size(300, 200);
|
||||||
|
panel1.MinimumSize = new Size(300, 200);
|
||||||
|
panel1.Name = "panel1";
|
||||||
|
panel1.Padding = new Padding(0, 16, 0, 0);
|
||||||
|
panel1.Size = new Size(300, 200);
|
||||||
|
panel1.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// consoleCbx
|
||||||
|
//
|
||||||
|
consoleCbx.FormattingEnabled = true;
|
||||||
|
consoleCbx.Location = new Point(104, 41);
|
||||||
|
consoleCbx.Name = "consoleCbx";
|
||||||
|
consoleCbx.Size = new Size(151, 28);
|
||||||
|
consoleCbx.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// MainForm
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(800, 450);
|
||||||
|
Controls.Add(panel1);
|
||||||
|
Controls.Add(gameList);
|
||||||
|
Name = "MainForm";
|
||||||
|
Text = "Kuro's What to Play";
|
||||||
|
((System.ComponentModel.ISupportInitialize)gameList).EndInit();
|
||||||
|
panel1.ResumeLayout(false);
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GameListScroll(object sender, System.EventArgs e) {
|
||||||
|
int totalHeight = 0;
|
||||||
|
foreach (DataGridViewRow row in gameList.Rows)
|
||||||
|
totalHeight += row.Height;
|
||||||
|
|
||||||
|
if (totalHeight - gameList.Height < gameList.VerticalScrollingOffset) {
|
||||||
|
if (gameList.Rows.Count > 0) {
|
||||||
|
var id = gameList.Rows[gameList.Rows.Count - 1].Cells[0].Value;
|
||||||
|
if (id != null && id.GetType() == typeof(long)) {
|
||||||
|
currentID = long.Parse(id.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Igdb.GetGameNames(currentID, 200, gameList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initGameList() {
|
||||||
|
Igdb.GetGameNames(0, 199, gameList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initConsoleCbx() {
|
||||||
|
Igdb.GetConsoleNames(consoleCbx);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
long currentID = 0;
|
||||||
|
private DataGridView gameList;
|
||||||
|
private DataGridViewTextBoxColumn Id;
|
||||||
|
private DataGridViewTextBoxColumn gameName;
|
||||||
|
private System.ComponentModel.BackgroundWorker backgroundWorker1;
|
||||||
|
private Panel panel1;
|
||||||
|
private ComboBox consoleCbx;
|
||||||
|
}
|
||||||
|
}
|
13
KurosWhatToPlay/View/MainForm.cs
Normal file
13
KurosWhatToPlay/View/MainForm.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
namespace KurosWhatToPlay {
|
||||||
|
public partial class MainForm : Form {
|
||||||
|
public MainForm(Controller.IGDB igdb) {
|
||||||
|
InitializeComponent();
|
||||||
|
Igdb = igdb;
|
||||||
|
initGameList();
|
||||||
|
initConsoleCbx();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Controller.IGDB Igdb { get; }
|
||||||
|
}
|
||||||
|
}
|
129
KurosWhatToPlay/View/MainForm.resx
Normal file
129
KurosWhatToPlay/View/MainForm.resx
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="Id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>25</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
Loading…
x
Reference in New Issue
Block a user