This commit is contained in:
stax76
2024-02-03 06:03:54 +01:00
parent 23ed1457d5
commit 2f735215e0
6 changed files with 116 additions and 102 deletions

View File

@@ -68,7 +68,30 @@ public partial class MainForm : Form
GuiCommand.Current.WindowScaleNet += GuiCommand_WindowScaleNet;
GuiCommand.Current.ShowMenu += GuiCommand_ShowMenu;
Init();
Player.Init(Handle, true);
// bool methods not working correctly
Player.ObserveProperty("window-maximized", PropChangeWindowMaximized);
Player.ObserveProperty("window-minimized", PropChangeWindowMinimized);
Player.ObservePropertyBool("border", PropChangeBorder);
Player.ObservePropertyBool("fullscreen", PropChangeFullscreen);
Player.ObservePropertyBool("keepaspect-window", value => Player.KeepaspectWindow = value);
Player.ObservePropertyBool("ontop", PropChangeOnTop);
Player.ObservePropertyBool("title-bar", PropChangeTitleBar);
Player.ObservePropertyString("sid", PropChangeSid);
Player.ObservePropertyString("aid", PropChangeAid);
Player.ObservePropertyString("vid", PropChangeVid);
Player.ObservePropertyString("title", PropChangeTitle);
Player.ObservePropertyInt("edition", PropChangeEdition);
Player.ObservePropertyDouble("window-scale", PropChangeWindowScale);
CommandLine.ProcessCommandLineArgsPostInit();
CommandLine.ProcessCommandLineFiles();
_taskbarButtonCreatedMessage = RegisterWindowMessage("TaskbarButtonCreated");
@@ -145,34 +168,6 @@ public partial class MainForm : Form
SetTitle();
}
void Init()
{
Player.Init(Handle);
// bool methods not working correctly
Player.ObserveProperty("window-maximized", PropChangeWindowMaximized);
Player.ObserveProperty("window-minimized", PropChangeWindowMinimized);
Player.ObservePropertyBool("border", PropChangeBorder);
Player.ObservePropertyBool("fullscreen", PropChangeFullscreen);
Player.ObservePropertyBool("keepaspect-window", value => Player.KeepaspectWindow = value);
Player.ObservePropertyBool("ontop", PropChangeOnTop);
Player.ObservePropertyBool("title-bar", PropChangeTitleBar);
Player.ObservePropertyString("sid", PropChangeSid);
Player.ObservePropertyString("aid", PropChangeAid);
Player.ObservePropertyString("vid", PropChangeVid);
Player.ObservePropertyString("title", PropChangeTitle);
Player.ObservePropertyInt("edition", PropChangeEdition);
Player.ObservePropertyDouble("window-scale", PropChangeWindowScale);
Player.ProcessCommandLineArgsPost();
Player.ProcessCommandLineFiles();
}
void PropChangeWindowScale(double scale)
{
if (!WasShown)