示例#1
0
        static void PluginModeInit()
        {
            Try(() =>
            {
                Ust = new Ust(args[0], Encoding);
                Ust.SetAtlas(Atlas);
                if (Ust.IsLoaded)
                {
                    Log("Ust loaded");
                }
                else
                {
                    Log($"Error reading UST");
                }
            }, "Error on reading Ust");

            Try(() =>
            {
                if (Ust.IsLoaded)
                {
                    Atlas = new Atlas(Ust.VoiceDir);
                    Ust.SetAtlas(Atlas);
                }
                if (Atlas.IsLoaded)
                {
                    Log("Atlas loaded");
                }
                else
                {
                    Log("Error reading Atlas");
                }
            }, "Error on reading Atlas");

            Try(() =>
            {
                var singer = new Singer(Ust.VoiceDir);
                if (singer.IsLoaded)
                {
                    Log("Singer loaded");
                }
                else
                {
                    Log($"Error reading singer {Ust.VoiceDir}");
                }
            }, "Error on reading Singer");

            Log("All files loaded successfully");

            Try(() =>
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
            }, "Error on end init");

            var window = new PluginWindow();

            window.Init(Ust, Atlas);
            Application.Run(window);
        }
 public PluginWindow()
 {
     window = this;
     InitializeComponent();
 }