DEFCON: Difference between revisions
DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Introversion Software}} |Publishers = {{Game.InfoBox.Publisher|Introversion Software}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|September 29, 2006}} |Genres = {{Game.InfoBox.Genre|Real Time Strategy (RTS)}} {{Game.InfoBox.Genre|Strategy}} {{Game.InfoBox.Genre|Indie}} | PCGamingWiki = DEFCON }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = defcon_o...") |
DoctorDalek (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 9: | Line 9: | ||
{{Game.InfoBox.ReleaseDate|Windows|September 29, 2006}} | {{Game.InfoBox.ReleaseDate|Windows|September 29, 2006}} | ||
|Genres = | |Genres = | ||
{{Game.InfoBox.Genre| | {{Game.InfoBox.Genre|Indie}}{{Game.InfoBox.Genre|Real Time Strategy (RTS)}}{{Game.InfoBox.Genre|Strategy}} | ||
{{Game.InfoBox.Genre|Strategy}} | |PCGamingWiki = DEFCON}} | ||
{{Game.InfoBox.Genre| | |||
| PCGamingWiki = DEFCON | |||
}} | |||
{{Game.ActionBox | {{Game.ActionBox | ||
|Actions = | |Actions = | ||
{{Game.ActionBox.Row|Name = Play|Path = defcon_offline.exe|Arguments = |WorkingDirectory = |Primary = True}} | {{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\defcon_offline.exe|Arguments = |WorkingDirectory = |Primary = True}} | ||
}} | }} | ||
{{Game.Scripts. | |||
|Name = | {{Game.Scripts.Install | ||
|Name = Install Script | |||
|Description = | |Description = | ||
|RequiresAdmin = False | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = | ||
$ | <syntaxhighlight lang="powershell" line> | ||
$ | # 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 '^ScreenWidth = "(.+)"' -Substitution "ScreenWidth $($Display.Bounds.Width)" -FilePath "$InstallDirectory\preferences.txt" | |||
Write-ReplaceContentInFile -Pattern '^ScreenHeight = "(.+)"' -Substitution "ScreenHeight $($Display.Bounds.Height)" -FilePath "$InstallDirectory\preferences.txt" | |||
Write-ReplaceContentInFile - | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
{{Game.Scripts. | {{Game.Scripts.NameChange | ||
|Name = | |Name = Name Change Script | ||
|Description = | |Description = | ||
|RequiresAdmin = False | |RequiresAdmin = False | ||
|Contents = <syntaxhighlight lang="powershell" line> | |Contents = | ||
<syntaxhighlight lang="powershell" line> | |||
# | # Trim a string down to a specified amount of characters | ||
if ($NewPlayerAlias.Length -gt 16) { | |||
$ | $NewPlayerAlias = $NewPlayerAlias.Substring(0, 16); | ||
{ | |||
$ | |||
} | } | ||
Write-ReplaceContentInFile -Pattern '^PlayerName = (.+)' -Substitution "PlayerName = $NewPlayerAlias" -FilePath "$InstallDirectory\preferences.txt" | |||
Write-ReplaceContentInFile - | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} |
Latest revision as of 00:40, 22 February 2024
Developers | |
---|---|
Introversion Software | |
Publishers | |
Introversion Software | |
Release Date | |
Windows: September 29, 2006 | |
Genres | |
IndieReal Time Strategy (RTS)Strategy | |
View at PCGamingWiki |
Actions
Name | Path | Arguments | Working Directory | Primary |
---|---|---|---|---|
Play | {InstallDir}\defcon_offline.exe | True |
Install Script
# 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 '^ScreenWidth = "(.+)"' -Substitution "ScreenWidth $($Display.Bounds.Width)" -FilePath "$InstallDirectory\preferences.txt"
Write-ReplaceContentInFile -Pattern '^ScreenHeight = "(.+)"' -Substitution "ScreenHeight $($Display.Bounds.Height)" -FilePath "$InstallDirectory\preferences.txt"
Name Change Script
# Trim a string down to a specified amount of characters
if ($NewPlayerAlias.Length -gt 16) {
$NewPlayerAlias = $NewPlayerAlias.Substring(0, 16);
}
Write-ReplaceContentInFile -Pattern '^PlayerName = (.+)' -Substitution "PlayerName = $NewPlayerAlias" -FilePath "$InstallDirectory\preferences.txt"