$Display = Get-PrimaryDisplay
Write-ReplaceContentInFile -Pattern '\$pref::VideoFullScreenRes = "(.+)"' -Substitution "`$pref::VideoFullScreenRes = ""$($Display.Bounds.Width)x$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\config\ClientPrefs.cs"
# Might need to set FOV
$FOV = 90
if (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 9)) {
$FOV = 106
} elseif (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 10)) {
$FOV = 100
}
Write-ReplaceContentInFile -Pattern '\$pref::PlayerFov = "(.+)"' -Substitution "`$pref::PlayerFov = ""$FOV""" -FilePath "$InstallDirectory\config\ClientPrefs.cs"
Write-ReplaceContentInFile -Pattern '\$PCFG::Name = (.+)' -Substitution "`$PCFG::Name = ""$NewPlayerAlias"";" -FilePath "$InstallDirectory\config\Players.cs"
Write-ReplaceContentInFile -Pattern '\$PCFG::Name0 = (.+)' -Substitution "`$PCFG::Name0 = ""$NewPlayerAlias"";" -FilePath "$InstallDirectory\config\Players.cs"
Write-ReplaceContentInFile -Pattern '\$PCFG::RealName = (.+)' -Substitution "`$PCFG::RealName = ""$NewPlayerAlias"";" -FilePath "$InstallDirectory\config\Players.cs"
Write-ReplaceContentInFile -Pattern '\$PCFG::RealName0 = (.+)' -Substitution "`$PCFG::RealName0 = ""$NewPlayerAlias"";" -FilePath "$InstallDirectory\config\Players.cs"