Skip to content

Commit

Permalink
v1.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
RetroDriven committed Apr 3, 2023
1 parent fe04c1c commit 67c96b2
Show file tree
Hide file tree
Showing 21 changed files with 995 additions and 394 deletions.
195 changes: 133 additions & 62 deletions Controls/Organize_Cores/Organize_Cores.Designer.cs

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions Controls/Organize_Cores/Organize_Cores.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Net;
using System.ComponentModel;
using Pocket_Updater.Forms.Message_Box;
using System.Diagnostics;
//using Analogue;

namespace Pocket_Updater.Controls.Organize_Cores
Expand Down Expand Up @@ -90,6 +91,8 @@ public void ReadPlatforms(string Dir)
{
var Dir_Check = Dir + "Platforms";

Debug.WriteLine(Dir_Check);

if (Directory.Exists(Dir_Check))
{

Expand Down Expand Up @@ -182,5 +185,43 @@ private void Button_Refresh_Click(object sender, EventArgs e)
dataGridView1.Rows.Clear();
PopulateDrives();
}

private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
String Location_Type = comboBox2.SelectedItem.ToString();
if (Location_Type == "Removable Storage")
{
dataGridView1.Rows.Clear();
PopulateDrives();
label3.Visible = true;
Pocket_Drive.Visible = true;
Button_Refresh.Visible = true;

if (Pocket_Drive.SelectedIndex == -1)
{
Save.Enabled = false;
}
else
{
Save.Enabled = true;
}
}
else
{
label3.Visible = false;
Pocket_Drive.Visible = false;
Button_Refresh.Visible = false;
}
if (Location_Type == "Current Directory")
{
//Get Json Data
string Current = Directory.GetCurrentDirectory()+"\\";
_settings = new SettingsManager(Current);
dataGridView1.Rows.Clear();
ReadPlatforms(Current);

//Save.Enabled = true;
}
}
}
}
461 changes: 317 additions & 144 deletions Controls/Update_Pocket/Update_Pocket.Designer.cs

Large diffs are not rendered by default.

121 changes: 104 additions & 17 deletions Controls/Update_Pocket/Update_Pocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task RunCoreUpdateProcess(string updatePath, string coresJsonPath,
Button_Refresh.Enabled = false;
comboBox1.Enabled = false;
//GitHub Token
//_updater.SetGithubApiKey("apikey");
_updater.SetGithubApiKey("apikey");
await _updater.RunUpdates();
Update.Enabled = true;
Button_Refresh.Enabled = true;
Expand Down Expand Up @@ -88,6 +88,7 @@ private async void Update_Click(object sender, EventArgs e)
_updater.DownloadAssets(_settings.GetConfig().download_assets);
_updater.DeleteSkippedCores(_settings.GetConfig().delete_skipped_cores);
_updater.PreservePlatformsFolder(_settings.GetConfig().preserve_platforms_folder);
_updater.RenameJotegoCores(_settings.GetConfig().fix_jt_names);

if (github_token != null)
{
Expand Down Expand Up @@ -134,6 +135,7 @@ private async void Update_Click(object sender, EventArgs e)
_updater.DownloadAssets(_settings.GetConfig().download_assets);
_updater.DeleteSkippedCores(_settings.GetConfig().delete_skipped_cores);
_updater.PreservePlatformsFolder(_settings.GetConfig().preserve_platforms_folder);
_updater.RenameJotegoCores(_settings.GetConfig().fix_jt_names);

if (github_token != null)
{
Expand Down Expand Up @@ -379,19 +381,33 @@ public async Task ReadSettingsAsync()
string Current_Dir = Directory.GetCurrentDirectory();
_settings = new SettingsManager(Current_Dir);

//GitHub Token
GitHub_Token.Text = _settings.GetConfig().github_token;

if (_settings.GetConfig().github_token != null)
//Alternate Arcade Files
if (_settings.GetConfig().skip_alternative_assets == true)
{
Toggle_GitHub.Checked = true;
Toggle_Alternatives.Checked = true;
}
else
{
Toggle_GitHub.Checked = false;
Toggle_Alternatives.Checked = false;
}
//GitHub Token
//Alternate_Location.Text = _settings.GetConfig().use_custom_archive;

if (_settings.GetConfig().use_custom_archive == true)
{
Toggle_Alternate.Checked = true;

var custom = _settings.GetConfig().custom_archive;
var url = custom["url"];
var index = custom["index"];
Alternate_Location.Text = url;
//CRC_Json.Text = index;

}
else
{
Toggle_Alternate.Checked = false;
}
//Download Pocket Firmware
if (_settings.GetConfig().download_firmware == true)
{
Expand Down Expand Up @@ -437,6 +453,24 @@ public async Task ReadSettingsAsync()
{
Toggle_Jsons.Checked = false;
}
//Jotego Core Rename
if (_settings.GetConfig().fix_jt_names == true)
{
Toggle_Jotego.Checked = true;
}
else
{
Toggle_Jotego.Checked = false;
}
//CRC Checking
if (_settings.GetConfig().crc_check == true)
{
Toggle_CRC.Checked = true;
}
else
{
Toggle_CRC.Checked = false;
}
//Pre-release Cores
List<Core> cores = await CoresService.GetCores();
foreach (Core core in cores)
Expand All @@ -456,11 +490,36 @@ public async Task ReadSettingsAsync()
}
private async void Button_Save_Click(object sender, EventArgs e)
{
string value = GitHub_Token.Text;
//string value = Alternate_Location.Text;
Config config = _settings.GetConfig();

//GitHub Token
config.github_token = value;
//config.github_token = value;

//Alternate Arcade Files
if (Toggle_Alternatives.Checked == true)
{
config.skip_alternative_assets = true;
}
else
{
config.skip_alternative_assets = false;
}

//Alternate Download Location
if (Toggle_Alternate.Checked == true)
{
config.use_custom_archive = true;

var custom = _settings.GetConfig().custom_archive;
custom["url"] = Alternate_Location.Text;
//custom["index"] = CRC_Json.Text;
_settings.GetConfig().custom_archive = custom;
}
else
{
config.use_custom_archive = false;
}

//Download Pocket Firmware
if (Toggle_Firmware.Checked == true)
Expand Down Expand Up @@ -507,6 +566,24 @@ private async void Button_Save_Click(object sender, EventArgs e)
{
config.build_instance_jsons = false;
}
//Jotego Rename
if (Toggle_Jotego.Checked == true)
{
config.fix_jt_names = true;
}
else
{
config.fix_jt_names = false;
}
//CRC Check
if (Toggle_CRC.Checked == true)
{
config.crc_check = true;
}
else
{
config.crc_check = false;
}
//Pre-Release Cores
try
{
Expand Down Expand Up @@ -558,15 +635,25 @@ private void Button_Refresh_Click_1(object sender, EventArgs e)
}
}

private void Toggle_GitHub_CheckedChanged(object sender, EventArgs e)
private void Toggle_Alternate_CheckedChanged(object sender, EventArgs e)
{
if (Toggle_GitHub.Checked == true)
{
GitHub_Token.Visible = true;
}
if (Toggle_GitHub.Checked == false)
{
GitHub_Token.Visible = false;
if (Toggle_Alternate.Checked == true)
{
Alternate_Location.Visible = true;
TextBox2.Visible = true;
//CRC_Json.Visible = true;
//label15.Visible = true;
//label17.Visible = true;
//label18.Visible = true;
}
if (Toggle_Alternate.Checked == false)
{
Alternate_Location.Visible = false;
TextBox2.Visible = false;
//CRC_Json.Visible = false;
//label15.Visible = false;
//label17.Visible = false;
//label18.Visible = false;
}
}
}
Expand Down
Loading

0 comments on commit 67c96b2

Please sign in to comment.