Codename: Panzers - Phase One: Difference between revisions
DoctorDalek (talk | contribs) No edit summary |
DoctorDalek (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
}} | }} | ||
{{Game.ActionBox | {{Game.ActionBox | ||
|Actions = | |Actions = | ||
{{Game.ActionBox.Row|Name = Play|Path = |Arguments = |WorkingDirectory = |Primary = | {{Game.ActionBox.Row|Name = Play|Path = PANZERS.exe|Arguments = |WorkingDirectory = |Primary = True}} | ||
}} | }} | ||
{{Game.Scripts.NameChange | {{Game.Scripts.NameChange | ||
|Name = Name Change Script | |Name = Name Change Script | ||
|Description = | |Description = | ||
|RequiresAdmin = | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = <syntaxhighlight lang="powershell" line> | ||
$NewName = $args[0] | $NewName = $args[0] | ||
Line 39: | Line 32: | ||
{{Game.Scripts.Install | {{Game.Scripts.Install | ||
|Name = Install Script | |Name = Install Script | ||
|Description = | |Description = | ||
|RequiresAdmin = | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = <syntaxhighlight lang="powershell" line> | ||
$NewName = $args[0] | $NewName = $args[0] |
Revision as of 06:57, 31 July 2023
Release Date | |
---|---|
Windows: September 30, 2004 | |
View at PCGamingWiki |
Actions
Name | Path | Arguments | Working Directory | Primary |
---|---|---|---|---|
Play | PANZERS.exe | 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 '^Player name = (.+)' -Replacement "Player name = $NewName" -FilePath "$InstallDir\options.ini"
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 'FullScreenWidth = (.+)' -Replacement "FullScreenWidth = $X" -FilePath "$InstallDir\options.ini"
Write-ReplaceContentInFile -Regex 'FullScreenHeight = (.+)' -Replacement "FullScreenHeight = $Y" -FilePath "$InstallDir\options.ini"