示例#1
0
        public void Run(
            VgcApis.Models.IServices.IApiService api,
            Services.Settings settings,
            Services.LuaServer luaServer)
        {
            this.api        = api;
            this.configMgr  = api.GetConfigMgrService();
            this.vgcServers = api.GetServersService();

            this.settings    = settings;
            this.luaServer   = luaServer;
            this.luaCoreCtrl = CreateLuaCoreCtrl(
                settings, api);

            InitControls();
            BindEvents();

            ReloadScriptName();
            if (cboxScriptName.Items.Count > 0)
            {
                cboxScriptName.SelectedIndex = 0;
            }

            repaintCtrl = new VgcApis.Libs.Views.RepaintCtrl(rtboxOutput);
            logUpdater.Run();
        }
示例#2
0
        public void Run(
            VgcApis.Models.IServices.IApiService api,
            Services.Settings settings,
            Services.LuaServer luaServer)
        {
            this.api        = api;
            this.configMgr  = api.GetConfigMgrService();
            this.vgcServers = api.GetServersService();

            this.settings    = settings;
            this.luaServer   = luaServer;
            this.luaCoreCtrl = CreateLuaCoreCtrl(
                settings, api);

            InitControls();
            BindEvents();

            ReloadScriptName();
            if (cboxScriptName.Items.Count > 0)
            {
                cboxScriptName.SelectedIndex = 0;
            }

            updateOutputTimer.Tick += UpdateOutput;
            updateOutputTimer.Start();
        }
示例#3
0
 public void Run(Services.LuaServer luaServer)
 {
     this.luaServer = luaServer;
     BindEvents(luaServer);
     RefreshFlyPanel();
     luaServer.OnLuaCoreCtrlListChange += OnLuaCoreCtrlListChangeHandler;
 }
示例#4
0
        public void Run(
            VgcApis.Interfaces.Services.IApiService api,
            Services.Settings settings,
            Services.FormMgrSvc formMgr,
            Services.LuaServer luaServer)
        {
            this.formMgr   = formMgr;
            this.settings  = settings;
            this.luaServer = luaServer;

            this.luaCoreCtrl = CreateLuaCoreCtrl(settings, api);


            isLoadClrLib = false;

            BindEvents();
            ReloadScriptName();

            rtboxFreezer = new VgcApis.UserControls.RepaintController(rtboxOutput);
            logUpdater.Run();

            /*
             #if DEBUG
             *          if (cboxScriptName.Items.Count > 0)
             *          {
             *              cboxScriptName.SelectedIndex = 0;
             *          }
             #endif
             */
        }
示例#5
0
 public void Cleanup()
 {
     ReleaseEvent(this.luaCoreCtrl);
     lazyUpdater?.Dispose();
     this.formMgrSvc   = null;
     this.luaServerSvc = null;
 }
示例#6
0
文件: LuaUI.cs 项目: torgitor/vrGCon
 public LuaUI(
     Services.LuaServer luaServer,
     Controllers.LuaCoreCtrl luaCoreCtrl)
 {
     this.luaCoreCtrl = luaCoreCtrl;
     this.luaServer   = luaServer;
     InitializeComponent();
 }
示例#7
0
 public LuaUI(
     Services.LuaServer luaServer,
     Services.FormMgrSvc formMgrSvc,
     Controllers.LuaCoreCtrl luaCoreCtrl)
 {
     this.luaCoreCtrl = luaCoreCtrl;
     this.luaServer   = luaServer;
     this.formMgrSvc  = formMgrSvc;
     InitializeComponent();
 }
示例#8
0
        public void Run(
            Services.Settings settings,
            Services.LuaServer luaServer)
        {
            this.settings  = settings;
            this.luaServer = luaServer;
            BindEvents(luaServer);
            BindDragDropEvent();

            RefreshFlyPanel();
            luaServer.OnRequireFlyPanelUpdate += OnLuaCoreCtrlListChangeHandler;
        }
示例#9
0
 public FormMain(
     VgcApis.Models.IServices.IServersService vgcServers,
     Services.Settings settings,
     Services.LuaServer luaServer)
 {
     this.vgcServers = vgcServers;
     this.settings   = settings;
     this.luaServer  = luaServer;
     InitializeComponent();
     VgcApis.Libs.UI.AutoSetFormIcon(this);
     this.Text = Properties.Resources.Name + " v" + Properties.Resources.Version;
 }
示例#10
0
        public static FormMain CreateForm(
            Services.Settings settings,
            Services.LuaServer luaServer,
            Services.FormMgrSvc formMgr)
        {
            FormMain r = null;

            VgcApis.Misc.UI.Invoke(() =>
            {
                r = new FormMain(settings, luaServer, formMgr);
            });
            return(r);
        }
示例#11
0
        FormMain(
            Services.Settings settings,
            Services.LuaServer luaServer,
            Services.FormMgrSvc formMgr)
        {
            this.settings  = settings;
            this.luaServer = luaServer;
            this.formMgr   = formMgr;

            InitializeComponent();
            VgcApis.Misc.UI.AutoSetFormIcon(this);
            this.Text = string.Format(I18N.LunaScrMgr, Properties.Resources.Version);
        }
示例#12
0
        public void Run(
            Services.LuaServer luaServer,
            Services.FormMgrSvc formMgrSvc)
        {
            this.luaServer  = luaServer;
            this.formMgrSvc = formMgrSvc;

            BindControlsEvent(luaServer);
            BindFlyPanelDragDropEvent();

            RefreshFlyPanel();
            luaServer.OnRequireFlyPanelUpdate += OnLuaCoreCtrlListChangeHandler;
        }
示例#13
0
 FormMain(
     VgcApis.Interfaces.Services.IApiService api,
     Services.Settings settings,
     Services.LuaServer luaServer,
     Services.FormMgr formMgr)
 {
     this.api       = api;
     this.formMgr   = formMgr;
     this.settings  = settings;
     this.luaServer = luaServer;
     InitializeComponent();
     VgcApis.Misc.UI.AutoSetFormIcon(this);
     this.Text = Properties.Resources.Name + " v" + Properties.Resources.Version;
 }
示例#14
0
        public static FormMain CreateForm(
            VgcApis.Interfaces.Services.IApiService api,
            Services.Settings settings,
            Services.LuaServer luaServer,
            Services.FormMgr formMgr)
        {
            FormMain r = null;

            VgcApis.Misc.UI.Invoke(() =>
            {
                r = new FormMain(api, settings, luaServer, formMgr);
            });
            return(r);
        }
示例#15
0
        public void Reload(
            Services.LuaServer luaServerSvc,
            Services.FormMgrSvc formMgrSvc,

            Controllers.LuaCoreCtrl luaCoreCtrl)
        {
            this.luaServerSvc = luaServerSvc;
            this.formMgrSvc   = formMgrSvc;

            var org = this.luaCoreCtrl;

            this.luaCoreCtrl = luaCoreCtrl;
            ReleaseEvent(org);
            BindEvent(luaCoreCtrl);
            UpdateUiLater();
        }
示例#16
0
        public void Run(
            VgcApis.Interfaces.Services.IApiService api,
            Services.Settings settings,
            Services.LuaServer luaServer)
        {
            this.settings    = settings;
            this.luaServer   = luaServer;
            this.luaCoreCtrl = CreateLuaCoreCtrl(settings, api);

            InitControls();
            BindEvents();

            ReloadScriptName();

            repaintCtrl = new VgcApis.Libs.Views.RepaintCtrl(rtboxOutput);
            logUpdater.Run();
        }
示例#17
0
        public static FormEditor CreateForm(
            VgcApis.Interfaces.Services.IApiService api,
            Services.Settings settings,
            Services.LuaServer luaServer,
            Services.FormMgrSvc formMgr,

            Models.Data.LuaCoreSetting initialCoreSettings)
        {
            FormEditor r = null;

            VgcApis.Misc.UI.Invoke(() =>
            {
                r = new FormEditor(
                    api, settings, luaServer, formMgr,

                    initialCoreSettings);
            });
            return(r);
        }
示例#18
0
        private void BindEvents(Services.LuaServer luaServer)
        {
            btnStopAll.Click += (s, a) =>
            {
                var ctrls = luaServer.GetAllLuaCoreCtrls();
                foreach (var c in ctrls)
                {
                    c.Stop();
                }
            };

            btnKillAll.Click += (s, a) =>
            {
                var ctrls = luaServer.GetAllLuaCoreCtrls();
                foreach (var c in ctrls)
                {
                    c.Kill();
                }
            };
        }
示例#19
0
        FormEditor(
            VgcApis.Interfaces.Services.IApiService api,
            Services.Settings settings,
            Services.LuaServer luaServer,
            Services.FormMgrSvc formMgr,

            Models.Data.LuaCoreSetting initialCoreSettings)
        {
            this.api                 = api;
            this.formMgr             = formMgr;
            this.initialCoreSettings = initialCoreSettings;

            this.settings  = settings;
            this.luaServer = luaServer;

            InitializeComponent();
            VgcApis.Misc.UI.AutoSetFormIcon(this);
            title = string.Format(I18N.LunaScrEditor, Properties.Resources.Version);

            editor    = Misc.UI.CreateLuaEditor(pnlScriptEditor);
            this.Text = title;
        }
示例#20
0
        public void Run(
            VgcApis.Interfaces.Services.IApiService api,
            Services.Settings settings,
            Services.LuaServer luaServer)
        {
            this.settings    = settings;
            this.luaServer   = luaServer;
            this.luaCoreCtrl = CreateLuaCoreCtrl(settings, api);

            InitControls();
            BindEvents();
            ReloadScriptName();

            rtboxFreezer = new VgcApis.Libs.Views.RepaintController(rtboxOutput);
            logUpdater.Run();

#if DEBUG
            if (cboxScriptName.Items.Count > 0)
            {
                cboxScriptName.SelectedIndex = 0;
            }
#endif
        }
示例#21
0
        private void BindEvents(Services.LuaServer luaServer)
        {
            btnDelAll.Click += (s, a) =>
            {
                if (!VgcApis.Misc.UI.Confirm(I18N.ConfirmDeleteAllScripts))
                {
                    return;
                }
                luaServer.RemoveAllScripts();
            };

            btnImport.Click += (s, a) =>
            {
                try
                {
                    var serializedScripts = VgcApis.Misc.UI.ReadFileContentFromDialog(
                        VgcApis.Models.Consts.Files.TxtExt);

                    // cancelle by user
                    if (serializedScripts == null)
                    {
                        return;
                    }

                    var scripts = JsonConvert.DeserializeObject <List <string[]> >(serializedScripts);
                    if (scripts != null && scripts.Count > 0)
                    {
                        luaServer.ImportScripts(scripts);
                        MessageBox.Show(I18N.ImportScriptsSuccess);
                        return;
                    }
                }
                catch { }
                MessageBox.Show(I18N.ImportScriptsFail);
            };

            btnExport.Click += (s, a) =>
            {
                try
                {
                    var scripts           = luaServer.GetAllScripts();
                    var serializedScripts = JsonConvert.SerializeObject(scripts);
                    VgcApis.Misc.UI.SaveToFile(VgcApis.Models.Consts.Files.TxtExt, serializedScripts);
                }
                catch
                {
                    MessageBox.Show(I18N.ExportScriptsFail);
                }
            };

            btnStopAll.Click += (s, a) =>
            {
                var ctrls = luaServer.GetAllLuaCoreCtrls();
                foreach (var c in ctrls)
                {
                    c.Stop();
                }
            };

            btnKillAll.Click += (s, a) =>
            {
                var ctrls = luaServer.GetAllLuaCoreCtrls();
                foreach (var c in ctrls)
                {
                    c.Abort();
                }
            };
        }