private void Initialize() { Instance = this; InitializeComponent(); Kernel.Init(KernelLoadDirective.ShadowPlugins); Logger.ReportVerbose("======= Kernel intialized. Building window..."); commonConfig = Kernel.Instance.CommonConfigData; PopUpMsg = new PopupMsg(alertText); //Logger.ReportVerbose("======= Loading combo boxes..."); lblVersion.Content = lblVersion2.Content = "Version " + Kernel.Instance.VersionStr; //Logger.ReportVerbose("======= Refreshing Ext Players..."); RefreshPlayers(); //Logger.ReportVerbose("======= Loading Config Settings..."); LoadConfigurationSettings(); //Logger.ReportVerbose("======= Config Settings Loaded."); for (char c = 'D'; c <= 'Z'; c++) { daemonToolsDrive.Items.Add(c.ToString()); } try { daemonToolsDrive.SelectedValue = commonConfig.DaemonToolsDrive; } catch { // someone bodged up the config } //daemonToolsLocation.Content = config.DaemonToolsLocation; /// old daemonToolsLocation.Text = commonConfig.DaemonToolsLocation; //Logger.ReportVerbose("======= Refreshing Extender Formats..."); RefreshExtenderFormats(); //Logger.ReportVerbose("======= Refreshing Display Settings..."); RefreshDisplaySettings(); //Logger.ReportVerbose("======= Saving Config..."); SaveConfig(); //Logger.ReportVerbose("======= Initialize Finised."); }
void OpenPopup(PopupMsg msg) { popup.SetActive(true); if (msg.OnClick != null) { commonButton.onClick.RemoveAllListeners(); commonButton.onClick.AddListener(() => msg.OnClick()); commonButton.onClick.AddListener(ClosePopup); var buttonText = commonButton.GetComponentInChildren <Text>(); buttonText.text = msg.ButtonMessage; commonButton.gameObject.SetActive(true); } else { commonButton.gameObject.SetActive(false); DOVirtual.DelayedCall(2f, ClosePopup); } debugText.gameObject.SetActive(true); debugText.text = msg.Message; }
private void Initialize() { Instance = this; InitializeComponent(); Kernel.Init(KernelLoadDirective.ShadowPlugins); if (!Kernel.ServerConnected) { Async.Queue("error", () => MessageBox.Show("Cannot connect to the MB3 server. Please start it or configure address.", "Cannot find server")); // Hide plug-in tab because we can't get to them plugins.Visibility = Visibility.Collapsed; } else { var user = Kernel.AvailableUsers.OrderBy(u => u.Name).FirstOrDefault(); Kernel.CurrentUser = new User { Name = user.Name, Id = new Guid(user.Id ?? ""), Dto = user, ParentalAllowed = user.HasPassword }; } //Kernel.Instance.LoadUserConfig(); Kernel.Instance.LoadPlugins(); Logger.ReportVerbose("======= Kernel intialized. Building window..."); commonConfig = Kernel.Instance.CommonConfigData; pluginList.MouseDoubleClick += pluginList_DoubleClicked; PopUpMsg = new PopupMsg(alertText); //config = Kernel.Instance.ConfigData; //Logger.ReportVerbose("======= Loading combo boxes..."); LoadComboBoxes(); lblVersion.Content = lblVersion2.Content = "Version " + Kernel.Instance.VersionStr; //Logger.ReportVerbose("======= Refreshing Ext Players..."); RefreshPlayers(); //Logger.ReportVerbose("======= Loading Config Settings..."); LoadConfigurationSettings(); //Logger.ReportVerbose("======= Config Settings Loaded."); for (char c = 'D'; c <= 'Z'; c++) { daemonToolsDrive.Items.Add(c.ToString()); } try { daemonToolsDrive.SelectedValue = commonConfig.DaemonToolsDrive; } catch { // someone bodged up the config } //daemonToolsLocation.Content = config.DaemonToolsLocation; /// old daemonToolsLocation.Text = commonConfig.DaemonToolsLocation; //Logger.ReportVerbose("======= Refreshing Extender Formats..."); RefreshExtenderFormats(); //Logger.ReportVerbose("======= Refreshing Display Settings..."); RefreshDisplaySettings(); //Logger.ReportVerbose("======= Saving Config..."); SaveConfig(); LoadAvailablePlugins(); //Logger.ReportVerbose("======= Initialize Finised."); }