Skip to content

Commit 555e8ae

Browse files
Merge pull request #14 from kodenamekrak/main
1.28.0
2 parents 1e3de40 + 04635f3 commit 555e8ae

16 files changed

Lines changed: 82 additions & 422 deletions

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Android.mk.backup
5555
[Ee]xtern/
5656
*.qmod
5757
mod.json
58+
qpm_defines.cmake
5859
qpm.shared.json
5960
![Cc][Mm]ake[Ll]ists.txt
6061

@@ -64,5 +65,4 @@ cmake-build-*/
6465
extern.cmake
6566

6667
# QMOD Schema
67-
mod.json.schema
68-
ndkpath.txt
68+
mod.json.schema

.vscode/c_cpp_properties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"defines": [
55
"MOD_ID=\"#{id}\"",
6-
"VERSION=\"0.1.0\"",
6+
"VERSION=\"#{version}\"",
77
"__GNUC__",
88
"__aarch64__"
99
],

Android.mk

Lines changed: 0 additions & 68 deletions
This file was deleted.

Application.mk

Lines changed: 0 additions & 5 deletions
This file was deleted.

bmbfmod.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

build.ps1

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,25 @@ Param(
77
)
88

99
if ($help -eq $true) {
10-
echo "`"Build`" - Copiles your mod into a `".so`" or a `".a`" library"
11-
echo "`n-- Arguments --`n"
10+
Write-Output "`"Build`" - Copiles your mod into a `".so`" or a `".a`" library"
11+
Write-Output "`n-- Arguments --`n"
1212

13-
echo "-Clean `t`t Deletes the `"build`" folder, so that the entire library is rebuilt"
13+
Write-Output "-Clean `t`t Deletes the `"build`" folder, so that the entire library is rebuilt"
1414

1515
exit
1616
}
1717

1818
# if user specified clean, remove all build files
19-
if ($clean.IsPresent)
20-
{
21-
if (Test-Path -Path "build")
22-
{
19+
if ($clean.IsPresent) {
20+
if (Test-Path -Path "build") {
2321
remove-item build -R
2422
}
2523
}
2624

2725

28-
if (($clean.IsPresent) -or (-not (Test-Path -Path "build")))
29-
{
30-
$out = new-item -Path build -ItemType Directory
26+
if (($clean.IsPresent) -or (-not (Test-Path -Path "build"))) {
27+
new-item -Path build -ItemType Directory
3128
}
3229

33-
cd build
34-
& cmake -G "Ninja" -DCMAKE_BUILD_TYPE="RelWithDebInfo" ../
35-
& cmake --build .
36-
cd ..
30+
& cmake -G "Ninja" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -B build
31+
& cmake --build ./build

copy.ps1

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ Param(
1818
[String] $custom="",
1919

2020
[Parameter(Mandatory=$false)]
21-
[Switch] $file,
21+
[String] $file="",
2222

2323
[Parameter(Mandatory=$false)]
2424
[Switch] $help
2525
)
2626

2727
if ($help -eq $true) {
28-
echo "`"Copy`" - Builds and copies your mod to your quest, and also starts Beat Saber with optional logging"
29-
echo "`n-- Arguments --`n"
28+
Write-Output "`"Copy`" - Builds and copies your mod to your quest, and also starts Beat Saber with optional logging"
29+
Write-Output "`n-- Arguments --`n"
3030

31-
echo "-Clean `t`t Performs a clean build (equvilant to running `"Build -clean`")"
32-
echo "-UseDebug `t Copied the debug version of the mod to your quest"
33-
echo "-Log `t`t Logs Beat Saber using the `"Start-Logging`" command"
31+
Write-Output "-Clean `t`t Performs a clean build (equvilant to running `"build -clean`")"
32+
Write-Output "-UseDebug `t Copies the debug version of the mod to your quest"
33+
Write-Output "-Log `t`t Logs Beat Saber using the `"Start-Logging`" command"
3434

35-
echo "`n-- Logging Arguments --`n"
35+
Write-Output "`n-- Logging Arguments --`n"
3636

3737
& $PSScriptRoot/start-logging.ps1 -help -excludeHeader
3838

@@ -42,18 +42,29 @@ if ($help -eq $true) {
4242
& $PSScriptRoot/build.ps1 -clean:$clean
4343

4444
if ($LASTEXITCODE -ne 0) {
45-
echo "Failed to build, exiting..."
45+
Write-Output "Failed to build, exiting..."
4646
exit $LASTEXITCODE
4747
}
4848

49-
if ($useDebug -eq $true) {
50-
$fileName = Get-ChildItem lib*.so -Path "build/debug" -Name
51-
} else {
52-
$fileName = Get-ChildItem lib*.so -Path "build/" -Name
53-
}
49+
# & $PSScriptRoot/validate-modjson.ps1
50+
# if ($LASTEXITCODE -ne 0) {
51+
# exit $LASTEXITCODE
52+
# }
53+
$modJson = Get-Content "./mod.json" -Raw | ConvertFrom-Json
54+
55+
$modFiles = $modJson.modFiles
5456

55-
& adb push build/$fileName /sdcard/Android/data/com.beatgames.beatsaber/files/mods/$fileName
57+
foreach ($fileName in $modFiles) {
58+
if ($useDebug -eq $true) {
59+
& adb push build/debug/$fileName /sdcard/Android/data/com.beatgames.beatsaber/files/mods/$fileName
60+
} else {
61+
& adb push build/$fileName /sdcard/Android/data/com.beatgames.beatsaber/files/mods/$fileName
62+
}
63+
}
5664

5765
& $PSScriptRoot/restart-game.ps1
5866

59-
if ($log -eq $true) { & $PSScriptRoot/start-logging.ps1 -self:$self -all:$all -custom:$custom -file:$file }
67+
if ($log -eq $true) {
68+
& adb logcat -c
69+
& $PSScriptRoot/start-logging.ps1 -self:$self -all:$all -custom:$custom -file:$file
70+
}

createqmod.ps1

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@ if ($help -eq $true) {
1717

1818
$mod = "./mod.json"
1919

20-
& $PSScriptRoot/build.ps1 -clean:$clean
21-
22-
if ($LASTEXITCODE -ne 0) {
23-
echo "Failed to build, exiting..."
24-
exit $LASTEXITCODE
25-
}
26-
27-
& qpm-rust qmod build
28-
29-
& $PSScriptRoot/validate-modjson.ps1
30-
if ($LASTEXITCODE -ne 0) {
31-
exit $LASTEXITCODE
32-
}
3320
$modJson = Get-Content $mod -Raw | ConvertFrom-Json
3421

3522
if ($qmodName -eq "") {
@@ -67,8 +54,8 @@ foreach ($lib in $modJson.libraryFiles) {
6754
$filelist += $path
6855
}
6956

70-
$zip = "Play3rdPer.zip"
71-
$qmod = "Play3rdPer.qmod"
57+
$zip = $qmodName + ".zip"
58+
$qmod = $qmodName + ".qmod"
7259

7360
Compress-Archive -Path $filelist -DestinationPath $zip -Update
7461
Move-Item $zip $qmod -Force

mod.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

mod.template.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"_QPVersion": "0.1.1",
3-
"id": "Play3rdPer",
4-
"name": "Third Person mod",
5-
"version": "0.11.0",
3+
"name": "${mod_name}",
4+
"id": "${mod_id}",
5+
"version": "${version}",
66
"coverImage": "cover.png",
77
"author": "ComputerElite",
88
"packageId": "com.beatgames.beatsaber",
9-
"packageVersion": "1.27.0_3631150051",
9+
"packageVersion": "1.28.0_4124311467",
1010
"modFiles": [
1111
],
1212
"libraryFiles": [

0 commit comments

Comments
 (0)