Quake II

From LANCommander
Revision as of 01:23, 1 August 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|id Software}} {{Game.InfoBox.Developer|Hammerhead}} |Publishers = {{Game.InfoBox.Publisher|Activision}} {{Game.InfoBox.Publisher|TecToy}} {{Game.InfoBox.Publisher|Macmillan Digital Publishing}} {{Game.InfoBox.Publisher|Hyperion Entertainment}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|December 9, 1997}} |Genres = {{Game.InfoBox.Genre|Shooter}} | PCGamingWiki = Quake_II }}...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
id Software

Hammerhead

Publishers
Activision

TecToy Macmillan Digital Publishing

Hyperion Entertainment
Release Date
Windows: December 9, 1997
Genres
Shooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play yquake2.exe -portable True

Name Change Script

$NewName = $args[0]
$InstallDir = $PSScriptRoot

function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}

Write-ReplaceContentInFile -Regex '^set name (.+)' -Replacement "set name ""$NewName""" -FilePath "$InstallDir\baseq2\config.cfg"

Install Script

$NewName = $args[0]
$InstallDir = $PSScriptRoot
Add-Type -AssemblyName System.Windows.Forms
$Display = [System.Windows.Forms.Screen]::AllScreens | Where-Object Primary | Select Bounds

function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}

$X = $Display.Width
$Y = $Display.Height

Write-ReplaceContentInFile -Regex 'set r_customheight = (.+)' -Replacement "set r_customheight = ""$Y""" -FilePath "$InstallDir\baseq2\config.cfg"
Write-ReplaceContentInFile -Regex 'set r_customwidth = (.+)' -Replacement "set r_customwidth = ""$X""" -FilePath "$InstallDir\baseq2\config.cfg"
Write-ReplaceContentInFile -Regex 'set vid_fullscreen = (.+)' -Replacement "set vid_fullscreen = ""1""" -FilePath "$InstallDir\baseq2\config.cfg"