diff --git a/Anno1800ModLauncher/Anno1800ModLauncher.csproj b/Anno1800ModLauncher/Anno1800ModLauncher.csproj index 908d91d..ee1ca2d 100644 --- a/Anno1800ModLauncher/Anno1800ModLauncher.csproj +++ b/Anno1800ModLauncher/Anno1800ModLauncher.csproj @@ -17,6 +17,21 @@ true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true x64 @@ -52,14 +67,17 @@ bin\x64\Release\ - TRACE + + true - pdbonly + none x64 8.0 prompt MinimumRecommendedRules.ruleset true + false + false Anno1800ModLauncher.App @@ -99,6 +117,7 @@ app.manifest + @@ -147,17 +166,13 @@ + Resources.resx True True - - Resources.en-EN.resx - True - True - AboutView.xaml @@ -228,11 +243,6 @@ Code - - True - True - Resources.de-DE.resx - True Settings.settings @@ -242,14 +252,6 @@ PublicResXFileCodeGenerator Resources.Designer.cs - - PublicResXFileCodeGenerator - Resources.en-EN.Designer.cs - - - PublicResXFileCodeGenerator - Resources.de-DE.Designer.cs - @@ -292,30 +294,31 @@ - + + PreserveNewest - - + + PreserveNewest - - + + PreserveNewest - - + + PreserveNewest - - + + PreserveNewest - - + + PreserveNewest - - + + PreserveNewest - - + + PreserveNewest - + Always @@ -357,5 +360,17 @@ + + + False + Microsoft .NET Framework 4.7.2 %28x86 und x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file diff --git a/Anno1800ModLauncher/App.config b/Anno1800ModLauncher/App.config index bffc6c2..6b3f283 100644 --- a/Anno1800ModLauncher/App.config +++ b/Anno1800ModLauncher/App.config @@ -31,6 +31,9 @@ https://anno-union.com/de/ + + True + diff --git a/Anno1800ModLauncher/CustomDialogs/ModInstallationDialog.xaml b/Anno1800ModLauncher/CustomDialogs/ModInstallationDialog.xaml index fe7a50d..99f4a47 100644 --- a/Anno1800ModLauncher/CustomDialogs/ModInstallationDialog.xaml +++ b/Anno1800ModLauncher/CustomDialogs/ModInstallationDialog.xaml @@ -8,7 +8,7 @@ xmlns:ignore="http://www.galasoft.ch/ignore" mc:Ignorable="ignore" xmlns:local="clr-namespace:Anno1800ModLauncher.CustomDialogs" - Title="Mod Installer" Height="501.104" Width="425.669" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" x:Name="ModInstallWindow" TitleBarIcon="/Anno1800ModManager;component/AML.ico" WindowStyle="ToolWindow" Background="#FF6C787E"> + Title="{DynamicResource InstallDialogWindowTitleText}" Height="501.104" Width="425.669" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" x:Name="ModInstallWindow" TitleBarIcon="/Anno1800ModManager;component/AML.ico" WindowStyle="ToolWindow" Background="#FF6C787E"> @@ -34,12 +34,12 @@ Margin="8,0,0,0" VerticalAlignment="Center" Style="{StaticResource MaterialDesignTextBlock}" - Text="Mod List" /> + Text="{DynamicResource InstallDialogModListText}" /> + materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Installing}" HorizontalAlignment="Right" Margin="0,0,15,0" Click="InstallMods_Clicked" Content="{DynamicResource InstallDialogInstallButtonText}"/> diff --git a/Anno1800ModLauncher/CustomDialogs/ProfileImportDuplicateDialog.xaml b/Anno1800ModLauncher/CustomDialogs/ProfileImportDuplicateDialog.xaml index 9487962..35aa6bc 100644 --- a/Anno1800ModLauncher/CustomDialogs/ProfileImportDuplicateDialog.xaml +++ b/Anno1800ModLauncher/CustomDialogs/ProfileImportDuplicateDialog.xaml @@ -19,11 +19,9 @@ - - You already have a profile with this name. - Do you want to overwrite it? + - - diff --git a/Anno1800ModLauncher/Helpers/LanguageManager.cs b/Anno1800ModLauncher/Helpers/LanguageManager.cs index eb51f4c..3f1f8d0 100644 --- a/Anno1800ModLauncher/Helpers/LanguageManager.cs +++ b/Anno1800ModLauncher/Helpers/LanguageManager.cs @@ -9,21 +9,33 @@ namespace Anno1800ModLauncher.Helpers { /// - /// the language manager is a static helper that can set and return the current language easily from anywhere within the application. + /// the language manager is a helper that can set and return the current language easily from anywhere within the application by accessing the static LanguageManager.Instance /// All Strings that have to be localized have to be a dynamic resource. /// Any change to language is automatically saved in the application property "Language". /// This is needed for returning localized values from modinfos. /// Currently supports German and English. /// - public static class LanguageManager { + public class LanguageManager { + + #region Events public delegate void LanguageChangedHandler(object source, EventArgs args); - public static event LanguageChangedHandler LanguageChanged = delegate { }; - public static void OnLanguageChanged() { - LanguageChanged(null, EventArgs.Empty); + public event LanguageChangedHandler LanguageChanged = delegate { }; + + #endregion + + public static LanguageManager Instance; + + #region Constructors + public LanguageManager() + { + Instance = this; } - public static void SetLanguage(HelperEnums.Language lang) { + #endregion + + #region LanguageModifying Members + public void SetLanguage(HelperEnums.Language lang) { //get language file name string langCode = ""; switch (lang) { @@ -33,7 +45,10 @@ public static void SetLanguage(HelperEnums.Language lang) { langCode = "english"; break; } Properties.Settings.Default.Language = (int)lang; - Properties.Settings.Default.Save(); + Properties.Settings.Default.Save(); + + //log language change to english. + Console.WriteLine("Changed Language to: {0}", lang); //replace the current language resource dictionary. var dict = new ResourceDictionary() { Source = new Uri($"Texts/{langCode}.xaml", UriKind.Relative) }; @@ -48,10 +63,15 @@ public static void SetLanguage(HelperEnums.Language lang) { OnLanguageChanged(); } - public static HelperEnums.Language GetLanguage() { + public HelperEnums.Language GetLanguage() { int langInt = Properties.Settings.Default.Language; return (HelperEnums.Language)langInt; } + #endregion + public void OnLanguageChanged() + { + LanguageChanged(null, EventArgs.Empty); + } } } diff --git a/Anno1800ModLauncher/Helpers/ModDirectoryManager.cs b/Anno1800ModLauncher/Helpers/ModDirectoryManager.cs index 38ea167..a1026b5 100644 --- a/Anno1800ModLauncher/Helpers/ModDirectoryManager.cs +++ b/Anno1800ModLauncher/Helpers/ModDirectoryManager.cs @@ -33,6 +33,28 @@ public class ModDirectoryManager : INotifyPropertyChanged private string modPath { get => Path.Combine(Properties.Settings.Default.GameRootPath, Properties.Settings.Default.ModDirectory); } public Ookii.Dialogs.Wpf.ProgressDialog currentProgDiag { get; private set; } + private int _activeMods { get; set; } + private int _inactiveMods { get; set; } + + public int activeMods + { + get { return _activeMods; } + set + { + _activeMods = value; + OnPropertyChanged("activeMods"); + } + } + public int inactiveMods + { + get { return _inactiveMods; } + set + { + _inactiveMods = value; + OnPropertyChanged("inactiveMods"); + } + } + /// /// Raises the PropertyChanged notification in a thread safe manner /// @@ -56,10 +78,17 @@ private void OnPropertyChanged(string propertyName) public ModDirectoryManager() { + activeMods = 0; + inactiveMods = 0; Instance = Instance ?? this; LoadMods(); } + private void UpdateModCounts() { + activeMods = modList.Count(i => i.IsActive); + inactiveMods = modList.Count(i => !i.IsActive); + } + public void LoadMods() { if (Directory.Exists(modPath)) @@ -86,11 +115,13 @@ public void LoadMods() (Path.GetFileName(d).IsActive()) ? "CheckBold" : "NoEntry", (Path.GetFileName(d).IsActive()) ? "DarkGreen" : "Red") - ).Where(w => w.Name != ".cache").ToList().OrderByDescending(s => s.IsActive));; ; ; + ).Where(w => w.Name != ".cache").ToList().OrderBy(s => s.Name).OrderByDescending(s => s.IsActive));; ; ; if (modList.Count > 0) Console.WriteLine($"Found {modList.Count} mods! Active: {modList.Count(i => i.IsActive)} / Inactive: {modList.Count(i => !i.IsActive)}"); else Console.WriteLine("Found no mods! You should check out NexusMods for some sweet mods..."); + + UpdateModCounts(); } else modList = null; @@ -98,14 +129,18 @@ public void LoadMods() internal bool ActivateMod(ModModel i) { - string v = Path.GetDirectoryName(i.Path) + @"\"; try { - string destDirName = $"{v}{i.Name}"; + string[] PathArr = i.Path.Split('\\'); + string Name = PathArr[PathArr.Length - 1]; + if (Name.StartsWith("-")) + Name = Name.Substring(1); + string destDirName = $"{v}{Name}"; Directory.Move(i.Path, destDirName); i.Path = destDirName; Console.WriteLine($"Activated - {i.Name}"); + UpdateModCounts(); } catch (Exception ex) { @@ -120,11 +155,14 @@ internal bool DeactivateMod(ModModel i) string v = Path.GetDirectoryName(i.Path) + @"\"; try { - string destDirName = $@"{v}-{i.Name}"; + string[] PathArr = i.Path.Split('\\'); + string Name = PathArr[PathArr.Length - 1]; + string destDirName = $@"{v}-{Name}"; File.SetAttributes(i.Path, FileAttributes.Normal); Directory.Move(i.Path, destDirName); i.Path = destDirName; Console.WriteLine($"De-Activated - {i.Name}"); + UpdateModCounts(); } catch (Exception ex) { @@ -143,24 +181,126 @@ internal string GetReadMeText(ModModel i) res = File.ReadAllText(contentPath); if (File.Exists(readmePath)) res += Environment.NewLine + File.ReadAllText(readmePath); + //prefer Modinfo over the old way - - if (i.Metadata != null) { - res = i.Metadata.Description.getText() + "\n"; + if (i.Metadata != null) + { + res = ""; + //Version + if (i.Metadata.Version != null) { + res += "\n\n" +Application.Current.TryFindResource("ReadMeTextVersion") + " " + i.Metadata.Version; + } + + //Description + if (i.Metadata.Description != null) { + res += "\n\n" + i.Metadata.Description.getText(); + } + + //Known Issues if (i.Metadata.KnownIssues != null) { - res += "\n"+ Application.Current.TryFindResource("ReadMeTextKnownIssues") + " "; + res += "\n\n" + Application.Current.TryFindResource("ReadMeTextKnownIssues") + " "; foreach (Localized KnownIssue in i.Metadata.KnownIssues) { res += "\n" + "> " + KnownIssue.getText(); } + } + + //DLC Dependency + if (i.Metadata.DLCDependencies != null) + { res += "\n"; + Dlc[] DlcDependencies = i.Metadata.DLCDependencies; + + //sort this array by dlc dependency + Array.Sort(DlcDependencies, Comparer.Create((x, y) => y.Dependant.CompareTo(x.Dependant))); + + //these bools will indicate wether the respective paragraph of DLCs has already been added in the description. + bool requiredSet = false; + bool partlySet = false; + bool atLeastSet = false; + + //due to the array of DLCs being sorted by DLC dependency, we can add the Dependency Header once and all DLCs will be in the right paragraph without further checks. + foreach (Dlc dlc in DlcDependencies) + { + string DlcDescription = ""; + switch (dlc.Dependant) { + case "required": + if (!requiredSet) + { + DlcDescription += "\n"+ Application.Current.TryFindResource("ModsViewDLCRequiredText"); + requiredSet = true; + } + break; + case "partly": + if (!partlySet) + { + DlcDescription += "\n" + Application.Current.TryFindResource("ModsViewDLCPartlyRequiredText"); + partlySet = true; + } + break; + case "atLeastOneRequired": + if (!atLeastSet) + { + DlcDescription += "\n" + Application.Current.TryFindResource("ModsViewDLCAtLeastOneRequiredText"); + atLeastSet = true; + } + break; + } + + switch (dlc.DLC) { + case "Anarchist": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCAnarchistText"); + break; + case "SunkenTreasures": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCSunkenTreasuresText"); + break; + case "Botanica": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCBotanicaText"); + break; + case "ThePassage": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCThePassageText"); + break; + case "SeatOfPower": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCSeatOfPowerText"); + break; + case "BrightHarvest": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCBrightHarvestText"); + break; + case "LandOfLions": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCLandOfLionsText"); + break; + case "Christmas": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCChristmasText"); + break; + case "AmusementPark": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCAmusementParkText"); + break; + case "CityLife": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCCityLifeText"); + break; + //change those later as soon as we get Season 3 info. + case "Docklands": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCS301Text"); + break; + case "Tourism": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCS302Text"); + break; + case "Highlife": + DlcDescription += "\n> " + Application.Current.TryFindResource("DLCS303Text"); + break; + + } + res += DlcDescription; + } } + + //Creator if (i.Metadata.CreatorName != null) { - res += "\n" + Application.Current.TryFindResource("ReadMeTextCreator") + " " + i.Metadata.CreatorName; + res += "\n\n" + Application.Current.TryFindResource("ReadMeTextCreator") + " " + i.Metadata.CreatorName; } } - return res; + return res.TrimStart(); } internal ImageSource GetModBanner(ModModel i) @@ -183,12 +323,17 @@ internal ImageSource GetModBanner(ModModel i) { if (i.Metadata.Image != null) { - var bytes = Convert.FromBase64String(i.Metadata.Image); - BitmapImage bitmap = new BitmapImage(); - bitmap.BeginInit(); - bitmap.StreamSource = new MemoryStream(bytes); - bitmap.EndInit(); - res = bitmap; + try { + var bytes = Convert.FromBase64String(i.Metadata.Image); + BitmapImage bitmap = new BitmapImage(); + bitmap.BeginInit(); + bitmap.StreamSource = new MemoryStream(bytes); + bitmap.EndInit(); + res = bitmap; + bitmap.StreamSource.Dispose(); + } catch ( System.FormatException e) { + Console.WriteLine(i.Metadata.ModID + " contains a corrupted Base64 image. Fallback to normal image"); + } } } return res; @@ -211,7 +356,6 @@ internal ObservableCollection FilterMods(string filterText, bool? filt return _baseData.Where(o => o.Name.ToLower().Contains(filterText.ToLower()) && o.IsActive == filterStatus).ToObservableCollection(); } } - internal void DownloadInstallNewMod(string v) { currentProgDiag = new ProgressDialog(); @@ -227,7 +371,6 @@ private void GetNewMod(Uri uri) { using (var w = new WebClient()) { - W_DownloadDataCompleted(w.DownloadData(uri)); } } @@ -300,21 +443,26 @@ public ModModel(string pName, string pPath, bool pIsActive, string pIcon, string Icon = pIcon; Color = pColor; + //try to deserialize mod metadata here. try { Metadata = JsonConvert.DeserializeObject(File.ReadAllText(Path + "\\modinfo.json")); if (Metadata != null) { - + name = "[" + Metadata.Category.getText() + "] " + Metadata.ModName.getText(); } } - catch { } + catch (JsonSerializationException e) + { + Console.WriteLine("Json Serialization failed:{0}", Path); + } + catch (IOException e) + { + Console.WriteLine("No modinfo found for {0}", Path); + } + LanguageManager.Instance.LanguageChanged += LanguageManager_LanguageChanged; - //buttons should have a listener to change their displayed names etc. - //NOTE: LanguageManager.LanguageChanged is a static event. - //reloading mods with new modModels can result in a memory leak. - LanguageManager.LanguageChanged += LanguageManager_LanguageChanged; } private void LanguageManager_LanguageChanged(object source, EventArgs args) @@ -325,6 +473,19 @@ private void LanguageManager_LanguageChanged(object source, EventArgs args) } } + /// + /// + /// + /// The non localized directory name of a mod without "-" in the front + public String getDirectoryName() { + String[] PathArr = Path.Split('\\'); + var DirectoryName = PathArr[PathArr.Length - 1]; + if (DirectoryName.StartsWith("-")) + { + DirectoryName = DirectoryName.Substring(1); + } + return DirectoryName; + } public bool hasMetadata() { return Metadata != null; } @@ -356,7 +517,6 @@ protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) #endregion - public override string ToString() { return Name; diff --git a/Anno1800ModLauncher/Helpers/ModInstaller/ModInstallationManager.cs b/Anno1800ModLauncher/Helpers/ModInstaller/ModInstallationManager.cs index 559d13f..b662381 100644 --- a/Anno1800ModLauncher/Helpers/ModInstaller/ModInstallationManager.cs +++ b/Anno1800ModLauncher/Helpers/ModInstaller/ModInstallationManager.cs @@ -9,6 +9,7 @@ using System.Windows; using Ionic.Zip; using Ionic.Zlib; +using Microsoft.VisualBasic.FileIO; namespace Anno1800ModLauncher.Helpers.ModInstaller { @@ -54,6 +55,7 @@ private void OnPropertyChanged(string propertyName) public event PropertyChangedEventHandler PropertyChanged; #endregion + public delegate void InstallationCompleteEventHandler(MessageBoxResult Result); public event InstallationCompleteEventHandler InstallationComplete; @@ -73,7 +75,7 @@ internal void ActivateAll() public void Install() { - Task.Run(async () => await InstallAsync().ConfigureAwait(false)).ContinueWith((e) => InstallationComplete(e.Result)); + Task.Run(async () => await InstallAsync().ConfigureAwait(true)).ContinueWith((e) => InstallationComplete(e.Result)); } private async Task InstallAsync() @@ -100,9 +102,75 @@ private async Task InstallAsync() return msgRes; } + /// + /// Installs mods from a single zip archive. + /// + /// If the mod in question is already in the mods folder, it will automatically overwrite and take over the activated status. + /// + /// + /// private void InstallSingle(ZipFile modArchive, string destinationPath) - { - modArchive.ExtractAll(destinationPath, ExtractExistingFileAction.OverwriteSilently); + { + //temporary directory path for all unpacks + string TmpDirPath = Path.Combine(Properties.Settings.Default.GameRootPath, "amm_unpack"); + //temporary unpack directory path + string TmpModPath = Path.Combine(TmpDirPath, modArchive.Name.Split('\\')[modArchive.Name.Split('\\').Length - 1]); + string modDir = Path.Combine(Properties.Settings.Default.GameRootPath, Properties.Settings.Default.ModDirectory); + + //in case it doesn't already exists, create the unpack directory. + if (!Directory.Exists(TmpDirPath)) { + Directory.CreateDirectory(TmpDirPath); + } + + //extract to the temporary directory + modArchive.ExtractAll(TmpModPath, ExtractExistingFileAction.OverwriteSilently); + + //enumerate mods in the directory + var directories = Directory.EnumerateDirectories(TmpModPath); + //for each mod in the directory, check wether a mod with the same folder name is already installed. currently just don't copy in this case. + foreach (string s in directories) { + //get folder name alone + string folderName = s.Split('\\')[s.Split('\\').Length - 1]; + string folderNameTrimmed = folderName.TrimStart('-').TrimStart(' '); + + //determine what should happen if installation would lead to mod duplications + if ( + //no directory of the same name exists + !(Directory.Exists(Path.Combine(modDir, folderNameTrimmed)) || + //no directory with the same name but deactivated exists. + Directory.Exists(Path.Combine(modDir, "-" + folderNameTrimmed))) + ) + { + FileSystem.MoveDirectory(s, Path.Combine(modDir, folderName)); + Console.WriteLine("No mod duplication problems found, copying {0}", folderNameTrimmed); + } + else if ( + //activated directory exists + Directory.Exists(Path.Combine(modDir, folderNameTrimmed)) + ) + { + //delete the old one, paste in the new one, activate the new one + FileSystem.DeleteDirectory(Path.Combine(modDir, folderNameTrimmed), DeleteDirectoryOption.DeleteAllContents); + FileSystem.MoveDirectory(s, Path.Combine(modDir, folderNameTrimmed)); + Console.WriteLine("Mod Duplication found: replacing", folderNameTrimmed); + } + else if ( + //deactivated directory exists + Directory.Exists(Path.Combine(modDir, "-" + folderNameTrimmed)) + ) + { + //delete the old one, paste in the new one, deactivate the new one + FileSystem.DeleteDirectory(Path.Combine(modDir, "-" + folderNameTrimmed), DeleteDirectoryOption.DeleteAllContents); + FileSystem.MoveDirectory(s, Path.Combine(modDir, "-" + folderNameTrimmed)); + Console.WriteLine("Mod Duplication found: replacing", "-"+folderNameTrimmed); + } + } + + //delete temp directories - note: TmpDirPath can be used by other unpacks at the same time, so ONLY delete it if there are no files in it, which is default behavior for Directory.Delete method. + Directory.Delete(TmpModPath); + Directory.Delete(TmpDirPath); + + //reload mods ModDirectoryManager.Instance.LoadMods(); } diff --git a/Anno1800ModLauncher/Helpers/ProfilesManager.cs b/Anno1800ModLauncher/Helpers/ProfilesManager.cs index 24e1e43..476488e 100644 --- a/Anno1800ModLauncher/Helpers/ProfilesManager.cs +++ b/Anno1800ModLauncher/Helpers/ProfilesManager.cs @@ -180,7 +180,7 @@ public Profile(string path) public Profile(string name, ModDirectoryManager manager) { Name = name; - mods = new ObservableCollection(manager.modList.Where(m => m.IsActive).Select(m => m.Name)); + mods = new ObservableCollection(manager.modList.Where(m => m.IsActive).Select(m => m.getDirectoryName())); } internal void Persist(string directory) @@ -194,7 +194,7 @@ internal void Load(ModDirectoryManager modDirectoryManager) { foreach (ModModel m in modDirectoryManager.modList) { - if(Mods.Contains(m.Name)) + if(Mods.Contains(m.getDirectoryName())) { if (!m.IsActive) { @@ -272,7 +272,7 @@ public override string ToString() internal void UpdateMods(ModDirectoryManager manager) { - mods = new ObservableCollection(manager.modList.Where(m => m.IsActive).Select(m => m.Name)); + mods = new ObservableCollection(manager.modList.Where(m => m.IsActive).Select(m => m.getDirectoryName())); } internal void Refresh(string path) diff --git a/Anno1800ModLauncher/Helpers/Serializable/Localized.cs b/Anno1800ModLauncher/Helpers/Serializable/Localized.cs index 81cee04..ac4a9e8 100644 --- a/Anno1800ModLauncher/Helpers/Serializable/Localized.cs +++ b/Anno1800ModLauncher/Helpers/Serializable/Localized.cs @@ -22,7 +22,7 @@ public Localized() { } public String Taiwanese { get; set; } public String getText() { - switch (LanguageManager.GetLanguage()) { + switch (LanguageManager.Instance.GetLanguage()) { case HelperEnums.Language.English: return English; case HelperEnums.Language.German: return German; default: return English; diff --git a/Anno1800ModLauncher/Helpers/Serializable/Theme.cs b/Anno1800ModLauncher/Helpers/Serializable/Theme.cs index 593c237..49f4404 100644 --- a/Anno1800ModLauncher/Helpers/Serializable/Theme.cs +++ b/Anno1800ModLauncher/Helpers/Serializable/Theme.cs @@ -25,7 +25,7 @@ public String ShowName { public event PropertyChangedEventHandler PropertyChanged; public Theme() { - LanguageManager.LanguageChanged += UpdateLanguage; + LanguageManager.Instance.LanguageChanged += UpdateLanguage; } public void UpdateLanguage(object sender, EventArgs e) { @@ -57,7 +57,8 @@ public ResourceDictionary toResourceDictionary() { case ResourceType.Image: try { - ImageSource image = new BitmapImage(new Uri(Key.Value)); + var uri = new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase) + Key.Value); + ImageSource image = new BitmapImage(uri); res.Add(Key.Key, image); } catch { } diff --git a/Anno1800ModLauncher/Helpers/SettingsManager.cs b/Anno1800ModLauncher/Helpers/SettingsManager.cs new file mode 100644 index 0000000..7f1f8a8 --- /dev/null +++ b/Anno1800ModLauncher/Helpers/SettingsManager.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace Anno1800ModLauncher.Helpers +{ + public class SettingsManager : INotifyPropertyChanged + { + public static SettingsManager Instance { get; set; } + + #region Constructors + public SettingsManager() + { + + Visibility = Properties.Settings.Default.ConsoleVisibility; + Instance = this; + } + #endregion + + #region SettingVariables + private bool _visibility; + public bool Visibility + { + get + { + return _visibility; + } + set + { + _visibility = value; + OnPropertyChanged("Visibility"); + + } + } + + private void OnPropertyChanged(string propertyName) + { + PropertyChangedEventHandler handler = PropertyChanged; + if (handler != null) + { + handler(this, new PropertyChangedEventArgs(propertyName)); + } + } + protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) + { + PropertyChangedEventHandler handler = PropertyChanged; + if (handler != null) + { + handler(this, e); + } + } + + public event PropertyChangedEventHandler PropertyChanged; + #endregion + } +} diff --git a/Anno1800ModLauncher/Helpers/ThemeManager.cs b/Anno1800ModLauncher/Helpers/ThemeManager.cs index 3865bf3..cd6f99a 100644 --- a/Anno1800ModLauncher/Helpers/ThemeManager.cs +++ b/Anno1800ModLauncher/Helpers/ThemeManager.cs @@ -12,48 +12,6 @@ namespace Anno1800ModLauncher.Helpers { - public static class ThemeManager - { - private static void ChangeTheme(ThemeWrap wrap) - { - //save path of the theme - SaveTheme(wrap.Path); - - //change the theme to json file format to provide meta info about the themes - var dict = wrap.Theme.toResourceDictionary(); - foreach (var key in dict.Keys) - { - Application.Current.Resources[key] = dict[key]; - } - } - public static void SetTheme(ThemeWrap theme) { - ChangeTheme(theme); - } - - private static void SaveTheme(String path) - { - Properties.Settings.Default.Theme = path; - Properties.Settings.Default.Save(); - } - public static void SetTheme(String theme) - { - try - { - if (!string.IsNullOrEmpty(theme)) { - ChangeTheme(new ThemeWrap - { - Theme = JsonConvert.DeserializeObject(File.ReadAllText("Themes/" + theme)), Path = "Themes/" + theme - }); - SaveTheme(theme); - } - - } - catch { - Console.WriteLine("Theme {0}.json couldn't be loaded", theme); - } - } - } - public class ThemeWrap { public String Path { get; set; } @@ -64,30 +22,11 @@ public ThemeWrap() { } } - public class ThemeLoadingHelper : INotifyPropertyChanged + public class ThemeManager : INotifyPropertyChanged { private string themePath = "Themes"; - public ThemeLoadingHelper() { - LoadThemes(); - } - public void LoadThemes() { - if (Directory.Exists(themePath)) { - themeList = new ObservableCollection(Directory.EnumerateFiles(themePath, "*.json"). - Select( - d => new ThemeWrap - { - Theme = JsonConvert.DeserializeObject(File.ReadAllText(d, Encoding.UTF8)), - //need to delete the themepath here so we just get the filename. maybe there is a better way to do this. - Path = d.Replace(themePath + "\\", "") - } - ).Where(w => w != null).ToList()) ;; - } - } - - public event PropertyChangedEventHandler PropertyChanged; - - private ObservableCollection _themeList; + private ObservableCollection _themeList; public ObservableCollection themeList { get { return _themeList; } @@ -97,6 +36,23 @@ public ObservableCollection themeList OnPropertyChanged("themeList"); } } + + public static ThemeManager Instance { get; private set; } + + #region Constructors + public ThemeManager() + { + LoadThemes(); + Instance = this; + } + + #endregion + + #region INotifyPropertyChanged Members + + public event PropertyChangedEventHandler PropertyChanged; + + private void OnPropertyChanged(string propertyName) { PropertyChangedEventHandler handler = PropertyChanged; @@ -105,5 +61,92 @@ private void OnPropertyChanged(string propertyName) handler(this, new PropertyChangedEventArgs(propertyName)); } } + #endregion + + #region ThemeChanging Members + /// + /// loads themes from the Themes directory into a collection of ThemeWraps + /// + public void LoadThemes() + { + if (Directory.Exists(themePath)) + { + //lets do this the stoneage way for better exception handling + themeList = new ObservableCollection(); + var files = Directory.EnumerateFiles(themePath, "*.json"); + foreach (string file in files) { + try + { + var theme = new ThemeWrap + { + Theme = JsonConvert.DeserializeObject(File.ReadAllText(file, Encoding.UTF8)), + //need to delete the themepath here so we just get the filename. maybe there is a better way to do this. + Path = file.Replace(themePath + "\\", "") + }; + if (theme != null) + themeList.Add(theme); + } + catch (JsonSerializationException e) + { + Console.WriteLine("couldn't deserialize theme: {0}", file); + } + catch (JsonReaderException e){ + Console.WriteLine("Error parsing theme: {0}", file); + } + } + } + } + /// + /// Changes the theme of the application and automatically stores it as the new default in the application properties + /// + /// The themeWrap that the theme should be changed to. + public void ChangeTheme(ThemeWrap wrap) + { + //save themepath in the application properties. + SaveTheme(wrap.Path); + + var dict = wrap.Theme.toResourceDictionary(); + foreach (var key in dict.Keys) + { + Application.Current.Resources[key] = dict[key]; + } + Console.WriteLine("Changed Theme to {0}", wrap.Theme.ThemeName.English); + } + + /// + /// Saves the theme in the application properties. + /// + /// the path of the theme + private void SaveTheme(String path) + { + Properties.Settings.Default.Theme = path; + Properties.Settings.Default.Save(); + } + + /// + /// Changes the theme of the application + /// + /// The filename of the theme file that should be changed to. + public void ChangeTheme(String theme) + { + try + { + if (!string.IsNullOrEmpty(theme)) + { + ChangeTheme(new ThemeWrap + { + Theme = JsonConvert.DeserializeObject(File.ReadAllText("Themes/" + theme)), + Path = "Themes/" + theme + }); + } + } + catch + { + Console.WriteLine("Theme {0}.json couldn't be loaded", theme); + } + } + #endregion + + } } diff --git a/Anno1800ModLauncher/Images/ModImg_PlaceHolder_2.png b/Anno1800ModLauncher/Images/ModImg_PlaceHolder_2.png new file mode 100644 index 0000000..e8acb38 Binary files /dev/null and b/Anno1800ModLauncher/Images/ModImg_PlaceHolder_2.png differ diff --git a/Anno1800ModLauncher/Libs/python35.dll b/Anno1800ModLauncher/Libs/python35.dll index 2eef93f..de9610f 100644 Binary files a/Anno1800ModLauncher/Libs/python35.dll and b/Anno1800ModLauncher/Libs/python35.dll differ diff --git a/Anno1800ModLauncher/MainWindow.xaml b/Anno1800ModLauncher/MainWindow.xaml index 8c8de2c..c602064 100644 --- a/Anno1800ModLauncher/MainWindow.xaml +++ b/Anno1800ModLauncher/MainWindow.xaml @@ -32,7 +32,7 @@ + UniformCornerRadius="5" Background ="{DynamicResource PrimaryHueMenuBackgroundBrush}"> @@ -153,14 +153,17 @@ + + + - + UniformCornerRadius="5" Background ="{DynamicResource PrimaryHueMenuBackgroundBrush}" DockPanel.Dock="Bottom" Height="100" Visibility="{Binding Path=SettingsManager.Instance.Visibility, Converter={StaticResource BoolToVisConverter}}" > - + + FontFamily="Consolas" + TextChanged="LogRTB_TextChanged" + BorderBrush="Transparent" /> diff --git a/Anno1800ModLauncher/MainWindow.xaml.cs b/Anno1800ModLauncher/MainWindow.xaml.cs index 814faf9..133e31c 100644 --- a/Anno1800ModLauncher/MainWindow.xaml.cs +++ b/Anno1800ModLauncher/MainWindow.xaml.cs @@ -39,7 +39,7 @@ namespace Anno1800ModLauncher /// /// Interaction logic for MainWindow.xaml /// - public partial class MainWindow : MaterialWindow + public partial class MainWindow : MaterialWindow, INotifyPropertyChanged { //Test private const string WindowTitle = "AMM"; @@ -58,12 +58,19 @@ public partial class MainWindow : MaterialWindow private ManagerStatus Status = ManagerStatus.bad; private bool IsUpdating; + public LanguageManager LanguageManager = new LanguageManager(); + + public SettingsManager SettingsManager { get; set; } + [DllImport("winmm.dll")] public static extern int waveOutSetVolume(IntPtr h, uint dwVolume); public MainWindow() { InitializeComponent(); + this.DataContext = this; + + SettingsManager = new SettingsManager(); //set language to the one that is saved as default in the application properties @@ -74,17 +81,17 @@ public MainWindow() var lang = CultureInfo.InstalledUICulture.Name; if (lang.StartsWith("en")) { - LanguageManager.SetLanguage(HelperEnums.Language.English); + LanguageManager.Instance.SetLanguage(HelperEnums.Language.English); } else if (lang.StartsWith("de")) { - LanguageManager.SetLanguage(HelperEnums.Language.German); + LanguageManager.Instance.SetLanguage(HelperEnums.Language.German); } } else { - LanguageManager.SetLanguage((HelperEnums.Language)Properties.Settings.Default.Language); + LanguageManager.Instance.SetLanguage((HelperEnums.Language)Properties.Settings.Default.Language); } - ThemeManager.SetTheme(Properties.Settings.Default.Theme); + ThemeManager.Instance.ChangeTheme(Properties.Settings.Default.Theme); } private void CheckSelfVersion() @@ -399,5 +406,21 @@ private void ProcessModListImport(string modList) } } } + + + #region INotifyPropertyChanged Members + + private void OnPropertyChanged(string propertyName) + { + PropertyChangedEventHandler handler = PropertyChanged; + if (handler != null) + { + handler(this, new PropertyChangedEventArgs(propertyName)); + } + } + + public event PropertyChangedEventHandler PropertyChanged; + + #endregion } } diff --git a/Anno1800ModLauncher/Properties/Resources.Designer.cs b/Anno1800ModLauncher/Properties/Resources.Designer.cs index 921714d..6590e86 100644 --- a/Anno1800ModLauncher/Properties/Resources.Designer.cs +++ b/Anno1800ModLauncher/Properties/Resources.Designer.cs @@ -59,527 +59,5 @@ internal Resources() { resourceCulture = value; } } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die About ähnelt. - /// - public static string AboutButtonText { - get { - return ResourceManager.GetString("AboutButtonText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die The community for helping us improve AMM! ähnelt. - /// - public static string AboutMessageCommunity { - get { - return ResourceManager.GetString("AboutMessageCommunity", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die The contributors to the open source project over at the ähnelt. - /// - public static string AboutMessageContributors { - get { - return ResourceManager.GetString("AboutMessageContributors", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Anno 1800 Mod Launcher Discord Server ähnelt. - /// - public static string AboutMessageDiscordServerText { - get { - return ResourceManager.GetString("AboutMessageDiscordServerText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Github Repo ähnelt. - /// - public static string AboutMessageGithub { - get { - return ResourceManager.GetString("AboutMessageGithub", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die About Anno 1800 Mod Launcher and The Dev ähnelt. - /// - public static string AboutMessageHeader { - get { - return ResourceManager.GetString("AboutMessageHeader", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Anno 1800 Mod Loader ähnelt. - /// - public static string AboutMessageModloaderText { - get { - return ResourceManager.GetString("AboutMessageModloaderText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die This mod launcher is a passion project that I felt the Anno Community deserved. I myself prefer mod launchers that are focused on one specific game as they usually are able to address concerns regarding that game more quickly and efficiently. I noticed that the mod community around this game has created some pretty awesome mods, and xforce was extremely kind enough to create an awesome mod loader that works extremely well. The only piece of the puzzle left was a Mod launcher that brought all of it together [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt. - /// - public static string AboutMessagePart1 { - get { - return ResourceManager.GetString("AboutMessagePart1", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die I'm a gamer myself and have been playing Anno games for years. On top of that, I'm a married father with a full time job, so my time is precious to me and those around me. I created this out of love and passion for programming so I appreciate that you took the time to check it out. Please feel free to make suggestions, comments, or even make the occasional gripe over on the official discord for this app: ähnelt. - /// - public static string AboutMessagePart2 { - get { - return ResourceManager.GetString("AboutMessagePart2", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Special thanks to: ähnelt. - /// - public static string AboutMessagePart3 { - get { - return ResourceManager.GetString("AboutMessagePart3", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Buy Me A Coffee ähnelt. - /// - public static string AboutMessagePaypalButtonText { - get { - return ResourceManager.GetString("AboutMessagePaypalButtonText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die If you like the app or are feeling extra generous I work best when hopped up on caffeine ähnelt. - /// - public static string AboutMessagePaypalLabelText { - get { - return ResourceManager.GetString("AboutMessagePaypalLabelText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die RebuiltStatue21 for creating the ähnelt. - /// - public static string AboutMessageRebuilt { - get { - return ResourceManager.GetString("AboutMessageRebuilt", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Wiki ähnelt. - /// - public static string AboutMessageWikiText { - get { - return ResourceManager.GetString("AboutMessageWikiText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Xforce for creating the ähnelt. - /// - public static string AboutMessageXForce { - get { - return ResourceManager.GetString("AboutMessageXForce", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Anno Union ähnelt. - /// - public static string AnnoUnionText { - get { - return ResourceManager.GetString("AnnoUnionText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Home ähnelt. - /// - public static string HomeButtonText { - get { - return ResourceManager.GetString("HomeButtonText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Game Path: ähnelt. - /// - public static string HomeViewGamePathText { - get { - return ResourceManager.GetString("HomeViewGamePathText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Choose a Repository from Github ähnelt. - /// - public static string HomeViewHintAssistGithub { - get { - return ResourceManager.GetString("HomeViewHintAssistGithub", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die The path of the ZIP-archive you want to install. ähnelt. - /// - public static string HomeViewHintAssistLocalFile { - get { - return ResourceManager.GetString("HomeViewHintAssistLocalFile", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die the URL of the mod you wish to install ähnelt. - /// - public static string HomeViewHintAssistNexus { - get { - return ResourceManager.GetString("HomeViewHintAssistNexus", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Import ähnelt. - /// - public static string HomeViewImportButtonText { - get { - return ResourceManager.GetString("HomeViewImportButtonText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Install from Github ähnelt. - /// - public static string HomeViewInstallFromGithubText { - get { - return ResourceManager.GetString("HomeViewInstallFromGithubText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Install from Nexusmods ähnelt. - /// - public static string HomeViewInstallFromNexusText { - get { - return ResourceManager.GetString("HomeViewInstallFromNexusText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Install from ZIP ähnelt. - /// - public static string HomeViewInstallFromZipText { - get { - return ResourceManager.GetString("HomeViewInstallFromZipText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Install Modloader ähnelt. - /// - public static string HomeViewInstallModloaderText { - get { - return ResourceManager.GetString("HomeViewInstallModloaderText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Modding Setup ähnelt. - /// - public static string HomeViewModdingSetupText { - get { - return ResourceManager.GetString("HomeViewModdingSetupText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Create Mod Folder ähnelt. - /// - public static string HomeViewModfolderCreateText { - get { - return ResourceManager.GetString("HomeViewModfolderCreateText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Mod Folder Path ähnelt. - /// - public static string HomeViewModfolderPathText { - get { - return ResourceManager.GetString("HomeViewModfolderPathText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die 4ʞʞz0ɔʞ7 repo ähnelt. - /// - public static string HomeViewRepoComboBoxAkkRepoText { - get { - return ResourceManager.GetString("HomeViewRepoComboBoxAkkRepoText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Spice it Up repo ähnelt. - /// - public static string HomeViewRepoComboBoxSIURepoText { - get { - return ResourceManager.GetString("HomeViewRepoComboBoxSIURepoText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Search and select from local drives. ähnelt. - /// - public static string HomeViewSearchTooltipText { - get { - return ResourceManager.GetString("HomeViewSearchTooltipText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Set Game Path ähnelt. - /// - public static string HomeViewSetGamePathText { - get { - return ResourceManager.GetString("HomeViewSetGamePathText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Search and select from local drives ähnelt. - /// - public static string HomeViewTooltipInstallFromLocal { - get { - return ResourceManager.GetString("HomeViewTooltipInstallFromLocal", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Install using the built-in mod browser. ähnelt. - /// - public static string HomeViewTooltipInstallText { - get { - return ResourceManager.GetString("HomeViewTooltipInstallText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die https://discord.com/invite/eZsxQXS ähnelt. - /// - public static string LinkDiscordModmanager { - get { - return ResourceManager.GetString("LinkDiscordModmanager", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die https://github.com/LemonDrop1228/anno1800-mod-manager ähnelt. - /// - public static string LinkGithubRepo { - get { - return ResourceManager.GetString("LinkGithubRepo", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die https://github.com/xforce/anno1800-mod-loader ähnelt. - /// - public static string LinkModloaderRepo { - get { - return ResourceManager.GetString("LinkModloaderRepo", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die https://www.notion.so/Anno-1800-Mod-Manager-Wiki-60bbcd8ad9634c2faa225be3f1bd46d6 ähnelt. - /// - public static string LinkNotion { - get { - return ResourceManager.GetString("LinkNotion", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Mods ähnelt. - /// - public static string ModsButtonText { - get { - return ResourceManager.GetString("ModsButtonText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Activate ähnelt. - /// - public static string ModsViewActivateText { - get { - return ResourceManager.GetString("ModsViewActivateText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Create mod folder ähnelt. - /// - public static string ModsViewCreateModfolderText { - get { - return ResourceManager.GetString("ModsViewCreateModfolderText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Create new profile ähnelt. - /// - public static string ModsViewCreateProfileButtonText { - get { - return ResourceManager.GetString("ModsViewCreateProfileButtonText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Deactivate ähnelt. - /// - public static string ModsViewDeactivateText { - get { - return ResourceManager.GetString("ModsViewDeactivateText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Delete Profile ähnelt. - /// - public static string ModsViewDeleteProfileText { - get { - return ResourceManager.GetString("ModsViewDeleteProfileText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Load Profile ähnelt. - /// - public static string ModsViewLoadProfileText { - get { - return ResourceManager.GetString("ModsViewLoadProfileText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Manage ähnelt. - /// - public static string ModsViewManageText { - get { - return ResourceManager.GetString("ModsViewManageText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Mod Details: ähnelt. - /// - public static string ModsViewModDetailsText { - get { - return ResourceManager.GetString("ModsViewModDetailsText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Mod List ähnelt. - /// - public static string ModsViewModListText { - get { - return ResourceManager.GetString("ModsViewModListText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Type here to search mods... ähnelt. - /// - public static string ModsViewModSearchHint { - get { - return ResourceManager.GetString("ModsViewModSearchHint", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die New profile name ähnelt. - /// - public static string ModsViewNewProfileNameLabelText { - get { - return ResourceManager.GetString("ModsViewNewProfileNameLabelText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Active ähnelt. - /// - public static string ModsViewProfileFilterComboActiveText { - get { - return ResourceManager.GetString("ModsViewProfileFilterComboActiveText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Inactive ähnelt. - /// - public static string ModsViewProfileFilterComboInactiveText { - get { - return ResourceManager.GetString("ModsViewProfileFilterComboInactiveText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Reinstall mod loader ähnelt. - /// - public static string ModsViewReinstallModloaderText { - get { - return ResourceManager.GetString("ModsViewReinstallModloaderText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Save Profile ähnelt. - /// - public static string ModsViewSaveProfileText { - get { - return ResourceManager.GetString("ModsViewSaveProfileText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die News ähnelt. - /// - public static string NewsButtonText { - get { - return ResourceManager.GetString("NewsButtonText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Play ähnelt. - /// - public static string PlayButtonText { - get { - return ResourceManager.GetString("PlayButtonText", resourceCulture); - } - } - - /// - /// Sucht eine lokalisierte Zeichenfolge, die Settings ähnelt. - /// - public static string SettingsButtonText { - get { - return ResourceManager.GetString("SettingsButtonText", resourceCulture); - } - } } } diff --git a/Anno1800ModLauncher/Properties/Resources.de-DE.Designer.cs b/Anno1800ModLauncher/Properties/Resources.de-DE.Designer.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Anno1800ModLauncher/Properties/Resources.de-DE.resx b/Anno1800ModLauncher/Properties/Resources.de-DE.resx deleted file mode 100644 index 177aac7..0000000 --- a/Anno1800ModLauncher/Properties/Resources.de-DE.resx +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Über AMM - Left Menu Button: Settings - - - Die Community, die dazu beiträgt, AMM zu verbessern! - About Message: Community - - - Alle, die zum Opensource-Projekt beitragen über das - About Message: Contributors - - - Anno 1800 Mod Launcher Discord Server - About Message: Discord - - - Github Repo - About Message: Github - - - Über AMM und den Entwickler - About Message: Header - - - Anno 1800 Modloader - About Message: Mod Loader - - - Dieser Modlauncher ist ein Projekt, von dem ich glaube, dass die Anno-Community es verdiene. Ich mag Modmanager, die für ein einziges Spiel ausgelegt sind, da so viel schneller und effizienter auf die Gegebenheiten des Spiels eingegangen werden kann. Die Modding-Community dieses Spiels hatte bereits ein paar wirklich coole Mods erstellt, und mit dem Modloader von xforce haben wir sehr gutes Tool bekommen. Das einzige Puzzleteil, das noch fehlte, war ein Modmanager, der all das in einer benutzerfreundlichen Anwendung vereint. - About Message: Part I - - - Ich bin selbst Gamer und spiele Anno bereits seit Jahren. Darüber hinaus bin ich verheirateter Familienvater mit Vollzeitjob, und meine Zeit mit der Familie und Freunden ist mir sehr wichtig. Dieses Tool wurde aus Liebe und Leidenschaft fürs Programmieren erstellt, und freue mich, dass Du Dir die Zeit genommen hast, es auszuprobieren. Wenn Du Vorschläge, Kommentare, oder die ein oder andere Beschwerde hast, besuch uns auf Discord: - About Message: Part II - - - Vielen Dank an: - About Message: Part III - - - Einen Kaffee spendieren - AboutView: Donation Button - - - Wenn Dir die App gefällt, oder du einfach spenden möchtest, Ich arbeite am besten auf Koffein-Basis. - AboutView: Little Text above the donation Button - - - RebuiltStatue21 fürs Erstellen des - About Message: RebuiltStatue21 - - - Wiki - About Message: Wiki - - - Xforce für das Erstellen des - About Message: Xforce - - - Anno-Union - News View: Header - - - Startseite - Left Menu Button: Home - - - Spielpfad: - Home View: Label Game Path - - - Wähle ein Repository auf Github aus - Home View Hint: Github - - - Pfad des Archivs, aus dem installiert wird - Home View Hint: Local File - - - URL der zu installierenden Mod - Home View Hint: Nexusmods - - - Importieren - Home View: Import Button - - - von Github installieren - Home View: Install from Github Button - - - von Nexusmods installieren - Home View: Install from Nexusmods Button - - - aus ZIP-Archiv installieren - Home View: Install from Zip Header - - - Modloader installieren - Home View: Install modloader button - - - Modding-Setup - Home View: Modding setup header - - - Modordner erstellen - Home View: Button create modloader - - - Pfad des Modordners - Home View: Mod folder path label - - - 4ʞʞz0ɔʞ7 Repository - Home View: Combo Box for Github akkzockt - - - Spice it Up Repository - Home View. Combo Box for Github Spice it up - - - Durchsuchen - Home View Tooltip: Search local button - - - Spielpfad festlegen - Home View: Button set game path - - - Durchsuchen - Home View Tooltip: Install local drive - - - Mit dem eingebauten Modbrowser installieren - Home View Tooltip: Install Mods via built-in browser - - - https://discord.com/invite/eZsxQXS - Link: Mod Manager Discord - - - https://github.com/LemonDrop1228/anno1800-mod-manager - Link: Mod Manager Github Repo - - - https://github.com/xforce/anno1800-mod-loader - Link: Modloader Github Repo - - - https://www.notion.so/Anno-1800-Mod-Manager-Wiki-60bbcd8ad9634c2faa225be3f1bd46d6 - Link: Notion Wiki - - - Mods - Left Menu Button: Mods - - - Aktivieren - Mods View: Button for activating Mod - - - Neues Profil erstellen - Mods View: Button for creating profiles - - - Deaktivieren - Mods View: Button for deactivating Mod - - - Profil löschen - Mods View: Button for deleting Profile - - - Profil laden - Mods View: Button for loading Profile - - - Verwalten - Mods View: Manage - - - Mod-Details: - Mods View: Mod Details - - - Liste der Mods - Mods View: Mod List - - - In installierten Mods suchen - Mods View: Hint about mod search - - - Name des neuen Profils - Mods View: Text Label for new profiles - - - Aktiv - Mods View: FilterCombo Active - - - Inaktiv - Mods View: FilterCombo Inactive - - - Profil speichern - Mods View: Button for saving Profile - - - Neuigkeiten - Left Menu Button: News - - - Spielen - Left Menu Button: Play - - - Einstellungen - Left Menu Button: Settings - - \ No newline at end of file diff --git a/Anno1800ModLauncher/Properties/Resources.en-EN.Designer.cs b/Anno1800ModLauncher/Properties/Resources.en-EN.Designer.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Anno1800ModLauncher/Properties/Resources.en-EN.resx b/Anno1800ModLauncher/Properties/Resources.en-EN.resx deleted file mode 100644 index 8bc453e..0000000 --- a/Anno1800ModLauncher/Properties/Resources.en-EN.resx +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - About - Left Menu Button: Settings - - - The community for helping us improve AMM! - About Message: Community - - - The contributors to the open source project over at the - About Message: Contributors - - - Anno 1800 Mod Launcher Discord Server - About Message: Discord - - - Github Repo - About Message: Github - - - About Anno 1800 Mod Launcher and The Dev - About Message: Header - - - Anno 1800 Mod Loader - About Message: Mod Loader - - - This mod launcher is a passion project that I felt the Anno Community deserved. I myself prefer mod launchers that are focused on one specific game as they usually are able to address concerns regarding that game more quickly and efficiently. I noticed that the mod community around this game has created some pretty awesome mods, and xforce was extremely kind enough to create an awesome mod loader that works extremely well. The only piece of the puzzle left was a Mod launcher that brought all of it together in an easy to use tool. - About Message: Part I - - - I'm a gamer myself and have been playing Anno games for years. On top of that, I'm a married father with a full time job, so my time is precious to me and those around me. I created this out of love and passion for programming so I appreciate that you took the time to check it out. Please feel free to make suggestions, comments, or even make the occasional gripe over on the official discord for this app: - About Message: Part II - - - Special thanks to: - About Message: Part III - - - Buy Me A Coffee - AboutView: Donation Button - - - If you like the app or are feeling extra generous I work best when hopped up on caffeine - AboutView: Little Text above the donation Button - - - RebuiltStatue21 for creating the - About Message: RebuiltStatue21 - - - Wiki - About Message: Wiki - - - Xforce for creating the - About Message: Xforce - - - Anno Union - News View: Header - - - Home - Left Menu Button: Home - - - Game Path: - Home View: Label Game Path - - - Choose a Repository from Github - Home View Hint: Github - - - The path of the ZIP-archive you want to install. - Home View Hint: Local File - - - the URL of the mod you wish to install - Home View Hint: Nexusmods - - - Import - Home View: Import Button - - - Install from Github - Home View: Install from Github Button - - - Install from Nexusmods - Home View: Install from Nexusmods Button - - - Install from ZIP - Home View: Install from Zip Header - - - Install Modloader - Home View: Install modloader button - - - Modding Setup - Home View: Modding setup header - - - Create Mod Folder - Home View: Button create modloader - - - Mod Folder Path - Home View: Mod folder path label - - - 4ʞʞz0ɔʞ7 repo - Home View: Combo Box for Github akkzockt - - - Spice it Up repo - Home View. Combo Box for Github Spice it up - - - Search and select from local drives. - Home View Tooltip: Search local button - - - Set Game Path - Home View: Button set game path - - - Search and select from local drives - Home View Tooltip: Install local drive - - - Install using the built-in mod browser. - Home View Tooltip: Install Mods via built-in browser - - - https://discord.com/invite/eZsxQXS - Link: Mod Manager Discord - - - https://github.com/LemonDrop1228/anno1800-mod-manager - Link: Mod Manager Github Repo - - - https://github.com/xforce/anno1800-mod-loader - Link: Modloader Github Repo - - - https://www.notion.so/Anno-1800-Mod-Manager-Wiki-60bbcd8ad9634c2faa225be3f1bd46d6 - Link: Notion Wiki - - - Mods - Left Menu Button: Mods - - - Activate - Mods View: Button for activating Mod - - - Create new profile - Mods View: Button for creating profiles - - - Deactivate - Mods View: Button for deactivating Mod - - - Delete Profile - Mods View: Button for deleting Profile - - - Load Profile - Mods View: Button for loading Profile - - - Manage - Mods View: Manage - - - Mod Details: - Mods View: Mod Details - - - Mod List - Mods View: Mod List - - - Type here to search mods... - Mods View: Hint about mod search - - - New profile name - Mods View: Text Label for new profiles - - - Active - Mods View: FilterCombo Active - - - Inactive - Mods View: FilterCombo Inactive - - - Save Profile - Mods View: Button for saving Profile - - - News - Left Menu Button: News - - - Play - Left Menu Button: Play - - - Settings - Left Menu Button: Settings - - \ No newline at end of file diff --git a/Anno1800ModLauncher/Properties/Resources.resx b/Anno1800ModLauncher/Properties/Resources.resx index 441833b..1af7de1 100644 --- a/Anno1800ModLauncher/Properties/Resources.resx +++ b/Anno1800ModLauncher/Properties/Resources.resx @@ -117,236 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - About - Left Menu Button: Settings - - - The community for helping us improve AMM! - About Message: Community - - - The contributors to the open source project over at the - About Message: Contributors - - - Anno 1800 Mod Launcher Discord Server - About Message: Discord - - - Github Repo - About Message: Github - - - About Anno 1800 Mod Launcher and The Dev - About Message: Header - - - Anno 1800 Mod Loader - About Message: Mod Loader - - - This mod launcher is a passion project that I felt the Anno Community deserved. I myself prefer mod launchers that are focused on one specific game as they usually are able to address concerns regarding that game more quickly and efficiently. I noticed that the mod community around this game has created some pretty awesome mods, and xforce was extremely kind enough to create an awesome mod loader that works extremely well. The only piece of the puzzle left was a Mod launcher that brought all of it together in an easy to use tool. - About Message: Part I - - - I'm a gamer myself and have been playing Anno games for years. On top of that, I'm a married father with a full time job, so my time is precious to me and those around me. I created this out of love and passion for programming so I appreciate that you took the time to check it out. Please feel free to make suggestions, comments, or even make the occasional gripe over on the official discord for this app: - About Message: Part II - - - Special thanks to: - About Message: Part III - - - Buy Me A Coffee - AboutView: Donation Button - - - If you like the app or are feeling extra generous I work best when hopped up on caffeine - AboutView: Little Text above the donation Button - - - RebuiltStatue21 for creating the - About Message: RebuiltStatue21 - - - Wiki - About Message: Wiki - - - Xforce for creating the - About Message: Xforce - - - Anno Union - News View: Header - - - Home - Left Menu Button: Home - - - Game Path: - Home View: Label Game Path - - - Choose a Repository from Github - Home View Hint: Github - - - The path of the ZIP-archive you want to install. - Home View Hint: Local File - - - the URL of the mod you wish to install - Home View Hint: Nexusmods - - - Import - Home View: Import Button - - - Install from Github - Home View: Install from Github Button - - - Install from Nexusmods - Home View: Install from Nexusmods Button - - - Install from ZIP - Home View: Install from Zip Header - - - Install Modloader - Home View: Install modloader button - - - Modding Setup - Home View: Modding setup header - - - Create Mod Folder - Home View: Button create modloader - - - Mod Folder Path - Home View: Mod folder path label - - - 4ʞʞz0ɔʞ7 repo - Home View: Combo Box for Github akkzockt - - - Spice it Up repo - Home View. Combo Box for Github Spice it up - - - Search and select from local drives. - Home View Tooltip: Search local button - - - Set Game Path - Home View: Button set game path - - - Search and select from local drives - Home View Tooltip: Install local drive - - - Install using the built-in mod browser. - Home View Tooltip: Install Mods via built-in browser - - - https://discord.com/invite/eZsxQXS - Link: Mod Manager Discord - - - https://github.com/LemonDrop1228/anno1800-mod-manager - Link: Mod Manager Github Repo - - - https://github.com/xforce/anno1800-mod-loader - Link: Modloader Github Repo - - - https://www.notion.so/Anno-1800-Mod-Manager-Wiki-60bbcd8ad9634c2faa225be3f1bd46d6 - Link: Notion Wiki - - - Mods - Left Menu Button: Mods - - - Activate - Mods View: Button for activating Mod - - - Create mod folder - Mods View: Button for Creating mod folder - - - Create new profile - Mods View: Button for creating profiles - - - Deactivate - Mods View: Button for deactivating Mod - - - Delete Profile - Mods View: Button for deleting Profile - - - Load Profile - Mods View: Button for loading Profile - - - Manage - Mods View: Manage - - - Mod Details: - Mods View: Mod Details - - - Mod List - Mods View: Mod List - - - Type here to search mods... - Mods View: Hint about mod search - - - New profile name - Mods View: Text Label for new profiles - - - Active - Mods View: FilterCombo Active - - - Inactive - Mods View: FilterCombo Inactive - - - Reinstall mod loader - Mods View: Reinstall mod loader - - - Save Profile - Mods View: Button for saving Profile - - - News - Left Menu Button: News - - - Play - Left Menu Button: Play - - - Settings - Left Menu Button: Settings - \ No newline at end of file diff --git a/Anno1800ModLauncher/Properties/Settings.Designer.cs b/Anno1800ModLauncher/Properties/Settings.Designer.cs index d3fe596..f0b590b 100644 --- a/Anno1800ModLauncher/Properties/Settings.Designer.cs +++ b/Anno1800ModLauncher/Properties/Settings.Designer.cs @@ -139,5 +139,17 @@ public string NewsUrlDE { this["NewsUrlDE"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool ConsoleVisibility { + get { + return ((bool)(this["ConsoleVisibility"])); + } + set { + this["ConsoleVisibility"] = value; + } + } } } diff --git a/Anno1800ModLauncher/Properties/Settings.settings b/Anno1800ModLauncher/Properties/Settings.settings index 8eb55d4..266e20e 100644 --- a/Anno1800ModLauncher/Properties/Settings.settings +++ b/Anno1800ModLauncher/Properties/Settings.settings @@ -35,5 +35,8 @@ https://anno-union.com/de/ + + True + \ No newline at end of file diff --git a/Anno1800ModLauncher/Texts/english.xaml b/Anno1800ModLauncher/Texts/english.xaml index eaa99a0..b2a4d31 100644 --- a/Anno1800ModLauncher/Texts/english.xaml +++ b/Anno1800ModLauncher/Texts/english.xaml @@ -22,7 +22,7 @@ Import Install from Github Install from Nexusmods - Install from ZIP + Select ZIP Archives to install from Install Modloader Modding Setup Create Mod Folder @@ -31,6 +31,7 @@ Spice it Up repo Search and select from local drives. Set Game Path + Change Game Path Search and select from local drives Install using the built-in mod browser. Source: @@ -78,6 +79,14 @@ Step 2 Step 3 Step 4 + Active + Inactive + Reload Mods + Select All + + Required DLCs: + Partly Required DLCs: + Needs at least one of those DLCs: Select a profile file to install Select a mod archive to install @@ -85,7 +94,41 @@ Theme Preferences + Language: + Show Console: + Version: Creator: - Known Issues: + Known Issues: + + + The Anarchist + Sunken Treasures + Botanica + The Passage + Seat of Power + Bright Harvest + Land of Lions + Holiday Pack + Amusement Park + City Lights Pack + Docklands + Tourist Season + the High Life + + + + Install from Archive + Archive List + Set all Archives to be installed. + Activate all + Delete all archives after installation + Open Mod Details after installation + Backup archives after installation + INSTALL + + + You already have a profile with this name. Do you want to overwrite it? + Cancel + Overwrite \ No newline at end of file diff --git a/Anno1800ModLauncher/Texts/german.xaml b/Anno1800ModLauncher/Texts/german.xaml index 02d104a..18fb28a 100644 --- a/Anno1800ModLauncher/Texts/german.xaml +++ b/Anno1800ModLauncher/Texts/german.xaml @@ -22,7 +22,7 @@ Importieren von Github installieren von Nexusmods installieren - aus ZIP-Archiv installieren + ZIP-Archive zur Installation auswählen Modloader installieren Modding-Setup Modordner erstellen @@ -31,6 +31,7 @@ Spice it Up Repository Durchsuchen Spielpfad festlegen + Spielpfad ändern Durchsuchen Mit dem eingebauten Modbrowser installieren Quelle: @@ -61,7 +62,7 @@ Profil laden Verwalten Mod-Details: - Liste der Mods + Mods In installierten Mods suchen Name des neuen Profils Aktiv @@ -78,6 +79,15 @@ Schritt 2 Schritt 3 Schritt 4 + + Aktiv + Inaktiv + Mods neu laden + Alles auswählen + + Zwingend benötigte DLC: + Teilweise benötigte DLC: + Benötigt eines der DLC: Ein Profil zum installieren auswählen @@ -86,7 +96,39 @@ Erscheinungsbild Einstellungen + Sprache: + Version: Ersteller: - Bekannte Probleme: - \ No newline at end of file + Bekannte Probleme: + + + Der Anarchist + Gesunkene Schätze + Botanika + Die Passage + Paläste der Macht + Reiche Ernte + Land der Löwen + Weihnachtsmarkt + Vergnügungspark + Lichter der Stadt + Speicherstadt + Reisezeit + Dächer der Stadt + + + Aus Archiv installieren + Archivliste + Alle Archive aktivieren. + Alle aktivieren + Alle Archive nach der Installation löschen + Mod-Details nach Installation anzeigen + Backup der Archive nach Installation + LOS! + + + Ein Profil mit diesem Namen existiert bereits. Überschreiben? + Abbrechen + Überschreiben + diff --git a/Anno1800ModLauncher/Themes/bakery.json b/Anno1800ModLauncher/Themes/bakery.json index 3f6c8b4..ea42713 100644 --- a/Anno1800ModLauncher/Themes/bakery.json +++ b/Anno1800ModLauncher/Themes/bakery.json @@ -65,7 +65,7 @@ }, { "Key": "BackgroundImageBrush", - "Value": "pack://application:,,,/Images/baker.jpg", + "Value": "/Images/baker.jpg", "ReadAs": 1 } ] diff --git a/Anno1800ModLauncher/Themes/botanica.json b/Anno1800ModLauncher/Themes/botanica.json index 5155e52..ba38a50 100644 --- a/Anno1800ModLauncher/Themes/botanica.json +++ b/Anno1800ModLauncher/Themes/botanica.json @@ -65,7 +65,7 @@ }, { "Key": "BackgroundImageBrush", - "Value": "pack://application:,,,/Images/botanica.jpg", + "Value": "/Images/botanica.jpg", "ReadAs": 1 } ] diff --git a/Anno1800ModLauncher/Themes/colorblind.json b/Anno1800ModLauncher/Themes/colorblind.json index 36430d7..deafd54 100644 --- a/Anno1800ModLauncher/Themes/colorblind.json +++ b/Anno1800ModLauncher/Themes/colorblind.json @@ -65,7 +65,7 @@ }, { "Key": "BackgroundImageBrush", - "Value": "pack://application:,,,/Images/colorblind.jpg", + "Value": "/Images/colorblind.jpg", "ReadAs": 1 } ] diff --git a/Anno1800ModLauncher/Themes/default.json b/Anno1800ModLauncher/Themes/default.json index a46e7d6..84636c3 100644 --- a/Anno1800ModLauncher/Themes/default.json +++ b/Anno1800ModLauncher/Themes/default.json @@ -65,7 +65,7 @@ }, { "Key": "BackgroundImageBrush", - "Value": "pack://application:,,,/Images/sunken_treasures.jpg", + "Value": "/Images/sunken_treasures.jpg", "ReadAs": 1 } ] diff --git a/Anno1800ModLauncher/Themes/elephant.json b/Anno1800ModLauncher/Themes/elephant.json index e88c90e..03c0e13 100644 --- a/Anno1800ModLauncher/Themes/elephant.json +++ b/Anno1800ModLauncher/Themes/elephant.json @@ -65,7 +65,7 @@ }, { "Key": "BackgroundImageBrush", - "Value": "pack://application:,,,/Images/elephant.jpg", + "Value": "/Images/elephant.jpg", "ReadAs": 1 } ] diff --git a/Anno1800ModLauncher/Themes/passage.json b/Anno1800ModLauncher/Themes/passage.json index 146e06a..8b131a5 100644 --- a/Anno1800ModLauncher/Themes/passage.json +++ b/Anno1800ModLauncher/Themes/passage.json @@ -65,7 +65,7 @@ }, { "Key": "BackgroundImageBrush", - "Value": "pack://application:,,,/Images/passage.jpg", + "Value": "/Images/passage.jpg", "ReadAs": 1 } ] diff --git a/Anno1800ModLauncher/Themes/workshop.json b/Anno1800ModLauncher/Themes/workshop.json index 0926042..475fa86 100644 --- a/Anno1800ModLauncher/Themes/workshop.json +++ b/Anno1800ModLauncher/Themes/workshop.json @@ -65,7 +65,7 @@ }, { "Key": "BackgroundImageBrush", - "Value": "pack://application:,,,/Images/workshop.jpg", + "Value": "/Images/workshop.jpg", "ReadAs": 1 } ] diff --git a/Anno1800ModLauncher/Themes/worldsfair.json b/Anno1800ModLauncher/Themes/worldsfair.json index af0a8e1..9aae271 100644 --- a/Anno1800ModLauncher/Themes/worldsfair.json +++ b/Anno1800ModLauncher/Themes/worldsfair.json @@ -65,7 +65,7 @@ }, { "Key": "BackgroundImageBrush", - "Value": "pack://application:,,,/Images/worldsfair.jpg", + "Value": "/Images/worldsfair.jpg", "ReadAs": 1 } ] diff --git a/Anno1800ModLauncher/Views/HomeView.xaml b/Anno1800ModLauncher/Views/HomeView.xaml index 63f8c28..0da0082 100644 --- a/Anno1800ModLauncher/Views/HomeView.xaml +++ b/Anno1800ModLauncher/Views/HomeView.xaml @@ -137,6 +137,7 @@ Width="24" DockPanel.Dock="Left"/> @@ -171,7 +172,7 @@ Header="{DynamicResource ModsViewLocalTitleText}" Foreground="{DynamicResource PrimaryHueLightForegroundBrush}" Background ="{DynamicResource PrimaryHueBackgroundBrush}"> - - - + + + - + @@ -88,8 +127,10 @@ + Source="/Images/ModImg_PlaceHolder_2.png" + Grid.Row="0" Stretch="UniformToFill" + HorizontalAlignment="Center" + VerticalAlignment="Center"/> @@ -120,6 +161,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -206,76 +321,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/Anno1800ModLauncher/Views/ModListView.xaml.cs b/Anno1800ModLauncher/Views/ModListView.xaml.cs index a92f2f2..1165781 100644 --- a/Anno1800ModLauncher/Views/ModListView.xaml.cs +++ b/Anno1800ModLauncher/Views/ModListView.xaml.cs @@ -63,6 +63,17 @@ public ProfilesManager profilesManager } } + private String _activeMods { get; set; } + + public String activeMods + { + get { return _activeMods; } + set + { + _activeMods = value; + OnPropertyChanged("activeMods"); + } + } /// /// Raises the PropertyChanged notification in a thread safe manner @@ -94,9 +105,8 @@ public ModListView() profilesManager = new ProfilesManager(); SetProfilesOptions(); OriginalBannerSource = ModBannerImg.Source; - - // - LanguageManager.LanguageChanged += LanguageChanged; + LanguageManager.Instance.LanguageChanged += LanguageChanged; + activeMods = "500"; } private void SetProfilesOptions() @@ -175,6 +185,16 @@ private void ModListBox_SelectionChanged(object sender, SelectionChangedEventArg } } + private void Reload_Mods(object sender, RoutedEventArgs e) + { + ModDirectoryManager.Instance.LoadMods(); + } + + private void Select_All(object sender, RoutedEventArgs e) + { + ModListBox.SelectAll(); + } + private void Save_Profile(object sender, RoutedEventArgs e) { string name; diff --git a/Anno1800ModLauncher/Views/NewsView.xaml.cs b/Anno1800ModLauncher/Views/NewsView.xaml.cs index 4a140d9..37933be 100644 --- a/Anno1800ModLauncher/Views/NewsView.xaml.cs +++ b/Anno1800ModLauncher/Views/NewsView.xaml.cs @@ -44,10 +44,10 @@ private void NewsBrowser_Loaded(object sender, RoutedEventArgs e) //or if app is set to german and the address doesn't equal german URL //then set language if (chromiumWebBrowser.Address == null || - (!LanguageManager.GetLanguage().Equals(HelperEnums.Language.German) && !chromiumWebBrowser.Address.Contains(Properties.Settings.Default.NewsUrl)) || - (LanguageManager.GetLanguage().Equals(HelperEnums.Language.German) && !chromiumWebBrowser.Address.Contains(Properties.Settings.Default.NewsUrlDE))) + (!LanguageManager.Instance.GetLanguage().Equals(HelperEnums.Language.German) && !chromiumWebBrowser.Address.Contains(Properties.Settings.Default.NewsUrl)) || + (LanguageManager.Instance.GetLanguage().Equals(HelperEnums.Language.German) && !chromiumWebBrowser.Address.Contains(Properties.Settings.Default.NewsUrlDE))) { - if (LanguageManager.GetLanguage().Equals(HelperEnums.Language.German)) + if (LanguageManager.Instance.GetLanguage().Equals(HelperEnums.Language.German)) chromiumWebBrowser.Load(Properties.Settings.Default.NewsUrlDE); else chromiumWebBrowser.Load(Properties.Settings.Default.NewsUrl); diff --git a/Anno1800ModLauncher/Views/SettingsView.xaml b/Anno1800ModLauncher/Views/SettingsView.xaml index 7b60665..d5e73b7 100644 --- a/Anno1800ModLauncher/Views/SettingsView.xaml +++ b/Anno1800ModLauncher/Views/SettingsView.xaml @@ -44,7 +44,7 @@ - + @@ -97,7 +97,7 @@ - - - - - + + + + + + + + + + + + + + - English - Deutsch - - - - + English + Deutsch + + + + + + diff --git a/Anno1800ModLauncher/Views/SettingsView.xaml.cs b/Anno1800ModLauncher/Views/SettingsView.xaml.cs index f5481b2..3bbe301 100644 --- a/Anno1800ModLauncher/Views/SettingsView.xaml.cs +++ b/Anno1800ModLauncher/Views/SettingsView.xaml.cs @@ -24,22 +24,35 @@ namespace Anno1800ModLauncher.Views /// public partial class SettingsView : UserControl, INotifyPropertyChanged { - private ThemeLoadingHelper _themeLoadingHelper; - public ThemeLoadingHelper themeLoadingHelper + private ThemeManager _ThemeManager; + public ThemeManager ThemeManager { - get { return _themeLoadingHelper; } + get { return _ThemeManager; } set { - _themeLoadingHelper = value; - OnPropertyChanged("themeLoadingHelper"); + _ThemeManager = value; + OnPropertyChanged("ThemeManager"); } } + + private SettingsManager _SettingsManager; + public SettingsManager SettingsManager + { + get { return _SettingsManager; } + set + { + _SettingsManager = value; + OnPropertyChanged("SettingsManager"); + } + } + public SettingsView() { InitializeComponent(); - themeLoadingHelper = new ThemeLoadingHelper(); + ThemeManager = new ThemeManager(); + SettingsManager = new SettingsManager(); this.DataContext = this; - LanguageComboBox.SelectedIndex = (int)LanguageManager.GetLanguage(); + LanguageComboBox.SelectedIndex = (int)LanguageManager.Instance.GetLanguage(); } private void OnPropertyChanged(string propertyName) { @@ -56,11 +69,16 @@ private void OnPropertyChanged(string propertyName) #endregion - private void ThemeSelection_SelectionChanged(object sender, RoutedEventArgs e) + private void ThemeSelection_SelectionChanged(object sender, RoutedEventArgs e) { - Console.WriteLine("Changed Theme"); ThemeWrap theme = (ThemeWrap)ListViewThemes.SelectedItems[0]; - ThemeManager.SetTheme(theme); + ThemeManager.Instance.ChangeTheme(theme); + } + + private void ConsoleOutput_Toggled(object sender, RoutedEventArgs e) + { + Console.WriteLine("Show Console Output: {0}", SettingsManager.Instance.Visibility); + Properties.Settings.Default.ConsoleVisibility = SettingsManager.Instance.Visibility; } public void LanguageSelection_LanguageChanged(object sender, RoutedEventArgs e) { @@ -68,20 +86,20 @@ public void LanguageSelection_LanguageChanged(object sender, RoutedEventArgs e) { if (LanguageComboBox.SelectedValue.Equals(LanguageComboBoxItemEnglish)) { - LanguageManager.SetLanguage(HelperEnums.Language.English); + LanguageManager.Instance.SetLanguage(HelperEnums.Language.English); } else if (LanguageComboBox.SelectedValue.Equals(LanguageComboBoxItemGerman)) { - LanguageManager.SetLanguage(HelperEnums.Language.German); + LanguageManager.Instance.SetLanguage(HelperEnums.Language.German); } } //disallow user to clear the combo box ^^ else { - if (LanguageManager.GetLanguage() == HelperEnums.Language.English) + if (LanguageManager.Instance.GetLanguage() == HelperEnums.Language.English) { LanguageComboBox.SelectedValue =(LanguageComboBoxItemEnglish); } - else if (LanguageManager.GetLanguage() == HelperEnums.Language.German) + else if (LanguageManager.Instance.GetLanguage() == HelperEnums.Language.German) { LanguageComboBox.SelectedValue = (LanguageComboBoxItemGerman); }