public Settings_Funky() { Demonbuddy = new SettingDemonBuddy(); Debug = new SettingDebug(); Grouping = new SettingGrouping(); Fleeing = new SettingFleeing(); Ranges = new SettingRanges(); ItemRules = new SettingItemRules(); Loot = new SettingLoot(); Cluster = new SettingCluster(); Targeting = new SettingTargeting(); Combat = new SettingCombat(); Avoidance = new SettingAvoidance(); LOSMovement = new SettingLOSMovement(); Plugin = new SettingPlugin(); Backtracking = new SettingBacktrack(); BuyPotionsDuringTownRun = false; EnableWaitAfterContainers = false; AfterCombatDelay = 500; OutOfCombatMovement = false; AllowBuffingInTown = false; Class = new ClassSettings(); }
public void CloseSettings(ClassSettings cs, Grid g) { MainWindow mw = (MainWindow)Application.Current.MainWindow; mw.theCanvas.Children.Remove(cs); mw.theCanvas.Children.Remove(g); }
public static string GetKeywords(ClassSettings settings) { var keywords = string.Empty; if ((settings & ClassSettings.Public) == ClassSettings.Public) { keywords += "public"; } if ((settings & ClassSettings.Private) == ClassSettings.Private) { keywords += "private"; } if ((settings & ClassSettings.Internal) == ClassSettings.Internal) { keywords += "internal"; } if ((settings & ClassSettings.Sealed) == ClassSettings.Sealed) { keywords += " sealed"; } if ((settings & ClassSettings.Static) == ClassSettings.Static) { keywords += " static"; } if ((settings & ClassSettings.Abstract) == ClassSettings.Abstract) { keywords += " abstract"; } return(keywords.Trim()); }
public ClassDefinition(string name, string ns, ClassSettings settings, List <PropertyDefinition> properties, List <MethodDefinition> methods) { this.name = name; this.ns = ns; this.settings = settings; this.properties = properties; this.methods = methods; }
public static bool HasOneAccessModifierToggled(ClassSettings settings) { var count = 0; count += settings.HasFlag(ClassSettings.Private) ? 1 : 0; count += settings.HasFlag(ClassSettings.Public) ? 1 : 0; count += settings.HasFlag(ClassSettings.Internal) ? 1 : 0; return(count == 1); }
private Image CaptureScreen(int with, int height, int xLocation, int yLocation) { Rectangle screenSize = Screen.PrimaryScreen.Bounds; ClassSettings classSettings = new ClassSettings(); Bitmap target = new Bitmap(with, height); int cursorX = Cursor.Position.X - xLocation; int cursorY = Cursor.Position.Y - yLocation; using (Graphics g = Graphics.FromImage(target)) { g.CopyFromScreen(xLocation, yLocation, 0, 0, new Size(screenSize.Width, screenSize.Height)); g.DrawImage(Image.FromFile(classSettings.GetProperties().generalsSttings.programPath + "\\icons\\color\\icons8-cursor-32.png"), cursorX, cursorY); } return(target); }
/// <summary> /// Updates the form's controls with values from the settings class /// </summary> /// <param name="settings">Class containing the values to show on the form's controls</param> private void UpdateControls(ClassSettings settings) { Settings = settings; try { PlayMode play = (PlayMode)Settings.PlayMode; this.radProgressive.Checked = ((play & PlayMode.SequenceProgressive) == PlayMode.SequenceProgressive); this.radRandom.Checked = ((play & PlayMode.SequenceRandom) == PlayMode.SequenceRandom); this.radFixed.Checked = ((play & PlayMode.TimeFixed) == PlayMode.TimeFixed); this.radIncremental.Checked = ((play & PlayMode.TimeIncremental) == PlayMode.TimeIncremental); this.numTimeIncrement.Enabled = this.radIncremental.Checked; this.trackTimeIncrement.Enabled = this.radIncremental.Checked; this.numTime.Value = Settings.Time; this.numTimeIncrement.Value = Settings.TimeIncrement; int value = Settings.MaximumDigit; this.numMaxDigit.Value = value > numMaxDigit.Maximum ? numMaxDigit.Maximum : (value < numMaxDigit.Minimum ? numMaxDigit.Minimum : value); this.numMinDigit.Maximum = this.numMaxDigit.Value; value = Settings.MinimumDigit; this.numMinDigit.Value = value > numMinDigit.Maximum ? numMinDigit.Maximum : (value < numMinDigit.Minimum ? numMinDigit.Minimum : value); this.numMaxAttempts.Value = Settings.MaximumAttempts; this.numMinLength.Value = Settings.MinimumLength; this.numCountRatio.Value = Convert.ToDecimal(Settings.CountDownRatio); this.numNumbersRatio.Value = Convert.ToDecimal(Settings.NumbersRatio); this.numBorderRatio.Value = Convert.ToDecimal(Settings.BorderRatio); this.numFontRatio.Value = Convert.ToDecimal(Settings.FontRatio); this.numResultsRatio.Value = Convert.ToDecimal(Settings.ResultsRatio); this.pctBackColor.BackColor = Color.FromArgb(Settings.BackColor); this.chkStartUp.Checked = Settings.WindowPosition; this.roundSample.Font = new Font(Settings.FontFamilyName, roundSample.Font.SizeInPoints); this.lblFontFamily.Text = "Font: " + this.roundSample.Font.FontFamily.Name; } catch (Exception) { using (new CenterWinDialog(this)) MessageBox.Show(this, "Unexpected error while applying settings.\nPlease report the error to the engineer.", "Settings error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void workClock() { while (true) { objectClassClock.Hour = (byte)DateTime.Now.Hour; objectClassClock.Minute = (byte)DateTime.Now.Minute; objectClassClock.Second = (byte)DateTime.Now.Second; actualT.Clear(); actualT.Append(ClassSettings.FormatDisplay(objectClassClock.Hour)).Append(":").Append(ClassSettings.FormatDisplay(objectClassClock.Minute)) .Append(":").Append(ClassSettings.FormatDisplay(objectClassClock.Second)); Dispatcher.Invoke(() => { actualTime.Text = actualT.ToString(); if (textToggleSwitchState.Text.Equals("On")) { objectClassSettings.OnAlarmSong(hour: objectClassClock.Hour, minute: objectClassClock.Minute); } }); Thread.Sleep(1000); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { byte i = 0; for (; i < 24; i++) { setHours.Items.Add(ClassSettings.FormatDisplay(i)); //new ComboBoxItem() { FontSize = 12, Content = i.ToString() } setMinutes.Items.Add(ClassSettings.FormatDisplay(i)); } for (; i < 60; i++) { setMinutes.Items.Add(i.ToString()); } actualT = new StringBuilder(); objectClassClock = new ClassClock(); objectClassClock.AddActionClock(workClock); objectClassClock.StartClock(); objectClassSettings = new ClassSettings(); gridSettings.DataContext = gridMainWindow.DataContext = objectClassSettings; listAlarmCLock.ItemsSource = objectClassSettings.GetListAlarmClock; objectClassTraySystem = new ClassTrySystem(this); setToolTipToButtonToggleSwitch(); setSaveSettings(); }
public static bool ShouldGenerateDtor(ClassSettings settings) { return(settings.HasFlag(ClassSettings.Dtor)); }
private static void ParseClass(string[] lines, ref string name, ref string ns, ref ClassSettings settings, ref int i) { var line = lines[i]; line = line.Replace(StringConsts.ClassDefinition, "").Trim(); name = line.Substring(line.LastIndexOf(".") + 1).Trim(); ns = line.Substring(0, line.LastIndexOf(".")).Replace(name, "").Trim(); var names = Enum.GetNames(typeof(ClassSettings)); var values = Enum.GetValues(typeof(ClassSettings)).Cast <int>().ToArray(); while (i < lines.Length) { line = lines[++i]; if (line == StringConsts.ClassDefinition) { i++; break; } if (names.Contains(line)) { settings |= (ClassSettings)values[Array.IndexOf(names, line)]; } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("invalid class setting name \"" + line + "\", skipping..."); Console.ResetColor(); } } }
public static bool IsSealed(ClassSettings settings) { return(settings.HasFlag(ClassSettings.Sealed)); }
public static bool IsAbstract(ClassSettings settings) { return(settings.HasFlag(ClassSettings.Abstract)); }
public FrmSettings(ClassSettings settings) : this() { UpdateControls(settings); }
public void KlassGrid_MouseDown(object sender, MouseButtonEventArgs e) { MainWindow mw = (MainWindow)Application.Current.MainWindow; Keyboard.Focus(this); if (e.ClickCount == 2) { Grid g = new Grid() { Width = mw.theCanvas.ActualWidth, Height = mw.theCanvas.ActualHeight, Background = Brushes.Black, Opacity = 0.2 }; Canvas.SetLeft(g, 0); Canvas.SetTop(g, 0); ClassSettings cs = new ClassSettings(KlassViewModel, g); g.MouseDown += (sendr, eventArgs) => { cs.Save(); }; //Skapar ett mouseDown-event för Grid g som anropar CloseSettings double x = (KlassViewModel.KlassModel.PositionLeft + _posOnUserControlOnHit.X - cs.Width / 2.33); double y = (KlassViewModel.KlassModel.PositionTop + _posOnUserControlOnHit.Y - cs.Height / 2); if (cs.Width + x > mw.ActualWidth) { Canvas.SetLeft(cs, x - (x + cs.Width - mw.ActualWidth)); } else if (x < 0) { Canvas.SetLeft(cs, x - x); } else { Canvas.SetLeft(cs, x); } if (cs.Height + y > mw.ActualHeight) { Canvas.SetTop(cs, y - (y + cs.Height - mw.ActualHeight)); } else if (y < 0) { Canvas.SetTop(cs, y - y); } else { Canvas.SetTop(cs, y); } mw.theCanvas.Children.Add(g); mw.theCanvas.Children.Add(cs); } else if (!(Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))) { mw.DeselectAll(); } CaptureMouse(); _posOnUserControlOnHit = Mouse.GetPosition(this); KlassViewModel.Select(); e.Handled = true; }
public Settings_Funky() { AttemptGroupingMovements=true; GroupingClusterRadiusDistance=10d; GroupingMinimumUnitDistance=60; GroupingMaximumDistanceAllowed=125; GroupingMinimumClusterCount=1; GroupingMinimumUnitsInCluster=4; LogGroupingOutput=false; EnableFleeingBehavior=true; FleeMaxMonsterDistance=6; FleeBotMinimumHealthPercent=0.75d; EnableUnstucker=true; RestartGameOnLongStucks=true; LogStuckLocations=true; UseShrineTypes=new bool[6] { true, true, true, true, true, true }; ItemRuleCustomPath=""; AvoidanceRecheckMaximumRate = 3500; AvoidanceRecheckMinimumRate = 550; KitingRecheckMaximumRate = 4500; KitingRecheckMinimumRate = 1000; OOCIdentifyItems = false; BuyPotionsDuringTownRun = false; EnableWaitAfterContainers=false; UseItemRulesPickup = true; UseItemRules=true; ItemRulesUnidStashing=true; ItemRulesSalvaging=true; UseExtendedRangeRepChest = false; EnableCoffeeBreaks=false; MaxBreakTime = 4; MinBreakTime = 8; OOCIdentifyItemsMinimumRequired = 10; breakTimeHour = 1.5d; ItemRuleDebug = false; ItemRuleUseItemIDs = false; ItemRuleType = "hard"; ItemRuleLogKeep = "Rare"; ItemRuleLogPickup="Rare"; ItemRuleGilesScoring = true; AttemptAvoidanceMovements=true; KiteDistance = 0; IgnoreCombatRange = false; IgnoreLootRange = false; DestructibleRange = 10; ContainerOpenRange = 30; NonEliteCombatRange = 45; GlobeHealthPercent = 0.6d; PotionHealthPercent = 0.5d; IgnoreCorpses = false; GoblinPriority = 2; AfterCombatDelay = 500; OutOfCombatMovement = false; AllowBuffingInTown=false; EliteCombatRange = 60; GoldRange = 45; GlobeRange=40; ItemRange = 75; TreasureGoblinRange = 55; ShrineRange = 30; MinimumWeaponItemLevel = new int[] { 0, 59 }; MinimumArmorItemLevel = new int[] { 0, 59 }; MinimumJeweleryItemLevel = new int[] { 0, 55 }; GilesMinimumWeaponScore = 75000; GilesMinimumArmorScore = 30000; GilesMinimumJeweleryScore = 30000; MinimumLegendaryItemLevel = 59; MaximumHealthPotions = 100; MinimumGoldPile = 425; PickupGems=new bool[] { true, true, true, true }; MinimumGemItemLevel = 60; PickupCraftTomes=true; PickupCraftPlans=true; PickupBlacksmithPlanSix=true; PickupBlacksmithPlanFive=false; PickupBlacksmithPlanFour=false; PickupBlacksmithPlanRazorspikes=false; PickupBlacksmithPlanArchonGauntlets=false; PickupBlacksmithPlanArchonSpaulders=false; PickupJewelerDesignFlawlessStar=false; PickupJewelerDesignPerfectStar=false; PickupJewelerDesignRadiantStar=false; PickupJewelerDesignMarquise=false; PickupJewelerDesignAmulet=false; PickupInfernalKeys=true; PickupDemonicEssence=true; PickupFollowerItems=true; MiscItemLevel = 59; UseLevelingLogic = false; UseAdvancedProjectileTesting = false; IgnoreAboveAverageMobs = false; DebugStatusBar = false; LogSafeMovementOutput = false; EnableClusteringTargetLogic = true; IgnoreClusteringWhenLowHP = true; ClusterKillLowHPUnits = true; ClusterDistance = 9d; ClusterMinimumUnitCount = 2; IgnoreClusterLowHPValue = 0.55d; ClusteringAllowRangedUnits=true; ClusteringAllowSpawnerUnits=true; SkipAhead=true; StopGameOnBotEnableScreenShot=true; StopGameOnBotLowHealth=false; StopGameOnBotHealthPercent=0.10d; StopGameScreenShotWindowWidth=1000; StopGameScreenShotWindowHeight=800; MissleDampeningEnforceCloseRange=true; Class = new ClassSettings(); }