Open bburky opened 5 years ago
Another:
Make PlayniteApi.ExpandGameVariables(Game, GameAction)
also expand an any associated emulator profile's Executable, WorkingDirectory and Arguments into the new GameAction, correctly handling OverrideDefaultArgs and AdditionalArguments.
Currently I have to manually lookup the emulator. Look up the Profile (using Linq in IronPython, which is weird but works). Manually expand each variable from the profile with Never mind, PlayniteApi.ExpandGameVariables(Game, string)
. And append AdditionalArguments myself. I gave up for now.EmulatorProfileExtensions
has ExpandVariables(..)
but extension methods are mostly unsupported in IronPython. The type currently isn't exposed to IronPython, but I managed to call it directly using some horrible reflection. It would still be nice if there was a method that evaluates everything like Playnite does right before starting a game.
How many of these are still needed?
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
and $PSScriptRoot
cover this now.GetSettingsView()
or save/load settings.
$PlayniteApi
variable. This is hacky and not documented though:
Enter-PSHostProcess -Name Playnite.DesktopApp
$PlayniteApi = (Get-Runspace)[-2].SessionStateProxy.GetVariable("PlayniteApi")
You can close this if you would like to though, or if you think any of these are good use cases I can create followup issues.
1) Extensions can use $CurrentExtensionInstallPath and your GetExecutingAssembly example for plugins is imho pretty standard, I don't think we need to add special variable for that.
2) #1741
3) #1967
4) https://playnite.link/docs/tutorials/extensions/expandingVariables.html
Add an easy way to get a path to the extension directory. It's not too unreasonable for users to rename the extension folder's name, so manually deriving this could be error prone. (" in IronPython, not a path to it's own location. But that's a separate IronPython bug I think.)
__file__
should do this, but it evaluates to "\Maybe allow easier configuration of script extensions. I need to prompt the user for the location of their Steam userdata folder and save that location somewhere. (It looks like
PlayniteApi.GetPluginConfiguration<TConfig>(IPlugin)
is actually accessible in IronPython. Maybe just create an IPlugin instance for script extensions and reuse it?)A REPL with access to the PlayniteApi would be really nice. It would be nice to incrementally test things against the API.