-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for per platform extraction option (LaunchBox 12.8)
- Loading branch information
1 parent
5762fa8
commit eb987be
Showing
8 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Unbroken.LaunchBox.Plugins; | ||
using Unbroken.LaunchBox.Plugins.Data; | ||
|
||
namespace ArchiveCacheManager | ||
{ | ||
static class PluginUtils | ||
{ | ||
public static bool GetEmulatorPlatformAutoExtract(string emulatorId, string platformName) | ||
{ | ||
var emulator = PluginHelper.DataManager.GetEmulatorById(emulatorId); | ||
var emulatorPlatform = Array.Find(emulator.GetAllEmulatorPlatforms(), p => p.Platform.Equals(platformName)); | ||
|
||
// emulatorPlatform.AutoExtract will be null if the Emulator settings haven't been changed since updating to LaunchBox 12.8 | ||
// So perform two checks to determine if AutoExtract is true, one at the emulator level, and one at the emulatorPlatform level | ||
return (emulator.AutoExtract && emulatorPlatform.AutoExtract == null) || (emulatorPlatform.AutoExtract == true); | ||
} | ||
|
||
public static bool GetEmulatorPlatformM3uDiscLoadEnabled(string emulatorId, string platformName) | ||
{ | ||
var emulator = PluginHelper.DataManager.GetEmulatorById(emulatorId); | ||
var emulatorPlatform = Array.Find(emulator.GetAllEmulatorPlatforms(), p => p.Platform.Equals(platformName)); | ||
|
||
return emulatorPlatform.M3uDiscLoadEnabled; | ||
} | ||
|
||
public static void SetEmulatorPlatformM3uDiscLoadEnabled(string emulatorId, string platformName, bool enabled) | ||
{ | ||
var emulator = PluginHelper.DataManager.GetEmulatorById(emulatorId); | ||
var emulatorPlatform = Array.Find(emulator.GetAllEmulatorPlatforms(), p => p.Platform.Equals(platformName)); | ||
|
||
emulatorPlatform.M3uDiscLoadEnabled = enabled; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters