Skip to content

Commit

Permalink
Added button and default config for the Game.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
therimmer96 committed Nov 17, 2023
1 parent 733e413 commit f4bf8e9
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ASA-Manager/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<Button x:Name="btn_run" Content="RUN" Margin="0,0,10,10" Click="Button_Click" HorizontalAlignment="Right" Width="204" Height="43" VerticalAlignment="Bottom"/>
<Button x:Name="btn_openUpdater" Content="Open Updater" HorizontalAlignment="Left" Margin="187,10,0,0" VerticalAlignment="Top" Height="28" Width="185" Click="btn_openUpdater_Click"/>
<Button x:Name="btn_openConfig" Content="Open Configuration" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="28" Width="172" Click="btn_openConfig_Click"/>
<Button x:Name="btn_openConfigFolder" Content="Open Game Config" HorizontalAlignment="Left" Margin="377,10,0,0" VerticalAlignment="Top" Height="28" Width="185" Click="btn_openConfigFolder_Click"/>
<Button x:Name="btn_openGUSConfig" Content="Open GUS.ini Config" HorizontalAlignment="Left" Margin="377,10,0,0" VerticalAlignment="Top" Height="28" Width="185" Click="btn_openGUSConfig_Click"/>
<Button x:Name="btn_openGameINIConfig" Content="Open Game.ini Config" HorizontalAlignment="Left" Margin="377,43,0,0" VerticalAlignment="Top" Height="28" Width="185" Click="btn_openGameINIConfig_Click"/>

</Grid>
</Window>
30 changes: 28 additions & 2 deletions ASA-Manager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void Window_Activated(object sender, EventArgs e)
SetButtonStatus();
}

private void btn_openConfigFolder_Click(object sender, RoutedEventArgs e)
private void btn_openGUSConfig_Click(object sender, RoutedEventArgs e)
{
string GUSConfigPath = Path.Combine(((ASCTConfiguration)Application.Current.Properties["globalConfig"]).GameDirectory, @"ShooterGame\Saved\Config\WindowsServer\GameUserSettings.ini");

Expand All @@ -114,7 +114,7 @@ private void btn_openConfigFolder_Click(object sender, RoutedEventArgs e)
}
else
{
string message = "No config file currently exists. Would you like to create one from the template?";
string message = "No gameusersettings.ini file currently exists. Would you like to create one from the template?";
string caption = "Missing Config";
MessageBoxResult result = MessageBox.Show(message, caption,
MessageBoxButton.YesNo );
Expand All @@ -127,5 +127,31 @@ private void btn_openConfigFolder_Click(object sender, RoutedEventArgs e)
}
}
}

private void btn_openGameINIConfig_Click(object sender, RoutedEventArgs e)
{
string GameConfigPath = Path.Combine(((ASCTConfiguration)Application.Current.Properties["globalConfig"]).GameDirectory, @"ShooterGame\Saved\Config\WindowsServer\Game.ini");

if (File.Exists(GameConfigPath))
{
Process.Start("notepad.exe", GameConfigPath).WaitForExit();
}
else
{
string message = "No game.ini file currently exists. Would you like to create one from the template?";
string caption = "Missing Config";
MessageBoxResult result = MessageBox.Show(message, caption,
MessageBoxButton.YesNo);

if (result == MessageBoxResult.Yes)
{
Directory.CreateDirectory(Path.GetDirectoryName(GameConfigPath));
File.WriteAllText(GameConfigPath, Properties.Resources.GameConfigTemplate);
Process.Start("notepad.exe", GameConfigPath).WaitForExit();
}
}
}


}
}
9 changes: 9 additions & 0 deletions ASA-Manager/Properties/Resources.Designer.cs

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

5 changes: 4 additions & 1 deletion ASA-Manager/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="GameConfigTemplate" xml:space="preserve">
<value>[/script/shootergame.shootergamemode]</value>
</data>
<data name="GUSConfigTemplate" xml:space="preserve">
<value>[ScalabilityGroups]
sg.ResolutionQuality=75
Expand Down Expand Up @@ -429,7 +432,7 @@ ImplantSuicideCD=28800
AllowHitMarkers=True

[SessionSettings]
SessionName=Nitrado Suck
SessionName=Server Created by ASCT

[/Script/Engine.GameSession]
MaxPlayers=70</value>
Expand Down

0 comments on commit f4bf8e9

Please sign in to comment.