Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Fixed a couple of UI annoyances and better inital launch User Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Barker committed Nov 13, 2020
1 parent db875e2 commit d3689a8
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 28 deletions.
6 changes: 6 additions & 0 deletions AmoungUsLauncher.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Debug|x64.ActiveCfg = Debug|x64
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Debug|x64.Build.0 = Debug|x64
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Debug|x86.ActiveCfg = Debug|x86
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Debug|x86.Build.0 = Debug|x86
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Release|Any CPU.Build.0 = Release|Any CPU
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Release|x64.ActiveCfg = Release|x64
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Release|x64.Build.0 = Release|x64
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Release|x86.ActiveCfg = Release|x86
{7D73EE0C-5507-4138-91AC-3C409C59D651}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
51 changes: 50 additions & 1 deletion AmoungUsLauncher/AmoungUsLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<IsWebBootstrapper>false</IsWebBootstrapper>
<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>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -51,6 +67,26 @@
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>D8AA37CC7E80810C66997D261A0C5904D35060AF</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>AmoungUsLauncher_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down Expand Up @@ -110,11 +146,12 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="AmoungUsLauncher_TemporaryKey.pfx" />
<None Include="regionInfo.dat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Resource Include="AmongUs.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
Expand All @@ -128,6 +165,18 @@
<ItemGroup>
<Resource Include="amongus_QTM_icon.ico" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and 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" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions AmoungUsLauncher/GameSelector.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ private void Button_Click(object sender, RoutedEventArgs e)
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Path.Text = this.GamePath;
Application curApp = Application.Current;
Window mainWindow = curApp.MainWindow;
this.Left = mainWindow.Left + (mainWindow.Width - this.ActualWidth) / 2;
this.Top = mainWindow.Top + (mainWindow.Height - this.ActualHeight) / 2;
}

private void Path_PreviewMouseDown(object sender, MouseButtonEventArgs e)
Expand Down
21 changes: 17 additions & 4 deletions AmoungUsLauncher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Loaded="Window_Loaded"
Title="Skeld.net Among Us Launcher" Height="456" Width="806" ResizeMode="NoResize">
<Window.Resources>
<FontFamily x:Key="AmoungUs">AmongUs.ttf</FontFamily>
<FontFamily x:Key="AmongUs">/AmoungUsLauncher;component/#In your face, Joffrey!</FontFamily>
</Window.Resources>
<Grid>
<Grid Height="366" VerticalAlignment="Top" Margin="0,22,0,0" HorizontalAlignment="Left" Width="792">
Expand All @@ -29,23 +29,36 @@
</Style>
</ProgressBar.Style>
</ProgressBar>
<TextBlock Name="LoaderText" Foreground="White" HorizontalAlignment="Left" Margin="15,12,0,0" TextWrapping="Wrap" Text="Press Launch to Begin" VerticalAlignment="Top" FontFamily="/AmoungUsLauncher;component/#In your face, Joffrey!" FontSize="24" Width="646"/>
<TextBlock Name="LoaderText" Foreground="White" HorizontalAlignment="Left" Margin="15,12,0,0" TextWrapping="Wrap" Text="Press Launch to Begin" VerticalAlignment="Top" FontFamily="{StaticResource AmongUs}" FontSize="24" Width="646"/>
</Grid>
<Grid HorizontalAlignment="Left" Height="53" Margin="669,366,0,0" VerticalAlignment="Top" Width="123" Background="Black">
<Button Name="PlayBtn" Click="PlayBtn_Click" Content="Launch" HorizontalAlignment="Left" Margin="4,4,2,2" VerticalAlignment="Top" Height="41" Width="111">
<Button Name="PlayBtn" Click="PlayBtn_Click" Content="Set Path" HorizontalAlignment="Left" Margin="4,4,2,2" VerticalAlignment="Top" Height="41" Width="111" FontFamily="/AmoungUsLauncher;component/#In your face, Joffrey!">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border CornerRadius="4" BorderBrush="White" BorderThickness="4">
<TextBlock FontSize="24" FontFamily="{StaticResource AmoungUs}" HorizontalAlignment="Center" Foreground="White" Text="{TemplateBinding Content}" Margin="{TemplateBinding Margin}" ></TextBlock>
<TextBlock FontSize="24" FontFamily="{StaticResource AmongUs}" HorizontalAlignment="Center" Foreground="White" Text="{TemplateBinding Content}" Margin="{TemplateBinding Margin}" ></TextBlock>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="Black"/>
<Setter Property="Foreground" Value="White"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border CornerRadius="4" BorderBrush="Green" BorderThickness="4">
<TextBlock FontSize="24" FontFamily="{StaticResource AmongUs}" HorizontalAlignment="Center" Foreground="White" Text="{TemplateBinding Content}" Margin="{TemplateBinding Margin}" ></TextBlock>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
Expand Down
62 changes: 39 additions & 23 deletions AmoungUsLauncher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,56 @@ private string ReadGamePath()
}
}

private void setPath()
{
GameSelector gs = new GameSelector();
gs.GamePath = this.GamePath;
gs.ShowDialog();
this.GamePath = gs.GamePath;
if (GamePath == "")
{
LoaderText.Text = "Please set Game Path";
PlayBtn.Content = "Set Path";
}
else
{
LoaderText.Text = "Press Launch to Begin";
PlayBtn.Content = "Launch";
SaveGamePath();
}
}

private void Window_Loaded(object sender, RoutedEventArgs e)
{
if (GamePath == "")
{
PlayBtn.IsEnabled = false;
LoaderText.Text = "Please set Game Path";
PlayBtn.Content = "Set Path";
}
else
{
PlayBtn.Content = "Launch";
}
}

private void PlayBtn_Click(object sender, RoutedEventArgs e)
{
string AppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string AppDataLocalLow = System.IO.Path.GetFullPath(AppDataPath + "\\..\\LocalLow\\");
try
if (this.GamePath == "")
{
setPath();
}
else
{
File.Delete(AppDataLocalLow + "\\Innersloth\\Among Us\\regionInfo.dat");
File.Copy("./regionInfo.dat", AppDataLocalLow + "\\Innersloth\\Among Us\\regionInfo.dat");
Process.Start(this.GamePath);
string AppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string AppDataLocalLow = System.IO.Path.GetFullPath(AppDataPath + "\\..\\LocalLow\\");
try
{
File.Delete(AppDataLocalLow + "\\Innersloth\\Among Us\\regionInfo.dat");
File.Copy("./regionInfo.dat", AppDataLocalLow + "\\Innersloth\\Among Us\\regionInfo.dat");
Process.Start(this.GamePath);
}
catch (Exception) { }
}
catch (Exception){}
}

private void MenuItem_Exit_Click(object sender, RoutedEventArgs e)
Expand All @@ -75,21 +105,7 @@ private void MenuItem_Exit_Click(object sender, RoutedEventArgs e)

private void MenuItem_SetPath_Click(object sender, RoutedEventArgs e)
{
GameSelector gs = new GameSelector();
gs.GamePath = this.GamePath;
gs.ShowDialog();
this.GamePath = gs.GamePath;
if (GamePath == "")
{
PlayBtn.IsEnabled = false;
LoaderText.Text = "Please set Game Path";
}
else
{
PlayBtn.IsEnabled = true;
LoaderText.Text = "Press Launch to Begin";
SaveGamePath();
}
setPath();
}
}
}

0 comments on commit d3689a8

Please sign in to comment.