Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
da72544
Merge pull request #1 from LemonDrop1228/master
taubenangriff Jan 26, 2021
c2053b5
load theme images from output directory to make custom themes easier
taubenangriff Jan 26, 2021
188efda
support version and needed DLC in mod descriptions
taubenangriff Jan 28, 2021
cdb5cdc
Fix Image Squeezing, new Default Modbanner by Alucarddarkking
taubenangriff Jan 28, 2021
e7b7606
Merge pull request #4 from taubenangriff/master
dianaw353 Jan 28, 2021
ab91b28
Delete python35_ubi.dll
dianaw353 Jan 30, 2021
70f4c2f
Delete python35.dll
dianaw353 Jan 30, 2021
cdf5e64
updated mod loader files
dianaw353 Jan 30, 2021
6418493
fix directory renaming bug, make it pretty
taubenangriff Jan 31, 2021
c2c1cc2
Several Stability Improvements
taubenangriff Jan 31, 2021
79db506
Merge pull request #5 from taubenangriff/master
dianaw353 Jan 31, 2021
77d757a
Add new DLC Ids in ModDirectoryManager.cs
taubenangriff Feb 22, 2021
9ce54e6
Update english.xaml
taubenangriff Feb 22, 2021
177740a
Update german.xaml
taubenangriff Feb 22, 2021
93c492a
Merge pull request #6 from taubenangriff/master
dianaw353 Feb 22, 2021
cf3e0f7
Added information about mod count, reload, select all to Mods View, a…
taubenangriff Mar 14, 2021
3548d37
Merge changes from today
taubenangriff Mar 14, 2021
6a7535b
Fix User Setting ConsoleVisibility being null by default
taubenangriff Mar 14, 2021
c25e227
Merge pull request #7 from taubenangriff/master
dianaw353 Mar 14, 2021
2effe31
Fix crashes caused by corrupted base64 strings, simplify mod installa…
taubenangriff Mar 19, 2021
f00c278
Merge pull request #8 from taubenangriff/master
dianaw353 Mar 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 51 additions & 36 deletions Anno1800ModLauncher/Anno1800ModLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
Expand Down Expand Up @@ -52,14 +67,17 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>
</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<DebugType>none</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>8.0</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Anno1800ModLauncher.App</StartupObject>
Expand Down Expand Up @@ -99,6 +117,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
Expand Down Expand Up @@ -147,17 +166,13 @@
<Compile Include="Helpers\Serializable\ModIdActiveTouple.cs" />
<Compile Include="Helpers\Serializable\Modinfo.cs" />
<Compile Include="Helpers\Serializable\Theme.cs" />
<Compile Include="Helpers\SettingsManager.cs" />
<Compile Include="Helpers\ThemeManager.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<DependentUpon>Resources.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Properties\Resources.en-EN.Designer.cs">
<DependentUpon>Resources.en-EN.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\AboutView.xaml.cs">
<DependentUpon>AboutView.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -228,11 +243,6 @@
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.de-DE.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.de-DE.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
Expand All @@ -242,14 +252,6 @@
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</None>
<None Include="Properties\Resources.en-EN.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.en-EN.Designer.cs</LastGenOutput>
</None>
<None Include="Properties\Resources.de-DE.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.de-DE.Designer.cs</LastGenOutput>
</None>
<None Include="anno1800modlaunchercert.pfx" />
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
Expand Down Expand Up @@ -292,30 +294,31 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Images\ANNO1800_LOGO_white_Shaded3.png" />
<Resource Include="Images\sunken_treasures.jpg">
<Resource Include="Images\ModImg_PlaceHolder_2.png" />
<Content Include="Images\sunken_treasures.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\baker.jpg">
</Content>
<Content Include="Images\baker.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\elephant.jpg">
</Content>
<Content Include="Images\elephant.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\botanica.jpg">
</Content>
<Content Include="Images\botanica.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\passage.jpg">
</Content>
<Content Include="Images\passage.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\colorblind.jpg">
</Content>
<Content Include="Images\colorblind.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\workshop.jpg">
</Content>
<Content Include="Images\workshop.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\worldsfair.jpg">
</Content>
<Content Include="Images\worldsfair.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
</Content>
<Content Include="Libs\python35.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -357,5 +360,17 @@
<ItemGroup>
<Folder Include="Mods\" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 und x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
3 changes: 3 additions & 0 deletions Anno1800ModLauncher/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<setting name="NewsUrlDE" serializeAs="String">
<value>https://anno-union.com/de/</value>
</setting>
<setting name="ConsoleVisibility" serializeAs="String">
<value>True</value>
</setting>
</Anno1800ModLauncher.Properties.Settings>
</userSettings>
<applicationSettings>
Expand Down
16 changes: 7 additions & 9 deletions Anno1800ModLauncher/CustomDialogs/ModInstallationDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
Expand All @@ -34,12 +34,12 @@
Margin="8,0,0,0"
VerticalAlignment="Center"
Style="{StaticResource MaterialDesignTextBlock}"
Text="Mod List" />
Text="{DynamicResource InstallDialogModListText}" />
</StackPanel>
<Button DockPanel.Dock="Right" Margin="5"
Style="{StaticResource MaterialDesignRaisedDarkButton}"
Width="100"
ToolTip="Set all mods to be activated after installation." HorizontalAlignment="Right" Content="Activate All" Padding="1" Click="ActivateAll_Click"/>
ToolTip="{DynamicResource InstallDialogActivateButtonTooltipText}" HorizontalAlignment="Right" Content="{DynamicResource InstallDialogActivateButtonText}" Padding="1" Click="ActivateAll_Click"/>
</DockPanel>
</DataTemplate>
</GroupBox.HeaderTemplate>
Expand Down Expand Up @@ -130,16 +130,14 @@
<CheckBox x:Name="OpenModDetailsCB" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource MaterialDesignLightCheckBox}"/>
<CheckBox Grid.Column="0" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource MaterialDesignLightCheckBox}" IsChecked="{Binding ElementName=ModInstallWindow, Path=ModInstallationManager.BackupAfterInstall, Mode=TwoWay}"/>

<Label Grid.Column="1" Grid.Row="0" Content="Delete all archives after installation" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<Label Grid.Column="1" Grid.Row="1" Content="Open Mod Details after installation" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<Label Grid.Column="1" Grid.Row="2" Content="Backup archives after installation" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<Label Grid.Column="1" Grid.Row="0" Content="{DynamicResource InstallDialogDeleteArchivesLabelText}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<Label Grid.Column="1" Grid.Row="1" Content="{DynamicResource InstallDialogOpenDetailsLabelText}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<Label Grid.Column="1" Grid.Row="2" Content="{DynamicResource InstallDialogBackupLabelText}" VerticalAlignment="Center" HorizontalAlignment="Left"/>

<Button x:Name="InstallButton" Grid.Column="3" Grid.RowSpan="3" IsDefault="True"
Style="{StaticResource MaterialDesignFloatingActionDarkButton}"
materialDesign:ButtonProgressAssist.IsIndicatorVisible="True"
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Installing}" HorizontalAlignment="Right" Margin="0,0,15,0" Click="InstallMods_Clicked">
INSTALL
</Button>
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Installing}" HorizontalAlignment="Right" Margin="0,0,15,0" Click="InstallMods_Clicked" Content="{DynamicResource InstallDialogInstallButtonText}"/>
</Grid>
</GroupBox>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
<ColumnDefinition Width="0.2*"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.ColumnSpan="3" FontSize="24" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center">
You already have a profile with this name.
<LineBreak/>Do you want to overwrite it?
<TextBlock Grid.ColumnSpan="3" FontSize="24" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Text="{DynamicResource DuplicateProfileDialogMainText}">
</TextBlock>
<Button Grid.Row="1" Margin="5" Click="Cancel_Click">
<Button Grid.Row="1" Grid.Column="2" Margin="5" Click="Cancel_Click">
<DockPanel>
<materialDesign:PackIcon
Kind="Cancel"
Expand All @@ -33,10 +31,10 @@
<TextBlock
VerticalAlignment="Center"
HorizontalAlignment="Right"
DockPanel.Dock="Right" Margin="10,0,0,0"><Run Text="Cancel"/></TextBlock>
DockPanel.Dock="Right" Margin="10,0,0,0"><Run Text="{DynamicResource DuplicateProfileDialogCancelButtonText}"/></TextBlock>
</DockPanel>
</Button>
<Button Grid.Row="1" Grid.Column="2" Margin="5" Click="Overwrite_Click">
<Button Grid.Row="1" Margin="5" Click="Overwrite_Click">
<DockPanel>
<materialDesign:PackIcon
Kind="ContentSave"
Expand All @@ -46,7 +44,7 @@
<TextBlock
VerticalAlignment="Center"
HorizontalAlignment="Right"
DockPanel.Dock="Right" Margin="10,0,0,0"><Run Text="Overwrite"/></TextBlock>
DockPanel.Dock="Right" Margin="10,0,0,0"><Run Text="{DynamicResource DuplicateProfileDialogOverrideButtonText}"/></TextBlock>
</DockPanel>
</Button>
</Grid>
Expand Down
36 changes: 28 additions & 8 deletions Anno1800ModLauncher/Helpers/LanguageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,33 @@
namespace Anno1800ModLauncher.Helpers
{
/// <summary>
/// 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.
/// </summary>
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) {
Expand All @@ -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) };
Expand All @@ -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);
}
}
}
Loading