scripts moved from wiki to folder

This commit is contained in:
Frank Skare
2020-04-21 04:31:10 +02:00
parent d82874409d
commit 4d55423fc7
4 changed files with 50 additions and 5 deletions

View File

@@ -0,0 +1,26 @@
using System.Reflection;
using mpvnet;
class Script
{
public Script()
{
string content = "ctrl+ö script-message my-message-1 my-argument-1";
string sectionName = Assembly.GetExecutingAssembly().GetName().Name;
mp.commandv("define-section", sectionName, content, "force");
mp.commandv("enable-section", sectionName);
mp.ClientMessage += ClientMessage;
}
void ClientMessage(string[] args)
{
switch (args[0])
{
case "my-message-1":
Msg.Show(args[1]);
break;
}
}
}

View File

@@ -0,0 +1,17 @@
// Draws text on screen when full screen property changes.
using mpvnet;
class Script
{
public Script()
{
mp.observe_property_bool("fullscreen", FullscreenChange);
}
void FullscreenChange(bool value)
{
mp.commandv("show-text", "fullscreen: " + value.ToString());
}
}