Skip to content

Commit

Permalink
Sync latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Sampson committed Mar 28, 2018
1 parent 05f053a commit 159f7fe
Show file tree
Hide file tree
Showing 24 changed files with 44,198 additions and 775 deletions.
2 changes: 1 addition & 1 deletion BorderlessGaming.Logic/BorderlessGaming.Logic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\BGKey.pfx</AssemblyOriginatorKeyFile>
Expand Down
14 changes: 11 additions & 3 deletions BorderlessGaming.Logic/Core/LanguageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,17 @@ private static bool LanguageSelected(ToolStripItemCollection dropDownItems)

private static bool IsDefault(string displayName)
{
var defaultCulture = Config.Instance.AppSettings.DefaultCulture;
var langauge = Languages.Values.FirstOrDefault(lang => lang.DisplayName.Equals(displayName));
return langauge != null && langauge.Culture.Equals(defaultCulture);
try
{
var defaultCulture = Config.Instance.AppSettings.DefaultCulture;
var langauge = Languages.Values.FirstOrDefault(lang => lang.DisplayName.Equals(displayName));
return langauge != null && langauge.Culture.Equals(defaultCulture);
}
catch
{

return false;
}
}

private static void SetDefaultLanguage(string tsiText)
Expand Down
5 changes: 5 additions & 0 deletions BorderlessGaming.Logic/Models/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,10 @@ public class AppSettings
[ProtoMember(12)]
[DefaultValue("en-US")]
public string DefaultCulture { get; set; } = "en-US";

[ProtoMember(13)]
[DefaultValue(true)]
public bool ShowAdOnStart { get; set; } = true;

}
}
11 changes: 10 additions & 1 deletion BorderlessGaming/BorderlessGaming.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\BGKey.pfx</AssemblyOriginatorKeyFile>
Expand Down Expand Up @@ -97,6 +97,12 @@
<Compile Include="Forms\MainWindow.Designer.cs">
<DependentUpon>MainWindow.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Rainway.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\Rainway.Designer.cs">
<DependentUpon>Rainway.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Forms\AboutForm.de.resx">
Expand Down Expand Up @@ -137,6 +143,9 @@
<EmbeddedResource Include="Forms\MainWindow.zh-CN.resx">
<DependentUpon>MainWindow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Rainway.resx">
<DependentUpon>Rainway.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
Expand Down
11 changes: 11 additions & 0 deletions BorderlessGaming/Forms/MainWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions BorderlessGaming/Forms/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ public MainWindow()
_watcher = new ProcessWatcher(this);
InitializeComponent();
LanguageManager.Setup(toolStripLanguages);
if (Config.Instance.AppSettings.ShowAdOnStart)
{
var rainway = new Rainway { StartPosition = this.StartPosition, TopMost = true};
rainway.ShowDialog(this);
rainway.BringToFront();
}

}

public void AddFavoriteToList(Favorite fav)
Expand Down Expand Up @@ -229,6 +236,10 @@ private async Task RefreshProcesses()
lstProcesses.Items.Clear();
await _watcher.Refresh();
}
private void rainwayToolStrip_Click(object sender, EventArgs e)
{
Tools.GotoSite("https://rainway.io/?ref=borderlessgaming");
}

private void usageGuideToolStripMenuItem_Click(object sender, EventArgs e)
{
Expand Down
77 changes: 77 additions & 0 deletions BorderlessGaming/Forms/Rainway.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions BorderlessGaming/Forms/Rainway.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using BorderlessGaming.Logic.Models;
using BorderlessGaming.Logic.System;

namespace BorderlessGaming.Forms
{
public partial class Rainway : Form
{
public Rainway()
{
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
InitializeComponent();
}

private void Rainway_Load(object sender, EventArgs e)
{

}

private void Rainway_Click(object sender, EventArgs e)
{
Tools.GotoSite("https://rainway.io/?ref=borderlessgaming2");
this.Close();
}

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
var checkbox = (CheckBox) sender;
Config.Instance.AppSettings.ShowAdOnStart = checkbox.Checked != true;
}

private void Rainway_MouseEnter(object sender, EventArgs e)
{
Cursor = Cursors.Hand;
}
}
}
Loading

0 comments on commit 159f7fe

Please sign in to comment.