$Display = Get-PrimaryDisplay
Write-ReplaceContentInFile -Pattern '^SCREEN_RESOLUTION = .+' -Substitution "SCREEN_RESOLUTION = 24" -FilePath "$InstallDirectory\Ja2.ini"
Write-ReplaceContentInFile -Pattern '^EDITOR_SCREEN_RESOLUTION = .+' -Substitution "EDITOR_SCREEN_RESOLUTION = 24" -FilePath "$InstallDirectory\Ja2.ini"
Write-ReplaceContentInFile -Pattern '^CUSTOM_SCREEN_RESOLUTION_X = .+' -Substitution "CUSTOM_SCREEN_RESOLUTION_X = $($Display.Bounds.Width)" -FilePath "$InstallDirectory\Ja2.ini"
Write-ReplaceContentInFile -Pattern '^CUSTOM_SCREEN_RESOLUTION_Y = .+' -Substitution "CUSTOM_SCREEN_RESOLUTION_Y = $($Display.Bounds.Height)" -FilePath "$InstallDirectory\Ja2.ini"
if ($NewPlayerAlias.Length -gt 11) {
$NewPlayerAlias = $NewPlayerAlias.Substring(0, 11)
}
Write-ReplaceContentInFile -Pattern '^PLAYER_NAME = (.+)' -Substitution "PLAYER_NAME = $NewPlayerAlias" -FilePath "$InstallDirectory\Profiles\UserProfile_JA2113\Ja2_mp.ini"