Files
Paradise/tools/rustlibs_tools/mapmanip.ps1
warriorstar-orion 0031225055 New mapmanip function: map orientation. (#28559)
* New mapmanip function: map orientation.

* Build Rust library

* rotate, don't flip

* Build Rust library

* Build Rust library

* remove from maps with airlock placers

* update mapmanip ps1 dll location

* attempt rebuild locally

* better error message and proper string conversion

* Build Rust library

---------

Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com>
2025-03-20 15:06:25 +00:00

42 lines
1.5 KiB
PowerShell

# if you want to run this script but it opens in notepad
# you may want to right click it and "run with powershell"
# script explanation
echo "*****"
echo "This script will run map manipulations on every `.dmm` map that has a `.jsonc` config file,"
echo "and write it to a `.mapmanipout.dmm` file in the same location."
echo "Make sure to not commit these files to the repo."
echo "This script will not show any error messages if map manipulations have failed."
echo "Should launch the actual server to get stacktraces and the like."
echo "*****"
# find path to rustlibs.dll
if (Test-Path "./rust/target/i686-pc-windows-msvc/release/rustlibs_515.dll") {
$BapiPath = "./rust/target/i686-pc-windows-msvc/release/rustlibs_515.dll"
}
elseif (Test-Path "./rust/target/i686-pc-windows-msvc/debug/rustlibs_515.dll") {
$BapiPath = "./rust/target/i686-pc-windows-msvc/debug/rustlibs_515.dll"
}
elseif (Test-Path "./rustlibs_515.dll") {
$BapiPath = "./rustlibs_515.dll"
}
else {
echo "Cannot find rustlibs."
}
# run ffi function from rustlibs.dll
echo "Executing..."
$BapiDllFunction = "all_mapmanip_configs_execute_ffi"
$BapiExecutionTime = Measure-Command {
# `rundll` runs a function from a dll
# the very sad limitation is that it does not give any output from that function
rundll32.exe $BapiPath $BapiDllFunction
}
# done
echo "Done!"
echo ("Took {0} seconds, or {1} milliseconds in total." -f $BapiExecutionTime.Seconds, $BapiExecutionTime.Milliseconds)
echo "*****"
Read-Host -Prompt "Press Enter to exit..."