void Start() { startupManager = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent <StartupManager> (); port = startupManager.twoCatSettings.localPort; InvokeRepeating ( "SendUDPMessage", 0, 5 ); PrepareUDPMessage ( "UMP is Running" ); }
public override void Open() { try { StartupManager.OpenStartupEntryLocations(new[] { Entry }); } catch (Exception ex) { PremadeDialogs.GenericError(ex); } }
private void openLinkLocationToolStripMenuItem_Click(object sender, EventArgs e) { try { StartupManager.OpenStartupEntryLocations(Selection); } catch (Exception ex) { PremadeDialogs.GenericError(ex); } }
private async void OnCancelDownload() { if (IsSkipping) { return; } IsSkipping = true; StartupManager.CancelDataUpdate(); await FinishAndNavigateAsync(); }
/// <summary> /// Asynchronously initializes startup flow /// </summary> public async void StartAsync(StartupManager sm) { var startupResults = await sm.ManageStartupAsync(); StartupManagerExitCode = startupResults; switch (startupResults) { case StartupManagerExitCode.Success: StatusNotifier.Print("Starting..."); break; case StartupManagerExitCode.UpdateFailedButNotRequired: StatusNotifier.Print("Update not currently possible, starting installed version..."); break; case StartupManagerExitCode.UpdateRequiredButFailed: // Configuration requires to make sure app is always most recent StatusNotifier.Print("Update not possible. Application cannot be started."); StatusNotifier.IsTryAgainVisible = true; MessageBox.Show( messageBoxText: "Application could not be started. Check your network and try again.", caption: "Application not started", button: MessageBoxButton.OK, icon: MessageBoxImage.Error); break; case StartupManagerExitCode.InstallationFailed: StatusNotifier.Print("Installation failed. Application cannot be started."); StatusNotifier.IsTryAgainVisible = true; MessageBox.Show( messageBoxText: "Application could not be installed. Check your network and try again.", caption: "Application not started", button: MessageBoxButton.OK, icon: MessageBoxImage.Error); break; default: break; } if (ConfigurationProvider.IsLoggerOn) { Logger.DumpToFile(); } // close if (startupResults == StartupManagerExitCode.Success || startupResults == StartupManagerExitCode.UpdateFailedButNotRequired) { StartupManager.StartProcess(ConfigurationProvider); CloseWithDelayAsync(2000); } }
protected override void Load(ContainerBuilder builder) { builder.RegisterInstance(_log) .As <ILog>() .SingleInstance(); builder.RegisterInstance(_console) .As <IConsole>() .SingleInstance(); builder.RegisterType <HealthService>() .As <IHealthService>() .SingleInstance(); var startupManager = new StartupManager(); builder.RegisterInstance(startupManager) .As <IStartupManager>() .SingleInstance(); builder.RegisterType <ShutdownManager>() .As <IShutdownManager>() .SingleInstance(); builder.RegisterResourcesMonitoring(_log); builder.RegisterType <DiskWorker>() .As <IDiskWorker>() .AsSelf() //.AutoActivate() .SingleInstance(); startupManager.Register(typeof(DiskWorker)); builder.RegisterType <DataProcessor>() .As <IDataProcessor>() .AsSelf() //.AutoActivate() .SingleInstance() .WithParameter(TypedParameter.From(_settings.DiskPath)) .WithParameter("diskPath", _settings.DiskPath) .WithParameter("warningSizeInGigabytes", _settings.WarningSizeInGigabytes) .WithParameter("maxSizeInGigabytes", _settings.MaxSizeInGigabytes); startupManager.Register(typeof(DataProcessor)); builder.RegisterType <OrderbookSubscriber>() .AsSelf() //.AutoActivate() .SingleInstance() .WithParameter("connectionString", _settings.Rabbit.ConnectionString) .WithParameter("exchangeName", _settings.Rabbit.ExchangeName); startupManager.Register(typeof(OrderbookSubscriber)); }
public override void LoadSettings(DownDetectorSettings settings) { intervalTimeSpanPicker.Value = settings.Interval; unstableIntervalTimeSpanPicker.Value = settings.UnstableInterval; displayCountNumericUpDown.Value = settings.MaximumDisplayItems; showNotificationsCheckBox.Checked = settings.ShowNotifications; startWithWindowsCheckBox.Checked = StartupManager.IsRegisteredForStartup(); showMenuItemsCheckBox.Checked = settings.ShowDisplayItems; offlineOnlyCheckBox.Checked = settings.ShowOfflineItemsOnly; maximumRedirectsNumericUpDown.Value = settings.MaximumRedirects; logDatesAsUtcCheckBox.Checked = settings.LogDatesAsUtc; base.LoadSettings(settings); }
public ServiceProvider Configure() { var services = new ServiceCollection(); //var configuration = StartupManager.GetRequiredJsonConfiguration("appsettings.json"); var configuration = StartupManager.GetConfiguration(); //var appSettings = services.ConfigureAndValidateOptionsDataAnnotations<ConsoleAppSettings>(configuration); var appSettings = services.ConfigureSettings <FunctionAppSettings>(configuration); services.AddSingleton <IAppService, AppService>(); return(services.BuildServiceProvider()); }
internal void ReassignStartupEntries(bool refreshListView, IEnumerable <StartupEntryBase> items) { // Using DoForEach to avoid multiple enumerations StartupManager.AssignStartupEntries(AllUninstallers .DoForEach(x => { if (x != null) { x.StartupEntries = null; } }), items); if (refreshListView) { RefreshList(); } }
private void ReloadItems(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; if (listView1.Items.Count < 1) { listView1.Items.Add(Localisation.StartupManager_Loading); listView1.Update(); } SelectionChanged(sender, e); listView1.BeginUpdate(); AllItems = StartupManager.GetAllStartupItems().ToList(); // Get icons if (listView1.SmallImageList == null) { listView1.SmallImageList = new ImageList(); } listView1.SmallImageList.Images.Clear(); listView1.SmallImageList.Images.Add(SystemIcons.Warning); foreach (var entry in AllItems) { try { if (entry.CommandFilePath != null && !listView1.SmallImageList.Images.ContainsKey(entry.ProgramName) && File.Exists(entry.CommandFilePath)) { var icon = Icon.ExtractAssociatedIcon(entry.CommandFilePath); if (icon != null) { listView1.SmallImageList.Images.Add(entry.ProgramName, icon); } } } catch { // Ignore failed icon gets } } UpdateList(false); listView1.EndUpdate(); Cursor = Cursors.Default; }
private async Task DownloadAsync() { try { await StartupManager.SyndDataAsync(); await Task.Delay(1000); // makes sure the animation completes before navigating to the dashboard } catch (Exception) { } finally { if (!IsSkipping) { await FinishAndNavigateAsync(); } } }
static void Main(string[] args) { Logger.OnStartup(); StartupManager.Initialize(Assembly.GetExecutingAssembly()); checkChampList(); if (args.Length == 0) { HandleCommand(string.Empty); } else { HandleCommand(args[0]); } Console.Read(); }
void Start() { startupManager = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent<StartupManager> (); musicViewer = GameObject.FindGameObjectWithTag ( "MusicViewer" ).GetComponent<MusicViewer> (); leftAudioOutput = new float[numSamples]; rightAudioOutput = new float[numSamples]; leftSpectrum = new float[numSamples]; rightSpectrum = new float[numSamples]; leftFCur = new float [numSamples]; rightFCur = new float [numSamples]; leftFMax = new float [numSamples]; rightFMax = new float [numSamples]; topLeftLine.SetVertexCount ( numSamples ); bottomLeftLine.SetVertexCount ( numSamples ); topRightLine.SetVertexCount ( numSamples ); bottomRightLine.SetVertexCount ( numSamples ); }
private void UpdateStartupSetting() { try { if (StartupManager.IsRegisteredForStartup() != startWithWindowsCheckBox.Checked) { if (startWithWindowsCheckBox.Checked) { StartupManager.RegisterStartupApplication(); } else { StartupManager.UnregisterStartupApplication(); } } } catch (Exception ex) { MessageBox.Show(string.Format("Failed to process startup changes. {0}", ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
static void Main(string[] args) { SSyncCore.OnProtocolLoaded += SSyncCore_OnProtocolLoaded; SSyncCore.Initialize(Assembly.GetAssembly(typeof(ChatRequestMessage)), Assembly.GetExecutingAssembly()); StartupManager.OnItemLoading += StartupManager_OnItemLoaded; StartupManager.OnStartupEnded += StartupManager_OnStartupEnded; StartupManager.Initialize(Assembly.GetExecutingAssembly()); SSyncServer serv = new SSyncServer("127.0.0.1", 500); serv.OnClientConnected += serv_OnSocketAccepted; serv.Start(); loop: string str = Console.ReadLine(); Clients.ForEach(x => x.Send(new ChatMessage(str))); Console.WriteLine(str + " Sended to clients"); goto loop; }
void Start() { startupManager = GameObject.FindGameObjectWithTag("StartupManager").GetComponent <StartupManager> (); guiManager = GameObject.FindGameObjectWithTag("GUIManager").GetComponent <GUIManager> (); if (!Directory.Exists(startupManager.parentFolder + Path.DirectorySeparatorChar + "Novels")) { Directory.CreateDirectory(startupManager.parentFolder + Path.DirectorySeparatorChar + "Novels"); UnityEngine.Debug.Log("Directory does not exist!"); } if (Directory.Exists(startupManager.parentFolder + Path.DirectorySeparatorChar + "Novels")) { foreach (string directory in Directory.GetDirectories(startupManager.parentFolder + Path.DirectorySeparatorChar + "Novels")) { if (File.Exists(directory + Path.DirectorySeparatorChar + "Info.txt")) { Novel tempNovel = new Novel(); tempNovel.location = directory.ToString(); using (StreamReader reader = new StreamReader(directory + Path.DirectorySeparatorChar + "Info.txt")) { tempNovel.name = reader.ReadLine(); tempNovel.author = reader.ReadLine(); tempNovel.version = reader.ReadLine(); } if (tempNovel.name != null && tempNovel.author != null && tempNovel.version != null && File.Exists(directory + Path.DirectorySeparatorChar + tempNovel.name + ".xml")) { availableNovels.Add(tempNovel); } else { UnityEngine.Debug.Log("Folder not added"); } } } } }
// Use this for initialization void Start() { // There are not object yet. // Data didnt loaded yet. if (_instance == null) { _instance = this; DataPlayer dataPlayer = new DataPlayer(); DataQuests dataQuests = new DataQuests(); DataAd dataAd = new DataAd(); // Load DataPlayer LoadSave.Load(ref dataPlayer); //, DataplayerManager.Instance.NameFile,true); DataplayerManager.Instance.Data = dataPlayer; // Load AdData LoadSave.Load(ref dataAd, AdManager.Instance.NameFile); AdManager.Instance.Data = dataAd; // Load dataQuests LoadSave.Load(ref dataQuests, QuestsManager.Instance.NameFile); QuestsManager.Instance.Data = dataQuests; // Get languege /* Change to next alghorithm: * if not changing language by user * try find witch languege use user and set it to default * catch set english * Now for will be always in default english * Befor change to alghorithm, be sure that font * suppor languages */ LocalizationManager.Instance.SetLanguage("localizedTextEn.json"); // Load scen when all data loaded SceneManager.LoadScene("MainMenu"); } }
public HttpResponseMessage Get() { string errMsg = ""; Model.Startup startup = new Model.Startup(); try { string token = this.ControllerContext.Request.Headers.GetValues("Token").First(); if (TokenManage.CheckAuthorizer(token, PowerStatusCode.None, out errMsg)) { StartupManager.tryFetch(ref startup, out errMsg); } } catch (Exception ex) { errMsg = ex.Message; } var status = HttpStatusCode.OK; string json = ""; if (errMsg.Length > 0) { status = (HttpStatusCode)422; var msg = new { errors = new { ServerSideError = errMsg } }; json = JsonConvert.SerializeObject(msg); } else { status = HttpStatusCode.OK; var msg = new { Startup = startup }; json = JsonConvert.SerializeObject(msg); } return(new HttpResponseMessage(status) { Content = new StringContent(json, System.Text.Encoding.GetEncoding("UTF-8"), "application/json") }); }
void Start() { manager = GameObject.FindGameObjectWithTag ("Manager"); startupManager = manager.GetComponent<StartupManager>(); mediaPath = startupManager.publicMediaPath; prefsLocation = startupManager.prefsLocation; clipList = Directory.GetFiles(mediaPath, "*.wav"); string[] prefs = File.ReadAllLines(prefsLocation); loop = Convert.ToBoolean(prefs[0]); shuffle = Convert.ToBoolean(prefs[1]); continuous = Convert.ToBoolean(prefs[2]); volumeBarValue = Convert.ToSingle(prefs[3]); previousSongs[0] = Convert.ToInt32(prefs[4]); if(previousSongs[0] > clipList.Length) previousSongs[0] = clipList.Length; previousSongs[1] = Convert.ToInt32(prefs[5]); if(previousSongs[1] > clipList.Length) previousSongs[1] = clipList.Length; previousSongs[2] = Convert.ToInt32(prefs[6]); if(previousSongs[2] > clipList.Length) previousSongs[2] = clipList.Length; previousSongs[3] = Convert.ToInt32(prefs[7]); if(previousSongs[3] > clipList.Length) previousSongs[3] = clipList.Length; previousSongs[4] = Convert.ToInt32(prefs[8]); if(previousSongs[4] > clipList.Length) previousSongs[4] = clipList.Length; previousSongs[5] = Convert.ToInt32(prefs[9]); if(previousSongs[5] > clipList.Length) previousSongs[5] = clipList.Length; previousSongs[6] = Convert.ToInt32(prefs[10]); if(previousSongs[6] > clipList.Length) previousSongs[6] = clipList.Length; TextWriter savePrefs = new StreamWriter(prefsLocation); savePrefs.WriteLine(loop + "\n" + shuffle + "\n" + continuous + "\n" + volumeBarValue + "\n" + previousSongs[0] + "\n" + previousSongs[1] + "\n" + previousSongs[2] + "\n" + previousSongs[3] + "\n" + previousSongs[4] + "\n" + previousSongs[5] + "\n" + previousSongs[6]); savePrefs.Close(); InvokeRepeating ("Refresh", 0, 2); }
void Start() { startupManager = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent<StartupManager> (); userInterface = gameObject.GetComponent<ErrorUI>(); writeLogToScreen = startupOnlyWriteToScreen; writeLogToDisk = startupOnlyWriteToDisk; writePath = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent<StartupManager> ().supportPath; if ( writeLogToScreen == true || writeLogToDisk == true ) { debugLogActive = true; } else { debugLogActive = false; } if ( debugLogActive == true ) { if ( writeLogToScreen == true ) { userInterface.enabled = true; } else { userInterface.enabled = false; } log.Add ( "Error Log Active" ); if ( writeLogToDisk == true ) { string writingWarning = "Writing to disk"; if ( String.IsNullOrEmpty ( writePath.Trim ()) == true ) { writingWarning = writingWarning + ", no destination given! Writing to default directory, Desktop."; writePath = Environment.GetFolderPath ( Environment.SpecialFolder.Desktop ); } writePath = writePath + Path.DirectorySeparatorChar + "ErrorLog" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day + ".txt"; //log.Add ( writingWarning ); } } else { UnityEngine.Debug.LogWarning ( "ErrorLog disabled." ); } }
public override void Open() { StartupManager.OpenStartupEntryLocations(new[] { Entry }); }
private void GameLoop() { var t = new Stopwatch(); t.Start(); while (GameState != EGameState.Exit) { // game active if (GameState == EGameState.Running && t.ElapsedMilliseconds >= 100) { t.Restart(); // check input CheckInput(); // move all moveables foreach (var t1 in LevelManager.Moveables) { t1.UpdatePosition(); } // check collisions among all collidables var collisions = CollisionManager.CheckCollision(LevelManager.Collidables); if (collisions != null) { ApplyCollisions(collisions); } // check to see if there are still players playing var playersLeft = false; var playerWon = false; foreach (var go in LevelManager.GameObjects) { if (!(go is IPlayer)) { continue; } playersLeft = true; if (go.Body.Count >= LevelManager.Height * LevelManager.Width) { playerWon = true; } } // end game if no players or player won if (!playersLeft || playerWon) { GameState = EGameState.Over; OnGameStateChangedListener(GameState); } // render all renderables if (GameState == EGameState.Running) { Console.Clear(); foreach (IRenderable t1 in LevelManager.Renderables) { t1.Render(); } } // game initializing } else { switch (GameState) { case EGameState.Init: CheckInput(); break; case EGameState.Over: if (LevelManager.GameOver != null) { LevelManager.GameOver.Render(ScoreManager.GetScore()); } else { Environment.Exit(0); } while (GameState == EGameState.Over) { CheckInput(); } break; case EGameState.Paused: CheckInput(); break; } } } StartupManager.Reset(); }
public void Init(StartupManager startupManager, PlayerManager playerManager, GameData gameData) { _startupManager = startupManager; _playerManager = playerManager; _gameData = gameData; }
private void ToggleSwitch_OnChecked(object sender, RoutedEventArgs e) { StartupManager.SyncStartupKey(); }
private void Form1_Load(object sender, EventArgs e) { bool existsKey = StartupManager.ExistsStartupKey(Program.appName), isAdmin = StartupManager.IsUserAdministrator(); if (!StartupManager.CheckIfRunningUnderVsHost()) { if (!existsKey) { if (isAdmin) { StartupManager.AddApplicationToStartup(Program.appName); } else { StartupManager.RunAsAdmin(); } } } else { Console.WriteLine("Cannot run as an admin in vshost environment!"); } m_GlobalHook = Hook.GlobalEvents(); m_GlobalHook.MouseMoveExt += ExtMouseMoved; m_GlobalHook.KeyDown += ExtKeyPress; /*foreach (var screen in Screen.AllScreens) * { * // For each screen, add the screen properties to a list box. * //listBox1.Items.Add("Device Name: " + screen.DeviceName); * //listBox1.Items.Add("Bounds: " + screen.Bounds.ToString()); * //listBox1.Items.Add("Type: " + screen.GetType().ToString()); * //listBox1.Items.Add("Working Area: " + screen.WorkingArea.ToString()); * //listBox1.Items.Add("Primary Screen: " + screen.Primary.ToString()); * Console.WriteLine("Name: {0}", screen.DeviceName); * Console.WriteLine("Bounds: {0}", screen.Bounds.ToString()); * Console.WriteLine("Working area: {0}", screen.WorkingArea.ToString()); * } * * Console.WriteLine("({0}, {1})", ScreenSize.Width, ScreenSize.Height); * mouse = new int[ScreenSize.Width, ScreenSize.Height];*/ DEVMODE vDevMode = new DEVMODE(); int i = 0; /*while (EnumDisplaySettings(null, i, ref vDevMode)) * { * Console.WriteLine("Width:{0} Height:{1} Color:{2} Frequency:{3}", * vDevMode.dmPelsWidth, * vDevMode.dmPelsHeight, * 1 << vDevMode.dmBitsPerPel, vDevMode.dmDisplayFrequency * ); ++i; * }*/ Timer1.Tick += Timer1_Tick; Timer1.Interval = timerInterval; Timer1.Start(); dpi = GetSystemDpi(); //Console.WriteLine("Screen phys size: " + new Point(SystemInformation.VirtualScreen.Width, SystemInformation.VirtualScreen.Height)); Console.WriteLine("Screen phys size: " + GetScreenPhysicalSize()); Console.WriteLine("DPI: " + dpi); Console.WriteLine("Mouse Speed: " + GetMouseSpeed()); KeysManager.GetPositions(); counting = true; }
public TrayApplicationContext( ILogger<TrayApplicationContext> logger, TrayContextMenuStrip contextMenu, NotifyIconManager notifyIconManager, AppState appState, StartupManager startupManager, ConfigurationUpdater configurationUpdater ) { if (notifyIconManager == null) { throw new ArgumentNullException(nameof(notifyIconManager)); } if (appState == null) { throw new ArgumentNullException(nameof(appState)); } if (startupManager == null) { throw new ArgumentNullException(nameof(startupManager)); } if (configurationUpdater == null) { throw new ArgumentNullException(nameof(configurationUpdater)); } this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.contextMenu = contextMenu ?? throw new ArgumentNullException(nameof(contextMenu)); notifyIconManager.NotifyIcon.ContextMenuStrip = contextMenu; appState.OnMachineStateChange += (object _, MachineStateChangeEventArgs __) => UpdateContextMenu(); appState.OnConfigurationChange += (object _, ConfigurationChangeEventArgs e) => { if (e.NewConfiguration.StartWithWindows != startupManager.IsEnabled()) { if (e.NewConfiguration.StartWithWindows) { startupManager.EnableStartup(); } else { startupManager.DisableStartup(); } } if (e.NewConfiguration.ShowTrayIcon) { notifyIconManager.ShowIcon(); } else { notifyIconManager.HideIcon(); } CreateContextMenu(); }; if (appState.Configuration.ShowTrayIcon) { notifyIconManager.ShowIcon(); } else if (!Program.IsAutoStarting()) { // If the program is not auto-starting and the tray icon is not visible the user launched the // application manually and it was not already running. We will show the configuration under the // assumption they are looking for it. configurationUpdater.ShowConfigurationForm(); } CreateContextMenu(); }
void Start() { manager = GameObject.FindGameObjectWithTag("Manager"); startupManager = manager.GetComponent <StartupManager>(); mediaPath = startupManager.publicMediaPath; prefsLocation = startupManager.prefsLocation; clipList = Directory.GetFiles(mediaPath, "*.wav"); string[] prefs = File.ReadAllLines(prefsLocation); loop = Convert.ToBoolean(prefs[0]); shuffle = Convert.ToBoolean(prefs[1]); continuous = Convert.ToBoolean(prefs[2]); volumeBarValue = Convert.ToSingle(prefs[3]); previousSongs[0] = Convert.ToInt32(prefs[4]); if (previousSongs[0] > clipList.Length) { previousSongs[0] = clipList.Length; } previousSongs[1] = Convert.ToInt32(prefs[5]); if (previousSongs[1] > clipList.Length) { previousSongs[1] = clipList.Length; } previousSongs[2] = Convert.ToInt32(prefs[6]); if (previousSongs[2] > clipList.Length) { previousSongs[2] = clipList.Length; } previousSongs[3] = Convert.ToInt32(prefs[7]); if (previousSongs[3] > clipList.Length) { previousSongs[3] = clipList.Length; } previousSongs[4] = Convert.ToInt32(prefs[8]); if (previousSongs[4] > clipList.Length) { previousSongs[4] = clipList.Length; } previousSongs[5] = Convert.ToInt32(prefs[9]); if (previousSongs[5] > clipList.Length) { previousSongs[5] = clipList.Length; } previousSongs[6] = Convert.ToInt32(prefs[10]); if (previousSongs[6] > clipList.Length) { previousSongs[6] = clipList.Length; } TextWriter savePrefs = new StreamWriter(prefsLocation); savePrefs.WriteLine(loop + "\n" + shuffle + "\n" + continuous + "\n" + volumeBarValue + "\n" + previousSongs[0] + "\n" + previousSongs[1] + "\n" + previousSongs[2] + "\n" + previousSongs[3] + "\n" + previousSongs[4] + "\n" + previousSongs[5] + "\n" + previousSongs[6]); savePrefs.Close(); InvokeRepeating("Refresh", 0, 2); }
void Awake() { Instance = this; }
void Start() { startupManager = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent<StartupManager> (); musicViewer = GameObject.FindGameObjectWithTag ( "MusicViewer" ).GetComponent<MusicViewer> (); paneManager = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent<PaneManager> (); onlineMusicBrowserPosition.width = Screen.width; onlineMusicBrowserPosition.height = Screen.height; onlineMusicBrowserPosition.x = onlineMusicBrowserPosition.width + onlineMusicBrowserPosition.width / 4; labelStyle = new GUIStyle (); labelStyle.alignment = TextAnchor.MiddleCenter; labelStyle.wordWrap = true; infoLabelStyle = new GUIStyle (); infoLabelStyle.alignment = TextAnchor.MiddleLeft; infoLabelStyle.fontSize = 16; sortLabelStyle = new GUIStyle (); sortLabelStyle.alignment = TextAnchor.MiddleRight; sortLabelStyle.fontSize = 16; buttonStyle = new GUIStyle (); buttonStyle.fontSize = 16; buttonStyle.alignment = TextAnchor.MiddleCenter; buttonStyle.border = new RectOffset ( 6, 6, 6, 4 ); buttonStyle.padding = new RectOffset ( 6, 6, 3, 3 ); buttonStyle.hover.background = guiHover; buttonStyle.active.background = guiActiveHover; artworkStyle = new GUIStyle (); artworkStyle.border = new RectOffset ( 6, 6, 6, 6 ); artworkStyle.padding = new RectOffset ( 6, 6, 6, 6 ); artworkStyle.hover.background = guiHover; GUIStyle flagStyle = new GUIStyle (); flagStyle.normal.background = flagNormal; flagStyle.hover.background = flagHover; flagStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle flagStyleActive = new GUIStyle (); flagStyleActive.normal.background = flagOnNormal; flagStyleActive.hover.background = flagOnHover; flagStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle clockStyle = new GUIStyle (); clockStyle.normal.background = clockNormal; clockStyle.hover.background = clockHover; clockStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle clockStyleActive = new GUIStyle (); clockStyleActive.normal.background = clockOnNormal; clockStyleActive.hover.background = clockOnHover; clockStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle textStyle = new GUIStyle (); textStyle.normal.background = textNormal; textStyle.hover.background = textHover; textStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle textStyleActive = new GUIStyle (); textStyleActive.normal.background = textOnNormal; textStyleActive.hover.background = textOnHover; textStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle recordStyle = new GUIStyle (); recordStyle.normal.background = recordNormal; recordStyle.hover.background = recordHover; recordStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle recordStyleActive = new GUIStyle (); recordStyleActive.normal.background = recordOnNormal; recordStyleActive.hover.background = recordOnHover; recordStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle personStyle = new GUIStyle (); personStyle.normal.background = personNormal; personStyle.hover.background = personHover; personStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle personStyleActive = new GUIStyle (); personStyleActive.normal.background = personOnNormal; personStyleActive.hover.background = personOnHover; personStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle listStyle = new GUIStyle (); listStyle.normal.background = listNormal; listStyle.hover.background = listHover; listStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle listStyleActive = new GUIStyle (); listStyleActive.normal.background = listOnNormal; listStyleActive.hover.background = listOnHover; listStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); availableSorts = new List<Sort> () { new Sort ( "Featured", 1, flagStyle, flagStyleActive ), new Sort ( "Recent", 2, clockStyle, clockStyleActive ), new Sort ( "Name", 3, textStyle, textStyleActive ), new Sort ( "Album", 4, recordStyle, recordStyleActive ), new Sort ( "Artist", 5, personStyle, personStyleActive ), new Sort ( "Genre", 6, listStyle, listStyleActive ) }; }
void Start() { manager = GameObject.FindGameObjectWithTag ( "Manager" ); startupManager = manager.GetComponent<StartupManager> (); socketsManager = manager.GetComponent<SocketsManager> (); onlineMusicBrowser = GameObject.FindGameObjectWithTag ( "OnlineMusicBrowser" ).GetComponent <OnlineMusicBrowser>(); paneManager = manager.GetComponent <PaneManager> (); loadingImage = GameObject.FindGameObjectWithTag ( "LoadingImage" ).GetComponent<LoadingImage>(); currentSlideshowImage = GameObject.FindGameObjectWithTag ( "SlideshowImage" ).GetComponent<GUITexture>(); currentSong = GameObject.FindGameObjectWithTag ( "CurrentSong" ).GetComponent<GUIText>(); musicViewerPosition.width = Screen.width; musicViewerPosition.height = Screen.height; bottomBarPosition = new Rect (( musicViewerPosition.width - 240 ) / 2 , musicViewerPosition.height - 18, 240, 54 ); optionsWindowRect.x = musicViewerPosition.width/2 - optionsWindowRect.width/2; optionsWindowRect.y = musicViewerPosition.height/2 - optionsWindowRect.height/2; audioVisualizer = GameObject.FindGameObjectWithTag ("AudioVisualizer").GetComponent<AudioVisualizer> (); timemark = GameObject.FindGameObjectWithTag ( "Timemark" ).GetComponent<GUIText> (); GameObject.FindGameObjectWithTag ( "TimebarImage" ).guiTexture.pixelInset = new Rect ( -musicViewerPosition.width/2, musicViewerPosition.height/2 - 3, musicViewerPosition.width, 6 ); LoadSettings ( false ); centerStyle = new GUIStyle (); centerStyle.alignment = TextAnchor.MiddleCenter; labelStyle = new GUIStyle (); labelStyle.alignment = TextAnchor.MiddleCenter; labelStyle.wordWrap = true; folderStyle = new GUIStyle (); folderStyle.alignment = TextAnchor.MiddleLeft; folderStyle.border = new RectOffset ( 6, 6, 4, 4 ); folderStyle.hover.background = guiSkin.button.hover.background; folderStyle.active.background = guiSkin.button.active.background; folderStyle.fontSize = 22; fileStyle = new GUIStyle (); fileStyle.alignment = TextAnchor.MiddleLeft; fileStyle.border = new RectOffset ( 6, 6, 6, 4 ); fileStyle.padding = new RectOffset ( 6, 6, 3, 3 ); fileStyle.margin = new RectOffset ( 4, 4, 4, 4 ); fileStyle.hover.background = guiSkin.button.hover.background; fileStyle.active.background = guiSkin.button.active.background; fileStyle.fontSize = 22; fileBrowserFileStyle = new GUIStyle (); fileBrowserFileStyle.alignment = TextAnchor.MiddleLeft; currentSongStyle = new GUIStyle (); currentSongStyle.font = secretCode; currentSongStyle.fontSize = 31; songStyle = new GUIStyle (); songStyle.alignment = TextAnchor.MiddleLeft; songStyle.fontSize = 16; buttonStyle = new GUIStyle (); buttonStyle.fontSize = 22; buttonStyle.alignment = TextAnchor.MiddleCenter; buttonStyle.border = new RectOffset ( 6, 6, 6, 4 ); buttonStyle.padding = new RectOffset ( 6, 6, 3, 3 ); buttonStyle.margin = new RectOffset ( 4, 4, 4, 4 ); buttonStyle.hover.background = guiSkin.button.hover.background; hideGUIStyle = new GUIStyle (); hideGUIStyle.normal.background = hideGUINormal; hideGUIStyle.hover.background = hideGUIHover; hideGUIStyle.onNormal.background = hideGUIOnNormal; hideGUIStyle.onHover.background = hideGUIOnHover; showVisualizerStyle = new GUIStyle (); showVisualizerStyle.normal.background = showAudioVisualizerNormal; showVisualizerStyle.hover.background = showAudioVisualizerHover; showVisualizerStyle.onNormal.background = showAudioVisualizerOnNormal; showVisualizerStyle.onHover.background = showAudioVisualizerOnHover; doubleSpeedStyle = new GUIStyle (); doubleSpeedStyle.normal.background = audioSpeedDoubleNormal; doubleSpeedStyle.hover.background = audioSpeedDoubleHover; doubleSpeedStyle.onNormal.background = audioSpeedNormalNormal; doubleSpeedStyle.onHover.background = audioSpeedNormalHover; halfSpeedStyle = new GUIStyle (); halfSpeedStyle.normal.background = audioSpeedHalfNormal; halfSpeedStyle.hover.background = audioSpeedHalfHover; halfSpeedStyle.onNormal.background = audioSpeedNormalNormal; halfSpeedStyle.onHover.background = audioSpeedNormalHover; echoStyle = new GUIStyle (); echoStyle.normal.background = echoNormal; echoStyle.hover.background = echoHover; echoStyle.onNormal.background = echoOnNormal; echoStyle.onHover.background = echoOnHover; InvokeRepeating ( "Refresh", 0, 2 ); StartCoroutine ( SetArtwork ()); }
static void Main(string[] args) { Logger.OnStartup(); StartupManager.Initialize(Assembly.GetExecutingAssembly()); checkChampList(); /* if (args.Length == 0) * HandleCommand(string.Empty); * else * HandleCommand(args[0]); */ BotApi bot = new BotApi(); GameApi game = new GameApi(); Random r = new Random(); /* Process.Start("C:\\Riot Games\\League of Legends\\LeagueClient.exe"); * bot.waitProcessOpen("RiotClientServices"); * * BotHelper.Wait(3000); * * string username = "******"; * string password = "******"; * LoginHandler.Login(username, password); * BotHelper.Wait(3000); * if (TextHelper.TextExists(769, 271, 262, 41, "TERMS OF SERVICE")) * { * Logger.Write("Accept the Terms of Service!"); * for (int i = 0; i < 100; i++) * { * if (ImageHelper.GetColor(816, 739) == "#BC252A") * break; * * InputHelper.LeftClick(1168, 642); * } * InputHelper.LeftClick(816, 739); * } * * bot.waitProcessOpen("LeagueClientUX"); * bot.bringProcessToFront("LeagueClientUX"); * bot.centerProcess("LeagueClientUX"); * * Logger.Write("CLIENT IS OPEN!"); * BotHelper.Wait(10000); * * if (TextHelper.TextExists(725, 425, 500, 50, "What name will you go by in the game?")) * { * TextInfo myTI = new CultureInfo("en-US", false).TextInfo; * string nUsername = myTI.ToTitleCase(username); * Logger.Write("Set Name to " + nUsername + "!"); * InputHelper.LeftClick(750, 540); * InputHelper.InputWords(nUsername); * BotHelper.Wait(3000); * * } * * // 421 220testperitestperi * InputHelper.LeftClick(421, 220); * BotHelper.Wait(r.Next(800, 1300)); * // 464 285 * InputHelper.LeftClick(464, 285); * BotHelper.Wait(r.Next(800, 1300)); * // 765 676 * InputHelper.LeftClick(765, 676); * BotHelper.Wait(r.Next(800, 1300)); * // 824 870 * InputHelper.LeftClick(824, 870); * BotHelper.Wait(r.Next(1000, 1700)); * * InputHelper.LeftClick(824, 870); * Logger.Write("SEARCH MATCH..."); * BotHelper.Wait(r.Next(800, 2000)); * * while(true) * { * TextHelper.WaitForText(827, 555, 267, 36, "MATCH FOUND"); * * InputHelper.LeftClick(960, 741); * Logger.Write("MATCH ACCEPTED!"); * BotHelper.Wait(3000); * * if (TextHelper.TextExists(758, 192, 441, 35, "CHOOSE YOUR CHAMPION!")) * break; * } * * // Search Champion * InputHelper.LeftClick(1095, 258); * BotHelper.Wait(r.Next(800, 1300)); * * InputHelper.InputWords("ezreal"); * BotHelper.Wait(r.Next(800, 1300)); * * // Select Champion * InputHelper.LeftClick(702, 349); * BotHelper.Wait(r.Next(800, 1300)); * * InputHelper.LeftClick(963, 787); * BotHelper.Wait(r.Next(800, 1300)); * * Logger.Write("PICKED CHAMP!"); */ // BotHelper.Wait(95000); string GAME_PROCESS_NAME = "League of Legends"; Logger.Write("process done^TEST"); bot.waitProcessOpen(GAME_PROCESS_NAME); bot.waitUntilProcessBounds(GAME_PROCESS_NAME, 1030, 797); bot.wait(200); bot.bringProcessToFront(GAME_PROCESS_NAME); bot.centerProcess(GAME_PROCESS_NAME); Logger.Write("process done"); game.waitUntilGameStart(); bot.log("We are in game!"); bot.bringProcessToFront(GAME_PROCESS_NAME); bot.centerProcess(GAME_PROCESS_NAME); bot.wait(1000); game.detectSide(); Point CastTargetPoint; if (game.getSide() == SideEnum.Blue) { CastTargetPoint = new Point(1084, 398); bot.log("We are blue side!"); } else { CastTargetPoint = new Point(644, 761); bot.log("We are red side!"); } int allyIndex = 2; bool CreepHasBeenFound = false; bot.wait(1000); game.player.setLevel(0); #region items Item[] items = { new Item("Vampiric Scepter", 900, false, false, 0, game.shop.getItemPosition(ShopItemTypeEnum.Early, 1)), new Item("Long Sword", 350, false, false, 0, game.shop.getItemPosition(ShopItemTypeEnum.Early, 0)), new Item("Berserker's Greaves", 1100, false, false, 0, game.shop.getItemPosition(ShopItemTypeEnum.Essential, 2)), new Item("B.F. Sword", 1300, false, false, 0, game.shop.getItemPosition(ShopItemTypeEnum.Offensive, 1)), new Item("Bloodthirster", 3500, false, false, 0, game.shop.getItemPosition(ShopItemTypeEnum.Offensive, 2)), new Item("B.F. Sword", 1300, false, false, 0, game.shop.getItemPosition(ShopItemTypeEnum.Offensive, 1)), new Item("Infinity Edge", 3400, false, false, 0, game.shop.getItemPosition(ShopItemTypeEnum.Defensive, 2)), new Item("Statikk Shiv", 2600, false, false, 0, game.shop.getItemPosition(ShopItemTypeEnum.Defensive, 0)), new Item("Frozen Mallet", 3100, false, false, 0, game.shop.getItemPosition(ShopItemTypeEnum.Defensive, 1)), }; //if want another itemset, just copy and paste and change SELECTED_CHAMPION_SET value #endregion List <Item> itemsToBuy = new List <Item>(items); game.shop.setItemBuild(itemsToBuy); game.shop.toogle(); bot.wait(1500); bot.wait(1000); game.player.fixItemsInShop(); bot.wait(1000); game.shop.buyItem(1); game.shop.toogle(); bot.wait(3000); game.player.moveNearestBotlaneAllyTower(); while (bot.isProcessOpen(GAME_PROCESS_NAME)) // Game loop { bot.bringProcessToFront(GAME_PROCESS_NAME); bot.centerProcess(GAME_PROCESS_NAME); if (game.player.getCharacterLeveled()) { game.player.increaseLevel(); game.player.upSpells(); //Change order on MainPlayer.cs } int health = game.player.getHealthPercent(); //back base/buy if (health <= 50) { //heal usage if is available if (game.player.isThereAnEnemy()) { game.player.tryCastSpellToCreep(6); } } if (health <= 88) { //heal usage if is available if (game.player.isThereAnEnemy()) { game.player.tryCastSpellToCreep(5); } } if (health <= 25) { //low hp. game.player.moveNearestBotlaneAllyTower(); bot.wait(8000); game.player.backBaseRegenerateAndBuy(); // read gold. game.shop.toogle(); game.shop.tryBuyItem(); game.shop.toogle(); bot.wait(200); game.player.moveNearestBotlaneAllyTower(); bot.wait(6000); //prevent getting stucked by doing it again game.player.moveNearestBotlaneAllyTower(); } //getting attacked by enemy, tower or creep. if (game.player.isThereAnAllyCreep()) { //attack enemy and run away if (game.player.isThereAnEnemy()) { game.player.processSpellToEnemyChampions(); game.player.moveAwayFromEnemy(); } else { if (game.player.isThereAnEnemyCreep()) { game.player.processSpellToEnemyCreeps(); game.player.moveAwayFromCreep(); } bot.wait(100); game.player.allyCreepPosition(); CreepHasBeenFound = true; } } else { // Just run away, no allies to find. if (game.player.isThereAnEnemy()) { game.player.processSpellToEnemyChampions(); game.player.moveAwayFromEnemy(); } if (game.player.isThereAnEnemyCreep()) { game.player.processSpellToEnemyCreeps(); game.player.moveAwayFromCreep(); } if (!game.player.isThereAnAllyCreep() && !game.player.isThereAnEnemy() && !game.player.nearTowerStructure() && !game.player.isThereAnEnemyCreep()) { bot.log("im lost help!"); if (game.player.tryMoveLightArea(1397, 683, "#65898F")) { } else if (game.player.tryMoveLightArea(966, 630, "#65898F")) { } else if (game.player.tryMoveLightArea(1444, 813, "#919970")) { } else { if (CreepHasBeenFound) { game.camera.lockAlly(allyIndex); } else { allyIndex = incAllyIndex(allyIndex); bot.wait(5000); } game.moveCenterScreen(); if (!game.player.isThereAnAllyCreep() || !game.player.isThereAnEnemyCreep()) //if player just afks, change index. { allyIndex = incAllyIndex(allyIndex); } bot.wait(500); } } } } Console.Read(); }
internal void ReassignStartupEntries(bool refreshListView) { ReassignStartupEntries(refreshListView, StartupManager.GetAllStartupItems()); }
public ConfigurationFactory(StartupManager startupManager) { this.startupManager = startupManager ?? throw new ArgumentNullException(nameof(startupManager)); }
private void OnResuming(object sender, object e) { StartupManager.HandleResumeEvent(); }
void Start() { startupManager = GameObject.FindGameObjectWithTag ( "StartupManager" ).GetComponent<StartupManager> (); guiManager = GameObject.FindGameObjectWithTag ( "GUIManager" ).GetComponent<GUIManager> (); if ( !Directory.Exists(startupManager.parentFolder + Path.DirectorySeparatorChar + "Novels")) { Directory.CreateDirectory(startupManager.parentFolder + Path.DirectorySeparatorChar + "Novels"); UnityEngine.Debug.Log("Directory does not exist!"); } if (Directory.Exists(startupManager.parentFolder + Path.DirectorySeparatorChar + "Novels")) { foreach (string directory in Directory.GetDirectories(startupManager.parentFolder + Path.DirectorySeparatorChar + "Novels")) { if (File.Exists(directory + Path.DirectorySeparatorChar + "Info.txt")) { Novel tempNovel = new Novel(); tempNovel.location = directory.ToString(); using (StreamReader reader = new StreamReader(directory + Path.DirectorySeparatorChar + "Info.txt")) { tempNovel.name = reader.ReadLine(); tempNovel.author = reader.ReadLine(); tempNovel.version = reader.ReadLine(); } if (tempNovel.name != null && tempNovel.author != null && tempNovel.version != null && File.Exists(directory + Path.DirectorySeparatorChar + tempNovel.name + ".xml")) availableNovels.Add(tempNovel); else UnityEngine.Debug.Log("Folder not added"); } } } }
private void OnLaunchStartupManagerBtnClick(object sender, RoutedEventArgs e) { StartupManager startupManager = new StartupManager(); startupManager.ShowDialog(); }