private void buttonShortcut_Click(object sender, EventArgs e) { if (!_MacroNameValid) { return; } string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string macroName = MacroName; string shortcutPath = Path.Combine(desktopPath, String.Format("Macro - {0}.lnk", macroName)); ShellShortcut shortcut = new ShellShortcut(shortcutPath); string translatorFolder = SystemRegistry.GetInstallFolder(); if (translatorFolder == null) { translatorFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); } shortcut.Arguments = String.Format("-MACRO \"{0}\"", macroName); shortcut.Description = "Launch Macro: " + macroName; shortcut.Path = Path.Combine(translatorFolder, "Translator.exe"); shortcut.WorkingDirectory = translatorFolder; //shortcut.WindowStyle = ProcessWindowStyle.Normal; shortcut.Save(); }
private void LoadSettings() { try { _autoRun = SystemRegistry.GetAutoRun("Media Center Blaster"); } catch (Exception ex) { IrssLog.Error(ex); _autoRun = false; } try { XmlDocument doc = new XmlDocument(); doc.Load(ConfigurationFile); _serverHost = doc.DocumentElement.Attributes["ServerHost"].Value; } catch (FileNotFoundException) { IrssLog.Warn("Configuration file not found, using defaults"); CreateDefaultSettings(); } catch (Exception ex) { IrssLog.Error(ex); CreateDefaultSettings(); } }
protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); _gs = registry.GetSystem <GraphicsSystem>(); _sls = registry.GetSystem <SceneLoaderSystem>(); _as = registry.GetSystem <AssetSystem>(); }
private void FormMain_Load(object sender, EventArgs e) { List <string> networkPCs = Network.GetComputers(false); if (networkPCs == null) { MessageBox.Show(this, "No server names detected.", "Network Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); return; } else { comboBoxComputer.Items.Add("localhost"); comboBoxComputer.Items.AddRange(networkPCs.ToArray()); } _irBlastLocation = SystemRegistry.GetInstallFolder(); if (String.IsNullOrEmpty(_irBlastLocation)) { MessageBox.Show(this, "IR Server Suite install location not found, please re-install IR Server Suite", "Application Location Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); return; } }
protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); _ballState = GameObject.GetComponent <BallState>(); _audioSource = new AudioSourceComponent(); GameObject.AddComponent(_audioSource); _audioSource.AudioClip = new AssetRef <WaveFile>("Audio/BoostNoise.wav"); _audioSource.Gain = 4.0f; var shs = registry.GetSystem <SynchronizationHelperSystem>(); Task.Run(() => { var particleChildPrefab = registry.GetSystem <AssetSystem>().Database.LoadAsset <SerializedPrefab>("Prefabs/LinearBoostParticles.prefab", false); var particleChild = particleChildPrefab.Instantiate(registry.GetSystem <GameObjectQuerySystem>()); var transformFollow = new TransformFollow() { Target = Transform }; particleChild.AddComponent(transformFollow); _childParticleSystem = particleChild.GetComponent <ParticleSystem>(); }); _currentAvailableBoosts = MaxBoosts; }
protected override void Start(SystemRegistry registry) { _physics = registry.GetSystem <PhysicsSystem>(); _gs = registry.GetSystem <GraphicsSystem>(); _input = registry.GetSystem <InputSystem>(); _time = (float)Math.PI / 2f; }
public PresetSystem(SystemRegistry systemRegistry) { systemRegistry.RegisterSingleNode <CreateByRankConfigComponent>(); systemRegistry.RegisterSingleNode <ItemsBuyCountLimitComponent>(); systemRegistry.RegisterSingleNode <FirstBuySaleComponent>(); systemRegistry.RegisterSingleNode <CreatedByRankItemComponent>(); }
protected override void Attached(SystemRegistry registry) { _as = registry.GetSystem <AssetSystem>(); _meshData = _as.Database.LoadAsset <MeshData>(_meshAsset.ID); _textureData = _as.Database.LoadAsset <ImageSharpTexture>(_textureAsset.ID); _transform = GameObject.Transform; _centeredBounds = _meshData.GetBoundingBox(); _objectCenter = _centeredBounds.GetCenter(); // _gs.ExecuteOnMainThread(() => // { // InitializeContextObjects(_gs.Context, _gs.MaterialCache, _gs.BufferCache); // }); // _gs = registry.GetSystem<GraphicsSystem>(); // _ad = registry.GetSystem<AssetSystem>().Database; // _texstture = Texture.Get(_ad); // _mesh = Mesh.Get(_ad); // _centeredBoundingSphere = _mesh.GetBoundingSphere(); // _centeredBoundingBox = _mesh.GetBoundingBox(); // _gs.ExecuteOnMainThread(() => // { // InitializeContextObjects(_gs.Context, _gs.MaterialCache, _gs.BufferCache); // }); }
public override void Execute(string args2, SystemRegistry registry) { string[] args = args2.Split(' '); Process p = new Process() { StartInfo = new ProcessStartInfo(args[0], string.Join(" ", args.Skip(1))) { RedirectStandardOutput = true } }; try { p.Start(); Task.Run(() => { while (!p.StandardOutput.EndOfStream) { string output = p.StandardOutput.ReadLine(); Print(output); } }); } catch (Exception e) { Print("Error starting process"); Print(e.ToString()); } }
protected override void Start(SystemRegistry registry) { _levelLoadTrigger = GameObject.GetComponent <LevelLoadTrigger>(); _levelLoadTrigger.LevelLoadTriggered += OnLevelLoadTriggered; _goqs = registry.GetSystem <GameObjectQuerySystem>(); _sls = registry.GetSystem <SceneLoaderSystem>(); }
protected override void Start(SystemRegistry registry) { _collider = GameObject.GetComponent <Collider>(); _rollSource = GameObject.GetComponent <AudioSourceComponent>(); _thudSource = new AudioSourceComponent(); _thudSource.AudioClip = ThudClip; GameObject.AddComponent(_thudSource); }
protected override void PostAttached(SystemRegistry registry) { _gs = registry.GetSystem <GraphicsSystem>(); _ad = registry.GetSystem <AssetSystem>().Database; _texture = Texture.Get(_ad); _cameraDistanceComparer = new CameraDistanceComparer(_gs); _gs.ExecuteOnMainThread(() => InitializeContextObjects(_gs.Context, _gs.MaterialCache, _gs.BufferCache)); }
protected override void PostAttached(SystemRegistry registry) { _as = registry.GetSystem <AssetSystem>(); if (_mesh.GetRef() != null) { SetEntity(CreateEntity()); } }
protected override void Attached(SystemRegistry registry) { _gs = registry.GetSystem <GraphicsSystem>(); _as = registry.GetSystem <AssetSystem>(); var ad = _as.Database; RecreateCubemapTexture(); _gs.ExecuteOnMainThread(() => InitializeContextObjects(ad, _gs.Context)); }
/// <summary> /// Get a list of commands found in the Command Libraries. /// </summary> /// <returns>Available commands.</returns> public static Type[] GetLibraryCommands() { try { List <Type> commands = new List <Type>(); string installFolder = SystemRegistry.GetInstallFolder(); if (String.IsNullOrEmpty(installFolder)) { return(null); } string folder = Path.Combine(installFolder, "Commands"); string[] files = Directory.GetFiles(folder, "*.dll", SearchOption.TopDirectoryOnly); foreach (string file in files) { try { Assembly assembly = Assembly.LoadFrom(file); Type[] types = assembly.GetExportedTypes(); foreach (Type type in types) { if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(Command))) { commands.Add(type); } } } catch (BadImageFormatException) { // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins } catch (TypeLoadException) { // Ignore Type Load Exceptions, just keep checking for IR Server Plugins } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Command Error"); } } return(commands.ToArray()); } #if TRACE catch (Exception ex) { Trace.WriteLine(ex.ToString()); #else catch { #endif return(null); } }
public override void Execute(string args, SystemRegistry registry) { var topLevelGOs = registry.GetSystem <GameObjectQuerySystem>().GetUnparentedGameObjects(); foreach (var go in topLevelGOs) { PrintGo(go, 0); } }
protected override void Removed(SystemRegistry registry) { _vb?.Dispose(); _ib?.Dispose(); _material?.Dispose(); _rasterizerState?.Dispose(); _cubemapBinding?.Dispose(); _cubemapBinding?.BoundTexture?.Dispose(); }
protected override void Attached(SystemRegistry registry) { _physics = registry.GetSystem <PhysicsSystem>(); Controller = new BEPUphysics.Character.CharacterController( Transform.Position, jumpSpeed: 8f, tractionForce: 1500 ); }
private void checkBoxAutoRun_CheckedChanged(object sender, EventArgs e) { if (checkBoxAutoRun.Checked) { SystemRegistry.SetAutoRun("Media Center Blaster", Application.ExecutablePath); } else { SystemRegistry.RemoveAutoRun("Media Center Blaster"); } }
protected override void Start(SystemRegistry registry) { _particleSystem = GameObject.GetComponent <ParticleSystem>(); Collider collider = GameObject.GetComponent <Collider>(); if (collider == null) { throw new InvalidOperationException("No collider on magnet " + GameObject.Name); } collider.Layer = registry.GetSystem <PhysicsSystem>().GetLayerByName("Magnet"); }
private void SaveSettings() { try { if (_autoRun) { SystemRegistry.SetAutoRun("Tray Launcher", Application.ExecutablePath); } else { SystemRegistry.RemoveAutoRun("Tray Launcher"); } } catch (Exception ex) { IrssLog.Error(ex); } try { Directory.CreateDirectory(ConfigurationDir); } catch (Exception ex) { IrssLog.Error(ex); } try { using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) { writer.Formatting = Formatting.Indented; writer.Indentation = 1; writer.IndentChar = (char)9; writer.WriteStartDocument(true); writer.WriteStartElement("settings"); // <settings> writer.WriteAttributeString("ServerHost", _serverHost); writer.WriteAttributeString("ProgramFile", _programFile); writer.WriteAttributeString("LaunchOnLoad", _launchOnLoad.ToString()); writer.WriteAttributeString("OneInstanceOnly", _oneInstanceOnly.ToString()); writer.WriteAttributeString("RepeatsFocus", _repeatsFocus.ToString()); writer.WriteAttributeString("LaunchKeyCode", _launchKeyCode); writer.WriteEndElement(); // </settings> writer.WriteEndDocument(); } } catch (Exception ex) { IrssLog.Error(ex); } }
protected unsafe override void Start(SystemRegistry registry) { _assetSystem = registry.GetSystem <AssetSystem>(); _sls = registry.GetSystem <SceneLoaderSystem>(); _gs = registry.GetSystem <GraphicsSystem>(); _audioSource = GameObject.GetComponent <AudioSourceComponent>(); LoadFont(); _gs.ImGuiRenderer.RecreateFontDeviceTexture(_gs.Context); _allScenes = _assetSystem.Database.GetAssetsOfType(typeof(SceneAsset)); }
public override void Execute(string args, SystemRegistry registry) { var options = registry.GetSystem <ConsoleCommandSystem>()._commandOptions; Print("Availiable commands:"); foreach (var option in options) { string name = option.Names.Last(); var aliases = option.Names.Take(option.Names.Length - 1); Print($" {name}, ({string.Join(", ", aliases)})"); } }
protected override void Attached(SystemRegistry registry) { _gs = registry.GetSystem <GraphicsSystem>(); _ad = registry.GetSystem <AssetSystem>().Database; _texture = Texture.Get(_ad); _mesh = Mesh.Get(_ad); _centeredBoundingSphere = _mesh.GetBoundingSphere(); _centeredBoundingBox = _mesh.GetBoundingBox(); _gs.ExecuteOnMainThread(() => { InitializeContextObjects(_gs.Context, _gs.MaterialCache, _gs.BufferCache); }); }
private void buttonKeyHelp_Click(object sender, EventArgs e) { try { string file = Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); Help.ShowHelp(this, file, HelpNavigator.Topic, "Common\\keystrokes_info.html"); } catch (Exception ex) { IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttonHelp_Click(object sender, EventArgs e) { try { string file = Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); Help.ShowHelp(this, file, HelpNavigator.Topic, "Plugins\\TV3 Blaster Plugin\\index.html"); } catch (Exception ex) { Log.Error(ex.ToString()); MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected override void Attached(SystemRegistry registry) { _assetSystem = registry.GetSystem <AssetSystem>(); _audioSystem = registry.GetSystem <AudioSystem>(); _source = _audioSystem.Engine.ResourceFactory.CreateAudioSource(); OnTransformChanged(Transform); _source.Gain = _gain; _source.Looping = Looping; if (_clipRef != null && !_clipRef.ID.IsEmpty) { GetBufferForRef(); } }
private void toolStripMenuItemHelp_Click(object sender, EventArgs e) { try { string file = Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); Help.ShowHelp(this, file, HelpNavigator.Topic, "Virtual Remote\\index.html"); } catch (Exception ex) { IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected override void Start(SystemRegistry registry) { _input = registry.GetSystem <InputSystem>(); _goqs = registry.GetSystem <GameObjectQuerySystem>(); _gs = registry.GetSystem <GraphicsSystem>(); _physics = registry.GetSystem <PhysicsSystem>(); _ball = _goqs.FindByName(BallName); if (_ball == null) { throw new InvalidOperationException("No Ball found in scene with name " + BallName); } _ballCollider = _ball.GetComponent <Collider>(); _ballState = _ball.GetComponent <BallState>(); }
protected override void Start(SystemRegistry registry) { GameObject.RemoveComponent(this); _ccs = registry.GetSystem <ConsoleCommandSystem>(); if (_ccs != null) { _ccs.Print += AddLine; _gs = registry.GetSystem <GraphicsSystem>(); _input = registry.GetSystem <InputSystem>(); } else { Enabled = false; } }