public MainWindow() { InitializeComponent(); rnd = new Random(); Accents.Add(DefaultColors.Briliet); Accents.Add(DefaultColors.Hibiscus); Accents.Add(DefaultColors.LaSectur); Accents.Add(DefaultColors.Oros); Accents.Add(DefaultColors.SpectreOriginal); Accents.Add(DefaultColors.ThismakerOfficial); ApplyRandomAccent(); }
private static void ReloadAccents() { string[] accents = { "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Amber.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Brown.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Cobalt.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Crimson.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Cyan.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Emerald.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Green.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Indigo.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Lime.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Magenta.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Mauve.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Olive.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Orange.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Pink.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Purple.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Red.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Sienna.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Steel.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Taupe.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Teal.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Violet.xaml", "pack://application:,,,/MahApps.Metro;component/Styles/Accents/Yellow.xaml" }; Accents.Clear(); foreach (var a in accents) { var dic = new ResourceDictionary { Source = new Uri(a) }; var accent = new AccentColor(dic, Path.GetFileNameWithoutExtension(a)); Accents.Add(accent); } }
public SwordAccent(string texture, string suffix, int originX, int originY, int mana = 0, Action <Player, NPC, ProceduralSword, int, bool> onHit = null, float dpsModifier = 1f, int critBonus = 0, Action <Rectangle, Player> effect = null) { Type = Accents.Count; if (Main.netMode != NetmodeID.Server) { if (texture != null) { Texture = ModLoader.GetMod(Constants.ModName).GetTexture("Content/GFX/Items/Accents/" + texture); } } Suffix = suffix; Origin = new Vector2(originX, originY); OnHit = onHit; DpsModifier = dpsModifier; CritBonus = critBonus; Effect = effect; Mana = mana; if (!Accents.ContainsKey(Type)) { Accents.Add(Type, this); } }
public async Task WindowLoaded() { MyMutex = new Mutex(true, "GTADownloaderOneInstance", out bool isNewInstance); if (!isNewInstance) { await TryCloseAsync(); } new Join(this, _tsViewModel); if (Accents.Count == 0) { foreach (var color in ThemeManager.Current.ColorSchemes) { Accents.Add(new AccentsModel() { ColorName = color }); } } if (IsServerChecked) { await Task.Delay(DelayJoinValue * 1000); if (Process.GetProcessesByName("steam").Length != 0) { if (Process.GetProcessesByName("arma3_x64").Length == 0 && Process.GetProcessesByName("arma3").Length == 0 && Process.GetProcessesByName("arma3launcher").Length == 0) { foreach (var server in Servers) { if (server.ContentButton == "Join TeamSpeak") { continue; } Join.Server(server); break; } } } else { MessageBox.Show("GTA Mission Downloader could not find steam.exe running! Make sure to launch Steam first before this application.", "Join Game Server Error", MessageBoxButton.OK, MessageBoxImage.Error); } } if (IsTsChecked) { if (Process.GetProcessesByName("ts3client_win64").Length == 0) { foreach (var server in Servers) { if (server.ContentButton != "Join TeamSpeak") { continue; } Join.Server(server); break; } } } _ = Update.ItemsAsync(); //Must be at the end, to prevent black screen if (IsHiddenChecked) { Helper.MyNotifyIcon.ShowBalloonTip("Reminder!", "The program is running in the background!", BalloonIcon.Info); WindowVisibility = Visibility.Hidden; } }
public bool AddAccent(string name, Uri resource) { Accents.Add(name, resource); return(true); }