Exemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            //AllocConsole();

            EmoteModuleMetadata meta = new EmoteModuleMetadata()
            {
                Text      = @"NEKOPARA Vol.0",
                Path      = @"neko0\emotedriver.dll",
                Key       = "742877301",
                Ver       = InterfaceVersion.NEKO0,
                ColorMode = ColorType.BGRA,
            };

            emoteLibs.Add(meta);
            //emoteLibs.Add(new EmoteModuleMetadata()
            //{
            //    Text = @"NEKOPARA Vol.1",
            //    Path = @"neko1\emotedriver.dll",
            //    Key = "742877301",
            //    Ver = InterfaceVersion.NEKO1,
            //});



            {
                string pluginsDir = Path.Combine(Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath), "plugins");
                if (!Directory.Exists(pluginsDir))
                {
                    Directory.CreateDirectory(pluginsDir);
                }
                List <string> plugins = Directory.GetFiles(pluginsDir, "*.dll", SearchOption.TopDirectoryOnly).ToList();
                plugins.ForEach(dr =>
                {
                    try
                    {
                        ICharacterLoader[] pluginInstances = LoadAssembly(dr);
                        foreach (ICharacterLoader plugin in pluginInstances)
                        {
                            CharacterLoaders.Add(plugin);
                        }
                    }
                    catch { }
                });
            }



            renderForm = new EnhancedRenderForm();
            //renderForm.AutoScaleMode = AutoScaleMode.None;
            renderForm.FormBorderStyle = FormBorderStyle.None;
            renderForm.Width           = 512;
            renderForm.Height          = 512;
            renderForm.StartPosition   = FormStartPosition.Manual;
            renderForm.Location        = new Point(this.Location.X + this.Width, this.Location.Y);
            renderForm.Show();
            emote = new Emote(renderForm.Handle, 1024, 1024, false);



            emote.LoadEmoteEngine(Path.Combine(Directory.GetCurrentDirectory(), @"engines", meta.Path), meta.Ver);
            emote.EmoteInit();

            _device = new Device(new IntPtr(emote.D3Device));

            functionGraph               = new FunctionGraphForm();
            functionGraph.Width         = this.Width;
            functionGraph.Height        = renderForm.Height - this.Height;
            functionGraph.StartPosition = FormStartPosition.Manual;
            functionGraph.Location      = new Point(this.Location.X, this.Location.Y + this.Height);
            functionGraph.Show();

            rendering = true;
            Task.Run(() =>
            {
                while (rendering)
                {
                    Render();
                }
            }).ContinueWith((task) => { });

            //timer1.Start();

            LoadCharacters();
        }
Exemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            //AllocConsole();

            EmoteModuleMetadata meta = new EmoteModuleMetadata()
            {
                Text = @"NEKOPARA Vol.0",
                Path = @"neko0\emotedriver.dll",
                Key = "742877301",
                Ver = InterfaceVersion.NEKO0,
                ColorMode = ColorType.BGRA,
            };
            emoteLibs.Add(meta);
            //emoteLibs.Add(new EmoteModuleMetadata()
            //{
            //    Text = @"NEKOPARA Vol.1",
            //    Path = @"neko1\emotedriver.dll",
            //    Key = "742877301",
            //    Ver = InterfaceVersion.NEKO1,
            //});



            {
                string pluginsDir = Path.Combine(Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath), "plugins");
                if (!Directory.Exists(pluginsDir)) Directory.CreateDirectory(pluginsDir);
                List<string> plugins = Directory.GetFiles(pluginsDir, "*.dll", SearchOption.TopDirectoryOnly).ToList();
                plugins.ForEach(dr =>
                {
                    try
                    {
                        ICharacterLoader[] pluginInstances = LoadAssembly(dr);
                        foreach (ICharacterLoader plugin in pluginInstances)
                        {
                            CharacterLoaders.Add(plugin);
                        }
                    }
                    catch { }
                });
            }






            renderForm = new EnhancedRenderForm();
            //renderForm.AutoScaleMode = AutoScaleMode.None;
            renderForm.FormBorderStyle = FormBorderStyle.None;
            renderForm.Width = 512;
            renderForm.Height = 512;
            renderForm.StartPosition = FormStartPosition.Manual;
            renderForm.Location = new Point(this.Location.X + this.Width, this.Location.Y);
            renderForm.Show();
            emote = new Emote(renderForm.Handle, 1024, 1024, false);



            emote.LoadEmoteEngine(Path.Combine(Directory.GetCurrentDirectory(), @"engines", meta.Path), meta.Ver);
            emote.EmoteInit();

            _device = new Device(new IntPtr(emote.D3Device));

            functionGraph = new FunctionGraphForm();
            functionGraph.Width = this.Width;
            functionGraph.Height = renderForm.Height - this.Height;
            functionGraph.StartPosition = FormStartPosition.Manual;
            functionGraph.Location = new Point(this.Location.X, this.Location.Y + this.Height);
            functionGraph.Show();

            rendering = true;
            Task.Run(() =>
            {
                while (rendering)
                {
                    Render();
                }
            }).ContinueWith((task) => { });

            //timer1.Start();

            LoadCharacters();
        }