Add F4SE plugin template
Create a minimal Fallout 4 F4SE/CommonLibF4 starter repo with build, packaging, install, and rename scripts, plus initial plugin source, headers, and xmake configuration.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Fallout4Path
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$plugins = Join-Path $root "package\F4SE\Plugins"
|
||||
$target = Join-Path $Fallout4Path "Data\F4SE\Plugins"
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $target | Out-Null
|
||||
Copy-Item -Path (Join-Path $plugins "*") -Destination $target -Force
|
||||
|
||||
Write-Host "Installed plugin files to $target"
|
||||
@@ -0,0 +1,16 @@
|
||||
param(
|
||||
[string]$OutputName = "F4SEPluginTemplate"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$packageDir = Join-Path $root "package"
|
||||
$outFile = Join-Path $root "$OutputName.zip"
|
||||
|
||||
if (Test-Path $outFile) {
|
||||
Remove-Item $outFile -Force
|
||||
}
|
||||
|
||||
Compress-Archive -Path (Join-Path $packageDir "*") -DestinationPath $outFile
|
||||
Write-Host "Created $outFile"
|
||||
@@ -0,0 +1,23 @@
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$NewName,
|
||||
|
||||
[string]$Author = "YourName"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$files = Get-ChildItem -Path $root -Recurse -File | Where-Object {
|
||||
$_.FullName -notmatch "\\\.git\\" -and
|
||||
$_.FullName -notmatch "\\lib\\commonlibf4\\"
|
||||
}
|
||||
|
||||
foreach ($file in $files) {
|
||||
$content = Get-Content $file.FullName -Raw
|
||||
$content = $content.Replace("F4SEPluginTemplate", $NewName)
|
||||
$content = $content.Replace("YourName", $Author)
|
||||
Set-Content -Path $file.FullName -Value $content -NoNewline
|
||||
}
|
||||
|
||||
Write-Host "Renamed template references to $NewName"
|
||||
Reference in New Issue
Block a user