Compare commits
127 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 499956d3b3 | |||
| c313685f6f | |||
| 88a1691d4b | |||
| cdd25b458c | |||
| 30a53c013f | |||
| 1db3db7bdd | |||
| e0e647b22a | |||
| 69914e3063 | |||
| 0c2624ed37 | |||
| cf11277541 | |||
| d028e144fc | |||
| 59c624d58d | |||
| 2d67876ee1 | |||
| 6b30d74628 | |||
| eb76bb5df0 | |||
| 590daf3be2 | |||
| ecf18b9967 | |||
| bc26f329a5 | |||
| 030df21619 | |||
| d61588c09f | |||
| 7ed2b5c820 | |||
| 239a68821e | |||
| fc512091e4 | |||
| f71c29da58 | |||
| 60c656b45b | |||
| bec8e1f571 | |||
| 20d0cd7ee6 | |||
| 3f37c2ee34 | |||
| 0b24a5ceb2 | |||
| 318a6b5afa | |||
| c80685065e | |||
| cdc589f602 | |||
| ee6acb7980 | |||
| 515ef06589 | |||
| 344cce9461 | |||
| 536690dc55 | |||
| 4fc5a87c13 | |||
| 263061e7ce | |||
| 0b7cad82d5 | |||
| 63d35f678d | |||
| 16b9ca79f2 | |||
| 792ad9d777 | |||
| b6ecaa3934 | |||
| bb4ce5505a | |||
| d6aad2690c | |||
| cfb2b35bf7 | |||
| 40f6803b90 | |||
| d2c1d815a1 | |||
| 4c8617a419 | |||
| 444db56d90 | |||
| 4b94b11b53 | |||
| 1a9ed04cc2 | |||
| f3d4c64118 | |||
| f908acefd6 | |||
| 7dc63fa775 | |||
| 08e1b46e06 | |||
| 9d613d5a7f | |||
| 6e2dfa26b7 | |||
| 86017e65c0 | |||
| d6e51f0d11 | |||
| c095469214 | |||
| fcf391db55 | |||
| 68b105dd63 | |||
| c54185b348 | |||
| cc42f0a978 | |||
| 073061c8e5 | |||
| e071d792ad | |||
| 072e2991ba | |||
| 8c9597ab0e | |||
| a7dbe61535 | |||
| a51bf1ab15 | |||
| 1ed71c61ef | |||
| 40ecf536d0 | |||
| 32cab3d4eb | |||
| 4c7a61ecd0 | |||
| 0b1f36cc96 | |||
| 902ca819c5 | |||
| fcad40ec66 | |||
| f448f023f8 | |||
| 05a3a383ee | |||
| 54f24d93a3 | |||
| 395b6704fd | |||
| 79be8a8173 | |||
| 7f3a55cee4 | |||
| c2d722d5fe | |||
| 91d71b295b | |||
| c1afa24d7a | |||
| 081e4e4fa7 | |||
| 07a353393b | |||
| 7b22387fc5 | |||
| 2bba3c5232 | |||
| b97e03041a | |||
| fb7f08ee2e | |||
| 1ba0b0beac | |||
| fa50d90941 | |||
| 0539b0da8d | |||
| ea33ee3a62 | |||
| fd4918017b | |||
| 95688b9d33 | |||
| 14036b9269 | |||
| 01bc0e13e3 | |||
| f7849344d1 | |||
| db345e0c2c | |||
| 90d1abcc55 | |||
| 6966cb9e90 | |||
| b764ac90cf | |||
| 921b1fd230 | |||
| 7df499641c | |||
| 344e7abc95 | |||
| 94c1614c2f | |||
| 891e2338c9 | |||
| 2d63708d11 | |||
| 80d0333170 | |||
| f76e693bb7 | |||
| 220111d81f | |||
| 4571d8da73 | |||
| cb6682d954 | |||
| c2ff4fed8b | |||
| 04f811f53b | |||
| 341308eab5 | |||
| 57f050ad28 | |||
| 890884b587 | |||
| 83875bbf13 | |||
| b4fdf1b9ec | |||
| 44f6ec2db5 | |||
| 30327824ea | |||
| 4146a66405 |
@@ -2,7 +2,7 @@ root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
@@ -46,7 +46,12 @@ module.exports = {
|
||||
"react/prop-types": "off",
|
||||
"import/no-cycle": "off",
|
||||
"prefer-promise-reject-errors": "off",
|
||||
"react/jsx-no-target-blank": "off"
|
||||
"react/jsx-no-target-blank": "off",
|
||||
"@typescript-eslint/ban-types": ["error", {
|
||||
types: {
|
||||
Function: false,
|
||||
}
|
||||
}]
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
|
||||
@@ -27,3 +27,6 @@ npm-debug.log.*
|
||||
*.css.d.ts
|
||||
*.sass.d.ts
|
||||
*.scss.d.ts
|
||||
|
||||
# externals
|
||||
externals/**/target/*
|
||||
|
||||
@@ -1,4 +1,247 @@
|
||||
## [0.2.0](https://github.com/Zagrios/bs-manager/releases/tag/v0.2.0) (October 23, 2022)
|
||||
## Not released yet ~
|
||||
|
||||
## [1.4.3](https://github.com/Zagrios/bs-manager/releases/tag/v1.4.3) (Dec 27, 2023)
|
||||
|
||||
### Features
|
||||
- It's now possible to save Oculus token entered manually with a password #383
|
||||
|
||||
### Fixes
|
||||
- Fixed issue where the latest Beat Saber version was misordered #379
|
||||
|
||||
### Other changes
|
||||
- Re-enabled Oculus downgrade with manual token input #383
|
||||
|
||||
## [1.4.2](https://github.com/Zagrios/bs-manager/releases/tag/v1.4.2) (Dec 17, 2023)
|
||||
|
||||
### Features
|
||||
- Added Traditional Chinese translation (thanks to @mant0u0) #372
|
||||
|
||||
### Fixes
|
||||
- Fixed an issue with keyboard navigation in the downloadable versions list [344e7ab](https://github.com/Zagrios/bs-manager/commit/344e7abc95130cfa44d9fa51365a5161c9f378a6)
|
||||
- Fixed an issue where automatic Steam version detection was not working for some users #375
|
||||
|
||||
### Other changes
|
||||
- Temporarily disabled Oculus downgrade #377
|
||||
- Recommended version now appears first in the versions list #376
|
||||
- Updated the "Broken Models" notification #378
|
||||
|
||||
## [1.4.1](https://github.com/Zagrios/bs-manager/releases/tag/v1.4.1) (Dec 5, 2023)
|
||||
|
||||
### Features
|
||||
- Added Japanese translation (thanks to @emesan22) #365
|
||||
|
||||
### Fixes
|
||||
- Fixed a JavaScript error that occurred when closing a window during a download #366
|
||||
- Resolved text overflow issue with the Spanish translation #367
|
||||
- Fixed an issue where downloading a playlist was not possible if a version do not has the "CustomLevel" folder #368
|
||||
- Installing a playlist now doesn't download maps that are already present #369
|
||||
|
||||
## [1.4.0](https://github.com/Zagrios/bs-manager/releases/tag/v1.4.0) (Nov 28, 2023)
|
||||
|
||||
### Features
|
||||
- Oculus PCVR support #346
|
||||
- The most moddable version now have a “Recommended” banner #354
|
||||
- Chinese translation has been added (thanks to @ktKongTong)
|
||||
|
||||
### Fixes
|
||||
- BSManager crashes if too many OneClick downloads are done at the same time #340
|
||||
- Unable to download playlists with OneClick from some websites #349
|
||||
- "Refresh list" was updating available versions but not installed versions #351
|
||||
- Prevent launching a version that is currently downloading #355
|
||||
- Prioritize IPv4 to avoid IPv6 issues #353
|
||||
- Import version progress bar is now accurate #358
|
||||
|
||||
### Other changes
|
||||
- Fix french translation misspelling and standardize the "Beat Saber" name #341 (Thanks to @Synaelle)
|
||||
|
||||
## [1.3.2](https://github.com/Zagrios/bs-manager/releases/tag/v1.3.2) (Oct 8, 2023)
|
||||
|
||||
### Fixes
|
||||
- Maps or Playlists couldn't be downloaded with OneClick if maps were linked #331 #337
|
||||
- Mishandling of additional launch arguments when launching from a shortcut #335
|
||||
- Incorrect English translation #336
|
||||
|
||||
## [1.3.1](https://github.com/Zagrios/bs-manager/releases/tag/v1.3.1) (Oct 2, 2023)
|
||||
|
||||
### Features
|
||||
- Beat Saber versions now automatically sync with LIV #320
|
||||
- Use ArcViewer to preview maps #312
|
||||
|
||||
### Fixes
|
||||
- SteamVR backup folder is now restored when disabling FPFC Mode #314
|
||||
- OneClick installs now correctly place contents in user-defined symlinks #311
|
||||
- Currently downloading Beat Saber version no longer disappears on uninstalling a version #307
|
||||
- Add "no-yeet" argument when launching Beat Saber to prevent mods to be removed if "UserData" is linked #321
|
||||
- Fixed a rare bug that prevent BSManager from launching due to a missing DLL #328
|
||||
- Increase the SteamVR restore timeout to prevent it from launching in FPFC Mode #330
|
||||
|
||||
### Other changes
|
||||
- Improved Spanish translation #309 (Thanks to @GabiRP)
|
||||
- For new installations, the default folder for BSManager contents has been moved from "Documents" to the "User" directory to avoid OneDrive conflicts #319
|
||||
|
||||
## [1.3.0](https://github.com/Zagrios/bs-manager/releases/tag/v1.3.0) (Aug 10, 2023)
|
||||
|
||||
### Features
|
||||
- Steam now launches automatically if needed when starting a version of Beat Saber #255
|
||||
- Create shortcuts to launch Beat Saber more quickly without going through BSManager #282
|
||||
- Russian translation has been added (thanks to @Dead0Duck)
|
||||
- Download Beat Saber versions without enter your credentials using QR code to login #293
|
||||
- Login approval from the Steam app is now being handled #293
|
||||
|
||||
### Fixes
|
||||
- Unable to delete maps from shared content #262
|
||||
- Maps are no longer loaded unnecessarily when not accessing the map tab #261
|
||||
- BSManager no longer crashes when it loads tons of maps #288
|
||||
- Loading maps is faster and consumes a lot less memory #288
|
||||
- Prevent installed mods from being downgraded after mods installation #291
|
||||
- Window title of BSManager no longer become "index.html" after closing settings #290
|
||||
- Models' texts color within the download modal in light theme is now correct #296
|
||||
- Downloading versions of Beat Saber now works on Linux #297 (thanks to @Insprill)
|
||||
- Fix the ability to focus on non-visible elements #299
|
||||
|
||||
### Other changes
|
||||
- Corrections and adjustments of some translations for better clarity #249 #279 (Thanks to @AltyFox and @KnuckleDF)
|
||||
- Improved compatibility with Linux (Thanks to @RedlineTriad and @Insprill)
|
||||
- Alpha versions should now update to the latest Stable version when its available #294
|
||||
|
||||
## [1.2.0](https://github.com/Zagrios/bs-manager/releases/tag/v1.2.0) (Jun 16, 2023)
|
||||
|
||||
### Features
|
||||
- Add models management #218
|
||||
- Hexadecimal field has been added in color pickers #236
|
||||
- "Show Password" button has been added in the login modal #244
|
||||
|
||||
### Fixes
|
||||
- Made permission error not possible when installing mods #219
|
||||
- Fix progress collision when switching versions while maps are being loaded #220
|
||||
- Some mods do not show as installed after an update #231
|
||||
- Some mods are not marked as updated, after a mods update #229
|
||||
- Shortcut to BSManager had an incorrect description #240
|
||||
- Mod LookupID was never shown as installed #242
|
||||
- Usernames with spaces were not supported for Steam login #243
|
||||
- Can't clone Steam version without renaming it #248
|
||||
|
||||
### Other changes
|
||||
- Some UI elements have been reorganized to make usage more pleasant #218
|
||||
- Initial loading of mods is now faster #232
|
||||
- A warning has been added when the Steam password exceeds 64 characters #225
|
||||
|
||||
## [1.1.1](https://github.com/Zagrios/bs-manager/releases/tag/v1.1.1) (Apr 13, 2023)
|
||||
|
||||
### Features
|
||||
- Add German translation #198 #199 (thanks @XCraftTM)
|
||||
- Add message when no mods are available #197
|
||||
- Add button to link all folders at once #204
|
||||
- Add indicator when a supporter is clickable #208
|
||||
|
||||
### Fixes
|
||||
- Fix error with mods management when offline #202
|
||||
- Can't open supporter link #207
|
||||
- Change color of diamond supporters to match the discord role color #208
|
||||
- Error when spaces are present in Steam Guard code #209
|
||||
- Unable to move contents folder of BSManager when parent folder is named "BSManager" #210
|
||||
- Unable to move contents folder of BSManager to another drive if symlinks are present #210
|
||||
- Improve resilience to errors when moving contents folder of BSManager #210
|
||||
- A strange bug prevents the launch of Beat Saber for some people #215
|
||||
|
||||
### Other changes
|
||||
- Add BeatLeader icon in OneClicks settings #193
|
||||
|
||||
## [1.1.0](https://github.com/Zagrios/bs-manager/releases/tag/v1.1.0) (Mar 24, 2023)
|
||||
|
||||
### Features
|
||||
- Custom folders can now be shared between BeatSaber versions #176
|
||||
- Advanced launch options to add custom launch arguments for BeatSaber #179
|
||||
- Added an indicator if the current version is a preview #185
|
||||
|
||||
### Fixes
|
||||
- Disable SteamVR when "Desktop Mode" is enabled #181
|
||||
- Fix some UI bugs #175
|
||||
- Reactivate support button #183
|
||||
- Installing an older version of a mod overwrites the most recent version installed #186
|
||||
- On version cloning, contents of linked folders no longer duplicate #189
|
||||
- Now, the content of a shared folder is moved instead of being duplicated if no other version uses this shared folder #191
|
||||
|
||||
## [1.0.4](https://github.com/Zagrios/bs-manager/releases/tag/v1.0.4) (Mar 4, 2023)
|
||||
|
||||
### Features
|
||||
- Add volume control #154
|
||||
|
||||
### Fixes
|
||||
- Fix some English translations #153 #151 #167
|
||||
- The debug console does not open #158
|
||||
- Can't enable Oculus and Desktop mode in the same time #159
|
||||
- Pause Map song on open preview #160
|
||||
- Reduces map loading time by 20 to 40% depending on configuration (still work on that) #161
|
||||
- Mods menu partially hidden when no mods listed #165
|
||||
- Fix light theme issues #168
|
||||
- The .NET installation request notification sometimes does not appear #170
|
||||
- Change Oculus Mode description #166
|
||||
|
||||
### Other changes
|
||||
- We have added an explanation of why we need your Steam credentials to download a BeatSaber version #164
|
||||
|
||||
## [1.0.3](https://github.com/Zagrios/bs-manager/releases/tag/v1.0.3) (Feb 28, 2023)
|
||||
|
||||
### Fixes
|
||||
- Can't download Beat Saber version if there are spaces in the folder path
|
||||
|
||||
## [1.0.2](https://github.com/Zagrios/bs-manager/releases/tag/v1.0.2) (Feb 24, 2023)
|
||||
|
||||
### Fixes
|
||||
- Huge RAM usage optimization in maps list #140
|
||||
- Maps deletion is way faster #140
|
||||
- Maps progress bars are now accurate #140
|
||||
- Maps loading is slightly faster #140
|
||||
- Other little optimizations for the Maps management feature #140
|
||||
- OneClick install for Maps not work if no Beat Saber version is installed #141
|
||||
- Little English translation fix #143
|
||||
|
||||
## [1.0.1](https://github.com/Zagrios/bs-manager/releases/tag/v1.0.1) (Feb 6, 2023)
|
||||
|
||||
### Fixes
|
||||
- Some French translation corrections #133
|
||||
- Update the default Mods to be more consistent with ModAssistant #132 #135
|
||||
- Disable the `Support BSManager` button due to the change of the donation platform #134
|
||||
|
||||
## [1.0.0](https://github.com/Zagrios/bs-manager/releases/tag/v1.0.0) (Jan 26, 2023)
|
||||
|
||||
### Breaking Change
|
||||
|
||||
- Config file have been moved to contents folder of BSManager to keep user config even if it exports the contents folder to another pc #55
|
||||
- Versions file system have been modified to be more reliable #118
|
||||
|
||||
### Features
|
||||
|
||||
- Maps Management #35
|
||||
- OneClick installs (maps, playlists, models) #35
|
||||
- Oculus BeatSaber detection #17
|
||||
- Lunch Steam from BSManager #37
|
||||
- Alert if dotnet is not installed #54
|
||||
- Swipe notification to close it #40
|
||||
- Add discord button in settings #46
|
||||
- Add Mods disclaimer #50
|
||||
- Some UI tweaks #39 #51
|
||||
- Moving from Patreon to Mee6 #86
|
||||
- Add launch mod infos #11
|
||||
- Can import external BeatSaber installs #121
|
||||
- Add Web installer
|
||||
|
||||
### Fixes
|
||||
|
||||
- Outdated mod not seen as outdated #36
|
||||
- Settings close button was stuck when scrolling #85
|
||||
- Error when try to loading mods without internet #87
|
||||
- Can't manage any version if Oculus app is not installed #101
|
||||
- Download version button overlap with the spin loader #99
|
||||
- After uninstall last BeatSaber version we stay on the same page #105
|
||||
- No more files verification in available versions list #126
|
||||
|
||||
### Other Changes
|
||||
|
||||
- Fix high CPU usage #121
|
||||
|
||||
## [0.2.0](https://github.com/Zagrios/bs-manager/releases/tag/v0.2.0) (Oct 23, 2022)
|
||||
|
||||
### Features
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
<video src = "https://github.com/Zagrios/bs-manager/assets/40648115/5e0d1503-7a58-4134-878b-a2b31a8936df" />
|
||||
<video src="https://github.com/Zagrios/bs-manager/assets/40648115/ba39aceb-f55f-4e58-8386-51fcfaad4957"/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -421,7 +421,7 @@
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
<video src="https://github.com/Zagrios/bs-manager/assets/40648115/c2765468-e203-4989-85f8-2c3e54d8aba4" />
|
||||
<video src="https://github.com/Zagrios/bs-manager/assets/40648115/733fe6bb-c157-4c47-8a79-f8062380bcc8" />
|
||||
</div>
|
||||
|
||||
<!--
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 698 KiB After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 1.2 MiB |
@@ -664,7 +664,7 @@
|
||||
"ReleaseDate": "1698678611",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
{
|
||||
"BSVersion": "1.34.0",
|
||||
"BSManifest": "3651119791147907495",
|
||||
"OculusBinaryId": "6373048192794906",
|
||||
@@ -672,5 +672,41 @@
|
||||
"ReleaseImg": "https://clan.cloudflare.steamstatic.com/images/32055887/1ef505a26d6eb8d7d8c132df54bd57918339cb2c.png",
|
||||
"ReleaseDate": "1701795528",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.34.2",
|
||||
"BSManifest": "8045892568861450718",
|
||||
"OculusBinaryId": "6426757994090592",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3865840827122760836",
|
||||
"ReleaseImg": "https://clan.akamai.steamstatic.com/images/32055887/ae11d195bbe41a0f244d7b4d055a0ab89f88e5bb.png",
|
||||
"ReleaseDate": "1702309893",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.34.5",
|
||||
"BSManifest": "7413405154512822201",
|
||||
"OculusBinaryId": "6639053626194360",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/4036983137766828694",
|
||||
"ReleaseImg": "https://clan.cloudflare.steamstatic.com/images/32055887/925e60f14c6815f7617fde11a894ed20f54a0846.png",
|
||||
"ReleaseDate": "1707745958",
|
||||
"year": "2024"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.34.6",
|
||||
"BSManifest": "4398761375819224126",
|
||||
"OculusBinaryId": "6682206641879058",
|
||||
"ReleaseURL": "https://store.steampowered.com/news/app/620980/view/7595953477644376720",
|
||||
"ReleaseImg": "https://clan.cloudflare.steamstatic.com/images/32055887/e7c75bdfc76d00713adc3fbdf221c9ce8ab3620d.png",
|
||||
"ReleaseDate": "1708091473",
|
||||
"year": "2024"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.35.0",
|
||||
"BSManifest": "1490986193481243578",
|
||||
"OculusBinaryId": "6720809361352119",
|
||||
"ReleaseURL": "https://store.steampowered.com/news/app/620980/view/4142820264819707009",
|
||||
"ReleaseImg": "https://clan.cloudflare.steamstatic.com/images//32055887/9a141be5c44ca6fc81551a2c7e7f28407df413ed.png",
|
||||
"ReleaseDate": "1709831174",
|
||||
"year": "2024"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -1,20 +1,93 @@
|
||||
[
|
||||
{"username": "Shidorien"},
|
||||
{"username": "iPixelGalaxy"},
|
||||
{"username": "Emyte", "type": "gold"},
|
||||
{"username": "GoodOldNervy"},
|
||||
{"username": "Naysy"},
|
||||
{"username": "Falmil"},
|
||||
{"username": "K1Lc4m"},
|
||||
{"username": "Anonymously42", "type": "diamond", "link": "https://www.twitch.tv/anonymously42tv"},
|
||||
{"username": "Burt", "type": "gold"},
|
||||
{"username": "Ilnahro"},
|
||||
{"username": "Phil", "type": "gold"},
|
||||
{"username": "Protocrush", "type": "gold"},
|
||||
{"username": "ServerMensch", "type": "gold"},
|
||||
{"username": "Karlito", "type": "gold"},
|
||||
{"username": "Cathery", "type": "gold"},
|
||||
{"username": ".sharkey"},
|
||||
{"username": "Z3t4"},
|
||||
{"username": "blot455", "type": "diamond"}
|
||||
{
|
||||
"username": "Shidorien"
|
||||
},
|
||||
{
|
||||
"username": "iPixelGalaxy"
|
||||
},
|
||||
{
|
||||
"username": "Emyte",
|
||||
"type": "gold"
|
||||
},
|
||||
{
|
||||
"username": "GoodOldNervy"
|
||||
},
|
||||
{
|
||||
"username": "Naysy"
|
||||
},
|
||||
{
|
||||
"username": "Falmil"
|
||||
},
|
||||
{
|
||||
"username": "K1Lc4m"
|
||||
},
|
||||
{
|
||||
"username": "Anonymously42",
|
||||
"type": "diamond",
|
||||
"link": "https://www.twitch.tv/anonymously42tv"
|
||||
},
|
||||
{
|
||||
"username": "Burt",
|
||||
"type": "gold"
|
||||
},
|
||||
{
|
||||
"username": "Ilnahro"
|
||||
},
|
||||
{
|
||||
"username": "Phil",
|
||||
"type": "gold"
|
||||
},
|
||||
{
|
||||
"username": "Protocrush",
|
||||
"type": "gold"
|
||||
},
|
||||
{
|
||||
"username": "ServerMensch",
|
||||
"type": "gold"
|
||||
},
|
||||
{
|
||||
"username": "Karlito",
|
||||
"type": "gold"
|
||||
},
|
||||
{
|
||||
"username": "Cathery",
|
||||
"type": "gold"
|
||||
},
|
||||
{
|
||||
"username": ".sharkey"
|
||||
},
|
||||
{
|
||||
"username": "Z3t4"
|
||||
},
|
||||
{
|
||||
"username": "blot455",
|
||||
"type": "diamond"
|
||||
},
|
||||
{
|
||||
"username": "Lumberjack462",
|
||||
"type": "diamond",
|
||||
"link": "https://www.youtube.com/@lumberjack462"
|
||||
},
|
||||
{
|
||||
"username": "Xero"
|
||||
},
|
||||
{
|
||||
"username": "Minescence"
|
||||
},
|
||||
{
|
||||
"username": "Finlay"
|
||||
},
|
||||
{
|
||||
"username": "mereknom"
|
||||
},
|
||||
{
|
||||
"username": "Jascha"
|
||||
},
|
||||
{
|
||||
"username": "Celldweller",
|
||||
"type": "gold"
|
||||
},
|
||||
{
|
||||
"username": "rhythmshade"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps": {
|
||||
"title": "Geteilte Maps"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Oculus Modus",
|
||||
@@ -42,7 +39,6 @@
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"title": "Geteilte Maps",
|
||||
"search-bar": {
|
||||
"search-placeholder": "Suche eine Map",
|
||||
"filters-btn": "Filter",
|
||||
@@ -98,8 +94,7 @@
|
||||
"edit": "Bearbeiten",
|
||||
"uninstall": "Entfernen",
|
||||
"create-shortcut": "Verknüpfung erstellen",
|
||||
"shared-folders": "Geteilte Ordner",
|
||||
"restore-oculus-folder": "Ordner wiederherstellen"
|
||||
"shared-folders": "Geteilte Ordner"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
@@ -157,6 +152,7 @@
|
||||
"de-DE": "Deutsch",
|
||||
"ru-RU": "Русский",
|
||||
"zh-CN": "简体中文",
|
||||
"zh-TW": "正體中文",
|
||||
"ja-JP": "日本語",
|
||||
"translated": {
|
||||
"en-EN": "Englisch, Vereinigtes Königreich",
|
||||
@@ -166,6 +162,7 @@
|
||||
"de-DE": "Deutsch",
|
||||
"ru-RU": "Russisch",
|
||||
"zh-CN": "Vereinfachtes Chinesisch",
|
||||
"zh-TW": "Traditionelles Chinesisch",
|
||||
"ja-JP": "Japanisch"
|
||||
}
|
||||
}
|
||||
@@ -462,7 +459,7 @@
|
||||
},
|
||||
"maps": {
|
||||
"one-click-install": {
|
||||
"success": "Map installation abegschlossen",
|
||||
"success": "Map installation abgeschlossen",
|
||||
"error": "Ein Fehler ist aufgetreten während der installation der Map"
|
||||
}
|
||||
},
|
||||
@@ -697,30 +694,48 @@
|
||||
"title": "Achtung",
|
||||
"body": {
|
||||
"must-be-installed-once": "Sie müssen Beat Saber mindestens einmal aus dem Oculus Store installiert haben, sonst könnte sich Beat Saber nach dem Start automatisch schließen.",
|
||||
"need-backup": "Um diese Version zu starten, wird der Installationsordner von Beat Saber in Ihrer Oculus-Bibliothek umbenannt.",
|
||||
"can-restore-later": "Bei Bedarf können Sie ihn vom BSManager aus wiederherstellen, indem Sie zu den Optionen der originalen Oculus-Version gehen und auf 'Ordner wiederherstellen' klicken",
|
||||
"tips-launch-oculus": "Tipp: Sie können diese Version direkt über Oculus starten, solange die Originalversion nicht wiederhergestellt ist."
|
||||
"will-backup": "Um diese Version zu starten, wird der ursprüngliche Installationsordner von Beat Saber in Ihrer Oculus-Bibliothek umbenannt und beim Schließen von Beat Saber automatisch wiederhergestellt."
|
||||
},
|
||||
"not-remind-me": "Nicht mehr erinnern",
|
||||
"understood": "Verstanden"
|
||||
},
|
||||
"enter-meta-token": {
|
||||
"title": "Meta-Token",
|
||||
"title": "Oculus Token",
|
||||
"body": {
|
||||
"need-token": "Um Beat Saber herunterzuladen, ist Ihr Meta-Anmelde-Token erforderlich.",
|
||||
"how-obtain-token": "Wie erhalte ich mein Meta-Token?",
|
||||
"input-label": "Meta-Token",
|
||||
"token-is-invalid": "Das Token ist ungültig."
|
||||
"info-enter-token": "Um Beat Saber herunterzuladen, ist Ihr Oculus-Anmeldetoken erforderlich.",
|
||||
"how-obtain-token": "Wie erhalte ich mein Oculus Token?",
|
||||
"oculus-token": "Oculus Token",
|
||||
"token-is-invalid": "Das Token ist ungültig.",
|
||||
"save-my-token": "Mein Token speichern",
|
||||
"have-token-saved": "Ich habe bereits ein Token gespeichert",
|
||||
"save-token-info": "Dies wird Ihr Token zur einfacheren Wiederverwendung speichern. Sie müssen ein Passwort erstellen, um Ihr Token zu verschlüsseln und zu speichern. Wenn Sie Ihr Passwort vergessen, müssen Sie nur Ihr Token erneut angeben.",
|
||||
"password": "Passwort",
|
||||
"password-too-short": "Passwort zu kurz",
|
||||
"info-enter-password": "Um Beat Saber herunterzuladen, ist Ihr Oculus-Anmeldetoken erforderlich. Geben Sie das Passwort ein, mit dem Ihr Oculus-Token gespeichert wurde.",
|
||||
"info-disabled-btn-password": "Der mit dem angegebenen Passwort entschlüsselte Token ist ungültig. Stellen Sie sicher, dass das Passwort dasselbe ist wie das zum Speichern des Tokens verwendete.",
|
||||
"enter-oculus-token": "Ein Oculus-Token eingeben"
|
||||
},
|
||||
"valid-btn": "Validieren"
|
||||
},
|
||||
"launch-as-admin": {
|
||||
"title": "Administratorberechtigungen",
|
||||
"body": {
|
||||
"info": "Es wurde festgestellt, dass Steam mit Administratorrechten ausgeführt wird. Um mit Steam zu kommunizieren, muss auch Beat Saber als Administrator gestartet werden. Andernfalls könnte Beat Saber Probleme haben und nach dem Starten schließen.",
|
||||
"info-2": "Das Starten von Beat Saber im Administratormodus gibt auch den installierten Mods Administratorrechte. Daher wird empfohlen, Steam ohne Administratorrechte neu zu starten.",
|
||||
"info-3": "Beachten Sie, dass es nicht ratsam ist, Steam Administratorrechte zu geben, da dies auch die installierten Spiele und Mods betrifft und ein Sicherheitsrisiko darstellt."
|
||||
},
|
||||
"launch-as-admin": "Als Administrator starten",
|
||||
"not-remind-me": "Nicht mehr erinnern"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"map-filter-panel": {
|
||||
"duration": "Länge",
|
||||
"nps" : "Noten Pro Sekunde",
|
||||
"tags": "Stichworte",
|
||||
"specificities": "Allgemein",
|
||||
"requirements": "Anforderungen"
|
||||
"requirements": "Anforderungen",
|
||||
"exclude": "ausschließen"
|
||||
},
|
||||
"map-types": {
|
||||
"accuracy": "Präzision",
|
||||
@@ -776,6 +791,9 @@
|
||||
"verified": "verifiziert",
|
||||
"fullSpread": "full spread"
|
||||
},
|
||||
"map-excludes": {
|
||||
"installed": "installiert"
|
||||
},
|
||||
"difficulties": {
|
||||
"Easy": "einfach",
|
||||
"Normal": "normal",
|
||||
@@ -785,7 +803,13 @@
|
||||
},
|
||||
"map-item": {
|
||||
"by": "Von {songAutor}",
|
||||
"mapped-by": "Gemapped von"
|
||||
"mapped-by": "Gemapped von",
|
||||
"delete": "Löschen",
|
||||
"preview" : "Kartenvorschau",
|
||||
"bsr-code" : "BSR Code",
|
||||
"download" : "Karte herunterladen",
|
||||
"downloading" :"Karte wird heruntergeladen",
|
||||
"cancel-download" : "Download abbrechen"
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
@@ -944,7 +968,7 @@
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "Gebrochene Modelle",
|
||||
"desc": "Seit dem Update des Beat Saber-Motors sind Modelle für diese Version nicht mehr funktional."
|
||||
"desc": "Seit dem Update der Beat Saber Engine sind alle benutzerdefinierten Modellmods defekt und müssen aktualisiert werden. Sie wurden noch nicht aktualisiert."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Export abgeschlossen 🎉"
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps": {
|
||||
"title": "Shared maps"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Oculus Mode",
|
||||
@@ -42,7 +39,6 @@
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"title": "Shared maps",
|
||||
"search-bar": {
|
||||
"search-placeholder": "Search a map",
|
||||
"filters-btn": "Filters",
|
||||
@@ -98,8 +94,7 @@
|
||||
"edit": "Edit",
|
||||
"uninstall": "Uninstall",
|
||||
"create-shortcut": "Create a shortcut",
|
||||
"shared-folders": "Shared Folders",
|
||||
"restore-oculus-folder": "Restore the folder"
|
||||
"shared-folders": "Shared Folders"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
@@ -157,6 +152,7 @@
|
||||
"de-DE": "Deutsch",
|
||||
"ru-RU": "Русский",
|
||||
"zh-CN": "简体中文",
|
||||
"zh-TW": "正體中文",
|
||||
"ja-JP": "日本語",
|
||||
"translated": {
|
||||
"en-EN": "English, United Kingdom",
|
||||
@@ -166,6 +162,7 @@
|
||||
"de-DE": "German",
|
||||
"ru-RU": "Russian",
|
||||
"zh-CN": "Chinese (Simplified)",
|
||||
"zh-TW": "Chinese (Traditional)",
|
||||
"ja-JP": "Japanese"
|
||||
}
|
||||
}
|
||||
@@ -697,30 +694,48 @@
|
||||
"title": "Warning",
|
||||
"body": {
|
||||
"must-be-installed-once": "You must have installed Beat Saber at least once from the Oculus Store, otherwise Beat Saber might automatically close after launching.",
|
||||
"need-backup": "To launch this version, the Beat Saber installation folder located in your Oculus library will be renamed.",
|
||||
"can-restore-later": "If needed, you can restore it from BSManager by going to the options of the original Oculus version and clicking on 'Restore the folder'",
|
||||
"tips-launch-oculus": "Tip: You can launch this version directly from Oculus, as long as the original version is not restored."
|
||||
"will-backup": "To launch this version, the original installation folder of Beat Saber located in your Oculus library will be renamed and will be automatically restored when Beat Saber is closed."
|
||||
},
|
||||
"not-remind-me": "Do not remind me",
|
||||
"understood": "Understood"
|
||||
},
|
||||
"enter-meta-token": {
|
||||
"title": "Meta Token",
|
||||
"title": "Oculus Token",
|
||||
"body": {
|
||||
"need-token": "To download Beat Saber, your Meta login token is required.",
|
||||
"how-obtain-token": "How do I obtain my Meta Token?",
|
||||
"input-label": "Meta Token",
|
||||
"token-is-invalid": "The Token is invalid."
|
||||
"info-enter-token": "To download Beat Saber, your Oculus login token is required.",
|
||||
"how-obtain-token": "How do I obtain my Oculus Token?",
|
||||
"oculus-token": "Oculus Token",
|
||||
"token-is-invalid": "The Token is invalid.",
|
||||
"save-my-token": "Save my token",
|
||||
"have-token-saved": "I already have a token saved",
|
||||
"save-token-info": "This will save your token for easier reuse. You will need to create a password to encrypt your token for storage purposes. If you ever forget your password, you just need to provide your token again.",
|
||||
"password": "Password",
|
||||
"password-too-short": "Password too short",
|
||||
"info-enter-password": "To download Beat Saber, your Oculus login token is required. Enter the password used to save your Oculus token.",
|
||||
"info-disabled-btn-password": "The token decrypted with the provided password is invalid. Make sure the password is the same as the one used to save the token.",
|
||||
"enter-oculus-token": "Enter an Oculus token"
|
||||
},
|
||||
"valid-btn": "Validate"
|
||||
},
|
||||
"launch-as-admin": {
|
||||
"title": "Administrator Permissions",
|
||||
"body": {
|
||||
"info": "Steam has been detected as running with administrator permissions. To communicate with Steam, Beat Saber must also be launched as an administrator. Otherwise, Beat Saber might experience problems and close after launching.",
|
||||
"info-2": "Launching Beat Saber in administrator mode will also give administrator rights to the installed mods. Therefore, it is recommended to restart Steam without administrator permissions.",
|
||||
"info-3": "Note that it is advised against giving administrator rights to Steam, as this affects the installed games and mods, presenting a security risk."
|
||||
},
|
||||
"launch-as-admin": "Launch as Administrator",
|
||||
"not-remind-me": "Do not remind me"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"map-filter-panel": {
|
||||
"duration": "Duration",
|
||||
"nps" : "Notes Per Second",
|
||||
"tags": "tags",
|
||||
"specificities": "general",
|
||||
"requirements": "requirements"
|
||||
"requirements": "requirements",
|
||||
"exclude": "exclude"
|
||||
},
|
||||
"map-types": {
|
||||
"accuracy": "accuracy",
|
||||
@@ -776,6 +791,9 @@
|
||||
"verified": "verified",
|
||||
"fullSpread": "full spread"
|
||||
},
|
||||
"map-excludes": {
|
||||
"installed": "installed"
|
||||
},
|
||||
"difficulties": {
|
||||
"Easy": "easy",
|
||||
"Normal": "normal",
|
||||
@@ -785,7 +803,13 @@
|
||||
},
|
||||
"map-item": {
|
||||
"by": "By {songAutor}",
|
||||
"mapped-by": "mapped by"
|
||||
"mapped-by": "mapped by",
|
||||
"delete": "Delete",
|
||||
"preview" : "Preview map",
|
||||
"bsr-code" : "BSR code",
|
||||
"download" : "Download map",
|
||||
"downloading" :"Downloading map",
|
||||
"cancel-download" : "Cancel download"
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
@@ -944,7 +968,7 @@
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "Broken models",
|
||||
"desc": "Since the Beat Saber engine update, models are no longer functional for this version."
|
||||
"desc": "Since the Beat Saber engine update, all custom model mods have broken and need to be updated. They have not been updated yet."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Export completed 🎉"
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps": {
|
||||
"title": "Mapas comunes"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Modo Oculus",
|
||||
@@ -97,8 +94,7 @@
|
||||
"edit": "Editar",
|
||||
"uninstall": "Desinstalar",
|
||||
"create-shortcut": "Crear un atajo",
|
||||
"shared-folders": "Carpetas Compartidas",
|
||||
"restore-oculus-folder": "Restaurar la carpeta"
|
||||
"shared-folders": "Carpetas Compartidas"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
@@ -156,6 +152,7 @@
|
||||
"de-DE": "Deutsch",
|
||||
"ru-RU": "Русский",
|
||||
"zh-CN": "简体中文",
|
||||
"zh-TW": "正體中文",
|
||||
"ja-JP": "日本語",
|
||||
"translated": {
|
||||
"en-EN": "Inglés, Reino Unido",
|
||||
@@ -165,6 +162,7 @@
|
||||
"de-DE": "Alemán",
|
||||
"ru-RU": "Ruso",
|
||||
"zh-CN": "Chino simplificado",
|
||||
"zh-TW": "Chino tradicional",
|
||||
"ja-JP": "Japonés"
|
||||
}
|
||||
}
|
||||
@@ -696,30 +694,48 @@
|
||||
"title": "Atención",
|
||||
"body": {
|
||||
"must-be-installed-once": "Debes haber instalado Beat Saber al menos una vez desde la Oculus Store, de lo contrario, Beat Saber podría cerrarse automáticamente después de iniciar.",
|
||||
"need-backup": "Para iniciar esta versión, la carpeta de instalación de Beat Saber que se encuentra en tu biblioteca de Oculus será renombrada.",
|
||||
"can-restore-later": "Si es necesario, podrás restaurarla desde el BSManager accediendo a las opciones de la versión original de Oculus y haciendo clic en 'Restaurar la carpeta'",
|
||||
"tips-launch-oculus": "Consejo: Podrás iniciar esta versión directamente desde Oculus, siempre que la versión original no haya sido restaurada."
|
||||
"will-backup": "Para lanzar esta versión, la carpeta de instalación original de Beat Saber ubicada en tu biblioteca de Oculus será renombrada y se restaurará automáticamente al cerrar Beat Saber."
|
||||
},
|
||||
"not-remind-me": "No volver a recordármelo",
|
||||
"understood": "Entendido"
|
||||
},
|
||||
"enter-meta-token": {
|
||||
"title": "Token de Meta",
|
||||
"title": "Token de Oculus",
|
||||
"body": {
|
||||
"need-token": "Para descargar Beat Saber, se requiere su token de inicio de sesión de Meta.",
|
||||
"how-obtain-token": "¿Cómo obtengo mi Token de Meta?",
|
||||
"input-label": "Token de Meta",
|
||||
"token-is-invalid": "El Token es inválido."
|
||||
"info-enter-token": "Para descargar Beat Saber, se requiere tu token de inicio de sesión de Oculus.",
|
||||
"how-obtain-token": "¿Cómo obtengo mi Token de Oculus?",
|
||||
"oculus-token": "Token de Oculus",
|
||||
"token-is-invalid": "El token es inválido.",
|
||||
"save-my-token": "Guardar mi token",
|
||||
"have-token-saved": "Ya tengo un token guardado",
|
||||
"save-token-info": "Esto guardará tu token para reutilizarlo más fácilmente. Necesitarás crear una contraseña para encriptar tu token para su almacenamiento. Si alguna vez olvidas tu contraseña, solo necesitas proporcionar tu token nuevamente.",
|
||||
"password": "Contraseña",
|
||||
"password-too-short": "Contraseña demasiado corta",
|
||||
"info-enter-password": "Para descargar Beat Saber, se requiere tu token de inicio de sesión de Oculus. Introduce la contraseña utilizada para guardar tu token de Oculus.",
|
||||
"info-disabled-btn-password": "El token descifrado con la contraseña proporcionada es inválido. Asegúrate de que la contraseña sea la misma que la utilizada para guardar el token.",
|
||||
"enter-oculus-token": "Introducir un token de Oculus"
|
||||
},
|
||||
"valid-btn": "Validar"
|
||||
},
|
||||
"launch-as-admin": {
|
||||
"title": "Permisos Administrador",
|
||||
"body": {
|
||||
"info": "Se ha detectado que Steam está funcionando con permisos de administrador. Para comunicarse con Steam, Beat Saber también debe iniciarse como administrador. De lo contrario, Beat Saber podría experimentar problemas y cerrarse después de iniciar.",
|
||||
"info-2": "Iniciar Beat Saber en modo administrador también otorgará derechos de administrador a los mods instalados. Por lo tanto, se recomienda reiniciar Steam sin permisos de administrador.",
|
||||
"info-3": "Tenga en cuenta que se desaconseja otorgar derechos de administrador a Steam, ya que esto afecta a los juegos y mods instalados, presentando un riesgo de seguridad."
|
||||
},
|
||||
"launch-as-admin": "Iniciar como Administrador",
|
||||
"not-remind-me": "No volver a recordármelo"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"map-filter-panel": {
|
||||
"duration": "Duración",
|
||||
"nps" : "Notas Por Segundo",
|
||||
"tags": "tags",
|
||||
"specificities": "general",
|
||||
"requirements": "requisitos"
|
||||
"requirements": "requisitos",
|
||||
"exclude": "excluir"
|
||||
},
|
||||
"map-types": {
|
||||
"accuracy": "precisión",
|
||||
@@ -775,6 +791,9 @@
|
||||
"verified": "verificado",
|
||||
"fullSpread": "panel completo"
|
||||
},
|
||||
"map-excludes": {
|
||||
"installed": "instalado"
|
||||
},
|
||||
"difficulties": {
|
||||
"Easy": "fácil",
|
||||
"Normal": "normal",
|
||||
@@ -784,7 +803,13 @@
|
||||
},
|
||||
"map-item": {
|
||||
"by": "Por {songAutor}",
|
||||
"mapped-by": "mapeado por"
|
||||
"mapped-by": "mapeado por",
|
||||
"delete": "Borrar",
|
||||
"preview" : "Vista previa del mapa",
|
||||
"bsr-code" : "Código BSR",
|
||||
"download" : "Descargar mapa",
|
||||
"downloading" :"Descargando mapa",
|
||||
"cancel-download" : "Cancelar descarga"
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
@@ -943,7 +968,7 @@
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "Modelos rotos",
|
||||
"desc": "Desde la actualización del motor de Beat Saber, los modelos ya no son funcionales para esta versión."
|
||||
"desc": "Desde la actualización del motor de Beat Saber, todos los mods de modelos personalizados se han roto y necesitan ser actualizados. Todavía no han sido actualizados."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Exportación completada 🎉"
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps": {
|
||||
"title": "Maps partagées"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Mode Oculus",
|
||||
@@ -97,8 +94,7 @@
|
||||
"edit": "Modifier",
|
||||
"uninstall": "Désinstaller",
|
||||
"create-shortcut": "Créer un raccourci",
|
||||
"shared-folders": "Dossiers partagés",
|
||||
"restore-oculus-folder": "Restaurer le dossier"
|
||||
"shared-folders": "Dossiers partagés"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
@@ -156,6 +152,7 @@
|
||||
"de-DE": "Deutsch",
|
||||
"ru-RU": "Русский",
|
||||
"zh-CN": "简体中文",
|
||||
"zh-TW": "正體中文",
|
||||
"ja-JP": "日本語",
|
||||
"translated": {
|
||||
"en-EN": "Anglais, Royaume-Uni",
|
||||
@@ -165,6 +162,7 @@
|
||||
"de-DE": "Allemand",
|
||||
"ru-RU": "Russe",
|
||||
"zh-CN": "Chinois simplifié",
|
||||
"zh-TW": "Chinois traditionnel",
|
||||
"ja-JP": "Japonais"
|
||||
}
|
||||
}
|
||||
@@ -228,8 +226,11 @@
|
||||
"steam-download": {
|
||||
"warnings": {
|
||||
"msg": {
|
||||
"ManifestChecksum": "Le manifeste précédemment téléchargé ne correspond pas au nouveau 🤔",
|
||||
"ConnectionTimeout": "Ta connexion internet semble instable 🥶",
|
||||
"Unknown": "Quelque chose d'étrange s'est produit 🤔 Votre connexion est surement instable."
|
||||
"ConnectionLost": "La connexion a été perdue, essayez à nouveau...",
|
||||
"ConnectionError": "Impossible de se connecter à Steam, essayez à nouveau...",
|
||||
"Unknown": "Quelque chose d'étrange s'est produit 🤔 Votre connexion est probablement instable."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
@@ -693,30 +694,48 @@
|
||||
"title": "Attention",
|
||||
"body": {
|
||||
"must-be-installed-once": "Vous devez avoir installé au moins une fois Beat Saber depuis l'Oculus Store, sinon Beat Saber pourrait se fermer automatiquement après son lancement.",
|
||||
"need-backup": "Pour lancer cette version, le dossier d'installation de Beat Saber se trouvant dans votre librairie Oculus va être renommé.",
|
||||
"can-restore-later": "Au besoin, vous pourrez le restaurer depuis BSManager en vous rendant dans les options de la version originale Oculus et en cliquant sur \"Restaurer le dossier\"",
|
||||
"tips-launch-oculus": "Astuce : Vous pourrez lancer cette version directement depuis Oculus, tant que la version originale n'est pas restaurée."
|
||||
"will-backup": "Afin de lancer cette version, le dossier d'installation original de Beat Saber se trouvant dans votre bibliothèque Oculus va être renommé et sera automatiquement restauré à l'arrêt de Beat Saber."
|
||||
},
|
||||
"not-remind-me": "Ne plus me rappeler",
|
||||
"understood": "J'ai compris"
|
||||
},
|
||||
"enter-meta-token": {
|
||||
"title": "Token Meta",
|
||||
"title": "Token Oculus",
|
||||
"body": {
|
||||
"need-token": "Pour télécharger Beat Saber, votre token de connexion à Meta est nécessaire.",
|
||||
"how-obtain-token": "Comment obtenir mon Token Meta ?",
|
||||
"input-label": "Token Meta",
|
||||
"token-is-invalid": "Le Token est invalide."
|
||||
"info-enter-token": "Pour télécharger Beat Saber, votre token de connexion à Oculus est nécessaire.",
|
||||
"how-obtain-token": "Comment obtenir mon Token Oculus ?",
|
||||
"oculus-token": "Token Oculus",
|
||||
"token-is-invalid": "Le Token est invalide.",
|
||||
"save-my-token": "Sauvegarder mon token",
|
||||
"have-token-saved": "J'ai déjà un token sauvegardé",
|
||||
"save-token-info": "Ceci enregistrera votre token pour le réutiliser plus facilement. Vous devrez créer un mot de passe pour crypter votre token à des fins de stockage. Si jamais vous oubliez votre mot de passe, il vous suffit de fournir à nouveau votre token.",
|
||||
"password": "Mot de passe",
|
||||
"password-too-short": "Mot de passe trop court",
|
||||
"info-enter-password": "Pour télécharger Beat Saber, votre token de connexion à Oculus est nécessaire. Entrez le mot de passe utilisé pour sauvegarder votre token Oculus.",
|
||||
"info-disabled-btn-password": "Le token déchiffré à l'aide du mot de passe fourni est invalide. Assurez-vous que le mot de passe est le même que celui utilisé pour sauvegarder le token.",
|
||||
"enter-oculus-token": "Entrer un token Oculus"
|
||||
},
|
||||
"valid-btn": "Valider"
|
||||
},
|
||||
"launch-as-admin": {
|
||||
"title": "Permissions Administrateur",
|
||||
"body": {
|
||||
"info": "Steam a été détecté comme fonctionnant avec des permissions administrateur. Afin communiquer avec Steam, Beat Saber doit également être lancé en tant qu'administrateur. Dans le cas contraire, Beat Saber pourrait rencontrer des problèmes et se fermer après son lancement.",
|
||||
"info-2": "Lancer Beat Saber en mode administrateur donnera également les droits administrateur aux mods installés. Il est donc plutôt recommandé de redémarrer Steam sans permissions administrateur.",
|
||||
"info-3": "Notez qu'il est déconseillé de donner des droits d'administrateur à Steam, car cela affecte également les jeux et mods installés, présentant un risque pour la sécurité."
|
||||
},
|
||||
"launch-as-admin": "Lancer en administateur",
|
||||
"not-remind-me": "Ne plus me rappeler"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"map-filter-panel": {
|
||||
"duration": "Durée",
|
||||
"nps" : "Notes Par Seconde",
|
||||
"tags": "tags",
|
||||
"specificities": "général",
|
||||
"requirements": "requis"
|
||||
"requirements": "requis",
|
||||
"exclude": "exclure"
|
||||
},
|
||||
"map-types": {
|
||||
"accuracy": "précision",
|
||||
@@ -772,6 +791,9 @@
|
||||
"verified": "vérifiée",
|
||||
"fullSpread": "panel complet"
|
||||
},
|
||||
"map-excludes": {
|
||||
"installed": "installé"
|
||||
},
|
||||
"difficulties": {
|
||||
"Easy": "facile",
|
||||
"Normal": "normal",
|
||||
@@ -781,7 +803,13 @@
|
||||
},
|
||||
"map-item": {
|
||||
"by": "Par {songAutor}",
|
||||
"mapped-by": "mappée par"
|
||||
"mapped-by": "mappée par",
|
||||
"delete": "Supprimer",
|
||||
"preview" : "Aperçu de la carte",
|
||||
"bsr-code" : "Code BSR",
|
||||
"download" : "Télécharger la carte",
|
||||
"downloading" :"Téléchargement de la carte",
|
||||
"cancel-download" : "Annuler le téléchargement"
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
@@ -940,7 +968,7 @@
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "Modèles cassés",
|
||||
"desc": "Depuis la mise à jour du moteur de Beat Saber, les modèles ne sont plus fonctionnels pour cette version."
|
||||
"desc": "Depuis la mise à jour du moteur Beat Saber, tous les mods de modèles personnalisés ne sont plus fonctionnels et doivent être mis à jour. Ils n'ont pas encore été mis à jour."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Export terminé 🎉"
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps": {
|
||||
"title": "共有マップ"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Oculusモード",
|
||||
@@ -42,7 +39,6 @@
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"title": "共有マップ",
|
||||
"search-bar": {
|
||||
"search-placeholder": "マップを検索",
|
||||
"filters-btn": "絞り込み",
|
||||
@@ -98,8 +94,7 @@
|
||||
"edit": "編集",
|
||||
"uninstall": "アンインストール",
|
||||
"create-shortcut": "ショートカットを作成",
|
||||
"shared-folders": "共有フォルダー",
|
||||
"restore-oculus-folder": "フォルダーの復元"
|
||||
"shared-folders": "共有フォルダー"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
@@ -157,6 +152,7 @@
|
||||
"de-DE": "Deutsch",
|
||||
"ru-RU": "Русский",
|
||||
"zh-CN": "简体中文",
|
||||
"zh-TW": "正體中文",
|
||||
"ja-JP": "日本語",
|
||||
"translated": {
|
||||
"en-EN": "イギリス英語",
|
||||
@@ -166,6 +162,7 @@
|
||||
"de-DE": "ドイツ語",
|
||||
"ru-RU": "ロシア語",
|
||||
"zh-CN": "簡体字中国",
|
||||
"zh-TW": "繁体字中国",
|
||||
"ja-JP": "日本語"
|
||||
}
|
||||
}
|
||||
@@ -697,30 +694,48 @@
|
||||
"title": "注意",
|
||||
"body": {
|
||||
"must-be-installed-once": "少なくとも一度はOculus StoreからBeat Saberをインストールしている必要があります。そうしないとBeat Saberは起動後に自動的に終了する可能性があります。",
|
||||
"need-backup": "このバージョンを起動するには、OculusライブラリにあるBeat Saberインストールフォルダの名前を変更します。",
|
||||
"can-restore-later": "必要であれば、BSManagerから元のOculusバージョンのオプションに行き、'フォルダを復元'をクリックして復元することができます。",
|
||||
"tips-launch-oculus": "ヒント: 元のバージョンが復元されない限り、Oculusから直接このバージョンを起動することができます。"
|
||||
"will-backup": "このバージョンを起動するために、OculusライブラリにあるBeat Saberの元のインストールフォルダは名前が変更され、Beat Saberの終了時に自動的に復元されます。"
|
||||
},
|
||||
"not-remind-me": "二度と表示しないでください",
|
||||
"understood": "分かった"
|
||||
},
|
||||
"enter-meta-token": {
|
||||
"title": "Metaトークン",
|
||||
"title": "Oculusトークン",
|
||||
"body": {
|
||||
"need-token": "Beat Saberをダウンロードするには、Metaのログイントークンが必要です。",
|
||||
"how-obtain-token": "Metaトークンはどうやって入手すればいいですか?",
|
||||
"input-label": "Metaトークン",
|
||||
"token-is-invalid": "トークンが無効です。"
|
||||
"info-enter-token": "Beat Saberをダウンロードするには、あなたのオキュラスログイントークンが必要です。",
|
||||
"how-obtain-token": "オキュラストークンはどうやって取得するの?",
|
||||
"oculus-token": "オキュラストークン",
|
||||
"token-is-invalid": "トークンが無効です。",
|
||||
"save-my-token": "私のトークンを保存する",
|
||||
"have-token-saved": "すでにトークンを保存しています",
|
||||
"save-token-info": "これにより、トークンを簡単に再利用するために保存します。保管のためにトークンを暗号化するパスワードを作成する必要があります。パスワードを忘れた場合は、トークンを再度提供するだけです。",
|
||||
"password": "パスワード",
|
||||
"password-too-short": "パスワードが短すぎます",
|
||||
"info-enter-password": "Beat Saberをダウンロードするには、あなたのオキュラスログイントークンが必要です。オキュラストークンを保存するために使用したパスワードを入力してください。",
|
||||
"info-disabled-btn-password": "提供されたパスワードで復号化されたトークンは無効です。トークンを保存するために使用されたパスワードと同じであることを確認してください。",
|
||||
"enter-oculus-token": "オキュラストークンを入力する"
|
||||
},
|
||||
"valid-btn": "検証"
|
||||
"valid-btn": "確認"
|
||||
},
|
||||
"launch-as-admin": {
|
||||
"title": "管理者権限",
|
||||
"body": {
|
||||
"info": "Steamが管理者権限で動作していることが検出されました。Steamと通信するためには、Beat Saberも管理者として起動する必要があります。そうでない場合、Beat Saberは問題が発生し、起動後に終了する可能性があります。",
|
||||
"info-2": "管理者モードでBeat Saberを起動すると、インストールされたMODにも管理者権限が与えられます。そのため、管理者権限なしでSteamを再起動することをお勧めします。",
|
||||
"info-3": "Steamに管理者権限を与えることはお勧めできません。これはインストールされたゲームやMODにも影響を与え、セキュリティリスクをもたらすからです。"
|
||||
},
|
||||
"launch-as-admin": "管理者として起動",
|
||||
"not-remind-me": "Больше не напоминать"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"map-filter-panel": {
|
||||
"duration": "尺",
|
||||
"nps" : "秒間ノート数",
|
||||
"tags": "タグ",
|
||||
"specificities": "一般",
|
||||
"requirements": "要Mod"
|
||||
"requirements": "要Mod",
|
||||
"exclude": "除外する"
|
||||
},
|
||||
"map-types": {
|
||||
"accuracy": "正確",
|
||||
@@ -776,6 +791,9 @@
|
||||
"verified": "認証済み",
|
||||
"fullSpread": "フルスプレッド"
|
||||
},
|
||||
"map-excludes": {
|
||||
"installed": "インストール済み"
|
||||
},
|
||||
"difficulties": {
|
||||
"Easy": "easy",
|
||||
"Normal": "normal",
|
||||
@@ -785,7 +803,13 @@
|
||||
},
|
||||
"map-item": {
|
||||
"by": "By {songAutor}",
|
||||
"mapped-by": "作成者 "
|
||||
"mapped-by": "作成者 ",
|
||||
"delete": "削除",
|
||||
"preview" : "マッププレビュー",
|
||||
"bsr-code" : "BSRコード",
|
||||
"download" : "マップをダウンロード",
|
||||
"downloading" :"マップをダウンロード中",
|
||||
"cancel-download" : "ダウンロードをキャンセル"
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
@@ -944,7 +968,7 @@
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "モデルが壊れています!",
|
||||
"desc": "Beat Saberエンジンのアップデートしたため、このバージョンではモデルが機能しなくなりました。"
|
||||
"desc": "Beat Saberのエンジンアップデート以来、すべてのカスタムモデルのMODが壊れており、更新が必要です。まだ更新されていません。"
|
||||
},
|
||||
"export-success": {
|
||||
"title": "エクスポート完了🎉"
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps": {
|
||||
"title": "Общие карты"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Режим Oculus",
|
||||
@@ -42,7 +39,6 @@
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"title": "Общие карты",
|
||||
"search-bar": {
|
||||
"search-placeholder": "Поиск среди карт",
|
||||
"filters-btn": "Фильтр",
|
||||
@@ -98,8 +94,7 @@
|
||||
"edit": "Редактировать",
|
||||
"uninstall": "Удалить",
|
||||
"create-shortcut": "Создать ярлык",
|
||||
"shared-folders": "Общие папки",
|
||||
"restore-oculus-folder": "Восстановить папку"
|
||||
"shared-folders": "Общие папки"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
@@ -157,6 +152,7 @@
|
||||
"de-DE": "Deutsch",
|
||||
"ru-RU": "Русский",
|
||||
"zh-CN": "简体中文",
|
||||
"zh-TW": "正體中文",
|
||||
"ja-JP": "日本語",
|
||||
"translated": {
|
||||
"en-EN": "Английский, Великобритания",
|
||||
@@ -166,6 +162,7 @@
|
||||
"de-DE": "Немецкий",
|
||||
"ru-RU": "Русский",
|
||||
"zh-CN": "Китайский (упрощенный)",
|
||||
"zh-TW": "Китайский (традиционный)",
|
||||
"ja-JP": "Японский"
|
||||
}
|
||||
}
|
||||
@@ -697,30 +694,47 @@
|
||||
"title": "Внимание",
|
||||
"body": {
|
||||
"must-be-installed-once": "Вы должны были установить Beat Saber хотя бы один раз из Oculus Store, иначе Beat Saber может автоматически закрыться после запуска.",
|
||||
"need-backup": "Для запуска этой версии папка установки Beat Saber в вашей библиотеке Oculus будет переименована.",
|
||||
"can-restore-later": "При необходимости вы можете восстановить её через BSManager, перейдя в опции оригинальной версии Oculus и нажав на 'Восстановить папку'",
|
||||
"tips-launch-oculus": "Совет: Вы можете запустить эту версию напрямую через Oculus, пока оригинальная версия не восстановлена."
|
||||
"will-backup": "Для запуска этой версии исходная папка установки Beat Saber, находящаяся в вашей библиотеке Oculus, будет переименована и автоматически восстановлена при выходе из Beat Saber."
|
||||
},
|
||||
"not-remind-me": "Больше не напоминать",
|
||||
"understood": "Понял"
|
||||
},
|
||||
"enter-meta-token": {
|
||||
"title": "Мета Токен",
|
||||
"title": "Токен Oculus",
|
||||
"body": {
|
||||
"need-token": "Для загрузки Beat Saber требуется ваш токен входа в Meta.",
|
||||
"how-obtain-token": "Как получить мой Мета Токен?",
|
||||
"input-label": "Мета Токен",
|
||||
"token-is-invalid": "Токен недействителен."
|
||||
"info-enter-token": "Для загрузки Beat Saber требуется ваш токен входа в Oculus.",
|
||||
"how-obtain-token": "Как получить мой токен Oculus?",
|
||||
"oculus-token": "Токен Oculus",
|
||||
"token-is-invalid": "Токен недействителен.",
|
||||
"save-my-token": "Сохранить мой токен",
|
||||
"have-token-saved": "У меня уже есть сохраненный токен",
|
||||
"save-token-info": "Это сохранит ваш токен для удобства повторного использования. Вам необходимо создать пароль для шифрования вашего токена для хранения. Если вы забудете пароль, вам просто нужно будет снова предоставить свой токен.",
|
||||
"password": "Пароль",
|
||||
"password-too-short": "Слишком короткий пароль",
|
||||
"info-enter-password": "Для загрузки Beat Saber требуется ваш токен входа в Oculus. Введите пароль, используемый для сохранения вашего токена Oculus.",
|
||||
"info-disabled-btn-password": "Токен, расшифрованный с использованием предоставленного пароля, недействителен. Убедитесь, что пароль совпадает с тем, который использовался для сохранения токена.",
|
||||
"enter-oculus-token": "Введите токен Oculus"
|
||||
},
|
||||
"valid-btn": "Подтвердить"
|
||||
},
|
||||
"launch-as-admin": {
|
||||
"title": "Права Администратора",
|
||||
"body": {
|
||||
"info": "Обнаружено, что Steam работает с правами администратора. Чтобы связаться со Steam, Beat Saber также должен быть запущен от имени администратора. В противном случае Beat Saber может столкнуться с проблемами и закрыться после запуска.",
|
||||
"info-2": "Запуск Beat Saber в режиме администратора также даст права администратора установленным модам. Поэтому рекомендуется перезапустить Steam без прав администратора.",
|
||||
"info-3": "Обратите внимание, что не рекомендуется предоставлять права администратора Steam, так как это также влияет на установленные игры и моды, представляя угрозу безопасности."
|
||||
},
|
||||
"launch-as-admin": "Запустить от имени администратора"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"map-filter-panel": {
|
||||
"duration": "Длительность",
|
||||
"nps" : "Нот в Секунду",
|
||||
"tags": "тэги",
|
||||
"specificities": "основное",
|
||||
"requirements": "требуемые моды"
|
||||
"requirements": "требуемые моды",
|
||||
"exclude": "исключить"
|
||||
},
|
||||
"map-types": {
|
||||
"accuracy": "точность",
|
||||
@@ -776,6 +790,9 @@
|
||||
"verified": "проверенные авторы",
|
||||
"fullSpread": "полный набор"
|
||||
},
|
||||
"map-excludes": {
|
||||
"installed": "установленный"
|
||||
},
|
||||
"difficulties": {
|
||||
"Easy": "легко",
|
||||
"Normal": "нормально",
|
||||
@@ -785,7 +802,13 @@
|
||||
},
|
||||
"map-item": {
|
||||
"by": "От {songAutor}",
|
||||
"mapped-by": "автор карты "
|
||||
"mapped-by": "автор карты ",
|
||||
"delete": "Удалить",
|
||||
"preview" : "Предпросмотр карты",
|
||||
"bsr-code" : "Код BSR",
|
||||
"download" : "Скачать карту",
|
||||
"downloading" :"Загрузка карты",
|
||||
"cancel-download" : "Отменить загрузку"
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
@@ -944,7 +967,7 @@
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "Сломанные модели",
|
||||
"desc": "После обновления движка Beat Saber, модели не работают с этой версией."
|
||||
"desc": "С момента обновления движка Beat Saber, все пользовательские модификации моделей сломались и требуют обновления. Они еще не были обновлены."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Экспорт завершен 🎉"
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps": {
|
||||
"title": "共享谱面"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Oculus 模式",
|
||||
@@ -42,7 +39,6 @@
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"title": "Shared maps",
|
||||
"search-bar": {
|
||||
"search-placeholder": "谱面搜索",
|
||||
"filters-btn": "筛选",
|
||||
@@ -98,8 +94,7 @@
|
||||
"edit": "编辑",
|
||||
"uninstall": "卸载",
|
||||
"create-shortcut": "创建快捷方式",
|
||||
"shared-folders": "Shared Folders",
|
||||
"restore-oculus-folder": "Restore the folder"
|
||||
"shared-folders": "Shared Folders"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
@@ -157,6 +152,7 @@
|
||||
"de-DE": "Deutsch",
|
||||
"ru-RU": "Русский",
|
||||
"zh-CN": "简体中文",
|
||||
"zh-TW": "正體中文",
|
||||
"ja-JP": "日本語",
|
||||
"translated": {
|
||||
"en-EN": "英式英语",
|
||||
@@ -166,6 +162,7 @@
|
||||
"de-DE": "德语",
|
||||
"ru-RU": "俄语",
|
||||
"zh-CN": "简体中文",
|
||||
"zh-TW": "正体中文",
|
||||
"ja-JP": "日语"
|
||||
}
|
||||
}
|
||||
@@ -651,7 +648,6 @@
|
||||
"valid-btn": "取消关联谱面"
|
||||
}
|
||||
},
|
||||
|
||||
"download-maps": {
|
||||
"search-btn": "搜索",
|
||||
"loading-maps": "谱面加载中...",
|
||||
@@ -698,30 +694,48 @@
|
||||
"title": "警告",
|
||||
"body": {
|
||||
"must-be-installed-once": "你必须至少从 Oculus 商店安装过一次 BeatSaber,否则 BeatSaber 可能会在启动后自动关闭。",
|
||||
"need-backup": "要启动该版本,位于你的 Oculus 库中的 BeatSaber 安装文件夹将被重命名。",
|
||||
"can-restore-later": "如果需要,你可以通过前往 BSManager 的原始 Oculus 版本选项并点击'恢复文件夹'来恢复它。",
|
||||
"tips-launch-oculus": "提示:只要原始版本没有被恢复,你就可以直接从 Oculus 启动该版本。"
|
||||
"will-backup": "为了启动这个版本,位于您的Oculus库中的Beat Saber的原始安装文件夹将被重命名,并且在Beat Saber关闭时会自动恢复。"
|
||||
},
|
||||
"not-remind-me": "不再提醒我",
|
||||
"understood": "明白了"
|
||||
},
|
||||
"enter-meta-token": {
|
||||
"title": "Meta 令牌",
|
||||
"title": "Oculus令牌",
|
||||
"body": {
|
||||
"need-token": "要下载 BeatSaber,需要你的 Meta 登录令牌。",
|
||||
"how-obtain-token": "如何获取我的 Meta 令牌?",
|
||||
"input-label": "Meta 令牌",
|
||||
"token-is-invalid": "令牌无效。"
|
||||
"info-enter-token": "下载Beat Saber需要您的Oculus登录令牌。",
|
||||
"how-obtain-token": "我如何获得我的Oculus令牌?",
|
||||
"oculus-token": "Oculus令牌",
|
||||
"token-is-invalid": "令牌无效。",
|
||||
"save-my-token": "保存我的令牌",
|
||||
"have-token-saved": "我已经保存了一个令牌",
|
||||
"save-token-info": "这将保存您的令牌以便更容易地重新使用。您需要创建一个密码来加密您的令牌以进行存储。如果您忘记了密码,只需再次提供您的令牌即可。",
|
||||
"password": "密码",
|
||||
"password-too-short": "密码太短",
|
||||
"info-enter-password": "下载Beat Saber需要您的Oculus登录令牌。请输入用于保存您的Oculus令牌的密码。",
|
||||
"info-disabled-btn-password": "使用提供的密码解密的令牌无效。确保密码与保存令牌时使用的密码相同。",
|
||||
"enter-oculus-token": "输入Oculus令牌"
|
||||
},
|
||||
"valid-btn": "验证"
|
||||
},
|
||||
"launch-as-admin": {
|
||||
"title": "管理员权限",
|
||||
"body": {
|
||||
"info": "检测到Steam正在以管理员权限运行。为了与Steam通信,Beat Saber也必须以管理员身份启动。否则,Beat Saber可能会遇到问题并在启动后关闭。",
|
||||
"info-2": "以管理员模式启动Beat Saber还会将管理员权限赋予已安装的模组。因此,建议重启Steam,不使用管理员权限。",
|
||||
"info-3": "请注意,不建议给Steam管理员权限,因为这也会影响已安装的游戏和模组,带来安全风险。"
|
||||
},
|
||||
"launch-as-admin": "以管理员身份启动",
|
||||
"not-remind-me": "不再提醒我"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"map-filter-panel": {
|
||||
"duration": "时长",
|
||||
"nps" : "每秒音符数",
|
||||
"tags": "标签",
|
||||
"specificities": "general",
|
||||
"requirements": "要求"
|
||||
"requirements": "要求",
|
||||
"exclude": "排除"
|
||||
},
|
||||
"map-types": {
|
||||
"accuracy": "精确度",
|
||||
@@ -777,6 +791,9 @@
|
||||
"verified": "verified",
|
||||
"fullSpread": "full spread"
|
||||
},
|
||||
"map-excludes": {
|
||||
"installed": "已安装"
|
||||
},
|
||||
"difficulties": {
|
||||
"Easy": "easy",
|
||||
"Normal": "normal",
|
||||
@@ -786,7 +803,13 @@
|
||||
},
|
||||
"map-item": {
|
||||
"by": "By {songAutor}",
|
||||
"mapped-by": "mapped by"
|
||||
"mapped-by": "mapped by",
|
||||
"delete": "删除",
|
||||
"preview" : "预览地图",
|
||||
"bsr-code" : "BSR代码",
|
||||
"download" : "下载地图",
|
||||
"downloading" :"正在下载地图",
|
||||
"cancel-download" : "取消下载"
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
@@ -945,7 +968,7 @@
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "已损坏的模型",
|
||||
"desc": "因 BeatSaber 引擎更新,这些模型在该版本中不再可用。"
|
||||
"desc": "自从Beat Saber引擎更新以来,所有自定义模型的MOD都已损坏,需要更新。它们还没有被更新。"
|
||||
},
|
||||
"export-success": {
|
||||
"title": "导出成功 🎉"
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<job id="test">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript" src="regUtil.vbs" />
|
||||
<script language="VBScript">
|
||||
CheckZeroArgs("type A as first arg!!")
|
||||
|
||||
DetermineOSArchitecture()
|
||||
LoadRegistryImplementationByOSArchitecture()
|
||||
|
||||
'On Error Resume Next
|
||||
|
||||
Dim key: key = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
|
||||
Dim value: value = "AppData"
|
||||
|
||||
ParseHiveAndSubKey key, constHive, strSubKey
|
||||
|
||||
GetExpandedStringValue constHive, strSubKey, value, exResult
|
||||
WriteLine "GetExpandedStringValue: " & exResult
|
||||
|
||||
GetStringValue constHive, strSubKey, value, nResult
|
||||
WriteLine "GetStringValue: " & nResult
|
||||
|
||||
set ws = createobject("Wscript.shell")
|
||||
WriteLine "regread: " & ws.regread(key & "\AppData")
|
||||
</script>
|
||||
</job>
|
||||
@@ -1,75 +0,0 @@
|
||||
' Notes: wanted to implement this using a class but:
|
||||
' 1. No matter what I did I could not assign the result of GetObject to a private member
|
||||
' 2. It looks as if all methods were treated as subs from the outside world which is not good since
|
||||
' some of these need to return a value
|
||||
'
|
||||
|
||||
Set private_oReg = GetObject("winmgmts:\root\default:StdRegProv")
|
||||
|
||||
Function SetStringValue(constHive, strSubKey, strValueName, strValue)
|
||||
SetStringValue = private_oReg.SetStringValue(constHive, strSubKey, strValueName, strValue)
|
||||
End Function
|
||||
|
||||
Sub GetStringValue(constHive, strKey, strValueName, strValue)
|
||||
private_oReg.GetStringValue constHive, strKey, strValueName, strValue
|
||||
End Sub
|
||||
|
||||
Function SetExpandedStringValue(constHive, strSubKey, strValueName, strValue)
|
||||
SetExpandedStringValue = private_oReg.SetExpandedStringValue(constHive, strSubKey, strValueName, strValue)
|
||||
End Function
|
||||
|
||||
Sub GetExpandedStringValue(constHive, strKey, strValueName, strValue)
|
||||
private_oReg.GetExpandedStringValue constHive, strKey, strValueName, strValue
|
||||
End Sub
|
||||
|
||||
Function SetMultiStringValue(constHive, strSubKey, strValueName, arrValue)
|
||||
SetMultiStringValue = private_oReg.SetMultiStringValue(constHive, strSubKey, strValueName, arrValue)
|
||||
End Function
|
||||
|
||||
Sub GetMultiStringValue(constHive, strKey, strValueName, arrStrValue)
|
||||
private_oReg.GetMultiStringValue constHive, strKey, strValueName, arrStrValue
|
||||
End Sub
|
||||
|
||||
Function SetDWORDValue(constHive, strSubKey, strValueName, arrValue)
|
||||
SetDWORDValue = private_oReg.SetDWORDValue(constHive, strSubKey, strValueName, arrValue)
|
||||
End Function
|
||||
|
||||
Sub GetDWORDValue(constHive, strKey, strValueName, intDWordValue)
|
||||
private_oReg.GetDWORDValue constHive, strKey, strValueName, intDWordValue
|
||||
End Sub
|
||||
|
||||
Function SetQWORDValue(constHive, strSubKey, strValueName, strQWordValue)
|
||||
SetQWORDValue = private_oReg.SetQWORDValue(constHive, strSubKey, strValueName, strQWordValue)
|
||||
End Function
|
||||
|
||||
Sub GetQWORDValue(constHive, strKey, strValueName, intQWordValue)
|
||||
private_oReg.GetQWORDValue constHive, strKey, strValueName, intQWordValue
|
||||
End Sub
|
||||
|
||||
Function SetBinaryValue(constHive, strSubKey, strValueName, arrValue)
|
||||
SetBinaryValue = private_oReg.SetBinaryValue(constHive, strSubKey, strValueName, arrValue)
|
||||
End Function
|
||||
|
||||
Sub GetBinaryValue(constHive, strKey, strValueName, arrBinaryValue)
|
||||
private_oReg.GetBinaryValue constHive, strKey, strValueName, arrBinaryValue
|
||||
End Sub
|
||||
|
||||
Function EnumKey(constHive, strSubKey, arrKeyNames)
|
||||
EnumKey = private_oReg.EnumKey(constHive, strSubKey, arrKeyNames)
|
||||
End Function
|
||||
|
||||
Function EnumValues(constHive, strSubKey, arrValueNames, arrValueTypes)
|
||||
EnumValues = private_oReg.EnumValues(constHive, strSubKey, arrValueNames, arrValueTypes)
|
||||
End Function
|
||||
|
||||
Function CreateKey(constHive, strSubKey)
|
||||
CreateKey = private_oReg.CreateKey(constHive, strSubKey)
|
||||
End Function
|
||||
|
||||
Function DeleteKey(constHive, strSubKey)
|
||||
DeleteKey = private_oReg.DeleteKey(constHive, strSubKey)
|
||||
End Function
|
||||
|
||||
Function DeleteValue(constHive, strSubKey, strValue)
|
||||
DeleteValue = private_oReg.DeleteValue(constHive, strSubKey, strValue)
|
||||
End Function
|
||||
@@ -1,358 +0,0 @@
|
||||
' Notes: wanted to implement this using a class but:
|
||||
' 1. No matter what I did I could not assign the result of GetObject to a private member
|
||||
' 2. It looks as if all methods were treated as subs from the outside world which is not good since
|
||||
' some of these need to return a value
|
||||
|
||||
' should be removed when migration is complete
|
||||
Set private_oReg = GetObject("winmgmts:\root\default:StdRegProv")
|
||||
|
||||
Set private_oCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
|
||||
private_oCtx.Add "__ProviderArchitecture", CInt(OSArchitecture)
|
||||
|
||||
Set private_oLocator = CreateObject("Wbemscripting.SWbemLocator")
|
||||
Set private_oServices = private_oLocator.ConnectServer(".", "root\default","","",,,,private_oCtx)
|
||||
Set private_oRegSpecific = private_oServices.Get("StdRegProv")
|
||||
|
||||
Function CheckAccess(hDefKey,sSubKeyName,uRequired, bGranted )
|
||||
Set Inparams = private_oRegSpecific.Methods_("CheckAccess").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.uRequired = uRequired
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("CheckAccess", Inparams,,private_oCtx)
|
||||
|
||||
bGranted = Outparams.bGranted
|
||||
|
||||
|
||||
CheckAccess = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function CreateKey(hDefKey,sSubKeyName)
|
||||
Set Inparams = private_oRegSpecific.Methods_("CreateKey").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("CreateKey", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
CreateKey = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function DeleteKey(hDefKey,sSubKeyName)
|
||||
Set Inparams = private_oRegSpecific.Methods_("DeleteKey").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("DeleteKey", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
DeleteKey = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function DeleteValue(hDefKey,sSubKeyName,sValueName)
|
||||
Set Inparams = private_oRegSpecific.Methods_("DeleteValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("DeleteValue", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
DeleteValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function EnumKey(hDefKey,sSubKeyName, sNames )
|
||||
Set Inparams = private_oRegSpecific.Methods_("EnumKey").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("EnumKey", Inparams,,private_oCtx)
|
||||
|
||||
sNames = Outparams.sNames
|
||||
|
||||
|
||||
EnumKey = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function EnumValues(hDefKey,sSubKeyName, sNames,Types )
|
||||
Set Inparams = private_oRegSpecific.Methods_("EnumValues").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("EnumValues", Inparams,,private_oCtx)
|
||||
|
||||
sNames = Outparams.sNames
|
||||
|
||||
Types = Outparams.Types
|
||||
|
||||
|
||||
EnumValues = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function GetBinaryValue(hDefKey,sSubKeyName,sValueName, uValue )
|
||||
Set Inparams = private_oRegSpecific.Methods_("GetBinaryValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("GetBinaryValue", Inparams,,private_oCtx)
|
||||
|
||||
uValue = Outparams.uValue
|
||||
|
||||
|
||||
GetBinaryValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function GetDWORDValue(hDefKey,sSubKeyName,sValueName, uValue )
|
||||
Set Inparams = private_oRegSpecific.Methods_("GetDWORDValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("GetDWORDValue", Inparams,,private_oCtx)
|
||||
|
||||
uValue = Outparams.uValue
|
||||
|
||||
|
||||
GetDWORDValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function GetExpandedStringValue(hDefKey,sSubKeyName,sValueName, sValue )
|
||||
Set Inparams = private_oRegSpecific.Methods_("GetExpandedStringValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("GetExpandedStringValue", Inparams,,private_oCtx)
|
||||
|
||||
sValue = Outparams.sValue
|
||||
|
||||
|
||||
GetExpandedStringValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function GetMultiStringValue(hDefKey,sSubKeyName,sValueName, sValue )
|
||||
Set Inparams = private_oRegSpecific.Methods_("GetMultiStringValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("GetMultiStringValue", Inparams,,private_oCtx)
|
||||
|
||||
sValue = Outparams.sValue
|
||||
|
||||
|
||||
GetMultiStringValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function GetQWORDValue(hDefKey,sSubKeyName,sValueName, uValue )
|
||||
Set Inparams = private_oRegSpecific.Methods_("GetQWORDValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("GetQWORDValue", Inparams,,private_oCtx)
|
||||
|
||||
uValue = Outparams.uValue
|
||||
|
||||
|
||||
GetQWORDValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function GetSecurityDescriptor(hDefKey,sSubKeyName, Descriptor )
|
||||
Set Inparams = private_oRegSpecific.Methods_("GetSecurityDescriptor").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("GetSecurityDescriptor", Inparams,,private_oCtx)
|
||||
|
||||
Descriptor = Outparams.Descriptor
|
||||
|
||||
|
||||
GetSecurityDescriptor = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function GetStringValue(hDefKey,sSubKeyName,sValueName, sValue )
|
||||
Set Inparams = private_oRegSpecific.Methods_("GetStringValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("GetStringValue", Inparams,,private_oCtx)
|
||||
|
||||
sValue = Outparams.sValue
|
||||
|
||||
|
||||
GetStringValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function SetBinaryValue(hDefKey,sSubKeyName,sValueName,uValue)
|
||||
Set Inparams = private_oRegSpecific.Methods_("SetBinaryValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
Inparams.uValue = uValue
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("SetBinaryValue", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
SetBinaryValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function SetDWORDValue(hDefKey,sSubKeyName,sValueName,uValue)
|
||||
Set Inparams = private_oRegSpecific.Methods_("SetDWORDValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
Inparams.uValue = uValue
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("SetDWORDValue", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
SetDWORDValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function SetExpandedStringValue(hDefKey,sSubKeyName,sValueName,sValue)
|
||||
Set Inparams = private_oRegSpecific.Methods_("SetExpandedStringValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
Inparams.sValue = sValue
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("SetExpandedStringValue", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
SetExpandedStringValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function SetMultiStringValue(hDefKey,sSubKeyName,sValueName,sValue)
|
||||
Set Inparams = private_oRegSpecific.Methods_("SetMultiStringValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
Inparams.sValue = sValue
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("SetMultiStringValue", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
SetMultiStringValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function SetQWORDValue(hDefKey,sSubKeyName,sValueName,uValue)
|
||||
Set Inparams = private_oRegSpecific.Methods_("SetQWORDValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
Inparams.uValue = uValue
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("SetQWORDValue", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
SetQWORDValue = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function SetSecurityDescriptor(hDefKey,sSubKeyName,Descriptor)
|
||||
Set Inparams = private_oRegSpecific.Methods_("SetSecurityDescriptor").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.Descriptor = Descriptor
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("SetSecurityDescriptor", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
SetSecurityDescriptor = 0
|
||||
|
||||
End Function
|
||||
|
||||
Function SetStringValue(hDefKey,sSubKeyName,sValueName,sValue)
|
||||
Set Inparams = private_oRegSpecific.Methods_("SetStringValue").Inparameters
|
||||
|
||||
Inparams.hDefKey = hDefKey
|
||||
|
||||
Inparams.sSubKeyName = sSubKeyName
|
||||
|
||||
Inparams.sValueName = sValueName
|
||||
|
||||
Inparams.sValue = sValue
|
||||
|
||||
set Outparams = private_oRegSpecific.ExecMethod_("SetStringValue", Inparams,,private_oCtx)
|
||||
|
||||
|
||||
SetStringValue = 0
|
||||
|
||||
End Function
|
||||
@@ -1,7 +0,0 @@
|
||||
<job id="JsonSafeStreamTest">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript">
|
||||
str = """" & vbcrlf & "测试\"
|
||||
Write("{ ""a"": """ & JsonSafe(str) & """}" & vbcrlf)
|
||||
</script>
|
||||
</job>
|
||||
@@ -1,32 +0,0 @@
|
||||
<job id="createKeyStream">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript" src="regUtil.vbs" />
|
||||
<script language="VBScript">
|
||||
|
||||
CheckZeroArgs("usage: cscript regCreateKey.wsf architecture")
|
||||
DetermineOSArchitecture()
|
||||
LoadRegistryImplementationByOSArchitecture()
|
||||
|
||||
Do While Not stdin.AtEndOfLine
|
||||
strLine = stdin.ReadLine()
|
||||
strLine = unescape(trim(strLine))
|
||||
|
||||
If IsNull(strLine) or strLine = "" Then
|
||||
WScript.Quit 25127
|
||||
End If
|
||||
|
||||
ParseHiveAndSubKey strLine, constHive, strSubKey
|
||||
|
||||
if IsNull(constHive) Then
|
||||
WriteLineErr "unsupported hive " & strLine
|
||||
WScript.Quit 25122
|
||||
End If
|
||||
|
||||
Result = CreateKey(constHive, strSubKey)
|
||||
|
||||
If Not Result = 0 Then
|
||||
WScript.Quit Result
|
||||
End If
|
||||
Loop
|
||||
</script>
|
||||
</job>
|
||||
@@ -1,29 +0,0 @@
|
||||
<job id="deleteKey">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript" src="regUtil.vbs" />
|
||||
<script language="VBScript">
|
||||
|
||||
CheckZeroArgs("usage: cscript regDeleteKey.wsf architecture")
|
||||
DetermineOSArchitecture()
|
||||
LoadRegistryImplementationByOSArchitecture()
|
||||
|
||||
Do While Not stdin.AtEndOfLine
|
||||
|
||||
strLine = stdin.ReadLine()
|
||||
strLine = unescape(trim(strLine))
|
||||
|
||||
ParseHiveAndSubKey strLine, constHive, strSubKey
|
||||
|
||||
if IsNull(constHive) Then
|
||||
WriteLineErr "unsupported hive " & strLine
|
||||
WScript.Quit 25122
|
||||
End If
|
||||
|
||||
Result = DeleteKey(constHive, strSubKey)
|
||||
|
||||
If Not Result = 0 Then
|
||||
WScript.Quit Result
|
||||
End If
|
||||
Loop
|
||||
</script>
|
||||
</job>
|
||||
@@ -1,29 +0,0 @@
|
||||
<job id="deleteValue">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript" src="regUtil.vbs" />
|
||||
<script language="VBScript">
|
||||
|
||||
CheckZeroArgs("usage: cscript regDeleteValue.wsf architecture")
|
||||
DetermineOSArchitecture()
|
||||
LoadRegistryImplementationByOSArchitecture()
|
||||
|
||||
Do While Not stdin.AtEndOfLine
|
||||
|
||||
strLine = stdin.ReadLine()
|
||||
strLine = unescape(trim(strLine))
|
||||
|
||||
ParseHiveAndSubKeyAndValue strLine, constHive, strSubKey, strValue
|
||||
|
||||
if IsNull(constHive) Then
|
||||
WriteLineErr "unsupported hive " & strLine
|
||||
WScript.Quit 25122
|
||||
End If
|
||||
|
||||
Result = DeleteValue(constHive, strSubKey, strValue)
|
||||
|
||||
If Not Result = 0 Then
|
||||
WScript.Quit Result
|
||||
End If
|
||||
Loop
|
||||
</script>
|
||||
</job>
|
||||
@@ -1,49 +0,0 @@
|
||||
'
|
||||
' Lists the sub keys and values of a given registry key
|
||||
'
|
||||
' cscript regList.wsg HKLM\Software
|
||||
'
|
||||
' Will Yield:
|
||||
'
|
||||
' {
|
||||
' "hklm\software": {
|
||||
' "keys": [ .. array of sub keys .. ],
|
||||
' "values": {
|
||||
' "moo": {
|
||||
' "type": "REG_SZ",
|
||||
' "value": "bar"
|
||||
' }
|
||||
' }
|
||||
' }
|
||||
' }
|
||||
<job id="list">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript" src="regUtil.vbs" />
|
||||
<script language="VBScript">
|
||||
CheckZeroArgs("usage: cscript regList.wsf architecture regpath1 [regpath2] ... [regpathN]")
|
||||
DetermineOSArchitecture()
|
||||
LoadRegistryImplementationByOSArchitecture()
|
||||
|
||||
Write "{"
|
||||
On Error Resume Next
|
||||
For v = 1 To args.Count - 1
|
||||
If (v > 1) Then
|
||||
Write ","
|
||||
End If
|
||||
|
||||
Dim key: key = trim(args(v))
|
||||
|
||||
Write """" & JsonSafe(key) & """: "
|
||||
|
||||
ParseHiveAndSubKey key, constHive, strSubKey
|
||||
|
||||
If IsNull(constHive) Then
|
||||
WriteLineErr "unsupported hive " & args(v)
|
||||
WScript.Quit 25122
|
||||
End If
|
||||
|
||||
ListChildrenAsJson constHive, strSubKey
|
||||
Next
|
||||
Write "}"
|
||||
</script>
|
||||
</job>
|
||||
@@ -1,46 +0,0 @@
|
||||
'
|
||||
' Lists the sub keys and values of a given registry key, this script is slightly different
|
||||
' than regList because it reads stdin for the keys to list
|
||||
'
|
||||
' echo HKLM\Software | cscript regListStream.wsf A
|
||||
'
|
||||
' Will Yield:
|
||||
'
|
||||
' {
|
||||
' "hklm\software": {
|
||||
' "keys": [ .. array of sub keys .. ],
|
||||
' "values": {
|
||||
' "moo": {
|
||||
' "type": "REG_SZ",
|
||||
' "value": "bar"
|
||||
' }
|
||||
' }
|
||||
' }
|
||||
' }
|
||||
<job id="listStream">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript" src="regUtil.vbs" />
|
||||
<script language="VBScript">
|
||||
CheckZeroArgs("usage: echo KEY | cscript regListStream.wsf architecture")
|
||||
DetermineOSArchitecture()
|
||||
LoadRegistryImplementationByOSArchitecture()
|
||||
|
||||
Do While Not stdin.AtEndOfLine
|
||||
|
||||
strLine = stdin.ReadLine()
|
||||
strLine = unescape(trim(strLine))
|
||||
|
||||
ParseHiveAndSubKey strLine, constHive, strSubKey
|
||||
|
||||
if IsNull(constHive) Then
|
||||
WriteLineErr "unsupported hive " & strLine
|
||||
WScript.Quit 25122
|
||||
End If
|
||||
|
||||
Write "{ ""key"" : """ & JsonSafe(strLine) & """, ""data"": "
|
||||
ListChildrenAsJson constHive, strSubKey
|
||||
Write "}" & vbcrlf
|
||||
Loop
|
||||
|
||||
</script>
|
||||
</job>
|
||||
@@ -1,56 +0,0 @@
|
||||
<job id="putValue">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript" src="regUtil.vbs" />
|
||||
<script language="VBScript">
|
||||
usage = "usage: cscript regPutValue.wsf architecture" & vbNewLine _
|
||||
& "types: REG_SZ, REG_EXPAND_SZ, REG_BINARY, REG_DWORD, REG_MULTI_SZ, REG_QWORD"
|
||||
|
||||
CheckZeroArgs(usage)
|
||||
DetermineOSArchitecture()
|
||||
LoadRegistryImplementationByOSArchitecture()
|
||||
|
||||
ReadCount = 0
|
||||
Dim lineArgs(3)
|
||||
|
||||
Do While Not stdin.AtEndOfLine
|
||||
strLine = stdin.ReadLine()
|
||||
strLine = unescape(trim(strLine))
|
||||
|
||||
If IsNull(strLine) or strLine = "" Then
|
||||
WScript.Quit 25127
|
||||
End If
|
||||
|
||||
lineArgs(ReadCount) = strLine
|
||||
|
||||
ReadCount = ReadCount + 1
|
||||
|
||||
If ReadCount = 4 Then
|
||||
|
||||
ParseHiveAndSubKey lineArgs(0), constHive, strSubKey
|
||||
|
||||
if IsNull(constHive) Then
|
||||
WriteLineErr "unsupported hive " & lineArgs(0)
|
||||
WScript.Quit 25122
|
||||
End If
|
||||
|
||||
strValueName = lineArgs(1)
|
||||
strValue = lineArgs(2)
|
||||
strType = lineArgs(3)
|
||||
|
||||
Result = PutValue(constHive, strSubKey, strValueName, strValue, strType)
|
||||
|
||||
If Not Result = 0 Then
|
||||
WriteLineErr "error while putting value: " & result
|
||||
WScript.Quit Result
|
||||
End If
|
||||
|
||||
ReadCount = 0
|
||||
Erase lineArgs
|
||||
End If
|
||||
Loop
|
||||
|
||||
If ReadCount <> 0 Then
|
||||
WScript.Quit 25123
|
||||
End If
|
||||
</script>
|
||||
</job>
|
||||
@@ -1,358 +0,0 @@
|
||||
' TODO: consider incorporating a json writer of some sort instead of adhoc solution like the following
|
||||
' e.g: http://demon.tw/my-work/vbs-json.html
|
||||
|
||||
const HKEY_CLASSES_ROOT = &H80000000
|
||||
const HKEY_CURRENT_USER = &H80000001
|
||||
const HKEY_LOCAL_MACHINE = &H80000002
|
||||
const HKEY_USERS = &H80000003
|
||||
const HKEY_CURRENT_CONFIG = &H80000005
|
||||
|
||||
Sub LoadRegistryImplementationByOSArchitecture()
|
||||
If IsNull(OSArchitecture) Then
|
||||
WriteLineErr "missing OSArchitecture global. did not call util.DetermineOSArchitecture? or Forgot to load util.vbs?"
|
||||
WScript.Quit 25125
|
||||
End If
|
||||
|
||||
If OSArchitecture = "A" Then
|
||||
Include "ArchitectureAgnosticRegistry.vbs"
|
||||
Else
|
||||
Include "ArchitectureSpecificRegistry.vbs"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Function PutValue(constHive, strSubKey, strValueName, strValue, strType)
|
||||
Select Case UCase(strType)
|
||||
|
||||
Case "REG_SZ"
|
||||
PutValue = SetStringValue(constHive, strSubKey, strValueName, strValue)
|
||||
|
||||
Case "REG_EXPAND_SZ"
|
||||
PutValue = SetExpandedStringValue(constHive, strSubKey, strValueName, strValue)
|
||||
|
||||
Case "REG_BINARY"
|
||||
PutValue = SetBinaryValue(constHive, strSubKey, strValueName, ToBinaryValue(strValue))
|
||||
|
||||
Case "REG_NONE"
|
||||
PutValue = SetBinaryValue(constHive, strSubKey, strValueName, ToBinaryValue(strValue))
|
||||
|
||||
' TODO: need to check that indeed int is the right type here
|
||||
Case "REG_DWORD"
|
||||
PutValue = SetDWORDValue(constHive, strSubKey, strValueName, CDbl(strValue))
|
||||
|
||||
Case "REG_MULTI_SZ"
|
||||
PutValue = SetMultiStringValue(constHive, strSubKey, strValueName, Split(strValue, ","))
|
||||
|
||||
Case "REG_QWORD"
|
||||
PutValue = SetQWORDValue(constHive, strSubKey, strValueName, strValue)
|
||||
|
||||
Case "REG_DEFAULT"
|
||||
PutValue = SetStringValue(constHive, strSubKey, "", strValue)
|
||||
|
||||
Case Else
|
||||
PutValue = SetStringValue(constHive, strSubKey, strValueName, strValue)
|
||||
|
||||
End Select
|
||||
End Function
|
||||
|
||||
' render the child of a sub path strSubKey in hive constHive
|
||||
' as json.
|
||||
Sub ListChildrenAsJson(constHive, strSubKey)
|
||||
' start outputting json to stdout
|
||||
Write "{"
|
||||
|
||||
Dim e1: e1 = EnumKey (constHive, strSubKey, arrKeyNames)
|
||||
If e1 <> 0 Then
|
||||
Write """exists"": false,"
|
||||
Dim arrValueNames: arrValueNames = null
|
||||
Else
|
||||
Write """exists"": true,"
|
||||
|
||||
Dim e2: e2 = EnumValues (constHive, strSubKey, arrValueNames, arrValueTypes)
|
||||
If e2 <> 0 Then
|
||||
WScript.Quit e2
|
||||
End If
|
||||
End If
|
||||
|
||||
Write """keys"": ["
|
||||
If Not IsNull(arrKeyNames) Then
|
||||
For x = 0 To UBound(arrKeyNames)
|
||||
If (x > 0) Then
|
||||
Write ","
|
||||
End If
|
||||
|
||||
Write """" & JsonSafe(arrKeyNames(x)) & """"
|
||||
Next
|
||||
End If
|
||||
Write "],"
|
||||
' TODO: some duplicity of code between the two paths of this condition, this needs to be address at some point
|
||||
Write """values"":{"
|
||||
If Not IsNull(arrValueNames) Then
|
||||
For y = 0 To UBound(arrValueNames)
|
||||
If y > 0 Then
|
||||
Write ","
|
||||
End If
|
||||
|
||||
strValueName = arrValueNames(y)
|
||||
intValueType = arrValueTypes(y)
|
||||
|
||||
' assign the value to varValue
|
||||
GetValueByType constHive, strSubKey, strValueName, intValueType, varValue
|
||||
|
||||
WriteValue strValueName, intValueType, varValue
|
||||
Next
|
||||
Else
|
||||
' fix for keys with only default values in them
|
||||
' see http://stackoverflow.com/questions/8840343/how-to-read-the-default-value-from-registry-in-vbscript
|
||||
GetStringValue constHive, strSubKey, "", strDefaultValue
|
||||
|
||||
If IsNull(strDefaultValue) = false and strDefaultValue <> "" Then
|
||||
' write the default value with REG_SZ
|
||||
WriteValue "", 1, strDefaultValue
|
||||
End If
|
||||
End If
|
||||
Write "}}"
|
||||
End Sub
|
||||
|
||||
Sub WriteValue (strValueName, intValueType, varValue)
|
||||
Write """"
|
||||
Write JsonSafe(strValueName)
|
||||
Write """:{"
|
||||
Write """type"": """
|
||||
Write RenderType(intValueType)
|
||||
Write ""","
|
||||
Write """value"":"
|
||||
Write RenderValueByType(intValueType, varValue)
|
||||
Write "}"
|
||||
End Sub
|
||||
|
||||
' give a raw HKLM\something\somewhere
|
||||
' output the hive constant and the subkey, in this case:
|
||||
' HKEY_LOCAL_MACHINE will be assigned to outConstHive
|
||||
' and something\somewhere will be assigned to outStrSubKey
|
||||
Sub ParseHiveAndSubKey(strRawKey, outConstHive, outStrSubKey)
|
||||
' split into two parts to deduce the hive and the sub key
|
||||
arrSplitted = Split(strRawKey, "\", 2, 1)
|
||||
|
||||
If UBound(arrSplitted) > 0 Then
|
||||
strHive = arrSplitted(0)
|
||||
outStrSubKey = arrSplitted(1)
|
||||
Else
|
||||
strHive = strRawKey
|
||||
outStrSubKey = ""
|
||||
End If
|
||||
|
||||
outConstHive = StringToHiveConst(UCase(strHive))
|
||||
End Sub
|
||||
|
||||
Function ArrayRemoveAt(arr, pos)
|
||||
Dim i
|
||||
If IsArray(arr) Then
|
||||
If pos >= 0 And pos <= UBound(arr) Then
|
||||
For i = pos To UBound(arr) - 1
|
||||
arr(i) = arr(i + 1)
|
||||
Next
|
||||
ReDim Preserve arr(UBound(arr) - 1)
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
|
||||
Sub ParseHiveAndSubKeyAndValue(strRawKey, outConstHive, outStrSubKey, outStrValue)
|
||||
' split into two parts to deduce the hive and the sub key
|
||||
arrSplitted = Split(strRawKey, "\", -1, 1)
|
||||
|
||||
If UBound(arrSplitted) > 0 Then
|
||||
strHive = arrSplitted(0)
|
||||
outStrValue = arrSplitted(UBound(arrSplitted))
|
||||
test = ArrayRemoveAt(arrSplitted, UBound(arrSplitted))
|
||||
test = ArrayRemoveAt(arrSplitted, 0)
|
||||
outStrSubKey = Join(arrSplitted, "\")
|
||||
Else
|
||||
strHive = strRawKey
|
||||
outStrSubKey = ""
|
||||
End If
|
||||
|
||||
outConstHive = StringToHiveConst(UCase(strHive))
|
||||
End Sub
|
||||
|
||||
Function StringToHiveConst(strHive)
|
||||
|
||||
Select Case strHive
|
||||
Case "HKCR"
|
||||
StringToHiveConst = HKEY_CLASSES_ROOT
|
||||
Case "HKCU"
|
||||
StringToHiveConst = HKEY_CURRENT_USER
|
||||
Case "HKLM"
|
||||
StringToHiveConst = HKEY_LOCAL_MACHINE
|
||||
Case "HKU"
|
||||
StringToHiveConst = HKEY_USERS
|
||||
Case "HKCC"
|
||||
StringToHiveConst = HKEY_CURRENT_CONFIG
|
||||
Case Else
|
||||
StringToHiveConst = Null
|
||||
End Select
|
||||
|
||||
End Function
|
||||
|
||||
' TODO: this entire "by type" should be transformed into OOP style
|
||||
' where each type will have a class with render(), getValue() etc...
|
||||
|
||||
' convert a value type number into a string label
|
||||
Function RenderType(intType)
|
||||
RenderType = "REG_UNKNOWN"
|
||||
|
||||
Select Case intType
|
||||
Case 0
|
||||
RenderType = "REG_NONE"
|
||||
Case 1
|
||||
RenderType = "REG_SZ"
|
||||
Case 2
|
||||
RenderType = "REG_EXPAND_SZ"
|
||||
Case 3
|
||||
RenderType = "REG_BINARY"
|
||||
Case 4
|
||||
RenderType = "REG_DWORD"
|
||||
Case 7
|
||||
RenderType = "REG_MULTI_SZ"
|
||||
Case 11
|
||||
RenderType = "REG_QWORD"
|
||||
Case Else
|
||||
' TODO: should report / throw an error here
|
||||
WriteErr("invalid Registry Value Type " & intType)
|
||||
|
||||
End Select
|
||||
|
||||
End Function
|
||||
|
||||
' render by value type:
|
||||
' string will return as a string with double quotes, e.g "value"
|
||||
' multi string values which return as an array ot strings "["1", "2"]" (double quotes included ofc)
|
||||
' numeric values like DWORD and QWORD just return as the number e.g. 1
|
||||
' byte arrays such as reg_binary return as an array of ints, e.g [1,2,3]
|
||||
Function RenderValueByType(intType, varValue)
|
||||
|
||||
Select Case intType
|
||||
' REG_NONE
|
||||
Case 0
|
||||
RenderValueByType = "0"
|
||||
|
||||
' REG_SZ
|
||||
Case 1
|
||||
RenderValueByType = """" & JsonSafe(varValue) & """"
|
||||
|
||||
' REG_EXPAND_SZ
|
||||
Case 2
|
||||
RenderValueByType = """" & JsonSafe(varValue) & """"
|
||||
|
||||
' REG_BINARY
|
||||
Case 3
|
||||
RenderValueByType = RenderByteArray(varValue)
|
||||
|
||||
' REG_DWORD
|
||||
Case 4
|
||||
RenderValueByType= varValue
|
||||
|
||||
' REG_MULYI_SZ'
|
||||
Case 7
|
||||
|
||||
RenderValueByType = RenderStringArray(varValue)
|
||||
' REG_QWORD
|
||||
Case 11
|
||||
RenderValueByType = varValue
|
||||
Case Else
|
||||
' TODO: should report / throw an error here
|
||||
WriteErr("invalid Registry Value Type " & intType)
|
||||
End Select
|
||||
|
||||
End Function
|
||||
|
||||
' get the value of a registry based on its value type and assign it to out parameter outVarValue
|
||||
Sub GetValueByType(constHive, strKey, strValueName, intType, outVarValue)
|
||||
|
||||
Select Case intType
|
||||
' REG_NONE
|
||||
Case 0
|
||||
GetStringValue constHive, strKey, strValueName, "0"
|
||||
Exit Sub
|
||||
|
||||
' REG_SZ
|
||||
Case 1
|
||||
GetStringValue constHive, strKey, strValueName, outVarValue
|
||||
Exit Sub
|
||||
|
||||
' REG_EXPAND_SZ
|
||||
Case 2
|
||||
GetExpandedStringValue constHive, strKey, strValueName, outVarValue
|
||||
Exit Sub
|
||||
|
||||
' REG_BINARY
|
||||
Case 3
|
||||
GetBinaryValue constHive, strKey, strValueName, outVarValue
|
||||
Exit Sub
|
||||
|
||||
' REG_DWORD
|
||||
Case 4
|
||||
GetDWORDValue constHive, strKey, strValueName, outVarValue
|
||||
|
||||
' #21 - VBS does not support UInt32. This is the workaround
|
||||
If outVarValue < 0 Then outVarValue = 4294967296 + outVarValue
|
||||
|
||||
Exit Sub
|
||||
|
||||
' REG_MULYI_SZ'
|
||||
Case 7
|
||||
GetMultiStringValue constHive, strKey, strValueName, outVarValue
|
||||
Exit Sub
|
||||
|
||||
' REG_QWORD
|
||||
Case 11
|
||||
GetQWORDValue constHive, strKey, strValueName, outVarValue
|
||||
Exit Sub
|
||||
|
||||
Case Else
|
||||
' TODO: should report / throw an error here
|
||||
WriteErr("invalid Registry Value Type " & intType)
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
' render a byte array as a json array of numbers
|
||||
Function RenderByteArray(arr)
|
||||
RenderByteArray = "[]"
|
||||
|
||||
If Not IsNull(arr) Then
|
||||
RenderByteArray = "[" & Join(arr, ",") & "]"
|
||||
End If
|
||||
End Function
|
||||
|
||||
' render a string array as json string array
|
||||
Function RenderStringArray(arr)
|
||||
Result = "["
|
||||
If Not IsNull(arr) Then
|
||||
For t = 0 To UBound(arr)
|
||||
If (t > 0) Then
|
||||
Result = Result & ","
|
||||
End If
|
||||
|
||||
Result = Result & """" & JsonSafe(arr(t)) & """"
|
||||
Next
|
||||
End If
|
||||
Result = Result & "]"
|
||||
|
||||
RenderStringArray = Result
|
||||
End Function
|
||||
|
||||
Function ToBinaryValue(strValue)
|
||||
|
||||
arrValue = Split(strValue, ",")
|
||||
|
||||
If IsNull(arrValue) Then
|
||||
ToBinaryValue = Array()
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
For i = 0 To UBound(arrValue)
|
||||
arrValue(i) = CInt(arrValue(i))
|
||||
Next
|
||||
|
||||
ToBinaryValue = arrValue
|
||||
End Function
|
||||
@@ -1,162 +0,0 @@
|
||||
Set stdout = WScript.StdOut
|
||||
Set stderr = WScript.StdErr
|
||||
Set stdin = WScript.StdIn
|
||||
Set args = WScript.Arguments
|
||||
Set fs = CreateObject("scripting.filesystemobject")
|
||||
Dim OSArchitecture
|
||||
|
||||
Sub WriteErr(message)
|
||||
stderr.Write message
|
||||
End Sub
|
||||
|
||||
Sub WriteLineErr(message)
|
||||
stderr.WriteLine message
|
||||
End Sub
|
||||
|
||||
Sub Write(message)
|
||||
stdout.Write message
|
||||
End Sub
|
||||
|
||||
Sub WriteLine(message)
|
||||
stdout.WriteLine message
|
||||
End Sub
|
||||
|
||||
Function IndexOf(varNeedle, arrHaystack)
|
||||
IndexOf = -1
|
||||
|
||||
If Not IsArray(arrHaystack) Then
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
For xyz = 0 To UBound(arrHaystack)
|
||||
If arrHaystack(xyz) = varNeedle Then
|
||||
IndexOf = xyz
|
||||
Exit Function
|
||||
End If
|
||||
Next
|
||||
End Function
|
||||
|
||||
Sub CheckZeroArgs(message)
|
||||
' bail if args are missing
|
||||
If args.Count = 0 Then
|
||||
WriteLineErr message
|
||||
WScript.Quit 25121
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Dim ALLOWED_OS_ARCHITECTURE_VALUES: ALLOWED_OS_ARCHITECTURE_VALUES = Array("S", "A", "32", "64")
|
||||
|
||||
'
|
||||
' determine the architecture of the operating system, that will be used. there are 4 possibilities:
|
||||
' A - means agnostic
|
||||
' S - means that we want to use a specific architecture, but auto detect Item
|
||||
' 32 - explicitly use 32 bit architecture
|
||||
' 64 - explicitly use 64 bit architecture
|
||||
'
|
||||
Sub DetermineOSArchitecture()
|
||||
strArchitecture = args(0)
|
||||
|
||||
If IsNull(strArchitecture) Then
|
||||
WriteLineErr "missing architecture argument"
|
||||
WScript.Quit 25124
|
||||
End If
|
||||
|
||||
strArchitecture = UCase(strArchitecture)
|
||||
|
||||
If IndexOf(strArchitecture, ALLOWED_OS_ARCHITECTURE_VALUES) = -1 Then
|
||||
WriteLineErr "invalid architecture argument"
|
||||
WScript.Quit 25124
|
||||
End If
|
||||
|
||||
If (strArchitecture = "S") Then
|
||||
OSArchitecture = GetOSArchitecture()
|
||||
If OSArchitecture = -1 Then
|
||||
WriteLineErr "invalid os architecture detected " & OSArchitecture
|
||||
WScript.Quit 25126
|
||||
End If
|
||||
Else
|
||||
OSArchitecture = strArchitecture
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub Include(sPath)
|
||||
' TODO this is fragile, but should work for "modules" nested relatively to script root
|
||||
include_ScriptPath = Left(WScript.ScriptFullName, InStr(WScript.ScriptFullName, WScript.ScriptName) - 2)
|
||||
sPath = include_ScriptPath & "\" & sPath
|
||||
|
||||
include_code = fs.OpenTextFile(sPath).ReadAll
|
||||
ExecuteGlobal include_code
|
||||
End Sub
|
||||
|
||||
Function GetOSArchitecture()
|
||||
|
||||
Dim ObjWMI, ColSettings, ObjProcessor
|
||||
Dim StrComputer, ObjNetwork
|
||||
|
||||
Set ObjWMI = GetObject("winmgmts:\Root\CIMV2")
|
||||
Set ColSettings = ObjWMI.ExecQuery ("SELECT DataWidth, AddressWidth, Architecture FROM Win32_Processor")
|
||||
|
||||
' TODO: I make two assumptions here:
|
||||
' 1. Eveyone will have CPU0 device
|
||||
' 2. There is only one cpu defined in the wmi database (and if not, then they are all of the same architecture)
|
||||
Set ObjProcessor = ColSettings.Item("Win32_Processor.DeviceID=""CPU0""")
|
||||
|
||||
If ObjProcessor.Architecture = 0 AND ObjProcessor.AddressWidth = 32 Then
|
||||
GetOSArchitecture = 32
|
||||
ElseIf (ObjProcessor.Architecture = 6 OR ObjProcessor.Architecture = 9) AND ObjProcessor.DataWidth = 64 AND ObjProcessor.AddressWidth = 32 Then
|
||||
GetOSArchitecture = 32
|
||||
ElseIf (ObjProcessor.Architecture = 6 OR ObjProcessor.Architecture = 9) AND ObjProcessor.DataWidth = 64 AND ObjProcessor.AddressWidth = 64 Then
|
||||
GetOSArchitecture = 64
|
||||
Else
|
||||
GetOSArchitecture = -1
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
Function JsonSafe(inStrText)
|
||||
If inStrText = "" Then
|
||||
JsonSafe = ""
|
||||
Exit Function
|
||||
End If
|
||||
Dim outStrText: outStrText = inStrText
|
||||
outStrText = Replace(outStrText, "\", "\\")
|
||||
outStrText = Replace(outStrText, vbcrlf, "\\r\\n")
|
||||
outStrText = Replace(outStrText, vblf, "\\n")
|
||||
outStrText = Replace(outStrText, vbcr, "\\r")
|
||||
outStrText = Replace(outStrText, """", "\""")
|
||||
outStrText = JsonU(outStrText)
|
||||
JsonSafe = outStrText
|
||||
End Function
|
||||
|
||||
'TODO: need to change this function's name to something more appropriate
|
||||
Function JsonU(astr)
|
||||
|
||||
If isNull(astr) Then
|
||||
JsonU = ""
|
||||
Exit Function
|
||||
End If
|
||||
|
||||
Dim c
|
||||
Dim utftext: utftext = ""
|
||||
|
||||
For n = 1 To Len(astr)
|
||||
c = CLng(AscW(Mid(astr, n, 1)))
|
||||
|
||||
If c < 0 Then
|
||||
c = &H10000 + c
|
||||
End If
|
||||
|
||||
If c < &H80 Then
|
||||
utftext = utftext & Mid(astr, n, 1)
|
||||
ElseIf c < &H100 Then
|
||||
utftext = utftext & "\u00" & Hex(c)
|
||||
ElseIf c < &H1000 Then
|
||||
utftext = utftext & "\u0" & Hex(c)
|
||||
Else
|
||||
utftext = utftext & "\u" & Hex(c)
|
||||
End If
|
||||
Next
|
||||
|
||||
JsonU = utftext
|
||||
End Function
|
||||
@@ -1,52 +0,0 @@
|
||||
'
|
||||
' Lists the values of a given registry path, this script takes its input from stdin
|
||||
'
|
||||
' cscript regListStream.wsf A "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\AppData"
|
||||
'
|
||||
' Will Yield:
|
||||
'
|
||||
' {
|
||||
' "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\AppData": "value here"
|
||||
' }
|
||||
<job id="regRead">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript" src="regUtil.vbs" />
|
||||
<script language="VBScript">
|
||||
CheckZeroArgs("usage: cscript wsRegRead.wsf architecture path1...pathN")
|
||||
DetermineOSArchitecture()
|
||||
LoadRegistryImplementationByOSArchitecture()
|
||||
|
||||
set ws = createobject("Wscript.shell")
|
||||
|
||||
Write "["
|
||||
On Error Resume Next
|
||||
For v = 1 To args.Count - 1
|
||||
If (v > 1) Then
|
||||
Write ","
|
||||
End If
|
||||
|
||||
Dim key: key = trim(args(v))
|
||||
|
||||
' not really needed except for validation
|
||||
ParseHiveAndSubKeyAndValue key, constHive, strSubKey, strValue
|
||||
|
||||
if IsNull(constHive) Then
|
||||
WriteLineErr "unsupported hive " & args(v)
|
||||
WScript.Quit 25122
|
||||
End If
|
||||
|
||||
Write "{ ""path"" : """ & JsonSafe(key) & """, "
|
||||
|
||||
Dim result: result = ws.RegRead(args(v))
|
||||
Dim exists: exists = "true"
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
exists = "false"
|
||||
End if
|
||||
|
||||
Write """exists"": " & exists & ", "
|
||||
Write """value"": """ & JsonSafe(result) & """}" & vbcrlf
|
||||
Next
|
||||
Write "]"
|
||||
</script>
|
||||
</job>
|
||||
@@ -1,47 +0,0 @@
|
||||
'
|
||||
' Lists the values of a given registry path, this script takes its input from stdin
|
||||
'
|
||||
' echo HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\AppData | cscript regListStream.wsf A
|
||||
'
|
||||
' Will Yield:
|
||||
'
|
||||
' {
|
||||
' "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\AppData": "value here"
|
||||
' }
|
||||
<job id="regRead">
|
||||
<script language="VBScript" src="util.vbs" />
|
||||
<script language="VBScript" src="regUtil.vbs" />
|
||||
<script language="VBScript">
|
||||
CheckZeroArgs("usage: echo KEY | cscript wsRegRead.wsf architecture")
|
||||
DetermineOSArchitecture()
|
||||
LoadRegistryImplementationByOSArchitecture()
|
||||
|
||||
set ws = createobject("Wscript.shell")
|
||||
|
||||
Do While Not stdin.AtEndOfLine
|
||||
|
||||
strLine = stdin.ReadLine()
|
||||
strLine = unescape(trim(strLine))
|
||||
|
||||
' not really needed except for validation
|
||||
ParseHiveAndSubKeyAndValue strLine, constHive, strSubKey, strValue
|
||||
|
||||
if IsNull(constHive) Then
|
||||
WriteLineErr "unsupported hive " & strLine
|
||||
WScript.Quit 25122
|
||||
End If
|
||||
|
||||
Write "{ ""path"" : """ & JsonSafe(strLine) & """, "
|
||||
|
||||
Dim result: result = ws.RegRead(strLine)
|
||||
Dim exists: exists = "true"
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
exists = "false"
|
||||
End if
|
||||
|
||||
Write """exists"": " & exists & ", "
|
||||
Write """value"": """ & JsonSafe(result) & """}" & vbcrlf
|
||||
Loop
|
||||
</script>
|
||||
</job>
|
||||
@@ -0,0 +1,2 @@
|
||||
[target.x86_64-pc-windows-msvc]
|
||||
rustflags = ["-C", "target-feature=+crt-static"]
|
||||
@@ -0,0 +1,83 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.76"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.195"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.195"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "start_beat_saber_admin"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"winres",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.48"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.5.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
|
||||
[[package]]
|
||||
name = "winres"
|
||||
version = "0.1.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
|
||||
dependencies = [
|
||||
"toml",
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
[package]
|
||||
name = "start_beat_saber_admin"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
winres = "0.1.12"
|
||||
|
||||
[profile.release]
|
||||
codegen-units = 1
|
||||
lto = true
|
||||
opt-level = "z"
|
||||
|
||||
[package.metadata.winres]
|
||||
FileDescription = "Start Beat Saber as Admin"
|
||||
LegalCopyright = "Copyright © 2024 Zagrios"
|
||||
CompanyName = "Zagrios"
|
||||
@@ -0,0 +1,20 @@
|
||||
extern crate winres;
|
||||
|
||||
fn main() {
|
||||
if cfg!(target_os = "windows") {
|
||||
let mut res = winres::WindowsResource::new();
|
||||
res.set_manifest(r#"
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
||||
"#);
|
||||
res.set_icon("./icon.ico");
|
||||
res.compile().unwrap();
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 67 KiB |
@@ -0,0 +1,47 @@
|
||||
|
||||
use std::{process::Command, path::Path};
|
||||
|
||||
const EXECUTABLE_NAME: &str = "Beat Saber.exe";
|
||||
const AUTORIZED_ARGS: [&str; 8] = [
|
||||
"fpfc",
|
||||
"-vrmode",
|
||||
"oculus",
|
||||
"--verbose",
|
||||
"--no-yeet",
|
||||
"--disable-autoupdate",
|
||||
"--combine-logs",
|
||||
"editor"
|
||||
];
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
|
||||
let executable_path = Path::new(&args[1]);
|
||||
|
||||
if executable_path.file_name().unwrap() != EXECUTABLE_NAME {
|
||||
eprintln!("Executable path is not Beat Saber.exe.");
|
||||
return;
|
||||
}
|
||||
|
||||
if !executable_path.exists() || !executable_path.is_file() {
|
||||
eprintln!("Executable path is not valid.");
|
||||
return;
|
||||
}
|
||||
|
||||
let mut command = Command::new(executable_path);
|
||||
|
||||
if let Some(parent_dir) = executable_path.parent() {
|
||||
command.current_dir(parent_dir);
|
||||
}
|
||||
|
||||
for arg in args.iter().skip(2) {
|
||||
if !AUTORIZED_ARGS.contains(&arg.as_str()) {
|
||||
continue;
|
||||
}
|
||||
command.arg(arg);
|
||||
}
|
||||
|
||||
command.env("SteamAppId", "620980");
|
||||
|
||||
let _ = command.spawn();
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
[target.x86_64-pc-windows-msvc]
|
||||
rustflags = ["-C", "target-feature=+crt-static"]
|
||||
@@ -0,0 +1,281 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "core-foundation-sys"
|
||||
version = "0.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-deque"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
|
||||
dependencies = [
|
||||
"crossbeam-epoch",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.9.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.153"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
|
||||
|
||||
[[package]]
|
||||
name = "ntapi"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "oculus_symlink_cleaner"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"sysinfo",
|
||||
"winres",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rayon"
|
||||
version = "1.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd"
|
||||
dependencies = [
|
||||
"either",
|
||||
"rayon-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rayon-core"
|
||||
version = "1.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
|
||||
dependencies = [
|
||||
"crossbeam-deque",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.197"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.197"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.52"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sysinfo"
|
||||
version = "0.30.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6746919caf9f2a85bff759535664c060109f21975c5ac2e8652e60102bd4d196"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
"ntapi",
|
||||
"once_cell",
|
||||
"rayon",
|
||||
"windows",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.5.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
||||
dependencies = [
|
||||
"winapi-i686-pc-windows-gnu",
|
||||
"winapi-x86_64-pc-windows-gnu",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi-i686-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-x86_64-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
|
||||
dependencies = [
|
||||
"windows-core",
|
||||
"windows-targets",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-core"
|
||||
version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
|
||||
dependencies = [
|
||||
"windows-targets",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm",
|
||||
"windows_aarch64_msvc",
|
||||
"windows_i686_gnu",
|
||||
"windows_i686_msvc",
|
||||
"windows_x86_64_gnu",
|
||||
"windows_x86_64_gnullvm",
|
||||
"windows_x86_64_msvc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.52.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
|
||||
|
||||
[[package]]
|
||||
name = "winres"
|
||||
version = "0.1.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
|
||||
dependencies = [
|
||||
"toml",
|
||||
]
|
||||
@@ -0,0 +1,22 @@
|
||||
[package]
|
||||
name = "oculus_symlink_cleaner"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
winres = "0.1.12"
|
||||
|
||||
[dependencies]
|
||||
sysinfo = "0.30.6"
|
||||
|
||||
[profile.release]
|
||||
codegen-units = 1
|
||||
lto = true
|
||||
opt-level = "z"
|
||||
|
||||
[package.metadata.winres]
|
||||
FileDescription = "Clean Oculus Symlink after Beat Saber ends"
|
||||
LegalCopyright = "Copyright © 2024 Zagrios"
|
||||
CompanyName = "Zagrios"
|
||||
@@ -0,0 +1,9 @@
|
||||
extern crate winres;
|
||||
|
||||
fn main() {
|
||||
if cfg!(target_os = "windows") {
|
||||
let mut res = winres::WindowsResource::new();
|
||||
res.set_icon("./icon.ico");
|
||||
res.compile().unwrap();
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 67 KiB |
@@ -0,0 +1,78 @@
|
||||
use sysinfo::{Pid, ProcessRefreshKind, System};
|
||||
use std::{env, thread, time::Duration, fs};
|
||||
use std::ffi::OsStr;
|
||||
use std::path::Path;
|
||||
use std::str::FromStr;
|
||||
|
||||
const BEAT_SABER_OCULUS_FOLDER_NAME: &str = "hyperbolic-magnetism-beat-saber";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
if args.len() != 3 {
|
||||
eprintln!("Usage: {} <pid> <path_to_directory>", args[0]);
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
let pid: Pid = Pid::from_str(&args[1]).expect("Invalid pid");
|
||||
let directory_path = Path::new(&args[2]);
|
||||
|
||||
if directory_path.file_name() != Some(OsStr::new(BEAT_SABER_OCULUS_FOLDER_NAME)) {
|
||||
eprintln!("Directory name is not {}", BEAT_SABER_OCULUS_FOLDER_NAME);
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
// we want to monitor only processes
|
||||
let mut system = System::new_with_specifics(sysinfo::RefreshKind::new().with_processes(ProcessRefreshKind::everything()));
|
||||
|
||||
loop {
|
||||
system.refresh_processes();
|
||||
let process = system.process(pid);
|
||||
|
||||
match process {
|
||||
Some(_) => {
|
||||
println!("Process {} is still running.", pid);
|
||||
thread::sleep(Duration::from_secs(2));
|
||||
},
|
||||
None => {
|
||||
println!("Process {} has stopped, deleting directory {:?}", pid, directory_path);
|
||||
match delete_dir_if_is_symlink(directory_path) {
|
||||
Ok(_) => {
|
||||
println!("Directory {:?} deleted successfully.", directory_path);
|
||||
if let Err(e) = rename_specific_backup_directory(directory_path.parent().unwrap()) {
|
||||
eprintln!("Failed to rename backup directory: {}", e);
|
||||
}
|
||||
},
|
||||
Err(e) => eprintln!("Failed to delete directory {:?}: {}", directory_path, e),
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn delete_dir_if_is_symlink(path: &Path) -> Result<(), Box<dyn std::error::Error>>{
|
||||
match path.symlink_metadata()?.file_type().is_symlink() {
|
||||
true => {
|
||||
fs::remove_dir_all(path)?;
|
||||
Ok(())
|
||||
},
|
||||
false => {
|
||||
eprintln!("Path {:?} is not a symlink.", path);
|
||||
Err("Path is not a symlink.".into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn rename_specific_backup_directory(parent_path: &Path) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let backup_dir_name = format!("{}.bsmbak", BEAT_SABER_OCULUS_FOLDER_NAME);
|
||||
let backup_path = parent_path.join(&backup_dir_name);
|
||||
if backup_path.exists() && backup_path.is_dir() {
|
||||
let new_path = parent_path.join(BEAT_SABER_OCULUS_FOLDER_NAME);
|
||||
fs::rename(&backup_path, &new_path)?;
|
||||
println!("Renamed {:?} to {:?}", backup_path, new_path);
|
||||
Ok(())
|
||||
} else {
|
||||
Err(format!("Backup directory {:?} does not exist or is not a directory.", backup_path).into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,7 @@
|
||||
"@testing-library/react": "^13.3.0",
|
||||
"@types/archiver": "^5.3.1",
|
||||
"@types/color": "^3.0.3",
|
||||
"@types/crypto-js": "^4.2.1",
|
||||
"@types/dateformat": "^5.0.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "17.0.23",
|
||||
@@ -183,8 +184,8 @@
|
||||
"css-loader": "^6.7.1",
|
||||
"css-minimizer-webpack-plugin": "^4.1.0",
|
||||
"detect-port": "^1.3.0",
|
||||
"electron": "^27.0.0",
|
||||
"electron-builder": "^24.6.3",
|
||||
"electron": "^27.1.3",
|
||||
"electron-builder": "^24.9.1",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-notarize": "^1.2.1",
|
||||
"electronmon": "^2.0.2",
|
||||
@@ -238,16 +239,18 @@
|
||||
"@tippyjs/react": "^4.2.6",
|
||||
"archiver": "^6.0.1",
|
||||
"color": "^4.2.3",
|
||||
"crypto-js": "^4.2.0",
|
||||
"dateformat": "^5.0.3",
|
||||
"dot-prop": "^8.0.2",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-store": "^8.1.0",
|
||||
"electron-updater": "^6.1.5",
|
||||
"electron-updater": "^6.1.7",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"framer-motion": "^10.16.4",
|
||||
"fs-extra": "^11.1.1",
|
||||
"framer-motion": "^10.16.16",
|
||||
"fs-extra": "^11.2.0",
|
||||
"history": "^5.3.0",
|
||||
"is-elevated": "^3.0.0",
|
||||
"jszip": "^3.10.1",
|
||||
"md5-file": "^5.0.0",
|
||||
"node-abi": "^3.47.0",
|
||||
@@ -264,7 +267,6 @@
|
||||
"react-virtualized-auto-sizer": "^1.0.12",
|
||||
"react-window": "^1.8.8",
|
||||
"recursive-readdir": "^2.2.3",
|
||||
"regedit": "^5.1.2",
|
||||
"rfdc": "^1.3.0",
|
||||
"rxjs": "^7.8.0",
|
||||
"sanitize-filename": "^1.6.3",
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
{
|
||||
"name": "bs-manager",
|
||||
"version": "1.3.1-alpha.2",
|
||||
"version": "1.4.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bs-manager",
|
||||
"version": "1.3.1-alpha.2",
|
||||
"version": "1.4.6",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ps-list": "^7.2.0",
|
||||
"query-process": "^0.0.3",
|
||||
"regedit-rs": "^1.0.2",
|
||||
"sharp": "^0.32.6"
|
||||
}
|
||||
},
|
||||
@@ -343,6 +345,160 @@
|
||||
"once": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process/-/query-process-0.0.3.tgz",
|
||||
"integrity": "sha512-6WRue0P+c84abP0o8MkDvigoS/gkkJzsSBt10PsOoBkP7Yodo4DducFsn9XyS4S+LuVYPAE5Hr4+kVNR5Onykg==",
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"query-process-android-arm-eabi": "0.0.3",
|
||||
"query-process-android-arm64": "0.0.3",
|
||||
"query-process-linux-arm-gnueabihf": "0.0.3",
|
||||
"query-process-linux-arm64-gnu": "0.0.3",
|
||||
"query-process-linux-arm64-musl": "0.0.3",
|
||||
"query-process-linux-x64-gnu": "0.0.3",
|
||||
"query-process-linux-x64-musl": "0.0.3",
|
||||
"query-process-win32-arm64-msvc": "0.0.3",
|
||||
"query-process-win32-x64-msvc": "0.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process-android-arm-eabi": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-android-arm-eabi/-/query-process-android-arm-eabi-0.0.3.tgz",
|
||||
"integrity": "sha512-NB+9T+/poBcygDiG+7d2lJSeioP5ZyLT0HwUBdnLgNWvNCpzbJxydup1SLpnt5G2NF6nlTgbUZlH4hvxY7t/bw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process-android-arm64": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-android-arm64/-/query-process-android-arm64-0.0.3.tgz",
|
||||
"integrity": "sha512-TiAw2yO62vQzM0s02471LToHyUs/PRkLGGlA715z10BPIM5NckzIe245AI45CDyH6tE/3nVHUd0LX/dfjQtTcw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process-linux-arm-gnueabihf": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-arm-gnueabihf/-/query-process-linux-arm-gnueabihf-0.0.3.tgz",
|
||||
"integrity": "sha512-w7NLHBKt7qselCDoh/PVWyeuEb2NiiDDf1A9UB4K3Ns/H24hK3NbfMMBm8mCFxUnFUqoVX8O+VMs7dD/FNlTxA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process-linux-arm64-gnu": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-arm64-gnu/-/query-process-linux-arm64-gnu-0.0.3.tgz",
|
||||
"integrity": "sha512-nrPHjnSqCBuuN7IZkZWOnBpiJjyKOjfpT0Xt2EjSGp+I7C0CHbnhCL/vG1hBzaWZn0mxJ5nf0c5N0Fja7krnpQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process-linux-arm64-musl": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-arm64-musl/-/query-process-linux-arm64-musl-0.0.3.tgz",
|
||||
"integrity": "sha512-vk8xMYTnS1PRKhwJgqLKyBAGIFP2CYZW2BsaKuNgQKUrDv7NnBaG7yukZT8niHNO1ycSrFpR/xqeJ8R23hO07A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process-linux-x64-gnu": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-x64-gnu/-/query-process-linux-x64-gnu-0.0.3.tgz",
|
||||
"integrity": "sha512-j1tGcNnGyVCABJ1PHZD1gKuyuomNzsPow3NDuZzUGjPqvKu67RsmKJJJOhMyT1SvUkcqdLFdtS1KTD20I4GS5Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process-linux-x64-musl": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-x64-musl/-/query-process-linux-x64-musl-0.0.3.tgz",
|
||||
"integrity": "sha512-AOGrrI/Qcb30iKFstiW60zNG/HQevCY0Q38eMHGd7LrBZ5sEN7NzZOjzKp43KeNHejuZBDMxf0gdGAqDznOAng==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process-win32-arm64-msvc": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-win32-arm64-msvc/-/query-process-win32-arm64-msvc-0.0.3.tgz",
|
||||
"integrity": "sha512-LHvxbzMFwPPUXHe4bDCAqs1bYbp8j0bMW8XyJGPZnIYrnwHz6g8VE5WQEtXQxSznsbfVxAKJXUtn088EjDVazw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/query-process-win32-x64-msvc": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-win32-x64-msvc/-/query-process-win32-x64-msvc-0.0.3.tgz",
|
||||
"integrity": "sha512-LfHAKmfqyKCgl9K+sTz0KyNwMwB79VcXZUy/Et9iQKLuZt7PDYpHWcFdhrfHw2qqIdKWTED8KmnmsOLhUn/2OA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/queue-tick": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz",
|
||||
@@ -375,6 +531,64 @@
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/regedit-rs": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/regedit-rs/-/regedit-rs-1.0.2.tgz",
|
||||
"integrity": "sha512-4vEgiZNO1FCG8z/Zx3v/6PU1+eZ+ELe6R0ca+VB96Vw+Mi3M0IVHAjtMFbl97lUSX11dJqpyousX/wY8QcI1lA==",
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"regedit-rs-win32-arm64-msvc": "1.0.2",
|
||||
"regedit-rs-win32-ia32-msvc": "1.0.2",
|
||||
"regedit-rs-win32-x64-msvc": "1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/regedit-rs-win32-arm64-msvc": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/regedit-rs-win32-arm64-msvc/-/regedit-rs-win32-arm64-msvc-1.0.2.tgz",
|
||||
"integrity": "sha512-hM1sxazOJWKmiC9DM8QXW9Iqm50Mh/Y9G4/rRYQpWXjMzq7lTqjwVZRkAoBrHliFS6d1Lt4qkm5+Ybt6GkbDpw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/regedit-rs-win32-ia32-msvc": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/regedit-rs-win32-ia32-msvc/-/regedit-rs-win32-ia32-msvc-1.0.2.tgz",
|
||||
"integrity": "sha512-FLINrCJ30wm6NYw7skQUDET8NP1N46kH77dqesCiU+/FjWzzPE5luZYY+j4uf+hKjPY6/MCj2CB9l9VdPhaBVQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/regedit-rs-win32-x64-msvc": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/regedit-rs-win32-x64-msvc/-/regedit-rs-win32-x64-msvc-1.0.2.tgz",
|
||||
"integrity": "sha512-ccCSyd5vWBKVWftBKLKzegqwwPMWcQtIW0ub66dCFFuv2s+x2EcZZWGdD9dVXX2Z6V9DU2JRPKgWUNjVPaj6Xg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
@@ -792,6 +1006,76 @@
|
||||
"once": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"query-process": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process/-/query-process-0.0.3.tgz",
|
||||
"integrity": "sha512-6WRue0P+c84abP0o8MkDvigoS/gkkJzsSBt10PsOoBkP7Yodo4DducFsn9XyS4S+LuVYPAE5Hr4+kVNR5Onykg==",
|
||||
"requires": {
|
||||
"query-process-android-arm-eabi": "0.0.3",
|
||||
"query-process-android-arm64": "0.0.3",
|
||||
"query-process-linux-arm-gnueabihf": "0.0.3",
|
||||
"query-process-linux-arm64-gnu": "0.0.3",
|
||||
"query-process-linux-arm64-musl": "0.0.3",
|
||||
"query-process-linux-x64-gnu": "0.0.3",
|
||||
"query-process-linux-x64-musl": "0.0.3",
|
||||
"query-process-win32-arm64-msvc": "0.0.3",
|
||||
"query-process-win32-x64-msvc": "0.0.3"
|
||||
}
|
||||
},
|
||||
"query-process-android-arm-eabi": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-android-arm-eabi/-/query-process-android-arm-eabi-0.0.3.tgz",
|
||||
"integrity": "sha512-NB+9T+/poBcygDiG+7d2lJSeioP5ZyLT0HwUBdnLgNWvNCpzbJxydup1SLpnt5G2NF6nlTgbUZlH4hvxY7t/bw==",
|
||||
"optional": true
|
||||
},
|
||||
"query-process-android-arm64": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-android-arm64/-/query-process-android-arm64-0.0.3.tgz",
|
||||
"integrity": "sha512-TiAw2yO62vQzM0s02471LToHyUs/PRkLGGlA715z10BPIM5NckzIe245AI45CDyH6tE/3nVHUd0LX/dfjQtTcw==",
|
||||
"optional": true
|
||||
},
|
||||
"query-process-linux-arm-gnueabihf": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-arm-gnueabihf/-/query-process-linux-arm-gnueabihf-0.0.3.tgz",
|
||||
"integrity": "sha512-w7NLHBKt7qselCDoh/PVWyeuEb2NiiDDf1A9UB4K3Ns/H24hK3NbfMMBm8mCFxUnFUqoVX8O+VMs7dD/FNlTxA==",
|
||||
"optional": true
|
||||
},
|
||||
"query-process-linux-arm64-gnu": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-arm64-gnu/-/query-process-linux-arm64-gnu-0.0.3.tgz",
|
||||
"integrity": "sha512-nrPHjnSqCBuuN7IZkZWOnBpiJjyKOjfpT0Xt2EjSGp+I7C0CHbnhCL/vG1hBzaWZn0mxJ5nf0c5N0Fja7krnpQ==",
|
||||
"optional": true
|
||||
},
|
||||
"query-process-linux-arm64-musl": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-arm64-musl/-/query-process-linux-arm64-musl-0.0.3.tgz",
|
||||
"integrity": "sha512-vk8xMYTnS1PRKhwJgqLKyBAGIFP2CYZW2BsaKuNgQKUrDv7NnBaG7yukZT8niHNO1ycSrFpR/xqeJ8R23hO07A==",
|
||||
"optional": true
|
||||
},
|
||||
"query-process-linux-x64-gnu": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-x64-gnu/-/query-process-linux-x64-gnu-0.0.3.tgz",
|
||||
"integrity": "sha512-j1tGcNnGyVCABJ1PHZD1gKuyuomNzsPow3NDuZzUGjPqvKu67RsmKJJJOhMyT1SvUkcqdLFdtS1KTD20I4GS5Q==",
|
||||
"optional": true
|
||||
},
|
||||
"query-process-linux-x64-musl": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-linux-x64-musl/-/query-process-linux-x64-musl-0.0.3.tgz",
|
||||
"integrity": "sha512-AOGrrI/Qcb30iKFstiW60zNG/HQevCY0Q38eMHGd7LrBZ5sEN7NzZOjzKp43KeNHejuZBDMxf0gdGAqDznOAng==",
|
||||
"optional": true
|
||||
},
|
||||
"query-process-win32-arm64-msvc": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-win32-arm64-msvc/-/query-process-win32-arm64-msvc-0.0.3.tgz",
|
||||
"integrity": "sha512-LHvxbzMFwPPUXHe4bDCAqs1bYbp8j0bMW8XyJGPZnIYrnwHz6g8VE5WQEtXQxSznsbfVxAKJXUtn088EjDVazw==",
|
||||
"optional": true
|
||||
},
|
||||
"query-process-win32-x64-msvc": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/query-process-win32-x64-msvc/-/query-process-win32-x64-msvc-0.0.3.tgz",
|
||||
"integrity": "sha512-LfHAKmfqyKCgl9K+sTz0KyNwMwB79VcXZUy/Et9iQKLuZt7PDYpHWcFdhrfHw2qqIdKWTED8KmnmsOLhUn/2OA==",
|
||||
"optional": true
|
||||
},
|
||||
"queue-tick": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz",
|
||||
@@ -818,6 +1102,34 @@
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"regedit-rs": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/regedit-rs/-/regedit-rs-1.0.2.tgz",
|
||||
"integrity": "sha512-4vEgiZNO1FCG8z/Zx3v/6PU1+eZ+ELe6R0ca+VB96Vw+Mi3M0IVHAjtMFbl97lUSX11dJqpyousX/wY8QcI1lA==",
|
||||
"requires": {
|
||||
"regedit-rs-win32-arm64-msvc": "1.0.2",
|
||||
"regedit-rs-win32-ia32-msvc": "1.0.2",
|
||||
"regedit-rs-win32-x64-msvc": "1.0.2"
|
||||
}
|
||||
},
|
||||
"regedit-rs-win32-arm64-msvc": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/regedit-rs-win32-arm64-msvc/-/regedit-rs-win32-arm64-msvc-1.0.2.tgz",
|
||||
"integrity": "sha512-hM1sxazOJWKmiC9DM8QXW9Iqm50Mh/Y9G4/rRYQpWXjMzq7lTqjwVZRkAoBrHliFS6d1Lt4qkm5+Ybt6GkbDpw==",
|
||||
"optional": true
|
||||
},
|
||||
"regedit-rs-win32-ia32-msvc": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/regedit-rs-win32-ia32-msvc/-/regedit-rs-win32-ia32-msvc-1.0.2.tgz",
|
||||
"integrity": "sha512-FLINrCJ30wm6NYw7skQUDET8NP1N46kH77dqesCiU+/FjWzzPE5luZYY+j4uf+hKjPY6/MCj2CB9l9VdPhaBVQ==",
|
||||
"optional": true
|
||||
},
|
||||
"regedit-rs-win32-x64-msvc": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/regedit-rs-win32-x64-msvc/-/regedit-rs-win32-x64-msvc-1.0.2.tgz",
|
||||
"integrity": "sha512-ccCSyd5vWBKVWftBKLKzegqwwPMWcQtIW0ub66dCFFuv2s+x2EcZZWGdD9dVXX2Z6V9DU2JRPKgWUNjVPaj6Xg==",
|
||||
"optional": true
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bs-manager",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.8",
|
||||
"description": "BSManager",
|
||||
"main": "./dist/main/main.js",
|
||||
"author": {
|
||||
@@ -15,6 +15,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"ps-list": "^7.2.0",
|
||||
"query-process": "^0.0.3",
|
||||
"regedit-rs": "^1.0.2",
|
||||
"sharp": "^0.32.6"
|
||||
},
|
||||
"license": "MIT"
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import log from "electron-log";
|
||||
import { isPromise } from "../../shared/helpers/promise.helpers";
|
||||
import { tryit } from "../../shared/helpers/error.helpers";
|
||||
|
||||
type LogOptions = {
|
||||
logInput?: boolean;
|
||||
logOutput?: boolean;
|
||||
logArgs?: boolean;
|
||||
};
|
||||
|
||||
const stringifyArgs = (args: unknown[]) => {
|
||||
return args?.map(a => JSON.stringify(a)).join(', ');
|
||||
};
|
||||
|
||||
const logInfo = (message: string, propertyKey: string, args: unknown[], logArgs: boolean, result: unknown) => {
|
||||
log.info(`[${message}] ${propertyKey}(${logArgs ? stringifyArgs(args) : ''})`, result);
|
||||
};
|
||||
|
||||
const logError = (propertyKey: string, args: unknown[], logArgs: boolean, error: unknown) => {
|
||||
log.error(`[ERROR] ${propertyKey}(${logArgs ? stringifyArgs(args) : ''})`, error);
|
||||
throw error;
|
||||
};
|
||||
|
||||
export function Log(options?: LogOptions){
|
||||
|
||||
const logInput = options?.logInput ?? false;
|
||||
const logOutput = options?.logOutput ?? true;
|
||||
const logArgs = options?.logArgs ?? true;
|
||||
|
||||
return (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => {
|
||||
const originalMethod = descriptor.value;
|
||||
|
||||
descriptor.value = function(...args: unknown[]) {
|
||||
|
||||
if (logInput) {
|
||||
logInfo('INPUT', propertyKey, args, logArgs, null);
|
||||
}
|
||||
|
||||
const outcome = tryit(() => originalMethod.apply(this, args));
|
||||
|
||||
if (isPromise(outcome)) {
|
||||
return outcome.then(({ result, error }) => {
|
||||
|
||||
if (error) {
|
||||
logError(propertyKey, args, logArgs, error);
|
||||
}
|
||||
if (logOutput) {
|
||||
logInfo('OUTPUT', propertyKey, args, logArgs, result);
|
||||
}
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
const { result, error } = outcome;
|
||||
|
||||
if (error) {
|
||||
logError(propertyKey, args, logArgs, error);
|
||||
}
|
||||
|
||||
if (logOutput) {
|
||||
logInfo('OUTPUT', propertyKey, args, logArgs, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import { Observable, concatMap, from } from "rxjs";
|
||||
import log from "electron-log";
|
||||
import { BsmException } from "shared/models/bsm-exception.model";
|
||||
import crypto from "crypto";
|
||||
import { execSync } from "child_process";
|
||||
import { tryit } from "../../shared/helpers/error.helpers";
|
||||
|
||||
export async function pathExist(path: string): Promise<boolean> {
|
||||
try {
|
||||
@@ -232,6 +234,16 @@ export async function isJunction(path: string): Promise<boolean>{
|
||||
return lstats.isSymbolicLink() && stats.isDirectory();
|
||||
}
|
||||
|
||||
export function resolveGUIDPath(guidPath: string): string {
|
||||
const guidVolume = path.parse(guidPath).root;
|
||||
const command = `powershell -command "(Get-WmiObject -Class Win32_Volume | Where-Object { $_.DeviceID -like '${guidVolume}' }).DriveLetter"`;
|
||||
const {result: driveLetter, error} = tryit(() => execSync(command).toString().trim());
|
||||
if (!driveLetter || error) {
|
||||
throw new Error("Unable to resolve GUID path", error);
|
||||
}
|
||||
return path.join(driveLetter, path.relative(guidVolume, guidPath));
|
||||
}
|
||||
|
||||
export interface Progression<T = unknown> {
|
||||
total: number;
|
||||
current: number;
|
||||
|
||||
@@ -10,4 +10,16 @@ export async function taskRunning(task: string): Promise<boolean> {
|
||||
log.error(error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function getProcessPid(task: string): Promise<number> {
|
||||
try {
|
||||
const processes = await psList();
|
||||
const process = processes.find(process => process.name?.includes(task) || process.cmd?.includes(task));
|
||||
return process?.pid;
|
||||
}
|
||||
catch(error){
|
||||
log.error(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ import { IpcService } from '../services/ipc.service';
|
||||
import { from } from "rxjs";
|
||||
import { SteamLauncherService } from "../services/bs-launcher/steam-launcher.service";
|
||||
import { OculusLauncherService } from "../services/bs-launcher/oculus-launcher.service";
|
||||
import { SteamService } from "../services/steam.service";
|
||||
import log from "electron-log";
|
||||
import isElevated from "is-elevated";
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
@@ -13,6 +16,17 @@ ipc.on<LaunchOption>('bs-launch.launch', (req, reply) => {
|
||||
reply(bsLauncher.launch(req.args));
|
||||
});
|
||||
|
||||
ipc.on<boolean>("bs-launch.need-start-as-admin", (_, reply) => {
|
||||
const steam = SteamService.getInstance();
|
||||
reply(from(isElevated().then(elevated => {
|
||||
if(elevated){ return false; }
|
||||
return steam.isElevated().catch(e => {
|
||||
log.error("Error while checking if Steam is running as admin", e);
|
||||
return false;
|
||||
});
|
||||
})));
|
||||
});
|
||||
|
||||
ipc.on<LaunchOption>("create-launch-shortcut", (req, reply) => {
|
||||
const bsLauncher = BSLauncherService.getInstance();
|
||||
reply(from(bsLauncher.createLaunchShortcut(req.args)));
|
||||
@@ -23,10 +37,3 @@ ipc.on<void>("bs-launch.restore-steamvr", (_, reply) => {
|
||||
const steamLauncher = SteamLauncherService.getInstance();
|
||||
reply(from(steamLauncher.restoreSteamVR()));
|
||||
});
|
||||
|
||||
ipc.on<void>("restore-original-oculus-folder", (_, reply) => {
|
||||
const oculusLauncher = OculusLauncherService.getInstance();
|
||||
reply(from(
|
||||
oculusLauncher.deleteBsSymlinks().then(() => oculusLauncher.restoreOriginalBeatSaber())
|
||||
));
|
||||
})
|
||||
@@ -21,16 +21,20 @@ import { BSLauncherService } from "./services/bs-launcher/bs-launcher.service";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { LivShortcut } from "./services/liv/liv-shortcut.service";
|
||||
import { SteamLauncherService } from "./services/bs-launcher/steam-launcher.service";
|
||||
import { readdirSync, statSync, unlinkSync } from "fs-extra";
|
||||
|
||||
export const filterStrings = new Set<string>();
|
||||
export const filterPatterns = new Set<RegExp>();
|
||||
|
||||
const isDebug = process.env.NODE_ENV === "development" || process.env.DEBUG_PROD === "true";
|
||||
|
||||
log.transports.file.level = "info";
|
||||
log.transports.file.resolvePath = () => {
|
||||
const now = new Date();
|
||||
return path.join(app.getPath("logs"), `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}-v${app.getVersion()}.log`);
|
||||
};
|
||||
// Filter all occulus tokens
|
||||
filterPatterns.add(/FRL\S{10,}/g);
|
||||
|
||||
initLogger();
|
||||
deleteOlestLogs();
|
||||
deleteOldLogs();
|
||||
|
||||
log.catchErrors();
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
const sourceMapSupport = require("source-map-support");
|
||||
@@ -90,11 +94,11 @@ if (!gotTheLock) {
|
||||
})
|
||||
|
||||
app.whenReady().then(() => {
|
||||
|
||||
|
||||
app.setAppUserModelId(APP_NAME);
|
||||
|
||||
initServicesMustBeInitialized();
|
||||
|
||||
|
||||
const deepLink = process.argv.find(arg => DeepLinkService.getInstance().isDeepLink(arg));
|
||||
|
||||
if (!deepLink) {
|
||||
@@ -102,13 +106,132 @@ if (!gotTheLock) {
|
||||
} else {
|
||||
DeepLinkService.getInstance().dispatchLinkOpened(deepLink);
|
||||
}
|
||||
|
||||
|
||||
SteamLauncherService.getInstance().restoreSteamVR();
|
||||
|
||||
|
||||
// Log renderer errors
|
||||
ipcMain.on("log-error", (_, args: IpcRequest<unknown>) => {
|
||||
log.error(args?.args);
|
||||
});
|
||||
|
||||
|
||||
ipcMain.on("add-filter-string", (_, args: IpcRequest<string>) => {
|
||||
filterStrings.add(args?.args);
|
||||
});
|
||||
|
||||
ipcMain.on("add-filter-pattern", (_, args: IpcRequest<string>) => {
|
||||
filterPatterns.add(new RegExp(args?.args));
|
||||
});
|
||||
|
||||
}).catch(log.error);
|
||||
}
|
||||
|
||||
function initLogger(){
|
||||
log.transports.file.level = "info";
|
||||
log.transports.file.resolvePath = () => {
|
||||
const now = new Date();
|
||||
return path.join(app.getPath("logs"), `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}-v${app.getVersion()}.log`);
|
||||
};
|
||||
|
||||
log.hooks.push((message) => {
|
||||
|
||||
const filterMessage = (filter: string|RegExp, ...param: unknown[]): unknown[] => {
|
||||
return param.map(data => {
|
||||
|
||||
if(typeof data === "string"){
|
||||
return data.replaceAll(filter, "****");
|
||||
}
|
||||
|
||||
if(data instanceof Error){
|
||||
data.message = data.message?.replaceAll(filter, "****");
|
||||
data.stack = data.stack?.replaceAll(filter, "****");
|
||||
}
|
||||
|
||||
if(data instanceof Array){
|
||||
return filterMessage(filter, ...data);
|
||||
}
|
||||
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
||||
filterStrings.forEach(filter => {
|
||||
if(filter && message.data.length){
|
||||
message.data = filterMessage(filter, ...message.data);
|
||||
}
|
||||
});
|
||||
|
||||
filterPatterns.forEach(filter => {
|
||||
if(filter && message.data.length){
|
||||
message.data = filterMessage(filter, ...message.data);
|
||||
}
|
||||
});
|
||||
|
||||
return message;
|
||||
});
|
||||
|
||||
log.catchErrors();
|
||||
}
|
||||
|
||||
function getLogFilesEntries() {
|
||||
try {
|
||||
const logsFolder = app.getPath("logs");
|
||||
let logs = readdirSync(logsFolder, { withFileTypes: true });
|
||||
|
||||
logs = logs.filter(file => file.isFile() && path.extname(file.name) === ".log");
|
||||
|
||||
logs.sort((a, b) => {
|
||||
const aStat = statSync(path.join(logsFolder, a.name));
|
||||
const bStat = statSync(path.join(logsFolder, b.name));
|
||||
return bStat.mtime.getTime() - aStat.mtime.getTime();
|
||||
});
|
||||
|
||||
return logs.map(file => {
|
||||
const filePath = path.join(logsFolder, file.name);
|
||||
const stat = statSync(filePath);
|
||||
return {
|
||||
path: filePath,
|
||||
name: file.name,
|
||||
stats: stat
|
||||
};
|
||||
});
|
||||
} catch (err) {
|
||||
log.error('Error while retrieving log files entries:', err);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// keep only the last 5 logs
|
||||
function deleteOldLogs(): void{
|
||||
try {
|
||||
let logs = getLogFilesEntries();
|
||||
|
||||
logs = logs.slice(5);
|
||||
|
||||
logs.forEach(file => {
|
||||
try {
|
||||
unlinkSync(file.path);
|
||||
log.info(`Deleted log file: ${file.path}`);
|
||||
} catch (err) {
|
||||
log.error(`Error deleting file ${file.path}:`, err);
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
log.error("Error while deleting old logs:", err);
|
||||
}
|
||||
}
|
||||
|
||||
// Temporary function to delete logs before 2024-07-31
|
||||
function deleteOlestLogs(): void{
|
||||
// delete all logs before 2024-07-31
|
||||
const date = new Date(2024, 6, 31); // month is 0-based
|
||||
const logs = getLogFilesEntries().filter(file => file.stats.mtime.getTime() < date.getTime());
|
||||
|
||||
logs.forEach(file => {
|
||||
try {
|
||||
unlinkSync(file.path);
|
||||
log.info(`Deleted log file: ${file.path}`);
|
||||
} catch (err) {
|
||||
log.error(`Error deleting file ${file.path}:`, err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { InstallationLocationService } from "../installation-location.service";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import crypto from "crypto";
|
||||
import { lstatSync } from "fs";
|
||||
import { copy, createReadStream, ensureDir, realpath, unlink } from "fs-extra";
|
||||
import { copy, createReadStream, ensureDir, pathExists, realpath, unlink } from "fs-extra";
|
||||
import StreamZip from "node-stream-zip";
|
||||
import { RequestService } from "../request.service";
|
||||
import sanitize from "sanitize-filename";
|
||||
@@ -255,10 +255,12 @@ export class LocalMapsManagerService {
|
||||
const mapFolderName = sanitize(`${map.id}-${map.name}`);
|
||||
const mapsFolder = await this.getMapsFolderPath(version);
|
||||
|
||||
const installedMap = await this.loadMapInfoFromPath(path.join(mapsFolder, mapFolderName)).catch(e => {
|
||||
log.error("loadMapInfoFromPath", e);
|
||||
return null;
|
||||
});
|
||||
const mapPath = path.join(mapsFolder, mapFolderName);
|
||||
|
||||
const installedMap = await pathExists(mapPath).then(exists => {
|
||||
if(!exists){ return null; }
|
||||
return this.loadMapInfoFromPath(mapPath);
|
||||
}).catch(() => null);
|
||||
|
||||
if(map.versions.every(version => version.hash === installedMap?.hash)) {
|
||||
return installedMap;
|
||||
@@ -270,8 +272,6 @@ export class LocalMapsManagerService {
|
||||
throw `Cannot download ${zipUrl}`;
|
||||
}
|
||||
|
||||
const mapPath = path.join(mapsFolder, mapFolderName);
|
||||
|
||||
await ensureFolderExist(mapPath);
|
||||
|
||||
await zip.extract(null, mapPath);
|
||||
|
||||
@@ -5,9 +5,9 @@ import path from "path";
|
||||
import log from "electron-log";
|
||||
|
||||
export abstract class AbstractLauncherService {
|
||||
|
||||
|
||||
protected readonly localVersions = BSLocalVersionService.getInstance();
|
||||
|
||||
|
||||
constructor(){
|
||||
this.localVersions = BSLocalVersionService.getInstance();
|
||||
}
|
||||
@@ -46,18 +46,20 @@ export abstract class AbstractLauncherService {
|
||||
|
||||
}
|
||||
|
||||
protected launchBs(bsExePath: string, args: string[], options?: SpawnOptionsWithoutStdio): Promise<number> {
|
||||
return new Promise<number>((resolve, reject) => {
|
||||
const bsProcess = this.launchBSProcess(bsExePath, args, options);
|
||||
protected launchBs(bsExePath: string, args: string[], options?: SpawnOptionsWithoutStdio): {process: ChildProcessWithoutNullStreams, exit: Promise<number>} {
|
||||
const process = this.launchBSProcess(bsExePath, args, options);
|
||||
|
||||
bsProcess.on("error", reject);
|
||||
bsProcess.on("exit", resolve);
|
||||
|
||||
setTimeout(() => {
|
||||
bsProcess.removeAllListeners("error");
|
||||
bsProcess.removeAllListeners("exit");
|
||||
resolve(-1);
|
||||
}, 30_000);
|
||||
const exit = new Promise<number>((resolve, reject) => {
|
||||
process.on("error", (err) => {
|
||||
log.error(`Error while launching BS`, err);
|
||||
reject(err);
|
||||
});
|
||||
process.on("exit", (code) => {
|
||||
log.info(`BS process exit with code ${code}`);
|
||||
resolve(code);
|
||||
});
|
||||
});
|
||||
|
||||
return { process, exit };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,10 @@ import { AbstractLauncherService } from "./abstract-launcher.service";
|
||||
import { taskRunning } from "../../helpers/os.helpers";
|
||||
import { CustomError } from "../../../shared/models/exceptions/custom-error.class";
|
||||
import { InstallationLocationService } from "../installation-location.service";
|
||||
import { ensurePathNotAlreadyExist } from "../../helpers/fs.helpers";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import { spawn } from "child_process";
|
||||
import { tryit } from "../../../shared/helpers/error.helpers";
|
||||
|
||||
export class OculusLauncherService extends AbstractLauncherService implements StoreLauncherInterface {
|
||||
|
||||
@@ -25,6 +29,7 @@ export class OculusLauncherService extends AbstractLauncherService implements St
|
||||
|
||||
private readonly oculus: OculusService;
|
||||
private readonly pathsService: InstallationLocationService;
|
||||
private readonly util: UtilsService;
|
||||
|
||||
private readonly oculusLib$ = new ReplaySubject<string>();
|
||||
|
||||
@@ -32,9 +37,12 @@ export class OculusLauncherService extends AbstractLauncherService implements St
|
||||
super();
|
||||
this.oculus = OculusService.getInstance();
|
||||
this.pathsService = InstallationLocationService.getInstance();
|
||||
this.util = UtilsService.getInstance();
|
||||
|
||||
this.oculus.tryGetGameFolder([OCULUS_BS_DIR, OCULUS_BS_BACKUP_DIR]).then(async dirPath => {
|
||||
if(dirPath){ return this.oculusLib$.next( path.join(dirPath, "..") ); }
|
||||
if(dirPath){
|
||||
return this.oculusLib$.next( path.join(dirPath, "..") );
|
||||
}
|
||||
const defaultLib = ((await this.oculus.getOculusLibs()) || []).find(lib => lib.isDefault);
|
||||
if(defaultLib?.path){ return this.oculusLib$.next(path.join(defaultLib.path, "Software")); }
|
||||
this.oculusLib$.next(null);
|
||||
@@ -59,13 +67,13 @@ export class OculusLauncherService extends AbstractLauncherService implements St
|
||||
log.info("Symlinks found in Oculus library", symlinks);
|
||||
|
||||
const bsSymlinks = symlinks.filter(dirent => dirent.startsWith(OCULUS_BS_DIR));
|
||||
|
||||
|
||||
const bsmSymlinks = (await Promise.all(bsSymlinks.map(async symlink => {
|
||||
const symlinkPath = path.join(oculusLibPath, symlink);
|
||||
const targetPath = await readlink(symlinkPath).catch(err => log.error(err));
|
||||
|
||||
log.info("Oculus Symlink", symlink, "target", targetPath);
|
||||
|
||||
|
||||
if(!targetPath){ return null; }
|
||||
|
||||
const bsmVersionsDir = path.join(this.pathsService.INSTALLATION_FOLDER, this.pathsService.VERSIONS_FOLDER);
|
||||
@@ -84,7 +92,7 @@ export class OculusLauncherService extends AbstractLauncherService implements St
|
||||
private async backupOriginalBeatSaber(): Promise<void>{
|
||||
const bsFolder = await this.oculus.getGameFolder(OCULUS_BS_DIR);
|
||||
if(!bsFolder){ return; }
|
||||
const backupPath = path.join(bsFolder, "..", OCULUS_BS_BACKUP_DIR);
|
||||
const backupPath = await ensurePathNotAlreadyExist(path.join(bsFolder, "..", OCULUS_BS_BACKUP_DIR));
|
||||
log.info("Backing up original Beat Saber", bsFolder, backupPath);
|
||||
return rename(bsFolder, backupPath);
|
||||
}
|
||||
@@ -97,6 +105,15 @@ export class OculusLauncherService extends AbstractLauncherService implements St
|
||||
return rename(bsFolderBackupPath, originalPath);
|
||||
}
|
||||
|
||||
private launchSymlinkCleaner(pid: number, symlinkPath: string){
|
||||
|
||||
log.info("Launch Symlink Cleaner", pid, symlinkPath);
|
||||
|
||||
const exeName = "oculus_symlink_cleaner.exe";
|
||||
const scriptPath = this.util.getAssetsScriptsPath();
|
||||
spawn(path.join(scriptPath, exeName), [`${pid}`, symlinkPath], { detached: true, stdio: "ignore" });
|
||||
}
|
||||
|
||||
public launch(launchOptions: LaunchOption): Observable<BSLaunchEventData> {
|
||||
|
||||
const prepareOriginalVersion: () => Promise<string> = async () => {
|
||||
@@ -136,21 +153,34 @@ export class OculusLauncherService extends AbstractLauncherService implements St
|
||||
if(bsRunning){
|
||||
throw CustomError.fromError(new Error("Cannot start two instance of Beat Saber for Oculus"), BSLaunchError.BS_ALREADY_RUNNING);
|
||||
}
|
||||
|
||||
|
||||
// Remove previously symlinks created by BSM
|
||||
await this.deleteBsSymlinks().catch(err => log.error("Error while deleting BSM symlinks", err));
|
||||
|
||||
const bsPath = await (launchOptions.version.oculus ? prepareOriginalVersion() : prepareDowngradedVersion());
|
||||
|
||||
// Launch Beat Saber
|
||||
const exePath = path.join(bsPath, BS_EXECUTABLE);
|
||||
|
||||
if(!(await pathExists(exePath))){
|
||||
throw CustomError.fromError(new Error(`BS Path not exist ${bsPath}`), BSLaunchError.BS_NOT_FOUND);
|
||||
}
|
||||
|
||||
// Make sure Oculus is running
|
||||
await this.oculus.startOculus().catch(err => log.error("Error while starting Oculus", err));
|
||||
|
||||
obs.next({type: BSLaunchEvent.BS_LAUNCHING});
|
||||
return this.launchBs(exePath, this.buildBsLaunchArgs(launchOptions)).catch(err => {
|
||||
|
||||
// Launch Beat Saber
|
||||
const process = this.launchBs(exePath, this.buildBsLaunchArgs(launchOptions));
|
||||
|
||||
if(launchOptions.version.oculus !== true && process?.process?.pid){
|
||||
const { error } = tryit(() => this.launchSymlinkCleaner(process.process.pid, bsPath));
|
||||
if(error){
|
||||
log.error("Error while launching symlink cleaner", error);
|
||||
}
|
||||
}
|
||||
|
||||
return process.exit.catch(err => {
|
||||
throw CustomError.fromError(err, BSLaunchError.BS_EXIT_ERROR);
|
||||
});
|
||||
|
||||
@@ -168,4 +198,4 @@ export class OculusLauncherService extends AbstractLauncherService implements St
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import { BS_APP_ID, BS_EXECUTABLE, STEAMVR_APP_ID } from "../../constants";
|
||||
import log from "electron-log";
|
||||
import { AbstractLauncherService } from "./abstract-launcher.service";
|
||||
import { CustomError } from "../../../shared/models/exceptions/custom-error.class";
|
||||
import isElevated from "is-elevated";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import { exec } from "child_process";
|
||||
|
||||
export class SteamLauncherService extends AbstractLauncherService implements StoreLauncherInterface{
|
||||
|
||||
@@ -21,10 +24,12 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
|
||||
}
|
||||
|
||||
private readonly steam: SteamService;
|
||||
private readonly util: UtilsService;
|
||||
|
||||
private constructor(){
|
||||
super();
|
||||
this.steam = SteamService.getInstance();
|
||||
this.util = UtilsService.getInstance();
|
||||
}
|
||||
|
||||
private getSteamVRPath(): Promise<string> {
|
||||
@@ -41,6 +46,17 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
|
||||
});
|
||||
}
|
||||
|
||||
private needStartBsAsAdmin(): Promise<boolean> {
|
||||
return isElevated().then(elevated => {
|
||||
if(elevated){ return false; }
|
||||
return this.steam.isElevated();
|
||||
})
|
||||
}
|
||||
|
||||
private getStartBsAsAdminExePath(): string {
|
||||
return path.join(this.util.getAssetsScriptsPath(), "start_beat_saber_admin.exe");
|
||||
}
|
||||
|
||||
public async restoreSteamVR(): Promise<void> {
|
||||
const steamVrFolder = await this.getSteamVRPath();
|
||||
const steamVrBackup = `${steamVrFolder}.bak`;
|
||||
@@ -53,7 +69,7 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
|
||||
log.error("Error while restoring SteamVR", err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public launch(launchOptions: LaunchOption): Observable<BSLaunchEventData>{
|
||||
|
||||
return new Observable<BSLaunchEventData>(obs => {(async () => {
|
||||
@@ -90,13 +106,33 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
|
||||
|
||||
obs.next({type: BSLaunchEvent.BS_LAUNCHING});
|
||||
|
||||
await this.launchBs(exePath, launchArgs, { env: {...process.env, "SteamAppId": BS_APP_ID} }).then(exitCode => {
|
||||
const launchPromise = !launchOptions.admin ? (
|
||||
this.launchBs(exePath, launchArgs, { env: {...process.env, "SteamAppId": BS_APP_ID} }).exit
|
||||
) : (
|
||||
new Promise<number>(resolve => {
|
||||
const adminProcess = exec(`"${this.getStartBsAsAdminExePath()}" "${exePath}" ${launchArgs.join(" ")}`, { env: {...process.env, "SteamAppId": BS_APP_ID} });
|
||||
adminProcess.on("error", err => {
|
||||
log.error("Error while starting BS as Admin", err);
|
||||
resolve(-1)
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
adminProcess.removeAllListeners("error");
|
||||
resolve(-1);
|
||||
}, 35_000);
|
||||
})
|
||||
);
|
||||
|
||||
try {
|
||||
const exitCode = await launchPromise;
|
||||
log.info("BS process exit code", exitCode);
|
||||
}).catch(err => {
|
||||
}
|
||||
catch(err: any) {
|
||||
throw CustomError.fromError(err, BSLaunchError.BS_EXIT_ERROR);
|
||||
}).finally(() => {
|
||||
this.restoreSteamVR().catch(log.error);
|
||||
});
|
||||
}
|
||||
finally {
|
||||
await this.restoreSteamVR().catch(log.error);
|
||||
}
|
||||
|
||||
})().then(() => {
|
||||
obs.complete();
|
||||
@@ -109,4 +145,4 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
|
||||
})});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ import readline from "readline";
|
||||
import { Observable, Subject, catchError, finalize, from, map, switchMap, throwError } from "rxjs";
|
||||
import { BsStore } from "../../shared/models/bs-store.enum";
|
||||
import { CustomError } from "../../shared/models/exceptions/custom-error.class";
|
||||
import crypto from "crypto";
|
||||
|
||||
|
||||
export class BSLocalVersionService {
|
||||
private static instance: BSLocalVersionService;
|
||||
@@ -119,7 +121,14 @@ export class BSLocalVersionService {
|
||||
folderVersion.ino = folderStats.ino;
|
||||
}
|
||||
|
||||
folderVersion.metadata = await this.getAllVersionMetadata(folderVersion, { store: BsStore.STEAM });
|
||||
|
||||
let metadata = await this.getAllVersionMetadata(folderVersion);
|
||||
|
||||
// Will be removed in future version. It just to prepare future features
|
||||
if(!metadata?.id){
|
||||
metadata = await this.initVersionMetadata(folderVersion, metadata ?? { store: BsStore.STEAM });
|
||||
}
|
||||
folderVersion.metadata = metadata;
|
||||
|
||||
const customVersion = this.getCustomVersions().find(customVersion => {
|
||||
return customVersion.BSVersion === folderVersion.BSVersion && customVersion.name === folderVersion.name;
|
||||
@@ -130,36 +139,27 @@ export class BSLocalVersionService {
|
||||
return folderVersion;
|
||||
}
|
||||
|
||||
public getAllVersionMetadata(version: BSVersion, defaultMetadata?: BSVersionMetadata): Promise<BSVersionMetadata>{
|
||||
private async writeVersionMetadata(version: BSVersion, metadata: BSVersionMetadata): Promise<void>{
|
||||
const versionPath = await this.getVersionPath(version);
|
||||
const metadataPath = path.join(versionPath, this.METADATA_FILE);
|
||||
return writeFile(metadataPath, JSON.stringify(metadata));
|
||||
}
|
||||
|
||||
public initVersionMetadata(version: BSVersion, metadata: Omit<BSVersionMetadata, "id">): Promise<BSVersionMetadata>{
|
||||
const firstMetadata = { id: crypto.randomUUID(), ...metadata };
|
||||
return this.writeVersionMetadata(version, firstMetadata).then(() => firstMetadata).catch(err => {
|
||||
log.error("initVersionMetadata error", err);
|
||||
return firstMetadata;
|
||||
});
|
||||
}
|
||||
|
||||
public getAllVersionMetadata(version: BSVersion): Promise<BSVersionMetadata>{
|
||||
return (async () => {
|
||||
const versionPath = await this.getVersionPath(version);
|
||||
const contents = await readFile(path.join(versionPath, this.METADATA_FILE), "utf-8");
|
||||
return JSON.parse(contents);
|
||||
})().catch(e => {
|
||||
log.warn("Not a critical error", e);
|
||||
return {};
|
||||
}).then(metadata => ({...defaultMetadata, ...metadata}));
|
||||
}
|
||||
|
||||
public getVersionMetadata<K extends keyof BSVersionMetadata, T extends BSVersionMetadata[K]>(version: BSVersion, key: K, defaultValue?: T): Promise<T|undefined>{
|
||||
return (async () => {
|
||||
const metadata = await this.getAllVersionMetadata(version);
|
||||
return metadata?.[key];
|
||||
})().catch(e => {
|
||||
log.warn("Not a critical error", e);
|
||||
return null;
|
||||
}).then(value => (value ?? defaultValue) as T);
|
||||
}
|
||||
|
||||
public setVersionMetadata<K extends keyof BSVersionMetadata, T extends BSVersionMetadata[K]>(version: BSVersion, key: K, value: T): Promise<void>{
|
||||
return (async () => {
|
||||
const versionPath = await this.getVersionPath(version);
|
||||
const metadataPath = path.join(versionPath, this.METADATA_FILE);
|
||||
const metadata = await this.getAllVersionMetadata(version) ?? ({} as BSVersionMetadata);
|
||||
metadata[key] = value;
|
||||
await writeFile(metadataPath, JSON.stringify(metadata));
|
||||
})().catch(e => {
|
||||
log.error(e);
|
||||
log.warn("Error getAllVersionMetadata", e);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ export class BSLocalVersionService {
|
||||
}),
|
||||
finalize(async () => {
|
||||
if(failed){ return; }
|
||||
await this.setVersionMetadata(versionDest.version, "store", store);
|
||||
await this.initVersionMetadata(versionDest.version, { store });
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export class BsOculusDownloaderService {
|
||||
version: {
|
||||
...version,
|
||||
...(path.basename(dest) !== version.BSVersion && { name: path.basename(dest) }),
|
||||
metadata: { store: BsStore.OCULUS }
|
||||
metadata: { store: BsStore.OCULUS, id: "" }
|
||||
},
|
||||
dest
|
||||
};
|
||||
@@ -129,6 +129,7 @@ export class BsOculusDownloaderService {
|
||||
|
||||
return tokenObs$.pipe(
|
||||
switchMap(token => {
|
||||
isOculusTokenValid(token, log.info); // Log token validity
|
||||
if(!downloadInfo.isVerification){
|
||||
return this.createDownloadVersion(downloadInfo.bsVersion).then(({version, dest}) => ({token, version, dest}))
|
||||
}
|
||||
@@ -140,7 +141,7 @@ export class BsOculusDownloaderService {
|
||||
progress => ({...progress, data: version})
|
||||
));
|
||||
}),
|
||||
finalize(() => downloadVersion && this.versions.setVersionMetadata(downloadVersion, "store", BsStore.OCULUS)),
|
||||
finalize(() => downloadVersion && this.versions.initVersionMetadata(downloadVersion, { store: BsStore.OCULUS })),
|
||||
finalize(() => this.oculusDownloader.stopDownload())
|
||||
);
|
||||
}
|
||||
@@ -170,7 +171,7 @@ export class BsOculusDownloaderService {
|
||||
map(progress => ({...progress, data: version})),
|
||||
);
|
||||
}),
|
||||
finalize(() => downloadVersion && this.versions.setVersionMetadata(downloadVersion, "store", BsStore.OCULUS)),
|
||||
finalize(() => downloadVersion && this.versions.initVersionMetadata(downloadVersion, { store: BsStore.OCULUS })),
|
||||
finalize(() => this.oculusDownloader.stopDownload()),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ export class BsSteamDownloaderService {
|
||||
const downloadVersion: BSVersion = {
|
||||
...downloadInfos.bsVersion,
|
||||
...(path.basename(dest) !== downloadInfos.bsVersion.BSVersion && { name: path.basename(dest) }),
|
||||
metadata: { store: BsStore.STEAM }
|
||||
metadata: { store: BsStore.STEAM, id: "" }
|
||||
};
|
||||
|
||||
const depotDownloaderOptions: DepotDownloaderArgsOptions = {
|
||||
@@ -118,7 +118,7 @@ export class BsSteamDownloaderService {
|
||||
}
|
||||
return event;
|
||||
}),
|
||||
finalize(() => this.localVersionService.setVersionMetadata(version, "store", BsStore.STEAM))
|
||||
finalize(() => this.localVersionService.initVersionMetadata(version, { store: BsStore.STEAM }))
|
||||
).subscribe(sub);
|
||||
|
||||
}).catch(err => sub.error({
|
||||
|
||||
@@ -2,6 +2,8 @@ import path from "path";
|
||||
import { app } from "electron";
|
||||
import ElectronStore from "electron-store";
|
||||
import { copyDirectoryWithJunctions, deleteFolder, ensureFolderExist, pathExist } from "../helpers/fs.helpers";
|
||||
import { tryit } from "../../shared/helpers/error.helpers";
|
||||
import { pathExistsSync } from "fs-extra";
|
||||
|
||||
export class InstallationLocationService {
|
||||
private static instance: InstallationLocationService;
|
||||
@@ -67,8 +69,8 @@ export class InstallationLocationService {
|
||||
return this.installPathConfig.get(this.STORE_INSTALLATION_PATH_KEY) as string;
|
||||
}
|
||||
|
||||
const oldPath = path.join(app.getPath("documents"), this.INSTALLATION_FOLDER);
|
||||
if(await pathExist(oldPath)){
|
||||
const { result: oldPath } = tryit(() => path.join(app.getPath("documents"), this.INSTALLATION_FOLDER));
|
||||
if(oldPath && pathExistsSync(oldPath)){
|
||||
return app.getPath("documents");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { execOnOs } from "../../helpers/env.helpers";
|
||||
import path from "path";
|
||||
import regedit from "regedit";
|
||||
import { Log } from "../../decorators/log.decorator";
|
||||
|
||||
const { list, createKey, putValue, deleteKey, RegSzValue } = (execOnOs({ win32: () => require("regedit-rs") }, true) ?? {}) as typeof import("regedit-rs");
|
||||
|
||||
export class LivService {
|
||||
|
||||
@@ -20,65 +22,58 @@ export class LivService {
|
||||
|
||||
}
|
||||
|
||||
@Log()
|
||||
public async isLivInstalled(): Promise<boolean> {
|
||||
return execOnOs({
|
||||
win32: async () => {
|
||||
const regRes = await regedit.promisified.list([this.livRegeditKey]).then(res => res[this.livRegeditKey]);
|
||||
return regRes?.exists;
|
||||
const regRes = await list(this.livRegeditKey).then(res => res[this.livRegeditKey]);
|
||||
return regRes.exists;
|
||||
},
|
||||
}, true);
|
||||
}
|
||||
|
||||
@Log()
|
||||
public async createLivShortcut(entry: LivEntry): Promise<void> {
|
||||
return execOnOs({
|
||||
win32: async () => {
|
||||
const livExternalAppRegeditKey = path.join(this.livExternalAppsRegeditKey, entry.id);
|
||||
await regedit.promisified.createKey([livExternalAppRegeditKey]);
|
||||
await regedit.promisified.putValue({
|
||||
await createKey(livExternalAppRegeditKey);
|
||||
await putValue({
|
||||
[livExternalAppRegeditKey]: {
|
||||
"InstallPath": {
|
||||
value: entry.installPath,
|
||||
type: "REG_SZ"
|
||||
},
|
||||
"Executable": {
|
||||
value: entry.executable,
|
||||
type: "REG_SZ"
|
||||
},
|
||||
"Arguments": {
|
||||
value: entry.arguments,
|
||||
type: "REG_SZ"
|
||||
},
|
||||
"Name": {
|
||||
value: entry.name,
|
||||
type: "REG_SZ"
|
||||
}
|
||||
InstallPath: new RegSzValue(entry.installPath),
|
||||
Executable: new RegSzValue(entry.executable),
|
||||
Arguments: new RegSzValue(entry.arguments),
|
||||
Name: new RegSzValue(entry.name)
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Log()
|
||||
public async deleteLivShortcuts(ids: string[]): Promise<void> {
|
||||
return execOnOs({
|
||||
win32: async () => {
|
||||
const shotcutsKeys = ids.map(id => path.join(this.livExternalAppsRegeditKey, id));
|
||||
return regedit.promisified.deleteKey(shotcutsKeys);
|
||||
return deleteKey(shotcutsKeys);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@Log()
|
||||
public getLivShortcuts(): Promise<LivEntry[]> {
|
||||
|
||||
return execOnOs({
|
||||
win32: async () => {
|
||||
const regRes = await regedit.promisified.list([this.livExternalAppsRegeditKey]).then(res => res[this.livExternalAppsRegeditKey]);
|
||||
|
||||
const regRes = await list(this.livExternalAppsRegeditKey).then(res => res[this.livExternalAppsRegeditKey]);
|
||||
|
||||
if(!regRes.exists){
|
||||
return [];
|
||||
}
|
||||
|
||||
const promises = regRes.keys.map(async key => {
|
||||
const shortcutKey = path.join(this.livExternalAppsRegeditKey, key);
|
||||
const entries = await regedit.promisified.list([shortcutKey]).then(res => res[shortcutKey]);
|
||||
const entries = await list(shortcutKey).then(res => res[shortcutKey]);
|
||||
|
||||
if(!entries.exists){
|
||||
return undefined;
|
||||
|
||||
@@ -57,7 +57,7 @@ export class BeatModsApiService {
|
||||
if (Array.from(aliases.keys()).some(k => k === version.BSVersion)) {
|
||||
return version;
|
||||
}
|
||||
const alias = Array.from(aliases.entries()).find(([key, value]) => value.find(v => v.BSVersion === version.BSVersion))[0];
|
||||
const alias = Array.from(aliases.entries()).find(([key, value]) => value.find(v => v.BSVersion === version.BSVersion))?.[0];
|
||||
return { BSVersion: alias } as BSVersion;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
import regedit from "regedit";
|
||||
import path from "path";
|
||||
import { pathExist } from "../helpers/fs.helpers";
|
||||
import { pathExist, resolveGUIDPath } from "../helpers/fs.helpers";
|
||||
import log from "electron-log";
|
||||
import { lstat } from "fs-extra";
|
||||
import { tryit } from "../../shared/helpers/error.helpers";
|
||||
import { shell } from "electron";
|
||||
import { taskRunning } from "../helpers/os.helpers";
|
||||
import { sToMs } from "../../shared/helpers/time.helpers";
|
||||
import { execOnOs } from "../helpers/env.helpers";
|
||||
|
||||
const { list } = (execOnOs({ win32: () => require("regedit-rs") }, true) ?? {}) as typeof import("regedit-rs");
|
||||
|
||||
export class OculusService {
|
||||
private static instance: OculusService;
|
||||
@@ -29,26 +35,30 @@ export class OculusService {
|
||||
}
|
||||
|
||||
const oculusLibsRegKey = "HKCU\\SOFTWARE\\Oculus VR, LLC\\Oculus\\Libraries";
|
||||
const libsRegData = await list(oculusLibsRegKey).then(data => data[oculusLibsRegKey]);
|
||||
|
||||
const libsRegData = (await regedit.promisified.list([oculusLibsRegKey]))["HKCU\\SOFTWARE\\Oculus VR, LLC\\Oculus\\Libraries"];
|
||||
|
||||
if (!libsRegData.exists || !libsRegData.keys) {
|
||||
if (!libsRegData.keys?.length) {
|
||||
log.info("Registry key \"HKCU\\SOFTWARE\\Oculus VR, LLC\\Oculus\\Libraries\" not found");
|
||||
return null;
|
||||
}
|
||||
|
||||
const defaultLibraryId = libsRegData.values.DefaultLibrary.value as string;
|
||||
|
||||
const libsPath: OculusLibrary[] = (
|
||||
await Promise.all(
|
||||
libsRegData.keys.map(async key => {
|
||||
const originalPath = (await regedit.promisified.list([`${oculusLibsRegKey}\\${key}`]))[`${oculusLibsRegKey}\\${key}`];
|
||||
if (!originalPath.exists || !libsRegData.values || !originalPath.values.OriginalPath) {
|
||||
return null;
|
||||
}
|
||||
await Promise.all(libsRegData.keys.map(async key => {
|
||||
const originalPath = await list([`${oculusLibsRegKey}\\${key}`]).then(res => res[`${oculusLibsRegKey}\\${key}`]);
|
||||
|
||||
return { id: key, path: originalPath.values.OriginalPath.value, isDefault: defaultLibraryId === key } as OculusLibrary
|
||||
}, [])
|
||||
)
|
||||
if (originalPath.values?.OriginalPath) {
|
||||
return { id: key, path: originalPath.values.OriginalPath.value, isDefault: defaultLibraryId === key } as OculusLibrary;
|
||||
}
|
||||
|
||||
if(originalPath.values?.Path) {
|
||||
const { result } = tryit(() => resolveGUIDPath(originalPath.values.Path.value as string));
|
||||
return result ? { id: key, path: result, isDefault: defaultLibraryId === key } as OculusLibrary : null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}, []))
|
||||
).filter(Boolean);
|
||||
|
||||
this.oculusLibraries = libsPath;
|
||||
@@ -77,7 +87,7 @@ export class OculusService {
|
||||
|
||||
/**
|
||||
* Return the first game folder found in the list
|
||||
* @param {string[]} gameFolders
|
||||
* @param {string[]} gameFolders
|
||||
*/
|
||||
public async tryGetGameFolder(gameFolders: string[]): Promise<string> {
|
||||
for(const gameFolder of gameFolders){
|
||||
@@ -87,6 +97,29 @@ export class OculusService {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public oculusRunning(): Promise<boolean> {
|
||||
return taskRunning("OculusClient");
|
||||
}
|
||||
|
||||
public async startOculus(): Promise<void>{
|
||||
if(await this.oculusRunning()){ return; }
|
||||
|
||||
await shell.openPath("oculus://view/homepage");
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const interval = setInterval(async () => {
|
||||
if(!(await this.oculusRunning())){ return; }
|
||||
clearInterval(interval);
|
||||
resolve();
|
||||
}, sToMs(3));
|
||||
|
||||
setTimeout(() => {
|
||||
clearInterval(interval);
|
||||
reject(new Error("Unable to open Oculus"));
|
||||
}, sToMs(30));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export interface OculusLibrary {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { Agent, get } from "https";
|
||||
import { Agent, RequestOptions, get } from "https";
|
||||
import { createWriteStream, unlink } from "fs";
|
||||
import { Progression } from "main/helpers/fs.helpers";
|
||||
import { Observable, shareReplay, tap } from "rxjs";
|
||||
import log from "electron-log";
|
||||
import fetch, { RequestInfo, RequestInit } from "node-fetch";
|
||||
import { app } from "electron";
|
||||
import os from "os";
|
||||
|
||||
export class RequestService {
|
||||
private static instance: RequestService;
|
||||
@@ -15,16 +17,33 @@ export class RequestService {
|
||||
return RequestService.instance;
|
||||
}
|
||||
|
||||
private constructor() {}
|
||||
private readonly defaultRequestInit: RequestInit;
|
||||
|
||||
private get ipv4Agent(){
|
||||
return new Agent({ family: 4 });
|
||||
private constructor() {
|
||||
|
||||
this.defaultRequestInit = {
|
||||
headers: {
|
||||
"User-Agent": `BSManager/${app.getVersion()} (${os.type()} ${os.release()})`
|
||||
},
|
||||
agent: new Agent({ family: 4 }),
|
||||
};
|
||||
}
|
||||
|
||||
private getInitWithOptions(options?: RequestInit): RequestInit {
|
||||
return { ...this.defaultRequestInit, ...(options || {}) };
|
||||
}
|
||||
|
||||
private requestOptionsFromDefaultInit(): RequestOptions {
|
||||
return {
|
||||
headers: this.defaultRequestInit.headers as Record<string, string>,
|
||||
agent: this.defaultRequestInit.agent as Agent,
|
||||
};
|
||||
}
|
||||
|
||||
public async getJSON<T = unknown>(url: RequestInfo, options?: RequestInit): Promise<T> {
|
||||
|
||||
try {
|
||||
const response = await fetch(url, {...options, agent: this.ipv4Agent});
|
||||
const response = await fetch(url, this.getInitWithOptions(options));
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status} ${url}`);
|
||||
@@ -50,7 +69,7 @@ export class RequestService {
|
||||
});
|
||||
file.on("error", err => unlink(dest, () => subscriber.error(err)));
|
||||
|
||||
const req = get(url, { agent: this.ipv4Agent }, res => {
|
||||
const req = get(url, this.requestOptionsFromDefaultInit(), res => {
|
||||
progress.total = parseInt(res.headers?.["content-length"] || "0", 10);
|
||||
|
||||
res.on("data", chunk => {
|
||||
@@ -77,7 +96,7 @@ export class RequestService {
|
||||
|
||||
const allChunks: Buffer[] = [];
|
||||
|
||||
const req = get(url, { agent: this.ipv4Agent }, res => {
|
||||
const req = get(url, this.requestOptionsFromDefaultInit(), res => {
|
||||
progress.total = parseInt(res.headers?.["content-length"] || "0", 10);
|
||||
|
||||
res.on("data", chunk => {
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
import { UtilsService } from "./utils.service";
|
||||
import regedit from "regedit";
|
||||
import { RegDwordValue } from "regedit-rs"
|
||||
import path from "path";
|
||||
import { parse } from "@node-steam/vdf";
|
||||
import { readFile } from "fs/promises";
|
||||
import { pathExist } from "../helpers/fs.helpers";
|
||||
import log from "electron-log";
|
||||
import { app, shell } from "electron";
|
||||
import { taskRunning } from "../helpers/os.helpers";
|
||||
import { getProcessPid, taskRunning } from "../helpers/os.helpers";
|
||||
import { isElevated } from "query-process";
|
||||
import { execOnOs } from "../helpers/env.helpers";
|
||||
|
||||
const { list } = (execOnOs({ win32: () => require("regedit-rs") }, true) ?? {}) as typeof import("regedit-rs");
|
||||
|
||||
export class SteamService {
|
||||
|
||||
private static instance: SteamService;
|
||||
private static readonly PROCESS_NAME = "steam";
|
||||
|
||||
private readonly utils: UtilsService = UtilsService.getInstance();
|
||||
private static instance: SteamService;
|
||||
|
||||
private steamPath: string = '';
|
||||
|
||||
private constructor(){
|
||||
const vbsDirectory = path.join(this.utils.getAssetsScriptsPath(), "node-regedit", "vbs");
|
||||
regedit.setExternalVBSLocation(vbsDirectory);
|
||||
}
|
||||
private constructor(){}
|
||||
|
||||
public static getInstance(){
|
||||
if(!SteamService.instance){ SteamService.instance = new SteamService(); }
|
||||
@@ -27,17 +27,37 @@ export class SteamService {
|
||||
}
|
||||
|
||||
public async getActiveUser(): Promise<number>{
|
||||
const res = await regedit.promisified.list(["HKCU\\Software\\Valve\\Steam\\ActiveProcess"]);
|
||||
const keys = res?.["HKCU\\Software\\Valve\\Steam\\ActiveProcess"];
|
||||
if(!keys?.exists){ throw "Key \"HKCU\\Software\\Valve\\Steam\\ActiveProcess\" not exist"; }
|
||||
return (keys.values?.ActiveUser.value || undefined) as number;
|
||||
const res = await list("HKCU\\Software\\Valve\\Steam\\ActiveProcess");
|
||||
const key = res["HKCU\\Software\\Valve\\Steam\\ActiveProcess"];
|
||||
if(!key.exists){ throw new Error("Key \"HKCU\\Software\\Valve\\Steam\\ActiveProcess\" not exist"); }
|
||||
const registryValue = key.values.ActiveUser as RegDwordValue;
|
||||
if(!registryValue){ throw new Error("Value \"ActiveUser\" not exist"); }
|
||||
return registryValue.value;
|
||||
}
|
||||
|
||||
public async steamRunning(): Promise<boolean>{
|
||||
const steamProcessRunning = await taskRunning("steam");
|
||||
const steamProcessRunning = await taskRunning(SteamService.PROCESS_NAME);
|
||||
if(process.platform === "linux") { return steamProcessRunning; }
|
||||
const activeUser = await this.getActiveUser().catch(err => log.error(err));
|
||||
return steamProcessRunning && !!activeUser;
|
||||
}
|
||||
|
||||
return steamProcessRunning && !!(await this.getActiveUser());
|
||||
public async getSteamPid(): Promise<number>{
|
||||
return getProcessPid(SteamService.PROCESS_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the Steam process is running as administrator
|
||||
* @throws Can throw an error if the Steam process is running as admin
|
||||
* @returns true if the Steam process is running as administrator
|
||||
*/
|
||||
public async isElevated(): Promise<boolean>{
|
||||
if(process.platform === "linux"){ return true; }
|
||||
const steamPid = await this.getSteamPid();
|
||||
|
||||
if(!steamPid){ return false; }
|
||||
|
||||
return isElevated(steamPid);
|
||||
}
|
||||
|
||||
public async getSteamPath(): Promise<string>{
|
||||
@@ -48,24 +68,19 @@ export class SteamService {
|
||||
case "linux":
|
||||
this.steamPath = path.join(app.getPath('home'), '.steam', "steam");
|
||||
return this.steamPath;
|
||||
case "win32":
|
||||
// eslint-disable-next-line no-case-declarations
|
||||
const [win32Res, win64Res] = await Promise.all([
|
||||
regedit.promisified.list(['HKLM\\SOFTWARE\\Valve\\Steam']),
|
||||
regedit.promisified.list(['HKLM\\SOFTWARE\\WOW6432Node\\Valve\\Steam'])
|
||||
]);
|
||||
case "win32": {
|
||||
const res = await list(['HKLM\\SOFTWARE\\Valve\\Steam', 'HKLM\\SOFTWARE\\WOW6432Node\\Valve\\Steam']);
|
||||
const win64 = res['HKLM\\SOFTWARE\\Valve\\Steam'];
|
||||
const win32 = res['HKLM\\SOFTWARE\\WOW6432Node\\Valve\\Steam'];
|
||||
|
||||
// eslint-disable-next-line no-case-declarations
|
||||
const [win32, win64] = [win32Res["HKLM\\SOFTWARE\\Valve\\Steam"], win64Res["HKLM\\SOFTWARE\\WOW6432Node\\Valve\\Steam"]];
|
||||
|
||||
if(win64.exists && win64?.values?.InstallPath?.value){
|
||||
if (win64.exists && win64?.values?.InstallPath?.value) {
|
||||
this.steamPath = win64.values.InstallPath.value as string;
|
||||
}
|
||||
else if (win32.exists && win32?.values?.InstallPath?.value){
|
||||
this.steamPath = win32.values.InstallPath.value as string;
|
||||
} else if (win32.exists && win32?.values?.InstallPath?.value) {
|
||||
this.steamPath = win32.values.InstallPath.value as string;
|
||||
}
|
||||
|
||||
return this.steamPath;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -78,7 +93,7 @@ export class SteamService {
|
||||
let libraryFolders: any = path.join(steamPath, "steamapps", "libraryfolders.vdf");
|
||||
|
||||
if (!(await pathExist(libraryFolders))) { return null; }
|
||||
|
||||
|
||||
libraryFolders = parse(await readFile(libraryFolders, { encoding: "utf-8" }));
|
||||
|
||||
if (!libraryFolders.libraryfolders) { return null; }
|
||||
@@ -93,7 +108,7 @@ export class SteamService {
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
|
||||
} catch (e) {
|
||||
log.error(e);
|
||||
return null;
|
||||
@@ -101,7 +116,7 @@ export class SteamService {
|
||||
}
|
||||
|
||||
public async openSteam(): Promise<void> {
|
||||
|
||||
|
||||
await shell.openPath("steam://open/games");
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -37,7 +37,7 @@ export const AvailableVersionItem = memo(function AvailableVersionItem({version,
|
||||
<span className="text-sm text-gray-700 dark:text-gray-400">{formatedDate}</span>
|
||||
</div>
|
||||
{version.ReleaseURL && (
|
||||
<a href={version.ReleaseURL} target="_blank" className="flex flex-row justify-between items-center rounded-full bg-black bg-opacity-30 text-white pb-px overflow-hidden hover:bg-opacity-50">
|
||||
<a href={version.ReleaseURL} target="_blank" className="flex flex-row justify-between items-center rounded-full bg-black bg-opacity-30 text-white pb-px overflow-hidden hover:bg-opacity-50" tabIndex={-1}>
|
||||
<SteamIcon className="w-[25px] h-[25px] transition-transform group-hover:rotate-[-360deg] duration-300" />
|
||||
<span className="relative -left-px text-sm w-fit max-w-0 text-center overflow-hidden h-full whitespace-nowrap pb-[3px] transition-all group-hover:max-w-[200px] group-hover:px-1 duration-300">{t("pages.available-versions.steam-release")}</span>
|
||||
</a>
|
||||
|
||||
@@ -19,9 +19,18 @@ export function AvailableVersionsSlide({ versions }: Props) {
|
||||
context.setSelectedVersion(version);
|
||||
}
|
||||
|
||||
const getVersions = () => {
|
||||
const copy = [...(versions ?? [])];
|
||||
const recommendedVersion = copy.find(v => v.recommended);
|
||||
if(!recommendedVersion) { return copy; }
|
||||
copy.splice(copy.indexOf(recommendedVersion), 1);
|
||||
copy.unshift(recommendedVersion);
|
||||
return copy;
|
||||
}
|
||||
|
||||
return (
|
||||
<ol className="w-full flex items-start justify-center gap-6 shrink-0 content-start flex-wrap p-4 overflow-x-hidden overflow-y-scroll scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900">
|
||||
{versions.map(version => (
|
||||
<ol className="w-full flex items-start justify-center gap-6 shrink-0 content-start flex-wrap px-3.5 py-4 overflow-x-hidden overflow-y-scroll scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900">
|
||||
{getVersions().map(version => (
|
||||
<AvailableVersionItem key={version.BSManifest} version={version} selected={equal(version, context.selectedVersion)} onClick={() => setSelectedVersion(version)}/>
|
||||
))}
|
||||
</ol>
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
export function AvailableVersionsSlider() {
|
||||
const versionManagerService = useService(BSVersionManagerService);
|
||||
|
||||
const availableVersions = useObservable(versionManagerService.availableVersions$);
|
||||
const availableVersions = useObservable(() => versionManagerService.availableVersions$);
|
||||
const [yearIndex, setYearIndex] = useState(0);
|
||||
|
||||
const availableYears = (() => {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { MAP_SPECIFICITIES } from "renderer/partials/maps/map-general/map-specificity";
|
||||
import { MAP_REQUIREMENTS } from "renderer/partials/maps/map-requirements/map-requirements";
|
||||
import { MAP_DIFFICULTIES_COLORS } from "renderer/partials/maps/map-difficulties/map-difficulties-colors";
|
||||
import { MapExclude, MAP_EXCLUDES } from "renderer/partials/maps/map-excludes/map-excludes";
|
||||
import { BsmButton } from "../shared/bsm-button.component";
|
||||
import equal from "fast-deep-equal/es6";
|
||||
import clone from "rfdc";
|
||||
@@ -21,12 +22,13 @@ export type Props = {
|
||||
ref?: MutableRefObject<undefined>;
|
||||
playlist?: boolean;
|
||||
filter: MapFilter;
|
||||
localData?: boolean;
|
||||
onChange?: (filter: MapFilter) => void;
|
||||
onApply?: (filter: MapFilter) => void;
|
||||
onClose?: (filter: MapFilter) => void;
|
||||
};
|
||||
|
||||
export function FilterPanel({ className, ref, playlist = false, filter, onChange, onApply, onClose }: Props) {
|
||||
export function FilterPanel({ className, ref, playlist = false, filter, localData = true, onChange, onApply, onClose }: Props) {
|
||||
const t = useTranslation();
|
||||
|
||||
const [haveChanged, setHaveChanged] = useState(false);
|
||||
@@ -56,7 +58,7 @@ export function FilterPanel({ className, ref, playlist = false, filter, onChange
|
||||
const renderDurationLabel = (sec: number): JSX.Element => {
|
||||
const textValue = (() => {
|
||||
if (sec === MIN_DURATION) {
|
||||
return t("maps.map-filter-panel.duration");
|
||||
return MIN_DURATION;
|
||||
}
|
||||
if (sec === MAX_DURATION) {
|
||||
return "∞";
|
||||
@@ -72,7 +74,7 @@ export function FilterPanel({ className, ref, playlist = false, filter, onChange
|
||||
const renderNpsLabel = (nps: number): JSX.Element => {
|
||||
const textValue = (() => {
|
||||
if (nps === MIN_NPS) {
|
||||
return "NPS";
|
||||
return MIN_NPS;
|
||||
}
|
||||
if (nps === MAX_NPS) {
|
||||
return "∞";
|
||||
@@ -147,6 +149,10 @@ export function FilterPanel({ className, ref, playlist = false, filter, onChange
|
||||
return t(`maps.map-specificities.${specificity}`);
|
||||
};
|
||||
|
||||
const translateMapExclude = (exclude: MapExclude): string => {
|
||||
return t(`maps.map-excludes.${exclude}`);
|
||||
};
|
||||
|
||||
type BooleanKeys<T> = { [k in keyof T]: T[k] extends boolean ? k : never }[keyof T];
|
||||
|
||||
const handleCheckbox = (key: BooleanKeys<MapFilter>) => {
|
||||
@@ -167,9 +173,11 @@ export function FilterPanel({ className, ref, playlist = false, filter, onChange
|
||||
|
||||
return !playlist ? (
|
||||
<motion.div ref={ref} className={`${className} bg-light-main-color-2 dark:bg-main-color-3`} initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }}>
|
||||
<div className="w-full h-6 grid grid-cols-2 gap-x-12 px-4 mb-6 pt-2">
|
||||
<BsmRange min={MIN_NPS} max={MAX_NPS} values={npss} onChange={onNpssChange} renderLabel={renderNpsLabel} step={0.1} />
|
||||
<BsmRange min={MIN_DURATION} max={MAX_DURATION} values={durations} onChange={onDurationsChange} renderLabel={renderDurationLabel} step={5} />
|
||||
<div className="w-full h-6 grid grid-cols-2 gap-x-12 px-4 mb-6 pt-1">
|
||||
<BsmRange min={MIN_NPS} max={MAX_NPS} values={npss} onChange={onNpssChange} renderLabel={renderNpsLabel} step={0.1} />
|
||||
<BsmRange min={MIN_DURATION} max={MAX_DURATION} values={durations} onChange={onDurationsChange} renderLabel={renderDurationLabel} step={5} />
|
||||
<span className=" text-sm font-bold text-center mt-2.5">{t("maps.map-filter-panel.nps")}</span>
|
||||
<span className=" text-sm font-bold text-center mt-2.5">{t("maps.map-filter-panel.duration")}</span>
|
||||
</div>
|
||||
<div className="w-full h-full flex gap-x-2">
|
||||
<section className="shrink-0">
|
||||
@@ -180,7 +188,6 @@ export function FilterPanel({ className, ref, playlist = false, filter, onChange
|
||||
<span className="grow capitalize">{translateMapSpecificity(specificity)}</span>
|
||||
</div>
|
||||
))}
|
||||
|
||||
<h2 className="my-1 uppercase text-sm">{t("maps.map-filter-panel.requirements")}</h2>
|
||||
{MAP_REQUIREMENTS.map(requirement => (
|
||||
<div key={requirement} className="flex justify-start items-center h-[22px] z-20 relative py-0.5 cursor-pointer" onClick={() => handleCheckbox(requirement)}>
|
||||
@@ -188,6 +195,17 @@ export function FilterPanel({ className, ref, playlist = false, filter, onChange
|
||||
<span className="grow capitalize">{requirement}</span>
|
||||
</div>
|
||||
))}
|
||||
{ !localData && (
|
||||
<>
|
||||
<h2 className="my-1 uppercase text-sm">{t("maps.map-filter-panel.exclude")}</h2>
|
||||
{MAP_EXCLUDES.map(exclude => (
|
||||
<div key={exclude} className="flex justify-start items-center h-[22px] z-20 relative py-0.5 cursor-pointer" onClick={() => handleCheckbox(exclude)}>
|
||||
<BsmCheckbox className="h-full aspect-square relative bg-inherit mr-1" checked={filter?.[exclude]} onChange={() => handleCheckbox(exclude)} />
|
||||
<span className="grow capitalize">{translateMapExclude(exclude)}</span>
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
<section className="grow capitalize">
|
||||
<h2 className="uppercase text-sm mb-1">{t("maps.map-filter-panel.tags")}</h2>
|
||||
|
||||
@@ -1,48 +1,56 @@
|
||||
import { motion } from "framer-motion";
|
||||
import { forwardRef } from "react";
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import { BsmIcon } from "../svgs/bsm-icon.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { FolderLinkState } from "renderer/services/version-folder-linker.service";
|
||||
|
||||
type Props = {
|
||||
export type LinkBtnProps = {
|
||||
className?: string;
|
||||
title?: string;
|
||||
linked?: boolean;
|
||||
disabled?: boolean;
|
||||
onClick?: () => void;
|
||||
state: FolderLinkState;
|
||||
onClick?: () => unknown;
|
||||
};
|
||||
|
||||
export const LinkButton = motion(
|
||||
forwardRef((props: Props, ref) => {
|
||||
const t = useTranslation();
|
||||
const color = useThemeColor("first-color");
|
||||
export const LinkButton = ({className, title, state, onClick}: LinkBtnProps) => {
|
||||
const t = useTranslation();
|
||||
|
||||
const color = useThemeColor("first-color");
|
||||
const disabled = state === FolderLinkState.Processing || state === FolderLinkState.Pending;
|
||||
|
||||
const linkedColor = (() => {
|
||||
if (props.disabled) {
|
||||
return "orange";
|
||||
}
|
||||
if (props.linked) {
|
||||
const btnColor = () => {
|
||||
switch (state) {
|
||||
case FolderLinkState.Linked:
|
||||
return color;
|
||||
}
|
||||
return "red";
|
||||
})();
|
||||
case FolderLinkState.Pending:
|
||||
case FolderLinkState.Processing:
|
||||
return "orange";
|
||||
case FolderLinkState.Unlinked:
|
||||
return "red";
|
||||
default:
|
||||
return "red";
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={ref}
|
||||
className={props.className}
|
||||
title={props.title ? t(props.title) : undefined}
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
!props.disabled && props.onClick?.();
|
||||
}}
|
||||
style={{ pointerEvents: props.disabled ? "none" : "auto" }}
|
||||
tabIndex={-1}
|
||||
>
|
||||
<span className="absolute top-0 left-0 h-full w-full rounded-full brightness-50 opacity-75 dark:opacity-20 dark:filter-none" style={{ backgroundColor: linkedColor }} />
|
||||
<BsmIcon className="p-1 absolute top-0 left-0 h-full w-full !bg-transparent -rotate-45 brightness-150" icon={props.linked ? "link" : "unlink"} style={{ color: linkedColor }} />
|
||||
</div>
|
||||
);
|
||||
})
|
||||
);
|
||||
const handleClick = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
!disabled && onClick?.();
|
||||
}
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
variants={{ hover: { rotate: 22.5 }, tap: { rotate: 45 } }}
|
||||
whileHover="hover"
|
||||
whileTap="tap"
|
||||
initial={{ rotate: 0 }}
|
||||
className={className}
|
||||
title={title ? t(title) : null}
|
||||
onClick={handleClick}
|
||||
style={{ pointerEvents: disabled ? "none" : "auto" }}
|
||||
tabIndex={-1}
|
||||
>
|
||||
<span className="absolute top-0 left-0 h-full w-full rounded-full brightness-50 opacity-75 dark:opacity-20 dark:filter-none" style={{ backgroundColor: btnColor() }} />
|
||||
<BsmIcon className="p-1 absolute top-0 left-0 h-full w-full !bg-transparent -rotate-45 brightness-150" icon={state === FolderLinkState.Linked ? "link" : "unlink"} style={{ color: btnColor() }} />
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ export const LocalMapsListPanel = forwardRef(({ version, className, filter, sear
|
||||
|
||||
return (
|
||||
<div ref={ref} className={className}>
|
||||
<VariableSizeList className="p-0 scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900" width="100%" height={listHeight} itemSize={() => 108} itemCount={preppedMaps.length} itemData={preppedMaps} layout="vertical" style={{ scrollbarGutter: "stable both-edges" }} itemKey={(i, data) => data[i].map(map => map.hash).join()}>
|
||||
<VariableSizeList className="scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900" width="100%" height={listHeight} itemSize={() => 108} itemCount={preppedMaps.length} itemData={preppedMaps} layout="vertical" style={{ scrollbarGutter: "stable both-edges" }} itemKey={(i, data) => data[i].map(map => map.hash).join()}>
|
||||
{props => <MapsRow maps={props.data[props.index]} style={props.style} selectedMaps$={selectedMaps$} onMapSelect={onMapSelected} onMapDelete={handleDelete} />}
|
||||
</VariableSizeList>
|
||||
</div>
|
||||
|
||||
@@ -21,6 +21,7 @@ import useDoubleClick from "use-double-click";
|
||||
import { GlowEffect } from "../shared/glow-effect.component";
|
||||
import { useDelayedState } from "renderer/hooks/use-delayed-state.hook";
|
||||
import { useService } from "renderer/hooks/use-service.hook";
|
||||
import Tippy from "@tippyjs/react";
|
||||
|
||||
export type ParsedMapDiff = { type: BsvMapDifficultyType; name: string; stars: number };
|
||||
|
||||
@@ -51,7 +52,6 @@ export type MapItemProps<T = unknown> = {
|
||||
};
|
||||
|
||||
export const MapItem = memo(({ hash, title, autor, songAutor, coverUrl, songUrl, autorId, mapId, diffs, ranked, bpm, duration, likes, createdAt, selected, downloading, showOwned, callBackParam, onDelete, onDownload, onSelected, onCancelDownload, onDoubleClick }: MapItemProps) => {
|
||||
|
||||
const linkOpener = useService(LinkOpenerService);
|
||||
const audioPlayer = useService(AudioPlayerService);
|
||||
|
||||
@@ -70,7 +70,7 @@ export const MapItem = memo(({ hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
onDoubleClick: () => onDoubleClick?.(callBackParam),
|
||||
});
|
||||
|
||||
const songPlaying = useObservable(audioPlayer.playing$.pipe(map(playing => playing && audioPlayer.src === songUrl)));
|
||||
const songPlaying = useObservable(() => audioPlayer.playing$.pipe(map(playing => playing && audioPlayer.src === songUrl)));
|
||||
|
||||
const previewUrl = mapId ? `https://allpoland.github.io/ArcViewer/?id=${mapId}` : null;
|
||||
const mapUrl = mapId ? `https://beatsaver.com/maps/${mapId}` : null;
|
||||
@@ -156,25 +156,25 @@ export const MapItem = memo(({ hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
return (
|
||||
<motion.li className="relative h-[100px] w-[400px] min-w-[370px] shrink-0 grow basis-0 text-white group cursor-pointer" onHoverStart={() => setHovered(true)} onHoverEnd={() => setHovered(false)} style={{ zIndex: hovered && 5, transform: "translateZ(0) scale(1.0, 1.0)", backfaceVisibility: "hidden" }}>
|
||||
<GlowEffect visible={hovered || (selected && !!onSelected)} />
|
||||
<AnimatePresence>
|
||||
{(diffsPanelHovered || bottomBarHovered) && (
|
||||
<motion.ul key={hash} className="absolute top-[calc(100%-10px)] w-full h-fit max-h-[200%] pt-4 pb-2 px-2 overflow-y-scroll bg-light-main-color-3 dark:bg-main-color-3 text-main-color-1 dark:text-current brightness-125 rounded-md flex flex-col gap-3 scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 shadow-sm shadow-black" initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} transition={{ duration: 0.15 }} onHoverStart={diffsPanelHoverStart} onHoverEnd={diffsPanelHoverEnd}>
|
||||
{Array.from(diffs.entries()).map(([charac, diffSet]) => (
|
||||
<ol key={crypto.randomUUID()} className="flex flex-col w-full gap-1">
|
||||
{diffSet.map(({ type, name, stars }) => (
|
||||
<li key={`${type}${name}${stars}`} className="w-full h-4 flex items-center gap-1">
|
||||
<BsmIcon className="h-full w-fit p-px" icon={charac} />
|
||||
<span className="h-full px-2 flex items-center text-xs font-bold bg-current rounded-full" style={{ color: MAP_DIFFICULTIES_COLORS[type] }}>
|
||||
{stars ? <span className="h-full block brightness-[.25]">★ {stars}</span> : <span className="h-full brightness-[.25] leading-4 pb-[2px] capitalize">{parseDiffLabel(type)}</span>}
|
||||
</span>
|
||||
<span className="text-sm leading-4 pb-[2px] capitalize">{parseDiffLabel(name)}</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
))}
|
||||
</motion.ul>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
<AnimatePresence>
|
||||
{(diffsPanelHovered || bottomBarHovered) && (
|
||||
<motion.ul key={hash} className="absolute top-[calc(100%-10px)] w-full h-fit max-h-[200%] pt-4 pb-2 px-2 overflow-y-scroll bg-light-main-color-3 dark:bg-main-color-3 text-main-color-1 dark:text-current brightness-125 rounded-md flex flex-col gap-3 scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 shadow-sm shadow-black" initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} transition={{ duration: 0.15 }} onHoverStart={diffsPanelHoverStart} onHoverEnd={diffsPanelHoverEnd}>
|
||||
{Array.from(diffs.entries()).map(([charac, diffSet]) => (
|
||||
<ol key={crypto.randomUUID()} className="flex flex-col w-full gap-1">
|
||||
{diffSet.map(({ type, name, stars }) => (
|
||||
<li key={`${type}${name}${stars}`} className="w-full h-4 flex items-center gap-1">
|
||||
<BsmIcon className="h-full w-fit p-px" icon={charac} />
|
||||
<span className="h-full px-2 flex items-center text-xs font-bold bg-current rounded-full" style={{ color: MAP_DIFFICULTIES_COLORS[type] }}>
|
||||
{stars ? <span className="h-full block brightness-[.25]">★ {stars}</span> : <span className="h-full brightness-[.25] leading-4 pb-[2px] capitalize">{parseDiffLabel(type)}</span>}
|
||||
</span>
|
||||
<span className="text-sm leading-4 pb-[2px] capitalize">{parseDiffLabel(name)}</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
))}
|
||||
</motion.ul>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
<div className="h-full w-full relative pl-[100px] rounded-md overflow-hidden flex flex-row justify-end">
|
||||
<div className={`absolute top-0 left-0 h-full aspect-square cursor-pointer ${showOwned && "border-l-[5px]"}`} style={{ borderColor: showOwned && color }}>
|
||||
<BsmImage className="w-full h-full object-cover" image={coverUrl} placeholder={defaultImage} errorImage={defaultImage} loading="lazy" />
|
||||
@@ -191,8 +191,8 @@ export const MapItem = memo(({ hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
</span>
|
||||
</div>
|
||||
<div className="relative h-full w-full z-[1] rounded-md overflow-hidden -translate-x-1" ref={ref}>
|
||||
<BsmImage className="absolute top-0 left-0 w-full h-full -z-[1] object-cover" image={coverUrl} placeholder={defaultImage} errorImage={defaultImage} loading="lazy" />
|
||||
<div className="pt-1 pl-2 pr-7 top-0 left-0 w-full h-full bg-gray-600 bg-opacity-80 flex flex-col justify-between group-hover:bg-main-color-1 group-hover:bg-opacity-80">
|
||||
<BsmImage className="absolute top-0 left-0 w-full h-full -z-[1] object-cover saturate-200" image={coverUrl} placeholder={defaultImage} errorImage={defaultImage} loading="lazy" />
|
||||
<div className="pt-1 pl-2 pr-7 top-0 left-0 w-full h-full bg-neutral-600 bg-opacity-80 flex flex-col justify-between group-hover:bg-main-color-1 group-hover:bg-opacity-80">
|
||||
<h1 className="font-bold whitespace-nowrap text-ellipsis overflow-hidden w-full leading-5 tracking-wide text-lg" title={title}>
|
||||
<BsmLink className="hover:underline" href={mapUrl}>
|
||||
{title}
|
||||
@@ -240,52 +240,72 @@ export const MapItem = memo(({ hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
</motion.div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="absolute bg-light-main-color-1 dark:bg-main-color-3 top-0 h-full z-[1] w-[30px] -right-5 group-hover:right-0 transition-all">
|
||||
<div className="absolute bg-light-main-color-3 dark:bg-main-color-3 top-0 h-full z-[1] w-[30px] -right-5 group-hover:right-0 transition-all">
|
||||
<span className="absolute w-[10px] h-[10px] top-0 right-full bg-inherit" style={{ clipPath: 'path("M11 -1 L11 10 L10 10 A10 10 0 0 0 0 0 L0 -1 Z")' }} />
|
||||
<span className="absolute w-[10px] h-[10px] bottom-0 right-full bg-inherit" style={{ clipPath: 'path("M11 11 L11 0 L10 0 A10 10 0 0 1 0 10 L 0 11 Z")' }} />
|
||||
|
||||
<div className="flex flex-col justify-center items-center gap-1 w-full h-full overflow-hidden opacity-0 group-hover:opacity-100">
|
||||
{onDelete && !downloading && (
|
||||
<BsmButton
|
||||
className="w-6 h-6 p-[2px] rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2"
|
||||
iconClassName="w-full h-full brightness-75 dark:brightness-200"
|
||||
iconColor={color}
|
||||
icon="trash"
|
||||
withBar={false}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
onDelete(callBackParam);
|
||||
}}
|
||||
/>
|
||||
<Tippy content={t("maps.map-item.delete")} placement="left" theme="default">
|
||||
<div>
|
||||
<BsmButton
|
||||
className="w-6 h-6 p-[2px] rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2"
|
||||
iconClassName="w-full h-full brightness-75 dark:brightness-200"
|
||||
iconColor={color}
|
||||
icon="trash"
|
||||
withBar={false}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
onDelete(callBackParam);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Tippy>
|
||||
)}
|
||||
{onDownload && !downloading && (
|
||||
<BsmButton
|
||||
className="w-6 h-6 p-[2px] rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2"
|
||||
iconClassName="w-full h-full brightness-75 dark:brightness-200"
|
||||
iconColor={color}
|
||||
icon="download"
|
||||
withBar={false}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
onDownload(callBackParam);
|
||||
}}
|
||||
/>
|
||||
<Tippy content={t("maps.map-item.download")} placement="left" theme="default">
|
||||
<div>
|
||||
<BsmButton
|
||||
className="w-6 h-6 p-[2px] rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2"
|
||||
iconClassName="w-full h-full brightness-75 dark:brightness-200"
|
||||
iconColor={color}
|
||||
icon="download"
|
||||
withBar={false}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
onDownload(callBackParam);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Tippy>
|
||||
)}
|
||||
{onCancelDownload && !downloading && (
|
||||
<BsmButton
|
||||
className="w-6 h-6 p-1 rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2"
|
||||
iconClassName="w-full h-full brightness-75 dark:brightness-200"
|
||||
iconColor="red"
|
||||
icon="cross"
|
||||
withBar={false}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
onCancelDownload(callBackParam);
|
||||
}}
|
||||
/>
|
||||
<Tippy content={t("maps.map-item.cancel-download")} placement="left" theme="default">
|
||||
<div>
|
||||
<BsmButton
|
||||
className="w-6 h-6 p-1 rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2"
|
||||
iconClassName="w-full h-full brightness-75 dark:brightness-200"
|
||||
iconColor="red"
|
||||
icon="cross"
|
||||
withBar={false}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
onCancelDownload(callBackParam);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Tippy>
|
||||
)}
|
||||
{downloading && <BsmBasicSpinner className="w-6 h-6 p-1 rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2 flex items-center justify-center" spinnerClassName="brightness-75 dark:brightness-200" style={{ color }} thikness="3px" />}
|
||||
{downloading &&
|
||||
<Tippy content={t("maps.map-item.downloading")} placement="left" theme="default">
|
||||
<div>
|
||||
<BsmBasicSpinner className="w-6 h-6 p-1 rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2 flex items-center justify-center" spinnerClassName="brightness-75 dark:brightness-200" style={{ color }} thikness="3px" />
|
||||
</div>
|
||||
</Tippy>
|
||||
}
|
||||
{previewUrl && (
|
||||
<Tippy content={t("maps.map-item.preview")} placement="left" theme="default">
|
||||
<div>
|
||||
<BsmButton
|
||||
className="w-6 h-6 p-[2px] rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2"
|
||||
iconClassName="w-full h-full brightness-75 dark:brightness-200"
|
||||
@@ -297,8 +317,12 @@ export const MapItem = memo(({ hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
openPreview();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Tippy>
|
||||
)}
|
||||
{mapId && (
|
||||
<Tippy content={t("maps.map-item.bsr-code")} placement="left" theme="default">
|
||||
<div>
|
||||
<BsmButton
|
||||
className="w-6 h-6 p-1 rounded-md !bg-inherit hover:!bg-light-main-color-2 hover:dark:!bg-main-color-2"
|
||||
iconClassName="w-full h-full brightness-75 dark:brightness-200"
|
||||
@@ -310,6 +334,8 @@ export const MapItem = memo(({ hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
copyBsr();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Tippy>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,24 +1,22 @@
|
||||
import { DetailedHTMLProps, useEffect, useRef, useState } from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { TabNavBar } from "../shared/tab-nav-bar.component";
|
||||
import { LocalMapsListPanel } from "./local-maps-list-panel.component";
|
||||
import { BsmDropdownButton, DropDownItem } from "../shared/bsm-dropdown-button.component";
|
||||
import { FilterPanel } from "./filter-panel.component";
|
||||
import { MapFilter } from "shared/models/maps/beat-saver.model";
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import { MapsManagerService } from "renderer/services/maps-manager.service";
|
||||
import { motion, Variants } from "framer-motion";
|
||||
import { MapsDownloaderService } from "renderer/services/maps-downloader.service";
|
||||
import { BsmImage } from "../shared/bsm-image.component";
|
||||
import wipGif from "../../../../assets/images/gifs/wip.gif";
|
||||
import { OsDiagnosticService } from "renderer/services/os-diagnostic.service";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { BsmIcon } from "../svgs/bsm-icon.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { LinkButton } from "./link-button.component";
|
||||
import { debounceTime } from "rxjs/operators";
|
||||
import { VersionFolderLinkerService, VersionLinkerActionListener } from "renderer/services/version-folder-linker.service";
|
||||
import { FolderLinkState, VersionFolderLinkerService, VersionLinkerActionListener } from "renderer/services/version-folder-linker.service";
|
||||
import { useService } from "renderer/hooks/use-service.hook";
|
||||
import { BsContentTabPanel } from "../shared/bs-content-tab-panel/bs-content-tab-panel.component";
|
||||
import { BsmButton } from "../shared/bsm-button.component";
|
||||
import { MapIcon } from "../svgs/icons/map-icon.component";
|
||||
import { PlaylistIcon } from "../svgs/icons/playlist-icon.component";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { of } from "rxjs";
|
||||
|
||||
type Props = {
|
||||
version?: BSVersion;
|
||||
@@ -29,7 +27,6 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
|
||||
const mapsService = useService(MapsManagerService);
|
||||
const mapsDownloader = useService(MapsDownloaderService);
|
||||
const osDiagnostic = useService(OsDiagnosticService);
|
||||
const linker = useService(VersionFolderLinkerService);
|
||||
|
||||
const [tabIndex, setTabIndex] = useState(0);
|
||||
@@ -37,9 +34,7 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
const [mapSearch, setMapSearch] = useState("");
|
||||
const [playlistSearch, setPlaylistSearch] = useState("");
|
||||
const [mapsLinked, setMapsLinked] = useState(false);
|
||||
const [linkingPending, setLinkingPending] = useState(false);
|
||||
const isOnline = useObservable(osDiagnostic.isOnline$);
|
||||
const color = useThemeColor("first-color");
|
||||
const mapsLinkedState = useObservable(() => version ? mapsService.$mapsFolderLinkState(version) : of(null), FolderLinkState.Unlinked, [version]);
|
||||
const t = useTranslation();
|
||||
const mapsRef = useRef<any>();
|
||||
|
||||
@@ -50,8 +45,6 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
|
||||
loadMapIsLinked();
|
||||
|
||||
const sub = mapsService.$mapsLinkingPending(version).pipe(debounceTime(50)).subscribe(setLinkingPending);
|
||||
|
||||
const onMapsLinked: VersionLinkerActionListener = action => {
|
||||
if (!action.relativeFolder.includes(MapsManagerService.RELATIVE_MAPS_FOLDER)) {
|
||||
return;
|
||||
@@ -63,7 +56,6 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
linker.onVersionFolderUnlinked(onMapsLinked);
|
||||
|
||||
return () => {
|
||||
sub.unsubscribe();
|
||||
linker.removeVersionFolderLinkedListener(onMapsLinked);
|
||||
linker.removeVersionFolderUnlinkedListener(onMapsLinked);
|
||||
};
|
||||
@@ -80,6 +72,10 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
return setPlaylistSearch(() => value);
|
||||
};
|
||||
|
||||
const handleMapsAddClick = () => {
|
||||
mapsDownloader.openDownloadMapModal(version, mapsRef.current.getMaps?.());
|
||||
};
|
||||
|
||||
const handleMapsLinkClick = () => {
|
||||
if (!mapsLinked) {
|
||||
return mapsService.linkVersion(version);
|
||||
@@ -87,56 +83,6 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
return mapsService.unlinkVersion(version);
|
||||
};
|
||||
|
||||
const handleMapsAddClick = () => {
|
||||
mapsDownloader.openDownloadMapModal(version, mapsRef.current.getMaps?.());
|
||||
};
|
||||
|
||||
const renderTab = (props: DetailedHTMLProps<React.HTMLAttributes<HTMLLIElement>, HTMLLIElement>, text: string, index: number): JSX.Element => {
|
||||
const onClickLink = (index: number) => {
|
||||
if (index === 0) {
|
||||
handleMapsLinkClick();
|
||||
}
|
||||
};
|
||||
|
||||
const onClickAdd = (index: number) => {
|
||||
if (index === 0) {
|
||||
handleMapsAddClick();
|
||||
}
|
||||
};
|
||||
|
||||
const variants: Variants = { hover: { rotate: 22.5 }, tap: { rotate: 45 } };
|
||||
|
||||
return (
|
||||
<li className="relative text-center text-lg font-bold hover:backdrop-brightness-75 flex justify-center items-center content-center" onClick={props.onClick}>
|
||||
<span className="text-main-color-1 dark:text-gray-200">{text}</span>
|
||||
{index === 0 && (
|
||||
<div className="h-full flex absolute right-0 top-0 gap-1.5 items-center pr-2">
|
||||
{isOnline && (
|
||||
<motion.div
|
||||
whileHover="hover"
|
||||
whileTap="tap"
|
||||
className="relative h-[calc(100%-5px)] flex flex-row justify-center items-center shrink-0 rounded-full overflow-hidden pr-2"
|
||||
style={{ color }}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
onClickAdd(index);
|
||||
}}
|
||||
tabIndex={-1}
|
||||
>
|
||||
<span className="absolute top-0 left-0 h-full w-full brightness-50 opacity-75 dark:opacity-20 dark:filter-none" style={{ backgroundColor: "currentcolor" }} />
|
||||
<motion.div className="h-full p-0.5" variants={variants}>
|
||||
<BsmIcon className="block h-full aspect-square brightness-150" icon="add" />
|
||||
</motion.div>
|
||||
<span className="text-sm brightness-150">{t("misc.add")}</span>
|
||||
</motion.div>
|
||||
)}
|
||||
{!!version && <LinkButton variants={variants} disabled={linkingPending} whileHover="hover" whileTap="tap" initial={{ rotate: 0 }} className="block p-0.5 h-[calc(100%-5px)] aspect-square blur-0 hover:brightness-75" linked={mapsLinked} title={mapsLinked ? "pages.version-viewer.maps.tabs.maps.actions.link-maps.tooltips.unlink" : "pages.version-viewer.maps.tabs.maps.actions.link-maps.tooltips.link"} onClick={() => onClickLink(index)} />}
|
||||
</div>
|
||||
)}
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
const dropDownItems = ((): DropDownItem[] => {
|
||||
if (tabIndex === 1) {
|
||||
return [];
|
||||
@@ -150,6 +96,15 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
return (
|
||||
<div className="w-full h-full flex flex-col items-center justify-center gap-4">
|
||||
<nav className="w-full shrink-0 flex h-9 justify-center px-40 gap-2 text-main-color-1 dark:text-white">
|
||||
<BsmButton
|
||||
className="flex items-center justify-center w-fit rounded-full px-2 py-1 font-bold"
|
||||
icon="add"
|
||||
text="misc.add"
|
||||
typeColor="primary"
|
||||
withBar={false}
|
||||
disabled={tabIndex === 1}
|
||||
onClick={handleMapsAddClick}
|
||||
/>
|
||||
<div className="h-full rounded-full bg-light-main-color-2 dark:bg-main-color-2 grow p-[6px]">
|
||||
<input type="text" className="h-full w-full bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-2" placeholder={t("pages.version-viewer.maps.search-bar.search-placeholder")} value={tabIndex === 0 ? mapSearch : playlistSearch} onChange={e => handleSearch(e.target.value)} tabIndex={-1} />
|
||||
</div>
|
||||
@@ -158,16 +113,34 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
|
||||
</BsmDropdownButton>
|
||||
<BsmDropdownButton className="h-full flex aspect-square relative rounded-full z-[1] bg-light-main-color-1 dark:bg-main-color-3" buttonClassName="rounded-full h-full w-full p-[6px]" icon="three-dots" withBar={false} items={dropDownItems} menuTranslationY="6px" align="center" />
|
||||
</nav>
|
||||
<div className="w-full h-full flex flex-col bg-light-main-color-3 dark:bg-main-color-2 rounded-md shadow-black shadow-md overflow-hidden">
|
||||
<TabNavBar className="!rounded-none shadow-sm" tabIndex={tabIndex} tabsText={["misc.maps", "misc.playlists"]} onTabChange={setTabIndex} renderTab={renderTab} />
|
||||
<div className="w-full grow min-h-0 flex flex-row items-center transition-transform duration-300" style={{ transform: `translate(${-(tabIndex * 100)}%, 0)` }}>
|
||||
<BsContentTabPanel
|
||||
tabIndex={tabIndex}
|
||||
onTabChange={index => setTabIndex(index)}
|
||||
tabs={[
|
||||
{
|
||||
text: "misc.maps",
|
||||
icon: MapIcon,
|
||||
onClick: () => setTabIndex(0),
|
||||
linkProps: version ? {
|
||||
state: mapsLinkedState,
|
||||
onClick: handleMapsLinkClick,
|
||||
} : null,
|
||||
},
|
||||
{
|
||||
text: "misc.playlists",
|
||||
icon: PlaylistIcon,
|
||||
onClick: () => setTabIndex(1),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<>
|
||||
<LocalMapsListPanel isActive={isActive && tabIndex === 0} ref={mapsRef} className="w-full h-full shrink-0 flex flex-col" version={version} filter={mapFilter} search={mapSearch} linked={mapsLinked} />
|
||||
<div className="w-full h-full shrink-0 flex flex-col justify-center items-center content-center gap-2 overflow-hidden text-gray-800 dark:text-gray-200">
|
||||
<BsmImage className="rounded-md" image={wipGif} />
|
||||
<span>Coming soon</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</BsContentTabPanel>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -16,13 +16,10 @@ type Props = {
|
||||
};
|
||||
|
||||
export const MapsRow = memo(({ maps, style, selectedMaps$, onMapSelect, onMapDelete }: Props) => {
|
||||
const selectedMaps = useObservable<BsmLocalMap[]>(
|
||||
selectedMaps$.pipe(
|
||||
const selectedMaps = useObservable<BsmLocalMap[]>(() => selectedMaps$.pipe(
|
||||
map(selectedMaps => selectedMaps.filter(selected => maps.some(map => map.hash === selected.hash))),
|
||||
distinctUntilChanged(equal)
|
||||
),
|
||||
[]
|
||||
);
|
||||
distinctUntilChanged(equal),
|
||||
), []);
|
||||
|
||||
const extractMapDiffs = (map: BsmLocalMap): Map<BsvMapCharacteristic, ParsedMapDiff[]> => {
|
||||
const res = new Map<BsvMapCharacteristic, ParsedMapDiff[]>();
|
||||
@@ -48,11 +45,30 @@ export const MapsRow = memo(({ maps, style, selectedMaps$, onMapSelect, onMapDel
|
||||
};
|
||||
|
||||
const renderMapItem = (map: BsmLocalMap) => {
|
||||
return <MapItem key={map.hash} hash={map.hash} title={map.rawInfo._songName} coverUrl={map.coverUrl} songUrl={map.songUrl} autor={map.rawInfo._levelAuthorName} songAutor={map.rawInfo._songAuthorName} bpm={map.rawInfo._beatsPerMinute} duration={map.bsaverInfo?.metadata?.duration} selected={selectedMaps.some(selected => selected.hash === map.hash)} diffs={extractMapDiffs(map)} mapId={map.bsaverInfo?.id} ranked={map.bsaverInfo?.ranked} autorId={map.bsaverInfo?.uploader?.id} likes={map.bsaverInfo?.stats?.upvotes} createdAt={map.bsaverInfo?.createdAt} onDelete={onMapDelete} onSelected={onMapSelect} callBackParam={map} />;
|
||||
return <MapItem
|
||||
key={map.hash}
|
||||
hash={map.hash}
|
||||
title={map.rawInfo._songName}
|
||||
coverUrl={map.coverUrl}
|
||||
songUrl={map.songUrl}
|
||||
autor={map.rawInfo._levelAuthorName}
|
||||
songAutor={map.rawInfo._songAuthorName}
|
||||
bpm={map.rawInfo._beatsPerMinute}
|
||||
duration={map.bsaverInfo?.metadata?.duration}
|
||||
selected={selectedMaps.some(selected => selected.hash === map.hash)}
|
||||
diffs={extractMapDiffs(map)} mapId={map.bsaverInfo?.id}
|
||||
ranked={map.bsaverInfo?.ranked}
|
||||
autorId={map.bsaverInfo?.uploader?.id}
|
||||
likes={map.bsaverInfo?.stats?.upvotes}
|
||||
createdAt={map.bsaverInfo?.createdAt}
|
||||
onDelete={onMapDelete}
|
||||
onSelected={onMapSelect}
|
||||
callBackParam={map}
|
||||
/>;
|
||||
};
|
||||
|
||||
return (
|
||||
<ul className="h-fit w-full flex flex-nowrap basis-0 gap-x-[8px] py-1 px-3" style={style}>
|
||||
<ul className="h-fit w-full flex flex-nowrap basis-0 gap-x-2 p-2" style={style}>
|
||||
{maps?.map(renderMapItem)}
|
||||
</ul>
|
||||
);
|
||||
|
||||
@@ -5,16 +5,25 @@ import BeatWaiting from "../../../../../../assets/images/apngs/beat-impatient.pn
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { useState } from "react";
|
||||
import { isOculusTokenValid } from "shared/helpers/oculus.helpers";
|
||||
import crypto from "crypto-js";
|
||||
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component";
|
||||
import Tippy from "@tippyjs/react";
|
||||
import { tryit } from "shared/helpers/error.helpers";
|
||||
import { logRenderError } from "renderer";
|
||||
import { useService } from "renderer/hooks/use-service.hook";
|
||||
import { ConfigurationService } from "renderer/services/configuration.service";
|
||||
|
||||
const OCULUS_TOKEN_STORAGE_KEY = "meta-token";
|
||||
|
||||
export const EnterMetaTokenModal: ModalComponent<string> = ({resolver}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const [token, setToken] = useState("");
|
||||
const [showToken, setShowToken] = useState(false);
|
||||
const config = useService(ConfigurationService);
|
||||
|
||||
const submit = () => {
|
||||
const [passwordView, setPasswordView] = useState(() => !!config.get(OCULUS_TOKEN_STORAGE_KEY));
|
||||
|
||||
const submit = (token: string) => {
|
||||
resolver({exitCode: ModalExitCode.COMPLETED, data: token});
|
||||
}
|
||||
|
||||
@@ -22,38 +31,181 @@ export const EnterMetaTokenModal: ModalComponent<string> = ({resolver}) => {
|
||||
resolver({exitCode: ModalExitCode.CANCELED});
|
||||
}
|
||||
|
||||
const isTokenValid = (() => {
|
||||
return isOculusTokenValid(token, logRenderError);
|
||||
})();
|
||||
|
||||
return (
|
||||
<form className="flex flex-col w-80 gap-4">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{t("modals.enter-meta-token.title")}</h1>
|
||||
|
||||
<BsmImage className="h-20 w-20 mx-auto" image={BeatWaiting}/>
|
||||
{passwordView ? (
|
||||
<EnterPasswordView onValid={submit} onCancel={cancel} dontHaveToken={() => setPasswordView(() => false)}/>
|
||||
) : (
|
||||
<EnterOculusTokenView onValid={submit} onCancel={cancel} alreadyHaveToken={() => setPasswordView(() => true)}/>
|
||||
)}
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
<p>{t("modals.enter-meta-token.body.need-token")}</p>
|
||||
const EnterPasswordView = ({onValid, onCancel, dontHaveToken}: {onValid: (token: string) => void, onCancel: () => void, dontHaveToken: () => void}) => {
|
||||
|
||||
<a href="https://github.com/Zagrios/bs-manager/wiki/How-to-obtain-your-Oculus-Token" target="_blank" className="underline">{t("modals.enter-meta-token.body.how-obtain-token")}</a>
|
||||
|
||||
<div>
|
||||
<div className="flex flex-row items-center justify-between">
|
||||
<label className="font-bold cursor-pointer tracking-wide inline-block" htmlFor="meta_token">{t("modals.enter-meta-token.body.input-label")}</label>
|
||||
{!isTokenValid && token.length > 0 && (
|
||||
<span className="text-orange-700 dark:text-orange-400 text-xs whitespace-normal min-w-0">{t("modals.enter-meta-token.body.token-is-invalid")}</span>
|
||||
)}
|
||||
const t = useTranslation();
|
||||
|
||||
const config = useService(ConfigurationService);
|
||||
|
||||
const [password, setPassword] = useState("");
|
||||
|
||||
const getTokenFromStorage = () => {
|
||||
const cryptedToken = config.get<string>(OCULUS_TOKEN_STORAGE_KEY);
|
||||
if(!cryptedToken) return null;
|
||||
const { result: token, error } = tryit(() => crypto.AES.decrypt(cryptedToken, password).toString(crypto.enc.Utf8));
|
||||
|
||||
if(error){
|
||||
logRenderError(error, "Often indicate that the password is not the same as the one used to save the token. This error can occur when the use is writing the password.");
|
||||
}
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
const isTokenValid = () => {
|
||||
const token = getTokenFromStorage();
|
||||
return isOculusTokenValid(token);
|
||||
}
|
||||
|
||||
const valid = () => {
|
||||
const token = getTokenFromStorage();
|
||||
onValid(token);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<p>{t("modals.enter-meta-token.body.info-enter-password")}</p>
|
||||
|
||||
<div className="flex flex-col gap-2">
|
||||
<div>
|
||||
<PasswordInput onChange={v => setPassword(v.password)} value={password}/>
|
||||
</div>
|
||||
<div className="bg-light-main-color-1 dark:bg-main-color-1 rounded-md flex box-border h-9">
|
||||
<input className="grow px-1 py-[2px] outline-none bg-transparent" onChange={e => setToken(e.target.value)} value={token} type={showToken ? "text" : "password"} name="meta_token" id="meta_token" placeholder="OCAStr43sdx2..." />
|
||||
<BsmButton className="shrink-0 m-1 rounded-md p-0.5 !bg-light-main-color-3 dark:!bg-main-color-3" icon={showToken ? "eye-cross" : "eye"} withBar={false} onClick={() => setShowToken(prev => !prev)} />
|
||||
|
||||
<div>
|
||||
<span className="underline italic text-sm float-right cursor-pointer" onClick={dontHaveToken}>{t("modals.enter-meta-token.body.enter-oculus-token")}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-row gap-2">
|
||||
<BsmButton className="rounded-md flex justify-center items-center transition-all h-9 w-full" typeColor="cancel" text="misc.cancel" withBar={false} onClick={cancel}/>
|
||||
<BsmButton className="rounded-md flex justify-center items-center transition-all h-9 w-full" typeColor="primary" text="modals.enter-meta-token.valid-btn" withBar={false} onClick={submit} disabled={!isTokenValid}/>
|
||||
<BsmButton className="rounded-md flex justify-center items-center transition-all h-9 w-full" typeColor="cancel" text="misc.cancel" withBar={false} onClick={onCancel}/>
|
||||
<Tippy className="!bg-neutral-900" disabled={!password || isTokenValid()} arrow={false} content={t("modals.enter-meta-token.body.info-disabled-btn-password")} hideOnClick={false}>
|
||||
<div className="w-full">
|
||||
<BsmButton className="rounded-md flex justify-center items-center transition-all h-9 w-full" typeColor="primary" text="modals.enter-meta-token.valid-btn" withBar={false} onClick={valid} disabled={!isTokenValid()}/>
|
||||
</div>
|
||||
</Tippy>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</>
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
const EnterOculusTokenView = ({onValid, onCancel, alreadyHaveToken}: {onValid: (token: string) => void, onCancel: () => void, alreadyHaveToken: () => void}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const config = useService(ConfigurationService);
|
||||
|
||||
const [token, setToken] = useState("");
|
||||
const [showToken, setShowToken] = useState(false);
|
||||
const [stay, setStay] = useState(false);
|
||||
const [password, setPassword] = useState("");
|
||||
const [passwordValid, setPasswordValid] = useState(false);
|
||||
|
||||
const storeToken = (token: string, password: string) => {
|
||||
const cryptedToken = crypto.AES.encrypt(token, password).toString();
|
||||
config.set(OCULUS_TOKEN_STORAGE_KEY, cryptedToken);
|
||||
}
|
||||
|
||||
const valid = () => {
|
||||
|
||||
if(stay){
|
||||
storeToken(token, password);
|
||||
} else {
|
||||
config.delete(OCULUS_TOKEN_STORAGE_KEY);
|
||||
}
|
||||
|
||||
onValid(token);
|
||||
}
|
||||
|
||||
const isCryptedTokenPresent = () => {
|
||||
return !!config.get(OCULUS_TOKEN_STORAGE_KEY);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<p>{t("modals.enter-meta-token.body.info-enter-token")}</p>
|
||||
<a href="https://github.com/Zagrios/bs-manager/wiki/How-to-obtain-your-Oculus-Token" target="_blank" className="underline">{t("modals.enter-meta-token.body.how-obtain-token")}</a>
|
||||
|
||||
<div className="flex flex-col gap-2">
|
||||
<div>
|
||||
<div className="flex flex-row items-center justify-between">
|
||||
<label className="font-bold cursor-pointer tracking-wide inline-block" htmlFor="meta_token">{t("modals.enter-meta-token.body.oculus-token")}</label>
|
||||
{!isOculusTokenValid(token) && token.length > 0 && (
|
||||
<span className="text-orange-700 dark:text-orange-400 text-xs whitespace-normal min-w-0">{t("modals.enter-meta-token.body.token-is-invalid")}</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="bg-light-main-color-1 dark:bg-main-color-1 rounded-md flex box-border h-9">
|
||||
<input className="grow px-1 py-[2px] outline-none bg-transparent" onChange={e => setToken(e.target.value)} value={token} type={showToken ? "text" : "password"} name="meta_token" id="meta_token" placeholder="FRLAStr43sdx2..." />
|
||||
<BsmButton className="shrink-0 m-1 rounded-md p-0.5 !bg-light-main-color-3 dark:!bg-main-color-3" icon={showToken ? "eye-cross" : "eye"} withBar={false} onClick={() => setShowToken(prev => !prev)} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Tippy className="!bg-neutral-900" arrow={false} content={t("modals.enter-meta-token.body.save-token-info")}>
|
||||
<div className="flex flex-row items-center gap-1 w-fit">
|
||||
<BsmCheckbox className="h-6 w-6 relative z-[1]" onChange={setStay} checked={stay}/>
|
||||
<span className="font-bold cursor-help">{t("modals.enter-meta-token.body.save-my-token")}</span>
|
||||
</div>
|
||||
</Tippy>
|
||||
|
||||
<div className="grid grid-rows-[0fr] transition-[grid-template-rows]" style={{gridTemplateRows: stay && "1fr"}}>
|
||||
<div className="overflow-hidden">
|
||||
<PasswordInput onChange={v => {setPassword(v.password); setPasswordValid(v.valid)}} value={password}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isCryptedTokenPresent() && (
|
||||
<div>
|
||||
<span className="underline italic text-sm float-right cursor-pointer" onClick={alreadyHaveToken}>{t("modals.enter-meta-token.body.have-token-saved")}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex flex-row gap-2">
|
||||
<BsmButton className="rounded-md flex justify-center items-center transition-all h-9 w-full" typeColor="cancel" text="misc.cancel" withBar={false} onClick={onCancel}/>
|
||||
<BsmButton className="rounded-md flex justify-center items-center transition-all h-9 w-full" typeColor="primary" text="modals.enter-meta-token.valid-btn" withBar={false} onClick={valid} disabled={!isOculusTokenValid(token) || (stay && !passwordValid)}/>
|
||||
</div>
|
||||
</>
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
const PasswordInput = ({onChange, value}: {onChange: (value : {password: string, valid: boolean}) => void, value: string}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
|
||||
const isPasswordValid = (password: string) => {
|
||||
return password.length >= 8;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-row items-center justify-between">
|
||||
<label className="font-bold cursor-pointer tracking-wide inline-block" htmlFor="password">{t("modals.enter-meta-token.body.password")}</label>
|
||||
{!isPasswordValid(value) && value.length > 0 && (
|
||||
<span className="text-orange-700 dark:text-orange-400 text-xs whitespace-normal min-w-0">{t("modals.enter-meta-token.body.password-too-short")}</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="bg-light-main-color-1 dark:bg-main-color-1 rounded-md flex box-border h-9">
|
||||
<input className="grow px-1 py-[2px] outline-none bg-transparent" onChange={e => onChange({password: e.target.value, valid: isPasswordValid(e.target.value)})} value={value} type={showPassword ? "text" : "password"} name="password" id="password" placeholder={t("modals.enter-meta-token.body.password")} />
|
||||
<BsmButton className="shrink-0 m-1 rounded-md p-0.5 !bg-light-main-color-3 dark:!bg-main-color-3" icon={showPassword ? "eye-cross" : "eye"} withBar={false} onClick={() => setShowPassword(prev => !prev)} />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export const LoginToSteamModal: ModalComponent<
|
||||
const [password, setPassword] = useState("");
|
||||
const [stay, setStay] = useState(false);
|
||||
const [showPassword, setShowPassword] = useState(false);
|
||||
const qrCodeUrl = useObservable(data.qrCode$);
|
||||
const qrCodeUrl = useObservable(() => data.qrCode$);
|
||||
const t = useTranslation();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -27,8 +27,8 @@ export const DownloadMapsModal: ModalComponent<void, { version: BSVersion; owned
|
||||
const progressBar = useService(ProgressBarService);
|
||||
const os = useService(OsDiagnosticService);
|
||||
|
||||
const currentDownload = useObservable(mapsDownloader.currentMapDownload$);
|
||||
const mapsInQueue = useObservable(mapsDownloader.mapsInQueue$);
|
||||
const currentDownload = useObservable(() => mapsDownloader.currentMapDownload$);
|
||||
const mapsInQueue = useObservable(() => mapsDownloader.mapsInQueue$);
|
||||
const t = useTranslation();
|
||||
const filterContainerRef = useRef(null);
|
||||
const [filter, setFilter] = useState<MapFilter>({});
|
||||
@@ -37,7 +37,7 @@ export const DownloadMapsModal: ModalComponent<void, { version: BSVersion; owned
|
||||
const [sortOrder, setSortOrder] = useState<SearchOrder>(BSV_SORT_ORDER.at(0));
|
||||
const [ownedMapHashs, setOwnedMapHashs] = useState<string[]>(ownedMaps?.map(map => map.hash) ?? []);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const isOnline = useObservable(os.isOnline$);
|
||||
const isOnline = useObservable(() => os.isOnline$);
|
||||
const [searchParams, setSearchParams] = useState<SearchParams>({
|
||||
sortOrder,
|
||||
filter,
|
||||
@@ -76,12 +76,48 @@ export const DownloadMapsModal: ModalComponent<void, { version: BSVersion; owned
|
||||
};
|
||||
}, []);
|
||||
|
||||
const loadMaps = (params: SearchParams) => {
|
||||
const applyInstalledFilter = (maps: BsvMapDetail[]): BsvMapDetail[] => {
|
||||
return maps.filter(map => {
|
||||
if (!filter.installed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return !map.versions.some(version => ownedMapHashs.includes(version.hash));
|
||||
});
|
||||
}
|
||||
|
||||
const loadMaps = (params: SearchParams, tryToLoad = 5) => {
|
||||
setLoading(() => true);
|
||||
beatSaver
|
||||
.searchMaps(params)
|
||||
.then(maps => setMaps(prev => [...prev, ...maps]))
|
||||
.finally(() => setLoading(() => false));
|
||||
|
||||
const searchResult = beatSaver.searchMaps(params);
|
||||
|
||||
if (!filter.installed) {
|
||||
searchResult
|
||||
.then(maps => setMaps(prev => [...prev, ...maps]))
|
||||
.finally(() => setLoading(() => false));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
searchResult
|
||||
.then(maps => {
|
||||
if (!maps.length) {
|
||||
setLoading(() => false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
maps = applyInstalledFilter(maps);
|
||||
setMaps(prev => [...prev, ...maps])
|
||||
|
||||
if (maps.length < tryToLoad) {
|
||||
handleLoadMore();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
setLoading(() => false);
|
||||
})
|
||||
};
|
||||
|
||||
const extractMapDiffs = (map: BsvMapDetail): Map<BsvMapCharacteristic, ParsedMapDiff[]> => {
|
||||
@@ -146,7 +182,7 @@ export const DownloadMapsModal: ModalComponent<void, { version: BSVersion; owned
|
||||
>
|
||||
<div className="flex h-9 gap-2 shrink-0">
|
||||
<BsmDropdownButton ref={filterContainerRef} className="shrink-0 h-full relative z-[1] flex justify-start" buttonClassName="flex items-center justify-center h-full rounded-full px-2 py-1 !bg-light-main-color-1 dark:!bg-main-color-1" icon="filter" text="pages.version-viewer.maps.search-bar.filters-btn" withBar={false}>
|
||||
<FilterPanel className="absolute top-[calc(100%+3px)] origin-top w-[450px] h-fit p-2 rounded-md shadow-md shadow-black" filter={filter} onChange={setFilter} onApply={handleSearch} onClose={() => filterContainerRef.current.close()} />
|
||||
<FilterPanel className="absolute top-[calc(100%+3px)] origin-top w-[450px] h-fit p-2 rounded-md shadow-md shadow-black" localData={false} filter={filter} onChange={setFilter} onApply={handleSearch} onClose={() => filterContainerRef.current.close()} />
|
||||
</BsmDropdownButton>
|
||||
<input className="h-full bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-2 grow pb-0.5" type="text" name="" id="" placeholder={t("pages.version-viewer.maps.search-bar.search-placeholder")} value={query} onChange={e => setQuery(e.target.value)} />
|
||||
<BsmButton
|
||||
|
||||
@@ -44,10 +44,10 @@ export const DownloadModelsModal: ModalComponent<void, { version: BSVersion; typ
|
||||
}))
|
||||
);
|
||||
|
||||
const currentDownload = useObservable(modelsDownloader.currentDownload$(), null);
|
||||
const downloadQueue = useObservable(modelsDownloader.getQueue$(), []);
|
||||
const currentDownload = useObservable(() => modelsDownloader.currentDownload$(), null);
|
||||
const downloadQueue = useObservable(() => modelsDownloader.getQueue$(), []);
|
||||
const [msModels, msModels$] = useBehaviorSubject<MSModel[]>([]);
|
||||
const isOnline = useObservable(os.isOnline$, true);
|
||||
const isOnline = useObservable(() => os.isOnline$, true);
|
||||
const [error, error$] = useBehaviorSubject(false);
|
||||
const [isLoading, isLoading$] = useBehaviorSubject(false);
|
||||
const [ownedModels, setOwnedModels] = useState<BsmLocalModel[]>(owned ?? []);
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component"
|
||||
import { BsmImage } from "renderer/components/shared/bsm-image.component"
|
||||
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service"
|
||||
import BeatConflict from "../../../../../assets/images/apngs/beat-conflict.png";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component";
|
||||
import { useState } from "react";
|
||||
|
||||
export const NeedLaunchAdminModal: ModalComponent<boolean, void> = ({resolver}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const [dontShowAgain, setDontShowAgain] = useState(false);
|
||||
|
||||
return (
|
||||
<form className="text-gray-800 dark:text-gray-200 flex flex-col min-w-[350px]">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{t("modals.launch-as-admin.title")}</h1>
|
||||
<BsmImage className="mx-auto h-24" image={BeatConflict} />
|
||||
<div className="flex flex-col gap-3">
|
||||
<p className="w-0 min-w-full">{t("modals.launch-as-admin.body.info")}</p>
|
||||
<p className="w-0 min-w-full">{t("modals.launch-as-admin.body.info-2")}</p>
|
||||
<p className="w-0 min-w-full text-sm italic">{t("modals.launch-as-admin.body.info-3")}</p>
|
||||
</div>
|
||||
<div className="flex flex-row justify-start items-center gap-1.5 my-4">
|
||||
<BsmCheckbox className="relative z-[1] w-6 aspect-square" checked={dontShowAgain} onChange={setDontShowAgain} />
|
||||
<span>{t("modals.launch-as-admin.not-remind-me")}</span>
|
||||
</div>
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center flex items-center justify-center transition-all h-8" onClick={() => resolver({ exitCode: ModalExitCode.CANCELED })} withBar={false} text="misc.cancel" />
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center flex items-center justify-center transition-all h-8" onClick={() => resolver({ exitCode: ModalExitCode.COMPLETED, data: dontShowAgain })} withBar={false} text="modals.launch-as-admin.launch-as-admin" />
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -19,11 +19,9 @@ export const OriginalOculusVersionBackupModal: ModalComponent<boolean, void> = (
|
||||
<form className="max-w-[450px] text-gray-800 dark:text-gray-200">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.original-version-backup-oculus.title")}</h1>
|
||||
<BsmImage className="mx-auto h-20" image={BeatConflict} />
|
||||
|
||||
|
||||
<p className="text-sm italic mb-4 font-bold">{t("modals.original-version-backup-oculus.body.must-be-installed-once")}</p>
|
||||
<p className="mb-4">{t("modals.original-version-backup-oculus.body.need-backup")}</p>
|
||||
<p className="mb-4">{t("modals.original-version-backup-oculus.body.can-restore-later")}</p>
|
||||
<p className="text-sm italic mb-4">{t("modals.original-version-backup-oculus.body.tips-launch-oculus")}</p>
|
||||
<p className="mb-4">{t("modals.original-version-backup-oculus.body.will-backup")}</p>
|
||||
|
||||
<div className="flex flex-row justify-start items-center gap-1.5 my-4" >
|
||||
<BsmCheckbox className="relative z-[1] w-6 aspect-square" checked={dontShowAgain} onChange={setDontShowAgain} />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import Tippy from "@tippyjs/react";
|
||||
import { Variants } from "framer-motion";
|
||||
import { useEffect, useState } from "react";
|
||||
import { LinkButton } from "renderer/components/maps-mangement-components/link-button.component";
|
||||
import { BsmBasicSpinner } from "renderer/components/shared/bsm-basic-spinner/bsm-basic-spinner.component";
|
||||
@@ -12,7 +11,7 @@ import { BSVersionManagerService } from "renderer/services/bs-version-manager.se
|
||||
import { ConfigurationService } from "renderer/services/configuration.service";
|
||||
import { IpcService } from "renderer/services/ipc.service";
|
||||
import { ModalComponent } from "renderer/services/modale.service";
|
||||
import { VersionFolderLinkerService, VersionLinkerActionType } from "renderer/services/version-folder-linker.service";
|
||||
import { FolderLinkState, VersionFolderLinkerService, VersionLinkerActionType } from "renderer/services/version-folder-linker.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
|
||||
export const ShareFoldersModal: ModalComponent<void, BSVersion> = ({ data }) => {
|
||||
@@ -107,33 +106,12 @@ const FolderItem = ({ version, relativeFolder, onDelete }: FolderProps) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const name = relativeFolder.split(window.electron.path.sep).at(-1);
|
||||
const color = useThemeColor("first-color");
|
||||
|
||||
const variants: Variants = {
|
||||
hover: { rotate: 22.5 },
|
||||
tap: { rotate: 45 },
|
||||
};
|
||||
|
||||
const pending = useObservable(linker.isPending(version, relativeFolder));
|
||||
const processing = useObservable(linker.isProcessing(version, relativeFolder));
|
||||
const linkDisabled = pending || processing;
|
||||
|
||||
const [linked, setLinked] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (pending) {
|
||||
return;
|
||||
}
|
||||
loadFolderIsLinked();
|
||||
}, [version, relativeFolder, pending]);
|
||||
|
||||
const loadFolderIsLinked = () => {
|
||||
linker.isVersionFolderLinked(version, relativeFolder).toPromise().then(setLinked);
|
||||
};
|
||||
const state = useObservable(() => linker.$folderLinkedState(version, relativeFolder), FolderLinkState.Unlinked, [version, relativeFolder]);
|
||||
const name = relativeFolder.split(window.electron.path.sep).at(-1);
|
||||
|
||||
const onClickLink = () => {
|
||||
if (linked) {
|
||||
if (state === FolderLinkState.Linked) {
|
||||
return linker.unlinkVersionFolder({
|
||||
version,
|
||||
relativeFolder,
|
||||
@@ -150,7 +128,6 @@ const FolderItem = ({ version, relativeFolder, onDelete }: FolderProps) => {
|
||||
|
||||
const cancelLink = () => {
|
||||
linker.cancelAction(version, relativeFolder);
|
||||
loadFolderIsLinked();
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -159,14 +136,18 @@ const FolderItem = ({ version, relativeFolder, onDelete }: FolderProps) => {
|
||||
{name}
|
||||
</span>
|
||||
<div className="flex flex-row gap-1.5">
|
||||
<Tippy placement="left" content={t(`modals.shared-folders.buttons.${linked ? "unlink-folder" : "link-folder"}`)} arrow={false}>
|
||||
<LinkButton variants={variants} linked={linked} disabled={linkDisabled} whileHover="hover" whileTap="tap" className="p-0.5 h-7 shrink-0 aspect-square blur-0 cursor-pointer hover:brightness-75" onClick={onClickLink} />
|
||||
<Tippy placement="left" content={t(`modals.shared-folders.buttons.${state === FolderLinkState.Linked ? "unlink-folder" : "link-folder"}`)} arrow={false}>
|
||||
<LinkButton
|
||||
className="p-0.5 h-7 shrink-0 aspect-square blur-0 cursor-pointer hover:brightness-75"
|
||||
state={state}
|
||||
onClick={onClickLink}
|
||||
/>
|
||||
</Tippy>
|
||||
{(() => {
|
||||
if (processing) {
|
||||
if (state === FolderLinkState.Processing) {
|
||||
return <BsmBasicSpinner className="aspect-square h-7 rounded-md p-1 dark:bg-main-color-2" thikness="3.5px" style={{ color }} />;
|
||||
}
|
||||
if (pending) {
|
||||
if (state === FolderLinkState.Pending) {
|
||||
return (
|
||||
<BsmButton
|
||||
className="aspect-square h-7 rounded-md p-1"
|
||||
|
||||
@@ -8,7 +8,7 @@ import { BsmIcon } from "../svgs/bsm-icon.component";
|
||||
export function Modal() {
|
||||
const modalSevice = ModalService.getInstance();
|
||||
|
||||
const ModalComponent = useObservable(modalSevice.getModalToShow());
|
||||
const ModalComponent = useObservable(() => modalSevice.getModalToShow());
|
||||
|
||||
const modalData = modalSevice.getModalData();
|
||||
const resolver = modalSevice.getResolver();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { useRef, useState } from "react";
|
||||
import { ModelsTabsNavbar } from "./models-tabs-navbar.component";
|
||||
import { ModelsGrid } from "./models-grid.component";
|
||||
import { MSModelType } from "shared/models/models/model-saber.model";
|
||||
import { BsmDropdownButton, DropDownItem } from "../shared/bsm-dropdown-button.component";
|
||||
@@ -14,6 +13,16 @@ import { NotificationService } from "renderer/services/notification.service";
|
||||
import { ConfigurationService } from "renderer/services/configuration.service";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { lt } from "semver";
|
||||
import { lastValueFrom, of, take } from "rxjs";
|
||||
import { FolderLinkState } from "renderer/services/version-folder-linker.service";
|
||||
import { BsContentTabItemProps } from "../shared/bs-content-tab-panel/bs-content-tab-item.component";
|
||||
import { BsContentTabPanel } from "../shared/bs-content-tab-panel/bs-content-tab-panel.component";
|
||||
import { ModelTypeAvatarIcon } from "../svgs/icons/model-type-avatar-icon.component";
|
||||
import { SvgIcon } from "../svgs/svg-icon.type";
|
||||
import { ModelTypeSaberIcon } from "../svgs/icons/model-type-saber-icon.component";
|
||||
import { ModelTypePlatformIcon } from "../svgs/icons/model-type-platform-icon.component";
|
||||
import { ModelTypeBloqIcon } from "../svgs/icons/model-type-bloq-icon.component";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
|
||||
export function ModelsPanel({ version, isActive, goToMods }: { version?: BSVersion; isActive: boolean; goToMods?: () => void }) {
|
||||
const modelsManager = useService(ModelsManagerService);
|
||||
@@ -29,9 +38,15 @@ export function ModelsPanel({ version, isActive, goToMods }: { version?: BSVersi
|
||||
|
||||
const [modelTypeTab, setModelTypeTab] = useState<MSModelType>(MSModelType.Avatar);
|
||||
const [currentTabIndex, setCurrentTabIndex] = useState<number>(0);
|
||||
|
||||
const [search, setSearch] = useState<string>("");
|
||||
|
||||
const modelsLinkStats = {
|
||||
[MSModelType.Avatar]: useObservable(() => version ? modelsManager.$modelsLinkingState(version, MSModelType.Avatar) : of(null), FolderLinkState.Unlinked, [version]),
|
||||
[MSModelType.Saber]: useObservable(() => version ? modelsManager.$modelsLinkingState(version, MSModelType.Saber) : of(null), FolderLinkState.Unlinked, [version]),
|
||||
[MSModelType.Platfrom]: useObservable(() => version ? modelsManager.$modelsLinkingState(version, MSModelType.Platfrom) : of(null), FolderLinkState.Unlinked, [version]),
|
||||
[MSModelType.Bloq]: useObservable(() => version ? modelsManager.$modelsLinkingState(version, MSModelType.Bloq) : of(null), FolderLinkState.Unlinked, [version]),
|
||||
}
|
||||
|
||||
useOnUpdate(() => {
|
||||
if (!isActive || !goToMods) {
|
||||
return;
|
||||
@@ -66,7 +81,7 @@ export function ModelsPanel({ version, isActive, goToMods }: { version?: BSVersi
|
||||
if (config.get("not-remind-models-breaks")) {
|
||||
return;
|
||||
}
|
||||
notification.notifyWarning({ title: "models.notifications.prevent-for-models-breaks.title", desc: "models.notifications.prevent-for-models-breaks.desc", actions: [{ id: "0", title: "models.notifications.prevent-for-mods.not-remind", cancel: true }], duration: 12_000 }).then(res => {
|
||||
notification.notifyInfo({ title: "models.notifications.prevent-for-models-breaks.title", desc: "models.notifications.prevent-for-models-breaks.desc", actions: [{ id: "0", title: "models.notifications.prevent-for-mods.not-remind", cancel: true }], duration: 12_000 }).then(res => {
|
||||
if (res === "0") {
|
||||
config.set("not-remind-models-breaks", true);
|
||||
}
|
||||
@@ -93,6 +108,44 @@ export function ModelsPanel({ version, isActive, goToMods }: { version?: BSVersi
|
||||
{ text: "models.panel.actions.drop-down.delete", onClick: deleteModels, icon: "trash" },
|
||||
];
|
||||
|
||||
const getModelTabProps = (model: MSModelType): BsContentTabItemProps => {
|
||||
|
||||
const onClick = async () => {
|
||||
const state = await lastValueFrom(modelsManager.$modelsLinkingState(version, model).pipe(take(1)));
|
||||
if (state === FolderLinkState.Pending || state === FolderLinkState.Processing) { return; }
|
||||
if (state === FolderLinkState.Linked) {
|
||||
modelsManager.unlinkModels(model, version);
|
||||
} else {
|
||||
modelsManager.linkModels(model, version);
|
||||
}
|
||||
}
|
||||
|
||||
const getModelIcon = (model: MSModelType): SvgIcon => {
|
||||
switch (model) {
|
||||
case MSModelType.Avatar:
|
||||
return ModelTypeAvatarIcon;
|
||||
case MSModelType.Saber:
|
||||
return ModelTypeSaberIcon;
|
||||
case MSModelType.Platfrom:
|
||||
return ModelTypePlatformIcon;
|
||||
case MSModelType.Bloq:
|
||||
return ModelTypeBloqIcon;
|
||||
default:
|
||||
return ModelTypeAvatarIcon;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
text: `models.types.plural.${model}`,
|
||||
icon: getModelIcon(model),
|
||||
onClick: () => setModelTypeTab(model),
|
||||
linkProps: version ? {
|
||||
onClick,
|
||||
state: modelsLinkStats[model],
|
||||
} : null
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div ref={ref} className="w-full h-full flex flex-col items-center justify-center gap-4">
|
||||
<div className="w-full shrink-0 flex h-9 justify-center px-40 gap-2 text-main-color-1 dark:text-white">
|
||||
@@ -112,24 +165,23 @@ export function ModelsPanel({ version, isActive, goToMods }: { version?: BSVersi
|
||||
</div>
|
||||
<BsmDropdownButton items={threeDotsItems} className="h-full flex aspect-square relative rounded-full z-[1] bg-light-main-color-1 dark:bg-main-color-3" buttonClassName="rounded-full h-full w-full p-[6px]" icon="three-dots" withBar={false} menuTranslationY="6px" align="center" />
|
||||
</div>
|
||||
<div className="w-full h-full flex flex-row bg-light-main-color-3 dark:bg-main-color-2 rounded-md shadow-black shadow-md overflow-hidden">
|
||||
<ModelsTabsNavbar
|
||||
className="flex-shrink-0"
|
||||
version={version}
|
||||
tabIndex={currentTabIndex}
|
||||
onTabChange={(index, tab) => {
|
||||
setModelTypeTab(() => tab.extra);
|
||||
setCurrentTabIndex(() => index);
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="flex-grow h-full flex flex-col transition-all duration-300" style={{ translate: `0 ${0 - currentTabIndex * 100}%` }}>
|
||||
<BsContentTabPanel
|
||||
tabIndex={currentTabIndex}
|
||||
onTabChange={(index) => setCurrentTabIndex(index)}
|
||||
tabs={[
|
||||
getModelTabProps(MSModelType.Avatar),
|
||||
getModelTabProps(MSModelType.Saber),
|
||||
getModelTabProps(MSModelType.Platfrom),
|
||||
getModelTabProps(MSModelType.Bloq),
|
||||
]}
|
||||
>
|
||||
<>
|
||||
<ModelsGrid ref={modelsGridRefs[0]} version={version} type={MSModelType.Avatar} active={isActive && modelTypeTab === MSModelType.Avatar} search={search} downloadModels={openDownloadModal} />
|
||||
<ModelsGrid ref={modelsGridRefs[1]} version={version} type={MSModelType.Saber} active={isActive && modelTypeTab === MSModelType.Saber} search={search} downloadModels={openDownloadModal} />
|
||||
<ModelsGrid ref={modelsGridRefs[2]} version={version} type={MSModelType.Platfrom} active={isActive && modelTypeTab === MSModelType.Platfrom} search={search} downloadModels={openDownloadModal} />
|
||||
<ModelsGrid ref={modelsGridRefs[3]} version={version} type={MSModelType.Bloq} active={isActive && modelTypeTab === MSModelType.Bloq} search={search} downloadModels={openDownloadModal} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</BsContentTabPanel>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { MSModelType } from "../../../shared/models/models/model-saber.model";
|
||||
import { LinkButton } from "../maps-mangement-components/link-button.component";
|
||||
import { useState } from "react";
|
||||
import { useOnUpdate } from "renderer/hooks/use-on-update.hook";
|
||||
import { ModelsManagerService } from "renderer/services/models-management/models-manager.service";
|
||||
import { BsContentNavBar, BsContentNavBarTab } from "../shared/bs-content-nav-bar.component";
|
||||
import { useConstant } from "renderer/hooks/use-constant.hook";
|
||||
import { BsmIcon } from "../svgs/bsm-icon.component";
|
||||
import { MODEL_TYPES } from "../../../shared/models/models/constants";
|
||||
import { useService } from "renderer/hooks/use-service.hook";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
|
||||
type Props = {
|
||||
className?: string;
|
||||
version?: BSVersion;
|
||||
tabIndex: number;
|
||||
onTabChange: (index: number, tab: BsContentNavBarTab<MSModelType>) => void;
|
||||
};
|
||||
|
||||
export function ModelsTabsNavbar({ className, version, tabIndex, onTabChange }: Props) {
|
||||
const tabs = useConstant<BsContentNavBarTab<MSModelType>[]>(() => {
|
||||
return MODEL_TYPES.map(type => ({
|
||||
text: type,
|
||||
extra: type,
|
||||
}));
|
||||
});
|
||||
|
||||
return <BsContentNavBar className={`!rounded-none shadow-sm ${className ?? ""}`} tabIndex={tabIndex} onTabChange={onTabChange} tabs={tabs} renderTab={(props, tab, activeTab) => <ModelTab version={version} modelType={tab.extra} {...props} active={tab === activeTab} />} />;
|
||||
}
|
||||
|
||||
type TabProps = {
|
||||
version?: BSVersion;
|
||||
modelType: MSModelType;
|
||||
active?: boolean;
|
||||
} & React.ComponentProps<"li">;
|
||||
|
||||
function ModelTab({ version, modelType, active, onClick }: TabProps) {
|
||||
const modelsManager = useService(ModelsManagerService);
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const [modelsAreLinked, setModelsAreLinked] = useState(false);
|
||||
const [linkBtnDisabled, setLinkBtnDisabled] = useState(false);
|
||||
|
||||
useOnUpdate(() => {
|
||||
if (!version) {
|
||||
return;
|
||||
}
|
||||
|
||||
const sub = modelsManager.$modelsLinkingPending(version, modelType).subscribe(async pending => {
|
||||
if (pending) {
|
||||
return setLinkBtnDisabled(() => pending);
|
||||
}
|
||||
const modelsLinked = await modelsManager.isModelsLinked(version, modelType);
|
||||
setModelsAreLinked(() => modelsLinked);
|
||||
setLinkBtnDisabled(() => pending);
|
||||
});
|
||||
|
||||
return () => {
|
||||
sub.unsubscribe();
|
||||
};
|
||||
}, [version]);
|
||||
|
||||
const linkModels = () => modelsManager.linkModels(modelType, version);
|
||||
const unlinkModels = () => modelsManager.unlinkModels(modelType, version);
|
||||
|
||||
const onClickLink = () => {
|
||||
if (!version) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (modelsAreLinked) {
|
||||
return unlinkModels();
|
||||
}
|
||||
return linkModels();
|
||||
};
|
||||
|
||||
return (
|
||||
<li className={`relative w-full cursor-pointer flex-1 text-center text-lg font-bold flex justify-center items-center content-center px-7 dim-on-hover ${active ? "dim" : ""}`} onClick={onClick}>
|
||||
<div className="flex flex-col gap-0.5 justify-start items-center text-main-color-1 dark:text-gray-200">
|
||||
<BsmIcon icon={modelType} className="w-7 h-7" />
|
||||
<span className=" font-thin italic text-xs">{t(`models.types.plural.${modelType}`)}</span>
|
||||
</div>
|
||||
<div className="flex items-center absolute top-1.5 left-1.5">{!!version && <LinkButton variants={{ hover: { rotate: 22.5 }, tap: { rotate: 45 } }} disabled={linkBtnDisabled} whileHover="hover" whileTap="tap" initial={{ rotate: 0 }} className="block w-6 h-6 aspect-square blur-0 cursor-pointer hover:brightness-75" linked={modelsAreLinked} title={modelsAreLinked ? "models.panel.actions.unlink-models" : "models.panel.actions.link-models"} onClick={onClickLink} />}</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export const BsManagerIcon = memo(({ className }: { className?: string }) => {
|
||||
const audioPlayer = useService(AudioPlayerService);
|
||||
|
||||
const { firstColor, secondColor } = useThemeColor();
|
||||
const playing = useObservable(audioPlayer.playing$);
|
||||
const playing = useObservable(() => audioPlayer.playing$);
|
||||
|
||||
const { bpm } = audioPlayer;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export function SharedNavBarItem() {
|
||||
const pageState = useService(PageStateService);
|
||||
|
||||
const t = useTranslation();
|
||||
const route = useObservable(pageState.route$);
|
||||
const route = useObservable(() => pageState.route$);
|
||||
const color = useThemeColor("first-color");
|
||||
|
||||
return (
|
||||
|
||||
@@ -19,8 +19,8 @@ export function NavBar() {
|
||||
const versionManager = useService(BSVersionManagerService);
|
||||
const versionDownloader = useService(BsDownloaderService);
|
||||
|
||||
const downloadingVersion = useObservable(versionDownloader.downloadingVersion$.pipe(distinctUntilChanged(equal)));
|
||||
const installedVersions = useObservable(versionManager.installedVersions$);
|
||||
const downloadingVersion = useObservable(() => versionDownloader.downloadingVersion$.pipe(distinctUntilChanged(equal)));
|
||||
const installedVersions = useObservable(() => versionManager.installedVersions$);
|
||||
|
||||
const color = useThemeColor("first-color");
|
||||
const t = useTranslation();
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useService } from "renderer/hooks/use-service.hook";
|
||||
export function NotificationOverlay() {
|
||||
const notificationService = useService(NotificationService);
|
||||
|
||||
const notifications = useObservable(notificationService.notifications$);
|
||||
const notifications = useObservable(() => notificationService.notifications$);
|
||||
|
||||
return (
|
||||
<ul className="absolute h-full w-0 top-0 right-0 z-[100] pt-10">
|
||||
|
||||
@@ -9,9 +9,9 @@ import { useService } from "renderer/hooks/use-service.hook";
|
||||
export function BsmProgressBar() {
|
||||
const progressBarService = useService(ProgressBarService);
|
||||
|
||||
const progressData = useObservable(progressBarService.progressData$);
|
||||
const visible = useObservable(progressBarService.visible$);
|
||||
const style = useObservable(progressBarService.style$);
|
||||
const progressData = useObservable(() => progressBarService.progressData$);
|
||||
const visible = useObservable(() => progressBarService.visible$);
|
||||
const style = useObservable(() => progressBarService.style$);
|
||||
|
||||
const progressLabel = (() => {
|
||||
if (!progressData) {
|
||||
|
||||
@@ -9,7 +9,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function TextProgressBar({ value$, className, style }: Props) {
|
||||
const value = useObservable(value$);
|
||||
const value = useObservable(() => value$);
|
||||
|
||||
const prefix = typeof value === "number" ? "%" : "";
|
||||
|
||||
|
||||