void highlightedValChanged(object sender, Objects.UI.Events.OptionChangedEventArgs e) { CSGOImplementation csgo = (CSGOImplementation)Program.GameImplementation; for (int i = 0; i < csgo.Players.Length; i++) { if (csgo.Players[i] == null) { continue; } if (csgo.Players[i].Name == ((ValueMenuItem)sender).Text) { csgo.Highlighted[i] = (OnOff)e.OptionValue == OnOff.On; break; } } }
protected override void OnTick() { if (Program.GameImplementation == null) { return; } if (Program.GameController == null) { return; } if (!Program.GameController.IsGameRunning) { return; } CSGOImplementation csgo = (CSGOImplementation)Program.GameImplementation; if (once) { once = !once; #region Load current values //foreach (MenuItem item in menuItems) //{ // if (csgo.HasKey(item.ExtraData)) // { // object val = csgo.GetValue(item.ExtraData); // if (item.ExtraData == "aimbotKey") // Program.PrintError("Aimbot-key: {0}, currently: {1}", val.ToString(), ((KeyMenuItem)item).Key.ToString()); // item.SwitchToVal(val); // } //} #endregion } #region keys if ((DateTime.Now.Ticks - lastTick) / TimeSpan.TicksPerMillisecond >= 100) { #region realign ui mainMenu.SetPosition(mainMenu.X, Program.GameController.Form.ClientSize.Height / 2f - mainMenu.Height / 2f); ctrlRadar.SetPosition(Program.GameController.Form.ClientSize.Width - ctrlRadar.Width - 4, Program.GameController.Form.ClientSize.Height / 2f - ctrlRadar.Height / 2f); ctrlPlayerInformation.SetPosition(Program.GameController.Form.ClientSize.Width - ctrlPlayerInformation.Width, 4f); #endregion if (Program.GameImplementation.GetValue <YesNo>("menuEnabled") == YesNo.Yes) { foreach (System.Windows.Forms.Keys key in Program.GameController.InputUpdater.KeysThatAreDown()) { mainMenu.OnKeyUp(key); } lastTick = DateTime.Now.Ticks; } if (Program.GameController.InputUpdater.KeyIsDown(System.Windows.Forms.Keys.F9)) { if (Program.GameImplementation.GetValue <YesNo>("menuEnabled") == YesNo.Yes) { Program.GameImplementation.SetValue("menuEnabled", YesNo.No); for (int i = mainMenu.ChildControls.Count - 1; i > 0; i--) { mainMenu.ChildControls[i].Visible = false; } } else { Program.GameImplementation.SetValue("menuEnabled", YesNo.Yes); for (int i = mainMenu.ChildControls.Count - 1; i > 0; i--) { mainMenu.ChildControls[i].Visible = true; } } lastTick = DateTime.Now.Ticks; } if (Program.GameController.InputUpdater.KeyIsDown(Program.GameImplementation.GetValue <System.Windows.Forms.Keys>("triggerKey"))) { if (Program.GameImplementation.GetValue <YesNo>("triggerbotEnabled") == YesNo.Yes) { Program.GameImplementation.SetValue("triggerbotEnabled", YesNo.No); } else { Program.GameImplementation.SetValue("triggerbotEnabled", YesNo.Yes); } } //if (Program.GameController.InputUpdater.KeyIsDown(System.Windows.Forms.Keys.F7)) // ((CSGOGameController)Program.GameController).MemoryUpdater.SaveIDS(); } #endregion #region highlight if (csgo.Players != null) { bool visible; for (int i = 0; i < 64; i++) { try { visible = highlightPlayers[i].Visible; if (csgo.Players[i] != null) { highlightPlayers[i].Visible = true; highlightPlayers[i].Text = csgo.Players[i].Name; } else { highlightPlayers[i].Visible = false; } if (highlightPlayers[i].Visible != visible) { highlightPlayerMenu.InvokeAutoSize(); } } catch { } } } #endregion }