# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^\$pref::Server::Info = "(.+)";' -Substitution "`$pref::Server::Info = ""Older than your mother!"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Server::Name = "(.+)";' -Substitution "`$pref::Server::Name = ""Vintage"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Server::MaxPlayers = "(.+)";' -Substitution "`$pref::Server::MaxPlayers = ""16"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::displayDevice = "(.+)";' -Substitution "`$pref::Video::displayDevice = ""OpenGL"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::fullScreen = "(.+)";' -Substitution "`$pref::Video::fullScreen = ""1"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::resolution = "(.+)";' -Substitution "`$pref::Video::resolution = ""$($Display.Bounds.Width) $($Resolution.Height) 32"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Server::Info = "(.+)";' -Substitution "`$pref::Server::Info = ""Older than your mother!"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Server::Name = "(.+)";' -Substitution "`$pref::Server::Name = ""Vintage"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Server::MaxPlayers = "(.+)";' -Substitution "`$pref::Server::MaxPlayers = ""16"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::displayDevice = "(.+)";' -Substitution "`$pref::Video::displayDevice = ""OpenGL"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::fullScreen = "(.+)";' -Substitution "`$pref::Video::fullScreen = ""1"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Video::resolution = "(.+)";' -Substitution "`$pref::Video::resolution = ""$($Display.Bounds.Width) $($Display.Bounds.Height) 32"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Player::Name = "(.+)";' -Substitution "`$pref::Player::Name = ""$NewPlayerAlias"";" -FilePath "$InstallDirectory\common\client\prefs.cs"
Write-ReplaceContentInFile -Pattern '^\$pref::Player::Name = "(.+)";' -Substitution "`$pref::Player::Name = ""$NewPlayerAlias"";" -FilePath "$InstallDirectory\rw\client\prefs.cs"