5.4.5.1 Beta
This commit is contained in:
20
scripts/powershell/open-file-dialog.ps1
Normal file
20
scripts/powershell/open-file-dialog.ps1
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
# Shows the Open File dialog to open a file without loading its folder into the playlist.
|
||||
|
||||
# In input.conf add: <key> script-message load-without-folder
|
||||
|
||||
$code = {
|
||||
if ($args[0] -eq 'load-without-folder')
|
||||
{
|
||||
$dialog = New-Object Windows.Forms.OpenFileDialog
|
||||
|
||||
if ($dialog.ShowDialog() -eq 'OK')
|
||||
{
|
||||
$core.LoadFiles($dialog.FileNames, $false, $false);
|
||||
}
|
||||
|
||||
$dialog.Dispose()
|
||||
}
|
||||
}
|
||||
|
||||
$mp.register_event("client-message", $code)
|
||||
27
scripts/powershell/pause-when-minimize.ps1
Normal file
27
scripts/powershell/pause-when-minimize.ps1
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
Set-Variable wasPaused $false -Option AllScope
|
||||
|
||||
$code = {
|
||||
$isMinimized = $args[0]
|
||||
$isPaused = $mp.get_property_bool('pause')
|
||||
|
||||
if ($isMinimized)
|
||||
{
|
||||
if (-not $isPaused)
|
||||
{
|
||||
$mp.set_property_bool('pause', $true)
|
||||
$wasPaused = $true
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($wasPaused -and $isPaused)
|
||||
{
|
||||
$mp.set_property_bool('pause', $false)
|
||||
}
|
||||
|
||||
$wasPaused = $false
|
||||
}
|
||||
}
|
||||
|
||||
$mp.observe_property('window-minimized', 'bool', $code)
|
||||
Reference in New Issue
Block a user