mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
Compare commits
385 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c264684ec6 | |||
| aa32f4e2f4 | |||
| bfafe0e4b1 | |||
| a8c36a5e7c | |||
| de3284922a | |||
| d018ac5c9a | |||
| e69983d6a7 | |||
| 2a8f4feea8 | |||
| b08aa4c1d9 | |||
| c0e169cead | |||
| 99f087a89d | |||
| e0fd024314 | |||
| 599e04a96f | |||
| 77b838187c | |||
| 0ce2b9493a | |||
| 8124577728 | |||
| 2e5929c74c | |||
| a4908ef850 | |||
| cf0fa2b787 | |||
| 03d4d14edd | |||
| 3bdbcfcfae | |||
| cebf83be7d | |||
| 2c89a8a44c | |||
| e0060973b6 | |||
| 0c0dd34026 | |||
| 5f63aaac45 | |||
| 52cdc50fa8 | |||
| e1bfcd7bc0 | |||
| 1009a4c02a | |||
| d1176ccabe | |||
| c20e10ea0a | |||
| 3f4d58a3ed | |||
| ba3de199fa | |||
| 1d8a68f665 | |||
| 9d37ebcdd3 | |||
| 616215c0a6 | |||
| 9cb5668b4c | |||
| 2e1c2d6bf2 | |||
| af0ec409a0 | |||
| bc2c716111 | |||
| b9359d6b9c | |||
| 474deaedcf | |||
| 9d230461de | |||
| bdc893d8a5 | |||
| 76bdde0fe8 | |||
| ace7657edb | |||
| db656259e1 | |||
| 645f18002a | |||
| b9750b0b26 | |||
| eb9775c89f | |||
| 86efb9293b | |||
| 1f4519b2a5 | |||
| 67e383ca47 | |||
| f10c7d76db | |||
| e38d0b081d | |||
| f818a758bd | |||
| 11819d0163 | |||
| 2c393cb294 | |||
| 24d2aa7fc6 | |||
| c056f84b66 | |||
| a366c07128 | |||
| d1dc7bbca0 | |||
| d7d3c980cb | |||
| 44074beb33 | |||
| ab798437d5 | |||
| bdbdcfb1b4 | |||
| abe2274d12 | |||
| f602547ca4 | |||
| 4abf04c12a | |||
| b6c6518fd9 | |||
| 26049d0359 | |||
| ed39cba41b | |||
| f91f6756c3 | |||
| b52d471828 | |||
| b841d067c7 | |||
| 27e5d79bf7 | |||
| 28a5576ef9 | |||
| 3b6e908352 | |||
| 004d335eda | |||
| ef8662edca | |||
| f2153f3d0b | |||
| b7ac9901c4 | |||
| 962f1d8aae | |||
| 66b834bd31 | |||
| 0214a518ee | |||
| 40137b15fa | |||
| d30e203d29 | |||
| 7810b31d13 | |||
| 9720335adf | |||
| 1af3ef7565 | |||
| 7da09c117f | |||
| 9ff47b6895 | |||
| ed4137949d | |||
| f833f28930 | |||
| 97fa44cd5d | |||
| 6562f6c764 | |||
| 1177091cf0 | |||
| a785828a6b | |||
| 39b4a48fef | |||
| a62038450f | |||
| 070eb5b796 | |||
| bc1e809545 | |||
| dee49c964a | |||
| 4aa1521e88 | |||
| 4a53917f27 | |||
| 75c849d203 | |||
| 3e3cffc6bc | |||
| 2d211e3c05 | |||
| e5142fe131 | |||
| 89312f0bf9 | |||
| f2e6fa486a | |||
| 4f0f80bbc2 | |||
| 31e5c0ed10 | |||
| 9a2afe6820 | |||
| c93f9a7041 | |||
| 5401248286 | |||
| 0511540b98 | |||
| dcb233c957 | |||
| 804cb22f56 | |||
| 00e4059213 | |||
| 83fcbf6d04 | |||
| 420ecc9ae6 | |||
| 835e9a0678 | |||
| e1a6721f7d | |||
| 2e588ef4cb | |||
| d3e0099d14 | |||
| b9acdc9578 | |||
| fefd552f60 | |||
| 6eb2866eee | |||
| 01401c4691 | |||
| 37c2bfcd04 | |||
| e190217390 | |||
| 5fa7013106 | |||
| abf53489f5 | |||
| 0db13a8474 | |||
| e1229a45a0 | |||
| eafe26507a | |||
| 5c70a7d974 | |||
| da8bae8582 | |||
| 4cce24e275 | |||
| 18f2f18e41 | |||
| ec3c6ce26e | |||
| 9862dfa78d | |||
| e3f91ea593 | |||
| 509b2cd9b9 | |||
| 1b54d86324 | |||
| 425b2ecdb1 | |||
| 3b973e1597 | |||
| 86d2781e67 | |||
| 5d10f139a9 | |||
| 9b5a1711ce | |||
| 646ec820a5 | |||
| a144a308f6 | |||
| 07818cf8f2 | |||
| ccbcc8296d | |||
| bea435439e | |||
| d9ff78c21d | |||
| 14a4bf3408 | |||
| 172d7e4578 | |||
| 5986cf7a15 | |||
| a5e4b745ef | |||
| 4cd538fe21 | |||
| c406dfee79 | |||
| 8a168d20b3 | |||
| b16f7150e8 | |||
| c4319f1c6c | |||
| d9003fa07b | |||
| eb2235e017 | |||
| 1e784c243b | |||
| 23e9b52af2 | |||
| e42ac4eca3 | |||
| 622595a7a0 | |||
| 556ca1b1e6 | |||
| cef4f22305 | |||
| ee1dd7b21f | |||
| 487b73a859 | |||
| a56fdde0e7 | |||
| 99f91d25c3 | |||
| 8579b0697d | |||
| f0761c8359 | |||
| b1833721d0 | |||
| aba099e15a | |||
| d25c0cced5 | |||
| bc4f6304db | |||
| 4357454b14 | |||
| 528abbcaa3 | |||
| 9bcc605e00 | |||
| f7e3b9ae9d | |||
| 1b963a99c1 | |||
| 363cc3cc5e | |||
| 8307a975ea | |||
| f5ecdfca60 | |||
| 5bb92d804b | |||
| 5b4b962015 | |||
| b43cfdd70b | |||
| 77350a823e | |||
| 5844aea281 | |||
| 8af5d8c3e4 | |||
| f0f3721ec5 | |||
| 5641c25cc1 | |||
| c1b32c2fc3 | |||
| dc70d2889f | |||
| 6b2879d9dc | |||
| 19e842d721 | |||
| 8d28c3cfc8 | |||
| baec206bf3 | |||
| 3aacd7575b | |||
| d739245e70 | |||
| c88d93b0ab | |||
| 64280509b0 | |||
| a7e81cfa8a | |||
| 2620354888 | |||
| 61a8790448 | |||
| 5b4af58baa | |||
| 6cd3c65362 | |||
| 211a3b9a39 | |||
| a4fd92a014 | |||
| 295d0f90ba | |||
| 5592242963 | |||
| 0212f3ba26 | |||
| 36521a2b1b | |||
| 571a4f23ea | |||
| 2b9829d57a | |||
| 2f6ea39f79 | |||
| 8e33214fd0 | |||
| 310dfb94c2 | |||
| 39e2a54e1e | |||
| 829cace7b9 | |||
| e82afa7e22 | |||
| 5e64ce16f4 | |||
| 2154d90759 | |||
| d889c85b4a | |||
| cc4d033db2 | |||
| 1cfef9f607 | |||
| bbd26d1c12 | |||
| 72f0c22e88 | |||
| 72daaeee0e | |||
| 26765c45c7 | |||
| 2afcaa46f9 | |||
| 3c5b2a2eed | |||
| 0ff8e865aa | |||
| 2d60acce51 | |||
| 53fb197585 | |||
| 3c11f5a0a1 | |||
| bef27b4ac5 | |||
| 0d0cfa1b4e | |||
| 286f4aa68d | |||
| 58f563ed61 | |||
| 523575e43c | |||
| 414017930e | |||
| 01550557fb | |||
| cdfb957203 | |||
| c647099f60 | |||
| 8899017a37 | |||
| c8b983fd76 | |||
| 24ad6b6a1d | |||
| ee9e23ef2c | |||
| 3125009e80 | |||
| b23e211e11 | |||
| 2cc9b342b7 | |||
| 085a74a6b3 | |||
| f6159a863c | |||
| 4430138e77 | |||
| 04eca2cbc0 | |||
| c8d47f8e67 | |||
| f7da6fdb63 | |||
| 2466bb6d4c | |||
| 5f293e38b6 | |||
| 08ce0b1da3 | |||
| e12aa7e695 | |||
| c92a32a503 | |||
| 56fdfdca49 | |||
| b2510645e5 | |||
| b5a08584a0 | |||
| 78568cd235 | |||
| 8e86d4a7c5 | |||
| 6322ff2dd5 | |||
| 89c3b93ba6 | |||
| 580dea6b44 | |||
| b203adc66f | |||
| 7a2639f772 | |||
| 535430d0c5 | |||
| a0c9c88e0e | |||
| 4b7610f39f | |||
| a06e903c5c | |||
| f79f46269f | |||
| b82ddc1c59 | |||
| f4dc6ab838 | |||
| 62dde63206 | |||
| 5c034013fe | |||
| 23717c15d1 | |||
| 09acc3ccaa | |||
| 7c3f4f6a64 | |||
| 8dc48b20cb | |||
| 165b17e034 | |||
| 4255e2ad85 | |||
| 16b7c1ed76 | |||
| d179bde348 | |||
| e2234b19ea | |||
| 45259f304b | |||
| 220c7940a8 | |||
| 9665dbcb4e | |||
| 423a17070c | |||
| 8d88b59e3d | |||
| ae9d1dfc9b | |||
| 6930df940f | |||
| fd523f4017 | |||
| 4c8f903256 | |||
| d2ba6aadc1 | |||
| 0023066e32 | |||
| 39bcf63e3c | |||
| 656f32e755 | |||
| f66279980b | |||
| 1f65841e62 | |||
| 0422e7fee8 | |||
| 7fdf165d57 | |||
| 31d1b8536d | |||
| 20ac0ef7da | |||
| a72c849693 | |||
| 48f3bf53ca | |||
| e78a1189b0 | |||
| 955d6420b3 | |||
| f773e419d5 | |||
| 08bceff27a | |||
| aacf09aebc | |||
| 0ad02979e7 | |||
| b33839c7a2 | |||
| 4d5fca4b18 | |||
| 598049a49f | |||
| e0f9b44f4d | |||
| 13ffd76459 | |||
| 5eae7eab10 | |||
| bc855990c8 | |||
| 55d643be1c | |||
| 1e726be44d | |||
| 648ea4be67 | |||
| 030d70e5c3 | |||
| 4a7c47fb5c | |||
| b404122960 | |||
| 9d075d79c8 | |||
| 4e1847c12d | |||
| de2f7882b3 | |||
| 28b6241255 | |||
| 3358efac88 | |||
| c7069494a9 | |||
| b98826612b | |||
| 5ef8443217 | |||
| 1209d8e32a | |||
| b89da81989 | |||
| b0a5cbc74e | |||
| a6d8bedde2 | |||
| e9824e86f4 | |||
| 220837d2fb | |||
| 1bfdcb732a | |||
| 9865f91b6d | |||
| 838b1b3b93 | |||
| 0f7a30992d | |||
| 1c2c997b6b | |||
| bbbaeb86d0 | |||
| 34921b166e | |||
| f9b10a1174 | |||
| 6b20fa8f7b | |||
| bc5fb017cf | |||
| ce82f53568 | |||
| 4f5ef38d1b | |||
| 26e2ed5bbf | |||
| a5d42f3687 | |||
| 811e49327a | |||
| a8bb34c2d8 | |||
| 13b426eca6 | |||
| dceb09ec36 | |||
| e89199fec3 | |||
| 1b2136ffb9 | |||
| 416cf41841 | |||
| 3940a0a06c | |||
| 6a987126c8 | |||
| a4f68ebc8b | |||
| b7adfacfd1 | |||
| ee03a90f02 | |||
| 383d917e25 | |||
| e15d4c45d4 | |||
| 6077e51203 | |||
| 079dc32429 | |||
| 01ef77832d | |||
| d29e6d39f5 |
@@ -0,0 +1,132 @@
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||
identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at contact@bsmanager.io.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series of
|
||||
actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or permanent
|
||||
ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||
community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.1, available at
|
||||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
||||
[https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
@@ -0,0 +1,32 @@
|
||||
## Contributing
|
||||
|
||||
[code-of-conduct]: CODE_OF_CONDUCT.md
|
||||
[fork]: https://github.com/Zagrios/bs-manager/fork
|
||||
[pr]: https://github.com/Zagrios/bs-manager/compare
|
||||
[style]: https://github.com/basarat/typescript-book/blob/master/docs/styleguide/styleguide.md
|
||||
|
||||
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms.
|
||||
|
||||
## Issues and PRs
|
||||
|
||||
If you have suggestions for how this project could be improved, or want to report a bug, open an issue! We'd love all and any contributions. If you have questions, too, we'd love to hear them.
|
||||
|
||||
We'd also love PRs. If you're thinking of a large PR, we advise opening up an issue first to talk about it, though! Look at the links below if you're not sure how to open a PR.
|
||||
|
||||
## Submitting a pull request
|
||||
|
||||
1. [Fork][fork] and clone the repository.
|
||||
1. Configure and install the dependencies: `npm install`.
|
||||
1. Create a new branch following naming convention: `git checkout -b (feature|bufix|hotfix)/(short-description)(/issue-id)`.
|
||||
1. Make your change, test, and make sure BSManager work fine.
|
||||
1. Push to your fork and [submit a pull request][pr].
|
||||
1. Pat your self on the back and wait for your pull request to be reviewed and merged.
|
||||
|
||||
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
|
||||
|
||||
- Follow the [style guide][style] which is using standard.
|
||||
- Keep your changes as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
|
||||
|
||||
Work in Progress pull requests are also welcome to get feedback early on, or if there is something blocked you.
|
||||
@@ -1,76 +1,243 @@
|
||||
<p align="center">
|
||||
<a href="https://github.com/Zagrios/bs-manager">
|
||||
<img src="https://raw.githubusercontent.com/Zagrios/bs-manager/master/resources/readme/icon.svg" alt="logo" width="250px"/>
|
||||
</a>
|
||||
<h3 align="center">BSManager</h3>
|
||||
<p align="center">Simple and fancy tools that alow you to download, launch and manage BeatSaber versions, Maps and Mods easily and quickly.</p>
|
||||
</p>
|
||||
<a name="readme-top"></a>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://github.com/Zagrios/bs-manager/blob/master/resources/readme/beat-running.png?raw=true" width="130"/>
|
||||
</p>
|
||||
<!-- PROJECT SHIELDS -->
|
||||
<!--
|
||||
*** I'm using markdown "reference style" links for readability.
|
||||
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
|
||||
*** See the bottom of this document for the declaration of the reference variables
|
||||
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
|
||||
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
|
||||
-->
|
||||
|
||||
<details open="open">
|
||||
<summary>
|
||||
<h2>Table of Contents</h2>
|
||||
</summary>
|
||||
<ol>
|
||||
<li>
|
||||
<a href="#about-the-project">About The Project</a>
|
||||
<ul><li><a href="#built-with">Built With</a></li></ul>
|
||||
</li>
|
||||
<li><a href="#how-to-use">How To Use</a></li>
|
||||
<li><a href="#having-problems">Having problems?</a></li>
|
||||
<li><a href="#acknowledgements">Acknowledgements</a></li>
|
||||
</ol>
|
||||
</details>
|
||||
|
||||
<h2 id="about-the-project">About The Project</h2>
|
||||
<p>
|
||||
Have you ever wanted to switch between multiple BeatSaber version? To have a specific version for you and your friends, or for personal use and Streaming use? Have you ever wanted to manage easily <b>Maps</b> and <b>Mods</b> between versions? All of that in one place? <b>Then this program is made for you!</b>
|
||||
<br/><br/>
|
||||
BSManager is designed to download any BeatSaber version from Steam's depots, and launch it within the same program!<br>
|
||||
- You can install as many versions as you want, customize them to quickly differentiate them, clone them to separate the additional contents of the same version!<br>
|
||||
- You can clone and launch your Steam version from the program!<br/><br/>
|
||||
<b>In the near future</b><br/>
|
||||
- You can Create a master Maps folder and link it across all versions!<br/>
|
||||
- You can download Maps with "OneClick"!<br/>
|
||||
- You can download Maps from BSManager!<br/>
|
||||
- You can download and manage Mods for each versions!<br/>
|
||||
- And even more!
|
||||
</p>
|
||||
<h3 id="built-with">Built With</h3>
|
||||
<!-- TITLE -->
|
||||
<div align="center">
|
||||
<a href="https://github.com/Zagrios/bs-manager">
|
||||
<img src="resources/readme/icon.svg" alt="Logo" width="250" height="250">
|
||||
</a>
|
||||
<br><br>
|
||||
<h2><b>BSManager</b></h2>
|
||||
<i>(Beat Saber Manager)</i>
|
||||
<br><br>
|
||||
<span>
|
||||
Download, manage and customize your versions of Beat Saber with a simple click!
|
||||
</span>
|
||||
<br>
|
||||
<span>
|
||||
<a href="https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=bug&template=-bug--bug-report.md&title=%5BBUG%5D+%3A+">Report Bug</a>
|
||||
·
|
||||
<a href="https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=enhancement&template=-feat---feature-request.md&title=%5BFEAT.%5D+%3A+">Request Feature</a>
|
||||
·
|
||||
<a href="https://github.com/Zagrios/bs-manager/security/policy">Report a security vulnerability</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- BADGES -->
|
||||
---
|
||||
<br>
|
||||
<div align="center" >
|
||||
<a href="https://github.com/Zagrios/bs-manager/stargazers"><img src ="https://img.shields.io/github/stars/Zagrios/bs-manager?style=for-the-badge" alt="Stargazers"/></a>
|
||||
<a href="https://github.com/Zagrios/bs-manager/network/members"><img src ="https://img.shields.io/github/forks/Zagrios/bs-manager?style=for-the-badge" alt="Forks"/></a>
|
||||
<a href="https://github.com/Zagrios/bs-manager/blob/master/LICENSE"><img src ="https://img.shields.io/github/license/Zagrios/bs-manager?style=for-the-badge" alt="License"/></a>
|
||||
<a href="https://github.com/Zagrios/bs-manager/graphs/contributors"><img src ="https://img.shields.io/github/contributors/Zagrios/bs-manager?style=for-the-badge" alt="Contributors"/></a>
|
||||
<a href="https://github.com/Zagrios/bs-manager/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/Zagrios/bs-manager?style=for-the-badge"></a>
|
||||
<br>
|
||||
<a href="https://discord.gg/uSqbHVpKdV"><img src ="https://img.shields.io/badge/-DISCORD-5865f2?style=for-the-badge&logo=discord&logoColor=ffffff" alt="discord"/></a>
|
||||
<a href="https://www.patreon.com/bsmanager"><img src ="https://img.shields.io/badge/-🥰%20Support%20BSM-EC4546?style=for-the-badge" alt="Donation"/></a>
|
||||
<a href="https://twitter.com/BSManager_"><img src ="https://img.shields.io/badge/-Twitter-F5F8FA?style=for-the-badge&logo=Twitter" alt="Twitter"/></a>
|
||||
<br>
|
||||
[<a href="#readme-bot">Go to bottom</a>]
|
||||
</div>
|
||||
|
||||
---
|
||||
<!-- TABLE OF CONTENTS -->
|
||||
<b>Table of Contents</b>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/electron-react-boilerplate/electron-react-boilerplate">Electron React Boilerplate</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/SteamRE/DepotDownloader">DepotDownloader</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#about-the-project">About The Project</a>
|
||||
<ul>
|
||||
<li><a href="#built-with">Built With</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#usage">Usage</a></li>
|
||||
<ul>
|
||||
<li><a href="#how-to-install">How to install?</a></li>
|
||||
<li><a href="#manage-versions">Manage Versions</a></li>
|
||||
<li><a href="#customize-your-versions">Customize your versions</a></li>
|
||||
<li><a href="#install-mods">Install Mods</a></li>
|
||||
<li><a href="#install-maps">Install Maps</a></li>
|
||||
<li><a href="#one-click">One Click</a></li>
|
||||
<li><a href="#having-problems">Having problems?</a></li>
|
||||
</ul>
|
||||
<li><a href="#credits">Credits</a></li>
|
||||
<li><a href="#contributing">Contributing</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 id="how-to-use">How To Use</h2>
|
||||
<ul>
|
||||
<li>
|
||||
Download the latest release from <a href="https://github.com/Zagrios/bs-manager/releases">Releases</a>.
|
||||
</li>
|
||||
<li>Execute the installer and BSManager will start itself.</li>
|
||||
<li>Once its done if you want to download a version, select a version and download it!</li>
|
||||
<li>From the version page you can choose launch options, launch the version, and more from the dropdown menu!</li>
|
||||
</ul>
|
||||
<!-- ABOUT THE PROJECT -->
|
||||
<div align="center">
|
||||
<h1> </h1>
|
||||
<h1><b>About The Project</b></h1>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://github.com/Zagrios/bs-manager">BSManager</a> was created to unify and improve the two most used Apps in the community (<a href="https://github.com/RiskiVR/BSLegacyLauncher">BS legacy launcher</a> and <a href="https://github.com/Assistant/ModAssistant">Mod Assistant</a>).
|
||||
<br><br>
|
||||
<h4><a href="https://github.com/Zagrios/bs-manager">BSManager</a> will allow you to:</h4>
|
||||
<ul>
|
||||
<li><b>Manage multiple BeatSaber versions</b>, designed for people who need to play on different versions or have multiple profiles for the same version.</li>
|
||||
<li><b>Download your maps in the same way</b>, in addition to that, depending on your choice, maps are not version dependent. so you will be able to find your maps whatever version you are using without having to transfer them.</li>
|
||||
<li><b>Install your mods in one click</b>, just like <a href="https://github.com/Assistant/ModAssistant">Mod Assistant</a>, <a href="https://github.com/Zagrios/bs-manager">BSManager</a> will allow you to install your mods quickly and securely depending on the version you choose.</li>
|
||||
<li><b>Customize your interface</b>, we know that some of you like to customize your interfaces to the maximum. That's why <a href="https://github.com/Zagrios/bs-manager">BSManager</a> brings you peace of mind on this point, you can change the name of the versions, their color, and you can even change the color of the logo! Of course, a dark theme has been added to protect your eyes at night.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
<img src="resources/readme/preview.png" alt="preview">
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<h2 id="having-problems">Having problems?</h2>
|
||||
<p>
|
||||
See the <a href="https://github.com/Zagrios/bs-manager/issues">open issues</a> for a list of known issues, from there you can create a new issue for the problem you have!
|
||||
Otherwise you can add on to existing issues if one matches what you're encountering.
|
||||
</p>
|
||||
<h2 id="acknowledgements">Acknowledgement</h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/Zagrios">Zagrios</a> - Founder, Lead Developer & Project Lead</li>
|
||||
<li><a href="https://github.com/Iluhadesu">Iluhadesu</a> - Custom DepotDownloader Developer</li>
|
||||
<li><a href="https://github.com/GaetanGrd">Gaëtan Gerard</a> - Main Alpha Tester</li>
|
||||
</ul>
|
||||
<p align="center">
|
||||
<img src="https://github.com/Zagrios/bs-manager/blob/master/resources/readme/beat-conflict.png?raw=true" width="130"/>
|
||||
</p>
|
||||
<!--BUILT WITH-->
|
||||
<div>
|
||||
<h2><b>Built With</b></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://electron-react-boilerplate.js.org/"><img src="https://img.shields.io/badge/-Electron%20React%20Boilerplate-black?style=for-the-badge&logo=Electron" alt="Electron React Boilerplate"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://github.com/SteamRE/DepotDownloader"><img src="https://img.shields.io/badge/-Depot%20Downloader-2a475e?style=for-the-badge&logo=steam" alt="Depot Downloader"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://rxjs.dev/"><img src="https://img.shields.io/badge/-RxJs-purple?style=for-the-badge&logo=ReactiveX" alt="RxJs"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://tailwindcss.com/"><img src="https://img.shields.io/badge/-Tailwind%20CSS-white?style=for-the-badge&logo=Tailwind%20CSS" alt="TailWind CSS"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<!--USAGE-->
|
||||
<div align="center">
|
||||
<h1> </h1>
|
||||
<h1><b>Usage</b></h1>
|
||||
</div>
|
||||
|
||||
<!--HOW TO INSTALL?-->
|
||||
<div>
|
||||
<h2><b>How to install?</b></h2>
|
||||
<ul>
|
||||
<li>Download the <a href="https://github.com/Zagrios/bs-manager/releases/latest">latest release</a> from <a href="https://github.com/Zagrios/bs-manager/releases">Releases</a>.</li>
|
||||
<li>Execute the installer and <a href="../..">BSManager</a> will start itself.</li>
|
||||
<li>Once its done if you want to download a version, select a version and download it! </li>
|
||||
<li>From the version page you can choose options, launch the version, and more!</li>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<!--MANAGE VERSIONS-->
|
||||
<div>
|
||||
<h2><b>Manage Versions</b></h2>
|
||||
<span>
|
||||
<a href="https://github.com/Zagrios/bs-manager">BSManager</a> allows you to manage your versions of Beat Saber. It gives you the ability to download any version of Beat Saber as long as you have a Steam account that already owns the game. Using <a href="https://github.com/Zagrios/bs-manager">BSManager</a>, you can easily manage and update your collection of Beat Saber versions.
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213008824-25cfdda3-6350-42dc-aa53-2132b4b8e838.mov
|
||||
</div>
|
||||
|
||||
<!--CUSTOM UR VERSIONS-->
|
||||
<div>
|
||||
<h2><b>Customize your versions</b></h2>
|
||||
<span>
|
||||
<a href="https://github.com/Zagrios/bs-manager">BSManager</a> will allow you to completely customize each of your downloaded versions, you can change the color of the icon, choose a name for the version and finally install your mods,maps and other contents according to the Beat Saber version!
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213296794-74a1e20b-12dc-44ec-a67f-e25d7010bd3d.mov
|
||||
</div>
|
||||
|
||||
<!--INSTALL MODS-->
|
||||
<div>
|
||||
<h2><b>Install Mods</b></h2>
|
||||
<span>
|
||||
<a href="https://github.com/Zagrios/bs-manager">BSManager</a> allows you to manage Beat Saber mods in a quick and easy way. It uses the <a href="https://beatmods.com/#/">BeatMod API</a> to allow you to install, update or uninstall mods for each version of your collection. So the app can help you manage them efficiently.
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213296816-bdaafc90-da76-4835-8d83-9ac6a4e1c549.mov
|
||||
</div>
|
||||
|
||||
<!--INSTALL MAPS-->
|
||||
<div>
|
||||
<h2><b>Install Maps</b></h2>
|
||||
<span>
|
||||
In addition to managing mods, <a href="https://github.com/Zagrios/bs-manager">BSManager</a> allows you to manage and organize custom beatmaps existing on <a href="https://beatsaver.com">Beat Saver</a>, a popular site for sharing custom beatmaps for beat Saber. Moreover the app allow you to share your maps across all your versions.
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213296838-f775fe83-866d-4764-a7d0-648dbb8ec983.mov
|
||||
</div>
|
||||
|
||||
<!--ONE CLICK-->
|
||||
<div>
|
||||
<h2><b>One Click</b></h2>
|
||||
<span>
|
||||
The "One-Click" feature of <a href="https://github.com/Zagrios/bs-manager">BSManager</a> is an incredibly convenient feature for Beat Saber users. It allows easy and quick installation of models, maps and playlists for all versions of Beat Saber you own.
|
||||
</span>
|
||||
</div>
|
||||
<br>
|
||||
<div align="center">
|
||||
|
||||
https://user-images.githubusercontent.com/40648115/213435051-7feb815d-f32b-4135-b095-ef49726a836c.mov
|
||||
</div>
|
||||
|
||||
<!--HAVING PROBLEMS?-->
|
||||
<div>
|
||||
<h2><b>Having problems?</b></h2>
|
||||
<span>
|
||||
See the <a href="https://github.com/Zagrios/bs-manager/issues">open issues</a> to show the list of known issues, from there you can create a new issue for your problem!
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<br><br><br>
|
||||
|
||||
<!-- Credits -->
|
||||
<div>
|
||||
<h1><b>Credits</b></h1>
|
||||
<ul>
|
||||
<li><a href="https://github.com/Zagrios">Zagrios</a> - Founder & Lead Developer</li>
|
||||
<li><a href="https://github.com/Iluhadesu">Iluhadesu</a> - Project Team & Developpement help</li>
|
||||
<li><a href="https://github.com/GaetanGrd">GaetanGrd</a> - Project Team & Developpement help</li>
|
||||
<li><a href="https://github.com/cheddZy">cheddZy</a> - Icon creator</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Contributing -->
|
||||
<br>
|
||||
<!--CONTRIBUTING-->
|
||||
<div>
|
||||
<h1><b>Contributing</b></h1>
|
||||
<p>
|
||||
If you'd like to contribute, check out the <a href="https://github.com/Zagrios/bs-manager/blob/master/CONTRIBUTING.md">contributing guide</a>
|
||||
</p>
|
||||
<p>Thank you to all the people who already contributed to BSManager!</p>
|
||||
<div>
|
||||
<a href="https://github.com/Zagrios/bs-manager/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=Zagrios/bs-manager" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div align="right">
|
||||
[<a href="#readme-top">Return to top</a>]
|
||||
</div>
|
||||
|
||||
<h1> </h1>
|
||||
<a name="readme-bot"></a>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Reporting Security Issues
|
||||
|
||||
If you discover a security issue in BSManager, please report it by sending an
|
||||
email to [contact@bsmanager.io](mailto:contact@bsmanager.io).
|
||||
|
||||
This will allow us to assess the risk, and make a fix available before we add a
|
||||
bug report to the GitHub repository.
|
||||
|
||||
Thanks for helping make BSManager safe for everyone.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -509,5 +509,45 @@
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/d9ed8771498be7fc83721aaaaa5b15a08fbeadb1.png",
|
||||
"ReleaseDate": "1670943003",
|
||||
"year": "2022"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.28.0",
|
||||
"BSManifest": "7463243155526905423",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3666530358620442392",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans//32055887/8f978bbf292810004bca12523e76be8a7eec8c4e.png",
|
||||
"ReleaseDate": "1677593822",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.29.0",
|
||||
"BSManifest": "3341527958186345367",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/6169409105082976092",
|
||||
"ReleaseImg": "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans//32055887/255fd49cd96042b97089f754609be291293e783f.png",
|
||||
"ReleaseDate": "1680188760",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.29.1",
|
||||
"BSManifest": "886973241045584398",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/6169409105101272202",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/c328e407367e9914abaf92f609501877ee5abb63.png",
|
||||
"ReleaseDate": "1680623885",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.29.4",
|
||||
"BSManifest": "6291266771922375922",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3708194993422325380",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/9c3d476c03e4a2ac72ca5df016b7c94d242b41cb.png",
|
||||
"ReleaseDate": "1683644991",
|
||||
"year": "2023"
|
||||
},
|
||||
{
|
||||
"BSVersion": "1.30.0",
|
||||
"BSManifest": "7304715857122259127",
|
||||
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/3725085394628677636",
|
||||
"ReleaseImg": "https://cdn.akamai.steamstatic.com/steamcommunity/public/images/clans/32055887/cd56688ad716b544af14a61b2fbace9088478887.png",
|
||||
"ReleaseDate": "1684965390",
|
||||
"year": "2023"
|
||||
}
|
||||
]
|
||||
@@ -1,3 +1,12 @@
|
||||
[
|
||||
{"username": "Shidorien"}
|
||||
{"username": "Shidorien"},
|
||||
{"username": "iPixelGalaxy", "type": "diamond", "link": "https://twitch.tv/ipixelgalaxy"},
|
||||
{"username": "Emyte", "type": "gold"},
|
||||
{"username": "GoodOldNervy"},
|
||||
{"username": "Carbon", "type": "gold"},
|
||||
{"username": "Naysy"},
|
||||
{"username": "Falmil"},
|
||||
{"username": "K1Lc4m"},
|
||||
{"username": "Adam"},
|
||||
{"username": "Cabalia"}
|
||||
]
|
||||
@@ -0,0 +1,912 @@
|
||||
{
|
||||
"misc": {
|
||||
"download": "Laden",
|
||||
"add": "Hinzufügen",
|
||||
"verify": "Prüfen",
|
||||
"launch": "Starten",
|
||||
"mods": "Mods",
|
||||
"maps": "Maps",
|
||||
"playlists": "Playlisten",
|
||||
"models": "Modelle",
|
||||
"cancel": "Abbruch",
|
||||
"delete": "Löschen",
|
||||
"accept": "Akzeptieren",
|
||||
"refuse": "Ablehnen",
|
||||
"apply": "Übernehmen",
|
||||
"copy": "Kopieren",
|
||||
"copied": "Kopiert!"
|
||||
},
|
||||
"nav-bar":{
|
||||
"add-version": "Version Hinzufügen",
|
||||
"settings": "Einstellungen",
|
||||
"shared": {
|
||||
"text": "Geteilt",
|
||||
"tooltip": "Geteilte Inhalte"
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps":{
|
||||
"title": "Geteilte Maps"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Oculus Modus",
|
||||
"oculus-description": "Wenn du Beat Saber über Steam benutzt, es ermöglicht dir Oculus's VR-Composer zu nutzen ohne SteamVR, um bessere Leistung zu erhalten. Dies wird nicht benötigt für Oculus Headsets",
|
||||
"desktop": "Desktop Modus",
|
||||
"desktop-description": "Auf diese Weise kannst du WASD und die Maus verwenden, um im Spiel durch das Menü zu navigieren. Dies erleichtert das Testen erheblich, da Du dein Headset nicht aufsetzen musst!",
|
||||
"debug": "Debug Modus",
|
||||
"debug-description": "Aktiviert das Ausgabeprotokollfenster für IPA. Dies zeigt die Debug-Konsole, die Mods verwenden.",
|
||||
"advanced-launch": {
|
||||
"button": "Erweiterter Start",
|
||||
"placeholder": "Weitere Argumente Bspw: --revert; --nowait"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"title": "Geteilte Maps",
|
||||
"search-bar": {
|
||||
"search-placeholder": "Suche eine Map",
|
||||
"filters-btn": "Filter",
|
||||
"dropdown": {
|
||||
"export-maps": "Maps Exportieren",
|
||||
"delete-maps": "Maps Löschen"
|
||||
}
|
||||
},
|
||||
"tabs": {
|
||||
"maps": {
|
||||
"actions": {
|
||||
"add-maps": {
|
||||
"text": "Hinzufügen"
|
||||
},
|
||||
"link-maps": {
|
||||
"tooltips": {
|
||||
"link": "Maps Verknüpfen",
|
||||
"unlink": "Maps Verknüpfung aufheben"
|
||||
}
|
||||
}
|
||||
},
|
||||
"empty-maps":{
|
||||
"text":"Keine Maps",
|
||||
"button":"Maps Herunterladen"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"mods": {
|
||||
"loading-mods": "Lade Mods...",
|
||||
"no-internet": "Kein Internet",
|
||||
"mods-not-available": "Für diese Version von Beat Saber sind noch keine Mods verfügbar",
|
||||
"buttons": {
|
||||
"more-infos": "Mehr Infos",
|
||||
"install-or-update": "Installieren oder aktualisieren"
|
||||
},
|
||||
"mods-grid": {
|
||||
"header-bar": {
|
||||
"name": "Name",
|
||||
"installed": "Installiert",
|
||||
"latest": "Neueste",
|
||||
"description": "Beschreibung",
|
||||
"dropdown": {
|
||||
"uninstall-all": "Alle deinstallieren"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dropdown": {
|
||||
"open-folder": "Ordner Öffnen",
|
||||
"verify-files": "Daten Prüfen",
|
||||
"clone": "Klonen",
|
||||
"edit": "Bearbeiten",
|
||||
"uninstall": "Entfernen",
|
||||
"shared-folders": "Geteilte Ordner"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
"title": "Wähle eine Version",
|
||||
"steam-release": "Versions Seite",
|
||||
"dropdown": {
|
||||
"refresh": "Liste aktualisieren",
|
||||
"import-version" :"Importiere eine Version"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"steam": {
|
||||
"title": "Steam",
|
||||
"description": "Wenn Du dich von Steam abmeldest, musst Du dich erneut anmelden, um eine neue Version von Beat Saber herunterzuladen.",
|
||||
"logout": "Abmelden"
|
||||
},
|
||||
"appearance": {
|
||||
"title": "Aussehen",
|
||||
"description": "Wähle Zwei von den Hauptfarben von BSManager",
|
||||
"reset": "Zurücksetzen",
|
||||
"sub-title": "Design",
|
||||
"themes": {
|
||||
"dark": "Dunkel",
|
||||
"light": "Hell",
|
||||
"os": "Mit Computer Synchronisieren"
|
||||
}
|
||||
},
|
||||
"installation-folder": {
|
||||
"title": "Installations Ordner",
|
||||
"description": "Ändern Sie den Standardordner für Beat Saber-Versionen und andere kommende Funktionen.",
|
||||
"choose-folder": "Ordner Wählen"
|
||||
},
|
||||
"additional-content": {
|
||||
"title": "Zusätzlicher Inhalt",
|
||||
"description": "Mit zusätzlichen Inhalten kannst du BeatSaber anpassen!",
|
||||
"deep-links": {
|
||||
"sub-title": "OneClick-Installationen"
|
||||
}
|
||||
},
|
||||
"language": {
|
||||
"title": "Sprache",
|
||||
"description": "Wähle eine Sprache.",
|
||||
"languages": {
|
||||
"en-EN": "English, UK",
|
||||
"en-US": "English, US",
|
||||
"fr-FR": "Français",
|
||||
"es-ES": "Español",
|
||||
"de-DE": "Deutsch",
|
||||
"translated": {
|
||||
"en-EN": "Englisch, Vereinigtes Königreich",
|
||||
"en-US": "Englisch, USA",
|
||||
"fr-FR": "Französisch",
|
||||
"es-ES": "Spanisch",
|
||||
"de-DE": "Deutsch"
|
||||
}
|
||||
}
|
||||
},
|
||||
"patreon": {
|
||||
"title": "BSManager Unterstützen 💖",
|
||||
"description": "Unterstütze das Projekt und helfe uns, BSManager kontinuierlich zu verbessern.",
|
||||
"buttons": {
|
||||
"support": "BSManager Unterstützen 🥰",
|
||||
"supporters": "Unterstützer 👀"
|
||||
},
|
||||
"view": {
|
||||
"no-supporters": "Noch keine Unterstützer",
|
||||
"sponsors": "Sponsoren",
|
||||
"supporters": "Unterstützer"
|
||||
}
|
||||
},
|
||||
"discord": {
|
||||
"description": "Trete der BSManager-Community bei, indem Du uns in unseren sozialen Medien folgst!"
|
||||
},
|
||||
"contribution": {
|
||||
"description": "Schlage neue Funktionen vor, oder melde einen Fehler und BSManager zu verbessern!",
|
||||
"buttons": {
|
||||
"request-features": "Funktion Vorschlagen",
|
||||
"report-bug": "Fehler melden",
|
||||
"open-logs": "Protokolle öffnen"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"notifications": {
|
||||
"types": {
|
||||
"error": "🚨 Fehler",
|
||||
"warning": "⚠️ Warnung",
|
||||
"success": "🎉 Erfolg"
|
||||
},
|
||||
"common": {
|
||||
"msg": {
|
||||
"error-occurred": "Ein Fehler ist aufgetreten"
|
||||
}
|
||||
},
|
||||
"shared": {
|
||||
"errors": {
|
||||
"titles": {
|
||||
"operation-running": "Vorgang läuft",
|
||||
"no-internet": "Kein Internet"
|
||||
},
|
||||
"msg": {
|
||||
"operation-running": "Warte auf das Ende des Aktuellen Vorgangs und versuche es erneut",
|
||||
"no-internet": "Überprüfe deine Verbindung und versuche es erneut."
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs-download": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"download-success": "Erfolgreich Heruntergeladen",
|
||||
"verification-finished": "Verifikation Erfolgreich"
|
||||
}
|
||||
},
|
||||
"warnings": {
|
||||
"msg": {
|
||||
"ManifestChecksum": "Die zuvor heruntergeladene Manifest stimmt nicht mit dem neuen überein 🤔",
|
||||
"ConnectionTimeout": "Deine Internetverbindung scheint instabil zu sein 🥶",
|
||||
"ConnectionLost": "Die Verbindung wurde unterbrochen, versuche es erneut...",
|
||||
"ConnectionError": "Kann keine Verbindung zu Steam herstellen, versuche es erneut...",
|
||||
"Unknown": "Etwas Seltsames ist passiert 🤔 Deine Verbindung ist wahrscheinlich instabil."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"titles":{
|
||||
"dotnet-required": ".NET 6 Benötigt"
|
||||
},
|
||||
"msg": {
|
||||
"401": "Steam scheint uns BeatSaber nicht herunterladen zu lassen 😢",
|
||||
"404": "Steam-Server können nicht kontaktiert werden.",
|
||||
"Password": "Passwort ist ungültig.",
|
||||
"InvalidCredentials": "Deine E-Mail oder Passwort ist ungültig 😴",
|
||||
"InvalidPassword": "Dein Passwort ist ungültig 😕",
|
||||
"NoManifest": "Es wurde keine Manifest gefunden",
|
||||
"DirectoryCreate": "Die erforderlichen Ordner können nicht installiert werden.",
|
||||
"NotAvailableApp": "Versuchst du, Beat Saber herunterzuladen, wenn Du es nicht hast? 🤣",
|
||||
"DepotNotFound": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
|
||||
"NotCompleted": "Der Download konnte nicht beendet werden ¯\\_(ツ)_/¯",
|
||||
"InvalidManifest": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
|
||||
"NoValidKey": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
|
||||
"NoManifestCode": "BeatSaber kann nicht heruntergeladen werden 😥 versuche es später noch einmal 😕",
|
||||
"Unknown": "Ein Unbekannter Fehler ist aufgetreten ¯\\_(ツ)_/¯",
|
||||
"NoServer": "Steam-Server können nicht kontaktiert werden.",
|
||||
"NotAllowed": "Anscheinend darfst Du BeatSaber nicht herunterladen 🥱",
|
||||
"ConnectionTimeout": "Kann keine Verbindung zu Steam herstellen 😕",
|
||||
"SteamLib": "Wenn dieser Fehler auftritt, melde den Fehler auf Github mit Protokollen, bitte.",
|
||||
"ConnectionError": "Kann nach 10 Versuchen keine Verbindung zu Steam herstellen 🤯",
|
||||
"LicenceError": "Die Liste der Lizenzen kann nicht abgerufen werden.",
|
||||
"verification-failed": "Verifikation fehlgeschlagen, versuche es später erneut.",
|
||||
"RateLimitExceeded": "Du hast es zu oft versucht, warte eine Weile und versuche es später erneut.",
|
||||
"AlreadyDownloading": "Ein Download ist bereits im Gange",
|
||||
"no-internet": "Keine Internet Verbindung",
|
||||
"dotnet-required": ".NET 6 Runtime muss installiert sein, um eine Version von BeatSaber herunterzuladen. Lade es herunter, indem Du auf die Schaltfläche unten klickst."
|
||||
},
|
||||
"actions":{
|
||||
"download-dotnet": ".NET 6 Herunterladen"
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs-import-version":{
|
||||
"success":{
|
||||
"start-import": {
|
||||
"title": "Import im Gange 👌",
|
||||
"desc": "Der Import kann je nach Konfiguration einige Minuten dauern."
|
||||
},
|
||||
"imported": {
|
||||
"title": "Versionen Importiert 🎉"
|
||||
}
|
||||
},
|
||||
"errors":{
|
||||
"import-error":{
|
||||
"desc": "Überprüfe, ob der ausgewählte Ordner eine BeatSaber-Installation ist."
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"move-folder": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"transfer-started": "Übertragung läuft",
|
||||
"transfer-finished": "Transfer abgeschlossen"
|
||||
},
|
||||
"descs": {
|
||||
"transfer-started": "Die Übertragung hat begonnen und kann je nach Konfiguration mehrere Minuten dauern."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"titles": {
|
||||
"transfer-failed": "Transfer fehlgeschlagen 😕"
|
||||
},
|
||||
"descs": {
|
||||
"COPY_TO_SUBPATH": "Der Zielordner darf kein Unterordner des Quellordners sein.",
|
||||
"restore-linked-folders": "Beim Wiederherstellen von freigegebenen Ordnern ist ein Fehler aufgetreten. Du kannst sie dennoch manuell über das Menü 'Freigegebene Ordner' auf der Versionsseite wiederherstellen."
|
||||
}
|
||||
}
|
||||
},
|
||||
"steam": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"logout": "Von Steam getrennt."
|
||||
}
|
||||
}
|
||||
},
|
||||
"additional-content":{
|
||||
"deep-link": {
|
||||
"select-all": "Alle Auswählen",
|
||||
"activation":{
|
||||
"success":{
|
||||
"title":"OneClick aktiviert!",
|
||||
"description":"OneClick-Installationen wurden aktiviert."
|
||||
},
|
||||
"error":{
|
||||
"description":"OneClick-Installationen konnten nicht aktiviert werden."
|
||||
}
|
||||
},
|
||||
"deactivation":{
|
||||
"success":{
|
||||
"title":"OneClick deaktiviert!",
|
||||
"description":"OneClick-Installationen wurden deaktiviert."
|
||||
},
|
||||
"error":{
|
||||
"description":"Ein Unbekannter Fehler ist aufgetreten."
|
||||
}
|
||||
},
|
||||
"check-all-enabled":{
|
||||
"title": "OneClick deaktiviert",
|
||||
"description": "Eine oder mehrere OneClick-Installationen sind deaktiviert. Gehe in die Einstellungen, um sie zu aktivieren.",
|
||||
"actions":{
|
||||
"settings": "Einstellungen",
|
||||
"not-remind": "Erinnere mich nicht"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs-launch": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"launching": "Starte...🚀"
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"titles": {
|
||||
"UNABLE_TO_LAUNCH": "Start nicht möglich",
|
||||
"STEAM_NOT_RUNNING": "Steam läuft nicht",
|
||||
"OCULUS_NOT_RUNNING": "Oculus läuft nicht",
|
||||
"BS_ALREADY_RUNNING": "BeatSaber läuft bereits",
|
||||
"EXE_NOT_FINDED": "Dateien Fehlen",
|
||||
"EXIT": "Abrupter Stop"
|
||||
},
|
||||
"msg": {
|
||||
"STEAM_NOT_RUNNING": "Steam muss laufen, um BeatSaber zu starten.",
|
||||
"OCULUS_NOT_RUNNING": "Oculus muss ausgeführt werden, um BeatSaber zu starten.",
|
||||
"BS_ALREADY_RUNNING": "Schließe BeatSaber, bevor Du es erneut startest.",
|
||||
"EXE_NOT_FINDED": "Einige Dateien scheinen zu fehlen, versuche die Dateien zu überprüfen.",
|
||||
"EXIT": "BeatSaber stoppte abrupt, versuche die Dateien zu überprüfen."
|
||||
},
|
||||
"actions":{
|
||||
"STEAM_NOT_RUNNING": "Starte Steam"
|
||||
}
|
||||
}
|
||||
},
|
||||
"steam":{
|
||||
"steam-launching":{
|
||||
"title": "Steam startet!",
|
||||
"description": "Abhängig von deiner Konfiguration kann es einige Zeit dauern, bis Steam gestartet wird."
|
||||
}
|
||||
},
|
||||
"custom-version": {
|
||||
"errors": {
|
||||
"titles": {
|
||||
"CantEditSteam": "Kann nicht bearbeitet werden",
|
||||
"CantRename": "Umbenennen unmöglich",
|
||||
"VersionAlreadExist": "Diese Version existiert bereits",
|
||||
"CantClone": "Klonen unmöglich"
|
||||
},
|
||||
"msg": {
|
||||
"CantEditSteam": "Die Steam-Version kann nicht bearbeitet werden. Du kannst es aber klonen."
|
||||
}
|
||||
},
|
||||
"success": {
|
||||
"titles": {
|
||||
"CloningFinished": "Klonen abgeschlossen 🎉"
|
||||
}
|
||||
}
|
||||
},
|
||||
"mods": {
|
||||
"install-mods": {
|
||||
"titles": {
|
||||
"success": "Mods Installiert 🎉",
|
||||
"warning": "Mods Installiert 🤔"
|
||||
},
|
||||
"msg": {
|
||||
"success": "Alle Mods wurden installiert.",
|
||||
"warning": "Eine oder mehr Mods konnten nicht installiert werden.",
|
||||
"errors": {
|
||||
"no-mods": "Keine Mods zum installieren.",
|
||||
"cannot-install-bsipa": "BSIPA installation fehlgeschlagen 😨"
|
||||
}
|
||||
}
|
||||
},
|
||||
"uninstall-mod": {
|
||||
"titles": {
|
||||
"success": "Mod entfernt 🎉"
|
||||
},
|
||||
"msg": {
|
||||
"errors": {
|
||||
"no-mods": "Diese Mod kann nicht installiert werden 😑"
|
||||
}
|
||||
}
|
||||
},
|
||||
"uninstall-all-mods": {
|
||||
"titles": {
|
||||
"success": "Mods entfernt 🎉"
|
||||
},
|
||||
"msg": {
|
||||
"success": "Alle Mods wurden entfernt.",
|
||||
"errors": {
|
||||
"no-mods": "Keine Mods sind in dieser Version installiert 😑"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"maps":{
|
||||
"one-click-install":{
|
||||
"success":"Map installation abegschlossen",
|
||||
"error":"Ein Fehler ist aufgetreten während der installation der Map"
|
||||
}
|
||||
},
|
||||
"playlists":{
|
||||
"one-click-install":{
|
||||
"success":"Playlist installation abgeschlossen",
|
||||
"error":"Ein Fehler ist aufgetreten während der installation der Playlist"
|
||||
}
|
||||
},
|
||||
"models":{
|
||||
"one-click-install":{
|
||||
"success":"Modell installation abgeschlossen",
|
||||
"error":"Ein Fehler ist aufgetreten während der installation des Modells"
|
||||
}
|
||||
},
|
||||
"shared-folder": {
|
||||
"info": {
|
||||
"userdata-backup-created":{
|
||||
"title": "Sicherung erstellt",
|
||||
"msg": "Das Freigeben des Ordners „UserData“ kann zu Fehlern führen. Bei Problemen trenne den Ordner, um die Sicherung wiederherzustellen"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
"misc":{
|
||||
"remember-my-choice": "Merke meine Wahl"
|
||||
},
|
||||
"guard": {
|
||||
"title": "Steam Guard",
|
||||
"inputs": {
|
||||
"guard-code": {
|
||||
"label": "Guard-Code",
|
||||
"placeholder": "Gebe deinen Guard-Code ein"
|
||||
}
|
||||
},
|
||||
"buttons": {
|
||||
"submit": "Anmelden"
|
||||
}
|
||||
},
|
||||
"steam-login": {
|
||||
"title": "Steam Login",
|
||||
"inputs": {
|
||||
"username": {
|
||||
"label": "Nutzername",
|
||||
"placeholder": "Gebe deinen Nutzernamen ein"
|
||||
},
|
||||
"password": {
|
||||
"label": "Passwort",
|
||||
"placeholder": "Gebe dein Passwort ein",
|
||||
"max-length-warning": "Das Passwort überschreitet 64 Zeichen! Wenn das Passwort ungültig ist, versuchen Sie nur die ersten 64 Zeichen einzugeben."
|
||||
},
|
||||
"stay": {
|
||||
"label": "Verbunden bleiben"
|
||||
}
|
||||
},
|
||||
"why-credentials": "Warum braucht ihr meine Anmeldeinformationen?",
|
||||
"buttons": {
|
||||
"submit": "Anmelden"
|
||||
}
|
||||
},
|
||||
"steam-credentials":{
|
||||
"title": "Steam Anmeldeinformationen",
|
||||
"p-1": "Die Anmeldeinformationen werden nur zum Herunterladen des Spiels verwendet, da Steam überprüfen muss, ob Du das Spiel bezahlt hast, um es herunterladen zu dürfen. Sie werden nicht gespeichert und direkt an DepotDownloader weitergegeben. Wenn Du deine Anmeldeinformationen nicht eingeben möchtest, kannst Du diesem Tutorial folgen:",
|
||||
"p-2": "und klicke dann auf das Zahnradsymbol in der oberen rechten Ecke und wähle \"Version importieren\", wähle den Ordner aus, in den Beat Saber heruntergeladen wurde (Wenn Du dem obigen Tutorial folgst, solltest Du den richtigen Speicherort haben)"
|
||||
},
|
||||
"bs-import-version":{
|
||||
"title": "Importiere eine Version",
|
||||
"description": "Importiert eine Version von BeatSaber zur Verwendung mit BSManager. Der Import kopiert den ausgewählten BeatSaber-Installationsordner in den BSManager-Versionsordner.",
|
||||
"buttons":{
|
||||
"submit": "Importiere eine Version"
|
||||
}
|
||||
},
|
||||
"bs-uninstall": {
|
||||
"title": "Deinstallieren",
|
||||
"description": "Möchtest du BeatSaber {version} wirklich deinstallieren? Du musst es erneut herunterladen, um es zu spielen.",
|
||||
"buttons": {
|
||||
"submit": "Deinstallieren"
|
||||
}
|
||||
},
|
||||
"install-folder": {
|
||||
"title": "Installation Ordner",
|
||||
"description": "Das Ändern des Standardinstallationsordners führt dazu, dass alle installierten Daten in den neuen Ordner verschoben werden.",
|
||||
"buttons": {
|
||||
"submit": "Ordner Wählen"
|
||||
}
|
||||
},
|
||||
"edit-version": {
|
||||
"title": "Version ändern",
|
||||
"buttons": {
|
||||
"submit": "Ändern"
|
||||
}
|
||||
},
|
||||
"clone-version": {
|
||||
"title": "Version Klonen",
|
||||
"description": "Durch das Klonen der Version kannst Du zusätzlichen BeatSaber-Inhalt zwischen zwei Versionen trennen.",
|
||||
"inputs": {
|
||||
"name": {
|
||||
"label": "Name",
|
||||
"placeholder": "Versions Name"
|
||||
},
|
||||
"color": {
|
||||
"label": "Farbe"
|
||||
}
|
||||
},
|
||||
"buttons": {
|
||||
"submit": "Klonen"
|
||||
}
|
||||
},
|
||||
"uninstall-mod": {
|
||||
"title": "Entfernen",
|
||||
"description": "Bist du sicher das du die Mod {mod} entfernen möchtest? Es könnte dafür sorgen, dass andere installationen nicht mehr richtig funktionieren.",
|
||||
"description-bsipa": "Bist du sicher, dass du BSIPA entfernen möchtest? Dannach werden deine Mods nicht mehr funktionieren."
|
||||
},
|
||||
"uninstall-all-mods": {
|
||||
"title": "Entferne Alle Mods",
|
||||
"description": "Bist du sicher das du alle Mods von der Version {version} entfernen möchtest? Diese Aktion kann nicht rückgängig gemacht werden."
|
||||
},
|
||||
"maps-actions": {
|
||||
"delete-maps": {
|
||||
"title": {
|
||||
"single": "Map Entfernen?",
|
||||
"multiple": "Maps Entfernen?"
|
||||
},
|
||||
"desc": {
|
||||
"single": "Bist du sicher das du die Map {name} entfernen willst?",
|
||||
"multiple": "Bist du sicher das du alle {nb} maps entfernen willst?"
|
||||
},
|
||||
"info": {
|
||||
"desc": {
|
||||
"single": "Diese Map ist teil der geteilten Maps",
|
||||
"multiple": "Diese Maps sind teil der geteilten Maps"
|
||||
},
|
||||
"title": {
|
||||
"single": "Diese Map wird auch aus Versionen entfernt, die geteilte Maps verwenden",
|
||||
"multiple": "Diese Maps werden auch aus Versionen entfernt, die geteilte Maps verwenden"
|
||||
}
|
||||
}
|
||||
},
|
||||
"link-maps": {
|
||||
"title": "Maps Verknüpfen",
|
||||
"desc": "Das Verknüpfen von Maps ermöglicht es, Maps zwischen allen Versionen zu teilen. Nach der Verknüpfung profitiert diese Version von den geteilten Maps",
|
||||
"info": "Das Hinzufügen und Löschen von Maps wird ebenfalls geteilt",
|
||||
"keep-maps": {
|
||||
"label": "Maps behalten",
|
||||
"title": "Maps behalten verschiebt die Maps der aktuellen Version in den geteilten Maps. Andernfalls gehen sie verloren."
|
||||
},
|
||||
"valid-btn": "Maps Verknüpfen"
|
||||
},
|
||||
"unlink-maps": {
|
||||
"title": "Maps Verknüpfung aufheben",
|
||||
"desc": "Bitte beachte, dass das Aufheben der Verknüpfung von Maps die Verwendung von geteilten Maps für diese Version nicht zulässt.",
|
||||
"keep-maps": {
|
||||
"label": "Maps behalten",
|
||||
"title": "Maps behalten verschiebt die Maps der aktuellen Version in den geteilten Maps. Andernfalls gehen sie verloren."
|
||||
},
|
||||
"valid-btn": "Verknüpfung aufheben"
|
||||
}
|
||||
},
|
||||
"download-maps": {
|
||||
"search-btn": "Suchen",
|
||||
"loading-maps": "Lade Maps...",
|
||||
"no-maps-found": "Keine Maps gefunden",
|
||||
"no-internet": "Kein Internet"
|
||||
},
|
||||
"mods-disclaimer":{
|
||||
"title": "Haftungsausschluss",
|
||||
"p-1": "Indem Du dich für die Verwendung von Mods entscheiden, verstehst Du Folgendes:",
|
||||
"li-1": "Möglicherweise treten Probleme auf, die im Vanilla-Spiel nicht vorhanden sind. 99.9% der Fehler, Abstürze und Verzögerungen sind auf Mods zurückzuführen.",
|
||||
"li-2": "Mods können durch Updates beschädigt werden und das ist normal - sei geduldig und respektvoll, wenn dies passiert, da Modder Freiwillige mit echtem Leben sind.",
|
||||
"li-3": "Beat Games versuchen nicht absichtlich, Mods kaputt zu machen. Sie möchten an der Codebasis arbeiten und manchmal macht dies Mods kaputt, aber sie sind nicht darauf aus, Mods zu verbieten.",
|
||||
"p-2": "Greife die Spieleentwickler nicht wegen Problemen im Zusammenhang mit Mods an und umgekehrt - Modder und Spieleentwickler sind zwei getrennte Gruppen. Sei einfach nicht gemein, okay?"
|
||||
},
|
||||
"shared-folders":{
|
||||
"title": "Geteilte Ordner",
|
||||
"description": "Verknüpfe BeatSaber-Ordner, um ihre Inhalte mit freigegebenen Ordnern in anderen Versionen zu synchronisieren. Beachte, dass auch das Löschen von Inhalten geteilt wird.",
|
||||
"buttons": {
|
||||
"add-folder": "Ordner Hinzufügen",
|
||||
"link-folder": "Ordner Verknüpfen",
|
||||
"unlink-folder": "Ordner Verknüpfung Aufheben",
|
||||
"link-all": "Alle verlinken"
|
||||
}
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"map-filter-panel": {
|
||||
"duration": "Länge",
|
||||
"tags": "Stichworte",
|
||||
"specificities": "Allgemein",
|
||||
"requirements": "Anforderungen"
|
||||
},
|
||||
"map-types": {
|
||||
"accuracy": "Präzision",
|
||||
"balanced": "Ausgeglichen",
|
||||
"challenge": "Herausforderung",
|
||||
"dancestyle": "Tanz",
|
||||
"fitness": "Fitness",
|
||||
"speed": "Geschwindigkeit",
|
||||
"tech": "Tech"
|
||||
},
|
||||
"map-styles": {
|
||||
"dance": "Tanz",
|
||||
"swing": "Swing",
|
||||
"nightcore": "Nightcore",
|
||||
"folk": "Folk",
|
||||
"family": "Familie",
|
||||
"ambient": "umgebung",
|
||||
"funk": "Funk",
|
||||
"jazz": "Jazz",
|
||||
"soul": "Soul",
|
||||
"speedcore": "Speedcore",
|
||||
"punk": "Punk",
|
||||
"rb": "R&B",
|
||||
"holiday": "Urlaub",
|
||||
"vocaloid": "Vokaloid",
|
||||
"jrock": "J-Rock",
|
||||
"trance": "Trance",
|
||||
"drumbass": "Basstrommel",
|
||||
"comedy": "Komödie",
|
||||
"instrumental": "Instrumental",
|
||||
"hardcore": "Hardcore",
|
||||
"kpop": "K-Pop",
|
||||
"indie": "Indie",
|
||||
"techno": "Techno",
|
||||
"house": "House",
|
||||
"game": "Videospiele",
|
||||
"film": "Filme",
|
||||
"alt": "Alternativ",
|
||||
"dubstep": "Dubstep",
|
||||
"metal": "Metal",
|
||||
"anime": "Anime",
|
||||
"hiphop": "HipHop",
|
||||
"jpop": "J-Pop",
|
||||
"rock": "Rock",
|
||||
"pop": "Pop",
|
||||
"electronic": "Elektronisch",
|
||||
"classical-orchestral": "Klassisch & Orchestra"
|
||||
},
|
||||
"map-specificities": {
|
||||
"automapper": "KI",
|
||||
"ranked": "ranked",
|
||||
"curated": "curated",
|
||||
"verified": "verifiziert",
|
||||
"fullSpread": "full spread"
|
||||
},
|
||||
"difficulties": {
|
||||
"Easy": "einfach",
|
||||
"Normal": "normal",
|
||||
"Hard": "hard",
|
||||
"Expert": "expert",
|
||||
"ExpertPlus": "expert+"
|
||||
},
|
||||
"map-item": {
|
||||
"by": "Von {songAutor}",
|
||||
"mapped-by": "Gemapped von"
|
||||
}
|
||||
},
|
||||
"models":{
|
||||
"types": {
|
||||
"singular": {
|
||||
"avatar": "Avatar",
|
||||
"saber": "Säbel",
|
||||
"platform": "Plattform",
|
||||
"bloq": "Block"
|
||||
},
|
||||
"plural": {
|
||||
"avatar": "Avatare",
|
||||
"saber": "Säbel",
|
||||
"platform": "Plattformen",
|
||||
"bloq": "Blöcke"
|
||||
}
|
||||
},
|
||||
"sorts": {
|
||||
"name": "Name",
|
||||
"date": "Datum",
|
||||
"author": "Autor"
|
||||
},
|
||||
"panel": {
|
||||
"actions": {
|
||||
"search": "Ein Modell suchen",
|
||||
"drop-down": {
|
||||
"delete": "Modelle löschen",
|
||||
"export": "Modelle exportieren"
|
||||
},
|
||||
"link-models": "Modelle verlinken",
|
||||
"unlink-models": "Modelle trennen"
|
||||
},
|
||||
"grid":{
|
||||
"loading": "Modelle laden...",
|
||||
"no-models": "Keine Modelle",
|
||||
"download-models": "Modelle herunterladen"
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
"delete-model" :{
|
||||
"title": "Das Modell löschen",
|
||||
"desc": "Sind Sie sicher, dass Sie das Modell {modelName} löschen möchten?",
|
||||
"linked-annotation": "Dieses Modell wird aus allen verlinkten Versionen entfernt."
|
||||
},
|
||||
"delete-models": {
|
||||
"title": "Modelle löschen",
|
||||
"desc": "Sind Sie sicher, dass Sie die {nb} Modelle löschen möchten?",
|
||||
"linked-annotation": "Diese Modelle werden aus allen verlinkten Versionen entfernt."
|
||||
},
|
||||
"download-models": {
|
||||
"search-btn": "Suche",
|
||||
"search-placeholder": "Ein Modell suchen",
|
||||
"search-tips": {
|
||||
"header": {
|
||||
"tag": "Tag",
|
||||
"desc": "Beschreibung"
|
||||
},
|
||||
"author-desc": "Nur Modelle vom angegebenen Autor anzeigen.",
|
||||
"hash-desc": "Nur Modelle mit dem angegebenen Hash anzeigen.",
|
||||
"tag-desc": "Nur Modelle mit dem angegebenen Tag anzeigen.",
|
||||
"name-desc": "Nur Modelle mit dem angegebenen Namen anzeigen.",
|
||||
"discordid-desc": "Nur Modelle vom angegebenen Discord-Benutzer anzeigen.",
|
||||
"status-desc": "Nur Modelle mit dem angegebenen Status anzeigen. (nur Profil, und nur für den Autor)"
|
||||
},
|
||||
"no-models": "Keine Modelle gefunden.",
|
||||
"no-internet": "Keine Internetverbindung.",
|
||||
"error-occured": "Ein Fehler ist aufgetreten, versuche es später erneut."
|
||||
},
|
||||
"link-models": {
|
||||
"avatar": {
|
||||
"title": "Avatare verbinden",
|
||||
"desc": "Das Verbinden von Avataren ermöglicht das Teilen von Avataren zwischen allen Versionen. Sobald verbunden, wird diese Version von den geteilten Avataren profitieren",
|
||||
"info": "Das Hinzufügen und Entfernen von Avataren wird ebenfalls geteilt",
|
||||
"keep-models": {
|
||||
"label": "Avatare behalten",
|
||||
"title": "Das Behalten der Avatare wird die Avatare der aktuellen Version in den Ordner der geteilten Avatare verschieben. Andernfalls gehen sie verloren"
|
||||
},
|
||||
"valid-btn": "Avatare verbinden"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Säbel verbinden",
|
||||
"desc": "Das Verbinden von Säbeln ermöglicht das Teilen von Säbeln zwischen allen Versionen. Sobald verbunden, wird diese Version von den geteilten Säbeln profitieren",
|
||||
"info": "Das Hinzufügen und Entfernen von Säbeln wird ebenfalls geteilt",
|
||||
"keep-models": {
|
||||
"label": "Säbel behalten",
|
||||
"title": "Das Behalten der Säbel wird die Säbel der aktuellen Version in den Ordner der geteilten Säbel verschieben. Andernfalls gehen sie verloren"
|
||||
},
|
||||
"valid-btn": "Säbel verbinden"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Plattformen verbinden",
|
||||
"desc": "Das Verbinden von Plattformen ermöglicht das Teilen von Plattformen zwischen allen Versionen. Sobald verbunden, wird diese Version von den geteilten Plattformen profitieren",
|
||||
"info": "Das Hinzufügen und Entfernen von Plattformen wird ebenfalls geteilt",
|
||||
"keep-models": {
|
||||
"label": "Plattformen behalten",
|
||||
"title": "Das Behalten der Plattformen wird die Plattformen der aktuellen Version in den Ordner der geteilten Plattformen verschieben. Andernfalls gehen sie verloren"
|
||||
},
|
||||
"valid-btn": "Plattformen verbinden"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Bloqs verbinden",
|
||||
"desc": "Das Verbinden von Bloqs ermöglicht das Teilen von Bloqs zwischen allen Versionen. Sobald verbunden, wird diese Version von den geteilten Bloqs profitieren",
|
||||
"info": "Das Hinzufügen und Entfernen von Bloqs wird ebenfalls geteilt",
|
||||
"keep-models": {
|
||||
"label": "Bloqs behalten",
|
||||
"title": "Das Behalten der Bloqs wird die Bloqs der aktuellen Version in den Ordner der geteilten Bloqs verschieben. Andernfalls gehen sie verloren"
|
||||
},
|
||||
"valid-btn": "Bloqs verbinden"
|
||||
}
|
||||
},
|
||||
"unlink-models": {
|
||||
"avatar": {
|
||||
"title": "Avatare trennen",
|
||||
"desc": "Achtung, das Trennen der Avatare wird die Nutzung der geteilten Avatare für diese Version nicht mehr ermöglichen.",
|
||||
"keep-models": {
|
||||
"label": "Avatare behalten",
|
||||
"title": "Das Behalten der Avatare wird eine Kopie der geteilten Avatare für die aktuelle Version erstellen. Andernfalls wird kein Avatar für diese Version aufbewahrt."
|
||||
},
|
||||
"valid-btn": "Avatare trennen"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Säbel trennen",
|
||||
"desc": "Achtung, das Trennen der Säbel wird die Nutzung der geteilten Säbel für diese Version nicht mehr ermöglichen.",
|
||||
"keep-models": {
|
||||
"label": "Säbel behalten",
|
||||
"title": "Das Behalten der Säbel wird eine Kopie der geteilten Säbel für die aktuelle Version erstellen. Andernfalls wird kein Säbel für diese Version aufbewahrt."
|
||||
},
|
||||
"valid-btn": "Säbel trennen"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Plattformen trennen",
|
||||
"desc": "Achtung, das Trennen der Plattformen wird die Nutzung der geteilten Plattformen für diese Version nicht mehr ermöglichen.",
|
||||
"keep-models": {
|
||||
"label": "Plattformen behalten",
|
||||
"title": "Das Behalten der Plattformen wird eine Kopie der geteilten Plattformen für die aktuelle Version erstellen. Andernfalls wird keine Plattform für diese Version aufbewahrt."
|
||||
},
|
||||
"valid-btn": "Plattformen trennen"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Bloqs trennen",
|
||||
"desc": "Achtung, das Trennen der Bloqs wird die Nutzung der geteilten Bloqs für diese Version nicht mehr ermöglichen.",
|
||||
"keep-models": {
|
||||
"label": "Bloqs behalten",
|
||||
"title": "Das Behalten der Bloqs wird eine Kopie der geteilten Bloqs für die aktuelle Version erstellen. Andernfalls wird kein Bloq für diese Version aufbewahrt."
|
||||
},
|
||||
"valid-btn": "Bloqs trennen"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notifications": {
|
||||
"prevent-for-mods": {
|
||||
"title": "Erforderliche Mods",
|
||||
"desc": "Stellen Sie sicher, dass Sie die notwendigen Mods installiert haben, um Modelle in BeatSaber zu verwenden",
|
||||
"go-to-mods": "Gehe zu Mods",
|
||||
"not-remind": "Erinnere mich nicht"
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "Gebrochene Modelle",
|
||||
"desc": "Seit dem Update des BeatSaber-Motors sind Modelle für diese Version nicht mehr funktional."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Export abgeschlossen 🎉"
|
||||
}
|
||||
}
|
||||
},
|
||||
"beat-saver": {
|
||||
"maps-sorts": {
|
||||
"Latest": "Neueste",
|
||||
"Relevance": "Relevanz",
|
||||
"Rating": "Bewertung",
|
||||
"Curated": "Curated"
|
||||
}
|
||||
},
|
||||
"auto-update": {
|
||||
"checking": "Prüfe auf Updates",
|
||||
"downloading": "Lade Updates Herunter"
|
||||
},
|
||||
"dateformat": {
|
||||
"dayNames": [
|
||||
"So",
|
||||
"Mo",
|
||||
"Di",
|
||||
"Mi",
|
||||
"Do",
|
||||
"Fr",
|
||||
"Sa",
|
||||
"Sonntag",
|
||||
"Montag",
|
||||
"Dienstag",
|
||||
"Mittwoch",
|
||||
"Donnerstag",
|
||||
"Freitag",
|
||||
"Samstag"
|
||||
],
|
||||
"monthNames": [
|
||||
"Jan",
|
||||
"Feb",
|
||||
"Mär",
|
||||
"Apr",
|
||||
"Mai",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Aug",
|
||||
"Sep",
|
||||
"Okt",
|
||||
"Nov",
|
||||
"Dez",
|
||||
"Januar",
|
||||
"Februar",
|
||||
"März",
|
||||
"April",
|
||||
"Mai",
|
||||
"Juni",
|
||||
"Juli",
|
||||
"August",
|
||||
"September",
|
||||
"Oktober",
|
||||
"November",
|
||||
"Dezember"
|
||||
],
|
||||
"timeNames": [
|
||||
"a",
|
||||
"p",
|
||||
"am",
|
||||
"pm",
|
||||
"A",
|
||||
"P",
|
||||
"AM",
|
||||
"PM"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"misc": {
|
||||
"download": "Download",
|
||||
"add": "Add",
|
||||
"verify": "Verify",
|
||||
"launch": "Launch",
|
||||
"mods": "Mods",
|
||||
@@ -11,16 +12,37 @@
|
||||
"delete": "Delete",
|
||||
"accept": "Accept",
|
||||
"refuse": "Refuse",
|
||||
"apply": "Apply"
|
||||
"apply": "Apply",
|
||||
"copy": "Copy",
|
||||
"copied": "Copied!"
|
||||
},
|
||||
"nav-bar":{
|
||||
"add-version": "Add a version",
|
||||
"settings": "Settings",
|
||||
"shared": {
|
||||
"text": "Shared",
|
||||
"tooltip": "Shared contents"
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps":{
|
||||
"title": "Shared maps"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Oculus Mod",
|
||||
"desktop": "Desktop Mod",
|
||||
"debug": "Debug Mod"
|
||||
"oculus": "Oculus Mode",
|
||||
"oculus-description": "If you are using Beat Saber via Steam, it allows you to use Oculus's VR composer without passing by SteamVR, to gain performances This is not necessary for using Oculus headsets.",
|
||||
"desktop": "Desktop Mode",
|
||||
"desktop-description": "This allows you to use WASD and the mouse to navigate around the menu in game. This makes testing much easier, because you don't have to put on your headset!",
|
||||
"debug": "Debug Mode",
|
||||
"debug-description": "Enables the output log window for IPA. This will show the debug console that mods use.",
|
||||
"advanced-launch": {
|
||||
"button": "Advanced launch",
|
||||
"placeholder": "Additional arguments ex: --revert; --nowait"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"title": "Shared maps",
|
||||
"search-bar": {
|
||||
"search-placeholder": "Search a map",
|
||||
"filters-btn": "Filters",
|
||||
@@ -38,7 +60,7 @@
|
||||
"link-maps": {
|
||||
"tooltips": {
|
||||
"link": "Link maps",
|
||||
"unlink": "Unling maps"
|
||||
"unlink": "Unlink maps"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -51,6 +73,8 @@
|
||||
},
|
||||
"mods": {
|
||||
"loading-mods": "Loading mods...",
|
||||
"no-internet": "No internet",
|
||||
"mods-not-available": "No mods are available yet for this version of Beat Saber",
|
||||
"buttons": {
|
||||
"more-infos": "More info",
|
||||
"install-or-update": "Install or update"
|
||||
@@ -72,12 +96,17 @@
|
||||
"verify-files": "Verify files",
|
||||
"clone": "Clone",
|
||||
"edit": "Edit",
|
||||
"uninstall": "Uninstall"
|
||||
"uninstall": "Uninstall",
|
||||
"shared-folders": "Shared Folders"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
"title": "Select a version",
|
||||
"steam-release": "Release page"
|
||||
"steam-release": "Release page",
|
||||
"dropdown": {
|
||||
"refresh": "Refresh list",
|
||||
"import-version" :"Import a version"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"steam": {
|
||||
@@ -116,11 +145,13 @@
|
||||
"en-US": "English, US",
|
||||
"fr-FR": "Français",
|
||||
"es-ES": "Español",
|
||||
"de-DE": "Deutsch",
|
||||
"translated": {
|
||||
"en-EN": "English, United Kingdom",
|
||||
"en-US": "English, USA",
|
||||
"fr-FR": "French",
|
||||
"es-ES": "Spanish"
|
||||
"es-ES": "Spanish",
|
||||
"de-DE": "German"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -128,7 +159,7 @@
|
||||
"title": "Support BSManager 💖",
|
||||
"description": "Support the project and help us to provide continuous improvements to BSManager.",
|
||||
"buttons": {
|
||||
"support": "Support BSManager",
|
||||
"support": "Support BSManager 🥰",
|
||||
"supporters": "Supporters 👀"
|
||||
},
|
||||
"view": {
|
||||
@@ -138,7 +169,7 @@
|
||||
}
|
||||
},
|
||||
"discord": {
|
||||
"description": "Join the BSManager community by joining our Discord!"
|
||||
"description": "Join the BSManager community by following us on our social media!"
|
||||
},
|
||||
"contribution": {
|
||||
"description": "Suggest new features or report a bug to help improve BSManager!",
|
||||
@@ -164,10 +195,12 @@
|
||||
"shared": {
|
||||
"errors": {
|
||||
"titles": {
|
||||
"operation-running": "Operation running"
|
||||
"operation-running": "Operation running",
|
||||
"no-internet": "No internet"
|
||||
},
|
||||
"msg": {
|
||||
"operation-running": "Wait for the end of the current operation then start again."
|
||||
"operation-running": "Wait for the end of the current operation then start again.",
|
||||
"no-internet": "Check your connection and try again."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -223,16 +256,40 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs-import-version":{
|
||||
"success":{
|
||||
"start-import": {
|
||||
"title": "Import in progress 👌",
|
||||
"desc": "The import may take several minutes depending on your configuration."
|
||||
},
|
||||
"imported": {
|
||||
"title": "Imported version 🎉"
|
||||
}
|
||||
},
|
||||
"errors":{
|
||||
"import-error":{
|
||||
"desc": "Check that the selected folder is a BeatSaber installation."
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"move-folder": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"transfer-started": "Transfer in progress",
|
||||
"transfer-finished": "Transfer complete"
|
||||
},
|
||||
"descs": {
|
||||
"transfer-started": "The transfer has started and may take several minutes depending on your configuration."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"titles": {
|
||||
"transfer-failed": "Transfer failed 😕"
|
||||
},
|
||||
"descs": {
|
||||
"COPY_TO_SUBPATH": "The destination folder cannot be a subfolder of the source folder.",
|
||||
"restore-linked-folders": "An error occurred while restoring shared folders. You can still manually restore them via the 'Shared Folders' menu on the versions page."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -245,6 +302,7 @@
|
||||
},
|
||||
"additional-content":{
|
||||
"deep-link": {
|
||||
"select-all": "Select all",
|
||||
"activation":{
|
||||
"success":{
|
||||
"title":"OneClick activated!",
|
||||
@@ -379,6 +437,14 @@
|
||||
"success":"Model installation complete",
|
||||
"error":"An error occurred while installing the model"
|
||||
}
|
||||
},
|
||||
"shared-folder": {
|
||||
"info": {
|
||||
"userdata-backup-created":{
|
||||
"title": "Backup created",
|
||||
"msg": "Sharing the 'UserData' folder can generate errors, in case of problems unlink the folder to restore the backup"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
@@ -406,16 +472,30 @@
|
||||
},
|
||||
"password": {
|
||||
"label": "Password",
|
||||
"placeholder": "Enter your password"
|
||||
"placeholder": "Enter your password",
|
||||
"max-length-warning": "The password exceeds 64 characters! If the password is invalid, try to put its first 64 characters."
|
||||
},
|
||||
"stay": {
|
||||
"label": "Stay connected"
|
||||
}
|
||||
},
|
||||
"why-credentials": "Why do you need my credentials ?",
|
||||
"buttons": {
|
||||
"submit": "Login"
|
||||
}
|
||||
},
|
||||
"steam-credentials":{
|
||||
"title": "Steam Credentials",
|
||||
"p-1": "The credentials are only used to download the game because steam need to verify that you paid the game in order to be allowed to download it. They aren't saved and directly passed to DepotDownloader. If you don't want to enter your credentials you can follow this tutorial :",
|
||||
"p-2": "and then click on the gear icon in the top right corner and select \"Import a version\", select the folder where beat saber has been downloaded (If you follow the tutorial above you should have the correct location)"
|
||||
},
|
||||
"bs-import-version":{
|
||||
"title": "Import a version",
|
||||
"description": "Imports a version of BeatSaber to use with BSManager. The import will copy the selected BeatSaber installation folder to the BSManager versions folder.",
|
||||
"buttons":{
|
||||
"submit": "Import a version"
|
||||
}
|
||||
},
|
||||
"bs-uninstall": {
|
||||
"title": "Uninstall",
|
||||
"description": "Are you sure you want to uninstall BeatSaber {version} ? You will have to download it again to play it.",
|
||||
@@ -504,7 +584,9 @@
|
||||
},
|
||||
"download-maps": {
|
||||
"search-btn": "Search",
|
||||
"loading-maps": "Loading maps..."
|
||||
"loading-maps": "Loading maps...",
|
||||
"no-maps-found": "No maps found",
|
||||
"no-internet": "No internet"
|
||||
},
|
||||
"mods-disclaimer":{
|
||||
"title": "disclaimer",
|
||||
@@ -513,6 +595,16 @@
|
||||
"li-2": "Mods are subject to being broken by updates and that's normal - be patient and respectful when this happens, as modders are volunteers with real lives.",
|
||||
"li-3": "Beat Games aren't purposefully trying to break mods. They wish to work on the codebase and sometimes this breaks mods, but they are not out to kill mods.",
|
||||
"p-2": "Do not attack the game developers for issues related to mods, and vice versa - modders and game developers are two separate groups. Just don't be a jerk ok."
|
||||
},
|
||||
"shared-folders":{
|
||||
"title": "Shared Folders",
|
||||
"description": "Link BeatSaber folders to synchronize their contents with shared folders in other versions. Note that deleting content will also be shared.",
|
||||
"buttons": {
|
||||
"add-folder": "Add Folder",
|
||||
"link-folder": "Link Folder",
|
||||
"unlink-folder": "Unlink Folder",
|
||||
"link-all": "Link all"
|
||||
}
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
@@ -588,6 +680,169 @@
|
||||
"mapped-by": "mapped by"
|
||||
}
|
||||
},
|
||||
"models":{
|
||||
"types": {
|
||||
"singular": {
|
||||
"avatar": "avatar",
|
||||
"saber": "saber",
|
||||
"platform": "platform",
|
||||
"bloq": "block"
|
||||
},
|
||||
"plural": {
|
||||
"avatar": "avatars",
|
||||
"saber": "sabers",
|
||||
"platform": "platforms",
|
||||
"bloq": "blocks"
|
||||
}
|
||||
},
|
||||
"sorts": {
|
||||
"name": "Name",
|
||||
"date": "Date",
|
||||
"author": "Author"
|
||||
},
|
||||
"panel": {
|
||||
"actions": {
|
||||
"search": "Search a model",
|
||||
"drop-down": {
|
||||
"delete": "Delete models",
|
||||
"export": "Export models"
|
||||
},
|
||||
"link-models": "Link models",
|
||||
"unlink-models": "Unlink models"
|
||||
},
|
||||
"grid":{
|
||||
"loading": "Loading models...",
|
||||
"no-models": "No models",
|
||||
"download-models": "Download models"
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
"delete-model" :{
|
||||
"title": "Delete the model",
|
||||
"desc": "Are you sure you want to delete the model {modelName}?",
|
||||
"linked-annotation": "This model will be removed from all linked versions."
|
||||
},
|
||||
"delete-models": {
|
||||
"title": "Delete models",
|
||||
"desc": "Are you sure you want to delete the {nb} models?",
|
||||
"linked-annotation": "These models will be removed from all linked versions."
|
||||
},
|
||||
"download-models": {
|
||||
"search-btn": "Search",
|
||||
"search-placeholder": "Search a model",
|
||||
"search-tips": {
|
||||
"header": {
|
||||
"tag": "Tag",
|
||||
"desc": "Description"
|
||||
},
|
||||
"author-desc": "Show only models from the specified author.",
|
||||
"hash-desc": "Show only models with the specified hash.",
|
||||
"tag-desc": "Show only models with the specified tag.",
|
||||
"name-desc": "Show only models with the specified name.",
|
||||
"discordid-desc": "Show only models from the specified discord user.",
|
||||
"status-desc": "Show only models with the specified status. (profile only, and only for the author)"
|
||||
},
|
||||
"no-models": "No models found.",
|
||||
"no-internet": "No internet connection.",
|
||||
"error-occured": "An error occurred, try again later."
|
||||
},
|
||||
"link-models": {
|
||||
"avatar": {
|
||||
"title": "Link Avatars",
|
||||
"desc": "Linking avatars allows sharing avatars between all versions. Once linked, this version will benefit from the shared avatars",
|
||||
"info": "Adding and deleting avatars will also be shared",
|
||||
"keep-models": {
|
||||
"label": "Keep Avatars",
|
||||
"title": "Keeping the avatars will move the avatars from the current version to the shared avatars folder. Otherwise, they will be lost"
|
||||
},
|
||||
"valid-btn": "Link Avatars"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Link Sabers",
|
||||
"desc": "Linking sabers allows sharing sabers between all versions. Once linked, this version will benefit from the shared sabers",
|
||||
"info": "Adding and deleting sabers will also be shared",
|
||||
"keep-models": {
|
||||
"label": "Keep Sabers",
|
||||
"title": "Keeping the sabers will move the sabers from the current version to the shared sabers folder. Otherwise, they will be lost"
|
||||
},
|
||||
"valid-btn": "Link Sabers"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Link Platforms",
|
||||
"desc": "Linking platforms allows sharing platforms between all versions. Once linked, this version will benefit from the shared platforms",
|
||||
"info": "Adding and deleting platforms will also be shared",
|
||||
"keep-models": {
|
||||
"label": "Keep Platforms",
|
||||
"title": "Keeping the platforms will move the platforms from the current version to the shared platforms folder. Otherwise, they will be lost"
|
||||
},
|
||||
"valid-btn": "Link Platforms"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Link Bloqs",
|
||||
"desc": "Linking bloqs allows sharing bloqs between all versions. Once linked, this version will benefit from the shared bloqs",
|
||||
"info": "Adding and deleting bloqs will also be shared",
|
||||
"keep-models": {
|
||||
"label": "Keep Bloqs",
|
||||
"title": "Keeping the bloqs will move the bloqs from the current version to the shared bloqs folder. Otherwise, they will be lost"
|
||||
},
|
||||
"valid-btn": "Link Bloqs"
|
||||
}
|
||||
},
|
||||
"unlink-models": {
|
||||
"avatar": {
|
||||
"title": "Unlink Avatars",
|
||||
"desc": "Be careful, unlinking avatars will no longer allow the use of shared avatars for this version.",
|
||||
"keep-models": {
|
||||
"label": "Keep Avatars",
|
||||
"title": "Keeping the avatars will create a copy of the shared avatars for the current version. Otherwise, no avatars will be kept for this version."
|
||||
},
|
||||
"valid-btn": "Unlink Avatars"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Unlink Sabers",
|
||||
"desc": "Be careful, unlinking sabers will no longer allow the use of shared sabers for this version.",
|
||||
"keep-models": {
|
||||
"label": "Keep Sabers",
|
||||
"title": "Keeping the sabers will create a copy of the shared sabers for the current version. Otherwise, no sabers will be kept for this version."
|
||||
},
|
||||
"valid-btn": "Unlink Sabers"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Unlink Platforms",
|
||||
"desc": "Be careful, unlinking platforms will no longer allow the use of shared platforms for this version.",
|
||||
"keep-models": {
|
||||
"label": "Keep Platforms",
|
||||
"title": "Keeping the platforms will create a copy of the shared platforms for the current version. Otherwise, no platforms will be kept for this version."
|
||||
},
|
||||
"valid-btn": "Unlink Platforms"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Unlink Bloqs",
|
||||
"desc": "Be careful, unlinking bloqs will no longer allow the use of shared bloqs for this version.",
|
||||
"keep-models": {
|
||||
"label": "Keep Bloqs",
|
||||
"title": "Keeping the bloqs will create a copy of the shared bloqs for the current version. Otherwise, no bloqs will be kept for this version."
|
||||
},
|
||||
"valid-btn": "Unlink Bloqs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notifications": {
|
||||
"prevent-for-mods": {
|
||||
"title": "Required mods",
|
||||
"desc": "Make sure you've installed the necessary mods to use models in BeatSaber",
|
||||
"go-to-mods": "Go to mods",
|
||||
"not-remind": "Do not remind me"
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "Broken models",
|
||||
"desc": "Since the BeatSaber engine update, models are no longer functional for this version."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Export completed 🎉"
|
||||
}
|
||||
}
|
||||
},
|
||||
"beat-saver": {
|
||||
"maps-sorts": {
|
||||
"Latest": "Latest",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"misc": {
|
||||
"download": "Descargar",
|
||||
"add": "Añadir",
|
||||
"verify": "Verificar",
|
||||
"launch": "Lanzar",
|
||||
"mods": "Mods",
|
||||
@@ -11,14 +12,34 @@
|
||||
"delete": "Borrar",
|
||||
"accept": "Aceptar",
|
||||
"refuse": "Rechazar",
|
||||
"apply": "Aplicar"
|
||||
"apply": "Aplicar",
|
||||
"copy": "Copiar",
|
||||
"copied": "¡Copiado!"
|
||||
},
|
||||
"nav-bar":{
|
||||
"add-version": "Agregar una versión",
|
||||
"settings": "Ajustes",
|
||||
"shared": {
|
||||
"text": "Compartidos",
|
||||
"tooltip": "Contenidos compartidos"
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps":{
|
||||
"title": "Mapas comunes"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Oculus Mod",
|
||||
"oculus-description": "Si estás usando Beat Saber a través de Steam, te permite usar el compositor VR de Oculus sin pasar por SteamVR, para ganar prestaciones. Esto no es necesario para usar auriculares Oculus.",
|
||||
"desktop": "Desktop Mod",
|
||||
"debug": "Debug Mod"
|
||||
"desktop-description": "Esto te permite usar WASD y el mouse para navegar por el menú en juego. Esto hace que las pruebas sean mucho más fáciles, ¡porque no tienes que ponerte el auricular!",
|
||||
"debug": "Debug Mod",
|
||||
"debug-description": "Habilita la ventana de registro de salida para IPA. Esto mostrará la consola de depuración que usan los mods.",
|
||||
"advanced-launch": {
|
||||
"button": "Lanzamiento avanzado",
|
||||
"placeholder": "Argumentos adicionales ej: --revert; --no-wait"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"search-bar": {
|
||||
@@ -51,6 +72,8 @@
|
||||
},
|
||||
"mods": {
|
||||
"loading-mods": "Cargando mods...",
|
||||
"no-internet": "Sin internet",
|
||||
"mods-not-available": "Aún no hay mods disponibles para esta versión de Beat Saber",
|
||||
"buttons": {
|
||||
"more-infos": "Más información",
|
||||
"install-or-update": "Instalar o actualizar"
|
||||
@@ -72,12 +95,17 @@
|
||||
"verify-files": "Verificar los archivos",
|
||||
"clone": "Clonar",
|
||||
"edit": "Editar",
|
||||
"uninstall": "Desinstalar"
|
||||
"uninstall": "Desinstalar",
|
||||
"shared-folders": "Carpetas Compartidas"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
"title": "Seleccione una versión",
|
||||
"steam-release": "Publicación Página"
|
||||
"steam-release": "Publicación Página",
|
||||
"dropdown": {
|
||||
"refresh": "Actualizar la lista",
|
||||
"import-version" :"Importar una versión"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"steam": {
|
||||
@@ -116,11 +144,13 @@
|
||||
"en-US": "English, US",
|
||||
"fr-FR": "Français",
|
||||
"es-ES": "Español",
|
||||
"de-DE": "Deutsch",
|
||||
"translated": {
|
||||
"en-EN": "Inglés, Reino Unido",
|
||||
"en-US": "Inglés, Estados Unidos",
|
||||
"fr-FR": "Francés",
|
||||
"es-ES": "Español"
|
||||
"es-ES": "Español",
|
||||
"de-DE": "Alemán"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -128,7 +158,7 @@
|
||||
"title": "Apoyo BSManager 💖",
|
||||
"description": "Apoye el proyecto y ayúdenos a proporcionar mejoras continuas a BSManager.",
|
||||
"buttons": {
|
||||
"support": "Apoyo BSManager",
|
||||
"support": "Apoyo BSManager 🥰",
|
||||
"supporters": "Apoyos 👀"
|
||||
},
|
||||
"view": {
|
||||
@@ -138,7 +168,7 @@
|
||||
}
|
||||
},
|
||||
"discord": {
|
||||
"description": "¡Únete a la comunidad de BSManager uniéndote a nuestro Discord!"
|
||||
"description": "¡Únete a la comunidad de BSManager siguiéndonos en nuestras redes sociales!"
|
||||
},
|
||||
"contribution": {
|
||||
"description": "¡Sugiera nuevas características o reporte un error para ayudar a mejorar BSManager!",
|
||||
@@ -164,10 +194,12 @@
|
||||
"shared": {
|
||||
"errors": {
|
||||
"titles": {
|
||||
"operation-running": "Operación en curso"
|
||||
"operation-running": "Operación en curso",
|
||||
"no-internet": "Sin internet"
|
||||
},
|
||||
"msg": {
|
||||
"operation-running": "Espere a que termine la operación actual y vuelva a empezar."
|
||||
"operation-running": "Espere a que termine la operación actual y vuelva a empezar.",
|
||||
"no-internet": "Comprueba tu conexión a Internet e inténtalo de nuevo."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -223,16 +255,40 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs-import-version":{
|
||||
"success":{
|
||||
"start-import": {
|
||||
"title": "Importación en curso 👌",
|
||||
"desc": "La importación puede tardar varios minutos dependiendo de su configuración."
|
||||
},
|
||||
"imported": {
|
||||
"title": "Versión importada 🎉"
|
||||
}
|
||||
},
|
||||
"errors":{
|
||||
"import-error":{
|
||||
"desc": "Compruebe que la carpeta seleccionada es una instalación de BeatSaber."
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"move-folder": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"transfer-started": "Transferencia en curso",
|
||||
"transfer-finished": "Transferencia completa"
|
||||
},
|
||||
"descs": {
|
||||
"transfer-started": "La transferencia ha comenzado y puede tomar varios minutos dependiendo de su configuración."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"titles": {
|
||||
"transfer-failed": "Transferencia fallida 😕"
|
||||
},
|
||||
"descs": {
|
||||
"COPY_TO_SUBPATH": "La carpeta de destino no puede ser una subcarpeta de la carpeta de origen.",
|
||||
"restore-linked-folders": "Se produjo un error al restaurar las carpetas compartidas. Aún puede restaurarlas manualmente a través del menú 'Carpetas compartidas' en la página de versiones."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -245,6 +301,7 @@
|
||||
},
|
||||
"additional-content":{
|
||||
"deep-link": {
|
||||
"select-all": "Seleccionar todo",
|
||||
"activation":{
|
||||
"success":{
|
||||
"title":"¡OneClick activado!",
|
||||
@@ -379,6 +436,14 @@
|
||||
"success":"Instalación del modelo completada",
|
||||
"error":"Se produjo un error durante la instalación del modelo"
|
||||
}
|
||||
},
|
||||
"shared-folder": {
|
||||
"info": {
|
||||
"userdata-backup-created":{
|
||||
"title": "Backup creado",
|
||||
"msg": "Compartir la carpeta 'UserData' puede generar errores, en caso de problemas desvincular la carpeta para restaurar la copia de seguridad"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
@@ -406,16 +471,30 @@
|
||||
},
|
||||
"password": {
|
||||
"label": "Contraseña",
|
||||
"placeholder": "Introduzca su contraseña"
|
||||
"placeholder": "Introduzca su contraseña",
|
||||
"max-length-warning": "¡La contraseña supera los 64 caracteres! Si la contraseña es inválida, intenta ingresar solo sus primeros 64 caracteres."
|
||||
},
|
||||
"stay": {
|
||||
"label": "Manténgase conectado"
|
||||
}
|
||||
},
|
||||
"why-credentials": "¿Por qué necesitas mis credenciales?",
|
||||
"buttons": {
|
||||
"submit": "Inicio de sesión"
|
||||
}
|
||||
},
|
||||
"steam-credentials":{
|
||||
"title": "Steam Credentials",
|
||||
"p-1": "Las credenciales sólo se utilizan para descargar el juego porque steam necesita verificar que has pagado el juego para que se te permita descargarlo. No se guardan y se pasan directamente a DepotDownloader. Si no quieres introducir tus credenciales puedes seguir este tutorial :",
|
||||
"p-2": "y, a continuación, haga clic en el icono de engranaje en la esquina superior derecha y seleccione \"Importar una versión\", seleccione la carpeta donde se ha descargado beat saber (Si usted sigue el tutorial anterior debe tener la ubicación correcta)"
|
||||
},
|
||||
"bs-import-version":{
|
||||
"title": "Importar una versión",
|
||||
"description": "Importa una versión de BeatSaber para usar con BSManager. La importación copiará la carpeta de instalación seleccionada de BeatSaber en la carpeta de versiones de BSManager.",
|
||||
"buttons":{
|
||||
"submit": "Importar una versión"
|
||||
}
|
||||
},
|
||||
"bs-uninstall": {
|
||||
"title": "Desinstalar",
|
||||
"description": "¿Estás seguro de que quieres desinstalar BeatSaber {version}? Tendrás que descargarlo de nuevo para poder jugar.",
|
||||
@@ -504,7 +583,9 @@
|
||||
},
|
||||
"download-maps": {
|
||||
"search-btn": "buscar",
|
||||
"loading-maps": "Cargando mapas..."
|
||||
"loading-maps": "Cargando mapas...",
|
||||
"no-maps-found": "No se encontraron mapas",
|
||||
"no-internet": "Sin internet"
|
||||
},
|
||||
"mods-disclaimer":{
|
||||
"title": "descargo de responsabilidad",
|
||||
@@ -513,6 +594,16 @@
|
||||
"li-2": "Es probable que los mods dejen de funcionar debido a las actualizaciones y eso es normal. Sé paciente y respetuoso cuando suceda esto, ya que los modders son voluntarios y tienen una vida.",
|
||||
"li-3": "Beat Games no está intencionalmente tratando de romper los mods. Quieren mejorar el juego base y a veces esto rompe los mods, pero no es su objetivo matar a los mods.",
|
||||
"p-2": "No ataques a los desarrolladores por problemas relacionados con los mods y viceversa. Los modders y los desarrolladores son dos grupos distintos. No seas tonto, ¿de acuerdo?"
|
||||
},
|
||||
"shared-folders":{
|
||||
"title": "Carpetas Compartidas",
|
||||
"description": "Enlace las carpetas de BeatSaber para sincronizar su contenido con las carpetas compartidas en otras versiones. Tenga en cuenta que la eliminación de contenido también se compartirá.",
|
||||
"buttons": {
|
||||
"add-folder": "Añadir Carpeta",
|
||||
"link-folder": "Enlazar Carpeta",
|
||||
"unlink-folder": "Desenlazar Carpeta",
|
||||
"link-all": "Enlazar todo"
|
||||
}
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
@@ -588,6 +679,169 @@
|
||||
"mapped-by": "mapeado por"
|
||||
}
|
||||
},
|
||||
"models":{
|
||||
"types": {
|
||||
"singular": {
|
||||
"avatar": "avatar",
|
||||
"saber": "sable",
|
||||
"platform": "plataforma",
|
||||
"bloq": "bloque"
|
||||
},
|
||||
"plural": {
|
||||
"avatar": "avatares",
|
||||
"saber": "sables",
|
||||
"platform": "plataformas",
|
||||
"bloq": "bloques"
|
||||
}
|
||||
},
|
||||
"sorts": {
|
||||
"name": "Nombre",
|
||||
"date": "Fecha",
|
||||
"author": "Autor"
|
||||
},
|
||||
"panel": {
|
||||
"actions": {
|
||||
"search": "Buscar un modelo",
|
||||
"drop-down": {
|
||||
"delete": "Eliminar modelos",
|
||||
"export": "Exportar modelos"
|
||||
},
|
||||
"link-models": "Vincular modelos",
|
||||
"unlink-models": "Desvincular los modelos"
|
||||
},
|
||||
"grid":{
|
||||
"loading": "Cargando modelos...",
|
||||
"no-models": "No hay modelos",
|
||||
"download-models": "Descargar modelos"
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
"delete-model" :{
|
||||
"title": "Eliminar el modelo",
|
||||
"desc": "¿Estás seguro de que quieres eliminar el modelo {modelName}?",
|
||||
"linked-annotation": "Este modelo será eliminado de todas las versiones vinculadas."
|
||||
},
|
||||
"delete-models": {
|
||||
"title": "Eliminar modelos",
|
||||
"desc": "¿Estás seguro de que quieres eliminar los {nb} modelos?",
|
||||
"linked-annotation": "Estos modelos serán eliminados de todas las versiones vinculadas."
|
||||
},
|
||||
"download-models": {
|
||||
"search-btn": "Buscar",
|
||||
"search-placeholder": "Buscar un modelo",
|
||||
"search-tips": {
|
||||
"header": {
|
||||
"tag": "Etiqueta",
|
||||
"desc": "Descripción"
|
||||
},
|
||||
"author-desc": "Mostrar solo modelos del autor especificado.",
|
||||
"hash-desc": "Mostrar solo modelos con el hash especificado.",
|
||||
"tag-desc": "Mostrar solo modelos con la etiqueta especificada.",
|
||||
"name-desc": "Mostrar solo modelos con el nombre especificado.",
|
||||
"discordid-desc": "Mostrar solo modelos del usuario de discord especificado.",
|
||||
"status-desc": "Mostrar solo modelos con el estado especificado. (solo perfil, y solo para el autor)"
|
||||
},
|
||||
"no-models": "No se encontraron modelos.",
|
||||
"no-internet": "Sin conexión a Internet.",
|
||||
"error-occured": "Ocurrió un error, inténtalo de nuevo más tarde."
|
||||
},
|
||||
"link-models": {
|
||||
"avatar": {
|
||||
"title": "Vincular avatares",
|
||||
"desc": "La vinculación de avatares permite compartir avatares entre todas las versiones. Una vez vinculada, esta versión se beneficiará de los avatares compartidos",
|
||||
"info": "La adición y eliminación de avatares también se compartirá",
|
||||
"keep-models": {
|
||||
"label": "Conservar los avatares",
|
||||
"title": "Conservar los avatares moverá los avatares de la versión actual a la carpeta de avatares compartidos. De lo contrario, se perderán"
|
||||
},
|
||||
"valid-btn": "Vincular avatares"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Vincular sables",
|
||||
"desc": "La vinculación de sables permite compartir sables entre todas las versiones. Una vez vinculada, esta versión se beneficiará de los sables compartidos",
|
||||
"info": "La adición y eliminación de sables también se compartirá",
|
||||
"keep-models": {
|
||||
"label": "Conservar los sables",
|
||||
"title": "Conservar los sables moverá los sables de la versión actual a la carpeta de sables compartidos. De lo contrario, se perderán"
|
||||
},
|
||||
"valid-btn": "Vincular sables"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Vincular plataformas",
|
||||
"desc": "La vinculación de plataformas permite compartir plataformas entre todas las versiones. Una vez vinculada, esta versión se beneficiará de las plataformas compartidas",
|
||||
"info": "La adición y eliminación de plataformas también se compartirá",
|
||||
"keep-models": {
|
||||
"label": "Conservar las plataformas",
|
||||
"title": "Conservar las plataformas moverá las plataformas de la versión actual a la carpeta de plataformas compartidas. De lo contrario, se perderán"
|
||||
},
|
||||
"valid-btn": "Vincular plataformas"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Vincular bloqs",
|
||||
"desc": "La vinculación de bloqs permite compartir bloqs entre todas las versiones. Una vez vinculada, esta versión se beneficiará de los bloqs compartidos",
|
||||
"info": "La adición y eliminación de bloqs también se compartirá",
|
||||
"keep-models": {
|
||||
"label": "Conservar los bloqs",
|
||||
"title": "Conservar los bloqs moverá los bloqs de la versión actual a la carpeta de bloqs compartidos. De lo contrario, se perderán"
|
||||
},
|
||||
"valid-btn": "Vincular bloqs"
|
||||
}
|
||||
},
|
||||
"unlink-models": {
|
||||
"avatar": {
|
||||
"title": "Desvincular avatares",
|
||||
"desc": "Atención, desvincular los avatares ya no permitirá el uso de avatares compartidos para esta versión.",
|
||||
"keep-models": {
|
||||
"label": "Conservar los avatares",
|
||||
"title": "Conservar los avatares creará una copia de los avatares compartidos para la versión actual. En caso contrario, ningún avatar se conservará para esta versión."
|
||||
},
|
||||
"valid-btn": "Desvincular avatares"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Desvincular sables",
|
||||
"desc": "Atención, desvincular los sables ya no permitirá el uso de sables compartidos para esta versión.",
|
||||
"keep-models": {
|
||||
"label": "Conservar los sables",
|
||||
"title": "Conservar los sables creará una copia de los sables compartidos para la versión actual. En caso contrario, ningún sable se conservará para esta versión."
|
||||
},
|
||||
"valid-btn": "Desvincular sables"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Desvincular plataformas",
|
||||
"desc": "Atención, desvincular las plataformas ya no permitirá el uso de plataformas compartidas para esta versión.",
|
||||
"keep-models": {
|
||||
"label": "Conservar las plataformas",
|
||||
"title": "Conservar las plataformas creará una copia de las plataformas compartidas para la versión actual. En caso contrario, ninguna plataforma se conservará para esta versión."
|
||||
},
|
||||
"valid-btn": "Desvincular plataformas"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Desvincular bloqs",
|
||||
"desc": "Atención, desvincular los bloqs ya no permitirá el uso de bloqs compartidos para esta versión.",
|
||||
"keep-models": {
|
||||
"label": "Conservar los bloqs",
|
||||
"title": "Conservar los bloqs creará una copia de los bloqs compartidos para la versión actual. En caso contrario, ningún bloq se conservará para esta versión."
|
||||
},
|
||||
"valid-btn": "Desvincular bloqs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notifications": {
|
||||
"prevent-for-mods": {
|
||||
"title": "Mods necesarios",
|
||||
"desc": "Asegúrate de haber instalado los mods necesarios para usar modelos en BeatSaber",
|
||||
"go-to-mods": "Ir a mods",
|
||||
"not-remind": "No volver a recordarme"
|
||||
},
|
||||
"prevent-for-models-breaks": {
|
||||
"title": "Modelos rotos",
|
||||
"desc": "Desde la actualización del motor de BeatSaber, los modelos ya no son funcionales para esta versión."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Exportación completada 🎉"
|
||||
}
|
||||
}
|
||||
},
|
||||
"beat-saver": {
|
||||
"maps-sorts": {
|
||||
"Latest": "Última",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"misc": {
|
||||
"download": "Télécharger",
|
||||
"add": "Ajouter",
|
||||
"verify": "Vérifier",
|
||||
"launch": "Lancer",
|
||||
"mods": "Mods",
|
||||
@@ -11,14 +12,34 @@
|
||||
"delete": "Supprimer",
|
||||
"accept": "Accepter",
|
||||
"refuse": "Refuser",
|
||||
"apply": "Appliquer"
|
||||
"apply": "Appliquer",
|
||||
"copy": "Copier",
|
||||
"copied": "Copié !"
|
||||
},
|
||||
"nav-bar":{
|
||||
"add-version": "Ajouter une version",
|
||||
"settings": "Paramètres",
|
||||
"shared": {
|
||||
"text": "Partagés",
|
||||
"tooltip": "Contenus partagés"
|
||||
}
|
||||
},
|
||||
"pages": {
|
||||
"shared-maps":{
|
||||
"title": "Maps partagées"
|
||||
},
|
||||
"version-viewer": {
|
||||
"launch-mods": {
|
||||
"oculus": "Mode Oculus",
|
||||
"oculus-description": "Si vous utilisez Beat Saber via Steam, cela vous permet d'utiliser le compositeur VR d'Oculus sans passer par SteamVR, pour gagner en performances. Ceci n'est pas nécessaire pour utiliser les casques Oculus.",
|
||||
"desktop": "Mode Bureau",
|
||||
"debug": "Mode Debug"
|
||||
"desktop-description": "Cela vous permet d'utiliser WASD et la souris pour naviguer dans le menu en jeu. Cela rend les tests beaucoup plus faciles, car vous n'avez pas à mettre votre casque!",
|
||||
"debug": "Mode Debug",
|
||||
"debug-description": "Active la fenêtre de log pour IPA. Cela affichera la console de débogage utilisée par les mods.",
|
||||
"advanced-launch": {
|
||||
"button": "Lancement avancé",
|
||||
"placeholder": "Arguments supplémentaires ex: --revert; --nowait"
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
"search-bar": {
|
||||
@@ -51,6 +72,8 @@
|
||||
},
|
||||
"mods": {
|
||||
"loading-mods": "Chargement des mods...",
|
||||
"no-internet": "Pas d'internet",
|
||||
"mods-not-available": "Aucun mod n'est encore disponible pour cette version de Beat Saber",
|
||||
"buttons": {
|
||||
"more-infos": "Plus d'infos",
|
||||
"install-or-update": "Installer ou mettre à jour"
|
||||
@@ -72,12 +95,17 @@
|
||||
"verify-files": "Vérifier les fichiers",
|
||||
"clone": "Cloner",
|
||||
"edit": "Editer",
|
||||
"uninstall": "Désinstaller"
|
||||
"uninstall": "Désinstaller",
|
||||
"shared-folders": "Dossiers Partagés"
|
||||
}
|
||||
},
|
||||
"available-versions": {
|
||||
"title": "Choisi une version",
|
||||
"steam-release": "Notes de version"
|
||||
"title": "Choisis une version",
|
||||
"steam-release": "Notes de version",
|
||||
"dropdown": {
|
||||
"refresh": "Rafraichir la liste",
|
||||
"import-version" :"Importer une version"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"steam": {
|
||||
@@ -87,7 +115,7 @@
|
||||
},
|
||||
"appearance": {
|
||||
"title": "Apparence",
|
||||
"description": "Choisi les deux couleurs principales de BSManager.",
|
||||
"description": "Choisis les deux couleurs principales de BSManager.",
|
||||
"reset": "Réinitialiser",
|
||||
"sub-title": "Thème",
|
||||
"themes": {
|
||||
@@ -103,7 +131,7 @@
|
||||
},
|
||||
"additional-content": {
|
||||
"title": "Contenus additionnels",
|
||||
"description": "Les contenus additionnels te permet de personaliser BeatSaber !",
|
||||
"description": "Les contenus additionnels te permettent de personaliser Beat Saber!",
|
||||
"deep-links": {
|
||||
"sub-title": "Installations OneClick"
|
||||
}
|
||||
@@ -116,19 +144,21 @@
|
||||
"en-US": "English, US",
|
||||
"fr-FR": "Français",
|
||||
"es-ES": "Español",
|
||||
"de-DE": "Deutsch",
|
||||
"translated": {
|
||||
"en-EN": "Anglais, Royaume-Uni",
|
||||
"en-US": "Anglais, États-Unis",
|
||||
"fr-FR": "Français",
|
||||
"es-ES": "Espagnol"
|
||||
"es-ES": "Espagnol",
|
||||
"de-DE": "Allemand"
|
||||
}
|
||||
}
|
||||
},
|
||||
"patreon": {
|
||||
"title": "Soutenir BSManager 💖",
|
||||
"description": "Soutien le projet et aide-nous à fournir des améliorations continues à BSManager.",
|
||||
"description": "Soutiens le projet et aide-nous à fournir des améliorations continues à BSManager.",
|
||||
"buttons": {
|
||||
"support": "Soutenir BSManager",
|
||||
"support": "Soutenir BSManager 🥰",
|
||||
"supporters": "Supporteurs 👀"
|
||||
},
|
||||
"view": {
|
||||
@@ -138,7 +168,7 @@
|
||||
}
|
||||
},
|
||||
"discord":{
|
||||
"description": "Prends part à la communauté de BSManager en rejoignant notre Discord !"
|
||||
"description": "Prends part à la communauté de BSManager en nous suivant sur nos réseaux sociaux !"
|
||||
},
|
||||
"contribution": {
|
||||
"description": "Propose de nouvelles fonctionnalités ou signale un bug pour contribuer à l'amélioration de BSManager !",
|
||||
@@ -158,16 +188,18 @@
|
||||
},
|
||||
"common": {
|
||||
"msg": {
|
||||
"error-occurred": "Une erreur c'est produite"
|
||||
"error-occurred": "Une erreur s'est produite"
|
||||
}
|
||||
},
|
||||
"shared": {
|
||||
"errors": {
|
||||
"titles": {
|
||||
"operation-running": "Opération en cours"
|
||||
"operation-running": "Opération en cours",
|
||||
"no-internet": "Pas d'internet"
|
||||
},
|
||||
"msg": {
|
||||
"operation-running": "Attend la fin de l'opération en cours puis recommences."
|
||||
"operation-running": "Attends la fin de l'opération en cours puis recommence.",
|
||||
"no-internet": "Verifie ta connexion internet et recommence."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -180,11 +212,11 @@
|
||||
},
|
||||
"warnings": {
|
||||
"msg": {
|
||||
"ManifestChecksum": "Le manifest télécharger précédemment ne correspond pas au nouveau 🤔",
|
||||
"ManifestChecksum": "Le manifest téléchargé précédemment ne correspond pas au nouveau 🤔",
|
||||
"ConnectionTimeout": "Ta connexion internet semble instable 🥶",
|
||||
"ConnectionLost": "La connexion a été perdue, retentative...",
|
||||
"ConnectionError": "Impossible de se connecter à Steam, retentative...",
|
||||
"Unknown": "Quelque chose d'étrange c'est produit 🤔 Votre connexion est surement instable."
|
||||
"ConnectionLost": "La connexion a été perdue, nouvelle tentative...",
|
||||
"ConnectionError": "Impossible de se connecter à Steam, nouvelle tentative...",
|
||||
"Unknown": "Quelque chose d'étrange s'est produit 🤔 Votre connexion est surement instable."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
@@ -192,48 +224,72 @@
|
||||
"dotnet-required": ".NET 6 Requis"
|
||||
},
|
||||
"msg": {
|
||||
"401": "Steam semble pas vouloir nous laisser télécharger BeatSaber 😢",
|
||||
"401": "Steam ne semble pas vouloir nous laisser télécharger Beat Saber 😢",
|
||||
"404": "Impossible de contacter les serveurs de Steam.",
|
||||
"Password": "Le mot de passe est invalide.",
|
||||
"InvalidCredentials": "Ton e-mail ou mot de passe est invalide 😴",
|
||||
"InvalidPassword": "Ton mot de passe est invalide 😕",
|
||||
"NoManifest": "Aucun manifest n'a été trouvé.",
|
||||
"DirectoryCreate": "Impossible d'installer les dossiers nécessaires.",
|
||||
"NotAvailableApp": "Tu essayes de télécharger BeatSaber alors que tu ne l'as pas ? 🤣",
|
||||
"DepotNotFound": "Impossible de télécharger BeatSaber 😥 réessaye plus tard 😕",
|
||||
"NotAvailableApp": "Tu essayes de télécharger Beat Saber alors que tu ne l'as pas ? 🤣",
|
||||
"DepotNotFound": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
|
||||
"NotCompleted": "Le téléchargement n'a pas pu se terminer ¯\\_(ツ)_/¯",
|
||||
"InvalidManifest": "Impossible de télécharger BeatSaber 😥 réessaye plus tard 😕",
|
||||
"NoValidKey": "Impossible de télécharger BeatSaber 😥 réessaye plus tard 😕",
|
||||
"NoManifestCode": "Impossible de télécharger BeatSaber 😥 réessaye plus tard 😕",
|
||||
"Unknown": "Une erreur inconnue c'est produite ¯\\_(ツ)_/¯",
|
||||
"InvalidManifest": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
|
||||
"NoValidKey": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
|
||||
"NoManifestCode": "Impossible de télécharger Beat Saber 😥 réessaye plus tard 😕",
|
||||
"Unknown": "Une erreur inconnue s'est produite ¯\\_(ツ)_/¯",
|
||||
"NoServer": "Impossible de contacter les serveurs de Steam.",
|
||||
"NotAllowed": "Apparemment tu n'es pas autorisé à télécharger BeatSaber 🥱",
|
||||
"NotAllowed": "Apparemment tu n'es pas autorisé à télécharger Beat Saber 🥱",
|
||||
"ConnectionTimeout": "Impossible de se connecter à Steam 😕",
|
||||
"SteamLib": "Si tu à cette erreur, report le bug sur GitHub avec les logs stp.",
|
||||
"SteamLib": "Si tu as cette erreur, signale le bug sur GitHub avec les logs stp.",
|
||||
"ConnectionError": "Impossible de se connecter à Steam après 10 essais 🤯",
|
||||
"LicenceError": "Impossible d'obtenir la liste des licences.",
|
||||
"verification-failed": "La vérification a échoué, réessaye plus tard.",
|
||||
"RateLimitExceeded": "Tu as essayé trop de fois attend un peu et recommence plus tard.",
|
||||
"RateLimitExceeded": "Tu as essayé trop de fois attends un peu et recommence plus tard.",
|
||||
"AlreadyDownloading": "Un téléchargement est déjà en cours",
|
||||
"no-internet": "Pas de connexion internet.",
|
||||
"dotnet-required": ".NET 6 Runtime doit être installé pour pouvoir télécharger une version de BeatSaber. Télécharge-le en cliquant sur le bouton ci-dessous."
|
||||
"dotnet-required": ".NET 6 Runtime doit être installé pour pouvoir télécharger une version de Beat Saber. Télécharge-le en cliquant sur le bouton ci-dessous."
|
||||
},
|
||||
"actions":{
|
||||
"download-dotnet": "Télécharger .NET 6"
|
||||
}
|
||||
}
|
||||
},
|
||||
"bs-import-version":{
|
||||
"success":{
|
||||
"start-import": {
|
||||
"title": "Importation en cours 👌",
|
||||
"desc": "L'importation peut durer plusieurs minutes selon votre configuration."
|
||||
},
|
||||
"imported": {
|
||||
"title": "Version importée 🎉"
|
||||
}
|
||||
},
|
||||
"errors":{
|
||||
"import-error":{
|
||||
"desc": "Vérifier que le dossier sélectionné est une installation de Beat Saber."
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"move-folder": {
|
||||
"success": {
|
||||
"titles": {
|
||||
"transfer-started": "Transfert en cours",
|
||||
"transfer-finished": "Transfert terminé 👌"
|
||||
},
|
||||
"descs":{
|
||||
"transfer-started": "Le transfert a commencé, il peut durer plusieurs minutes selon votre configuration."
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"titles": {
|
||||
"transfer-failed": "Le transfert a échoué 😕"
|
||||
}
|
||||
},
|
||||
"descs": {
|
||||
"COPY_TO_SUBPATH": "Le dossier de destination ne peut pas être un sous-dossier du dossier source.",
|
||||
"restore-linked-folders": "Une erreur s'est produite lors de la restauration des dossiers partagés. Vous pouvez toujours les restaurer manuellement via le menu 'Dossiers partagés' sur la page des versions."
|
||||
}
|
||||
}
|
||||
},
|
||||
"steam": {
|
||||
@@ -245,6 +301,7 @@
|
||||
},
|
||||
"additional-content":{
|
||||
"deep-link": {
|
||||
"select-all": "Tout sélectionner",
|
||||
"activation":{
|
||||
"success":{
|
||||
"title":"OneClick activé !",
|
||||
@@ -285,14 +342,14 @@
|
||||
"UNABLE_TO_LAUNCH": "Lancement impossible",
|
||||
"STEAM_NOT_RUNNING": "Steam n'est pas lancé",
|
||||
"OCULUS_NOT_RUNNING": "Oculus n'est pas lancé",
|
||||
"BS_ALREADY_RUNNING": "BeatSaber est déjà lancé",
|
||||
"BS_ALREADY_RUNNING": "Beat Saber est déjà lancé",
|
||||
"EXE_NOT_FINDED": "Fichiers manquants",
|
||||
"EXIT": "Arrêt brutal"
|
||||
},
|
||||
"msg": {
|
||||
"STEAM_NOT_RUNNING": "Steam doit être en cours d'exécution pour lancer BeatSaber.",
|
||||
"OCULUS_NOT_RUNNING": "Oculus doit être en cours d'exécution pour lancer BeatSaber.",
|
||||
"BS_ALREADY_RUNNING": "Ferme BeatSaber avant de le lancer à nouveau.",
|
||||
"STEAM_NOT_RUNNING": "Steam doit être en cours d'exécution pour lancer Beat Saber.",
|
||||
"OCULUS_NOT_RUNNING": "Oculus doit être en cours d'exécution pour lancer Beat Saber.",
|
||||
"BS_ALREADY_RUNNING": "Ferme Beat Saber avant de le lancer à nouveau.",
|
||||
"EXE_NOT_FINDED": "Quelques fichiers semblent manquants. Essaye de vérifier les fichiers.",
|
||||
"EXIT": "BeatSaber s'est arrêté brusquement, essaye de vérifier les fichiers."
|
||||
},
|
||||
@@ -316,12 +373,12 @@
|
||||
"CantClone": "Clonage impossible"
|
||||
},
|
||||
"msg": {
|
||||
"CantEditSteam": "Tu ne peut pas éditer la version Steam. Tu peut la cloner par contre."
|
||||
"CantEditSteam": "Tu ne peux pas éditer la version Steam. Tu peux la cloner par contre."
|
||||
}
|
||||
},
|
||||
"success": {
|
||||
"titles": {
|
||||
"CloningFinished": "Clonage terminer 🎉"
|
||||
"CloningFinished": "Clonage terminé 🎉"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -332,10 +389,10 @@
|
||||
"warning": "Mods installés 🤔"
|
||||
},
|
||||
"msg": {
|
||||
"success": "Tous les mods on été installés.",
|
||||
"success": "Tous les mods ont été installés.",
|
||||
"warning": "Un ou plusieurs mods n'ont pas pu être installés.",
|
||||
"errors": {
|
||||
"no-mods": "Aucun mods à installer.",
|
||||
"no-mods": "Aucun mod à installer.",
|
||||
"cannot-install-bsipa": "L'installation de BSIPA à échoué 😨"
|
||||
}
|
||||
}
|
||||
@@ -355,7 +412,7 @@
|
||||
"success": "Mods désintallés 🎉"
|
||||
},
|
||||
"msg": {
|
||||
"success": "Tous les mods on été désintallés.",
|
||||
"success": "Tous les mods ont été désintallés.",
|
||||
"errors": {
|
||||
"no-mods": "Aucun mod n'est installé dans dans cette version 😑"
|
||||
}
|
||||
@@ -379,6 +436,14 @@
|
||||
"success":"Installation du modèle terminée",
|
||||
"error":"Une erreur s'est produite lors de l'installation du modèle"
|
||||
}
|
||||
},
|
||||
"shared-folder":{
|
||||
"info": {
|
||||
"userdata-backup-created":{
|
||||
"title": "Sauvegarde créée",
|
||||
"msg": "Le partage du dossier 'UserData' peut générer des erreurs, en cas de soucis déliez le dossier pour restaurer la sauvegarde"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
@@ -406,26 +471,40 @@
|
||||
},
|
||||
"password": {
|
||||
"label": "Mot de passe",
|
||||
"placeholder": "Entre ton mot de passe"
|
||||
"placeholder": "Entre ton mot de passe",
|
||||
"max-length-warning": "Le mot de passe dépasse 64 caractères ! Si le mot de passe est invalide, tente d'entrer seulement ses 64 premiers caractères."
|
||||
},
|
||||
"stay": {
|
||||
"label": "Rester connecté"
|
||||
}
|
||||
},
|
||||
"why-credentials": "Pourquoi mes identifiants sont nécessaires ?",
|
||||
"buttons": {
|
||||
"submit": "Se connecter"
|
||||
}
|
||||
},
|
||||
"steam-credentials":{
|
||||
"title": "Steam Credentials",
|
||||
"p-1": "Les informations d'identification ne sont utilisées que pour télécharger le jeu, car Steam doit vérifier que vous avez payé le jeu afin d'être autorisé à le télécharger. Ils ne sont pas sauvegardés et transmis directement à DepotDownloader. Si vous ne voulez pas entrer vos informations d'identification, vous pouvez suivre ce tutoriel :",
|
||||
"p-2": "puis cliquez sur l'icône de l'engrenage dans le coin supérieur droit et sélectionnez \"Importer une version\", sélectionnez le dossier où beat saber a été téléchargé (Si vous suivez le tutoriel ci-dessus, vous devriez avoir le bon emplacement)."
|
||||
},
|
||||
"bs-import-version":{
|
||||
"title": "Importer une version",
|
||||
"description": "Importe une version de BeatSaber pour profiter des fonctionnalités de BSManager. L'importation copiera le dossier d'installation de BeatSaber sélectionné dans le dossier de versions de BSManager.",
|
||||
"buttons":{
|
||||
"submit": "Importer une version"
|
||||
}
|
||||
},
|
||||
"bs-uninstall": {
|
||||
"title": "Désinstaller",
|
||||
"description": "Est-tu sûr de vouloir désinstaller BeatSaber {version} ? Tu vas devoir la retélécharger pour y jouer.",
|
||||
"description": "Es-tu sûr de vouloir désinstaller Beat Saber {version} ? Tu vas devoir la retélécharger pour y jouer.",
|
||||
"buttons": {
|
||||
"submit": "Désinstaller"
|
||||
}
|
||||
},
|
||||
"install-folder": {
|
||||
"title": "Dossier d'installation",
|
||||
"description": "Changer le dossier d'installation par défaut, va engendrer le déplacement de toutes les données installer vers le nouveau dossier.",
|
||||
"description": "Changer le dossier d'installation par défaut, cela va engendrer le déplacement de toutes les données installer vers le nouveau dossier.",
|
||||
"buttons": {
|
||||
"submit": "Choisir un dossier"
|
||||
}
|
||||
@@ -468,12 +547,12 @@
|
||||
"multiple": "Supprimer les maps ?"
|
||||
},
|
||||
"desc": {
|
||||
"single": "Est-tu sur de vouloir supprimer la map {name} ?",
|
||||
"multiple": "Est-tu sur de vouloir supprimer les {nb} maps ?"
|
||||
"single": "Es-tu sur de vouloir supprimer la map {name} ?",
|
||||
"multiple": "Es-tu sur de vouloir supprimer les {nb} maps ?"
|
||||
},
|
||||
"info": {
|
||||
"desc": {
|
||||
"single": "Cette map fait partie des maps paratagées",
|
||||
"single": "Cette map fait partie des maps partagées",
|
||||
"multiple": "Ces maps font parties des maps partagées"
|
||||
},
|
||||
"title": {
|
||||
@@ -504,7 +583,9 @@
|
||||
},
|
||||
"download-maps": {
|
||||
"search-btn": "Rechercher",
|
||||
"loading-maps": "Chargement des maps..."
|
||||
"loading-maps": "Chargement des maps...",
|
||||
"no-maps-found": "Aucune map trouvée",
|
||||
"no-internet": "Pas d'internet"
|
||||
},
|
||||
"mods-disclaimer":{
|
||||
"title": "avis de non-responsabilité",
|
||||
@@ -512,7 +593,17 @@
|
||||
"li-1": "Vous pouvez rencontrer des problèmes qui n'existent pas dans le jeu de base. 99.9% des bugs, plantages et ralentissements sont dus aux mods.",
|
||||
"li-2": "Les mods sont susceptibles de ne plus fonctionner à cause des mises à jour et c'est normal - soyez patient et respectueux lorsque cela se produit, parce que les moddeurs sont bénévoles et ont une vie.",
|
||||
"li-3": "Beat Games ne cherche pas volontairement à casser les mods. Ils souhaitent améliorer la base du jeu et parfois cela casse les mods, mais ce n'est pas dans leur objectif de tuer les mods.",
|
||||
"p-2": "N'attaquez pas les développeurs pour des problèmes relatifs aux mods, et inversement - les moddeurs et les développeurs sont deux groupes distincts. Ne sois pas idiot, d'accord ?"
|
||||
"p-2": "N'attaquez pas les développeurs pour des problèmes relatifs aux mods, et inversement - les moddeurs et les développeurs sont deux groupes distincts. Ne soyez pas idiots, d'accord ?"
|
||||
},
|
||||
"shared-folders":{
|
||||
"title": "Dossiers Partagés",
|
||||
"description": "Liez les dossiers de BeatSaber pour synchroniser leurs contenus avec les dossiers partagés des autres versions. Notez que la suppression de contenu sera également partagée.",
|
||||
"buttons": {
|
||||
"add-folder": "Ajouter un dossier",
|
||||
"link-folder": "Lier le dossier",
|
||||
"unlink-folder": "Délier le dossier",
|
||||
"link-all": "Tout lier"
|
||||
}
|
||||
}
|
||||
},
|
||||
"maps": {
|
||||
@@ -588,6 +679,169 @@
|
||||
"mapped-by": "mappée par"
|
||||
}
|
||||
},
|
||||
"models":{
|
||||
"types": {
|
||||
"singular": {
|
||||
"avatar": "avatar",
|
||||
"saber": "sabre",
|
||||
"platform": "plateforme",
|
||||
"bloq": "bloc"
|
||||
},
|
||||
"plural": {
|
||||
"avatar": "avatars",
|
||||
"saber": "sabres",
|
||||
"platform": "plateformes",
|
||||
"bloq": "blocs"
|
||||
}
|
||||
},
|
||||
"sorts": {
|
||||
"name": "nom",
|
||||
"date": "date",
|
||||
"author": "auteur"
|
||||
},
|
||||
"panel": {
|
||||
"actions": {
|
||||
"search": "Rechercher un modèle",
|
||||
"drop-down": {
|
||||
"delete": "Supprimer les modèles",
|
||||
"export": "Exporter les modèles"
|
||||
},
|
||||
"link-models": "Lier les modèles",
|
||||
"unlink-models": "Délier les modèles"
|
||||
},
|
||||
"grid":{
|
||||
"loading": "Chargement des modèles...",
|
||||
"no-models": "Aucun modèle",
|
||||
"download-models": "Télécharger des modèles"
|
||||
}
|
||||
},
|
||||
"modals": {
|
||||
"delete-model" :{
|
||||
"title": "Supprimer le modèle",
|
||||
"desc": "Est-tu sûr de vouloir supprimer le modèle {modelName} ?",
|
||||
"linked-annotation": "Ce modèle sera supprimé de toutes les versions liées."
|
||||
},
|
||||
"delete-models": {
|
||||
"title": "Supprimer les modèles",
|
||||
"desc": "Est-tu sûr de vouloir supprimer les {nb} modèles ?",
|
||||
"linked-annotation": "Ces modèles seront supprimés de toutes les versions liées."
|
||||
},
|
||||
"download-models": {
|
||||
"search-btn": "Rechercher",
|
||||
"search-placeholder": "Rechercher un modèle",
|
||||
"search-tips": {
|
||||
"header": {
|
||||
"tag": "Tag",
|
||||
"desc": "Description"
|
||||
},
|
||||
"author-desc": "Afficher seulement les modèles de l'auteur spécifié.",
|
||||
"hash-desc": "Afficher seulement les modèles avec le hash spécifié.",
|
||||
"tag-desc": "Afficher seulement les modèles avec le tag spécifié.",
|
||||
"name-desc": "Afficher seulement les modèles avec le nom spécifié.",
|
||||
"discordid-desc": "Afficher seulement les modèles de l'utilisateur discord spécifié.",
|
||||
"status-desc": "Afficher seulement les modèles avec le status spécifié. (profil seulement, et seulement pour l'auteur)"
|
||||
},
|
||||
"no-models": "Aucun modèles trouvés.",
|
||||
"no-internet": "Pas de connexion internet.",
|
||||
"error-occured": "Une erreur est survenue, réessaye plus tard."
|
||||
},
|
||||
"link-models":{
|
||||
"avatar": {
|
||||
"title": "Lier les avatars",
|
||||
"desc": "La liaison des avatars permet de partager les avatars entre toute les version. Une fois liée, cette version profitera des avatars partagés",
|
||||
"info": "L'ajout et la suppression d'avatars sera également partagé",
|
||||
"keep-models": {
|
||||
"label": "Conserver les avatars",
|
||||
"title": "Conserver les avatars déplacera les avatars de la version actuelle dans le dossier des avatars partagés. Dans le cas contraire ils seront perdus"
|
||||
},
|
||||
"valid-btn": "Lier les avatars"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Lier les sabres",
|
||||
"desc": "La liaison des sabres permet de partager les sabres entre toute les version. Une fois liée, cette version profitera des sabres partagés",
|
||||
"info": "L'ajout et la suppression de sabres sera également partagé",
|
||||
"keep-models": {
|
||||
"label": "Conserver les sabres",
|
||||
"title": "Conserver les sabres déplacera les sabres de la version actuelle dans le dossier des sabres partagés. Dans le cas contraire ils seront perdus"
|
||||
},
|
||||
"valid-btn": "Lier les sabres"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Lier les plateformes",
|
||||
"desc": "La liaison des plateformes permet de partager les plateformes entre toute les version. Une fois liée, cette version profitera des plateformes partagées",
|
||||
"info": "L'ajout et la suppression de plateformes sera également partagé",
|
||||
"keep-models": {
|
||||
"label": "Conserver les plateformes",
|
||||
"title": "Conserver les plateformes déplacera les plateformes de la version actuelle dans le dossier des plateformes partagées. Dans le cas contraire ils seront perdus"
|
||||
},
|
||||
"valid-btn": "Lier les plateformes"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Lier les bloqs",
|
||||
"desc": "La liaison des bloqs permet de partager les bloqs entre toute les version. Une fois liée, cette version profitera des bloqs partagés",
|
||||
"info": "L'ajout et la suppression de bloqs sera également partagé",
|
||||
"keep-models": {
|
||||
"label": "Conserver les bloqs",
|
||||
"title": "Conserver les bloqs déplacera les bloqs de la version actuelle dans le dossier des bloqs partagés. Dans le cas contraire ils seront perdus"
|
||||
},
|
||||
"valid-btn": "Lier les bloqs"
|
||||
}
|
||||
},
|
||||
"unlink-models":{
|
||||
"avatar": {
|
||||
"title": "Délier les avatars",
|
||||
"desc": "Attention, délier les avatars ne permettra plus l'utilisation des avatars paratagés pour cette version.",
|
||||
"keep-models": {
|
||||
"label": "Conserver les avatars",
|
||||
"title": "Conserver les avatars créera une copie des avatars partagés pour la version actuelle. Dans le cas contraire, aucun avatar ne sera conservé pour cette version."
|
||||
},
|
||||
"valid-btn": "Délier les avatars"
|
||||
},
|
||||
"saber": {
|
||||
"title": "Délier les sabres",
|
||||
"desc": "Attention, délier les sabres ne permettra plus l'utilisation des sabres paratagés pour cette version.",
|
||||
"keep-models": {
|
||||
"label": "Conserver les sabres",
|
||||
"title": "Conserver les sabres créera une copie des sabres partagés pour la version actuelle. Dans le cas contraire, aucun sabre ne sera conservé pour cette version."
|
||||
},
|
||||
"valid-btn": "Délier les sabres"
|
||||
},
|
||||
"platform": {
|
||||
"title": "Délier les plateformes",
|
||||
"desc": "Attention, délier les plateformes ne permettra plus l'utilisation des plateformes paratagées pour cette version.",
|
||||
"keep-models": {
|
||||
"label": "Conserver les plateformes",
|
||||
"title": "Conserver les plateformes créera une copie des plateformes partagées pour la version actuelle. Dans le cas contraire, aucune plateforme ne sera conservée pour cette version."
|
||||
},
|
||||
"valid-btn": "Délier les plateformes"
|
||||
},
|
||||
"bloq": {
|
||||
"title": "Délier les bloqs",
|
||||
"desc": "Attention, délier les bloqs ne permettra plus l'utilisation des bloqs paratagés pour cette version.",
|
||||
"keep-models": {
|
||||
"label": "Conserver les bloqs",
|
||||
"title": "Conserver les bloqs créera une copie des bloqs partagés pour la version actuelle. Dans le cas contraire, aucun bloq ne sera conservé pour cette version."
|
||||
},
|
||||
"valid-btn": "Délier les bloqs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"notifications": {
|
||||
"prevent-for-mods": {
|
||||
"title": "Mods nécessaires",
|
||||
"desc": "Assurez-toi d'avoir installé les mods nécessaires pour utiliser des modèles dans BeatSaber",
|
||||
"go-to-mods": "Aller aux mods",
|
||||
"not-remind": "Ne plus me rappeler"
|
||||
},
|
||||
"prevent-for-models-breaks":{
|
||||
"title": "Modèles cassés",
|
||||
"desc": "Depuis la mise à jour du moteur de BeatSaber, les modèles ne sont plus fonctionnels pour cette version."
|
||||
},
|
||||
"export-success": {
|
||||
"title": "Export terminé 🎉"
|
||||
}
|
||||
}
|
||||
},
|
||||
"beat-saver": {
|
||||
"maps-sorts": {
|
||||
"Latest": "Dernière",
|
||||
@@ -654,4 +908,4 @@
|
||||
"PM"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+19450
-726
File diff suppressed because it is too large
Load Diff
+27
-14
@@ -74,7 +74,8 @@
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
"nsis"
|
||||
"nsis",
|
||||
"nsis-web"
|
||||
],
|
||||
"icon": "assets/favicon.ico",
|
||||
"certificateSha1": "f3363a89b084f8f6b616babea3c91f9d79e15000"
|
||||
@@ -153,10 +154,14 @@
|
||||
"@types/dateformat": "^5.0.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "17.0.23",
|
||||
"@types/react": "^17.0.48",
|
||||
"@types/react-dom": "^18.0.10",
|
||||
"@types/node-fetch": "^2.6.3",
|
||||
"@types/react": "^18.0.33",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@types/react-outside-click-handler": "^1.3.1",
|
||||
"@types/react-test-renderer": "^17.0.2",
|
||||
"@types/react-virtualized-auto-sizer": "^1.0.1",
|
||||
"@types/react-window": "^1.8.5",
|
||||
"@types/recursive-readdir": "^2.2.1",
|
||||
"@types/terser-webpack-plugin": "^5.0.4",
|
||||
"@types/use-double-click": "^1.0.1",
|
||||
"@types/webpack-bundle-analyzer": "^4.4.2",
|
||||
@@ -172,7 +177,7 @@
|
||||
"css-loader": "^6.7.1",
|
||||
"css-minimizer-webpack-plugin": "^4.1.0",
|
||||
"detect-port": "^1.3.0",
|
||||
"electron": "^20.0.3",
|
||||
"electron": "^24.3.1",
|
||||
"electron-builder": "^23.6.0",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-notarize": "^1.2.1",
|
||||
@@ -209,7 +214,7 @@
|
||||
"sass-loader": "^12.6.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"tailwind-scrollbar": "^2.0.1",
|
||||
"tailwindcss": "^3.2.4",
|
||||
"tailwindcss": "^3.3.1",
|
||||
"terser-webpack-plugin": "^5.3.5",
|
||||
"ts-jest": "^27.1.5",
|
||||
"ts-loader": "^9.3.0",
|
||||
@@ -225,33 +230,41 @@
|
||||
"dependencies": {
|
||||
"@node-steam/vdf": "^2.2.0",
|
||||
"@tippyjs/react": "^4.2.6",
|
||||
"@types/color": "^3.0.3",
|
||||
"archiver": "^5.3.1",
|
||||
"color": "^4.2.3",
|
||||
"dateformat": "^5.0.3",
|
||||
"dot-prop": "^7.2.0",
|
||||
"dot-prop": "^8.0.0",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-store": "^8.1.0",
|
||||
"electron-updater": "^5.2.4",
|
||||
"electron-updater": "^6.0.3",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"framer-motion": "^8.0.2",
|
||||
"fs-extra": "^10.1.0",
|
||||
"framer-motion": "^10.11.2",
|
||||
"fs-extra": "^11.1.1",
|
||||
"history": "^5.3.0",
|
||||
"is-online": "^9.0.1",
|
||||
"jszip": "^3.10.1",
|
||||
"md5-file": "^5.0.0",
|
||||
"node-fetch": "^3.3.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"node-stream-zip": "^1.15.0",
|
||||
"react": "^18.2.0",
|
||||
"react-colorful": "^5.6.1",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-range": "^1.8.14",
|
||||
"react-router-dom": "^6.3.0",
|
||||
"regedit": "^5.1.1",
|
||||
"rxjs": "^7.5.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",
|
||||
"semver": "^7.3.8",
|
||||
"semver": "^7.5.1",
|
||||
"striptags": "^4.0.0-alpha.4",
|
||||
"tailwind-scrollbar-hide": "^1.1.7",
|
||||
"tailwindcss-scoped-groups": "^2.0.0",
|
||||
"use-delayed-state": "^1.2.0",
|
||||
"tippy.js": "^6.3.7",
|
||||
"use-double-click": "^1.0.5",
|
||||
"use-fit-text": "^2.4.0"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<!--
|
||||
|
||||
Please use the content below as a template for your pull request.
|
||||
Feel free to remove sections which do not make sense.
|
||||
|
||||
-->
|
||||
|
||||
## Scope
|
||||
|
||||
<!-- Brief description of WHAT you’re doing and WHY. -->
|
||||
|
||||
[closes TICKET-###](https://link-to-your-ticket)
|
||||
|
||||
## Implementation
|
||||
|
||||
<!--
|
||||
|
||||
Some description of HOW you achieved it. Perhaps give a high level description of the program flow. Did you need to refactor something? What tradeoffs did you take? Are there things in here which you’d particularly like people to pay close attention to?
|
||||
|
||||
-->
|
||||
|
||||
## Screenshots
|
||||
|
||||
| before | after |
|
||||
| ------ | ----- |
|
||||
| | |
|
||||
|
||||
## How to Test
|
||||
|
||||
<!--
|
||||
|
||||
A straightforward scenario of how to test your changes could help colleagues that are not familiar with the part of the code that you are changing but want to see it in action. This section can include a description or step-by-step instructions of how to get to the state of v2 that your change affects.
|
||||
|
||||
A "How To Test" section can look something like this:
|
||||
|
||||
- Sign in with a user with tracks
|
||||
- Activate `show_awesome_cat_gifs` feature (add `?feature.show_awesome_cat_gifs=1` to your URL)
|
||||
- You should see a GIF with cats dancing
|
||||
|
||||
-->
|
||||
|
||||
## Emoji Guide
|
||||
|
||||
**For reviewers: Emojis can be added to comments to call out blocking versus non-blocking feedback.**
|
||||
|
||||
E.g: Praise, minor suggestions, or clarifying questions that don’t block merging the PR.
|
||||
|
||||
> 🟢 Nice refactor!
|
||||
|
||||
> 🟡 Why was the default value removed?
|
||||
|
||||
E.g: Blocking feedback must be addressed before merging.
|
||||
|
||||
> 🔴 This change will break something important
|
||||
|
||||
| | | |
|
||||
| --- | --- | --- |
|
||||
| Blocking | 🔴 ❌ 🚨 | RED |
|
||||
| Non-blocking | 🟡 💡 🤔 💭 | Yellow, thinking, etc |
|
||||
| Praise | 🟢 💚 😍 👍 🙌 | Green, hearts, positive emojis, etc |
|
||||
Generated
+3
-912
@@ -1,922 +1,13 @@
|
||||
{
|
||||
"name": "bs-manager",
|
||||
"version": "0.2.0",
|
||||
"version": "1.1.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@mapbox/node-pre-gyp": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.9.tgz",
|
||||
"integrity": "sha512-aDF3S3rK9Q2gey/WAttUlISduDItz5BU3306M9Eyv6/oS40aMprnopshtlKTykxRNIBEZuRMaZAnbrQ4QtKGyw==",
|
||||
"requires": {
|
||||
"detect-libc": "^2.0.0",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"make-dir": "^3.1.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"nopt": "^5.0.0",
|
||||
"npmlog": "^5.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.5",
|
||||
"tar": "^6.1.11"
|
||||
}
|
||||
},
|
||||
"abbrev": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
|
||||
},
|
||||
"agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"requires": {
|
||||
"debug": "4"
|
||||
}
|
||||
},
|
||||
"ansi-escapes": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
|
||||
"integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==",
|
||||
"requires": {
|
||||
"type-fest": "^0.21.3"
|
||||
}
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"requires": {
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"aproba": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz",
|
||||
"integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ=="
|
||||
},
|
||||
"are-we-there-yet": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz",
|
||||
"integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==",
|
||||
"requires": {
|
||||
"delegates": "^1.0.0",
|
||||
"readable-stream": "^3.6.0"
|
||||
}
|
||||
},
|
||||
"array-back": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz",
|
||||
"integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q=="
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"builtins": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz",
|
||||
"integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ=="
|
||||
},
|
||||
"chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"chardet": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
|
||||
"integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA=="
|
||||
},
|
||||
"chownr": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
|
||||
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="
|
||||
},
|
||||
"cli-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
|
||||
"integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
|
||||
"requires": {
|
||||
"restore-cursor": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"cli-width": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz",
|
||||
"integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw=="
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"requires": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
|
||||
},
|
||||
"color-support": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
|
||||
"integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg=="
|
||||
},
|
||||
"command-line-args": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz",
|
||||
"integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==",
|
||||
"requires": {
|
||||
"array-back": "^3.1.0",
|
||||
"find-replace": "^3.0.0",
|
||||
"lodash.camelcase": "^4.3.0",
|
||||
"typical": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"command-line-commands": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/command-line-commands/-/command-line-commands-3.0.2.tgz",
|
||||
"integrity": "sha512-ac6PdCtdR6q7S3HN+JiVLIWGHY30PRYIEl2qPo+FuEuzwAUk0UYyimrngrg7FvF/mCr4Jgoqv5ZnHZgads50rw==",
|
||||
"requires": {
|
||||
"array-back": "^4.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"array-back": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
|
||||
"integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"command-line-usage": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz",
|
||||
"integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==",
|
||||
"requires": {
|
||||
"array-back": "^4.0.2",
|
||||
"chalk": "^2.4.2",
|
||||
"table-layout": "^1.0.2",
|
||||
"typical": "^5.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"requires": {
|
||||
"color-convert": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"array-back": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
|
||||
"integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg=="
|
||||
},
|
||||
"chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"requires": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"requires": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"requires": {
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"typical": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
|
||||
"integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||
"integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ=="
|
||||
},
|
||||
"ctrlc-windows": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ctrlc-windows/-/ctrlc-windows-2.0.0.tgz",
|
||||
"integrity": "sha512-bpZLqGGwJ/2uLIXmhBYC4TObQlpfEeCCzmJ1At6TWFIWcY4FydkJLTolABFPUxmDYHeC9y95wdYBLa4U4PSktA==",
|
||||
"requires": {
|
||||
"@mapbox/node-pre-gyp": "^1.0.5",
|
||||
"neon-cli": "^0.8.1"
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
|
||||
"requires": {
|
||||
"ms": "2.1.2"
|
||||
}
|
||||
},
|
||||
"deep-extend": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
|
||||
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="
|
||||
},
|
||||
"delegates": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="
|
||||
},
|
||||
"detect-libc": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz",
|
||||
"integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w=="
|
||||
},
|
||||
"emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="
|
||||
},
|
||||
"external-editor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
|
||||
"integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
|
||||
"requires": {
|
||||
"chardet": "^0.7.0",
|
||||
"iconv-lite": "^0.4.24",
|
||||
"tmp": "^0.0.33"
|
||||
}
|
||||
},
|
||||
"figures": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
|
||||
"integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==",
|
||||
"requires": {
|
||||
"escape-string-regexp": "^1.0.5"
|
||||
}
|
||||
},
|
||||
"find-replace": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz",
|
||||
"integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==",
|
||||
"requires": {
|
||||
"array-back": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"fs-minipass": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
|
||||
"integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
|
||||
"requires": {
|
||||
"minipass": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
||||
},
|
||||
"gauge": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",
|
||||
"integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==",
|
||||
"requires": {
|
||||
"aproba": "^1.0.3 || ^2.0.0",
|
||||
"color-support": "^1.1.2",
|
||||
"console-control-strings": "^1.0.0",
|
||||
"has-unicode": "^2.0.1",
|
||||
"object-assign": "^4.1.1",
|
||||
"signal-exit": "^3.0.0",
|
||||
"string-width": "^4.2.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"wide-align": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"git-config": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/git-config/-/git-config-0.0.7.tgz",
|
||||
"integrity": "sha512-LidZlYZXWzVjS+M3TEwhtYBaYwLeOZrXci1tBgqp/vDdZTBMl02atvwb6G35L64ibscYoPnxfbwwUS+VZAISLA==",
|
||||
"requires": {
|
||||
"iniparser": "~1.0.5"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"handlebars": {
|
||||
"version": "4.7.7",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz",
|
||||
"integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==",
|
||||
"requires": {
|
||||
"minimist": "^1.2.5",
|
||||
"neo-async": "^2.6.0",
|
||||
"source-map": "^0.6.1",
|
||||
"uglify-js": "^3.1.4",
|
||||
"wordwrap": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
|
||||
},
|
||||
"has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||
"integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ=="
|
||||
},
|
||||
"https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"requires": {
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
}
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"requires": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
}
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"iniparser": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/iniparser/-/iniparser-1.0.5.tgz",
|
||||
"integrity": "sha512-i40MWqgTU6h/70NtMsDVVDLjDYWwcIR1yIEVDPfxZIJno9z9L4s83p/V7vAu2i48Vj0gpByrkGFub7ko9XvPrw=="
|
||||
},
|
||||
"inquirer": {
|
||||
"version": "7.3.3",
|
||||
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz",
|
||||
"integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==",
|
||||
"requires": {
|
||||
"ansi-escapes": "^4.2.1",
|
||||
"chalk": "^4.1.0",
|
||||
"cli-cursor": "^3.1.0",
|
||||
"cli-width": "^3.0.0",
|
||||
"external-editor": "^3.0.3",
|
||||
"figures": "^3.0.0",
|
||||
"lodash": "^4.17.19",
|
||||
"mute-stream": "0.0.8",
|
||||
"run-async": "^2.4.0",
|
||||
"rxjs": "^6.6.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"through": "^2.3.6"
|
||||
}
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
},
|
||||
"lodash.camelcase": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
|
||||
"integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA=="
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"requires": {
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
|
||||
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
|
||||
"requires": {
|
||||
"semver": "^6.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"make-promises-safe": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/make-promises-safe/-/make-promises-safe-5.1.0.tgz",
|
||||
"integrity": "sha512-AfdZ49rtyhQR/6cqVKGoH7y4ql7XkS5HJI1lZm0/5N6CQosy1eYbBJ/qbhkKHzo17UH7M918Bysf6XB9f3kS1g=="
|
||||
},
|
||||
"mimic-fn": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||
},
|
||||
"minipass": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz",
|
||||
"integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==",
|
||||
"requires": {
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"minizlib": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
|
||||
"integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
|
||||
"requires": {
|
||||
"minipass": "^3.0.0",
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
||||
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"mute-stream": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz",
|
||||
"integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA=="
|
||||
},
|
||||
"neo-async": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
|
||||
},
|
||||
"neon-cli": {
|
||||
"version": "0.8.3",
|
||||
"resolved": "https://registry.npmjs.org/neon-cli/-/neon-cli-0.8.3.tgz",
|
||||
"integrity": "sha512-I44MB8PD0AEyFr/b5icR4sX1tsjdkb2T2uWEStG4Uf5C/jzalZPn7eazbQrW6KDyXNd8bc+LVuOr1v6CGTa1KQ==",
|
||||
"requires": {
|
||||
"chalk": "^4.1.0",
|
||||
"command-line-args": "^5.1.1",
|
||||
"command-line-commands": "^3.0.1",
|
||||
"command-line-usage": "^6.1.0",
|
||||
"git-config": "0.0.7",
|
||||
"handlebars": "^4.7.6",
|
||||
"inquirer": "^7.3.3",
|
||||
"make-promises-safe": "^5.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.2",
|
||||
"toml": "^3.0.0",
|
||||
"ts-typed-json": "^0.3.2",
|
||||
"validate-npm-package-license": "^3.0.4",
|
||||
"validate-npm-package-name": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"nopt": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
|
||||
"integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
|
||||
"requires": {
|
||||
"abbrev": "1"
|
||||
}
|
||||
},
|
||||
"npmlog": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz",
|
||||
"integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==",
|
||||
"requires": {
|
||||
"are-we-there-yet": "^2.0.0",
|
||||
"console-control-strings": "^1.1.0",
|
||||
"gauge": "^3.0.0",
|
||||
"set-blocking": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"onetime": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
|
||||
"integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
|
||||
"requires": {
|
||||
"mimic-fn": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g=="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"reduce-flatten": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz",
|
||||
"integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w=="
|
||||
},
|
||||
"restore-cursor": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
|
||||
"integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
|
||||
"requires": {
|
||||
"onetime": "^5.1.0",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
|
||||
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"run-async": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
|
||||
"integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ=="
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.6.7",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
|
||||
"integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.7",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
|
||||
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
||||
},
|
||||
"spdx-correct": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz",
|
||||
"integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==",
|
||||
"requires": {
|
||||
"spdx-expression-parse": "^3.0.0",
|
||||
"spdx-license-ids": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"spdx-exceptions": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
|
||||
"integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A=="
|
||||
},
|
||||
"spdx-expression-parse": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
|
||||
"integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
|
||||
"requires": {
|
||||
"spdx-exceptions": "^2.1.0",
|
||||
"spdx-license-ids": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"spdx-license-ids": {
|
||||
"version": "3.0.11",
|
||||
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz",
|
||||
"integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g=="
|
||||
},
|
||||
"string-width": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"requires": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"requires": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"table-layout": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz",
|
||||
"integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==",
|
||||
"requires": {
|
||||
"array-back": "^4.0.1",
|
||||
"deep-extend": "~0.6.0",
|
||||
"typical": "^5.2.0",
|
||||
"wordwrapjs": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"array-back": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz",
|
||||
"integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg=="
|
||||
},
|
||||
"typical": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
|
||||
"integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"tar": {
|
||||
"version": "6.1.11",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz",
|
||||
"integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==",
|
||||
"requires": {
|
||||
"chownr": "^2.0.0",
|
||||
"fs-minipass": "^2.0.0",
|
||||
"minipass": "^3.0.0",
|
||||
"minizlib": "^2.1.1",
|
||||
"mkdirp": "^1.0.3",
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"through": {
|
||||
"version": "2.3.8",
|
||||
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||
"integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg=="
|
||||
},
|
||||
"tmp": {
|
||||
"version": "0.0.33",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
|
||||
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
|
||||
"requires": {
|
||||
"os-tmpdir": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"toml": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
|
||||
"integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w=="
|
||||
},
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"ts-typed-json": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-typed-json/-/ts-typed-json-0.3.2.tgz",
|
||||
"integrity": "sha512-Tdu3BWzaer7R5RvBIJcg9r8HrTZgpJmsX+1meXMJzYypbkj8NK2oJN0yvm4Dp/Iv6tzFa/L5jKRmEVTga6K3nA=="
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||
},
|
||||
"type-fest": {
|
||||
"version": "0.21.3",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
|
||||
"integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w=="
|
||||
},
|
||||
"typical": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz",
|
||||
"integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw=="
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.16.2",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.2.tgz",
|
||||
"integrity": "sha512-AaQNokTNgExWrkEYA24BTNMSjyqEXPSfhqoS0AxmHkCJ4U+Dyy5AvbGV/sqxuxficEfGGoX3zWw9R7QpLFfEsg==",
|
||||
"optional": true
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"validate-npm-package-license": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||
"integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
|
||||
"requires": {
|
||||
"spdx-correct": "^3.0.0",
|
||||
"spdx-expression-parse": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"validate-npm-package-name": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz",
|
||||
"integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==",
|
||||
"requires": {
|
||||
"builtins": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"wide-align": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
|
||||
"integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
|
||||
"requires": {
|
||||
"string-width": "^1.0.2 || 2 || 3 || 4"
|
||||
}
|
||||
},
|
||||
"wordwrap": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q=="
|
||||
},
|
||||
"wordwrapjs": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz",
|
||||
"integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==",
|
||||
"requires": {
|
||||
"reduce-flatten": "^2.0.0",
|
||||
"typical": "^5.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"typical": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz",
|
||||
"integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
|
||||
},
|
||||
"yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
"resolved": "https://registry.npmjs.org/ctrlc-windows/-/ctrlc-windows-2.1.0.tgz",
|
||||
"integrity": "sha512-OrX5KI+K+2NMN91QIhYZdW7VDO2YsSdTZW494pA7Nvw/wBdU2hz+MGP006bR978zOTrG6Q8EIeJvLJmLqc6MsQ=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "bs-manager",
|
||||
"version": "1.0.0-alpha.2",
|
||||
"version": "1.2.0-alpha.3",
|
||||
"description": "A foundation for scalable desktop apps",
|
||||
"main": "./dist/main/main.js",
|
||||
"author": {
|
||||
"name": "Zagrios",
|
||||
"email": "electronreactboilerplate@gmail.com",
|
||||
"email": "admin@bsmanager.io",
|
||||
"url": "https://github.com/Zagrios/bs-manager"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -14,7 +14,7 @@
|
||||
"postinstall": "npm run electron-rebuild && npm run link-modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"ctrlc-windows": "^2.0.0"
|
||||
"ctrlc-windows": "^2.1.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 965 KiB |
@@ -3,3 +3,5 @@ export const OCULUS_BS_DIR = "hyperbolic-magnetism-beat-saber"
|
||||
export const BS_APP_ID = "620980";
|
||||
export const BS_DEPOT = "620981";
|
||||
export const APP_NAME = "BSManager";
|
||||
|
||||
export const STEAMVR_APP_ID = "250820";
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
import { CopyOptions, copy, ensureDir, move, symlink } from "fs-extra";
|
||||
import { access, mkdir, rm, readdir, unlink, lstat, readlink } from "fs/promises";
|
||||
import path from "path";
|
||||
import { Observable } from "rxjs";
|
||||
import log from "electron-log"
|
||||
import { BsmException } from "shared/models/bsm-exception.model";
|
||||
|
||||
export async function pathExist(path: string): Promise<boolean> {
|
||||
try{
|
||||
await access(path);
|
||||
return true;
|
||||
}catch(e){
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export async function ensureFolderExist(path: string): Promise<void> {
|
||||
if(await pathExist(path)){ return Promise.resolve(); }
|
||||
return mkdir(path, {recursive: true}).catch(log.error).then(() => {});
|
||||
}
|
||||
|
||||
export async function deleteFolder(folderPath: string): Promise<void> {
|
||||
if(!(await pathExist(folderPath))){ return; }
|
||||
return rm(folderPath, {recursive: true, force: true});
|
||||
}
|
||||
|
||||
export async function unlinkPath(path: string): Promise<void>{
|
||||
if(!(await pathExist(path))){ return; }
|
||||
return unlink(path);
|
||||
}
|
||||
|
||||
export async function getFoldersInFolder(folderPath: string, opts?: {ignoreSymlinkTargetError?: boolean}): Promise<string[]> {
|
||||
if(!(await pathExist(folderPath))){ return []; }
|
||||
|
||||
const files = await readdir(folderPath, {withFileTypes: true});
|
||||
|
||||
const promises = files.map(async file => {
|
||||
if(file.isDirectory()){ return path.join(folderPath, file.name); }
|
||||
if(!file.isSymbolicLink()){ return undefined; }
|
||||
try{
|
||||
const targetPath = await readlink(path.join(folderPath, file.name));
|
||||
return (await lstat(targetPath)).isDirectory() ? path.join(folderPath, file.name) : undefined;
|
||||
}catch(e: any){
|
||||
if(e.code === "ENOENT" && opts?.ignoreSymlinkTargetError === true && !path.extname(file.name)){
|
||||
return path.join(folderPath, file.name);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
|
||||
return (await Promise.all(promises)).filter(folder => folder);
|
||||
}
|
||||
|
||||
export function moveFolderContent(src: string, dest: string): Observable<Progression>{
|
||||
const progress: Progression = { current: 0, total: 0 };
|
||||
return new Observable<Progression>(subscriber => {
|
||||
subscriber.next(progress);
|
||||
(async () => {
|
||||
|
||||
const srcExist = await pathExist(src);
|
||||
|
||||
if(!srcExist){ return subscriber.complete(); }
|
||||
|
||||
ensureFolderExist(dest);
|
||||
|
||||
const files = await readdir(src, {encoding: "utf-8"});
|
||||
progress.total = files.length;
|
||||
|
||||
const promises = files.map(async file => {
|
||||
const srcFullPath = path.join(src, file);
|
||||
const destFullPath = path.join(dest, file);
|
||||
if(await pathExist(destFullPath)){
|
||||
progress.current++;
|
||||
return subscriber.next(progress);
|
||||
}
|
||||
await move(srcFullPath, destFullPath);
|
||||
progress.current++;
|
||||
subscriber.next(progress);
|
||||
});
|
||||
|
||||
Promise.allSettled(promises).then(() => subscriber.complete());
|
||||
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
export function isSubdirectory(parent: string, child: string): boolean {
|
||||
const parentNormalized = path.resolve(parent);
|
||||
const childNormalized = path.resolve(child);
|
||||
|
||||
if (parentNormalized === childNormalized) { return false; }
|
||||
|
||||
const relativePath = path.relative(parentNormalized, childNormalized);
|
||||
|
||||
if (path.parse(parentNormalized).root !== path.parse(childNormalized).root) { return false; }
|
||||
|
||||
return relativePath && !relativePath.startsWith('..') && !path.isAbsolute(relativePath);
|
||||
}
|
||||
|
||||
export async function copyDirectoryWithJunctions(src: string, dest: string, options?: CopyOptions): Promise<void> {
|
||||
|
||||
if(isSubdirectory(src, dest)){
|
||||
throw {message: `Cannot copy directory '${src}' into itself '${dest}'.`, code: "COPY_TO_SUBPATH"} as BsmException;
|
||||
}
|
||||
|
||||
await ensureDir(dest);
|
||||
const items = await readdir(src, { withFileTypes: true });
|
||||
|
||||
for (const item of items) {
|
||||
const sourcePath = path.join(src, item.name);
|
||||
const destinationPath = path.join(dest, item.name);
|
||||
|
||||
if (item.isDirectory()) {
|
||||
await copyDirectoryWithJunctions(sourcePath, destinationPath, options);
|
||||
} else if (item.isFile()) {
|
||||
await copy(sourcePath, destinationPath, options);
|
||||
} else if (item.isSymbolicLink()) {
|
||||
if(options?.overwrite){
|
||||
await unlinkPath(destinationPath);
|
||||
}
|
||||
const symlinkTarget = await readlink(sourcePath);
|
||||
const relativePath = path.relative(src, symlinkTarget);
|
||||
const newTarget = path.join(dest, relativePath);
|
||||
await symlink(newTarget, destinationPath, 'junction');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface Progression<T = unknown>{
|
||||
total: number;
|
||||
current: number;
|
||||
data?: T;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import JSZip from 'jszip';
|
||||
import { pathExist } from './fs.helpers';
|
||||
import path from 'path';
|
||||
import { mkdir, writeFile } from 'fs/promises';
|
||||
|
||||
export async function extractZip(zip: JSZip, dest: string): Promise<string[]>{
|
||||
if(!await pathExist(dest)){ throw new Error(`Path ${dest} does not exist`); }
|
||||
const files: string[] = [];
|
||||
|
||||
for(const [relativePath, entry] of Object.entries(zip.files)){
|
||||
if(entry.dir){ continue; }
|
||||
|
||||
const content = await entry.async("nodebuffer");
|
||||
const outPath = path.join(dest, relativePath);
|
||||
const outDir = path.dirname(outPath);
|
||||
|
||||
await mkdir(outDir, { recursive: true });
|
||||
await writeFile(outPath, content);
|
||||
|
||||
files.push(outPath);
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { UtilsService } from "../services/utils.service";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { SearchParams } from "shared/models/maps/beat-saver.model";
|
||||
import { BeatSaverService } from "../services/thrid-party/beat-saver/beat-saver.service";
|
||||
import log from "electron-log";
|
||||
|
||||
ipcMain.on("bsv-search-map", async (event, request: IpcRequest<SearchParams>) => {
|
||||
const utlis = UtilsService.getInstance();
|
||||
@@ -22,6 +23,7 @@ ipcMain.on("bsv-get-map-details-from-hashs", async (event, request: IpcRequest<s
|
||||
bsvService.getMapDetailsFromHashs(request.args).then(maps => {
|
||||
utlis.ipcSend(request.responceChannel, {success: true, data: maps});
|
||||
}).catch(e => {
|
||||
log.error(e);
|
||||
utlis.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
})
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ipcMain } from 'electron';
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import { BSInstallerService, DownloadEventType } from '../services/bs-installer.service';
|
||||
import { BSInstallerService, DownloadEventType, DownloadInfo } from '../services/bs-installer.service';
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { InstallationLocationService } from '../services/installation-location.service';
|
||||
import { UtilsService } from '../services/utils.service';
|
||||
@@ -18,13 +17,6 @@ export interface InitDownloadInfoInterface {
|
||||
stay: boolean
|
||||
}
|
||||
|
||||
export interface DownloadInfo {
|
||||
bsVersion: BSVersion,
|
||||
username: string,
|
||||
password?: string,
|
||||
stay?: boolean
|
||||
}
|
||||
|
||||
ipcMain.on('is-dotnet-6-installed', async (event, request: IpcRequest<void>) => {
|
||||
const installer = BSInstallerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
@@ -65,4 +57,14 @@ ipcMain.on('bs-download.set-installation-folder', (event, request: IpcRequest<st
|
||||
});
|
||||
})
|
||||
|
||||
ipcMain.on('bs-download.import-version', (event, request: IpcRequest<string>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const installer = BSInstallerService.getInstance();
|
||||
installer.importVersion(request.args).catch(e => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
}).then(() => {
|
||||
utils.ipcSend(request.responceChannel, {success: true});
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
import { ipcMain } from "electron";
|
||||
|
||||
import { LocalMapsManagerService } from "../services/additional-content/local-maps-manager.service";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
|
||||
import { BsvMapDetail } from "shared/models/maps";
|
||||
import { IpcService } from "../services/ipc.service";
|
||||
import { from } from "rxjs";
|
||||
|
||||
ipcMain.on('get-version-maps', (event, request: IpcRequest<BSVersion>) => {
|
||||
const utilsService = UtilsService.getInstance();
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipc.on('load-version-maps', async (request: IpcRequest<BSVersion>, reply) => {
|
||||
const localMaps = LocalMapsManagerService.getInstance();
|
||||
|
||||
localMaps.getMaps(request.args).then(maps => {
|
||||
utilsService.ipcSend<BsmLocalMap[]>(request.responceChannel, {success: true, data: maps});
|
||||
}).catch(() => {
|
||||
utilsService.ipcSend(request.responceChannel, {success: false});
|
||||
})
|
||||
|
||||
reply(localMaps.getMaps(request.args));
|
||||
});
|
||||
|
||||
ipcMain.on("verion-have-maps-linked", async (event, request: IpcRequest<BSVersion>) => {
|
||||
ipc.on("verion-have-maps-linked", async (request: IpcRequest<BSVersion>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
@@ -26,7 +23,7 @@ ipcMain.on("verion-have-maps-linked", async (event, request: IpcRequest<BSVersio
|
||||
|
||||
});
|
||||
|
||||
ipcMain.on("link-version-maps", async (event, request: IpcRequest<{version: BSVersion, keepMaps: boolean}>) => {
|
||||
ipc.on("link-version-maps", async (request: IpcRequest<{version: BSVersion, keepMaps: boolean}>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
@@ -38,7 +35,7 @@ ipcMain.on("link-version-maps", async (event, request: IpcRequest<{version: BSVe
|
||||
|
||||
});
|
||||
|
||||
ipcMain.on("unlink-version-maps", async (event, request: IpcRequest<{version: BSVersion, keepMaps: boolean}>) => {
|
||||
ipc.on("unlink-version-maps", async (request: IpcRequest<{version: BSVersion, keepMaps: boolean}>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
@@ -50,40 +47,22 @@ ipcMain.on("unlink-version-maps", async (event, request: IpcRequest<{version: BS
|
||||
|
||||
});
|
||||
|
||||
ipcMain.on("delete-maps", async (event, request: IpcRequest<{version: BSVersion, maps: BsmLocalMap[]}>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
ipc.on("delete-maps", async (request: IpcRequest<BsmLocalMap[]>, reply) => {
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
maps.deleteMaps(request.args.maps, request.args.version).then(() => {
|
||||
utils.ipcSend<void>(request.responceChannel, {success: true});
|
||||
}).catch(err => {
|
||||
utils.ipcSend<void>(request.responceChannel, {success: false, error: err});
|
||||
});
|
||||
reply(maps.deleteMaps(request.args));
|
||||
});
|
||||
|
||||
ipcMain.on("export-maps", async (event, request: IpcRequest<{version: BSVersion, maps: BsmLocalMap[], outPath: string}>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
ipc.on("export-maps", async (request: IpcRequest<{version: BSVersion, maps: BsmLocalMap[], outPath: string}>, reply) => {
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
maps.exportMaps(request.args.version, request.args.maps, request.args.outPath).then(() => {
|
||||
utils.ipcSend<void>(request.responceChannel, {success: true});
|
||||
}).catch(err => {
|
||||
utils.ipcSend<void>(request.responceChannel, {success: false, error: err});
|
||||
});
|
||||
reply(await maps.exportMaps(request.args.version, request.args.maps, request.args.outPath));
|
||||
});
|
||||
|
||||
ipcMain.on("download-map", async (event, request: IpcRequest<{map: BsvMapDetail, version: BSVersion}>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
ipc.on("download-map", async (request: IpcRequest<{map: BsvMapDetail, version: BSVersion}>, reply) => {
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
maps.downloadMap(request.args.map, request.args.version).then(() => {
|
||||
utils.ipcSend(request.responceChannel, {success: true});
|
||||
}).catch(err => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: err});
|
||||
});
|
||||
reply(from(maps.downloadMap(request.args.map, request.args.version)))
|
||||
});
|
||||
|
||||
ipcMain.on("one-click-install-map", async (event, request: IpcRequest<BsvMapDetail>) => {
|
||||
ipc.on("one-click-install-map", async (request: IpcRequest<BsvMapDetail>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
|
||||
@@ -94,7 +73,7 @@ ipcMain.on("one-click-install-map", async (event, request: IpcRequest<BsvMapDeta
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on("register-maps-deep-link", async (event, request: IpcRequest<void>) => {
|
||||
ipc.on("register-maps-deep-link", async (request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
@@ -109,7 +88,7 @@ ipcMain.on("register-maps-deep-link", async (event, request: IpcRequest<void>) =
|
||||
|
||||
});
|
||||
|
||||
ipcMain.on("unregister-maps-deep-link", async (event, request: IpcRequest<void>) => {
|
||||
ipc.on("unregister-maps-deep-link", async (request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
@@ -124,7 +103,7 @@ ipcMain.on("unregister-maps-deep-link", async (event, request: IpcRequest<void>)
|
||||
|
||||
});
|
||||
|
||||
ipcMain.on("is-map-deep-links-enabled", async (event, request: IpcRequest<void>) => {
|
||||
ipc.on("is-map-deep-links-enabled", async (request: IpcRequest<void>) => {
|
||||
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
const utils = UtilsService.getInstance();
|
||||
@@ -137,4 +116,9 @@ ipcMain.on("is-map-deep-links-enabled", async (event, request: IpcRequest<void>)
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipc.on("get-version-maps-path", async (req: IpcRequest<BSVersion>, reply) => {
|
||||
const maps = LocalMapsManagerService.getInstance();
|
||||
reply(from(maps.getMapsFolderPath(req.args)));
|
||||
});
|
||||
@@ -1,8 +1,16 @@
|
||||
import { ipcMain } from "electron";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { MSModel } from "shared/models/model-saber/model-saber.model";
|
||||
import { MSModel, MSModelType } from "shared/models/models/model-saber.model";
|
||||
import { LocalModelsManagerService } from "../services/additional-content/local-models-manager.service";
|
||||
import { IpcService } from "../services/ipc.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
|
||||
import { from } from "rxjs";
|
||||
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
|
||||
import { ModelDownload } from "renderer/services/models-management/models-downloader.service";
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipcMain.on("one-click-install-model", async (event, request: IpcRequest<MSModel>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
@@ -58,4 +66,25 @@ ipcMain.on("is-models-deep-links-enabled", async (event, request: IpcRequest<voi
|
||||
utils.ipcSend(request.responceChannel, {success: false});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ipc.on<ModelDownload>("download-model", async (req, reply) => {
|
||||
const models = LocalModelsManagerService.getInstance();
|
||||
reply(models.downloadModel(req.args.model, req.args.version));
|
||||
});
|
||||
|
||||
ipc.on<{version: BSVersion, type: MSModelType}>("get-version-models", async (req, reply) => {
|
||||
const models = LocalModelsManagerService.getInstance();
|
||||
const res = await models.getModels(req.args.type, req.args.version);
|
||||
reply(res);
|
||||
});
|
||||
|
||||
ipc.on<{version: BSVersion, models: BsmLocalModel[], outPath: string}>("export-models", async (req, reply) => {
|
||||
const models = LocalModelsManagerService.getInstance();
|
||||
reply(models.exportModels(req.args.outPath, req.args.version, req.args.models));
|
||||
});
|
||||
|
||||
ipc.on<BsmLocalModel[]>("delete-models", async (req, reply) => {
|
||||
const models = LocalModelsManagerService.getInstance();
|
||||
reply(models.deleteModels(req.args));
|
||||
});
|
||||
@@ -6,6 +6,18 @@ import { exec } from 'child_process';
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { BSLocalVersionService } from '../services/bs-local-version.service';
|
||||
import { BsmException } from 'shared/models/bsm-exception.model';
|
||||
import { IpcService } from '../services/ipc.service';
|
||||
import { from } from 'rxjs';
|
||||
import path from 'path';
|
||||
import { pathExist } from '../helpers/fs.helpers';
|
||||
import { FolderLinkerService, LinkOptions } from '../services/folder-linker.service';
|
||||
import { LocalMapsManagerService } from '../services/additional-content/local-maps-manager.service';
|
||||
import { readJSON, writeJSON } from 'fs-extra';
|
||||
import log from "electron-log"
|
||||
import { VersionLinkerAction } from 'renderer/services/version-folder-linker.service';
|
||||
import { VersionFolderLinkerService } from '../services/version-folder-linker.service';
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipcMain.on('bs-version.get-version-dict', (event, req: IpcRequest<void>) => {
|
||||
BSVersionLibService.getInstance().getAvailableVersions().then(versions => {
|
||||
@@ -26,7 +38,7 @@ ipcMain.on('bs-version.installed-versions', async (event, req: IpcRequest<void>)
|
||||
ipcMain.on("bs-version.open-folder", async (event, req: IpcRequest<BSVersion>) => {
|
||||
const localVersionService = BSLocalVersionService.getInstance();
|
||||
const versionFolder = await localVersionService.getVersionPath(req.args);
|
||||
UtilsService.getInstance().pathExist(versionFolder) && exec(`start "" "${versionFolder}"`);
|
||||
(await pathExist(versionFolder)) && exec(`start "" "${versionFolder}"`);
|
||||
});
|
||||
|
||||
ipcMain.on("bs-version.edit", async (event, req: IpcRequest<{version: BSVersion, name: string, color: string}>) => {
|
||||
@@ -44,3 +56,104 @@ ipcMain.on("bs-version.clone", async (event, req: IpcRequest<{version: BSVersion
|
||||
UtilsService.getInstance().ipcSend(req.responceChannel, {success: false, error});
|
||||
});
|
||||
});
|
||||
|
||||
ipc.on("get-version-full-path", async (req: IpcRequest<BSVersion>, reply) => {
|
||||
const localVersions = BSLocalVersionService.getInstance();
|
||||
reply(from( localVersions.getVersionPath(req.args) ));
|
||||
});
|
||||
|
||||
ipc.on("relative-version-path-to-full", async (req: IpcRequest<{version: BSVersion, relative: string}>, reply) => {
|
||||
path.isAbsolute(req.args.relative) && reply(from(Promise.resolve(req.args.relative)));
|
||||
|
||||
const localVersions = BSLocalVersionService.getInstance();
|
||||
const promise = localVersions.getVersionPath(req.args.version).catch(() => null).then(versionPath => {
|
||||
return path.join(versionPath, req.args.relative);
|
||||
});
|
||||
reply(from(promise));
|
||||
});
|
||||
|
||||
ipc.on("full-version-path-to-relative", async (req: IpcRequest<{version: BSVersion, fullPath: string}>, reply) => {
|
||||
const localVersions = BSLocalVersionService.getInstance();
|
||||
const promise = localVersions.getVersionPath(req.args.version).catch(() => null).then(versionPath => {
|
||||
return path.relative(versionPath, req.args.fullPath);
|
||||
});
|
||||
reply(from(promise));
|
||||
});
|
||||
|
||||
ipc.on("get-linked-folders", async (req: IpcRequest<{version: BSVersion, options?: { relative?: boolean }}>, reply) => {
|
||||
const versionLinker = VersionFolderLinkerService.getInstance();
|
||||
reply(from(versionLinker.getLinkedFolders(req.args.version, req.args.options)));
|
||||
});
|
||||
|
||||
ipc.on("link-folder", async (req: IpcRequest<{ folder: string, options?: LinkOptions}>, reply) => {
|
||||
|
||||
req.args.options ??= {};
|
||||
|
||||
const linker = FolderLinkerService.getInstance();
|
||||
|
||||
const relativeMapsFolder = path.join(LocalMapsManagerService.LEVELS_ROOT_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER)
|
||||
|
||||
if(req.args.folder.includes(relativeMapsFolder)){
|
||||
return reply(from(linker.linkFolder(req.args.folder, {keepContents: req.args.options?.keepContents, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER})));
|
||||
}
|
||||
|
||||
if(req.args.folder.includes("UserData")){
|
||||
req.args.options = { ...req.args.options, backup: true };
|
||||
}
|
||||
|
||||
const res = from(linker.linkFolder(req.args.folder, req.args.options));
|
||||
|
||||
const jsonIPAPath = path.join(req.args.folder, "Beat Saber IPA.json");
|
||||
|
||||
if(!(await pathExist(jsonIPAPath))){ return reply(res); }
|
||||
|
||||
await res.toPromise();
|
||||
|
||||
try{
|
||||
const ipaData = (await readJSON(jsonIPAPath)) ?? {} as any;
|
||||
ipaData["YeetMods"] = false;
|
||||
await writeJSON(jsonIPAPath, ipaData, {spaces: 4});
|
||||
}catch(e){
|
||||
log.error("Disable YeetMods", e);
|
||||
}
|
||||
|
||||
reply(res);
|
||||
|
||||
});
|
||||
|
||||
ipc.on("link-version-folder-action", async (req: IpcRequest<VersionLinkerAction>, reply) => {
|
||||
const versionLinker = VersionFolderLinkerService.getInstance();
|
||||
reply(from(versionLinker.doAction(req.args)));
|
||||
});
|
||||
|
||||
ipc.on("is-version-folder-linked", async (req: IpcRequest<{ version: BSVersion, relativeFolder: string }>, reply) => {
|
||||
const versionLinker = VersionFolderLinkerService.getInstance();
|
||||
reply(from(versionLinker.isFolderLinked(req.args.version, req.args.relativeFolder)));
|
||||
});
|
||||
|
||||
ipc.on("unlink-folder", async (req: IpcRequest<{ folder: string, options?: LinkOptions}>, reply) => {
|
||||
|
||||
req.args.options ??= {};
|
||||
|
||||
const linker = FolderLinkerService.getInstance();
|
||||
|
||||
const relativeMapsFolder = path.join(LocalMapsManagerService.LEVELS_ROOT_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER)
|
||||
|
||||
if(req.args.folder.includes(relativeMapsFolder)){
|
||||
return reply(from(linker.unlinkFolder(req.args.folder, {...req.args.options, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER})));
|
||||
}
|
||||
|
||||
if(req.args.folder.includes("UserData")){
|
||||
req.args.options = { ...req.args.options, backup: true };
|
||||
}
|
||||
|
||||
reply(from(linker.unlinkFolder(req.args.folder, req.args.options)));
|
||||
|
||||
});
|
||||
|
||||
ipc.on("relink-all-versions-folders", async (req: IpcRequest<void>, reply) => {
|
||||
const versionLinker = VersionFolderLinkerService.getInstance();
|
||||
reply(from(versionLinker.relinkAllVersionsFolders()));
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@ import { ipcMain } from "electron";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { ModelSaberService } from "../services/thrid-party/model-saber/model-saber.service";
|
||||
import { UtilsService } from "../services/utils.service";
|
||||
import { IpcService } from "../services/ipc.service";
|
||||
import { MSGetQuery } from "shared/models/models/model-saber.model";
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipcMain.on("ms-get-model-by-id", async (event, request: IpcRequest<string|number>) => {
|
||||
const utils = UtilsService.getInstance();
|
||||
@@ -12,4 +16,9 @@ ipcMain.on("ms-get-model-by-id", async (event, request: IpcRequest<string|number
|
||||
}).catch(e => {
|
||||
utils.ipcSend(request.responceChannel, {success: false, error: e});
|
||||
})
|
||||
});
|
||||
|
||||
ipc.on<MSGetQuery>("search-models", async (req, reply) => {
|
||||
const ms = ModelSaberService.getInstance();
|
||||
reply(ms.searchModels(req.args));
|
||||
});
|
||||
@@ -4,10 +4,16 @@ import { IpcRequest } from 'shared/models/ipc';
|
||||
import { SystemNotificationOptions } from 'shared/models/notification/system-notification.model';
|
||||
import { NotificationService } from '../services/notification.service';
|
||||
import { SteamService } from '../services/steam.service';
|
||||
import { IpcService } from '../services/ipc.service';
|
||||
import { from } from 'rxjs';
|
||||
import { fstat, lstat } from 'fs';
|
||||
import { pathExist } from '../helpers/fs.helpers';
|
||||
|
||||
|
||||
// TODO IMPROVE WINDOW CONTROL BY USING WINDOW SERVICE
|
||||
|
||||
const ipc = IpcService.getInstance();
|
||||
|
||||
ipcMain.on('window.close', async () => {
|
||||
const utils = UtilsService.getInstance();
|
||||
utils.getMainWindows("index.html")?.close();
|
||||
@@ -32,10 +38,10 @@ ipcMain.on('new-window', async (event, request: IpcRequest<string>) => {
|
||||
shell.openExternal(request.args);
|
||||
});
|
||||
|
||||
ipcMain.on('choose-folder', async (event, request: IpcRequest<void>) => {
|
||||
dialog.showOpenDialog({properties: ['openDirectory']}).then(res => {
|
||||
UtilsService.getInstance().ipcSend(request.responceChannel, {success: true, data: res});
|
||||
});
|
||||
ipc.on('choose-folder', async (req: IpcRequest<string>, reply) => {
|
||||
reply(
|
||||
from(dialog.showOpenDialog({properties: ['openDirectory'], defaultPath: req.args ?? ""}))
|
||||
)
|
||||
});
|
||||
|
||||
ipcMain.on("window.progression", async (event, request: IpcRequest<number>) => {
|
||||
|
||||
@@ -2,6 +2,9 @@ import { ipcMain } from "electron";
|
||||
import { WindowManagerService } from "../services/window-manager.service";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { AppWindow } from "shared/models/window-manager/app-window.model";
|
||||
import { BSLauncherService } from "../services/bs-launcher.service";
|
||||
|
||||
const launcher = BSLauncherService.getInstance();
|
||||
|
||||
ipcMain.on("open-window-then-close-all", async (event, request: IpcRequest<AppWindow>) => {
|
||||
const windowManager = WindowManagerService.getInstance();
|
||||
@@ -12,11 +15,13 @@ ipcMain.on("open-window-then-close-all", async (event, request: IpcRequest<AppWi
|
||||
});
|
||||
|
||||
ipcMain.on("close-all-windows", async (event, request: IpcRequest<AppWindow>) => {
|
||||
await launcher.restoreSteamVR();
|
||||
const windowManager = WindowManagerService.getInstance();
|
||||
windowManager.closeAllWindows(request.args);
|
||||
});
|
||||
|
||||
ipcMain.on("close-windows", async (event, request: IpcRequest<AppWindow[]>) => {
|
||||
await launcher.restoreSteamVR();
|
||||
const windowManager = WindowManagerService.getInstance();
|
||||
windowManager.close(...request.args);
|
||||
});
|
||||
+11
-13
@@ -9,10 +9,9 @@
|
||||
* `./src/main.js` using webpack. This gives us some performance wins.
|
||||
*/
|
||||
import path from 'path';
|
||||
import { app, protocol } from 'electron';
|
||||
import { app, ipcMain, protocol } from 'electron';
|
||||
import log from 'electron-log';
|
||||
import './ipcs';
|
||||
import { UtilsService } from './services/utils.service';
|
||||
import { WindowManagerService } from './services/window-manager.service';
|
||||
import { DeepLinkService } from './services/deep-link.service';
|
||||
import { AppWindow } from 'shared/models/window-manager/app-window.model';
|
||||
@@ -20,6 +19,9 @@ import { LocalMapsManagerService } from './services/additional-content/local-map
|
||||
import { LocalPlaylistsManagerService } from './services/additional-content/local-playlists-manager.service';
|
||||
import { LocalModelsManagerService } from './services/additional-content/local-models-manager.service';
|
||||
import { APP_NAME } from './constants';
|
||||
import { BSLauncherService } from './services/bs-launcher.service';
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { MSModelType } from '../shared/models/models/model-saber.model';
|
||||
|
||||
const isDebug = process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === 'true';
|
||||
|
||||
@@ -31,9 +33,6 @@ log.transports.file.resolvePath = (() => {
|
||||
|
||||
log.catchErrors();
|
||||
|
||||
const utilsService = UtilsService.getInstance();
|
||||
utilsService.setAssetsPath(app.isPackaged ? path.join(process.resourcesPath, 'assets') : path.join(__dirname, '../../assets'));
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
const sourceMapSupport = require('source-map-support');
|
||||
sourceMapSupport.install();
|
||||
@@ -63,14 +62,6 @@ const initServicesMustBeInitialized = () => {
|
||||
// Model
|
||||
}
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
// Respect the OSX convention of having the application in memory even
|
||||
// after all windows have been closed
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
|
||||
if(!gotTheLock){
|
||||
@@ -108,5 +99,12 @@ else{
|
||||
callback(pathname);
|
||||
});
|
||||
|
||||
BSLauncherService.getInstance().restoreSteamVR();
|
||||
|
||||
// Log renderer errors
|
||||
ipcMain.on('log-error', (event, args: IpcRequest<any>) => {
|
||||
log.error(args?.args);
|
||||
});
|
||||
|
||||
}).catch(log.error);
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import archiver from "archiver";
|
||||
import { createWriteStream } from "fs";
|
||||
import { Observable } from "rxjs";
|
||||
import recursive from "recursive-readdir";
|
||||
import { lstatSync } from "fs";
|
||||
import * as _path from "path";
|
||||
import { ArchiveProgress } from "shared/models/archive.interface";
|
||||
import { Progression } from "main/helpers/fs.helpers";
|
||||
|
||||
export class Archive{
|
||||
|
||||
private archive: archiver.Archiver;
|
||||
private readonly output: string;
|
||||
|
||||
private readonly directories: string[] = [];
|
||||
private readonly files: string[] = [];
|
||||
|
||||
constructor(output: string, options?: archiver.ArchiverOptions){
|
||||
this.output = output;
|
||||
this.initArchive(options);
|
||||
}
|
||||
|
||||
private initArchive(options?: archiver.ArchiverOptions): void{
|
||||
const defaultOptions: archiver.ArchiverOptions = {
|
||||
zlib: {level: 9}
|
||||
};
|
||||
|
||||
this.archive = archiver("zip", {...defaultOptions, ...options});
|
||||
}
|
||||
|
||||
private async loadTotalFiles(): Promise<number>{
|
||||
let totalFiles = this.files.length;
|
||||
for(const path of this.directories){
|
||||
const files = await recursive(path);
|
||||
totalFiles += files.length;
|
||||
}
|
||||
return totalFiles;
|
||||
}
|
||||
|
||||
public addDirectory(path: string, destPath?: string|false): void{
|
||||
this.directories.push(path);
|
||||
destPath = destPath === false ? false : _path.basename(path);
|
||||
this.archive.directory(path, destPath);
|
||||
}
|
||||
|
||||
public addFile(path: string, destPath?: string): void{
|
||||
this.files.push(path);
|
||||
destPath = destPath ||= _path.basename(path);
|
||||
this.archive.file(path, {name: destPath});
|
||||
}
|
||||
|
||||
|
||||
public finalize(): Observable<Progression>{
|
||||
|
||||
const progress: Progression = {
|
||||
total: 0,
|
||||
current: 0
|
||||
};
|
||||
|
||||
return new Observable<Progression>(observer => {
|
||||
(async () => {
|
||||
|
||||
progress.total = await this.loadTotalFiles();
|
||||
|
||||
this.archive.on("entry", e => {
|
||||
if(e.stats.isDirectory()){ return; }
|
||||
progress.current++;
|
||||
observer.next(progress);
|
||||
});
|
||||
|
||||
this.archive.pipe(createWriteStream(this.output));
|
||||
|
||||
this.archive.on("error", err => observer.error(err));
|
||||
this.archive.finalize().then(() => observer.complete());
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
+7
-5
@@ -1,21 +1,23 @@
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
|
||||
|
||||
export type Channels = any;
|
||||
import { IpcChannel } from 'shared/models/ipc/ipc-response.interface';
|
||||
|
||||
contextBridge.exposeInMainWorld('electron', {
|
||||
ipcRenderer: {
|
||||
sendMessage(channel: Channels, args: unknown[]) {
|
||||
sendMessage(channel: IpcChannel, args: unknown[]) {
|
||||
ipcRenderer.send(channel, args);
|
||||
},
|
||||
on(channel: Channels, func: (...args: unknown[]) => void) {
|
||||
on(channel: IpcChannel, func: (...args: unknown[]) => void) {
|
||||
const subscription = (_event: IpcRendererEvent, ...args: unknown[]) =>
|
||||
func(...args);
|
||||
ipcRenderer.on(channel, subscription);
|
||||
|
||||
return () => ipcRenderer.removeListener(channel, subscription);
|
||||
},
|
||||
once(channel: Channels, func: (...args: unknown[]) => void) {
|
||||
once(channel: IpcChannel, func: (...args: unknown[]) => void) {
|
||||
ipcRenderer.once(channel, (_event, ...args) => func(...args));
|
||||
},
|
||||
removeAllListeners(channel: IpcChannel) {
|
||||
ipcRenderer.removeAllListeners(channel);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,22 +1,27 @@
|
||||
import path from "path";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BsvMapDetail, RawMapInfoData } from "shared/models/maps";
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
|
||||
import { BsmLocalMap, BsmLocalMapsProgress, DeleteMapsProgress } from "shared/models/maps/bsm-local-map.interface";
|
||||
import { BSLocalVersionService } from "../bs-local-version.service";
|
||||
import { InstallationLocationService } from "../installation-location.service";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import crypto from "crypto";
|
||||
import { lstatSync, symlinkSync, unlinkSync, readdirSync, createWriteStream } from "fs";
|
||||
import { lstatSync, unlinkSync } from "fs";
|
||||
import { copySync } from "fs-extra";
|
||||
import StreamZip from "node-stream-zip";
|
||||
import { RequestService } from "../request.service";
|
||||
import sanitize from "sanitize-filename";
|
||||
import archiver from "archiver";
|
||||
import { DeepLinkService } from "../deep-link.service";
|
||||
import log from 'electron-log';
|
||||
import { WindowManagerService } from "../window-manager.service";
|
||||
import { ipcMain } from "electron";
|
||||
import { IpcRequest } from 'shared/models/ipc';
|
||||
import { Observable, lastValueFrom } from "rxjs";
|
||||
import { Archive } from "../../models/archive.class";
|
||||
import { deleteFolder, ensureFolderExist, getFoldersInFolder, pathExist } from "../../helpers/fs.helpers";
|
||||
import { readFile } from "fs/promises";
|
||||
import { FolderLinkerService } from "../folder-linker.service";
|
||||
import { allSettled } from "../../../shared/helpers/promise.helpers";
|
||||
|
||||
export class LocalMapsManagerService {
|
||||
|
||||
@@ -27,8 +32,9 @@ export class LocalMapsManagerService {
|
||||
return LocalMapsManagerService.instance;
|
||||
}
|
||||
|
||||
private readonly LEVELS_ROOT_FOLDER = "Beat Saber_Data";
|
||||
private readonly CUSTOM_LEVELS_FOLDER = "CustomLevels";
|
||||
public static readonly LEVELS_ROOT_FOLDER = "Beat Saber_Data";
|
||||
public static readonly CUSTOM_LEVELS_FOLDER = "CustomLevels";
|
||||
public static readonly SHARED_MAPS_FOLDER = "SharedMaps";
|
||||
|
||||
private readonly DEEP_LINKS = {
|
||||
BeatSaver: "beatsaver",
|
||||
@@ -41,6 +47,7 @@ export class LocalMapsManagerService {
|
||||
private readonly reqService: RequestService;
|
||||
private readonly deepLink: DeepLinkService;
|
||||
private readonly windows: WindowManagerService;
|
||||
private readonly linker = FolderLinkerService.getInstance();
|
||||
|
||||
private constructor(){
|
||||
this.localVersion = BSLocalVersionService.getInstance();
|
||||
@@ -49,50 +56,50 @@ export class LocalMapsManagerService {
|
||||
this.reqService = RequestService.getInstance();
|
||||
this.deepLink = DeepLinkService.getInstance();
|
||||
this.windows = WindowManagerService.getInstance();
|
||||
this.linker = FolderLinkerService.getInstance();
|
||||
|
||||
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.BeatSaver, (link) => {
|
||||
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.BeatSaver, link => {
|
||||
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.BeatSaver, link);
|
||||
this.openOneClickDownloadMapWindow(new URL(link).host);
|
||||
});
|
||||
|
||||
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.ScoreSaber, (link) => {
|
||||
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.ScoreSaber, link => {
|
||||
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.ScoreSaber, link);
|
||||
this.openOneClickDownloadMapWindow(new URL(link).host, true);
|
||||
});
|
||||
}
|
||||
|
||||
public async getMapsFolderPath(version?: BSVersion): Promise<string>{
|
||||
if(version){ return path.join(await this.localVersion.getVersionPath(version), this.LEVELS_ROOT_FOLDER, this.CUSTOM_LEVELS_FOLDER); }
|
||||
const sharedMapsPath = path.join(this.installLocation.sharedMapsPath, this.CUSTOM_LEVELS_FOLDER);
|
||||
if(!(await this.utils.pathExist(sharedMapsPath))){
|
||||
this.utils.createFolderIfNotExist(sharedMapsPath);
|
||||
|
||||
if(version){ return path.join(await this.localVersion.getVersionPath(version), LocalMapsManagerService.LEVELS_ROOT_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER); }
|
||||
const sharedMapsPath = path.join(this.installLocation.sharedContentPath, LocalMapsManagerService.SHARED_MAPS_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER);
|
||||
if(!(await pathExist(sharedMapsPath))){
|
||||
await ensureFolderExist(sharedMapsPath);
|
||||
}
|
||||
return sharedMapsPath;
|
||||
}
|
||||
|
||||
private async computeMapHash(mapPath: string, rawInfoString: string): Promise<string>{
|
||||
const mapRawInfo = JSON.parse(rawInfoString);
|
||||
let content = rawInfoString;
|
||||
const shasum = crypto.createHash("sha1");
|
||||
shasum.update(rawInfoString);
|
||||
for(const set of mapRawInfo._difficultyBeatmapSets){
|
||||
for(const diff of set._difficultyBeatmaps){
|
||||
const diffFilePath = path.join(mapPath, diff._beatmapFilename);
|
||||
if(!await this.utils.pathExist(diffFilePath)){ continue; }
|
||||
const diffContent = (await this.utils.readFileAsync(diffFilePath)).toString();
|
||||
content += diffContent;
|
||||
const diffContent = await readFile(diffFilePath, {encoding: "utf-8"}).catch(() => null);
|
||||
diffContent && shasum.update(diffContent);
|
||||
}
|
||||
}
|
||||
|
||||
const shasum = crypto.createHash("sha1");
|
||||
shasum.update(content);
|
||||
|
||||
return shasum.digest("hex");
|
||||
}
|
||||
|
||||
private async loadMapInfoFromPath(mapPath: string): Promise<BsmLocalMap>{
|
||||
const infoFilePath = path.join(mapPath, "Info.dat");
|
||||
|
||||
if(!(await this.utils.pathExist(infoFilePath))){ return null; }
|
||||
if(!(await pathExist(infoFilePath))){ return null; }
|
||||
|
||||
const rawInfoString = await (await (this.utils.readFileAsync(infoFilePath))).toString();
|
||||
const rawInfoString = await readFile(infoFilePath, {encoding: "utf-8"});
|
||||
|
||||
const rawInfo: RawMapInfoData = JSON.parse(rawInfoString);
|
||||
const coverUrl = new URL(`file:///${path.join(mapPath, rawInfo._coverImageFilename)}`).href;
|
||||
@@ -100,43 +107,21 @@ export class LocalMapsManagerService {
|
||||
|
||||
const hash = await this.computeMapHash(mapPath, rawInfoString);
|
||||
|
||||
return {rawInfo, coverUrl, songUrl, hash};
|
||||
return {rawInfo, coverUrl, songUrl, hash, path: mapPath};
|
||||
}
|
||||
|
||||
private async downloadMapZip(zipUrl: string): Promise<{zip: StreamZip.StreamZipAsync, zipPath: string}>{
|
||||
const fileName = path.basename(zipUrl);
|
||||
const tempPath = this.utils.getTempPath();
|
||||
this.utils.createFolderIfNotExist(this.utils.getTempPath());
|
||||
await ensureFolderExist(this.utils.getTempPath());
|
||||
const dest = path.join(tempPath, fileName);
|
||||
|
||||
const zipPath = await this.reqService.downloadFile(zipUrl, dest);
|
||||
const zipPath = (await lastValueFrom(this.reqService.downloadFile(zipUrl, dest))).data;
|
||||
const zip = new StreamZip.async({file : zipPath});
|
||||
|
||||
return {zip, zipPath};
|
||||
}
|
||||
|
||||
private async getAbsoluteFolderOfMaps(maps: BsmLocalMap[], version: BSVersion): Promise<string[]>{
|
||||
|
||||
const mapsFolder = await this.getMapsFolderPath(version);
|
||||
|
||||
const res: string[] = [];
|
||||
const mapHashs = maps.map(map => map.hash);
|
||||
|
||||
const mapsFolders = readdirSync(mapsFolder, {withFileTypes: true});
|
||||
|
||||
for(const content of mapsFolders){
|
||||
if(!content.isDirectory()){ continue; }
|
||||
const mapFolderPath = path.join(mapsFolder, content.name);
|
||||
const { hash } = await this.loadMapInfoFromPath(mapFolderPath);
|
||||
if(mapHashs.includes(hash)){
|
||||
res.push(mapFolderPath);
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
private openOneClickDownloadMapWindow(mapId: string, isHash = false): void{
|
||||
|
||||
ipcMain.once("one-click-map-info", async (event, req: IpcRequest<void>) => {
|
||||
@@ -147,21 +132,46 @@ export class LocalMapsManagerService {
|
||||
|
||||
}
|
||||
|
||||
public async getMaps(version?: BSVersion): Promise<BsmLocalMap[]>{
|
||||
const levelsFolder = await this.getMapsFolderPath(version);
|
||||
public getMaps(version?: BSVersion): Observable<BsmLocalMapsProgress>{
|
||||
|
||||
const levelsPath = (await this.utils.pathExist(levelsFolder)) ? this.utils.listDirsInDir(levelsFolder, true) : [];
|
||||
const progression: BsmLocalMapsProgress = {
|
||||
total: 0,
|
||||
loaded: 0,
|
||||
maps: []
|
||||
};
|
||||
|
||||
const mapsInfo = await Promise.all(levelsPath.map(levelPath => this.loadMapInfoFromPath(levelPath)));
|
||||
return new Observable<BsmLocalMapsProgress>(observer => {
|
||||
(async () => {
|
||||
const levelsFolder = await this.getMapsFolderPath(version);
|
||||
|
||||
return mapsInfo.filter(info => !!info);
|
||||
const levelsPaths = (await pathExist(levelsFolder)) ? await getFoldersInFolder(levelsFolder) : [];
|
||||
|
||||
progression.total = levelsPaths.length;
|
||||
|
||||
const promises = levelsPaths.map(async levelPath => {
|
||||
const mapInfo = await this.loadMapInfoFromPath(levelPath);
|
||||
if(!mapInfo){ return null; }
|
||||
progression.loaded++;
|
||||
observer.next(progression);
|
||||
return mapInfo;
|
||||
});
|
||||
|
||||
const mapsInfo = await allSettled(promises, {removeFalsy: true});
|
||||
|
||||
progression.maps = mapsInfo;
|
||||
|
||||
observer.next(progression);
|
||||
|
||||
observer.complete();
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
public async versionIsLinked(version: BSVersion): Promise<boolean>{
|
||||
|
||||
const levelsPath = await this.getMapsFolderPath(version);
|
||||
|
||||
const isPathExist = await this.utils.pathExist(levelsPath);
|
||||
const isPathExist = await pathExist(levelsPath);
|
||||
|
||||
if(!isPathExist){ return false; }
|
||||
|
||||
@@ -169,53 +179,40 @@ export class LocalMapsManagerService {
|
||||
}
|
||||
|
||||
public async linkVersionMaps(version: BSVersion, keepMaps: boolean): Promise<void>{
|
||||
|
||||
if(await this.versionIsLinked(version)){ return; }
|
||||
|
||||
const sharedMapsPath = await this.getMapsFolderPath();
|
||||
const versionMapsPath = await this.getMapsFolderPath(version);
|
||||
|
||||
if(keepMaps){
|
||||
await this.utils.moveDirContent(versionMapsPath, sharedMapsPath);
|
||||
}
|
||||
|
||||
await this.utils.deleteFolder(versionMapsPath);
|
||||
|
||||
symlinkSync(sharedMapsPath, versionMapsPath, "junction");
|
||||
return this.linker.linkFolder(versionMapsPath, {keepContents: keepMaps, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER});
|
||||
}
|
||||
|
||||
public async unlinkVersionMaps(version: BSVersion, keepMaps: boolean): Promise<void>{
|
||||
|
||||
const sharedMapsPath = await this.getMapsFolderPath();
|
||||
const versionMapsPath = await this.getMapsFolderPath(version);
|
||||
|
||||
if(await this.versionIsLinked(version)){
|
||||
unlinkSync(versionMapsPath);
|
||||
}
|
||||
|
||||
this.utils.createFolderIfNotExist(versionMapsPath);
|
||||
|
||||
if(keepMaps){
|
||||
copySync(sharedMapsPath, versionMapsPath);
|
||||
}
|
||||
|
||||
return this.linker.unlinkFolder(versionMapsPath, {keepContents: keepMaps, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER});
|
||||
}
|
||||
|
||||
public async deleteMaps(maps: BsmLocalMap[], verion?: BSVersion){
|
||||
public deleteMaps(maps: BsmLocalMap[]): Observable<DeleteMapsProgress>{
|
||||
|
||||
const mapsFolders = await this.getAbsoluteFolderOfMaps(maps, verion);
|
||||
const mapsFolders = maps.map(map => map.path);
|
||||
const mapsHashsToDelete = maps.map(map => map.hash);
|
||||
|
||||
for(const folder of mapsFolders){
|
||||
const { hash } = await this.loadMapInfoFromPath(folder);
|
||||
if(mapsHashsToDelete.includes(hash)){
|
||||
await this.utils.deleteFolder(folder);
|
||||
}
|
||||
}
|
||||
|
||||
return new Observable<DeleteMapsProgress>(observer => {
|
||||
(async () => {
|
||||
const progress: DeleteMapsProgress = { total: maps.length, deleted: 0 };
|
||||
try{
|
||||
for(const folder of mapsFolders){
|
||||
const detail = await this.loadMapInfoFromPath(folder);
|
||||
if(!mapsHashsToDelete.includes(detail?.hash)){ continue; }
|
||||
await deleteFolder(folder);
|
||||
progress.deleted++;
|
||||
observer.next(progress);
|
||||
}
|
||||
}catch(e){
|
||||
observer.error(e);
|
||||
}
|
||||
observer.complete();
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
public async downloadMap(map: BsvMapDetail, version?: BSVersion): Promise<string>{
|
||||
public async downloadMap(map: BsvMapDetail, version?: BSVersion): Promise<BsmLocalMap>{
|
||||
|
||||
if(!map.versions.at(0).hash){ throw "Cannot download map, no hash found"; }
|
||||
|
||||
@@ -231,41 +228,33 @@ export class LocalMapsManagerService {
|
||||
|
||||
if(!zip){ throw `Cannot download ${zipUrl}`; }
|
||||
|
||||
this.utils.createFolderIfNotExist(mapPath);
|
||||
await ensureFolderExist(mapPath);
|
||||
|
||||
await zip.extract(null, mapPath);
|
||||
await zip.close();
|
||||
|
||||
unlinkSync(zipPath);
|
||||
|
||||
return mapPath;
|
||||
const localMap = await this.loadMapInfoFromPath(mapPath);
|
||||
localMap.bsaverInfo = map;
|
||||
|
||||
return localMap;
|
||||
}
|
||||
|
||||
public async exportMaps(version: BSVersion, maps: BsmLocalMap[], outPath: string){
|
||||
|
||||
const output = createWriteStream(outPath);
|
||||
const archive = archiver("zip", {zlib: {level: 9}});
|
||||
|
||||
archive.pipe(output);
|
||||
archive.on("error", (e) => {throw e});
|
||||
const archive = new Archive(outPath);
|
||||
|
||||
if(!maps || maps.length === 0){
|
||||
|
||||
const mapsFolder = await this.getMapsFolderPath(version);
|
||||
archive.directory(mapsFolder, false);
|
||||
|
||||
archive.addDirectory(mapsFolder, false);
|
||||
}
|
||||
else{
|
||||
|
||||
const mapsFolders = await this.getAbsoluteFolderOfMaps(maps, version);
|
||||
|
||||
for(const folder of mapsFolders){
|
||||
archive.directory(folder, path.basename(folder));
|
||||
}
|
||||
|
||||
const mapsFolders = maps.map(map => map.path);
|
||||
mapsFolders.forEach(maps => archive.addDirectory(maps));
|
||||
}
|
||||
|
||||
await archive.finalize();
|
||||
return archive.finalize()
|
||||
|
||||
}
|
||||
|
||||
@@ -281,9 +270,9 @@ export class LocalMapsManagerService {
|
||||
|
||||
const versionMapsPath = await this.getMapsFolderPath(version);
|
||||
|
||||
this.utils.createFolderIfNotExist(versionMapsPath);
|
||||
await ensureFolderExist(versionMapsPath);
|
||||
|
||||
copySync(downloadedMap, path.join(versionMapsPath, path.basename(downloadedMap)), {overwrite: true});
|
||||
copySync(downloadedMap.path, path.join(versionMapsPath, path.basename(downloadedMap.path)), {overwrite: true});
|
||||
|
||||
}
|
||||
|
||||
@@ -301,6 +290,4 @@ export class LocalMapsManagerService {
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistred(link));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -4,13 +4,24 @@ import { ipcMain } from "electron";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import { WindowManagerService } from "../window-manager.service";
|
||||
import { MSModel, MSModelType } from "shared/models/model-saber/model-saber.model";
|
||||
import { MSModel, MSModelType } from "../../../shared/models/models/model-saber.model";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BSLocalVersionService } from "../bs-local-version.service";
|
||||
import path from "path";
|
||||
import { RequestService } from "../request.service";
|
||||
import { copyFileSync } from "fs-extra";
|
||||
import sanitize from "sanitize-filename";
|
||||
import { Progression, ensureFolderExist, unlinkPath } from "../../helpers/fs.helpers";
|
||||
import { MODEL_FILE_EXTENSIONS, MODEL_TYPES, MODEL_TYPE_FOLDERS } from "../../../shared/models/models/constants";
|
||||
import { InstallationLocationService } from "../installation-location.service";
|
||||
import { Observable, Subscription, lastValueFrom, map } from "rxjs";
|
||||
import { readdir } from "fs/promises";
|
||||
import md5File from "md5-file";
|
||||
import { allSettled } from "../../../shared/helpers/promise.helpers";
|
||||
import { ModelSaberService } from "../thrid-party/model-saber/model-saber.service";
|
||||
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
|
||||
import { ArchiveProgress } from "shared/models/archive.interface";
|
||||
import { Archive } from "../../models/archive.class";
|
||||
|
||||
export class LocalModelsManagerService {
|
||||
|
||||
@@ -25,18 +36,13 @@ export class LocalModelsManagerService {
|
||||
ModelSaber: "modelsaber",
|
||||
};
|
||||
|
||||
private readonly MODEL_TYPE_FOLDER: Record<Exclude<MSModelType, "misc">, string> = {
|
||||
avatar: "CustomAvatars",
|
||||
bloq: "CustomNotes",
|
||||
platform: "CustomPlatforms",
|
||||
saber: "CustomSabers"
|
||||
}
|
||||
|
||||
private readonly deepLink: DeepLinkService;
|
||||
private readonly utils: UtilsService;
|
||||
private readonly windows: WindowManagerService;
|
||||
private readonly localVersion: BSLocalVersionService;
|
||||
private readonly installPaths: InstallationLocationService;
|
||||
private readonly request: RequestService;
|
||||
private readonly modelSaber: ModelSaberService;
|
||||
|
||||
private constructor(){
|
||||
this.deepLink = DeepLinkService.getInstance();
|
||||
@@ -44,6 +50,8 @@ export class LocalModelsManagerService {
|
||||
this.windows = WindowManagerService.getInstance();
|
||||
this.localVersion = BSLocalVersionService.getInstance();
|
||||
this.request = RequestService.getInstance();
|
||||
this.installPaths = InstallationLocationService.getInstance();
|
||||
this.modelSaber = ModelSaberService.getInstance();
|
||||
|
||||
this.deepLink.addLinkOpenedListener(this.DEEP_LINKS.ModelSaber, (link) => {
|
||||
log.info("DEEP-LINK RECEIVED FROM", this.DEEP_LINKS.ModelSaber, link);
|
||||
@@ -68,25 +76,51 @@ export class LocalModelsManagerService {
|
||||
|
||||
private async getModelFolderPath(type: MSModelType, version?: BSVersion): Promise<string>{
|
||||
|
||||
if(!version){ throw "will be implemented whith models management" }
|
||||
if(type === "misc"){ throw "model type not supported"; }
|
||||
const rootPath = !!version ? await this.localVersion.getVersionPath(version) : this.installPaths.sharedContentPath;
|
||||
const modelFolderPath = path.join(rootPath, MODEL_TYPE_FOLDERS[type]);
|
||||
|
||||
const versionPath = await this.localVersion.getVersionPath(version);
|
||||
const modelFolderPath = path.join(versionPath, this.MODEL_TYPE_FOLDER[type]);
|
||||
|
||||
this.utils.createFolderIfNotExist(modelFolderPath);
|
||||
await ensureFolderExist(modelFolderPath);
|
||||
|
||||
return modelFolderPath;
|
||||
|
||||
}
|
||||
|
||||
public async downloadModel(model: MSModel, version: BSVersion): Promise<string>{
|
||||
|
||||
const modelFolder = await this.getModelFolderPath(model.type, version);
|
||||
const modelDest = path.join(modelFolder, sanitize(path.basename(model.download)));
|
||||
public downloadModel(model: MSModel, version: BSVersion): Observable<Progression<BsmLocalModel>>{
|
||||
return new Observable<Progression<BsmLocalModel>>(subscriber => {
|
||||
|
||||
return this.request.downloadFile(model.download, modelDest);
|
||||
const subs: Subscription[] = [];
|
||||
|
||||
(async () => {
|
||||
|
||||
const modelFolder = await this.getModelFolderPath(model.type, version);
|
||||
const modelDest = path.join(modelFolder, sanitize(path.basename(model.download)));
|
||||
|
||||
let url = model.download.split("/");
|
||||
url[url.length - 1] = encodeURIComponent(url[url.length - 1]);
|
||||
|
||||
const download$ = this.request.downloadFile(url.join("/"), modelDest);
|
||||
|
||||
subs.push(download$.subscribe({ next: value => subscriber.next({...value, data: undefined}), error: e => subscriber.error(e) }));
|
||||
|
||||
const downloaded = await lastValueFrom(download$);
|
||||
|
||||
const res: BsmLocalModel = {
|
||||
path: downloaded.data,
|
||||
fileName: path.basename(downloaded.data),
|
||||
hash: await md5File(downloaded.data),
|
||||
type: model.type,
|
||||
model,
|
||||
version
|
||||
}
|
||||
|
||||
subscriber.next({...downloaded, data: res});
|
||||
|
||||
})().catch(err => subscriber.error(err)).then(() => subscriber.complete());
|
||||
|
||||
return () => {
|
||||
subs.forEach(sub => sub.unsubscribe());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async oneClickDownloadModel(model: MSModel): Promise<void>{
|
||||
@@ -99,18 +133,114 @@ export class LocalModelsManagerService {
|
||||
|
||||
const fisrtVersion = versions.shift();
|
||||
|
||||
const downloaded = await this.downloadModel(model, fisrtVersion);
|
||||
const downloaded = await lastValueFrom(this.downloadModel(model, fisrtVersion));
|
||||
|
||||
for(const version of versions){
|
||||
|
||||
const modelDest = path.join(await this.getModelFolderPath(model.type, version), path.basename(downloaded));
|
||||
const modelDest = path.join(await this.getModelFolderPath(model.type, version), path.basename(downloaded.data.path));
|
||||
|
||||
copyFileSync(downloaded, modelDest);
|
||||
copyFileSync(downloaded.data.path, modelDest);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async getModelsPaths(type: MSModelType, version?: BSVersion): Promise<string[]>{
|
||||
const modelsPath = await this.getModelFolderPath(type, version);
|
||||
const files = await readdir(modelsPath, {withFileTypes: true});
|
||||
|
||||
//return files.filter(file => file.isFile() && path.extname(file.name) === MODEL_FILE_EXTENSIONS[type]).map(file => path.join(modelsPath, file.name));
|
||||
return files.reduce((acc, file) => {
|
||||
if(!file.isFile() || path.extname(file.name) !== MODEL_FILE_EXTENSIONS[type]){ return acc; }
|
||||
acc.push(path.join(modelsPath, file.name));
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
|
||||
public getModels(type: MSModelType, version?: BSVersion): Observable<Progression<BsmLocalModel[]>>{
|
||||
|
||||
const progression: Progression<BsmLocalModel[]> = {
|
||||
total: 0,
|
||||
current: 0,
|
||||
data: null
|
||||
};
|
||||
|
||||
return new Observable<Progression<BsmLocalModel[]>>(subscriber => {
|
||||
(async () => {
|
||||
const modelsPaths = await this.getModelsPaths(type, version);
|
||||
progression.total = modelsPaths.length;
|
||||
|
||||
const models = await allSettled(modelsPaths.map(async modelPath => {
|
||||
|
||||
const hash = await md5File(modelPath)
|
||||
|
||||
const localModel: BsmLocalModel = {
|
||||
path: modelPath,
|
||||
fileName: path.basename(modelPath, MODEL_FILE_EXTENSIONS[type]),
|
||||
model: await this.modelSaber.getModelByHash(hash),
|
||||
type, hash, version
|
||||
}
|
||||
|
||||
progression.current++;
|
||||
|
||||
subscriber.next(progression);
|
||||
|
||||
return localModel;
|
||||
}));
|
||||
|
||||
progression.data = models;
|
||||
subscriber.next(progression);
|
||||
|
||||
})().catch(e => subscriber.error(e)).finally(() => subscriber.complete());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public exportModels(output: string, version?: BSVersion, models?: BsmLocalModel[]): Observable<Progression>{
|
||||
|
||||
return new Observable<Progression>(subscriber => {
|
||||
|
||||
const archive = new Archive(output);
|
||||
|
||||
(async () => {
|
||||
|
||||
if(models?.length){
|
||||
models.forEach(model => archive.addFile(model.path, path.join(MODEL_TYPE_FOLDERS[model.type], path.basename(model.path))));
|
||||
}
|
||||
else{
|
||||
for(const type of MODEL_TYPES){
|
||||
archive.addDirectory(await this.getModelFolderPath(type, version));
|
||||
}
|
||||
}
|
||||
|
||||
})().catch(e => subscriber.error(e)).then(() => (
|
||||
archive.finalize().subscribe(subscriber)
|
||||
));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public deleteModels(models: BsmLocalModel[]): Observable<Progression<BsmLocalModel[]>>{
|
||||
return new Observable<Progression<BsmLocalModel[]>>(subscriber => {
|
||||
(async () => {
|
||||
|
||||
const progression: Progression<BsmLocalModel[]> = {
|
||||
total: models.length,
|
||||
current: 0,
|
||||
data: []
|
||||
};
|
||||
|
||||
for(const model of models){
|
||||
await unlinkPath(model.path);
|
||||
progression.data.push(model);
|
||||
progression.current = progression.data.length;
|
||||
subscriber.next(progression);
|
||||
}
|
||||
|
||||
})().catch(e => subscriber.error(e)).finally(() => subscriber.complete());
|
||||
});
|
||||
}
|
||||
|
||||
public enableDeepLinks(): boolean{
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.registerDeepLink(link));
|
||||
}
|
||||
@@ -123,4 +253,10 @@ export class LocalModelsManagerService {
|
||||
return Array.from(Object.values(this.DEEP_LINKS)).every(link => this.deepLink.isDeepLinkRegistred(link));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export interface BsmLocalModelsProgress {
|
||||
total: number;
|
||||
loaded: number;
|
||||
models: MSModel[];
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import path from "path";
|
||||
import { BehaviorSubject, Observable } from "rxjs";
|
||||
import { BehaviorSubject, Observable, lastValueFrom } from "rxjs";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BSLocalVersionService } from "../bs-local-version.service";
|
||||
import { DeepLinkService } from "../deep-link.service";
|
||||
@@ -7,7 +7,7 @@ import { RequestService } from "../request.service";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import { LocalMapsManagerService } from "./local-maps-manager.service";
|
||||
import log from "electron-log"
|
||||
import { isValidUrl } from "../../helpers/url.helpers";
|
||||
import { isValidUrl } from "../../../shared/helpers/url.helpers";
|
||||
import { ipcMain } from "electron";
|
||||
import { WindowManagerService } from "../window-manager.service";
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
@@ -15,6 +15,7 @@ import { BPList, DownloadPlaylistProgression } from "shared/models/playlists/pla
|
||||
import { copyFileSync, readFileSync } from "fs";
|
||||
import { BeatSaverService } from "../thrid-party/beat-saver/beat-saver.service";
|
||||
import { copySync } from "fs-extra";
|
||||
import { ensureFolderExist, pathExist } from "../../helpers/fs.helpers";
|
||||
|
||||
export class LocalPlaylistsManagerService {
|
||||
|
||||
@@ -80,7 +81,7 @@ export class LocalPlaylistsManagerService {
|
||||
|
||||
const folder = path.join(versionFolder, this.PLAYLISTS_FOLDER);
|
||||
|
||||
await this.utils.createFolderIfNotExist(folder)
|
||||
await ensureFolderExist(folder)
|
||||
|
||||
return folder;
|
||||
|
||||
@@ -92,11 +93,11 @@ export class LocalPlaylistsManagerService {
|
||||
|
||||
const bpListDest = path.join(playlistFolder, path.basename(bpListUrlOrPath));
|
||||
|
||||
if(this.utils.pathExist(bpListUrlOrPath)){
|
||||
if(await pathExist(bpListUrlOrPath)){
|
||||
copyFileSync(bpListUrlOrPath, bpListDest);
|
||||
}
|
||||
else{
|
||||
await this.request.downloadFile(bpListUrlOrPath, bpListDest);
|
||||
await lastValueFrom(this.request.downloadFile(bpListUrlOrPath, bpListDest));
|
||||
}
|
||||
|
||||
return bpListDest;
|
||||
@@ -105,7 +106,7 @@ export class LocalPlaylistsManagerService {
|
||||
|
||||
private async readPlaylistFile(path: string): Promise<BPList>{
|
||||
|
||||
if(!this.utils.pathExist(path)){ throw `bplist file not exist at ${path}`; }
|
||||
if(!(await pathExist(path))){ throw `bplist file not exist at ${path}`; }
|
||||
|
||||
const rawContent = readFileSync(path).toString();
|
||||
|
||||
@@ -163,7 +164,7 @@ export class LocalPlaylistsManagerService {
|
||||
...res.value,
|
||||
current: null,
|
||||
downloadedMaps: [...res.value.downloadedMaps, map],
|
||||
mapsPath: [...res.value.mapsPath, mapPath],
|
||||
mapsPath: [...res.value.mapsPath, mapPath.path],
|
||||
progression
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* eslint-disable prefer-promise-reject-errors */
|
||||
import { BS_APP_ID, BS_DEPOT } from "../constants";
|
||||
import path from "path";
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import { BSVersion, PartialBSVersion } from 'shared/bs-version.interface';
|
||||
import { UtilsService } from "./utils.service";
|
||||
import { ChildProcessWithoutNullStreams, spawn, spawnSync } from "child_process";
|
||||
import log from "electron-log";
|
||||
@@ -9,6 +10,9 @@ import { ctrlc } from "ctrlc-windows";
|
||||
import { BSLocalVersionService } from "./bs-local-version.service";
|
||||
import isOnline from 'is-online';
|
||||
import { WindowManagerService } from "./window-manager.service";
|
||||
import { copy, copySync } from "fs-extra";
|
||||
import { clean, satisfies } from "semver";
|
||||
import { ensureFolderExist, pathExist } from "../helpers/fs.helpers";
|
||||
|
||||
export class BSInstallerService{
|
||||
|
||||
@@ -27,7 +31,7 @@ export class BSInstallerService{
|
||||
this.localVersionService = BSLocalVersionService.getInstance();
|
||||
this.windows = WindowManagerService.getInstance();
|
||||
|
||||
this.windows.getWindows("index.html")?.on("close", () => {
|
||||
this.windows.getWindow("index.html")?.on("close", () => {
|
||||
this.killDownloadProcess();
|
||||
});
|
||||
}
|
||||
@@ -37,8 +41,12 @@ export class BSInstallerService{
|
||||
return BSInstallerService.instance;
|
||||
}
|
||||
|
||||
private escapeSpaces(path: string): string{
|
||||
return `\"${path}\"`
|
||||
}
|
||||
|
||||
private getDepotDownloaderExePath(): string{
|
||||
return path.join(this.utils.getAssetsScriptsPath(), 'depot-downloader', 'DepotDownloader.exe');
|
||||
return this.escapeSpaces(path.join(this.utils.getAssetsScriptsPath(), 'depot-downloader', 'DepotDownloader.exe'));
|
||||
}
|
||||
|
||||
private removeSpecialSchar(txt: string): string{ return txt.replaceAll(/\[|\]/g, ""); }
|
||||
@@ -65,26 +73,38 @@ export class BSInstallerService{
|
||||
});
|
||||
}
|
||||
|
||||
public async isDotNet6Installed(): Promise<boolean>{
|
||||
public async isDotNet6Installed(): Promise<boolean>{
|
||||
try{
|
||||
const process = spawnSync(this.getDepotDownloaderExePath());
|
||||
const out = process.output.toString();
|
||||
if(out.includes(".NET runtime can be found at")){ return false; }
|
||||
const process = spawnSync(this.getDepotDownloaderExePath(), {shell: true});
|
||||
if(process.stderr.toString()){
|
||||
log.error("no dotnet", process.stderr.toString());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch(e){
|
||||
log.error("Error while checking .NET 6", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async downloadBsVersion(downloadInfos: DownloadInfo): Promise<DownloadEvent>{
|
||||
|
||||
// TODO : Can be a lot improved by using ipcV2 and Observable
|
||||
|
||||
if(this.downloadProcess && this.downloadProcess.connected){ throw "AlreadyDownloading"; }
|
||||
const {bsVersion} = downloadInfos;
|
||||
if(!bsVersion){ return {type: "[Error]"}; }
|
||||
if(!(await isOnline({timeout: 1500}))){ throw "no-internet"; }
|
||||
|
||||
this.utils.createFolderIfNotExist(this.installLocationService.versionsDirectory);
|
||||
await ensureFolderExist(this.installLocationService.versionsDirectory);
|
||||
|
||||
const versionPath = await this.localVersionService.getVersionPath(bsVersion)
|
||||
|
||||
const dest = !downloadInfos.isVerification ? await this.getPathNotAleardyExist(versionPath) : versionPath;
|
||||
|
||||
const downloadVersion: BSVersion = {...downloadInfos.bsVersion, ...(path.basename(dest) !== downloadInfos.bsVersion.BSVersion && {name: path.basename(dest)})}
|
||||
|
||||
this.downloadProcess = spawn(
|
||||
this.getDepotDownloaderExePath(),
|
||||
[
|
||||
@@ -92,12 +112,13 @@ export class BSInstallerService{
|
||||
`-depot ${BS_DEPOT}`,
|
||||
`-manifest ${bsVersion.BSManifest}`,
|
||||
`-username ${downloadInfos.username}`,
|
||||
`-dir \"${this.localVersionService.getVersionFolder(bsVersion)}\"`,
|
||||
(downloadInfos.stay || !downloadInfos.password) && "-remember-password"
|
||||
`-dir \"${this.localVersionService.getVersionFolder(downloadVersion)}\"`
|
||||
],
|
||||
{shell: true, cwd: this.installLocationService.versionsDirectory}
|
||||
);
|
||||
|
||||
this.utils.ipcSend("start-download-version", {success: true, data: downloadVersion});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
this.downloadProcess.stdout.on('data', data => {
|
||||
@@ -142,16 +163,25 @@ export class BSInstallerService{
|
||||
this.downloadProcess.stdout.on('error', (err) => {
|
||||
log.error("BS-DOWNLOAD ERROR", err.toString());
|
||||
this.killDownloadProcess();
|
||||
if(err.toString().includes(".NET") || err.toString().includes("dotnet") || err.toString().includes(".dll")){
|
||||
reject("dotnet");
|
||||
}
|
||||
reject();
|
||||
});
|
||||
this.downloadProcess.stderr.on('data', (err) => {
|
||||
log.error("BS-DOWNLOAD ERROR", err.toString());
|
||||
this.killDownloadProcess();
|
||||
if(err.toString().includes(".NET") || err.toString().includes("dotnet") || err.toString().includes(".dll")){
|
||||
reject("dotnet");
|
||||
}
|
||||
reject();
|
||||
});
|
||||
this.downloadProcess.stderr.on('error', (err) => {
|
||||
log.error("BS-DOWNLOAD ERROR", err.toString());
|
||||
this.killDownloadProcess();
|
||||
if(err.toString().includes(".NET") || err.toString().includes("dotnet") || err.toString().includes(".dll")){
|
||||
reject("dotnet");
|
||||
}
|
||||
reject();
|
||||
});
|
||||
|
||||
@@ -159,6 +189,34 @@ export class BSInstallerService{
|
||||
})
|
||||
}
|
||||
|
||||
private async getPathNotAleardyExist(path: string): Promise<string>{
|
||||
let destPath = path;
|
||||
let folderExist = await pathExist(destPath);
|
||||
let i = 0;
|
||||
|
||||
while(folderExist){
|
||||
i++;
|
||||
destPath = `${path} (${i})`;
|
||||
folderExist = await pathExist(destPath);
|
||||
}
|
||||
|
||||
return destPath
|
||||
}
|
||||
|
||||
public async importVersion(path: string): Promise<PartialBSVersion>{
|
||||
|
||||
const rawBsVersion = await this.localVersionService.getVersionOfBSFolder(path);
|
||||
|
||||
if(!rawBsVersion){ throw new Error("NOT_BS_FOLDER"); }
|
||||
|
||||
const destPath = await this.getPathNotAleardyExist(await this.localVersionService.getVersionPath(rawBsVersion));
|
||||
|
||||
await copy(path, destPath, {dereference: true});
|
||||
|
||||
return rawBsVersion;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -168,12 +226,13 @@ export interface DownloadInfo {
|
||||
bsVersion: BSVersion,
|
||||
username: string,
|
||||
password?: string,
|
||||
stay?: boolean
|
||||
stay?: boolean,
|
||||
isVerification: boolean
|
||||
}
|
||||
|
||||
export interface DownloadEvent{
|
||||
type: DownloadEventType,
|
||||
data?: unknown,
|
||||
data?: unknown
|
||||
}
|
||||
|
||||
export type DownloadEventType = "[Password]" | "[Guard]" | "[2FA]" | "[Progress]" | "[Validated]" | "[Finished]" | "[AlreadyDownloading]" | "[Error]" | "[Warning]" | "[SteamID]" | "[Exit]" | "[NoInternet]";
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import path from "path";
|
||||
import { LaunchResult, LauchOption } from "shared/models/bs-launch";
|
||||
import { UtilsService } from "./utils.service";
|
||||
import { BS_EXECUTABLE, BS_APP_ID } from "../constants";
|
||||
import { BS_EXECUTABLE, BS_APP_ID, STEAMVR_APP_ID } from "../constants";
|
||||
import { ChildProcessWithoutNullStreams, spawn } from "child_process";
|
||||
import { SteamService } from "./steam.service";
|
||||
import { BSLocalVersionService } from "./bs-local-version.service";
|
||||
import { OculusService } from "./oculus.service";
|
||||
import { pathExist } from "../helpers/fs.helpers";
|
||||
import { rename } from "fs/promises";
|
||||
import log from "electron-log";
|
||||
import { timer } from "rxjs";
|
||||
|
||||
export class BSLauncherService{
|
||||
|
||||
@@ -30,27 +34,73 @@ export class BSLauncherService{
|
||||
this.localVersionService = BSLocalVersionService.getInstance();
|
||||
}
|
||||
|
||||
private getSteamVRPath(): Promise<string>{
|
||||
return this.steamService.getGameFolder(STEAMVR_APP_ID, "SteamVR");
|
||||
}
|
||||
|
||||
private async backupSteamVR(): Promise<void>{
|
||||
const steamVrFolder = await this.getSteamVRPath();
|
||||
if(!await pathExist(steamVrFolder)){ return; }
|
||||
return rename(steamVrFolder, steamVrFolder + ".bak").catch(log.error);
|
||||
}
|
||||
|
||||
public async restoreSteamVR(): Promise<void>{
|
||||
const steamVrFolder = await this.getSteamVRPath();
|
||||
const steamVrBackup = steamVrFolder + ".bak";
|
||||
if(!await pathExist(steamVrBackup)){ return; }
|
||||
return rename(steamVrFolder + ".bak", steamVrFolder).catch(log.error);
|
||||
}
|
||||
|
||||
public isBsRunning(): boolean{
|
||||
return this.bsProcess?.connected || this.utilsService.taskRunning(BS_EXECUTABLE);
|
||||
return this.bsProcess?.connected || this.utilsService.taskRunning(BS_EXECUTABLE) === true;
|
||||
}
|
||||
|
||||
public async launch(launchOptions: LauchOption): Promise<LaunchResult>{
|
||||
if(launchOptions.version.oculus && !this.oculusService.oculusRunning()){ return "OCULUS_NOT_RUNNING" }
|
||||
if(!launchOptions.version.oculus && !this.steamService.steamRunning()){ return "STEAM_NOT_RUNNING" }
|
||||
if(this.isBsRunning()){ return "BS_ALREADY_RUNNING" }
|
||||
if(launchOptions.version.oculus && this.oculusService.oculusRunning() === false){ return "OCULUS_NOT_RUNNING" }
|
||||
if(!launchOptions.version.oculus && this.steamService.steamRunning() === false){ return "STEAM_NOT_RUNNING" }
|
||||
if(this.isBsRunning() === true){ return "BS_ALREADY_RUNNING" }
|
||||
|
||||
const cwd = await this.localVersionService.getVersionPath(launchOptions.version);
|
||||
const exePath = path.join(cwd, BS_EXECUTABLE);
|
||||
|
||||
if(!this.utilsService.pathExist(exePath)){ return "EXE_NOT_FINDED"; }
|
||||
if(!(await pathExist(exePath))){ return "EXE_NOT_FINDED"; }
|
||||
|
||||
const launchMods = [launchOptions.oculus && "-vrmode oculus", launchOptions.desktop && "fpfc", launchOptions.debug && "--verbose"];
|
||||
let launchArgs = [];
|
||||
|
||||
this.bsProcess = spawn(`\"${exePath}\"`, launchMods, {shell: true, cwd, env: {...process.env, "SteamAppId": BS_APP_ID}});
|
||||
if(!launchOptions.version.steam && !launchOptions.version.oculus){ launchArgs.push("--no-yeet"); }
|
||||
if(launchOptions.oculus){ launchArgs.push("-vrmode oculus"); }
|
||||
if(launchOptions.desktop){ launchArgs.push("fpfc"); }
|
||||
if(launchOptions.debug){ launchArgs.push("--verbose"); }
|
||||
if(launchOptions.additionalArgs){ launchArgs.push(...launchOptions.additionalArgs); }
|
||||
|
||||
this.bsProcess.on('message', msg => { /** EMIT HERE **/ });
|
||||
this.bsProcess.on('error', err => { /** EMIT HERE **/ });
|
||||
this.bsProcess.on('exit', code => this.utilsService.ipcSend("bs-launch.exit", {data: code, success: code === 0}));
|
||||
launchArgs = Array.from(new Set(launchArgs).values());
|
||||
|
||||
let restoreTimout: NodeJS.Timeout;
|
||||
|
||||
if(launchArgs.includes("fpfc")){
|
||||
await this.backupSteamVR().catch(() => {
|
||||
this.restoreSteamVR();
|
||||
}).finally(() => {
|
||||
restoreTimout = setTimeout(() => this.restoreSteamVR(), 35_000);
|
||||
});
|
||||
await timer(2_000).toPromise();
|
||||
}
|
||||
else{
|
||||
await this.restoreSteamVR();
|
||||
}
|
||||
|
||||
if(launchOptions.debug){
|
||||
this.bsProcess = spawn(`\"${exePath}\"`, launchArgs, {shell: true, cwd, env: {...process.env, "SteamAppId": BS_APP_ID}, detached: true, windowsVerbatimArguments: true });
|
||||
}
|
||||
else{
|
||||
this.bsProcess = spawn(`\"${exePath}\"`, launchArgs, {shell: true, cwd, env: {...process.env, "SteamAppId": BS_APP_ID} });
|
||||
}
|
||||
|
||||
this.bsProcess.on('error', err => log.error(err));
|
||||
this.bsProcess.on('exit', code => {
|
||||
this.restoreSteamVR().finally(() => clearTimeout(restoreTimout));
|
||||
this.utilsService.ipcSend("bs-launch.exit", {data: code, success: code === 0})
|
||||
});
|
||||
|
||||
return "LAUNCHED";
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { BSVersionLibService } from "./bs-version-lib.service";
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import { BSVersion, PartialBSVersion } from 'shared/bs-version.interface';
|
||||
import { InstallationLocationService } from "./installation-location.service";
|
||||
import { SteamService } from "./steam.service";
|
||||
import { UtilsService } from "./utils.service";
|
||||
import { BS_APP_ID, OCULUS_BS_DIR } from "../constants";
|
||||
import path from "path";
|
||||
import { createInterface } from "readline";
|
||||
import { createReadStream } from "fs";
|
||||
import fs from "fs-extra";
|
||||
import { ConfigurationService } from "./configuration.service";
|
||||
import { rename } from "fs/promises";
|
||||
import { BsmException } from "shared/models/bsm-exception.model";
|
||||
import log from "electron-log";
|
||||
import { OculusService } from "./oculus.service";
|
||||
import { DownloadLinkType } from "shared/models/mods";
|
||||
import sanitize from "sanitize-filename";
|
||||
import { copyDirectoryWithJunctions, deleteFolder, getFoldersInFolder, pathExist } from "../helpers/fs.helpers";
|
||||
import { FolderLinkerService } from "./folder-linker.service";
|
||||
|
||||
export class BSLocalVersionService{
|
||||
|
||||
@@ -22,46 +22,57 @@ export class BSLocalVersionService{
|
||||
private readonly CUSTOM_VERSIONS_KEY = "custom-versions";
|
||||
|
||||
private readonly installLocationService: InstallationLocationService;
|
||||
private readonly utilsService: UtilsService;
|
||||
private readonly steamService: SteamService;
|
||||
private readonly oculusService: OculusService;
|
||||
private readonly remoteVersionService: BSVersionLibService;
|
||||
private readonly configService: ConfigurationService;
|
||||
private readonly linker: FolderLinkerService;
|
||||
|
||||
public static getInstance(): BSLocalVersionService{
|
||||
if(!BSLocalVersionService.instance){ BSLocalVersionService.instance = new BSLocalVersionService(); }
|
||||
return BSLocalVersionService.instance;
|
||||
}
|
||||
|
||||
private constructor(){
|
||||
this.installLocationService = InstallationLocationService.getInstance();
|
||||
this.utilsService = UtilsService.getInstance();
|
||||
this.steamService = SteamService.getInstance();
|
||||
this.oculusService = OculusService.getInstance();
|
||||
this.remoteVersionService = BSVersionLibService.getInstance();
|
||||
this.configService = ConfigurationService.getInstance();
|
||||
}
|
||||
private constructor(){
|
||||
this.installLocationService = InstallationLocationService.getInstance();
|
||||
this.steamService = SteamService.getInstance();
|
||||
this.oculusService = OculusService.getInstance();
|
||||
this.remoteVersionService = BSVersionLibService.getInstance();
|
||||
this.configService = ConfigurationService.getInstance();
|
||||
this.linker = FolderLinkerService.getInstance();
|
||||
}
|
||||
|
||||
private async getVersionOfBSFolder(bsPath: string): Promise<string>{
|
||||
|
||||
|
||||
public async getVersionOfBSFolder(bsPath: string): Promise<PartialBSVersion>{
|
||||
const versionFilePath = path.join(bsPath, 'Beat Saber_Data', 'globalgamemanagers');
|
||||
if(!this.utilsService.pathExist(versionFilePath)){ return null; }
|
||||
if(!(await pathExist(versionFilePath))){ return null; }
|
||||
const versionsAvailable = await this.remoteVersionService.getAvailableVersions();
|
||||
return new Promise<string>(resolve => {
|
||||
const readLine = createInterface({ input: createReadStream(versionFilePath) });
|
||||
let findVersion: string = null;
|
||||
readLine.on('line', (line) => {
|
||||
return new Promise<PartialBSVersion>(resolve => {
|
||||
const stream = createReadStream(versionFilePath);
|
||||
let findVersion: PartialBSVersion = null;
|
||||
stream.on('data', (line) => {
|
||||
line = line.toString();
|
||||
for(const version of versionsAvailable){
|
||||
if(line.includes(version.BSVersion)){
|
||||
findVersion = version.BSVersion;
|
||||
readLine.close();
|
||||
findVersion = {BSVersion: version.BSVersion};
|
||||
if(findVersion.BSVersion !== path.basename(bsPath)){
|
||||
findVersion.name = path.basename(bsPath);
|
||||
}
|
||||
stream.close();
|
||||
stream.destroy();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
readLine.on('close', () => {
|
||||
stream.on('end', () => {
|
||||
if(findVersion){ resolve(findVersion) }
|
||||
resolve(findVersion);
|
||||
});
|
||||
stream.on('close', () => {
|
||||
if(findVersion){ resolve(findVersion) }
|
||||
resolve(findVersion);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -92,11 +103,11 @@ export class BSLocalVersionService{
|
||||
}
|
||||
|
||||
private removeSpecialChar(seq: string): string{
|
||||
return seq.replace( /[<>:"\/\\|?*]+/g, '' );
|
||||
return sanitize(seq);
|
||||
}
|
||||
|
||||
public getVersionFolder(version: BSVersion){
|
||||
return version.name ? `${version.BSVersion}-${version.name}` : version.BSVersion;
|
||||
public getVersionFolder(version: BSVersion): string{
|
||||
return version.name ?? version.BSVersion;
|
||||
}
|
||||
|
||||
public getVersionType(version: BSVersion): DownloadLinkType{
|
||||
@@ -107,10 +118,11 @@ export class BSLocalVersionService{
|
||||
|
||||
private async getSteamVersion(): Promise<BSVersion>{
|
||||
const steamBsFolder = await this.steamService.getGameFolder(BS_APP_ID, "Beat Saber");
|
||||
if(!steamBsFolder || !this.utilsService.pathExist(steamBsFolder)){ return null; }
|
||||
if(!steamBsFolder || !(await pathExist(steamBsFolder))){ return null; }
|
||||
const steamBsVersion = await this.getVersionOfBSFolder(steamBsFolder);
|
||||
|
||||
if(!steamBsVersion){ return null; }
|
||||
const version = await this.remoteVersionService.getVersionDetails(steamBsVersion);
|
||||
const version = await this.remoteVersionService.getVersionDetails(steamBsVersion.BSVersion);
|
||||
if(!version){ return null; }
|
||||
return {...version, steam: true};
|
||||
}
|
||||
@@ -120,51 +132,58 @@ export class BSLocalVersionService{
|
||||
if(!oculusBsFolder){ return null; }
|
||||
const oculusBsVersion = await this.getVersionOfBSFolder(oculusBsFolder);
|
||||
if(!oculusBsVersion){ return null; }
|
||||
const version = await this.remoteVersionService.getVersionDetails(oculusBsVersion);
|
||||
const version = await this.remoteVersionService.getVersionDetails(oculusBsVersion.BSVersion);
|
||||
if(!version){ return null; }
|
||||
return {...version, oculus: true};
|
||||
}
|
||||
|
||||
public async getInstalledVersions(): Promise<BSVersion[]>{
|
||||
|
||||
const versions: BSVersion[] = [];
|
||||
const steamVersion = await this.getSteamVersion();
|
||||
if(steamVersion){ versions.push(steamVersion); }
|
||||
const oculusVersion = await this.getOculusVersion();
|
||||
if(oculusVersion){ versions.push(oculusVersion); }
|
||||
const versions: BSVersion[] = [];
|
||||
|
||||
if(!this.utilsService.pathExist(this.installLocationService.versionsDirectory)){ return versions }
|
||||
const steamVersion = await this.getSteamVersion();
|
||||
if(steamVersion){ versions.push(steamVersion); }
|
||||
|
||||
const folderInInstallation = this.utilsService.listDirsInDir(this.installLocationService.versionsDirectory);
|
||||
for(const f of folderInInstallation){
|
||||
log.info("try get version from folder", f);
|
||||
let version = await this.remoteVersionService.getVersionDetails(f);
|
||||
if(version){ version = this.getCustomVersions().find(v => v.BSVersion === version.BSVersion && v.name === version.name) ?? version; }
|
||||
else { version = this.getCustomVersions().find(v => {
|
||||
const [version, ...rest] = f.split("-");
|
||||
if(rest.length < 1){ return false; }
|
||||
const name = rest.join("-");
|
||||
return name === v.name && version === v.BSVersion;
|
||||
})
|
||||
}
|
||||
version && versions.push(version);
|
||||
};
|
||||
this.setCustomVersions(versions.filter(v => !!v.name || !!v.color));
|
||||
return versions;
|
||||
const oculusVersion = await this.getOculusVersion();
|
||||
if(oculusVersion){ versions.push(oculusVersion); }
|
||||
|
||||
if(!(await pathExist(this.installLocationService.versionsDirectory))){ return versions }
|
||||
|
||||
const folderInInstallation = await getFoldersInFolder(this.installLocationService.versionsDirectory);
|
||||
|
||||
for(const f of folderInInstallation){
|
||||
log.info("try get version from folder", f);
|
||||
const rawVersion = await this.getVersionOfBSFolder(f);
|
||||
if(!rawVersion){ continue; }
|
||||
const bsVersion = {...await this.remoteVersionService.getVersionDetails(rawVersion.BSVersion)};
|
||||
if(!bsVersion){ continue; }
|
||||
bsVersion.name = path.basename(f) !== bsVersion.BSVersion ? path.basename(f) : undefined;
|
||||
|
||||
const customVersion = this.getCustomVersions().find(custom => custom.BSVersion === bsVersion.BSVersion && custom.name === bsVersion.name);
|
||||
|
||||
if(customVersion){
|
||||
bsVersion.color = customVersion.color;
|
||||
}
|
||||
|
||||
versions.push(bsVersion);
|
||||
};
|
||||
this.setCustomVersions(versions.filter(v => !!v.color));
|
||||
|
||||
return versions;
|
||||
}
|
||||
|
||||
public async deleteVersion(version: BSVersion): Promise<boolean>{
|
||||
if(version.steam || version.oculus){ return false; }
|
||||
const versionFolder = await this.getVersionPath(version);
|
||||
if(!this.utilsService.pathExist(versionFolder)){ return true; }
|
||||
if(!(await pathExist(versionFolder))){ return true; }
|
||||
|
||||
return this.utilsService.deleteFolder(versionFolder)
|
||||
return deleteFolder(versionFolder)
|
||||
.then(() => { return true; })
|
||||
.catch(() => { return false; })
|
||||
}
|
||||
|
||||
public async editVersion(version: BSVersion, name: string, color: string): Promise<BSVersion>{
|
||||
if(version.steam || version.oculus){ throw {title: "CantEditSteam", msg: "CantEditSteam"} as BsmException; }
|
||||
if(version.steam || version.oculus){ throw {title: "CantEditSteam", message: "CantEditSteam"} as BsmException; }
|
||||
const oldPath = await this.getVersionPath(version);
|
||||
const editedVersion: BSVersion = version.BSVersion === name
|
||||
? {...version, name: undefined, color}
|
||||
@@ -177,14 +196,15 @@ export class BSLocalVersionService{
|
||||
return editedVersion;
|
||||
}
|
||||
|
||||
if(this.utilsService.pathExist(newPath)){ throw {title: "VersionAlreadExist"} as BsmException; }
|
||||
if((await pathExist(newPath)) && newPath === oldPath){ throw {title: "VersionAlreadExist"} as BsmException; }
|
||||
|
||||
return rename(oldPath, newPath).then(() => {
|
||||
this.deleteCustomVersion(version);
|
||||
this.addCustomVersion(editedVersion);
|
||||
return editedVersion;
|
||||
}).catch((err: Error) => {
|
||||
throw {title: "CantRename", error: err} as BsmException;
|
||||
log.error("edit version error", err, version, name, color);
|
||||
throw {title: "CantRename", ...err} as BsmException;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -198,18 +218,31 @@ export class BSLocalVersionService{
|
||||
if(originPath === newPath){
|
||||
this.deleteCustomVersion(version);
|
||||
this.addCustomVersion(cloneVersion);
|
||||
return cloneVersion;
|
||||
}
|
||||
|
||||
if(this.utilsService.pathExist(newPath)){ throw {title: "VersionAlreadExist"} as BsmException; }
|
||||
if(await pathExist(newPath)){ throw {title: "VersionAlreadExist"} as BsmException; }
|
||||
|
||||
return fs.copy(originPath, newPath, {dereference: true}).then(() => {
|
||||
return copyDirectoryWithJunctions(originPath, newPath).then(() => {
|
||||
this.addCustomVersion(cloneVersion);
|
||||
return cloneVersion;
|
||||
}).catch((err: Error) => {
|
||||
log.error("CLONE", err, version);
|
||||
throw {title: "CantClone", error: err} as BsmException
|
||||
log.error("clone version error", err, version, name, color);
|
||||
throw {title: "CantClone", ...err} as BsmException
|
||||
})
|
||||
}
|
||||
|
||||
public async getLinkedFolders(version: BSVersion): Promise<string[]>{
|
||||
const versionPath = await this.getVersionPath(version);
|
||||
const [rootFolders, beatSaberDataFolders] = await Promise.all([
|
||||
getFoldersInFolder(versionPath),
|
||||
getFoldersInFolder(path.join(versionPath, "Beat Saber_Data"))
|
||||
]);
|
||||
|
||||
const linkedFolder = Promise.all([...rootFolders, ...beatSaberDataFolders].map(async folder => {
|
||||
if(!(await this.linker.isFolderSymlink(folder))){ return null; }
|
||||
return folder;
|
||||
}));
|
||||
|
||||
return (await linkedFolder).filter(folder => folder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { get } from 'https'
|
||||
import { UtilsService } from './utils.service';
|
||||
import path from 'path';
|
||||
import { writeFileSync } from 'fs';
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import { RequestService } from "./request.service"
|
||||
import isOnline from 'is-online';
|
||||
import { readJSON } from 'fs-extra';
|
||||
import { allSettled } from '../../shared/helpers/promise.helpers';
|
||||
|
||||
export class BSVersionLibService{
|
||||
|
||||
@@ -30,13 +30,12 @@ export class BSVersionLibService{
|
||||
}
|
||||
|
||||
private getRemoteVersions(): Promise<BSVersion[]>{
|
||||
return this.requestService.get<BSVersion[]>(this.REMOTE_BS_VERSIONS_URL);
|
||||
return this.requestService.getJSON<BSVersion[]>(this.REMOTE_BS_VERSIONS_URL);
|
||||
}
|
||||
|
||||
private async getLocalVersions(): Promise<BSVersion[]>{
|
||||
const localVersionsPath = path.join(this.utilsService.getAssestsJsonsPath(), this.VERSIONS_FILE);
|
||||
const rawVersion = (await this.utilsService.readFileAsync(localVersionsPath)).toString();
|
||||
return JSON.parse(rawVersion);
|
||||
return readJSON(localVersionsPath);
|
||||
}
|
||||
|
||||
private async updateLocalVersions(versions: BSVersion[]): Promise<void>{
|
||||
@@ -44,16 +43,19 @@ export class BSVersionLibService{
|
||||
writeFileSync(localVersionsPath, JSON.stringify(versions, null, "\t"), {encoding: 'utf-8', flag: 'w'});
|
||||
};
|
||||
|
||||
private async loadBsVersions(): Promise<BSVersion[]>{
|
||||
if(this.bsVersions){ return this.bsVersions; }
|
||||
const [localVersions, remoteVersions] = await Promise.all([
|
||||
this.getLocalVersions(), (await isOnline({timeout: 1500}) && this.getRemoteVersions())
|
||||
]);
|
||||
let resVersions = localVersions;
|
||||
if(remoteVersions && remoteVersions.length){ resVersions = remoteVersions; this.updateLocalVersions(resVersions); }
|
||||
this.bsVersions = resVersions;
|
||||
return this.bsVersions;
|
||||
}
|
||||
private async loadBsVersions(): Promise<BSVersion[]>{
|
||||
|
||||
if(this.bsVersions){ return this.bsVersions; }
|
||||
|
||||
const [localVersions, remoteVersions] = await allSettled([
|
||||
this.getLocalVersions(), this.getRemoteVersions()
|
||||
], {keepStructure: true});
|
||||
|
||||
let resVersions = localVersions;
|
||||
if(remoteVersions && remoteVersions.length){ resVersions = remoteVersions; this.updateLocalVersions(resVersions); }
|
||||
this.bsVersions = resVersions;
|
||||
return this.bsVersions;
|
||||
}
|
||||
|
||||
public async getAvailableVersions(): Promise<BSVersion[]>{
|
||||
const bsVersions = await this.loadBsVersions();
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
import { InstallationLocationService } from "./installation-location.service";
|
||||
import log from "electron-log";
|
||||
import { deleteFolder, ensureFolderExist, moveFolderContent, pathExist, unlinkPath } from "../helpers/fs.helpers";
|
||||
import { lstat, symlink } from "fs/promises";
|
||||
import path from "path";
|
||||
import { copy, readlink } from "fs-extra";
|
||||
|
||||
export class FolderLinkerService {
|
||||
|
||||
private static instance: FolderLinkerService;
|
||||
|
||||
public static getInstance(): FolderLinkerService {
|
||||
if (!FolderLinkerService.instance) {
|
||||
FolderLinkerService.instance = new FolderLinkerService();
|
||||
}
|
||||
return FolderLinkerService.instance;
|
||||
}
|
||||
|
||||
private readonly installLocationService = InstallationLocationService.getInstance();
|
||||
|
||||
private constructor(){
|
||||
this.installLocationService = InstallationLocationService.getInstance();
|
||||
}
|
||||
|
||||
private get sharedFolder(): string{
|
||||
return this.installLocationService.sharedContentPath;
|
||||
}
|
||||
|
||||
private getSharedFolder(folderPath: string, intermediateFolder?: string): string {
|
||||
return path.join(this.sharedFolder, intermediateFolder ?? "", path.basename(folderPath));
|
||||
}
|
||||
|
||||
private getBackupFolder(folderPath: string): string {
|
||||
return folderPath + "_backup";
|
||||
}
|
||||
|
||||
private async backupFolder(folderPath: string): Promise<void> {
|
||||
if(!await pathExist(folderPath)){ return; }
|
||||
return copy(folderPath, this.getBackupFolder(folderPath), { overwrite: true, errorOnExist: false });
|
||||
}
|
||||
|
||||
private async restoreFolder(folderPath: string): Promise<void> {
|
||||
if(!await pathExist( this.getBackupFolder(folderPath) )){ return; }
|
||||
return copy(this.getBackupFolder(folderPath), folderPath, { overwrite: true, errorOnExist: false }).then(() => {
|
||||
return deleteFolder(this.getBackupFolder(folderPath));
|
||||
});
|
||||
}
|
||||
|
||||
public async linkFolder(folderPath: string, options?: LinkOptions): Promise<void> {
|
||||
|
||||
const sharedPath = this.getSharedFolder(folderPath, options?.intermediateFolder);
|
||||
|
||||
if(await this.isFolderSymlink(folderPath)){
|
||||
const isTargetedToSharedPath = await readlink(folderPath).then(target => target === sharedPath).catch(() => false);
|
||||
if(isTargetedToSharedPath){ return; }
|
||||
await unlinkPath(folderPath);
|
||||
return symlink(sharedPath, folderPath, "junction");
|
||||
}
|
||||
|
||||
await ensureFolderExist(sharedPath);
|
||||
|
||||
if(options?.backup === true){
|
||||
await this.backupFolder(folderPath);
|
||||
}
|
||||
|
||||
await ensureFolderExist(folderPath);
|
||||
|
||||
if(options?.keepContents !== false){
|
||||
await moveFolderContent(folderPath, sharedPath).toPromise();
|
||||
}
|
||||
|
||||
await deleteFolder(folderPath);
|
||||
|
||||
return symlink(sharedPath, folderPath, "junction");
|
||||
}
|
||||
|
||||
public async unlinkFolder(folderPath: string, options?: UnlinkOptions): Promise<void> {
|
||||
|
||||
if(!(await this.isFolderSymlink(folderPath))){ return; }
|
||||
await unlinkPath(folderPath);
|
||||
|
||||
const sharedPath = this.getSharedFolder(folderPath, options?.intermediateFolder);
|
||||
|
||||
await ensureFolderExist(folderPath);
|
||||
|
||||
if(options?.backup === true){
|
||||
return this.restoreFolder(folderPath);
|
||||
}
|
||||
|
||||
if(options.moveContents === true){
|
||||
return moveFolderContent(sharedPath, folderPath).toPromise().then(() => {});
|
||||
}
|
||||
|
||||
if(options?.keepContents === false){ return; }
|
||||
|
||||
await ensureFolderExist(sharedPath);
|
||||
|
||||
return copy(sharedPath, folderPath, { errorOnExist: false, recursive: true });
|
||||
}
|
||||
|
||||
public async isFolderSymlink(folder: string): Promise<boolean> {
|
||||
try{
|
||||
if(!(await pathExist(folder))){ return false; }
|
||||
return lstat(folder).then(stat => stat.isSymbolicLink());
|
||||
}
|
||||
catch(e){
|
||||
log.error(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export interface LinkOptions {
|
||||
keepContents?: boolean,
|
||||
intermediateFolder?: string,
|
||||
backup?: boolean,
|
||||
}
|
||||
|
||||
export interface UnlinkOptions extends LinkOptions {
|
||||
moveContents?: boolean,
|
||||
};
|
||||
@@ -1,10 +1,8 @@
|
||||
import path from "path";
|
||||
import { UtilsService } from "./utils.service";
|
||||
import fs from 'fs-extra';
|
||||
import log from "electron-log";
|
||||
import { app } from "electron";
|
||||
import { BsmException } from "shared/models/bsm-exception.model";
|
||||
import ElectronStore from "electron-store";
|
||||
import { copyDirectoryWithJunctions, deleteFolder, ensureFolderExist } from "../helpers/fs.helpers";
|
||||
|
||||
export class InstallationLocationService {
|
||||
|
||||
@@ -19,10 +17,8 @@ export class InstallationLocationService {
|
||||
private readonly VERSIONS_FOLDER = "BSInstances";
|
||||
|
||||
private readonly SHARED_CONTENT_FOLDER = "SharedContent";
|
||||
private readonly SHARED_MAPS_FOLDER = "SharedMaps";
|
||||
|
||||
private readonly STORE_INSTALLATION_PATH_KEY = "installation-folder";
|
||||
private readonly utilsService: UtilsService;
|
||||
|
||||
private readonly installPathConfig: ElectronStore;
|
||||
private readonly updateListeners: Set<Listener> = new Set();
|
||||
@@ -31,7 +27,6 @@ export class InstallationLocationService {
|
||||
|
||||
private constructor(){
|
||||
this.installPathConfig = new ElectronStore({watch: true});
|
||||
this.utilsService = UtilsService.getInstance();
|
||||
this.initInstallationLocation();
|
||||
|
||||
this.installPathConfig.onDidChange(this.STORE_INSTALLATION_PATH_KEY, () => {
|
||||
@@ -50,16 +45,25 @@ export class InstallationLocationService {
|
||||
public setInstallationDirectory(newDir: string): Promise<string>{
|
||||
const oldDir = this.installationDirectory;
|
||||
const newDest = path.join(newDir, this.INSTALLATION_FOLDER);
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
if(!this.utilsService.pathExist(oldDir)){ this.utilsService.createFolderIfNotExist(oldDir); }
|
||||
fs.move(oldDir, newDest, { overwrite: true }).then(() => {
|
||||
return new Promise<string>(async (resolve, reject) => {
|
||||
|
||||
await ensureFolderExist(oldDir);
|
||||
|
||||
try{
|
||||
await copyDirectoryWithJunctions(oldDir, newDest, {overwrite: true});
|
||||
|
||||
this._installationDirectory = newDir;
|
||||
this.installPathConfig.set(this.STORE_INSTALLATION_PATH_KEY, newDir);
|
||||
resolve(this.installationDirectory);
|
||||
}).catch((err: Error) => {
|
||||
reject({title: "CantMoveFolder", error: err} as BsmException);
|
||||
|
||||
deleteFolder(oldDir);
|
||||
|
||||
return resolve(this.installationDirectory);
|
||||
}
|
||||
catch(err){
|
||||
log.error(err);
|
||||
})
|
||||
reject(err);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,7 +76,6 @@ export class InstallationLocationService {
|
||||
public get versionsDirectory(): string { return path.join(this.installationDirectory, this.VERSIONS_FOLDER); }
|
||||
|
||||
public get sharedContentPath(): string { return path.join(this.installationDirectory, this.SHARED_CONTENT_FOLDER); }
|
||||
public get sharedMapsPath(): string { return path.join(this.sharedContentPath, this.SHARED_MAPS_FOLDER); }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
import { IpcRequest } from "shared/models/ipc";
|
||||
import { ipcMain } from "electron";
|
||||
import { Observable } from "rxjs";
|
||||
import { IpcChannel, IpcCompleteChannel, IpcErrorChannel } from "shared/models/ipc/ipc-response.interface";
|
||||
import { AppWindow } from "shared/models/window-manager/app-window.model";
|
||||
import { WindowManagerService } from "./window-manager.service";
|
||||
import { IpcReplier } from "shared/models/ipc/ipc-request.interface";
|
||||
import log from "electron-log";
|
||||
|
||||
export class IpcService {
|
||||
|
||||
private static instance: IpcService;
|
||||
|
||||
public static getInstance(): IpcService {
|
||||
if (!IpcService.instance) { IpcService.instance = new IpcService(); }
|
||||
return IpcService.instance;
|
||||
}
|
||||
|
||||
private readonly windows: WindowManagerService;
|
||||
|
||||
private constructor() {
|
||||
this.windows = WindowManagerService.getInstance();
|
||||
}
|
||||
|
||||
private getErrorChannel(channel: IpcChannel): IpcErrorChannel {
|
||||
return `${channel}_error`;
|
||||
}
|
||||
|
||||
private getCompleteChannel(channel: IpcChannel): IpcCompleteChannel {
|
||||
return `${channel}_complete`;
|
||||
}
|
||||
|
||||
private buildProxyListener<T>(listener: (req: IpcRequest<T>, replier: IpcReplier) => void) {
|
||||
|
||||
return (event: Electron.IpcMainEvent, req: IpcRequest<T>) => {
|
||||
const window = this.windows.getAppWindowFromWebContents(event.sender);
|
||||
const replier = (data: Observable<unknown>) => this.connectStream(req.responceChannel, window, data);
|
||||
listener(req, replier);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public send<T>(channel: IpcChannel, window: AppWindow, response?: T|Error): void{
|
||||
this.windows.getWindow(window)?.webContents?.send(channel, response);
|
||||
}
|
||||
|
||||
public connectStream(channel: IpcChannel, window: AppWindow, observable: Observable<unknown>): void{
|
||||
observable.subscribe(data => {
|
||||
this.send(channel, window, data);
|
||||
}, error => {
|
||||
log.error(error);
|
||||
this.send(this.getErrorChannel(channel), window, error);
|
||||
}, () => {
|
||||
this.send(this.getCompleteChannel(channel), window);
|
||||
});
|
||||
}
|
||||
|
||||
public on<T>(channel: IpcChannel, listener: (req: IpcRequest<T>, replier: IpcReplier) => void): void{
|
||||
ipcMain.on(channel, this.buildProxyListener(listener));
|
||||
}
|
||||
|
||||
public once<T>(channel: IpcChannel, listener: (req: IpcRequest<T>, replier: IpcReplier) => void): void{
|
||||
ipcMain.once(channel, this.buildProxyListener(listener));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,7 +38,7 @@ export class BeatModsApiService {
|
||||
|
||||
private async getVersionAlias(): Promise<Map<string, BSVersion[]>>{
|
||||
if(this.aliasesCache.size){ return this.aliasesCache; }
|
||||
return this.requestService.get<Record<string, string[]>>(this.BEAT_MODS_ALIAS).then(rawAliases => {
|
||||
return this.requestService.getJSON<Record<string, string[]>>(this.BEAT_MODS_ALIAS).then(rawAliases => {
|
||||
Object.entries(rawAliases).forEach(([key, value]) => {
|
||||
this.aliasesCache.set(key, value.map(s => ({BSVersion: s} as BSVersion)));
|
||||
});
|
||||
@@ -64,7 +64,7 @@ export class BeatModsApiService {
|
||||
|
||||
const alias = await this.getAliasOfVersion(version);
|
||||
|
||||
return this.requestService.get<Mod[]>(this.getVersionModsUrl(alias)).then(mods => {
|
||||
return this.requestService.getJSON<Mod[]>(this.getVersionModsUrl(alias)).then(mods => {
|
||||
mods = mods.map(mod => this.asignDependencies(mod, mods));
|
||||
this.versionModsCache.set(version.BSVersion, mods);
|
||||
return mods;
|
||||
@@ -73,16 +73,10 @@ export class BeatModsApiService {
|
||||
|
||||
public async getAllMods(): Promise<Mod[]>{
|
||||
if(!!this.allModsCache){ return this.allModsCache; }
|
||||
return this.requestService.get<Mod[]>(this.getAllModsUrl()).then(mods => {
|
||||
return this.requestService.getJSON<Mod[]>(this.getAllModsUrl()).then(mods => {
|
||||
this.allModsCache = mods;
|
||||
return this.allModsCache;
|
||||
});
|
||||
}
|
||||
|
||||
public loadAllMods(){ return this.getAllMods(); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -6,11 +6,15 @@ import path from "path";
|
||||
import { UtilsService } from "../utils.service";
|
||||
import md5File from "md5-file";
|
||||
import fs from "fs"
|
||||
import StreamZip from "node-stream-zip";
|
||||
import { RequestService } from "../request.service";
|
||||
import { spawn } from "child_process";
|
||||
import { BS_EXECUTABLE } from "../../constants";
|
||||
import log from "electron-log";
|
||||
import { deleteFolder, pathExist, unlinkPath } from "../../helpers/fs.helpers";
|
||||
import { lastValueFrom } from "rxjs";
|
||||
import JSZip from "jszip"
|
||||
import { extractZip } from "../../helpers/zip.helpers";
|
||||
import { ensureFolderExist } from "../../helpers/fs.helpers";
|
||||
|
||||
export class BsModsManagerService {
|
||||
|
||||
@@ -44,7 +48,7 @@ export class BsModsManagerService {
|
||||
private async getModFromHash(hash: string): Promise<Mod>{
|
||||
const allMods = await this.beatModsApi.getAllMods();
|
||||
return allMods.find(mod => {
|
||||
if(mod.name.toLowerCase() === "bsipa" || mod.status === "declined"){ return false; }
|
||||
if(mod.name.toLowerCase() === "bsipa"){ return false; }
|
||||
return mod.downloads.some(download => download.hashMd5.some(md5 => md5.hash === hash));
|
||||
})
|
||||
}
|
||||
@@ -60,7 +64,7 @@ export class BsModsManagerService {
|
||||
private async getModsInDir(version: BSVersion, modsDir: ModsInstallFolder): Promise<Mod[]>{
|
||||
const bsPath = await this.bsLocalService.getVersionPath(version);
|
||||
const modsPath = path.join(bsPath, modsDir);
|
||||
if(!this.utilsService.pathExist(modsPath)){ return []; }
|
||||
if(!(await pathExist(modsPath))){ return []; }
|
||||
const files = fs.readdirSync(modsPath);
|
||||
const promises = files.map(f => {
|
||||
return (async() => {
|
||||
@@ -89,29 +93,32 @@ export class BsModsManagerService {
|
||||
private async getBsipaInstalled(version: BSVersion): Promise<Mod>{
|
||||
const bsPath = await this.bsLocalService.getVersionPath(version);
|
||||
const injectorPath = path.join(bsPath, "Beat Saber_Data", "Managed", "IPA.Injector.dll");
|
||||
if(!this.utilsService.pathExist(injectorPath)){ return undefined; }
|
||||
if(!(await pathExist(injectorPath))){ return undefined; }
|
||||
const injectorMd5 = await md5File(injectorPath);
|
||||
return this.getIpaFromHash(injectorMd5);
|
||||
}
|
||||
|
||||
private async downloadZip(zipUrl: string): Promise<{zip: StreamZip.StreamZipAsync, zipPath: string}>{
|
||||
private async downloadZip(zipUrl: string): Promise<JSZip>{
|
||||
zipUrl = path.join(this.beatModsApi.BEAT_MODS_URL, zipUrl);
|
||||
const fileName = path.basename(zipUrl);
|
||||
const tempPath = this.utilsService.getTempPath();
|
||||
this.utilsService.createFolderIfNotExist(this.utilsService.getTempPath());
|
||||
const dest = path.join(tempPath, fileName);
|
||||
|
||||
const zipPath = await this.requestService.downloadFile(zipUrl, dest);
|
||||
const zip = new StreamZip.async({file : zipPath});
|
||||
const buffer = await lastValueFrom(this.requestService.downloadBuffer(zipUrl)).then(progress => progress.data).catch(e => {
|
||||
log.error("ZIP", "Error while downloading zip", e);
|
||||
return undefined
|
||||
});
|
||||
|
||||
return {zip, zipPath};
|
||||
if(!buffer){ return null; }
|
||||
|
||||
return JSZip.loadAsync(buffer).catch(e => {
|
||||
log.error("ZIP", "Error while loading zip", e);
|
||||
return null
|
||||
});
|
||||
}
|
||||
|
||||
private async executeBSIPA(version: BSVersion, args: string[]): Promise<boolean>{
|
||||
const versionPath = await this.bsLocalService.getVersionPath(version);
|
||||
const ipaPath = path.join(versionPath, "IPA.exe");
|
||||
const bsExePath = path.join(versionPath, BS_EXECUTABLE);
|
||||
if(!this.utilsService.pathExist(ipaPath) || !this.utilsService.pathExist(bsExePath)){ return false; }
|
||||
if(!(await pathExist(ipaPath)) || !(await pathExist(bsExePath))){ return false; }
|
||||
|
||||
return new Promise<boolean>(resolve => {
|
||||
const processIPA = spawn(`start /wait /min "" "${ipaPath}" ${args.join(" ")}`, {cwd: versionPath, detached: true, shell: true});
|
||||
@@ -133,23 +140,22 @@ export class BsModsManagerService {
|
||||
}
|
||||
|
||||
private async installMod(mod: Mod, version: BSVersion): Promise<boolean>{
|
||||
|
||||
|
||||
this.utilsService.ipcSend<ModInstallProgression>("mod-installed", {success: true, data: {name: mod.name, progression: ((this.nbInstalledMods + 1) / this.nbModsToInstall) * 100}})
|
||||
|
||||
const download = this.getModDownload(mod, version);
|
||||
|
||||
if(!download){ return false; }
|
||||
|
||||
const {zip, zipPath} = await this.downloadZip(download.url);
|
||||
const zip = await this.downloadZip(download.url);
|
||||
|
||||
if(!zip){ return false; }
|
||||
|
||||
const crypto = require('crypto');
|
||||
const entries = await zip.entries();
|
||||
const files = await zip.files;
|
||||
|
||||
const checkedEntries = (await Promise.all(Object.values(entries).map(async (entry) => {
|
||||
if(!entry.isFile){ return undefined; }
|
||||
const data = await zip.entryData(entry);
|
||||
const checkedEntries = (await Promise.all(Object.values(files).map(async (entry) => {
|
||||
const data = await entry.async("nodebuffer");
|
||||
const entryMd5 = crypto.createHash('md5').update(data).digest('hex')
|
||||
return download.hashMd5.some(md5 => md5.hash === entryMd5) ? entry : undefined;
|
||||
}))).filter(entry => !!entry);
|
||||
@@ -160,12 +166,16 @@ export class BsModsManagerService {
|
||||
const isBSIPA = mod.name.toLowerCase() === "bsipa";
|
||||
const destDir = isBSIPA ? verionPath : path.join(verionPath, ModsInstallFolder.PENDING);
|
||||
|
||||
const extracted = await zip.extract(null, destDir).then(() => true).catch(err => {log.error(err); return false});
|
||||
await ensureFolderExist(destDir);
|
||||
const extracted = await extractZip(zip, destDir).then(() => true).catch(e => {
|
||||
log.error("EXTRACT MOD ZIP", e);
|
||||
return false;
|
||||
})
|
||||
|
||||
await zip.close();
|
||||
await this.utilsService.unlinkIfExist(zipPath);
|
||||
|
||||
const res = isBSIPA ? (extracted && (await this.executeBSIPA(version, ["-n"]))) : extracted;
|
||||
const res = isBSIPA ? (extracted && (await this.executeBSIPA(version, ["-n"]).catch(e => {
|
||||
log.error(e);
|
||||
return false;
|
||||
}))) : extracted;
|
||||
|
||||
res && this.nbInstalledMods++;
|
||||
|
||||
@@ -194,8 +204,8 @@ export class BsModsManagerService {
|
||||
const download = this.getModDownload(mod, version);
|
||||
|
||||
const verionPath = await this.bsLocalService.getVersionPath(version);
|
||||
const hasIPAExe = this.utilsService.pathExist(path.join(verionPath, "IPA.exe"));
|
||||
const hasIPADir = this.utilsService.pathExist(path.join(verionPath, "IPA"));
|
||||
const hasIPAExe = await pathExist(path.join(verionPath, "IPA.exe"));
|
||||
const hasIPADir = await pathExist(path.join(verionPath, "IPA"));
|
||||
|
||||
if(!hasIPADir || !hasIPAExe){ return; }
|
||||
|
||||
@@ -203,7 +213,7 @@ export class BsModsManagerService {
|
||||
|
||||
const promises = download.hashMd5.map(files => {
|
||||
const file = files.file.replaceAll("IPA/", "").replaceAll("Data", "Beat Saber_Data");
|
||||
return this.utilsService.unlinkIfExist(path.join(verionPath, file));
|
||||
return unlinkPath(path.join(verionPath, file));
|
||||
})
|
||||
|
||||
await Promise.all(promises);
|
||||
@@ -220,8 +230,10 @@ export class BsModsManagerService {
|
||||
const versionPath = await this.bsLocalService.getVersionPath(version);
|
||||
|
||||
const promises = download.hashMd5.map(async files => {
|
||||
this.utilsService.unlinkIfExist(path.join(versionPath, files.file));
|
||||
this.utilsService.unlinkIfExist(path.join(versionPath, "IPA", "Pending", files.file));
|
||||
return Promise.all([
|
||||
unlinkPath(path.join(versionPath, files.file)),
|
||||
unlinkPath(path.join(versionPath, "IPA", "Pending", files.file))
|
||||
]);
|
||||
});
|
||||
|
||||
await Promise.all(promises);
|
||||
@@ -233,7 +245,7 @@ export class BsModsManagerService {
|
||||
|
||||
public async getInstalledMods(version: BSVersion): Promise<Mod[]>{
|
||||
this.manifestMatches = [];
|
||||
await this.beatModsApi.loadAllMods();
|
||||
await this.beatModsApi.getAllMods();
|
||||
const bsipa = await this.getBsipaInstalled(version);
|
||||
return Promise.all([
|
||||
this.getModsInDir(version, ModsInstallFolder.PLUGINS_PENDING),
|
||||
@@ -241,11 +253,16 @@ export class BsModsManagerService {
|
||||
this.getModsInDir(version, ModsInstallFolder.PLUGINS),
|
||||
this.getModsInDir(version, ModsInstallFolder.LIBS)
|
||||
]).then(dirMods => {
|
||||
const res = [];
|
||||
if(!!bsipa){ res.push(bsipa); }
|
||||
const installedMods = Array.from(new Map<string, Mod>(dirMods.flat().map(m => [m.name, m])).values());
|
||||
res.push(...installedMods);
|
||||
return res;
|
||||
const modsDict = new Map<string, Mod>();
|
||||
|
||||
if(!!bsipa){ modsDict.set(bsipa.name, bsipa); }
|
||||
|
||||
for(const mod of dirMods.flat()){
|
||||
if(modsDict.has(mod.name)){ continue; }
|
||||
modsDict.set(mod.name, mod);
|
||||
}
|
||||
|
||||
return Array.from(modsDict.values());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -306,9 +323,9 @@ export class BsModsManagerService {
|
||||
|
||||
const versionPath = await this.bsLocalService.getVersionPath(version);
|
||||
|
||||
this.utilsService.rmDirIfExist(path.join(versionPath, ModsInstallFolder.PLUGINS));
|
||||
this.utilsService.rmDirIfExist(path.join(versionPath, ModsInstallFolder.LIBS));
|
||||
this.utilsService.rmDirIfExist(path.join(versionPath, ModsInstallFolder.IPA));
|
||||
await deleteFolder(path.join(versionPath, ModsInstallFolder.PLUGINS));
|
||||
await deleteFolder(path.join(versionPath, ModsInstallFolder.LIBS));
|
||||
await deleteFolder(path.join(versionPath, ModsInstallFolder.IPA));
|
||||
|
||||
path.resolve
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { UtilsService } from "./utils.service";
|
||||
import regedit from 'regedit'
|
||||
import path from "path";
|
||||
import { pathExist } from "../helpers/fs.helpers";
|
||||
|
||||
export class OculusService {
|
||||
|
||||
@@ -19,7 +20,7 @@ export class OculusService {
|
||||
this.utils = UtilsService.getInstance();
|
||||
}
|
||||
|
||||
public oculusRunning(): boolean{
|
||||
public oculusRunning(): boolean | null{
|
||||
return this.utils.taskRunning("OculusClient.exe");
|
||||
}
|
||||
|
||||
@@ -50,11 +51,14 @@ export class OculusService {
|
||||
public async getGameFolder(gameFolder: string): Promise<string>{
|
||||
|
||||
const libsFolders = await this.getOculusLibsPath();
|
||||
|
||||
if(!libsFolders){ return null; }
|
||||
|
||||
const rootLibDir = "Software"
|
||||
|
||||
for(const lib of libsFolders){
|
||||
const gameFullPath = path.join(lib, rootLibDir, gameFolder);
|
||||
if(this.utils.pathExist(gameFullPath)){ return gameFullPath; }
|
||||
if(await pathExist(gameFullPath)){ return gameFullPath; }
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { 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";
|
||||
|
||||
export class RequestService {
|
||||
|
||||
@@ -12,34 +16,86 @@ export class RequestService {
|
||||
|
||||
private constructor(){}
|
||||
|
||||
public get<T = any>(url: string): Promise<T>{
|
||||
return new Promise((resolve, reject) => {
|
||||
let body = ''
|
||||
get(url, (res) => {
|
||||
res.on('data', chunk => body += chunk);
|
||||
res.on('end', () => {
|
||||
resolve(JSON.parse(body));
|
||||
});
|
||||
res.on('error', (err) => reject(err))
|
||||
});
|
||||
});
|
||||
public async getJSON<T = unknown>(url: RequestInfo, options?: RequestInit): Promise<T>{
|
||||
try {
|
||||
const response = await fetch(url, options);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status} ${response}`);
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
}
|
||||
catch (err) {
|
||||
log.error(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
public downloadFile(url: string, dest: string): Promise<string>{
|
||||
return new Promise((resolve, reject) => {
|
||||
public downloadFile(url: string, dest: string): Observable<Progression<string>>{
|
||||
|
||||
return new Observable<Progression<string>>(subscriber => {
|
||||
const progress: Progression<string> = { current: 0, total: 0 };
|
||||
|
||||
const file = createWriteStream(dest);
|
||||
get(url, res => {
|
||||
res.pipe(file);
|
||||
file.on("close", () => {
|
||||
file.close(() => resolve(dest))
|
||||
}).on("error", err => {
|
||||
unlink(dest, () => reject(err));
|
||||
});
|
||||
}).on("error", err => {
|
||||
unlink(dest, () => reject(err));
|
||||
|
||||
file.on("close", () => {
|
||||
progress["data"] = dest;
|
||||
subscriber.next(progress); subscriber.complete();
|
||||
});
|
||||
});
|
||||
file.on("error", err => unlink(dest, () => subscriber.error(err)));
|
||||
|
||||
const req = get(url, res => {
|
||||
|
||||
progress.total = parseInt(res.headers?.["content-length"] || "0", 10);
|
||||
|
||||
res.on("data", chunk => {
|
||||
progress.current += chunk.length;
|
||||
subscriber.next(progress);
|
||||
});
|
||||
|
||||
res.pipe(file);
|
||||
|
||||
});
|
||||
|
||||
req.on("error", err => { subscriber.error(err); });
|
||||
|
||||
}).pipe(tap({error: e => log.error(e)}), shareReplay(1));
|
||||
|
||||
}
|
||||
|
||||
public downloadBuffer(url: string): Observable<Progression<Buffer>>{
|
||||
|
||||
return new Observable<Progression<Buffer>>(subscriber => {
|
||||
|
||||
const progress: Progression<Buffer> = {
|
||||
current: 0,
|
||||
total: 0,
|
||||
data: null
|
||||
};
|
||||
|
||||
const allChunks: Buffer[] = [];
|
||||
|
||||
const req = get(url, res => {
|
||||
|
||||
progress.total = parseInt(res.headers?.["content-length"] || "0", 10);
|
||||
|
||||
res.on("data", chunk => {
|
||||
allChunks.push(chunk);
|
||||
progress.current += chunk.length;
|
||||
subscriber.next(progress);
|
||||
});
|
||||
res.on('end', () => {
|
||||
progress.data = Buffer.concat(allChunks);
|
||||
subscriber.next(progress);
|
||||
subscriber.complete();
|
||||
});
|
||||
res.on('error', (err) => subscriber.error(err))
|
||||
});
|
||||
|
||||
req.on("error", err => { subscriber.error(err); });
|
||||
|
||||
}).pipe(tap({error: e => log.error(e)}), shareReplay(1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import path from "path";
|
||||
import { parse } from "@node-steam/vdf";
|
||||
import { readFile } from "fs/promises";
|
||||
import { spawn } from "child_process";
|
||||
import { pathExist } from "../helpers/fs.helpers";
|
||||
import log from "electron-log";
|
||||
|
||||
export class SteamService{
|
||||
|
||||
@@ -23,7 +25,7 @@ export class SteamService{
|
||||
return SteamService.instance;
|
||||
}
|
||||
|
||||
public steamRunning(): boolean{
|
||||
public steamRunning(): boolean | null{
|
||||
return this.utils.taskRunning('steam.exe');
|
||||
}
|
||||
|
||||
@@ -46,21 +48,27 @@ export class SteamService{
|
||||
}
|
||||
|
||||
public async getGameFolder(gameId: string, gameFolder?: string): Promise<string>{
|
||||
const steamPath = await this.getSteamPath();
|
||||
try{
|
||||
const steamPath = await this.getSteamPath();
|
||||
|
||||
let libraryFolders: any = path.join(steamPath, 'steamapps', 'libraryfolders.vdf');
|
||||
let libraryFolders: any = path.join(steamPath, 'steamapps', 'libraryfolders.vdf');
|
||||
|
||||
if(!this.utils.pathExist(libraryFolders)){ return null; }
|
||||
libraryFolders = parse(await readFile(libraryFolders, {encoding: 'utf-8'}));
|
||||
if(!(await pathExist(libraryFolders))){ return null; }
|
||||
libraryFolders = parse(await readFile(libraryFolders, {encoding: 'utf-8'}));
|
||||
|
||||
if(!libraryFolders.libraryfolders){ return null; }
|
||||
libraryFolders = libraryFolders.libraryfolders
|
||||
if(!libraryFolders.libraryfolders){ return null; }
|
||||
libraryFolders = libraryFolders.libraryfolders
|
||||
|
||||
for(const libKey in Object.keys(libraryFolders)){
|
||||
if(!libraryFolders[libKey] || !libraryFolders[libKey]["apps"]){ continue; }
|
||||
if(libraryFolders[libKey]["apps"][gameId]){ return path.join(libraryFolders[libKey]["path"], "steamapps", "common", gameFolder); };
|
||||
for(const libKey in Object.keys(libraryFolders)){
|
||||
if(!libraryFolders[libKey] || !libraryFolders[libKey]["apps"]){ continue; }
|
||||
if(libraryFolders[libKey]["apps"][gameId] != null){ return path.join(libraryFolders[libKey]["path"], "steamapps", "common", gameFolder); };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
catch(e){
|
||||
log.error(e);
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public openSteam(): Promise<boolean>{
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { writeFileSync } from "fs";
|
||||
import { get } from "https";
|
||||
import isOnline from "is-online";
|
||||
import { readJSON } from "fs-extra";
|
||||
import path from "path";
|
||||
import { Supporter } from "shared/models/supporters/supporter.interface";
|
||||
import { UtilsService } from "./utils.service";
|
||||
import { RequestService } from "./request.service";
|
||||
import { allSettled } from "../../shared/helpers/promise.helpers";
|
||||
|
||||
export class SupportersService {
|
||||
|
||||
@@ -15,6 +16,8 @@ export class SupportersService {
|
||||
private cache: Supporter[];
|
||||
|
||||
private readonly utilsService: UtilsService;
|
||||
private readonly requestService: RequestService;
|
||||
|
||||
|
||||
public static getInstance(): SupportersService{
|
||||
if(!SupportersService.instance){ SupportersService.instance = new SupportersService(); }
|
||||
@@ -23,6 +26,7 @@ export class SupportersService {
|
||||
|
||||
private constructor(){
|
||||
this.utilsService = UtilsService.getInstance();
|
||||
this.requestService = RequestService.getInstance();
|
||||
}
|
||||
|
||||
private async updateLocalSupporters(supporters: Supporter[]): Promise<void>{
|
||||
@@ -30,31 +34,21 @@ export class SupportersService {
|
||||
writeFileSync(patreonsPath, JSON.stringify(supporters, null, "\t"), {encoding: 'utf-8', flag: 'w'});
|
||||
}
|
||||
|
||||
private async getRemoteSupporters(): Promise<Supporter[]>{
|
||||
return new Promise<Supporter[]>((resolve, reject) => {
|
||||
let body = ''
|
||||
get(this.PATREONS_URL, (res) => {
|
||||
res.on('data', chunk => body += chunk);
|
||||
res.on('end', () => resolve(JSON.parse(body)));
|
||||
res.on('error', () => reject(null))
|
||||
})
|
||||
})
|
||||
private getRemoteSupporters(): Promise<Supporter[]>{
|
||||
return this.requestService.getJSON(this.PATREONS_URL);
|
||||
}
|
||||
|
||||
private async getLocalSupporters(): Promise<Supporter[]>{
|
||||
const patreonsPath = path.join(this.utilsService.getAssestsJsonsPath(), this.PATREONS_FILE);
|
||||
const rawPatreons = (await this.utilsService.readFileAsync(patreonsPath)).toString();
|
||||
return JSON.parse(rawPatreons);
|
||||
return readJSON(patreonsPath);
|
||||
}
|
||||
|
||||
private async loadSupporters(): Promise<Supporter[]>{
|
||||
if(!!this.cache && this.cache.length){ return this.cache; }
|
||||
|
||||
const isOnlineRes = await isOnline({timeout: 1500});
|
||||
|
||||
const [localVersions, remoteVersions] = await Promise.all([
|
||||
this.getLocalSupporters(), (isOnlineRes && this.getRemoteSupporters())
|
||||
]);
|
||||
const [localVersions, remoteVersions] = await allSettled([
|
||||
this.getLocalSupporters(), this.getRemoteSupporters()
|
||||
], {keepStructure: true});
|
||||
|
||||
const supporters = remoteVersions?.length ? remoteVersions : localVersions;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { splitIntoChunk } from "../../../helpers/array-tools";
|
||||
import { splitIntoChunk } from "../../../../shared/helpers/array.helpers";
|
||||
import { BsvMapDetail } from "shared/models/maps";
|
||||
import { BsvPlaylist, SearchParams } from "shared/models/maps/beat-saver.model";
|
||||
import { BeatSaverApiService } from "./beat-saver-api.service";
|
||||
@@ -32,8 +32,7 @@ export class BeatSaverService {
|
||||
return res;
|
||||
}, [] as BsvMapDetail[]);
|
||||
|
||||
for(const hashs of chunkHash){
|
||||
|
||||
await Promise.allSettled(chunkHash.map(async hashs => {
|
||||
const res = await this.bsaverApi.getMapsDetailsByHashs(hashs);
|
||||
|
||||
if(res.status === 200){
|
||||
@@ -42,7 +41,7 @@ export class BeatSaverService {
|
||||
this.cachedMapsDetails.set(detail.versions.at(0).hash.toLowerCase(), detail);
|
||||
});
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
return mapDetails;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import fetch from "node-fetch";
|
||||
import { ApiResult } from "renderer/models/api/api.model";
|
||||
import { MSGetQuery, MSGetQueryFilter, MSGetResponse } from "shared/models/model-saber/model-saber.model";
|
||||
import { MSGetQuery, MSGetQueryFilter, MSGetResponse } from "../../../../shared/models/models/model-saber.model";
|
||||
|
||||
export class ModelSaberApiService {
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { MSGetQuery, MSGetQueryFilter, MSModel } from "shared/models/model-saber/model-saber.model";
|
||||
import { Observable } from "rxjs";
|
||||
import { MSGetQuery, MSGetQueryFilterType, MSModel, MSModelPlatform } from "../../../../shared/models/models/model-saber.model";
|
||||
import { ModelSaberApiService } from "./model-saber-api.service";
|
||||
import log from "electron-log";
|
||||
import striptags from "striptags"
|
||||
|
||||
export class ModelSaberService {
|
||||
|
||||
@@ -10,6 +13,8 @@ export class ModelSaberService {
|
||||
return ModelSaberService.instance;
|
||||
}
|
||||
|
||||
private readonly modelsHashCache: Map<string, MSModel> = new Map(); // key: hash, value: model
|
||||
|
||||
private readonly modelSaberApi: ModelSaberApiService;
|
||||
|
||||
private constructor(){
|
||||
@@ -21,8 +26,8 @@ export class ModelSaberService {
|
||||
const query: MSGetQuery = {
|
||||
start: 0,
|
||||
end: 1,
|
||||
platform: "pc",
|
||||
filter: [{type: "id", value: id}]
|
||||
platform: MSModelPlatform.PC,
|
||||
filter: [{type: MSGetQueryFilterType.ID, value: id}]
|
||||
}
|
||||
|
||||
try{
|
||||
@@ -37,9 +42,61 @@ export class ModelSaberService {
|
||||
return res.data[`${id}`];
|
||||
}
|
||||
catch(e){
|
||||
log.error(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async getModelByHash(hash: string): Promise<MSModel>{
|
||||
|
||||
if(this.modelsHashCache.has(hash)){
|
||||
return this.modelsHashCache.get(hash);
|
||||
}
|
||||
|
||||
const query: MSGetQuery = {
|
||||
start: 0,
|
||||
end: 1,
|
||||
platform: MSModelPlatform.PC,
|
||||
filter: [{type: MSGetQueryFilterType.Hash, value: hash}]
|
||||
}
|
||||
|
||||
try{
|
||||
const res = await this.modelSaberApi.searchModel(query);
|
||||
|
||||
if(res.status !== 200){ return null;}
|
||||
|
||||
if(Object.keys(res.data).length === 0){
|
||||
return null;
|
||||
}
|
||||
|
||||
const model = Array.from(Object.values(res.data)).at(0);
|
||||
|
||||
model.name = striptags(model.name ?? "");
|
||||
|
||||
this.modelsHashCache.set(hash, model);
|
||||
|
||||
return model
|
||||
}
|
||||
catch(e){
|
||||
log.error(e);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public searchModels(query: MSGetQuery): Observable<MSModel[]>{
|
||||
return new Observable<MSModel[]>(observer => {
|
||||
(async () => {
|
||||
const res = await this.modelSaberApi.searchModel(query);
|
||||
if(res.status !== 200){ observer.error(res.status); }
|
||||
observer.next(Object.values(res.data).map(model => {
|
||||
if(!model || !model.name){ return model; }
|
||||
(model as MSModel).name = striptags(model.name);
|
||||
return model;
|
||||
}));
|
||||
})().catch(e => observer.error(e)).then(() => observer.complete());
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,18 @@
|
||||
import { existsSync, mkdirSync, readdirSync, readFile, rmSync } from "fs";
|
||||
import { moveSync } from "fs-extra"
|
||||
import { spawnSync } from "child_process";
|
||||
import { homedir } from "os";
|
||||
import path from "path";
|
||||
import { app, BrowserWindow } from "electron";
|
||||
import { rm, unlink } from "fs/promises";
|
||||
import { IpcResponse } from "shared/models/ipc";
|
||||
import log from "electron-log";
|
||||
import { AppWindow } from "shared/models/window-manager/app-window.model";
|
||||
|
||||
|
||||
// TODO : REFACTOR
|
||||
|
||||
export class UtilsService{
|
||||
|
||||
private static instance: UtilsService;
|
||||
|
||||
private assetsPath: string = '';
|
||||
private assetsPath: string = app.isPackaged ? path.join(process.resourcesPath, 'assets') : path.join(__dirname, '../../../assets');
|
||||
|
||||
private windows: Map<AppWindow, BrowserWindow> = new Map<AppWindow, BrowserWindow>();
|
||||
|
||||
@@ -36,69 +33,20 @@ export class UtilsService{
|
||||
public setMainWindows(windows: Map<AppWindow, BrowserWindow>){ this.windows = windows; }
|
||||
public getMainWindows(win: AppWindow){ return this.windows.get(win); }
|
||||
|
||||
public pathExist(path: string): boolean{ return existsSync(path); }
|
||||
|
||||
public createFolderIfNotExist(path: string): void{
|
||||
if(!this.pathExist(path)){ mkdirSync(path, {recursive: true}); }
|
||||
}
|
||||
|
||||
public async unlinkIfExist(pathToFile: string): Promise<void>{
|
||||
if(!this.pathExist(pathToFile)){ return }
|
||||
return unlink(pathToFile);
|
||||
}
|
||||
|
||||
public async rmDirIfExist(path: string): Promise<void>{
|
||||
if(!this.pathExist(path)){ return; }
|
||||
return rm(path, {recursive: true, force: true});
|
||||
}
|
||||
|
||||
public taskRunning(task: string): boolean{
|
||||
const tasks = spawnSync('tasklist').stdout.toString();
|
||||
return tasks.includes(task);
|
||||
}
|
||||
|
||||
public getUserFolder(){ return homedir(); }
|
||||
|
||||
public getUserDocumentsFolder(): string{
|
||||
return path.join(this.getUserFolder(), 'Documents');
|
||||
}
|
||||
|
||||
public readFileAsync(path: string){
|
||||
return new Promise<Buffer>((resolve, reject) => {
|
||||
readFile(path, (err, data) => {
|
||||
if(err){ reject(err); }
|
||||
else{ resolve(data); }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public listDirsInDir(dirPath: string, fullPath = false): string[]{
|
||||
let files = readdirSync(dirPath, { withFileTypes:true});
|
||||
files = files.filter(f => f.isDirectory())
|
||||
return files.map(f => fullPath ? path.join(dirPath, f.name) : f.name);
|
||||
}
|
||||
|
||||
public async deleteFolder(folderPath: string): Promise<void>{
|
||||
const folderExist = this.pathExist(folderPath);
|
||||
if(!folderExist){ return; }
|
||||
return rmSync(folderPath, {recursive: true});
|
||||
}
|
||||
|
||||
public async moveDirContent(src: string, dest: string, overwrite = false): Promise<void>{
|
||||
const [srcExist, destExist] = await Promise.all([this.pathExist(src), this.pathExist(dest)]);
|
||||
if(!srcExist){ return; }
|
||||
if(!destExist){ await this.createFolderIfNotExist(dest); }
|
||||
readdirSync(src, {encoding: "utf-8"}).forEach(file => {
|
||||
const srcFullPath = path.join(src, file);
|
||||
const destFullPath = path.join(dest, file);
|
||||
if(!overwrite && this.pathExist(destFullPath)){ return; }
|
||||
moveSync(srcFullPath, destFullPath, {overwrite});
|
||||
});
|
||||
public taskRunning(task: string): boolean | null{
|
||||
try{
|
||||
const tasks = spawnSync('tasklist').stdout;
|
||||
return tasks.toString().includes(task);
|
||||
}
|
||||
catch(error){
|
||||
log.error(error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ipcSend<T = any>(channel: string, response: IpcResponse<T>): void{
|
||||
try {
|
||||
Array.from(this.windows.values()).forEach(window => window.webContents.send(channel, response));
|
||||
Array.from(this.windows.values()).forEach(window => window?.webContents?.send(channel, response));
|
||||
} catch (error) {
|
||||
log.error(error);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
import { getFoldersInFolder, pathExist } from "../helpers/fs.helpers";
|
||||
import path from "path";
|
||||
import { VersionLinkerAction, VersionLinkFolderAction, VersionUnlinkFolderAction } from "renderer/services/version-folder-linker.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { LocalMapsManagerService } from "./additional-content/local-maps-manager.service";
|
||||
import { BSLocalVersionService } from "./bs-local-version.service";
|
||||
import { FolderLinkerService, LinkOptions } from "./folder-linker.service";
|
||||
import { allSettled } from "../../shared/helpers/promise.helpers";
|
||||
|
||||
export class VersionFolderLinkerService {
|
||||
|
||||
private static instance: VersionFolderLinkerService;
|
||||
|
||||
public static getInstance(): VersionFolderLinkerService{
|
||||
if(!VersionFolderLinkerService.instance){ VersionFolderLinkerService.instance = new VersionFolderLinkerService() }
|
||||
return VersionFolderLinkerService.instance;
|
||||
}
|
||||
|
||||
private readonly localVersion: BSLocalVersionService;
|
||||
private readonly folderLinker: FolderLinkerService;
|
||||
|
||||
private constructor(){
|
||||
this.localVersion = BSLocalVersionService.getInstance();
|
||||
this.folderLinker = FolderLinkerService.getInstance();
|
||||
}
|
||||
|
||||
private specialFolderOption(relativeFolder: string, options: LinkOptions): LinkOptions{
|
||||
if(relativeFolder.includes(LocalMapsManagerService.CUSTOM_LEVELS_FOLDER)){
|
||||
return {...options, intermediateFolder: LocalMapsManagerService.SHARED_MAPS_FOLDER};
|
||||
}
|
||||
|
||||
if(relativeFolder.includes("UserData")){
|
||||
return { ...options, backup: true };
|
||||
}
|
||||
|
||||
return options ?? {};
|
||||
}
|
||||
|
||||
private async isOtherVersionHaveFolderLinked(relativeFolder: string, ignorePath: string): Promise<boolean>{
|
||||
const versions = await this.localVersion.getInstalledVersions();
|
||||
const versionPaths = await allSettled(versions.map(version => this.localVersion.getVersionPath(version)));
|
||||
|
||||
for(const versionPath of versionPaths){
|
||||
const folderPath = this.relativeToFullPath(versionPath, relativeFolder);
|
||||
if(folderPath === ignorePath){ continue; }
|
||||
if(await this.folderLinker.isFolderSymlink(folderPath)){ return true; }
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private relativeToFullPath(parentPath: string, relativePath: string): string{
|
||||
return path.join(parentPath, relativePath);
|
||||
}
|
||||
|
||||
|
||||
public async linkVersionFolder(action: VersionLinkerAction): Promise<boolean>{
|
||||
action.options = this.specialFolderOption(action.relativeFolder, action.options);
|
||||
const versionPath = await this.localVersion.getVersionPath(action.version);
|
||||
const folderPath = this.relativeToFullPath(versionPath, action.relativeFolder);
|
||||
return this.folderLinker.linkFolder(folderPath, action.options).catch(() => false).then(() => true)
|
||||
}
|
||||
|
||||
public async unlinkVersionFolder(action: VersionUnlinkFolderAction): Promise<boolean>{
|
||||
action.options = this.specialFolderOption(action.relativeFolder, action.options);
|
||||
|
||||
const versionPath = await this.localVersion.getVersionPath(action.version);
|
||||
const folderPath = this.relativeToFullPath(versionPath, action.relativeFolder);
|
||||
|
||||
action.options.moveContents = !(await this.isOtherVersionHaveFolderLinked(action.relativeFolder, folderPath));
|
||||
|
||||
return this.folderLinker.unlinkFolder(folderPath, action.options).catch(() => false).then(() => true);
|
||||
}
|
||||
|
||||
public async doAction(action: VersionLinkerAction): Promise<boolean>{
|
||||
if(action.type === "link"){
|
||||
return this.linkVersionFolder(action);
|
||||
}
|
||||
return this.unlinkVersionFolder(action as VersionUnlinkFolderAction);
|
||||
}
|
||||
|
||||
public async isFolderLinked(version: BSVersion, relativeFolder: string): Promise<boolean>{
|
||||
if(!version){ return Promise.reject("no version provided") }
|
||||
const versionPath = await this.localVersion.getVersionPath(version);
|
||||
const folderPath = this.relativeToFullPath(versionPath, relativeFolder);
|
||||
return this.folderLinker.isFolderSymlink(folderPath);
|
||||
}
|
||||
|
||||
public async getLinkedFolders(version: BSVersion, options?: { relative?: boolean, ignoreSymlinkTargetError?: boolean }): Promise<string[]>{
|
||||
const versionPath = await this.localVersion.getVersionPath(version);
|
||||
const [rootFolders, beatSaberDataFolders] = await Promise.all([
|
||||
getFoldersInFolder(versionPath, {ignoreSymlinkTargetError: options?.ignoreSymlinkTargetError}),
|
||||
getFoldersInFolder(path.join(versionPath, "Beat Saber_Data"), {ignoreSymlinkTargetError: options?.ignoreSymlinkTargetError})
|
||||
]);
|
||||
|
||||
const linkedFolders = await Promise.all([...rootFolders, ...beatSaberDataFolders].map(async folder => {
|
||||
if(!(await this.folderLinker.isFolderSymlink(folder))){ return null; }
|
||||
return folder;
|
||||
}));
|
||||
|
||||
if(options?.relative){
|
||||
return linkedFolders.filter(folder => folder).map(folder => path.relative(versionPath, folder));
|
||||
}
|
||||
|
||||
return linkedFolders.filter(folder => folder);
|
||||
}
|
||||
|
||||
public async relinkAllVersionsFolders(): Promise<void>{
|
||||
const versions = await this.localVersion.getInstalledVersions();
|
||||
|
||||
for(const version of versions){
|
||||
const linkedFolders = await this.getLinkedFolders(version, { relative: true, ignoreSymlinkTargetError: true });
|
||||
const actions = linkedFolders.map(folder => ({ type: "link", version, relativeFolder: folder } as VersionLinkFolderAction));
|
||||
await Promise.all(actions.map(action => this.doAction(action)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,8 +75,12 @@ export class WindowManagerService{
|
||||
});
|
||||
}
|
||||
|
||||
public getWindows(window: AppWindow): BrowserWindow{
|
||||
public getWindow(window: AppWindow): BrowserWindow{
|
||||
return this.windows.get(window);
|
||||
}
|
||||
|
||||
public getAppWindowFromWebContents(sender: Electron.WebContents): AppWindow{
|
||||
return Array.from(this.windows.entries()).find(([key, value]) => value.webContents.id === sender.id)[0];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,8 @@ import { BsmImage } from "../shared/bsm-image.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { BsmIcon } from "../svgs/bsm-icon.component";
|
||||
import { LinkOpenerService } from 'renderer/services/link-opener.service';
|
||||
import { motion } from 'framer-motion';
|
||||
import { GlowEffect } from '../shared/glow-effect.component';
|
||||
|
||||
export const AvailableVersionItem = memo(function AvailableVersionItem(props: {version: BSVersion}) {
|
||||
|
||||
@@ -15,6 +17,7 @@ export const AvailableVersionItem = memo(function AvailableVersionItem(props: {v
|
||||
const linkOpener = LinkOpenerService.getInstance();
|
||||
|
||||
const [selected, setSelected] = useState(false);
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const t = useTranslation();
|
||||
|
||||
const formatedDate = (() => { return dateFormat(+props.version.ReleaseDate*1000, "ddd. d mmm yyyy"); })()
|
||||
@@ -38,8 +41,8 @@ export const AvailableVersionItem = memo(function AvailableVersionItem(props: {v
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<li className="group relative w-72 h-60 transition-transform active:scale-[.98]" onClick={toggleSelect}>
|
||||
<span className={`absolute glow-on-hover group-hover:opacity-100 ${selected && "!opacity-100"}`}/>
|
||||
<motion.li className="group relative w-72 h-60 transition-transform active:scale-[.98]" onClick={toggleSelect} onHoverStart={() => setHovered(true)} onHoverEnd={() => setHovered(false)}>
|
||||
<GlowEffect visible={hovered || selected} className="absolute"/>
|
||||
<div className={`relative flex flex-col overflow-hidden rounded-md w-72 h-60 cursor-pointer group-hover:shadow-none duration-300 bg-light-main-color-2 dark:bg-main-color-2 ${!selected && "shadow-lg shadow-gray-900"}`}>
|
||||
<BsmImage image={props.version.ReleaseImg ? props.version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="absolute top-0 right-0 w-full h-full opacity-40 blur-xl object-cover" loading="lazy"/>
|
||||
<BsmImage image={props.version.ReleaseImg ? props.version.ReleaseImg : defaultImage} errorImage={defaultImage} placeholder={defaultImage} className="bg-black w-full h-3/4 object-cover" loading="lazy"/>
|
||||
@@ -56,6 +59,6 @@ export const AvailableVersionItem = memo(function AvailableVersionItem(props: {v
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</motion.li>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BSVersion } from 'shared/bs-version.interface';
|
||||
import { useEffect, useState } from "react"
|
||||
import { BSVersionManagerService } from "renderer/services/bs-version-manager.service";
|
||||
import { filter, take } from "rxjs/operators";
|
||||
import { filter } from "rxjs/operators";
|
||||
import { AvailableVersionItem } from "./available-version-item.component";
|
||||
|
||||
export function AvailableVersionsSlide(props: {year: string}) {
|
||||
@@ -11,7 +11,7 @@ export function AvailableVersionsSlide(props: {year: string}) {
|
||||
const versionsService = BSVersionManagerService.getInstance();
|
||||
|
||||
useEffect(() => {
|
||||
versionsService.availableVersions$.pipe(filter(versions => !!versions?.length), take(1)).subscribe(() => {
|
||||
versionsService.availableVersions$.pipe(filter(versions => !!versions?.length)).subscribe(() => {
|
||||
setAvailableVersions(versionsService.getAvaibleVersionsOfYear(props.year));
|
||||
});
|
||||
}, [])
|
||||
|
||||
+14
-14
@@ -1,29 +1,29 @@
|
||||
import { useEffect, useState } from "react"
|
||||
import { BSVersionManagerService } from "../../services/bs-version-manager.service";
|
||||
import { AvailableVersionsSlide } from "./available-versions-slide.component";
|
||||
import { filter, take } from "rxjs/operators";
|
||||
import { filter} from "rxjs/operators";
|
||||
import { TabNavBar } from "../shared/tab-nav-bar.component";
|
||||
|
||||
export function AvailableVersionsSlider() {
|
||||
|
||||
const [availableYears, setAvailableYears] = useState([]);
|
||||
const [yearIndex, setYearIndex] = useState(0);
|
||||
const versionManagerService = BSVersionManagerService.getInstance();
|
||||
|
||||
const versionManagerService = BSVersionManagerService.getInstance();
|
||||
const [availableYears, setAvailableYears] = useState([]);
|
||||
const [yearIndex, setYearIndex] = useState(0);
|
||||
|
||||
const setSelectedYear = (index: number) => {
|
||||
setYearIndex(index);
|
||||
}
|
||||
const setSelectedYear = (index: number) => {
|
||||
setYearIndex(index);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
versionManagerService.availableVersions$.pipe(filter(versions => !!versions?.length), take(1)).subscribe(() => {
|
||||
setAvailableYears(versionManagerService.getAvailableYears());
|
||||
});
|
||||
}, [])
|
||||
useEffect(() => {
|
||||
versionManagerService.availableVersions$.pipe(filter(versions => !!versions?.length)).subscribe(() => {
|
||||
setAvailableYears(versionManagerService.getAvailableYears());
|
||||
});
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="w-full h-fit max-h-full flex flex-col items-center grow min-h-0">
|
||||
<TabNavBar className="mb-3" tabIndex={yearIndex} tabsText={availableYears} onTabChange={setSelectedYear}/>
|
||||
<div className="w-full h-fit max-h-full flex flex-col items-center grow min-h-0 gap-3">
|
||||
<TabNavBar tabIndex={yearIndex} tabsText={availableYears} onTabChange={setSelectedYear}/>
|
||||
<ol className="w-full min-h-0 flex transition-transform duration-300" style={{transform: `translate(${-(yearIndex * 100)}%, 0)`}}>
|
||||
{ availableYears.map(year =>
|
||||
<AvailableVersionsSlide key={year} year={year}/>
|
||||
|
||||
@@ -12,6 +12,9 @@ import { MAP_SPECIFICITIES } from "renderer/partials/maps/map-general/map-specif
|
||||
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 { BsmButton } from "../shared/bsm-button.component"
|
||||
import equal from "fast-deep-equal/es6";
|
||||
import clone from "rfdc";
|
||||
import { GlowEffect } from "../shared/glow-effect.component"
|
||||
|
||||
export type Props = {
|
||||
className?: string,
|
||||
@@ -28,6 +31,7 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange,
|
||||
const t = useTranslation();
|
||||
|
||||
const [haveChanged, setHaveChanged] = useState(false);
|
||||
const [firstFilter,] = useState(clone()(filter));
|
||||
const firstRun = useRef(true);
|
||||
|
||||
const MIN_NPS = 0;
|
||||
@@ -47,7 +51,7 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange,
|
||||
firstRun.current = false;
|
||||
return;
|
||||
}
|
||||
setHaveChanged(() => true);
|
||||
setHaveChanged(() => !equal(filter, firstFilter));
|
||||
}, [filter])
|
||||
|
||||
|
||||
@@ -89,6 +93,9 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange,
|
||||
if(max === MAX_NPS){
|
||||
delete newFilter["maxNps"];
|
||||
}
|
||||
if(min === MIN_NPS){
|
||||
delete newFilter["minNps"];
|
||||
}
|
||||
onChange(newFilter);
|
||||
}
|
||||
|
||||
@@ -97,6 +104,9 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange,
|
||||
if(max === MAX_DURATION){
|
||||
delete newFilter["maxDuration"];
|
||||
}
|
||||
if(min === MIN_DURATION){
|
||||
delete newFilter["minDuration"];
|
||||
}
|
||||
onChange(newFilter);
|
||||
}
|
||||
|
||||
@@ -116,11 +126,17 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange,
|
||||
enabledTags.add(tag);
|
||||
}
|
||||
|
||||
onChange({
|
||||
...filter,
|
||||
enabledTags,
|
||||
excludedTags
|
||||
});
|
||||
const newFilter = {...filter, enabledTags, excludedTags};
|
||||
|
||||
if(newFilter.enabledTags.size === 0){
|
||||
delete newFilter["enabledTags"];
|
||||
}
|
||||
|
||||
if(newFilter.excludedTags.size === 0){
|
||||
delete newFilter["excludedTags"];
|
||||
}
|
||||
|
||||
onChange(newFilter);
|
||||
|
||||
}
|
||||
|
||||
@@ -197,8 +213,8 @@ export function FilterPanel({className, ref, playlist = false, filter, onChange,
|
||||
</div>
|
||||
{onApply && (
|
||||
<div className="inline float-right relative w-fit h-fit mt-2">
|
||||
<BsmButton className="inline float-right rounded-md font-bold px-1 py-0.5 text-sm" text="Appliquer" typeColor="primary" withBar={false} onClick={handleApply}/>
|
||||
{haveChanged && <div className="glow-on-hover !opacity-100"></div>}
|
||||
<BsmButton className="inline float-right rounded-md font-bold px-1 py-0.5 text-sm" text="misc.apply" typeColor="primary" withBar={false} onClick={handleApply}/>
|
||||
<GlowEffect visible={haveChanged}/>
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
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"
|
||||
|
||||
type Props = {
|
||||
className?: string,
|
||||
title?: string,
|
||||
linked?: boolean
|
||||
disabled?: boolean,
|
||||
onClick?: () => void
|
||||
}
|
||||
|
||||
export const LinkButton = motion(forwardRef((props: Props, ref) => {
|
||||
|
||||
const t = useTranslation()
|
||||
const color = useThemeColor("first-color");
|
||||
|
||||
const linkedColor = (() => {
|
||||
if(props.disabled){ return "orange"; }
|
||||
if(props.linked){ return color; }
|
||||
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"}}>
|
||||
<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>
|
||||
)
|
||||
}))
|
||||
+156
-86
@@ -3,102 +3,159 @@ import { BSVersion } from "shared/bs-version.interface"
|
||||
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react"
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface"
|
||||
import { Subscription } from "rxjs"
|
||||
import { MapItem, ParsedMapDiff } from "./map-item.component"
|
||||
import { BsvMapCharacteristic, MapFilter } from "shared/models/maps/beat-saver.model"
|
||||
import { MapFilter } from "shared/models/maps/beat-saver.model"
|
||||
import { useInView } from "framer-motion"
|
||||
import { MapsDownloaderService } from "renderer/services/maps-downloader.service"
|
||||
import { BsmImage } from "../shared/bsm-image.component"
|
||||
import BeatConflict from "../../../../assets/images/apngs/beat-conflict.png"
|
||||
import { BsmButton } from "../shared/bsm-button.component"
|
||||
import { VariableSizeList } from "react-window"
|
||||
import { MapsRow } from "./maps-row.component"
|
||||
import { BehaviorSubject } from "rxjs"
|
||||
import { debounceTime, last, mergeMap, tap } from "rxjs/operators"
|
||||
import { BeatSaverService } from "renderer/services/thrird-partys/beat-saver.service"
|
||||
import { OsDiagnosticService } from "renderer/services/os-diagnostic.service"
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook"
|
||||
import BeatWaitingImg from "../../../../assets/images/apngs/beat-waiting.png"
|
||||
import BeatConflict from "../../../../assets/images/apngs/beat-conflict.png"
|
||||
import { BsmImage } from "../shared/bsm-image.component"
|
||||
import { BsmButton } from "../shared/bsm-button.component"
|
||||
import TextProgressBar from "../progress-bar/text-progress-bar.component"
|
||||
|
||||
type Props = {
|
||||
version: BSVersion,
|
||||
className?: string,
|
||||
filter?: MapFilter
|
||||
search?: string,
|
||||
linked?: boolean
|
||||
}
|
||||
|
||||
export const LocalMapsListPanel = forwardRef(({version, className, filter, search} : Props, forwardRef) => {
|
||||
export const LocalMapsListPanel = forwardRef(({version, className, filter, search, linked} : Props, forwardRef) => {
|
||||
|
||||
const mapsManager = MapsManagerService.getInstance();
|
||||
const mapsDownloader = MapsDownloaderService.getInstance();
|
||||
const bsaver = BeatSaverService.getInstance();
|
||||
const os = OsDiagnosticService.getInstance();
|
||||
|
||||
const ref = useRef(null)
|
||||
const isVisible = useInView(ref, {once: true});
|
||||
const [maps, setMaps] = useState<BsmLocalMap[]>([]);
|
||||
const [subs] = useState<Subscription[]>([]);
|
||||
const [selectedMaps, setSelectedMaps] = useState([]);
|
||||
const t = useTranslation();
|
||||
const ref = useRef(null)
|
||||
const isVisible = useInView(ref, {once: true, amount: .5});
|
||||
const [maps, setMaps] = useState<BsmLocalMap[]>(null);
|
||||
const [subs] = useState<Subscription[]>([]);
|
||||
const [selectedMaps$] = useState(new BehaviorSubject<BsmLocalMap[]>([]));
|
||||
const [itemPerRow, setItemPerRow] = useState(2);
|
||||
const [listHeight, setListHeight] = useState(0);
|
||||
|
||||
const [loadPercent$] = useState(new BehaviorSubject(0));
|
||||
|
||||
useImperativeHandle(forwardRef ,()=>({
|
||||
deleteMaps(){
|
||||
const mapsToDelete = selectedMaps.length === 0 ? maps : selectedMaps
|
||||
mapsManager.deleteMaps(mapsToDelete, version).finally(loadMaps);
|
||||
const mapsToDelete = selectedMaps$.value.length === 0 ? maps : selectedMaps$.value;
|
||||
mapsManager.deleteMaps(mapsToDelete, version).then(res => {
|
||||
if(!res){ return; }
|
||||
removeMapsFromList(mapsToDelete);
|
||||
selectedMaps$.next([]);
|
||||
});
|
||||
},
|
||||
exportMaps(){
|
||||
mapsManager.exportMaps(version, selectedMaps)
|
||||
mapsManager.exportMaps(version, selectedMaps$.value);
|
||||
},
|
||||
getMaps(){
|
||||
return maps;
|
||||
}
|
||||
}), [selectedMaps, maps, version]);
|
||||
}), [selectedMaps$.value, maps, version]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
if(isVisible){
|
||||
loadMaps();
|
||||
subs.push(mapsManager.versionLinked$.subscribe(loadMaps));
|
||||
subs.push(mapsManager.versionUnlinked$.subscribe(loadMaps));
|
||||
mapsDownloader.addOnMapDownloadedListener(loadMaps);
|
||||
mapsDownloader.addOnMapDownloadedListener((map, targerVersion) => {
|
||||
if(targerVersion !== version){ return; }
|
||||
setMaps(maps => maps ? [map, ...maps] : [map]);
|
||||
});
|
||||
}
|
||||
|
||||
return () => {
|
||||
setMaps(() => []);
|
||||
setMaps(() => null);
|
||||
loadPercent$.next(0);
|
||||
subs.forEach(s => s.unsubscribe());
|
||||
mapsDownloader.removeOnMapDownloadedListene(loadMaps);
|
||||
mapsDownloader.removeOnMapDownloadedListener(loadMaps);
|
||||
}
|
||||
}, [isVisible, version]);
|
||||
}, [isVisible, version, linked]);
|
||||
|
||||
const loadMaps = () => {
|
||||
subs.push(mapsManager.getMaps(version).subscribe(localMaps => setMaps(() => [...localMaps])));
|
||||
}
|
||||
useEffect(() => {
|
||||
|
||||
if(!isVisible){ return () => {}; }
|
||||
|
||||
const handleDelete = useCallback((map: BsmLocalMap) => {
|
||||
mapsManager.deleteMaps([map], version).then(res => res && loadMaps())
|
||||
}, [version]);
|
||||
const updateItemPerRow = (listWidth: number) => {
|
||||
const newPerRow = Math.min(Math.floor(listWidth / 400), 3);
|
||||
if(newPerRow === itemPerRow){ return; }
|
||||
setItemPerRow(newPerRow);
|
||||
};
|
||||
|
||||
const extractMapDiffs = (map: BsmLocalMap): Map<BsvMapCharacteristic, ParsedMapDiff[]> => {
|
||||
const res = new Map<BsvMapCharacteristic, ParsedMapDiff[]>();
|
||||
if(map.bsaverInfo?.versions[0]?.diffs){
|
||||
map.bsaverInfo.versions[0].diffs.forEach(diff => {
|
||||
const arr = res.get(diff.characteristic) || [];
|
||||
const diffName = map.rawInfo._difficultyBeatmapSets.find(set => set._beatmapCharacteristicName === diff.characteristic)._difficultyBeatmaps.find(rawDiff => rawDiff._difficulty === diff.difficulty)?._customData?._difficultyLabel || diff.difficulty
|
||||
arr.push({name: diffName, type: diff.difficulty, stars: diff.stars});
|
||||
res.set(diff.characteristic, arr);
|
||||
});
|
||||
return res;
|
||||
}
|
||||
const heightObserver$ = new BehaviorSubject(0);
|
||||
|
||||
map.rawInfo._difficultyBeatmapSets.forEach(set => {
|
||||
set._difficultyBeatmaps.forEach(diff => {
|
||||
const arr = res.get(set._beatmapCharacteristicName) || [];
|
||||
arr.push({name: diff._customData?._difficultyLabel || diff._difficulty, type: diff._difficulty, stars: null});
|
||||
res.set(set._beatmapCharacteristicName, arr);
|
||||
});
|
||||
const observer = new ResizeObserver(() => {
|
||||
updateItemPerRow(ref.current?.clientWidth || 0);
|
||||
heightObserver$.next(ref.current?.clientHeight || 0)
|
||||
});
|
||||
|
||||
return res;
|
||||
observer.observe(ref.current);
|
||||
|
||||
const sub = heightObserver$.pipe(debounceTime(100)).subscribe(setListHeight);
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
sub.unsubscribe();
|
||||
}
|
||||
|
||||
}, [isVisible, itemPerRow])
|
||||
|
||||
const loadMaps = () => {
|
||||
|
||||
setMaps(() => null);
|
||||
loadPercent$.next(0);
|
||||
|
||||
const loadMapsObs$ = mapsManager.getMaps(version);
|
||||
|
||||
subs.push(loadMapsObs$.pipe(
|
||||
tap(progress => loadPercent$.next(Math.floor(((progress.loaded / progress.total) * 100)))),
|
||||
last(),
|
||||
mergeMap(async progress => {
|
||||
if(os.isOffline){ return progress.maps; }
|
||||
const maps = progress.maps;
|
||||
const details = await bsaver.getMapDetailsFromHashs(maps.map(map => map.hash));
|
||||
return maps.map(map => {
|
||||
map.bsaverInfo = details.find(d => d.versions.at(0).hash === map.hash);
|
||||
return map;
|
||||
})
|
||||
})
|
||||
).subscribe({
|
||||
next: maps => setMaps(() => maps),
|
||||
complete: () => loadPercent$.next(0)
|
||||
}));
|
||||
}
|
||||
|
||||
const removeMapsFromList = (mapsToRemove: BsmLocalMap[]) => {
|
||||
const filtredMaps = maps.filter(map => !mapsToRemove.some(toDeleteMaps => map.hash === toDeleteMaps.hash));
|
||||
setMaps(() => filtredMaps);
|
||||
};
|
||||
|
||||
const handleDelete = useCallback((map: BsmLocalMap) => {
|
||||
mapsManager.deleteMaps([map], version).then(res => res && removeMapsFromList([map]));
|
||||
}, [version, maps]);
|
||||
|
||||
const onMapSelected = useCallback((map: BsmLocalMap) => {
|
||||
const maps = [...selectedMaps];
|
||||
if(maps.some(selectedMap => selectedMap.hash === map.hash)){
|
||||
const i = maps.findIndex(selectedMap => selectedMap.hash === map.hash);
|
||||
maps.splice(i, 1);
|
||||
|
||||
const mapsCopy = [...selectedMaps$.value];
|
||||
if(mapsCopy.some(selectedMap => selectedMap.hash === map.hash)){
|
||||
const i = mapsCopy.findIndex(selectedMap => selectedMap.hash === map.hash);
|
||||
mapsCopy.splice(i, 1);
|
||||
}
|
||||
else{
|
||||
maps.push(map);
|
||||
mapsCopy.push(map);
|
||||
}
|
||||
setSelectedMaps(() => maps);
|
||||
}, [selectedMaps]);
|
||||
|
||||
selectedMaps$.next(mapsCopy);
|
||||
|
||||
}, [selectedMaps$.value]);
|
||||
|
||||
const isMapFitFilter = (map: BsmLocalMap): boolean => {
|
||||
|
||||
@@ -215,46 +272,59 @@ export const LocalMapsListPanel = forwardRef(({version, className, filter, searc
|
||||
|
||||
}
|
||||
|
||||
const renderMaps = (): JSX.Element[] => {
|
||||
return maps.reduce((acc, current) => {
|
||||
if(isMapFitFilter(current)){
|
||||
acc.push(renderMapItem(current));
|
||||
|
||||
const preppedMaps: BsmLocalMap[][] = (() => {
|
||||
|
||||
if(!maps){ return []; }
|
||||
|
||||
const res: BsmLocalMap[][] = [];
|
||||
let mapsRow: BsmLocalMap[] = []
|
||||
|
||||
for(const map of maps){
|
||||
if(!isMapFitFilter(map)){ continue; }
|
||||
if(mapsRow.length === itemPerRow){
|
||||
res.push(mapsRow);
|
||||
mapsRow = [];
|
||||
}
|
||||
return acc
|
||||
}, []);
|
||||
mapsRow.push(map);
|
||||
}
|
||||
|
||||
if(mapsRow.length){
|
||||
res.push(mapsRow);
|
||||
}
|
||||
|
||||
return res;
|
||||
})();
|
||||
|
||||
if(!maps){
|
||||
return (
|
||||
<div ref={ref} className={className}>
|
||||
<div className="h-full flex flex-col items-center justify-center flex-wrap gap-1 text-gray-800 dark:text-gray-200">
|
||||
<BsmImage className="w-32 h-32 spin-loading" image={BeatWaitingImg}/>
|
||||
<span className="font-bold">{t("modals.download-maps.loading-maps")}</span>
|
||||
<TextProgressBar value$={loadPercent$}/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
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(_map => _map.hash === map.hash)}
|
||||
diffs={extractMapDiffs(map)} mapId={map.bsaverInfo?.id} qualified={null} ranked={map.bsaverInfo?.ranked} autorId={map.bsaverInfo?.uploader?.id} likes={map.bsaverInfo?.stats?.upvotes} createdAt={map.bsaverInfo?.createdAt}
|
||||
onDelete={handleDelete}
|
||||
onSelected={onMapSelected}
|
||||
callBackParam={map}
|
||||
/>;
|
||||
if(!maps.length){
|
||||
return (
|
||||
<div ref={ref} className={className}>
|
||||
<div className="h-full flex flex-col items-center justify-center flex-wrap gap-1 text-gray-800 dark:text-gray-200">
|
||||
<BsmImage className="h-32" image={BeatConflict}/>
|
||||
<span className="font-bold">{t("pages.version-viewer.maps.tabs.maps.empty-maps.text")}</span>
|
||||
<BsmButton className="font-bold rounded-md p-2" text="pages.version-viewer.maps.tabs.maps.empty-maps.button" typeColor="primary" withBar={false} onClick={e => {e.preventDefault(); mapsDownloader.openDownloadMapModal(version)}}/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div ref={ref} className={className}>
|
||||
<ul className="p-3 w-full grow flex flex-wrap justify-center content-start gap-2 overflow-y-scroll scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900">
|
||||
{maps?.length ? renderMaps() : (
|
||||
<div className="h-full flex flex-col items-center justify-center flex-wrap gap-1">
|
||||
<BsmImage className="h-32" image={BeatConflict}/>
|
||||
<span className="font-bold">{t("pages.version-viewer.maps.tabs.maps.empty-maps.text")}</span>
|
||||
<BsmButton className="font-bold rounded-md p-2" text="pages.version-viewer.maps.tabs.maps.empty-maps.button" typeColor="primary" withBar={false} onClick={e => {e.preventDefault(); mapsDownloader.openDownloadMapModal(version)}}/>
|
||||
</div>
|
||||
)}
|
||||
</ul>
|
||||
<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()}>
|
||||
{(props) => <MapsRow maps={props.data[props.index]} style={props.style} selectedMaps$={selectedMaps$} onMapSelect={onMapSelected} onMapDelete={handleDelete}/>}
|
||||
</VariableSizeList>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -11,7 +11,6 @@ import dateFormat from "dateformat";
|
||||
import { AudioPlayerService } from "renderer/services/audio-player.service";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { map } from "rxjs/operators";
|
||||
import useDelayedState from "use-delayed-state";
|
||||
import equal from "fast-deep-equal/es6";
|
||||
import { getMapZipUrlFromHash } from "renderer/helpers/maps-utils";
|
||||
import { BsmBasicSpinner } from "../shared/bsm-basic-spinner/bsm-basic-spinner.component";
|
||||
@@ -20,6 +19,8 @@ import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { MAP_DIFFICULTIES } from "renderer/partials/maps/map-difficulties/map-difficulties";
|
||||
import { MAP_DIFFICULTIES_COLORS } from "renderer/partials/maps/map-difficulties/map-difficulties-colors"
|
||||
import useDoubleClick from "use-double-click";
|
||||
import { GlowEffect } from "../shared/glow-effect.component";
|
||||
import { useDelayedState } from "renderer/hooks/use-delayed-state.hook";
|
||||
|
||||
export type ParsedMapDiff = {type: BsvMapDifficultyType, name: string, stars: number}
|
||||
|
||||
@@ -33,7 +34,6 @@ export type MapItemProps<T = any> = {
|
||||
autorId: number,
|
||||
mapId: string,
|
||||
diffs: Map<BsvMapCharacteristic, ParsedMapDiff[]>,
|
||||
qualified: boolean,
|
||||
ranked: boolean,
|
||||
bpm: number,
|
||||
duration: number,
|
||||
@@ -41,6 +41,7 @@ export type MapItemProps<T = any> = {
|
||||
createdAt: string,
|
||||
selected?: boolean,
|
||||
downloading?: boolean,
|
||||
showOwned?: boolean,
|
||||
callBackParam: T
|
||||
onDelete?: (param: T) => void,
|
||||
onDownload?: (param: T) => void,
|
||||
@@ -49,7 +50,7 @@ export type MapItemProps<T = any> = {
|
||||
onDoubleClick?: (param: T) => void
|
||||
}
|
||||
|
||||
export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl, autorId, mapId, diffs, qualified, ranked, bpm, duration, likes, createdAt, selected, downloading, callBackParam, onDelete, onDownload, onSelected, onCancelDownload, onDoubleClick}: MapItemProps) => {
|
||||
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 = LinkOpenerService.getInstance();
|
||||
const audioPlayer = AudioPlayerService.getInstance();
|
||||
@@ -92,7 +93,12 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
return diffLabel;
|
||||
}
|
||||
|
||||
const openPreview = () => linkOpener.open(previewUrl, true);
|
||||
const openPreview = () => {
|
||||
if(audioPlayer.playing){
|
||||
audioPlayer.pause();
|
||||
}
|
||||
linkOpener.open(previewUrl, true);
|
||||
}
|
||||
const copyBsr = () => navigator.clipboard.writeText(`!bsr ${mapId}`);
|
||||
const toogleMusic = () => {
|
||||
if(songPlaying){
|
||||
@@ -147,8 +153,8 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
}
|
||||
|
||||
return (
|
||||
<motion.li className="relative h-[100px] 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"}}>
|
||||
{(hovered || selected) && onSelected && <motion.span className="glow-on-hover !transition-none" animate={{opacity: 1}} transition={{duration: .2, ease: "linear"}}/>}
|
||||
<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: .15}} onHoverStart={diffsPanelHoverStart} onHoverEnd={diffsPanelHoverEnd}>
|
||||
@@ -175,7 +181,7 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
)}
|
||||
</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">
|
||||
<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"/>
|
||||
<span className="absolute flex justify-center items-center w-full h-full pr-1 bg-transparent top-0 left-0 group-hover:bg-black group-hover:bg-opacity-40" style={{color}} onClick={(e) => {e.stopPropagation(); e.preventDefault(); toogleMusic()}}>
|
||||
<BsmIcon className="w-full h-full p-7 opacity-0 group-hover:opacity-100 text-white hover:text-current" icon={songPlaying ? "pause" : "play"}/>
|
||||
@@ -186,7 +192,7 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
<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">
|
||||
<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}</BsmLink></h1>
|
||||
<h2 className="font-bold whitespace-nowrap text-ellipsis overflow-hidden w-full text-sm mb-[3px]">{songAutor && t("maps.map-item.by", {songAutor})}</h2>
|
||||
<h3 className="font-bold whitespace-nowrap text-ellipsis overflow-hidden w-full text-xs">{autor && (<> {t("maps.map-item.mapped-by")} <BsmLink href={authorUrl} className="brightness-150 hover:underline" style={{color}}>{autor}</BsmLink></>)}</h3>
|
||||
<h3 className="font-bold whitespace-nowrap text-ellipsis overflow-hidden w-full text-xs">{autor && (<> {t("maps.map-item.mapped-by")} <BsmLink href={authorUrl} className="brightness-200 hover:underline" style={{color}}>{autor}</BsmLink></>)}</h3>
|
||||
<div className="w-full h-4 text-xs gap-2 flex opacity-0 group-hover:opacity-100">
|
||||
{likesText && (
|
||||
<div className="h-full flex items-center">
|
||||
@@ -224,19 +230,15 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
<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-150" iconColor={color} icon="trash" withBar={false} onClick={e => {e.stopPropagation(); onDelete(callBackParam)}}/>}
|
||||
{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-150" iconColor={color} icon="download" withBar={false} onClick={e => {e.stopPropagation(); onDownload(callBackParam)}}/>}
|
||||
{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-150" iconColor="red" icon="cross" withBar={false} onClick={e => {e.stopPropagation(); onCancelDownload(callBackParam)}}/>}
|
||||
{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-150" style={{color}} thikness="3px"/>}
|
||||
{previewUrl && <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-150" iconColor={color} icon="eye" withBar={false} onClick={e => {e.stopPropagation(); openPreview()}}/>}
|
||||
{mapId && <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-150" iconColor={color} icon="twitch" withBar={false} onClick={e => {e.stopPropagation(); copyBsr()}}/>}
|
||||
{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)}}/>}
|
||||
{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)}}/>}
|
||||
{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)}}/>}
|
||||
{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"/>}
|
||||
{previewUrl && <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="eye" withBar={false} onClick={e => {e.stopPropagation(); openPreview()}}/>}
|
||||
{mapId && <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={color} icon="twitch" withBar={false} onClick={e => {e.stopPropagation(); copyBsr()}}/>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</motion.li>
|
||||
)
|
||||
}, areEqual)
|
||||
|
||||
function areEqual(prevProps: MapItemProps, nextProps: MapItemProps): boolean {
|
||||
return equal(prevProps, nextProps);
|
||||
}
|
||||
}, equal);
|
||||
|
||||
+45
-15
@@ -15,6 +15,10 @@ 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"
|
||||
|
||||
|
||||
type Props = {
|
||||
version?: BSVersion
|
||||
@@ -25,19 +29,40 @@ export function MapsPlaylistsPanel({version}: Props) {
|
||||
const mapsService = MapsManagerService.getInstance();
|
||||
const mapsDownloader = MapsDownloaderService.getInstance();
|
||||
const osDiagnostic = OsDiagnosticService.getInstance();
|
||||
const linker = VersionFolderLinkerService.getInstance();
|
||||
|
||||
const [tabIndex, setTabIndex] = useState(0);
|
||||
const [mapFilter, setMapFilter] = useState<MapFilter>({});
|
||||
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 t = useTranslation();
|
||||
const mapsRef = useRef<any>();
|
||||
|
||||
useEffect(() => {
|
||||
if(!version){ return; }
|
||||
|
||||
loadMapIsLinked();
|
||||
|
||||
const sub = mapsService.$mapsLinkingPending(version).pipe(debounceTime(50)).subscribe(setLinkingPending);
|
||||
|
||||
const onMapsLinked: VersionLinkerActionListener = (action, linked) => {
|
||||
if(!action.relativeFolder.includes(MapsManagerService.RELATIVE_MAPS_FOLDER)){ return; }
|
||||
loadMapIsLinked();
|
||||
}
|
||||
|
||||
linker.onVersionFolderLinked(onMapsLinked);
|
||||
linker.onVersionFolderUnlinked(onMapsLinked);
|
||||
|
||||
return () => {
|
||||
sub.unsubscribe();
|
||||
linker.removeVersionFolderLinkedListener(onMapsLinked);
|
||||
linker.removeVersionFolderUnlinkedListener(onMapsLinked);
|
||||
}
|
||||
|
||||
}, [version]);
|
||||
|
||||
const loadMapIsLinked = () => {
|
||||
@@ -53,19 +78,17 @@ export function MapsPlaylistsPanel({version}: Props) {
|
||||
|
||||
const handleMapsLinkClick = () => {
|
||||
if(!mapsLinked){
|
||||
return mapsService.linkVersion(version).then(loadMapIsLinked);
|
||||
return mapsService.linkVersion(version);
|
||||
}
|
||||
return mapsService.unlinkVersion(version).then(loadMapIsLinked);
|
||||
return mapsService.unlinkVersion(version);
|
||||
}
|
||||
|
||||
const handleMapsAddClick = () => {
|
||||
mapsDownloader.openDownloadMapModal(version);
|
||||
mapsDownloader.openDownloadMapModal(version, mapsRef.current.getMaps?.());
|
||||
}
|
||||
|
||||
const renderTab = (props: DetailedHTMLProps<React.HTMLAttributes<HTMLLIElement>, HTMLLIElement>, text: string, index: number): JSX.Element => {
|
||||
|
||||
const linkedColor = mapsLinked ? color : "red";
|
||||
|
||||
const onClickLink = (index: number) => {
|
||||
if(index === 0){ handleMapsLinkClick(); }
|
||||
}
|
||||
@@ -87,14 +110,21 @@ export function MapsPlaylistsPanel({version}: Props) {
|
||||
<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("pages.version-viewer.maps.tabs.maps.actions.add-maps.text")}</span>
|
||||
<span className="text-sm brightness-150">{t("misc.add")}</span>
|
||||
</motion.div>
|
||||
)}
|
||||
{(!!version) && (
|
||||
<motion.div variants={variants} whileHover="hover" whileTap="tap" initial={{rotate: 0}} className="block p-0.5 h-[calc(100%-5px)] aspect-square blur-0 hover:brightness-75" title={t(mapsLinked ? "pages.version-viewer.maps.tabs.maps.actions.link-maps.tooltips.unlink" : "pages.version-viewer.maps.tabs.maps.actions.link-maps.tooltips.link")} onClick={e => {e.stopPropagation(); onClickLink(index)}}>
|
||||
<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={mapsLinked ? "link" : "unlink"} style={{color: linkedColor}} />
|
||||
</motion.div>
|
||||
<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>
|
||||
)}
|
||||
@@ -117,10 +147,10 @@ export function MapsPlaylistsPanel({version}: Props) {
|
||||
})()
|
||||
|
||||
return (
|
||||
<div className="w-full h-full flex flex-col items-center justify-center">
|
||||
<nav className="w-full shrink-0 flex h-9 justify-center px-40 gap-2 mb-3 text-main-color-1 dark:text-white">
|
||||
<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">
|
||||
<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)}/>
|
||||
<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>
|
||||
<BsmDropdownButton className="h-full relative z-[1] flex justify-center" buttonClassName="flex items-center justify-center h-full rounded-full px-2 py-1" icon="filter" text="pages.version-viewer.maps.search-bar.filters-btn" withBar={false}>
|
||||
<FilterPanel className="absolute top-[calc(100%+3px)] origin-top w-[500px] h-fit p-2 rounded-md shadow-md shadow-black" filter={mapFilter} onChange={setMapFilter}/>
|
||||
@@ -130,8 +160,8 @@ export function MapsPlaylistsPanel({version}: Props) {
|
||||
<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)`}}>
|
||||
<LocalMapsListPanel ref={mapsRef} className="w-full h-full shrink-0 flex flex-col" version={version} filter={mapFilter} search={mapSearch}/>
|
||||
<div className="w-full h-full shrink-0 flex flex-col justify-center items-center content-center gap-2 overflow-hidden">
|
||||
<LocalMapsListPanel 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>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
import { CSSProperties, memo } from "react"
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook"
|
||||
import { distinctUntilChanged, map } from "rxjs/operators"
|
||||
import { BehaviorSubject } from "rxjs"
|
||||
import { BsvMapCharacteristic } from "shared/models/maps/beat-saver.model"
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface"
|
||||
import { ParsedMapDiff, MapItem } from "./map-item.component"
|
||||
import equal from "fast-deep-equal/es6"
|
||||
|
||||
type Props = {
|
||||
maps: BsmLocalMap[],
|
||||
style?: CSSProperties,
|
||||
onMapDelete: (map: BsmLocalMap) => void,
|
||||
onMapSelect: (map: BsmLocalMap) => void,
|
||||
selectedMaps$: BehaviorSubject<BsmLocalMap[]>
|
||||
}
|
||||
|
||||
export const MapsRow = memo(({maps, style, selectedMaps$, onMapSelect, onMapDelete}: Props) => {
|
||||
|
||||
const selectedMaps = useObservable<BsmLocalMap[]>(selectedMaps$.pipe(
|
||||
map(selectedMaps => selectedMaps.filter(selected => maps.some(map => map.hash === selected.hash))),
|
||||
distinctUntilChanged(equal)
|
||||
), []);
|
||||
|
||||
const extractMapDiffs = (map: BsmLocalMap): Map<BsvMapCharacteristic, ParsedMapDiff[]> => {
|
||||
const res = new Map<BsvMapCharacteristic, ParsedMapDiff[]>();
|
||||
if(map.bsaverInfo?.versions[0]?.diffs){
|
||||
map.bsaverInfo.versions[0].diffs.forEach(diff => {
|
||||
const arr = res.get(diff.characteristic) || [];
|
||||
const diffName = map.rawInfo._difficultyBeatmapSets.find(set => set._beatmapCharacteristicName === diff.characteristic)._difficultyBeatmaps.find(rawDiff => rawDiff._difficulty === diff.difficulty)?._customData?._difficultyLabel || diff.difficulty
|
||||
arr.push({name: diffName, type: diff.difficulty, stars: diff.stars});
|
||||
res.set(diff.characteristic, arr);
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
map.rawInfo._difficultyBeatmapSets.forEach(set => {
|
||||
set._difficultyBeatmaps.forEach(diff => {
|
||||
const arr = res.get(set._beatmapCharacteristicName) || [];
|
||||
arr.push({name: diff._customData?._difficultyLabel || diff._difficulty, type: diff._difficulty, stars: null});
|
||||
res.set(set._beatmapCharacteristicName, arr);
|
||||
});
|
||||
});
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
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 (
|
||||
<ul className="h-fit w-full flex flex-nowrap basis-0 gap-x-[8px] py-1 px-3" style={style}>
|
||||
{maps && maps.map(renderMapItem)}
|
||||
</ul>
|
||||
)
|
||||
}, equal);
|
||||
@@ -14,16 +14,19 @@ import { ModalComponent } from "renderer/services/modale.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { BsvMapCharacteristic, BsvMapDetail, MapFilter, SearchOrder, SearchParams } from "shared/models/maps/beat-saver.model";
|
||||
import BeatWaitingImg from "../../../../../assets/images/apngs/beat-waiting.png";
|
||||
import BeatConflictImg from "../../../../../assets/images/apngs/beat-conflict.png";
|
||||
import equal from "fast-deep-equal/es6";
|
||||
import { ProgressBarService } from "renderer/services/progress-bar.service";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { OsDiagnosticService } from "renderer/services/os-diagnostic.service";
|
||||
import { BsmLocalMap } from "shared/models/maps/bsm-local-map.interface";
|
||||
|
||||
export const DownloadMapsModal: ModalComponent<void, BSVersion> = ({data}) => {
|
||||
export const DownloadMapsModal: ModalComponent<void, {version: BSVersion, ownedMaps: BsmLocalMap[]}> = ({resolver, data: { ownedMaps, version }}) => {
|
||||
|
||||
const beatSaver = BeatSaverService.getInstance();
|
||||
const mapsManager = MapsManagerService.getInstance();
|
||||
const mapsDownloader = MapsDownloaderService.getInstance();
|
||||
const progressBar = ProgressBarService.getInstance();
|
||||
const os = OsDiagnosticService.getInstance();
|
||||
|
||||
const currentDownload = useObservable(mapsDownloader.currentMapDownload$);
|
||||
const mapsInQueue = useObservable(mapsDownloader.mapsInQueue$);
|
||||
@@ -33,7 +36,9 @@ export const DownloadMapsModal: ModalComponent<void, BSVersion> = ({data}) => {
|
||||
const [query, setQuery] = useState("");
|
||||
const [maps, setMaps] = useState<BsvMapDetail[]>([]);
|
||||
const [sortOrder, setSortOrder] = useState<SearchOrder>(BSV_SORT_ORDER.at(0));
|
||||
const [ownedMapHashs, setOwnedMapHashs] = useState<string[]>([]);
|
||||
const [ownedMapHashs, setOwnedMapHashs] = useState<string[]>(ownedMaps?.map(map => map.hash) ?? []);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const isOnline = useObservable(os.isOnline$);
|
||||
const [searchParams, setSearchParams] = useState<SearchParams>({
|
||||
sortOrder,
|
||||
filter,
|
||||
@@ -43,7 +48,7 @@ export const DownloadMapsModal: ModalComponent<void, BSVersion> = ({data}) => {
|
||||
|
||||
const loaderRef = useRef(null);
|
||||
|
||||
const sortOptions: BsmSelectOption[] = (() => {
|
||||
const sortOptions: BsmSelectOption<SearchOrder>[] = (() => {
|
||||
return BSV_SORT_ORDER.map(sort => ({text: `beat-saver.maps-sorts.${sort}`, value: sort}));
|
||||
})();
|
||||
|
||||
@@ -53,13 +58,12 @@ export const DownloadMapsModal: ModalComponent<void, BSVersion> = ({data}) => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
mapsManager.getMaps(data, false).toPromise().then(maps => setOwnedMapHashs(maps.map(map => map.hash)));
|
||||
|
||||
const onMapDownloaded = (map: BsvMapDetail, verion: BSVersion) => {
|
||||
if(!equal(verion, data) || !map?.versions){ return; }
|
||||
const downloadedHash = map.versions.at(0).hash;
|
||||
const onMapDownloaded = (map: BsmLocalMap, targerVersion: BSVersion) => {
|
||||
if(!equal(targerVersion, version)){ return; }
|
||||
const downloadedHash = map.hash;
|
||||
setOwnedMapHashs((prev) => [...prev, downloadedHash]);
|
||||
}
|
||||
|
||||
mapsDownloader.addOnMapDownloadedListener(onMapDownloaded);
|
||||
|
||||
if(mapsDownloader.isDownloading){
|
||||
@@ -67,13 +71,14 @@ export const DownloadMapsModal: ModalComponent<void, BSVersion> = ({data}) => {
|
||||
}
|
||||
|
||||
return () => {
|
||||
mapsDownloader.removeOnMapDownloadedListene(onMapDownloaded);
|
||||
mapsDownloader.removeOnMapDownloadedListener(onMapDownloaded);
|
||||
progressBar.setStyle(null);
|
||||
}
|
||||
}, [])
|
||||
|
||||
const loadMaps = (params: SearchParams) => {
|
||||
beatSaver.searchMaps(params).then((maps => setMaps(prev => [...prev, ...maps])));
|
||||
setLoading(() => true);
|
||||
beatSaver.searchMaps(params).then((maps => setMaps(prev => [...prev, ...maps]))).finally(() => setLoading(() => false));
|
||||
}
|
||||
|
||||
const extractMapDiffs = (map: BsvMapDetail): Map<BsvMapCharacteristic, ParsedMapDiff[]> => {
|
||||
@@ -93,7 +98,7 @@ export const DownloadMapsModal: ModalComponent<void, BSVersion> = ({data}) => {
|
||||
|
||||
const isMapOwned = map.versions.some(version => ownedMapHashs.includes(version.hash));
|
||||
const isDownloading = map.id === currentDownload?.map?.id;
|
||||
const inQueue = mapsInQueue.some(toDownload => equal(toDownload.version, data) && toDownload.map.id === map.id);
|
||||
const inQueue = mapsInQueue.some(toDownload => equal(toDownload.version, version) && toDownload.map.id === map.id);
|
||||
|
||||
return (
|
||||
<MapItem
|
||||
@@ -107,7 +112,6 @@ export const DownloadMapsModal: ModalComponent<void, BSVersion> = ({data}) => {
|
||||
likes={map.stats.upvotes}
|
||||
mapId={map.id}
|
||||
ranked={map.ranked}
|
||||
qualified={map.qualified}
|
||||
title={map.name}
|
||||
songAutor={map.metadata.songAuthorName}
|
||||
diffs={extractMapDiffs(map)}
|
||||
@@ -117,23 +121,24 @@ export const DownloadMapsModal: ModalComponent<void, BSVersion> = ({data}) => {
|
||||
onDoubleClick={(!isMapOwned && !inQueue) && (handleDownloadMap)}
|
||||
onCancelDownload={(inQueue && !isDownloading) && (handleCancelDownload)}
|
||||
downloading={isDownloading}
|
||||
showOwned={isMapOwned}
|
||||
callBackParam={map}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const handleDownloadMap = useCallback((map: BsvMapDetail) => {
|
||||
mapsDownloader.addMapToDownload({map, version: data})
|
||||
mapsDownloader.addMapToDownload({map, version})
|
||||
}, []);
|
||||
|
||||
const handleCancelDownload = useCallback((map: BsvMapDetail) => {
|
||||
mapsDownloader.removeMapToDownload({map, version: data});
|
||||
mapsDownloader.removeMapToDownload({map, version});
|
||||
}, []);
|
||||
|
||||
const handleSortChange = (newSort: string) => {
|
||||
setSortOrder(() => newSort as SearchOrder);
|
||||
const handleSortChange = (newSort: SearchOrder) => {
|
||||
setSortOrder(() => newSort);
|
||||
setMaps(() => []);
|
||||
setSearchParams(() => ({...searchParams, sortOrder: (newSort as SearchOrder)}));
|
||||
setSearchParams(() => ({...searchParams, sortOrder: (newSort)}));
|
||||
}
|
||||
|
||||
const handleSearch = () => {
|
||||
@@ -162,13 +167,13 @@ export const DownloadMapsModal: ModalComponent<void, BSVersion> = ({data}) => {
|
||||
</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 className="shrink-0 rounded-full py-1 px-3 !bg-light-main-color-1 dark:!bg-main-color-1 flex justify-center items-center capitalize" icon="search" text="modals.download-maps.search-btn" withBar={false} onClick={e => {e.preventDefault(); handleSearch()}}/>
|
||||
<BsmSelect className="bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-1 pb-0.5 text-center" options={sortOptions} onChange={handleSortChange}/>
|
||||
<BsmSelect className="bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-1 pb-0.5 text-center" options={sortOptions} onChange={sort => handleSortChange(sort)}/>
|
||||
</div>
|
||||
<ul className="w-full grow flex content-start flex-wrap gap-2 px-2 overflow-y-scroll overflow-x-hidden scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 z-0" >
|
||||
<ul className="w-full grow flex content-start flex-wrap gap-2 pt-1.5 px-2 overflow-y-scroll overflow-x-hidden scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 z-0" >
|
||||
{maps.length === 0 ? (
|
||||
<div className="w-full h-full flex flex-col items-center justify-center">
|
||||
<img className="w-32 h-32 spin-loading" src={BeatWaitingImg} alt=" "/>
|
||||
<span className="text-lg">{t("modals.download-maps.loading-maps")}</span>
|
||||
<img className={`w-32 h-32 ${loading && "spin-loading"}`} src={loading ? BeatWaitingImg : BeatConflictImg} alt=" "/>
|
||||
<span className="text-lg">{t(loading ? "modals.download-maps.loading-maps" : isOnline ? "modals.download-maps.no-maps-found" : "modals.download-maps.no-internet")}</span>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
|
||||
@@ -21,7 +21,7 @@ export const GuardModal: ModalComponent<string> = ({resolver}) => {
|
||||
<BsmImage className="mx-auto h-24" image={BeatConflict}/>
|
||||
<div className="mb-4">
|
||||
<label className="block font-bold tracking-wide text-gray-800 dark:text-gray-200" htmlFor="guard">{t("modals.guard.inputs.guard-code.label")}</label>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-2 rounded-md py-[2px]" onChange={e => setGuardCode(e.target.value.toUpperCase())} value={guardCode} type="guard" name="guard" id="guard" placeholder={t("modals.guard.inputs.guard-code.placeholder")}/>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-2 rounded-md py-[2px]" onChange={e => setGuardCode(e.target.value.toUpperCase().replaceAll(" ", ""))} value={guardCode} type="guard" name="guard" id="guard" placeholder={t("modals.guard.inputs.guard-code.placeholder")}/>
|
||||
</div>
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => {resolver({exitCode: ModalExitCode.CANCELED})}} withBar={false} text="misc.cancel"/>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { BsmButton } from 'renderer/components/shared/bsm-button.component'
|
||||
import { BsmImage } from 'renderer/components/shared/bsm-image.component'
|
||||
import { useTranslation } from 'renderer/hooks/use-translation.hook'
|
||||
import { ModalComponent, ModalExitCode } from 'renderer/services/modale.service'
|
||||
import BeatImpatient from "../../../../../assets/images/apngs/beat-impatient.png"
|
||||
|
||||
export const ImportVersionModal: ModalComponent<void> = ({resolver}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
return (
|
||||
<form>
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.bs-import-version.title")}</h1>
|
||||
<BsmImage className="mx-auto h-20" image={BeatImpatient}/>
|
||||
<p className="max-w-sm text-gray-800 dark:text-gray-200">{t("modals.bs-import-version.description")}</p>
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4 mt-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.CANCELED})} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.COMPLETED})} withBar={false} text="modals.bs-import-version.buttons.submit"/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -2,14 +2,17 @@ import { useState } from "react";
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { BsmImage } from "renderer/components/shared/bsm-image.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service";
|
||||
import { ModalComponent, ModalExitCode, ModalService } from "renderer/services/modale.service";
|
||||
import BeatImpatient from '../../../../../assets/images/apngs/beat-impatient.png'
|
||||
import { WhyCredentialsModal } from "./why-credentials-modal.component";
|
||||
|
||||
export const LoginModal: ModalComponent<{username: string, password: string, stay: boolean}> = ({resolver}) => {
|
||||
|
||||
const modal = ModalService.getInsance();
|
||||
|
||||
const [username, setUsername] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [stay, setStay] = useState(true);
|
||||
const [stay, setStay] = useState(false);
|
||||
const t = useTranslation();
|
||||
|
||||
const loggin = () => {
|
||||
@@ -17,22 +20,29 @@ export const LoginModal: ModalComponent<{username: string, password: string, sta
|
||||
resolver({exitCode: ModalExitCode.COMPLETED, data:{username, password, stay}});
|
||||
}
|
||||
|
||||
const whyCredentials = () => {
|
||||
modal.openModal(WhyCredentialsModal);
|
||||
}
|
||||
|
||||
return (
|
||||
<form onSubmit={(e) => {e.preventDefault(); loggin();}}>
|
||||
<form className="max-w-xs" onSubmit={(e) => {e.preventDefault(); loggin();}}>
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.steam-login.title")}</h1>
|
||||
<BsmImage className="mx-auto h-20" image={BeatImpatient} />
|
||||
|
||||
<div className="mb-2">
|
||||
<label className="block font-bold cursor-pointer tracking-wide text-gray-800 dark:text-gray-200" htmlFor="username">{t("modals.steam-login.inputs.username.label")}</label>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-1 py-[2px] rounded-md outline-none" onChange={e => setUsername(e.target.value)} value={username} type="text" name="username" id="username" placeholder={t("modals.steam-login.inputs.username.placeholder")}/>
|
||||
</div>
|
||||
<div className="mb-2">
|
||||
<div className="mb-2 flex flex-col w-full">
|
||||
<label className="block font-bold cursor-pointer tracking-wide text-gray-800 dark:text-gray-200" htmlFor="password">{t("modals.steam-login.inputs.password.label")}</label>
|
||||
<input className="w-full bg-light-main-color-1 dark:bg-main-color-1 px-1 py-[2px] rounded-md outline-none" onChange={e => setPassword(e.target.value)} value={password} type="password" name="password" id="password" placeholder={t("modals.steam-login.inputs.password.placeholder")}/>
|
||||
{password?.length > 64 && (
|
||||
<span className="text-orange-700 dark:text-orange-400 text-xs whitespace-normal max-w-full w-full overflow-hidden">{t("modals.steam-login.inputs.password.max-length-warning")}</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center content-center justify-start mb-3">
|
||||
<input onChange={e => setStay(e.target.checked)} checked={stay} className="mr-1" type="checkbox" name="stay" id="stay" />
|
||||
<label className="cursor-pointer text-gray-800 dark:text-gray-200" htmlFor="stay">{t("modals.steam-login.inputs.stay.label")}</label>
|
||||
</div>
|
||||
|
||||
<span onClick={whyCredentials} className="underline my-4 block cursor-pointer">{t("modals.steam-login.why-credentials")}</span>
|
||||
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => {resolver({exitCode: ModalExitCode.CANCELED})}} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" type="submit" withBar={false} text="modals.steam-login.buttons.submit"/>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import { useState } from 'react'
|
||||
import { ModalComponent, ModalExitCode } from 'renderer/services/modale.service'
|
||||
import { BsmLocalModel } from 'shared/models/models/bsm-local-model.interface'
|
||||
import BeatConflict from '../../../../../../assets/images/apngs/beat-conflict.png'
|
||||
import { BsmImage } from 'renderer/components/shared/bsm-image.component'
|
||||
import { BsmCheckbox } from 'renderer/components/shared/bsm-checkbox.component'
|
||||
import { BsmButton } from 'renderer/components/shared/bsm-button.component'
|
||||
import { useTranslation } from 'renderer/hooks/use-translation.hook'
|
||||
import { useOnUpdate } from 'renderer/hooks/use-on-update.hook'
|
||||
import { useConstant } from 'renderer/hooks/use-constant.hook'
|
||||
import { ConfigurationService } from 'renderer/services/configuration.service'
|
||||
import { ModelsManagerService } from 'renderer/services/models-management/models-manager.service'
|
||||
|
||||
export const DeleteModelsModal: ModalComponent<void, {models: BsmLocalModel[], linked: boolean}> = ({resolver, data}) => {
|
||||
|
||||
const config = useConstant(() => ConfigurationService.getInstance());
|
||||
const t = useTranslation();
|
||||
const [remember, setRemember] = useState(config.get<boolean>(ModelsManagerService.REMEMBER_CHOICE_DELETE_MODEL_KEY) || false);
|
||||
|
||||
useOnUpdate(() => {
|
||||
config.set(ModelsManagerService.REMEMBER_CHOICE_DELETE_MODEL_KEY, remember);
|
||||
}, [remember]);
|
||||
|
||||
const isMultiple = data.models.length > 1;
|
||||
|
||||
const title = useConstant(() => isMultiple ? t("models.modals.delete-models.title") : t("models.modals.delete-model.title"));
|
||||
const desc = useConstant(() => isMultiple ? t("models.modals.delete-models.desc", {nb: `${data.models.length}`}) : t("models.modals.delete-model.desc", {modelName: data.models[0].model?.name ?? data.models[0].fileName}));
|
||||
const linkedAnnotation = useConstant(() => data.linked ? (isMultiple ? t("models.modals.delete-models.linked-annotation") : t("models.modals.delete-model.linked-annotation")) : undefined);
|
||||
|
||||
return (
|
||||
<form className="text-gray-800 dark:text-gray-200">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{title}</h1>
|
||||
<BsmImage className="mx-auto h-24" image={BeatConflict}/>
|
||||
<p className="max-w-sm w-full">{desc}</p>
|
||||
{data.linked && <p className="text-sm italic mt-2 w-fit">{linkedAnnotation}</p>}
|
||||
{!isMultiple && (
|
||||
<div className="flex items-center relative py-2 gap-1 mt-1">
|
||||
<BsmCheckbox className="h-5 relative z-[1]" checked={remember} onChange={(val) => setRemember(val)}/>
|
||||
<span className="italic">{t("modals.misc.remember-my-choice")}</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4 mt-2">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.CANCELED})} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.COMPLETED})} withBar={false} text="misc.delete"/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
import { motion } from "framer-motion";
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { BsmSelect, BsmSelectOption } from "renderer/components/shared/bsm-select.component";
|
||||
import { ModalComponent } from "renderer/services/modale.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import BeatWaitingImg from "../../../../../../assets/images/apngs/beat-waiting.png";
|
||||
import BeatConflictImg from "../../../../../../assets/images/apngs/beat-conflict.png";
|
||||
import { MSGetQuery, MSGetSort, MSGetSortDirection, MSModel, MSModelPlatform, MSModelType } from "shared/models/models/model-saber.model";
|
||||
import { useCallback, useState } from "react";
|
||||
import { ModelItem } from "renderer/components/models-management/model-item.component";
|
||||
import { useService } from "renderer/hooks/use-service.hook";
|
||||
import { ModelDownload, ModelsDownloaderService } from "renderer/services/models-management/models-downloader.service";
|
||||
import { ModelSaberService } from "renderer/services/thrird-partys/model-saber.service";
|
||||
import { useBehaviorSubject } from "renderer/hooks/use-behavior-subject.hook";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { OsDiagnosticService } from "renderer/services/os-diagnostic.service";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { useConstant } from "renderer/hooks/use-constant.hook";
|
||||
import { MODEL_TYPES, MS_GET_QUERY_SORTS } from "shared/models/models/constants";
|
||||
import { useOnUpdate } from "renderer/hooks/use-on-update.hook";
|
||||
import equal from "fast-deep-equal";
|
||||
import { catchError, of } from "rxjs";
|
||||
import Tippy from "@tippyjs/react";
|
||||
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
|
||||
|
||||
export const DownloadModelsModal: ModalComponent<void, {version: BSVersion, type: MSModelType, owned: BsmLocalModel[]}> = ({resolver, data: { version, type, owned }}) => {
|
||||
|
||||
const modelsDownloader = useService(ModelsDownloaderService);
|
||||
const modelSaber = useService(ModelSaberService);
|
||||
const os = useService(OsDiagnosticService);
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const modelTypesOptions = useConstant<BsmSelectOption<MSModelType>[]>(() => MODEL_TYPES.map(type => ({
|
||||
text: `models.types.plural.${type}`,
|
||||
value: type
|
||||
})));
|
||||
|
||||
const querySortsOptions = useConstant<BsmSelectOption<MSGetSort>[]>(() => MS_GET_QUERY_SORTS.map(sort => ({
|
||||
text: `models.sorts.${sort}`,
|
||||
value: sort
|
||||
})));
|
||||
|
||||
const currentDownload = useObservable(modelsDownloader.currentDownload$(), null);
|
||||
const downloadQueue = useObservable(modelsDownloader.getQueue$(), []);
|
||||
const [msModels, msModels$] = useBehaviorSubject<MSModel[]>([]);
|
||||
const isOnline = useObservable(os.isOnline$, true);
|
||||
const [error, error$] = useBehaviorSubject(false);
|
||||
const [isLoading, isLoading$] = useBehaviorSubject(false);
|
||||
const [ownedModels, setOwnedModels] = useState<BsmLocalModel[]>(owned ?? []);
|
||||
|
||||
const [currentType, currentType$] = useBehaviorSubject<MSModelType>(type);
|
||||
const [currentSort, currentSort$] = useBehaviorSubject<MSGetSort>(MSGetSort.Date);
|
||||
const [searhInput, searhInput$] = useBehaviorSubject("");
|
||||
const [getQuery, getQuery$] = useBehaviorSubject<MSGetQuery>({ type: currentType, platform: MSModelPlatform.PC, start: 0, end: 25, sort: currentSort, sortDirection: MSGetSortDirection.Descending });
|
||||
|
||||
useOnUpdate(() => {
|
||||
const sub = modelsDownloader.onModelsDownloaded((model => {
|
||||
if(!equal(model.version, version)) { return; }
|
||||
setOwnedModels(prev => [...prev ?? [], model]);
|
||||
}));
|
||||
|
||||
return () => sub.unsubscribe();
|
||||
});
|
||||
|
||||
useOnUpdate(() => {
|
||||
error$.next(false);
|
||||
isLoading$.next(true);
|
||||
|
||||
const sub = modelSaber.searchModels(getQuery).pipe(catchError(() => {
|
||||
error$.next(true);
|
||||
return of([]);
|
||||
})).subscribe(models => {
|
||||
msModels$.next([...msModels, ...models]);
|
||||
isLoading$.next(false);
|
||||
});
|
||||
|
||||
return () => sub.unsubscribe();
|
||||
}, [getQuery])
|
||||
|
||||
useOnUpdate(() => {
|
||||
msModels$.next([]);
|
||||
|
||||
getQuery$.next({
|
||||
...getQuery$.value,
|
||||
start: 0,
|
||||
end: 25,
|
||||
type: currentType,
|
||||
sort: currentSort
|
||||
});
|
||||
|
||||
}, [currentType, currentSort]);
|
||||
|
||||
const loadMore = () => {
|
||||
const currentQuery = getQuery;
|
||||
currentQuery.start += 25;
|
||||
currentQuery.end += 25;
|
||||
getQuery$.next({...currentQuery});
|
||||
}
|
||||
|
||||
const search = () => {
|
||||
|
||||
const getQuery: MSGetQuery = {
|
||||
start: 0, end: 25,
|
||||
type: currentType,
|
||||
sort: currentSort,
|
||||
filter: modelSaber.parseFilter(searhInput)
|
||||
};
|
||||
|
||||
msModels$.next([]);
|
||||
getQuery$.next(getQuery);
|
||||
|
||||
}
|
||||
|
||||
const handleDownloadModel = useCallback((model: MSModel) => {
|
||||
modelsDownloader.addModelToDownload({model, version});
|
||||
}, []);
|
||||
|
||||
const handleCancelDownload = useCallback((model: MSModel) => {
|
||||
modelsDownloader.removeFromDownloadQueue({model, version});
|
||||
}, []);
|
||||
|
||||
const modelPendingDownload = (model: MSModel) => {
|
||||
return downloadQueue.some(download => download.model.id === model.id && equal(download.version, version));
|
||||
}
|
||||
|
||||
const isModelOwned = (model: MSModel) => {
|
||||
return !!ownedModels.some(owned => owned.hash === model.hash);
|
||||
}
|
||||
|
||||
const renderFilterTips = useConstant(() => (
|
||||
<div className="w-fit flex">
|
||||
<table className="w-fit whitespace-nowrap grow shrink-0 text-sm">
|
||||
<tbody>
|
||||
<tr className="font-bold"><td className="mr-3 block">{t("models.modals.download-models.search-tips.header.tag")}</td><td>{t("models.modals.download-models.search-tips.header.desc")}</td></tr>
|
||||
<tr><td className="mr-3 block">author:</td><td>{t("models.modals.download-models.search-tips.author-desc")}</td></tr>
|
||||
<tr><td className="mr-3 block">tag:</td><td>{t("models.modals.download-models.search-tips.tag-desc")}</td></tr>
|
||||
<tr><td className="mr-3 block">hash:</td><td>{t("models.modals.download-models.search-tips.hash-desc")}</td></tr>
|
||||
<tr><td className="mr-3 block">name:</td><td>{t("models.modals.download-models.search-tips.name-desc")}</td></tr>
|
||||
<tr><td className="mr-3 block">discordid:</td><td>{t("models.modals.download-models.search-tips.discordid-desc")}</td></tr>
|
||||
<tr><td className="mr-3 block">status:</td><td>{t("models.modals.download-models.search-tips.status-desc")}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
));
|
||||
|
||||
const renderLoadingStatus = () => {
|
||||
if(isLoading) { return <span className="text-lg">{t("models.panel.grid.loading")}</span> }
|
||||
if(isOnline) { return <span className="text-lg">{t("models.modals.download-models.no-models")}</span> }
|
||||
if(!isOnline) { return <span className="text-lg">{t("models.modals.download-models.no-internet")}</span> }
|
||||
return <span className="text-lg">{t("models.modals.download-models.error-occured")}</span>
|
||||
}
|
||||
|
||||
return (
|
||||
<form className="text-gray-800 dark:text-gray-200 flex flex-col max-w-[95vw] w-[970px] h-[85vh] gap-3" onSubmit={e => {e.preventDefault(); search()}}>
|
||||
<div className="flex h-9 gap-2 shrink-0">
|
||||
<BsmSelect className="bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-1 pb-0.5 text-center capitalize" options={modelTypesOptions} selected={currentType} onChange={(value) => currentType$.next(value)}/>
|
||||
<div className="h-ful grow relative flex justify-center items-center">
|
||||
<input className="h-full w-full bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-2 pb-0.5" type="text" name="" id="" placeholder={t("models.modals.download-models.search-placeholder")} value={searhInput} onChange={e => searhInput$.next(e.target.value)}/>
|
||||
<Tippy placement="bottom" content={renderFilterTips} allowHTML={true} maxWidth={Infinity}>
|
||||
<div className="absolute right-0 h-full w-fit p-1 cursor-pointer">
|
||||
<BsmButton className="h-full rounded-full p-1 aspect-square" typeColor="primary" icon="info" withBar={false}/>
|
||||
</div>
|
||||
</Tippy>
|
||||
|
||||
</div>
|
||||
<BsmButton className="shrink-0 rounded-full py-1 px-3 !bg-light-main-color-1 dark:!bg-main-color-1 flex justify-center items-center capitalize" icon="search" type="submit" text="models.modals.download-models.search-btn" withBar={false} onClick={e => {e.preventDefault(); search()}}/>
|
||||
<BsmSelect className="bg-light-main-color-1 dark:bg-main-color-1 rounded-full px-1 pb-0.5 text-center capitalize" options={querySortsOptions} onChange={(value) => currentSort$.next(value)}/>
|
||||
</div>
|
||||
<ul className="w-full grow flex content-start flex-wrap gap-4 pt-1.5 px-2 overflow-y-scroll overflow-x-hidden scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 z-0" >
|
||||
{msModels.length === 0 ? (
|
||||
<div className="w-full h-full flex flex-col items-center justify-center">
|
||||
<img className={`w-32 h-32 ${isLoading && "spin-loading"}`} src={(isLoading && !error) ? BeatWaitingImg : BeatConflictImg} alt=" "/>
|
||||
{renderLoadingStatus()}
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{msModels.map(model => (
|
||||
<ModelItem
|
||||
key={model.id}
|
||||
{...model}
|
||||
callbackValue={model}
|
||||
isDownloading={equal(currentDownload, {model, version} as ModelDownload)}
|
||||
onDownload={!isModelOwned(model) ? handleDownloadModel: undefined}
|
||||
onDoubleClick={(!isModelOwned(model)) ? handleDownloadModel: undefined}
|
||||
onCancelDownload={modelPendingDownload(model) ? handleCancelDownload : undefined}
|
||||
/>
|
||||
))}
|
||||
<motion.span onViewportEnter={loadMore} className="block w-full h-8"/>
|
||||
</>
|
||||
)}
|
||||
</ul>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { useState } from "react"
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component"
|
||||
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component"
|
||||
import { BsmImage } from "renderer/components/shared/bsm-image.component"
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook"
|
||||
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service"
|
||||
import { MSModelType } from "shared/models/models/model-saber.model"
|
||||
import BeatRunning from '../../../../../../assets/images/apngs/beat-running.png'
|
||||
|
||||
export const LinkModelsModal: ModalComponent<boolean, MSModelType> = ({resolver, data}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const [keepMaps, setKeepMaps] = useState(true)
|
||||
|
||||
return (
|
||||
<form className="text-gray-800 dark:text-gray-200">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{t(`models.modals.link-models.${data}.title`)}</h1>
|
||||
<BsmImage className="mx-auto h-24" image={BeatRunning} />
|
||||
<p className="max-w-sm w-full">{t(`models.modals.link-models.${data}.desc`)}</p>
|
||||
<p className="max-w-sm w-full text-sm italic mt-2">{t(`models.modals.link-models.${data}.info`)}</p>
|
||||
<div className="relative h-5 flex my-3 items-center">
|
||||
<BsmCheckbox className="h-full aspect-square relative bg-inherit mr-1.5 z-[1]" checked={keepMaps} onChange={setKeepMaps}/>
|
||||
<span className="text-sm mb-0.5 cursor-help" title={t(`models.modals.link-models.${data}.keep-models.title`)}>{t(`models.modals.link-models.${data}.keep-models.label`)}</span>
|
||||
</div>
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4 mt-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.CANCELED})} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="primary" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.COMPLETED, data: keepMaps})} withBar={false} text={`models.modals.link-models.${data}.valid-btn`}/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { useState } from "react";
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { BsmCheckbox } from "renderer/components/shared/bsm-checkbox.component";
|
||||
import { BsmImage } from "renderer/components/shared/bsm-image.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service";
|
||||
import BeatConflict from '../../../../../../assets/images/apngs/beat-conflict.png'
|
||||
import { MSModelType } from "shared/models/models/model-saber.model";
|
||||
|
||||
export const UnlinkModelsModal: ModalComponent<boolean, MSModelType> = ({resolver, data}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
const [keepMaps, setKeepMaps] = useState(true);
|
||||
|
||||
return (
|
||||
<form className="text-gray-800 dark:text-gray-200">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center">{t(`models.modals.unlink-models.${data}.title`)}</h1>
|
||||
<BsmImage className="mx-auto h-24" image={BeatConflict} />
|
||||
<p className="max-w-sm w-full">{t(`models.modals.unlink-models.${data}.desc`)}</p>
|
||||
<div className="relative h-5 flex my-3 items-center">
|
||||
<BsmCheckbox className="h-full aspect-square relative bg-inherit mr-1.5 z-[1]" checked={keepMaps} onChange={setKeepMaps}/>
|
||||
<span className="text-sm mb-0.5 cursor-help" title={t(`models.modals.unlink-models.${data}.keep-models.title`)}>{t(`models.modals.unlink-models.${data}.keep-models.label`)}</span>
|
||||
</div>
|
||||
<div className="grid grid-flow-col grid-cols-2 gap-4 mt-4">
|
||||
<BsmButton typeColor="cancel" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.CANCELED})} withBar={false} text="misc.cancel"/>
|
||||
<BsmButton typeColor="error" className="rounded-md text-center transition-all" onClick={() => resolver({exitCode: ModalExitCode.COMPLETED, data: keepMaps})} withBar={false} text={`models.modals.unlink-models.${data}.valid-btn`}/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
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";
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { BSVersionManagerService } from "renderer/services/bs-version-manager.service";
|
||||
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 { BSVersion } from "shared/bs-version.interface";
|
||||
|
||||
export const ShareFoldersModal: ModalComponent<void, BSVersion> = ({ data }) => {
|
||||
|
||||
const SHARED_FOLDERS_KEY = "default-shared-folders";
|
||||
|
||||
const config = ConfigurationService.getInstance();
|
||||
const ipc = IpcService.getInstance();
|
||||
const linker = VersionFolderLinkerService.getInstance();
|
||||
const versionManager = BSVersionManagerService.getInstance();
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const [folders, setFolders] = useState<string[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
setFolders(prev => Array.from(new Set([...prev, ...config.get<string[]>(SHARED_FOLDERS_KEY)]).values()));
|
||||
|
||||
linker.getLinkedFolders(data, {relative: true}).toPromise().then(linkedFolders => {
|
||||
setFolders(prev => Array.from(new Set([...prev, ...linkedFolders]).values()));
|
||||
});
|
||||
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
if(!folders?.length){
|
||||
config.delete(SHARED_FOLDERS_KEY);
|
||||
return;
|
||||
}
|
||||
|
||||
config.set(SHARED_FOLDERS_KEY, folders);
|
||||
|
||||
}, [folders]);
|
||||
|
||||
const addFolder = async () => {
|
||||
const versionPath = await versionManager.getVersionPath(data).toPromise();
|
||||
const folder = await ipc.sendV2<{canceled: boolean, filePaths: string[]}, string>("choose-folder", {args: versionPath}).toPromise();
|
||||
|
||||
if(!folder || folder.canceled || !folder.filePaths?.length){ return; }
|
||||
|
||||
const relativeFolder = await ipc.sendV2<string>("full-version-path-to-relative", {args: {version: data, fullPath: folder.filePaths[0]}}).toPromise();
|
||||
|
||||
if(folders.includes(relativeFolder)){ return; }
|
||||
|
||||
setFolders(pre => [...pre, relativeFolder]);
|
||||
}
|
||||
|
||||
const removeFolder = (index: number) => {
|
||||
setFolders((prev) => prev.filter((_, i) => i !== index));
|
||||
}
|
||||
|
||||
const linkAll = () => {
|
||||
folders.forEach(relativeFolder => linker.linkVersionFolder({ version: data, relativeFolder, type: VersionLinkerActionType.Link }))
|
||||
}
|
||||
|
||||
return (
|
||||
<form className="w-full max-w-md ">
|
||||
<h1 className="text-3xl uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.shared-folders.title")}</h1>
|
||||
<p className="my-3">{t("modals.shared-folders.description")}</p>
|
||||
<ul className="flex flex-col gap-1 mb-2 h-[300px] max-h-[300px] overflow-scroll scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 px-1">
|
||||
{folders.map((folder, index) => (
|
||||
<FolderItem key={index} version={data} relativeFolder={folder} onDelete={() => {removeFolder(index)}}/>
|
||||
))}
|
||||
</ul>
|
||||
<div className="grid grid-flow-col gap-3 grid-cols-2">
|
||||
<BsmButton icon="add" className="h-8 rounded-md flex justify-center items-center font-bold bg-light-main-color-1 dark:bg-main-color-1" iconClassName="h-6 aspect-square text-current" onClick={addFolder} withBar={false} text="modals.shared-folders.buttons.add-folder"/>
|
||||
<BsmButton icon="link" className="h-8 rounded-md flex justify-center items-center font-bold" typeColor="primary" iconClassName="h-6 aspect-square text-current -rotate-45" onClick={linkAll} withBar={false} text="modals.shared-folders.buttons.link-all"/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
|
||||
// -------- FOLDER ITEM --------
|
||||
|
||||
type FolderProps = {
|
||||
version: BSVersion;
|
||||
relativeFolder: string;
|
||||
onDelete?: () => void;
|
||||
}
|
||||
|
||||
const FolderItem = ({version, relativeFolder, onDelete}: FolderProps) => {
|
||||
|
||||
const linker = VersionFolderLinkerService.getInstance();
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const name = relativeFolder.split("\\").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 onClickLink = () => {
|
||||
if(linked){
|
||||
return linker.unlinkVersionFolder({
|
||||
version,
|
||||
relativeFolder,
|
||||
type: VersionLinkerActionType.Unlink,
|
||||
})
|
||||
}
|
||||
|
||||
return linker.linkVersionFolder({
|
||||
version,
|
||||
relativeFolder,
|
||||
type: VersionLinkerActionType.Link,
|
||||
})
|
||||
}
|
||||
|
||||
const cancelLink = () => {
|
||||
linker.cancelAction(version, relativeFolder);
|
||||
loadFolderIsLinked();
|
||||
}
|
||||
|
||||
return (
|
||||
<li className="w-full h-12 rounded-md shrink-0 flex flex-row items-center justify-between px-2 font-bold bg-light-main-color-1 dark:bg-main-color-1">
|
||||
<span className="cursor-help" title={relativeFolder}>{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>
|
||||
{!processing ? (
|
||||
!pending ? (
|
||||
<BsmButton className="aspect-square h-7 rounded-md p-1" icon={"trash"} withBar={false} onClick={e => {e.preventDefault(); onDelete?.()}}/>
|
||||
) : (
|
||||
<BsmButton className="aspect-square h-7 rounded-md p-1" icon={"cross"} withBar={false} onClick={e => {e.preventDefault(); cancelLink()}}/>
|
||||
)
|
||||
) : (
|
||||
<BsmBasicSpinner className="aspect-square h-7 rounded-md p-1 dark:bg-main-color-2" thikness="3.5px" style={{color}}/>
|
||||
)}
|
||||
|
||||
</div>
|
||||
</li>
|
||||
)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { BsmButton } from "renderer/components/shared/bsm-button.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { LinkOpenerService } from "renderer/services/link-opener.service";
|
||||
import { ModalComponent, ModalExitCode } from "renderer/services/modale.service"
|
||||
|
||||
export const WhyCredentialsModal: ModalComponent<void> = ({resolver}) => {
|
||||
|
||||
const t = useTranslation();
|
||||
const linkOpener = LinkOpenerService.getInstance();
|
||||
|
||||
const openTutorial = () => {
|
||||
linkOpener.open("https://steamcommunity.com/sharedfiles/filedetails/?id=1805934840");
|
||||
}
|
||||
|
||||
return (
|
||||
<form className="w-min">
|
||||
<h1 className="text-3xl mb-2 uppercase tracking-wide w-full text-center text-gray-800 dark:text-gray-200">{t("modals.steam-credentials.title")}</h1>
|
||||
|
||||
<p>{t("modals.steam-credentials.p-1")}</p>
|
||||
<a onClick={e => {e.preventDefault; openTutorial()}} className="underline text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-600 mb-2 block cursor-pointer">
|
||||
https://steamcommunity.com/sharedfiles/filedetails/?id=1805934840
|
||||
</a>
|
||||
<p>{t("modals.steam-credentials.p-2")}</p>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@@ -38,7 +38,7 @@ export function Modal() {
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
{ModalComponent && (
|
||||
{ModalComponent && resolver && (
|
||||
<div className="top-0 absolute w-screen h-screen flex content-center items-center justify-center z-[90]">
|
||||
<motion.span key="modal-overlay" onClick={() => modalSevice.resolve({exitCode: ModalExitCode.NO_CHOICE})} className="absolute top-0 bottom-0 right-0 left-0 bg-black" initial={{opacity: 0}} animate={{opacity: ModalComponent && .60}} exit={{opacity: 0}} transition={{duration: .2}}/>
|
||||
<motion.div key="modal" initial={{y: "100vh"}} animate={{y: 0}} exit={{y: "100vh"}}>
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
import equal from "fast-deep-equal";
|
||||
import { memo, useRef, useState } from "react";
|
||||
import { MSModel, MSModelType } from "shared/models/models/model-saber.model";
|
||||
import { BsmImage } from "../shared/bsm-image.component";
|
||||
import { motion } from "framer-motion";
|
||||
import { GlowEffect } from "../shared/glow-effect.component";
|
||||
import { MODELS_TYPE_MS_PAGE_ROOT, MODEL_SABER_URL } from "shared/models/models/constants";
|
||||
import { BsmLink } from "../shared/bsm-link.component";
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import Tippy from "@tippyjs/react";
|
||||
import { followCursor } from "tippy.js"
|
||||
import defaultImage from '../../../../assets/images/default-version-img.jpg'
|
||||
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
|
||||
import { BsmIcon, BsmIconType } from "../svgs/bsm-icon.component";
|
||||
import { BsmButton } from "../shared/bsm-button.component";
|
||||
import { BsmBasicSpinner } from "../shared/bsm-basic-spinner/bsm-basic-spinner.component";
|
||||
import { isValidUrl } from "shared/helpers/url.helpers";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import useDoubleClick from "use-double-click";
|
||||
|
||||
type Props<T> = {
|
||||
selected?: boolean,
|
||||
hash: string,
|
||||
id?: number,
|
||||
isDownloading?: boolean,
|
||||
callbackValue?: T
|
||||
onDelete?: (value: T) => void,
|
||||
onDownload?: (value: T) => void,
|
||||
onCancelDownload?: (value: T) => void
|
||||
onDoubleClick?: (value: T) => void
|
||||
} & Partial<MSModel> & Partial<BsmLocalModel> & Omit<React.ComponentProps<"li">, "id" | "onDoubleClick">
|
||||
|
||||
function modelItem<T = unknown>(props: Props<T>) {
|
||||
|
||||
const t = useTranslation();
|
||||
const color = useThemeColor("first-color");
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const [idContentCopied, setIdContentCopied] = useState<string>(null);
|
||||
const ref = useRef();
|
||||
|
||||
useDoubleClick({
|
||||
ref,
|
||||
latency: props.onDoubleClick ? 200 : 0,
|
||||
onSingleClick: (e) => props?.onClick?.(e as unknown as React.MouseEvent<HTMLLIElement>),
|
||||
onDoubleClick: () => props?.onDoubleClick?.(props.callbackValue)
|
||||
});
|
||||
|
||||
const modelPageUrl = (() => {
|
||||
if(!props.id){ return null; }
|
||||
const url = new URL(MODELS_TYPE_MS_PAGE_ROOT[props.type], MODEL_SABER_URL);
|
||||
url.searchParams.set("id", props.id.toString());
|
||||
return url.toString();
|
||||
})();
|
||||
|
||||
const authorPageUrl = (() => {
|
||||
if(!props.discord){ return null; }
|
||||
const url = new URL("Profile", MODEL_SABER_URL);
|
||||
url.searchParams.set("user", props.discord.toString());
|
||||
return url.toString();
|
||||
})();
|
||||
|
||||
const thumbnailUrl = (() => {
|
||||
if(!props.thumbnail){ return null; }
|
||||
if(isValidUrl(props.thumbnail)){ return props.thumbnail; }
|
||||
const [file, ext] = props.thumbnail.split(".");
|
||||
return props.download.split("/").slice(0, -1).join("/") + `/${file}.${ext.toLowerCase()}`;
|
||||
})();
|
||||
|
||||
const modelTags = (() => {
|
||||
if(!props.tags){ return null; }
|
||||
return [...new Set(props.tags)];
|
||||
})();
|
||||
|
||||
const actionButtons = (): {icon: BsmIconType, action: () => void, iconColor?: string}[] => {
|
||||
const buttons: {icon: BsmIconType, action: () => void, iconColor?: string}[] = [];
|
||||
|
||||
if(props.onDownload && !props.onCancelDownload){
|
||||
buttons.push({ icon: "download", action: () => props.onDownload(props.callbackValue) });
|
||||
}
|
||||
|
||||
if(props.onDelete){
|
||||
buttons.push({ icon: "trash", action: () => props.onDelete(props.callbackValue) });
|
||||
}
|
||||
|
||||
if(props.onCancelDownload){
|
||||
buttons.push({ icon: "cross", action: () => props.onCancelDownload(props.callbackValue), iconColor: "red" });
|
||||
}
|
||||
|
||||
return buttons;
|
||||
}
|
||||
|
||||
const copyContent = (value: string, id?: string) => {
|
||||
navigator.clipboard.writeText(value);
|
||||
setIdContentCopied(() => id);
|
||||
setTimeout(() => {
|
||||
setIdContentCopied(() => null);
|
||||
}, 700);
|
||||
}
|
||||
|
||||
return (
|
||||
<motion.li className={`relative flex-grow min-w-[16rem] h-64 cursor-pointer ${props.className ?? ""}`} onHoverStart={() => setHovered(() => true)} onHoverEnd={() => setHovered(() => false)}>
|
||||
<GlowEffect visible={props.selected || hovered}/>
|
||||
<div className="absolute top-0 left-0 w-full h-full rounded-lg overflow-hidden blur-none bg-black shadow-sm shadow-black">
|
||||
<div ref={ref} className="contents">
|
||||
<BsmImage className={`absolute top-0 left-0 w-full h-full object-cover brightness-50 scale-[200%] blur-md`} image={thumbnailUrl} placeholder={defaultImage} loading="lazy"/>
|
||||
<BsmImage className={`absolute top-0 left-1/2 -translate-x-1/2 max-w-[20rem] w-full h-full object-cover`} image={thumbnailUrl} placeholder={defaultImage} loading="lazy"/>
|
||||
<div className="absolute top-0 right-0 h-full w-0 flex flex-col items-end gap-1 pt-1.5 pr-1.5">
|
||||
{!props.isDownloading ? (
|
||||
actionButtons().map((button, index) => (
|
||||
<BsmButton key={index} className="w-8 h-8 p-1 rounded-md transition-transform duration-150 shadow-black shadow-sm" style={{transitionDelay: `${index * 50}ms`, transform: hovered ? "translate(0%)" : "translate(150%)"}} icon={button.icon} iconColor={button.iconColor} onClick={e => {e.stopPropagation(); e.preventDefault(); button.action();}} withBar={false}/>
|
||||
))
|
||||
): (
|
||||
<BsmBasicSpinner className="w-7 h-7 p-1 rounded-md bg-main-color-2 flex items-center justify-center shadow-black shadow-sm" spinnerClassName="brightness-200" thikness="3.5px" style={{color}}/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<motion.div className="absolute top-[83%] left-0 w-full h-full px-2 flex flex-col gap-1.5 bg-main-color-3 bg-opacity-60 backdrop-blur-md transition-all delay-150 hover:top-0 group" onClick={e =>{e.stopPropagation(); e.preventDefault()}}>
|
||||
<div className="w-full flex justify-center items-center mt-1.5">
|
||||
<BsmLink className={`block grow overflow-hidden font-bold whitespace-nowrap text-ellipsis ${props.id ? "cursor-pointer hover:underline" : ""}`} href={modelPageUrl}>{props.name}</BsmLink>
|
||||
<BsmIcon className="shrink-0 h-8 group-hover:rotate-180 transition-transform w-fit" icon="chevron-top"/>
|
||||
</div>
|
||||
<BsmLink className={`block w-fit max-w-full overflow-hidden whitespace-nowrap text-ellipsis brightness-200 ${authorPageUrl ? "cursor-pointer hover:underline" : ""}`} style={{color}} href={authorPageUrl}>{props.author ?? ''}</BsmLink>
|
||||
<ul className="flex flex-row flex-wrap gap-1">
|
||||
{modelTags?.map(tag => (
|
||||
<li key={tag} className="inline-block mr-1 text-xs bg-white text-black px-1 rounded-full p-0.5">{tag}</li>
|
||||
))}
|
||||
</ul>
|
||||
<Tippy placement="top" content={idContentCopied === "hash" ? t("misc.copied") : t("misc.copy")} followCursor="horizontal" plugins={[followCursor]} hideOnClick={false}>
|
||||
<span className="mt-0.5 cursor-copy block w-full max-w-fit overflow-hidden whitespace-nowrap text-ellipsis bg-main-color-1 rounded-md p-1 uppercase text-xs" onClick={() => copyContent(`${props.hash}`, 'hash')}>{props.hash}</span>
|
||||
</Tippy>
|
||||
<div className="flex gap-1">
|
||||
{props.id && (
|
||||
<Tippy placement="top" content={idContentCopied === "id" ? t("misc.copied") : t("misc.copy")} followCursor="horizontal" plugins={[followCursor]} hideOnClick={false}>
|
||||
<span className="cursor-copy w-fit shrink-0 max-w-full overflow-hidden whitespace-nowrap text-ellipsis bg-main-color-1 rounded-md p-1 uppercase text-xs" onClick={() => copyContent(`${props.id}`, 'id')}>{props.id}</span>
|
||||
</Tippy>
|
||||
)}
|
||||
{props.path && (
|
||||
<Tippy placement="top" content={idContentCopied === "path" ? t("misc.copied") : t("misc.copy")} followCursor="horizontal" plugins={[followCursor]} hideOnClick={false}>
|
||||
<span className="cursor-copy w-fit max-w-full overflow-hidden whitespace-nowrap text-ellipsis bg-main-color-1 rounded-md p-1 text-xs" onClick={() => copyContent(`${props.path}`, 'path')}>{props.path}</span>
|
||||
</Tippy>
|
||||
)}
|
||||
</div>
|
||||
</motion.div>
|
||||
</div>
|
||||
</motion.li>
|
||||
)
|
||||
};
|
||||
|
||||
const typedMemo: <T, P>(c: T, propsAreEqual?: (prevProps: Readonly<P>, nextProps: Readonly<P>) => boolean) => T = memo;
|
||||
|
||||
export const ModelItem = typedMemo(modelItem, equal);
|
||||
@@ -0,0 +1,208 @@
|
||||
import { useInView } from "framer-motion";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { useRef, forwardRef, useImperativeHandle, useState } from "react";
|
||||
import { MSModelType } from "shared/models/models/model-saber.model";
|
||||
import { useOnUpdate } from "renderer/hooks/use-on-update.hook";
|
||||
import { useConstant } from "renderer/hooks/use-constant.hook";
|
||||
import { ModelsManagerService } from "renderer/services/models-management/models-manager.service";
|
||||
import { useSwitchableObservable } from "renderer/hooks/use-switchable-observable.hook";
|
||||
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
|
||||
import { ModelItem } from "./model-item.component";
|
||||
import { useBehaviorSubject } from "renderer/hooks/use-behavior-subject.hook";
|
||||
import { BsmImage } from "../shared/bsm-image.component";
|
||||
import BeatWaitingImg from "../../../../assets/images/apngs/beat-waiting.png"
|
||||
import BeatConflict from "../../../../assets/images/apngs/beat-conflict.png"
|
||||
import TextProgressBar from "../progress-bar/text-progress-bar.component";
|
||||
import { BehaviorSubject, distinctUntilChanged, map, startWith } from "rxjs";
|
||||
import { BsmButton } from "../shared/bsm-button.component";
|
||||
import equal from "fast-deep-equal";
|
||||
import { VersionLinkerAction } from "renderer/services/version-folder-linker.service";
|
||||
import { MODEL_TYPE_FOLDERS } from "shared/models/models/constants";
|
||||
import { useService } from "renderer/hooks/use-service.hook";
|
||||
import { ModelsDownloaderService } from "renderer/services/models-management/models-downloader.service";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
|
||||
type Props = {
|
||||
className?: string,
|
||||
version?: BSVersion,
|
||||
type: MSModelType
|
||||
search?: string,
|
||||
active: boolean,
|
||||
downloadModels?: () => void
|
||||
}
|
||||
|
||||
export const ModelsGrid = forwardRef(({className, version, type, search, active, downloadModels}: Props, forwardRef) => {
|
||||
|
||||
const modelsManager = useService(ModelsManagerService);
|
||||
const modelsDownloader = useService(ModelsDownloaderService);
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const ref = useRef();
|
||||
|
||||
const [models, setModelsLoadObservable,, setModels] = useSwitchableObservable<BsmLocalModel[]>();
|
||||
const progress$ = useConstant(() => new BehaviorSubject(0));
|
||||
const [modelsSelected, modelsSelected$] = useBehaviorSubject<BsmLocalModel[]>([]);
|
||||
|
||||
const isLoading = !models;
|
||||
const hasModels = !!models?.length;
|
||||
|
||||
useImperativeHandle(forwardRef, () => ({
|
||||
getModels: () => {
|
||||
return models ?? [];
|
||||
},
|
||||
getSelectedModels: () => {
|
||||
return modelsSelected;
|
||||
},
|
||||
reloadModels: () => {
|
||||
loadModels();
|
||||
},
|
||||
deleteSelectedModels: () => {
|
||||
modelsManager.deleteModels(!modelsSelected?.length ? models : modelsSelected, version).then(deletedModels => {
|
||||
if(!deletedModels?.length){ return; }
|
||||
const newModels = models.filter(m => !deletedModels.some(d => d.hash === m.hash));
|
||||
setModels(() => newModels);
|
||||
modelsSelected$.next([]);
|
||||
});
|
||||
}
|
||||
}), [modelsSelected, models]);
|
||||
|
||||
useOnUpdate(() => {
|
||||
if(!active){ return; }
|
||||
if(models && models.length){ return; }
|
||||
loadModels();
|
||||
}, [active]);
|
||||
|
||||
useOnUpdate(() => {
|
||||
if(!active){
|
||||
setModels(() => null);
|
||||
}
|
||||
else {
|
||||
loadModels();
|
||||
}
|
||||
}, [version, type]);
|
||||
|
||||
useOnUpdate(() => {
|
||||
|
||||
if(!active && !models){ return; }
|
||||
|
||||
const onLinkStateChangeCb = (action: VersionLinkerAction) => {
|
||||
if(!equal(version, action.version) || !action.relativeFolder.includes(MODEL_TYPE_FOLDERS[type])){ return; }
|
||||
loadModels();
|
||||
}
|
||||
|
||||
const sub = modelsDownloader.onModelsDownloaded(localModel => {
|
||||
if(localModel.type !== type || !equal(localModel.version, version)){ return; }
|
||||
setModels(models => [localModel, ...models ?? []]);
|
||||
});
|
||||
|
||||
modelsManager.onModelsFolderLinked(onLinkStateChangeCb);
|
||||
modelsManager.onModelsFolderUnlinked(onLinkStateChangeCb);
|
||||
|
||||
return () => {
|
||||
modelsManager.removeModelsFolderLinkedListener(onLinkStateChangeCb);
|
||||
modelsManager.removeModelsFolderUnlinkedListener(onLinkStateChangeCb);
|
||||
sub.unsubscribe();
|
||||
}
|
||||
|
||||
}, [version, type, active]);
|
||||
|
||||
const loadModels = () => {
|
||||
const modelsObs$ = modelsManager.$getModels(type, version);
|
||||
setModels(() => null);
|
||||
setModelsLoadObservable(() => modelsObs$.pipe(map(models => models?.data), distinctUntilChanged()));
|
||||
modelsObs$.pipe(map(models => Math.floor((models.current / models.total) * 100)), startWith(0), distinctUntilChanged()).subscribe({next: v => progress$.next(v)});
|
||||
}
|
||||
|
||||
const handleModelClick = (model: BsmLocalModel) => {
|
||||
const prunedArray = Array.from(new Set(modelsSelected));
|
||||
if(prunedArray.some(m => m.hash === model.hash)){
|
||||
prunedArray.splice(prunedArray.findIndex(m => m.hash === model.hash), 1);
|
||||
}
|
||||
else {
|
||||
prunedArray.push(model);
|
||||
}
|
||||
modelsSelected$.next(prunedArray);
|
||||
}
|
||||
|
||||
const filtredModels = () => {
|
||||
if(!active){ return models; }
|
||||
|
||||
const lowerSearch = search?.toLowerCase();
|
||||
|
||||
return models?.filter(model => {
|
||||
const findedInRawValues = Object.values(model).some(value => {
|
||||
if(typeof value !== "string" && typeof value !== "number"){ return false; }
|
||||
return value.toString().toLowerCase().includes(lowerSearch);
|
||||
});
|
||||
|
||||
if(findedInRawValues) { return true; }
|
||||
|
||||
if(!model.model){ return false; }
|
||||
|
||||
return Object.values(model.model).some(value => {
|
||||
if(typeof value !== "string" && typeof value !== "number" && !Array.isArray(value)){ return false; }
|
||||
|
||||
if(Array.isArray(value)){
|
||||
return value.some(v => v.toString().toLowerCase().includes(lowerSearch));
|
||||
}
|
||||
|
||||
return value.toString().toLowerCase().includes(lowerSearch);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
const handleDelete = (model: BsmLocalModel) => {
|
||||
modelsManager.deleteModels([model], version).then(deleted => {
|
||||
if(!deleted?.length){ return; }
|
||||
setModels(prev => prev.filter(m => m.hash !== model.hash));
|
||||
modelsSelected$.next(modelsSelected.filter(m => m.hash !== model.hash));
|
||||
});
|
||||
}
|
||||
|
||||
const renderContent = () => {
|
||||
if(isLoading){
|
||||
return (
|
||||
<div className="h-full flex flex-col items-center justify-center flex-wrap gap-1 text-gray-800 dark:text-gray-200">
|
||||
<BsmImage className="w-32 h-32 spin-loading" image={BeatWaitingImg}/>
|
||||
<span className="font-bold">{t("models.panel.grid.loading")}</span>
|
||||
<TextProgressBar value$={progress$}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if(!hasModels){
|
||||
return (
|
||||
<div className="h-full flex flex-col items-center justify-center flex-wrap gap-1 text-gray-800 dark:text-gray-200">
|
||||
<BsmImage className="h-32" image={BeatConflict}/>
|
||||
<span className="font-bold">{t("models.panel.grid.no-models")}</span>
|
||||
<BsmButton className="font-bold rounded-md p-2" text="models.panel.grid.download-models" typeColor="primary" withBar={false} onClick={e => {e.preventDefault(); downloadModels?.()}}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<ul className="flex flex-wrap shrink-0 justify-start content-start w-full h-full overflow-y-scroll overflow-x-hidden p-4 gap-4 scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900">
|
||||
{filtredModels().map(localModel => (
|
||||
<ModelItem
|
||||
{...localModel?.model}
|
||||
key={localModel.path}
|
||||
hash={localModel.model?.hash ?? localModel.hash}
|
||||
path={localModel.path}
|
||||
type={localModel.type}
|
||||
name={localModel.model?.name ?? localModel.fileName}
|
||||
selected={modelsSelected.some(m => m.hash === localModel.hash)}
|
||||
onClick={() => handleModelClick(localModel)}
|
||||
onDelete={() => handleDelete(localModel)}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div ref={ref} className={`w-full h-full flex-shrink-0 ${className ?? ""}`}>
|
||||
{renderContent()}
|
||||
</div>
|
||||
)
|
||||
});
|
||||
@@ -0,0 +1,99 @@
|
||||
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";
|
||||
import { ModelsManagerService } from "renderer/services/models-management/models-manager.service";
|
||||
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
|
||||
import { BsmButton } from "../shared/bsm-button.component";
|
||||
import { useService } from "renderer/hooks/use-service.hook";
|
||||
import { ModelsDownloaderService } from "renderer/services/models-management/models-downloader.service";
|
||||
import { useOnUpdate } from "renderer/hooks/use-on-update.hook";
|
||||
import { NotificationService } from "renderer/services/notification.service";
|
||||
import { ConfigurationService } from "renderer/services/configuration.service";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { gte, lt } from "semver";
|
||||
|
||||
export function ModelsPanel({version, isActive, goToMods}: {version?: BSVersion, isActive: boolean, goToMods?: () => void}) {
|
||||
|
||||
const modelsManager = useService(ModelsManagerService);
|
||||
const modelDownloader = useService(ModelsDownloaderService);
|
||||
const notification = useService(NotificationService);
|
||||
const config = useService(ConfigurationService);
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const ref = useRef();
|
||||
|
||||
const modelsGridRefs = [useRef(null), useRef(null), useRef(null), useRef(null)];
|
||||
|
||||
const [modelTypeTab, setModelTypeTab] = useState<MSModelType>(MSModelType.Avatar);
|
||||
const [currentTabIndex, setCurrentTabIndex] = useState<number>(0);
|
||||
|
||||
const [search, setSearch] = useState<string>("");
|
||||
|
||||
useOnUpdate(() => {
|
||||
if(!isActive || !goToMods){ return; }
|
||||
if(config.get("not-remind-mods-models")){ return; }
|
||||
notification.notifyWarning({ title: "models.notifications.prevent-for-mods.title", desc: "models.notifications.prevent-for-mods.desc", actions: [
|
||||
{id: "0", title: "models.notifications.prevent-for-mods.go-to-mods"},
|
||||
{id: "1", title: "models.notifications.prevent-for-mods.not-remind", cancel: true}
|
||||
], duration: 12_000 }).then(res => {
|
||||
if(res === "0"){ return goToMods(); }
|
||||
if(res === "1"){ config.set("not-remind-mods-models", true); }
|
||||
});
|
||||
}, [isActive]);
|
||||
|
||||
useOnUpdate(() => {
|
||||
if(!isActive || !version || lt(version.BSVersion, "1.29.4")){ return; }
|
||||
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 => {
|
||||
if(res === "0"){ config.set("not-remind-models-breaks", true); }
|
||||
});
|
||||
}, [isActive, version])
|
||||
|
||||
const exportModels = () => {
|
||||
const selectedModels = modelsGridRefs.map(ref =>(ref.current?.getSelectedModels() as BsmLocalModel[])).flat()
|
||||
modelsManager.exportModels(selectedModels, version);
|
||||
}
|
||||
|
||||
const deleteModels = () => {
|
||||
const activeTab = modelsGridRefs[currentTabIndex];
|
||||
activeTab.current?.deleteSelectedModels();
|
||||
}
|
||||
|
||||
const openDownloadModal = () => {
|
||||
const allLoadedModels = modelsGridRefs.map(ref =>(ref.current?.getModels() as BsmLocalModel[])).flat();
|
||||
modelDownloader.openDownloadModelsModal(version, modelTypeTab, allLoadedModels);
|
||||
}
|
||||
|
||||
const threeDotsItems: DropDownItem[] = [
|
||||
{text: "models.panel.actions.drop-down.export", onClick: exportModels, icon: "export"},
|
||||
{text: "models.panel.actions.drop-down.delete", onClick: deleteModels, icon: "trash"},
|
||||
];
|
||||
|
||||
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">
|
||||
<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} onClick={e => {e.preventDefault(); openDownloadModal()}}/>
|
||||
<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("models.panel.actions.search")} onChange={e => setSearch(e.target.value)} tabIndex={-1}/>
|
||||
</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}%`}}>
|
||||
<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>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
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 { DetailedHTMLProps, 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>
|
||||
)
|
||||
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import { motion, Variants } from "framer-motion";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { AudioPlayerService } from "renderer/services/audio-player.service";
|
||||
|
||||
// Thanks to cheddZy for the icon : https://github.com/cheddZy
|
||||
|
||||
export const BsManagerIcon = memo(({className}: {className?: string}) => {
|
||||
|
||||
const audioPlayer = AudioPlayerService.getInstance();
|
||||
@@ -34,7 +36,7 @@ export const BsManagerIcon = memo(({className}: {className?: string}) => {
|
||||
<path d="M626.75,485.91l20.82,351.94a35.21,35.21,0,0,1-15.49,31.36L487.37,965.35l-.06,0A35.56,35.56,0,0,1,476,970.12a34.85,34.85,0,0,1-23.51-2.87L136.58,809.9a115.45,115.45,0,0,1-63.75-96.49L52,361.46a35.26,35.26,0,0,1,15.23-31.21l145.05-96.36a35.72,35.72,0,0,1,11.27-4.7,34.87,34.87,0,0,1,23.51,2.87L563,389.42a115.41,115.41,0,0,1,63.75,96.49Z"/>
|
||||
<path filter="brightness(30%)" d="M613.78,486.67l20.82,352a22.34,22.34,0,0,1-32.26,21.31L286.4,702.57A102.43,102.43,0,0,1,229.83,617L209,265a22.35,22.35,0,0,1,32.26-21.32L557.2,401.05A102.42,102.42,0,0,1,613.78,486.67Z"/>
|
||||
</g>
|
||||
<g fill="#fff">
|
||||
<g className="text-white stroke-black stroke-[2px] dark:stroke-0" fill="currentColor">
|
||||
<path d="M718.29,776.48,700,804.18c-40.63,39.5-87.06,67.25-133.81,90.75-87.32,43.9-203.67,77.19-249,90.34a48,48,0,0,1-26.17.16c-64-17.72-188.62-72-236.28-125.49a4.23,4.23,0,0,1,5.3-6.45c35.64,20.87,111.22,57.64,156.37,74.22,49.18,18.06,81.29,8.74,92.28-3.26a4.77,4.77,0,0,1,7.24.21c19.51,24,107.26,4.6,166.64-13C546.91,892.66,668.42,835.1,718.29,776.48Z"/>
|
||||
<path d="M522.09,933.81,374.64,989.49a3.92,3.92,0,0,0,1.44,7.58l54.62-.77a35.63,35.63,0,0,0,19-5.79l76-49.55A4,4,0,0,0,522.09,933.81Z"/>
|
||||
<path d="M218.92,195.56c-21.14.07-33.55,35.86-33.16,89.08.2,28,2.58,92.74,4.79,147.73.23,5.71-8.18,6.48-9,.81L143.13,162.47a4.38,4.38,0,0,1,7.12-4,63.63,63.63,0,0,0,21.93,11.85,4.61,4.61,0,0,0,5.9-3.72c4.2-27.7,16.63-58.74,37.35-88.74a4.36,4.36,0,0,1,7.56.69c10.86,23.87,49,103.8,93.34,152.79a4.65,4.65,0,0,1-5.62,7.22C274.14,219.18,227.7,195.54,218.92,195.56Z"/>
|
||||
|
||||
@@ -41,11 +41,12 @@ export function BsVersionItem(props: {version: BSVersion}) {
|
||||
)
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
const versionDownload = downloaderService.currentBsVersionDownload$.value;
|
||||
downloaderService.cancelDownload().then(async res => {
|
||||
if(!res.success){ return; }
|
||||
if(!downloaderService.isVerification){
|
||||
const cancel = () => {
|
||||
const versionDownload = downloaderService.currentBsVersionDownload$.value;
|
||||
const wasVerification = downloaderService.isVerification;
|
||||
downloaderService.cancelDownload().then(async res => {
|
||||
if(!res.success){ return; }
|
||||
if(!wasVerification){
|
||||
bsUninstallerService.uninstall(versionDownload).then(res => res && verionManagerService.askInstalledVersions());
|
||||
}
|
||||
});
|
||||
@@ -81,11 +82,9 @@ export function BsVersionItem(props: {version: BSVersion}) {
|
||||
const renderVersionText = () => {
|
||||
if(props.version.name){
|
||||
return (
|
||||
<Tippy content={props.version.BSVersion} placement="right-end" arrow={false} className="font-bold !bg-main-color-3" duration={[200, 0]}>
|
||||
<div className="h-8 flex items-center dark:text-gray-200 text-gray-800 overflow-hidden">
|
||||
<div ref={ref} className='whitespace-nowrap font-bold tracking-wide w-full text-center' style={{fontSize}}>{props.version.name}</div>
|
||||
</div>
|
||||
</Tippy>
|
||||
<div className="h-8 flex items-center dark:text-gray-200 text-gray-800 overflow-hidden">
|
||||
<div ref={ref} className='whitespace-nowrap font-bold tracking-wide w-full text-center' style={{fontSize}}>{props.version.name}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return (
|
||||
@@ -98,10 +97,20 @@ export function BsVersionItem(props: {version: BSVersion}) {
|
||||
|
||||
return (
|
||||
<NavBarItem onCancel={cancel} progress={downloading ? downloadPercent : 0} isActive={isActive() && !downloading} isDownloading={downloading}>
|
||||
<Link onDoubleClick={handleDoubleClick} to={`/bs-version/${props.version.BSVersion}`} state={props.version} className="w-full flex items-center justify-start content-center max-w-full">
|
||||
{renderIcon()}
|
||||
{renderVersionText()}
|
||||
</Link>
|
||||
{props.version.name ? (
|
||||
<Tippy content={props.version.BSVersion} placement="right-end" arrow={false} className="font-bold !bg-neutral-900" duration={[100, 0]} animation="shift-away-subtle">
|
||||
<Link onDoubleClick={handleDoubleClick} to={`/bs-version/${props.version.BSVersion}`} state={props.version} className="w-full flex items-center justify-start content-center max-w-full">
|
||||
{renderIcon()}
|
||||
{renderVersionText()}
|
||||
</Link>
|
||||
</Tippy>
|
||||
) : (
|
||||
<Link onDoubleClick={handleDoubleClick} to={`/bs-version/${props.version.BSVersion}`} state={props.version} className="w-full flex items-center justify-start content-center max-w-full">
|
||||
{renderIcon()}
|
||||
{renderVersionText()}
|
||||
</Link>
|
||||
)}
|
||||
|
||||
</NavBarItem>
|
||||
)
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import { Link } from "react-router-dom";
|
||||
import { BsmIcon } from "renderer/components/svgs/bsm-icon.component";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import { PageStateService } from "renderer/services/page-state.service";
|
||||
import { NavBarItem } from "./nav-bar-item.component";
|
||||
|
||||
export function MapsNavBarItem() {
|
||||
|
||||
const pageState = PageStateService.getInstance();
|
||||
|
||||
const route = useObservable(pageState.route$);
|
||||
|
||||
const color = useThemeColor("first-color");
|
||||
|
||||
return (
|
||||
<NavBarItem isActive={route === "/maps"}>
|
||||
<Link to="maps" className="w-full flex items-center justify-start content-center max-w-full h-[30px]">
|
||||
<BsmIcon className="w-[19px] h-[19px] mr-[5px] shrink-0 brightness-125" icon="bsMapDifficulty" style={{color}}/>
|
||||
<span className="dark:text-gray-200 text-gray-800 font-bold tracking-wide">Maps</span>
|
||||
</Link>
|
||||
</NavBarItem>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Link } from "react-router-dom";
|
||||
import { BsmIcon } from "renderer/components/svgs/bsm-icon.component";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import { PageStateService } from "renderer/services/page-state.service";
|
||||
import { NavBarItem } from "./nav-bar-item.component";
|
||||
import { useService } from "renderer/hooks/use-service.hook";
|
||||
import Tippy from "@tippyjs/react";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
|
||||
export function SharedNavBarItem() {
|
||||
|
||||
const pageState = useService(PageStateService);
|
||||
|
||||
const t = useTranslation();
|
||||
const route = useObservable(pageState.route$);
|
||||
const color = useThemeColor("first-color");
|
||||
|
||||
return (
|
||||
<NavBarItem isActive={route === "/shared"}>
|
||||
<Tippy content={t("nav-bar.shared.tooltip")} className="font-bold !bg-neutral-900" placement="right-end" arrow={false} duration={[100, 0]} animation="shift-away-subtle">
|
||||
<Link to="shared" className="w-full flex items-center justify-start content-center max-w-full h-[30px]">
|
||||
<BsmIcon className="w-[19px] h-[19px] mr-[5px] shrink-0 brightness-125" icon="link" style={{color}}/>
|
||||
<span className="dark:text-gray-200 text-gray-800 font-bold tracking-wide">{t("nav-bar.shared.text")}</span>
|
||||
</Link>
|
||||
</Tippy>
|
||||
</NavBarItem>
|
||||
)
|
||||
}
|
||||
@@ -5,31 +5,43 @@ import { Link } from 'react-router-dom';
|
||||
import { BsmIcon } from '../svgs/bsm-icon.component';
|
||||
import { useObservable } from 'renderer/hooks/use-observable.hook';
|
||||
import { BsManagerIcon } from './bsmanager-icon.component';
|
||||
import { MapsNavBarItem } from './nav-bar-items/maps-nav-bar-item.component';
|
||||
import { SharedNavBarItem } from './nav-bar-items/shared-nav-bar-item.component';
|
||||
import { NavBarSpliter } from './nav-bar-spliter.component';
|
||||
import { useThemeColor } from 'renderer/hooks/use-theme-color.hook';
|
||||
import Tippy from '@tippyjs/react';
|
||||
import { useTranslation } from 'renderer/hooks/use-translation.hook';
|
||||
import { I18nService } from 'renderer/services/i18n.service';
|
||||
|
||||
export function NavBar() {
|
||||
|
||||
const bsVersionServoce = BSVersionManagerService.getInstance();
|
||||
const bsVersionServoce = BSVersionManagerService.getInstance();
|
||||
|
||||
const installedVersions = useObservable(bsVersionServoce.installedVersions$);
|
||||
const installedVersions = useObservable(bsVersionServoce.installedVersions$);
|
||||
const color = useThemeColor("first-color");
|
||||
const t = useTranslation();
|
||||
|
||||
useObservable(I18nService.getInstance().currentLanguage$)
|
||||
|
||||
return (
|
||||
<nav id='nav-bar' className='z-10 flex flex-col h-full max-h-full items-center p-1 bg-light-main-color-1 dark:bg-main-color-1'>
|
||||
<nav id='nav-bar' className='z-10 flex flex-col h-full max-h-full items-center p-1'>
|
||||
<BsManagerIcon className='relative aspect-square w-16 h-16 mb-3'/>
|
||||
<ol id='versions' className='w-fit max-w-[120px] relative left-[2px] grow overflow-y-hidden scrollbar-track-transparent scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-neutral-900 hover:overflow-y-scroll'>
|
||||
<MapsNavBarItem/>
|
||||
<NavBarSpliter/>
|
||||
<SharedNavBarItem/>
|
||||
<NavBarSpliter/>
|
||||
{installedVersions && installedVersions.map((version) => <BsVersionItem key={JSON.stringify(version)} version={version}/>)}
|
||||
</ol>
|
||||
<NavBarSpliter/>
|
||||
<div className='w-full pb-2 flex flex-col items-center content-center justify-start gap-2'>
|
||||
<Link to="blah">
|
||||
<BsmIcon icon='add' className='text-blue-500 h-[34px]'/>
|
||||
</Link>
|
||||
<Link to="settings">
|
||||
<BsmIcon icon='settings' className='text-blue-500 h-7'/>
|
||||
</Link>
|
||||
<div className='w-full pb-2 flex flex-col items-center content-center justify-start gap-1'>
|
||||
<Tippy placement="right" content={t("nav-bar.add-version")} className='!bg-neutral-900' arrow={false}>
|
||||
<Link className='rounded-md w-9 h-9 flex justify-center items-center hover:bg-light-main-color-3 dark:hover:bg-main-color-3' to="blah">
|
||||
<BsmIcon icon='add' className='text-blue-500 h-[34px]' style={{color}}/>
|
||||
</Link>
|
||||
</Tippy>
|
||||
<Tippy placement="right" content={t("nav-bar.settings")} className='!bg-neutral-900' arrow={false}>
|
||||
<Link className='rounded-md w-9 h-9 flex justify-center items-center hover:bg-light-main-color-3 dark:hover:bg-main-color-3' to="settings">
|
||||
<BsmIcon icon='settings' className='text-blue-500 h-7' style={{color}}/>
|
||||
</Link>
|
||||
</Tippy>
|
||||
</div>
|
||||
</nav>
|
||||
)
|
||||
|
||||
@@ -7,14 +7,16 @@ import BeatWaitingImg from "../../../../assets/images/apngs/beat-waiting.png";
|
||||
import BeatImpatientImg from "../../../../assets/images/apngs/beat-impatient.png";
|
||||
import { BsmButton } from "../shared/bsm-button.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { ForwardedRef, forwardRef } from "react";
|
||||
|
||||
export function NotificationItem({resolver, notification}: {resolver?: (value: NotificationResult|string) => void, notification: Notification}) {
|
||||
export const NotificationItem = forwardRef(({resolver, notification}: {resolver?: (value: NotificationResult|string) => void, notification: Notification}, fwdRef: ForwardedRef<HTMLLIElement>) => {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const renderImage = (() => {
|
||||
if(notification.type === NotificationType.SUCCESS){ return BeatRunningImg; }
|
||||
if(notification.type === NotificationType.WARNING){ return BeatWaitingImg; }
|
||||
if(notification.type === NotificationType.INFO){ return BeatWaitingImg; }
|
||||
if(notification.type === NotificationType.ERROR){ return BeatConflictImg; }
|
||||
return BeatImpatientImg;
|
||||
})();
|
||||
@@ -22,6 +24,7 @@ export function NotificationItem({resolver, notification}: {resolver?: (value: N
|
||||
const renderNeonColors = (() => {
|
||||
if(notification.type === NotificationType.SUCCESS){ return "bg-green-400 shadow-green-400"; }
|
||||
if(notification.type === NotificationType.WARNING){ return "bg-yellow-400 shadow-yellow-400"; }
|
||||
if(notification.type === NotificationType.INFO){ return "bg-blue-500 shadow-blue-500"; }
|
||||
if(notification.type === NotificationType.ERROR){ return "bg-red-500 shadow-red-500"; }
|
||||
return "bg-gray-800 shadow-gray-800 dark:bg-white dark:shadow-white";
|
||||
})();
|
||||
@@ -37,7 +40,7 @@ export function NotificationItem({resolver, notification}: {resolver?: (value: N
|
||||
}
|
||||
|
||||
return (
|
||||
<motion.li layout drag="x" dragConstraints={{left: 0, right: 0}} dragElastic={{left: 0, right: .3}} onDragEnd={handleDragEnd} initial={{x: 0}} animate={{x: "-105%"}} exit={{x: 0}} className="relative w-[290px] rounded-md overflow-hidden mb-4 cursor-grab active:cursor-grabbing shadow-md shadow-black bg-gradient-to-br from-light-main-color-2 to-light-main-color-2 dark:from-main-color-2 dark:to-main-color-2 text-gray-800 dark:text-white">
|
||||
<motion.li ref={fwdRef} drag="x" dragConstraints={{left: 0, right: 0}} dragElastic={{left: 0, right: .3}} onDragEnd={handleDragEnd} animate={{x: "-125%"}} exit={{x: 50}} className="relative w-[290px] left-14 rounded-md overflow-hidden mb-4 cursor-grab active:cursor-grabbing shadow-md shadow-black bg-gradient-to-br from-light-main-color-2 to-light-main-color-2 dark:from-main-color-2 dark:to-main-color-2 text-gray-800 dark:text-white">
|
||||
<div className="w-full flex flex-col">
|
||||
<div className="flex items-center justify-start pl-1">
|
||||
<BsmImage className="h-14 mr-1 pointer-events-none" image={renderImage}/>
|
||||
@@ -56,4 +59,4 @@ export function NotificationItem({resolver, notification}: {resolver?: (value: N
|
||||
<BsmButton icon="cross" className="absolute top-2 right-2" withBar={false} onClick={() => resolver(NotificationResult.CLOSE)}/>
|
||||
</motion.li>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ export function NotificationOverlay() {
|
||||
|
||||
return (
|
||||
<ul className="absolute h-full w-0 top-0 right-0 z-[100] pt-10">
|
||||
<AnimatePresence>
|
||||
<AnimatePresence mode="popLayout">
|
||||
{notifications?.map(n => <NotificationItem key={n.id} resolver={n.resolver} notification={n.notification}/>)}
|
||||
</AnimatePresence>
|
||||
</ul>
|
||||
|
||||
@@ -24,7 +24,7 @@ export function BsmProgressBar() {
|
||||
|
||||
return (
|
||||
<AnimatePresence> { visible &&
|
||||
<motion.div initial={{y: "120%"}} animate={{y:"0%"}} exit={{y:"120%"}} className="w-full absolute h-14 flex justify-center items-center bottom-2 pointer-events-none" style={style}>
|
||||
<motion.div initial={{y: "120%"}} animate={{y:"0%"}} exit={{y:"120%"}} className="w-full absolute h-14 flex justify-center items-center bottom-2 pointer-events-none z-10" style={style}>
|
||||
<div className={`flex items-center content-center justify-center bottom-9 z-10 rounded-full bg-light-main-color-2 dark:bg-main-color-2 shadow-center shadow-black transition-all duration-300 ${!progressValue && "h-14 w-14 "} ${!!progressValue && "h-5 w-3/4 p-[6px]"}`}>
|
||||
{ !!progressValue && (
|
||||
<div className="relative h-full w-full rounded-full bg-black">
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { CSSProperties } from "react";
|
||||
import { useObservable } from "renderer/hooks/use-observable.hook";
|
||||
import { Observable } from "rxjs"
|
||||
|
||||
type Props = {
|
||||
value$: Observable<number|string>,
|
||||
className?: string,
|
||||
style?: CSSProperties
|
||||
}
|
||||
|
||||
export default function TextProgressBar({value$, className, style}: Props) {
|
||||
|
||||
const value = useObservable(value$);
|
||||
|
||||
const prefix = typeof value === "number" ? "%" : "";
|
||||
|
||||
return (
|
||||
<span className={className} style={style}>{`${value}${prefix}`}</span>
|
||||
)
|
||||
}
|
||||
@@ -14,7 +14,7 @@ export default function SettingColorChooser({color, onChange, pickerClassName}:
|
||||
<span className="z-[1] block h-full w-full border-2 border-white rounded-full" onClick={() => setColorVisible(!colorVisible)} style={{backgroundColor: color}}/>
|
||||
<AnimatePresence>
|
||||
{colorVisible &&
|
||||
<motion.div initial={{opacity: 0}} animate={{opacity: 1}} transition={{duration: .1}} exit={{opacity: 0}} className="fixed flex items-center justify-center translate-y-9 shadow-lg rounded-lg shadow-black">
|
||||
<motion.div initial={{opacity: 0}} animate={{opacity: 1}} transition={{duration: .1}} exit={{opacity: 0}} className="absolute flex items-center justify-center translate-y-9 shadow-lg rounded-lg shadow-black">
|
||||
<div className="absolute w-2/4 aspect-square rotate-45 bg-light-main-color-3 dark:bg-main-color-3 -translate-y-12"/>
|
||||
<HexColorPicker color={color} onChange={onChange} className={pickerClassName} />
|
||||
</motion.div>
|
||||
|
||||
@@ -15,19 +15,19 @@ export function SupporterItem({supporter, delay}: Props) {
|
||||
const additionnalStyles: CSSProperties = (() => {
|
||||
const commonStyles: CSSProperties = {backgroundImage: `url(${txtBg})`, backgroundRepeat: "no-repeat", backgroundPosition: "center"}
|
||||
if(supporter.type === "gold"){ return {color: "#ffe270", textShadow: "0px 0px 10px #ffdd59", backgroundSize: "70% 15px", ...commonStyles}; }
|
||||
if(supporter.type === "diamond"){ return {color: "#e574fc", textShadow: "0px 0px 15px #e056fd", backgroundSize: "70% 19px", ...commonStyles}; }
|
||||
if(supporter.type === "diamond"){ return {color: "#0ef2f8", textShadow: "0px 0px 15px #0ef2f8", backgroundSize: "70% 19px", ...commonStyles}; }
|
||||
if(supporter.type === "sponsor"){ return {color: "#0be881", textShadow: "0px 0px 15px #0be881", backgroundSize: "70% 19px", ...commonStyles}; }
|
||||
return {};
|
||||
})();
|
||||
|
||||
const renderSpan = () => {
|
||||
return <motion.span className="text-2xl font-bold px-3 pb-1" style={additionnalStyles} initial={{y: "100%", opacity: 0}} animate={{y: 0, opacity: 1}} transition={{delay: delay}}>{supporter.username}</motion.span>;
|
||||
return <motion.span className={`text-2xl font-bold px-3 pb-1 ${supporter.link && "cursor-pointer underline"}`} style={additionnalStyles} onClick={openSupporterLink} initial={{y: "100%", opacity: 0}} animate={{y: 0, opacity: 1}} transition={{delay: delay}}>{supporter.username}</motion.span>;
|
||||
}
|
||||
|
||||
const renderItem = () => {
|
||||
if(supporter.type !== "sponsor"){ return renderSpan(); }
|
||||
return (
|
||||
<motion.div className={`flex flex-col justify-center items-center mx-4 ${supporter.link && "cursor-pointer"}`} onClick={openSupporterLink} initial={{y: "100%", opacity: 0}} animate={{y: 0, opacity: 1}} transition={{delay: delay}}>
|
||||
<motion.div className={`flex flex-col justify-center items-center mx-4 ${supporter.link && "cursor-pointer underline"}`} onClick={openSupporterLink} initial={{y: "100%", opacity: 0}} animate={{y: 0, opacity: 1}} transition={{delay: delay}}>
|
||||
<img className="max-w-xs max-h-52 mb-2" src={supporter.img}/>
|
||||
{renderSpan()}
|
||||
</motion.div>
|
||||
|
||||
@@ -18,7 +18,7 @@ export function SupportersBlock({className, title, supporters}: Props) {
|
||||
<div className={`mb-10 flex flex-col items-center ${className}`}>
|
||||
<h2 className="uppercase text-3xl font-bold">{t(title)}</h2>
|
||||
<div className="flex justify-center flex-wrap py-5 px-20">
|
||||
{supporters.map(s => <SupporterItem supporter={s} delay={someDelay()}/>)}
|
||||
{supporters.map(s => <SupporterItem key={crypto.randomUUID()} supporter={s} delay={someDelay()}/>)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { DetailedHTMLProps, Fragment } from "react";
|
||||
import { BsmIconType } from "../svgs/bsm-icon.component";
|
||||
|
||||
type Props<T> = {
|
||||
className?: string;
|
||||
tabIndex: number;
|
||||
tabs: BsContentNavBarTab<T>[];
|
||||
renderTab: (props: DetailedHTMLProps<React.HTMLAttributes<any>, any>, tab?: BsContentNavBarTab<T>, activeTab?: BsContentNavBarTab<T>) => JSX.Element;
|
||||
onTabChange?: (index: number, tab?: BsContentNavBarTab<T>) => void;
|
||||
}
|
||||
|
||||
export type BsContentNavBarTab<T = unknown> = {
|
||||
text: string;
|
||||
icon?: BsmIconType;
|
||||
extra?: T
|
||||
}
|
||||
|
||||
export function BsContentNavBar<T>({className, tabIndex, tabs, renderTab, onTabChange}: Props<T>) {
|
||||
|
||||
const handleTabClick = (index: number) => {
|
||||
onTabChange?.(index, tabs[index]);
|
||||
}
|
||||
|
||||
return (
|
||||
<nav className={`h-full grid grid-flow-row ${className ?? ""}`}>
|
||||
{tabs.map((tab, i) => (
|
||||
<Fragment key={i}>
|
||||
{ renderTab({onClick: () => handleTabClick(i)}, tab, tabs[tabIndex]) }
|
||||
</Fragment>
|
||||
))}
|
||||
</nav>
|
||||
)
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import { BsmIcon, BsmIconType } from "../svgs/bsm-icon.component"
|
||||
import { useRef, CSSProperties } from "react";
|
||||
import { useRef, CSSProperties, MouseEvent } from "react";
|
||||
import { BsmImage } from "./bsm-image.component";
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook";
|
||||
import { useClickOutside } from "renderer/hooks/use-click-outside.hook";
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import { getCorrectTextColor } from "renderer/helpers/correct-text-color";
|
||||
|
||||
type BsmButtonType = "primary"|"success"|"cancel"|"error";
|
||||
type BsmButtonType = "primary"|"secondary"|"success"|"cancel"|"error";
|
||||
|
||||
type Props = {
|
||||
className?: string,
|
||||
@@ -36,7 +36,7 @@ export function BsmButton({className, style, imgClassName, iconClassName, icon,
|
||||
const ref = useRef(null);
|
||||
useClickOutside(ref, onClickOutside);
|
||||
|
||||
const primaryColor = typeColor === "primary" && useThemeColor("first-color");
|
||||
const primaryColor = typeColor === "primary" ? useThemeColor("first-color") : typeColor === "secondary" ? secondColor : undefined;
|
||||
|
||||
const textColor = (() => {
|
||||
if(primaryColor){ return getCorrectTextColor(primaryColor); }
|
||||
@@ -45,17 +45,19 @@ export function BsmButton({className, style, imgClassName, iconClassName, icon,
|
||||
|
||||
const renderTypeColor = (() => {
|
||||
if(typeColor === "primary"){ return ""; }
|
||||
if(!typeColor){ return `bg-light-main-color-2 dark:bg-main-color-2 ${!withBar && "hover:brightness-125"}`; }
|
||||
if(!typeColor){ return `bg-light-main-color-2 dark:bg-main-color-2 ${(!withBar && !disabled) && "hover:brightness-125"}`; }
|
||||
if(typeColor === "cancel"){ return "bg-gray-500"; }
|
||||
if(typeColor === "error"){ return "bg-red-500"; }
|
||||
if(typeColor === "success"){ return "bg-green-500"; }
|
||||
return "";
|
||||
})();
|
||||
|
||||
const handleClick = (e: MouseEvent) => !disabled && onClick?.(e);
|
||||
|
||||
return (
|
||||
<div ref={ref} onClick={onClick} title={t(title)} className={`${className} overflow-hidden cursor-pointer group ${(!withBar && !disabled && (!!typeColor || !!color)) && "hover:brightness-[1.15]"} ${disabled && "brightness-75 cursor-not-allowed"} ${renderTypeColor}`} style={{...style, backgroundColor: primaryColor || color}}>
|
||||
<div ref={ref} onClick={handleClick} title={t(title)} className={`${className} overflow-hidden cursor-pointer group ${(!withBar && !disabled && (!!typeColor || !!color)) && "hover:brightness-[1.15]"} ${disabled && "brightness-75 cursor-not-allowed"} ${renderTypeColor}`} style={{...style, backgroundColor: primaryColor || color}}>
|
||||
{ image && <BsmImage image={image} className={imgClassName}/> }
|
||||
{ icon && <BsmIcon icon={icon} className={iconClassName ?? "h-full w-full text-gray-800 dark:text-white"} style={{color: iconColor}}/> }
|
||||
{ icon && <BsmIcon icon={icon} className={iconClassName ?? "h-full w-full text-gray-800 dark:text-white"} style={{color: iconColor || textColor}}/> }
|
||||
{text && (type === "submit" ? <button type="submit" className={textClassName || "h-full w-full"} style={{...(!!textColor && {color: textColor})}}>{t(text)}</button> : <span className={textClassName} style={{...(!!textColor && {color: `${textColor}`})}}>{t(text)}</span>)}
|
||||
{ withBar && (
|
||||
<div className="absolute bottom-0 left-0 w-full h-1 bg-current" style={{color: secondColor}}>
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import { BsmIcon } from "../svgs/bsm-icon.component"
|
||||
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
|
||||
import { getCorrectTextColor } from "renderer/helpers/correct-text-color"
|
||||
import { GlowEffect } from "./glow-effect.component";
|
||||
import { motion } from "framer-motion";
|
||||
import { useState } from "react";
|
||||
|
||||
type Props = {className?:string, checked?: boolean, onChange?: (val: boolean) => void, disabled?: boolean}
|
||||
|
||||
export function BsmCheckbox({className, checked, onChange, disabled} : Props) {
|
||||
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const checkedColor = useThemeColor("first-color");
|
||||
const iconColor = getCorrectTextColor(checkedColor);
|
||||
const iconColor = checkedColor && getCorrectTextColor(checkedColor);
|
||||
|
||||
const handleClick = () => {
|
||||
if(disabled){ return; }
|
||||
@@ -15,12 +19,12 @@ export function BsmCheckbox({className, checked, onChange, disabled} : Props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={`${className} group-one`}>
|
||||
{!disabled && <span className="glow-on-hover !w-[calc(100%+6px)] !h-[calc(100%+6px)] !-top-[3px] !-left-[3px] group-one-hover:opacity-100"/>}
|
||||
<motion.div className={`${className} group-one`} onHoverStart={() => setHovered(true)} onHoverEnd={() => setHovered(false)}>
|
||||
<GlowEffect visible={!disabled && hovered} className="!w-[calc(100%+6px)] !h-[calc(100%+6px)] !-top-[3px] !-left-[3px]"/>
|
||||
|
||||
<span className={`w-full h-full flex items-center justify-center rounded-md border-2 border-current overflow-hidden bg-light-main-color-3 dark:bg-main-color-1 ${disabled ? "opacity-30 cursor-not-allowed" : "cursor-pointer"}`} onClickCapture={e => {e.stopPropagation(); handleClick()}}>
|
||||
<BsmIcon className="w-full h-full" icon="check" style={{color: iconColor, backgroundColor: checkedColor, visibility: checked ? "visible" : "hidden"}}/>
|
||||
</span>
|
||||
</div>
|
||||
</motion.div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -37,6 +37,6 @@ export const BsmImage = forwardRef(({className, image, errorImage, placeholder,
|
||||
|
||||
return (
|
||||
// @ts-ignore
|
||||
<img ref={ref} title={title} className={className} src={image} loading={loading} onLoad={handleLoaded} onError={handleError} style={styles} onClick={(e) => onClick?.(e)} alt=" "/>
|
||||
<img ref={ref} title={title} className={className} src={image} loading={loading} onLoad={handleLoaded} onError={handleError} style={styles} onClick={(e) => onClick?.(e)} alt=" " decoding="async"/>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -11,12 +11,13 @@ type Props = {
|
||||
max: number,
|
||||
step?: number,
|
||||
renderLabel?: (value: number) => JSX.Element,
|
||||
colors?: string[]
|
||||
}
|
||||
|
||||
export function BsmRange({colorType = "first-color", values, onChange, onFinalChange, min, max, renderLabel, step = 1} : Props) {
|
||||
export function BsmRange({colorType = "first-color", values, onChange, onFinalChange, min, max, renderLabel, step = 1, colors} : Props) {
|
||||
|
||||
const color = useThemeColor(colorType);
|
||||
const labelTextColor = getCorrectTextColor(color);
|
||||
const labelTextColor = color && getCorrectTextColor(color);
|
||||
|
||||
return (
|
||||
<Range
|
||||
@@ -35,10 +36,10 @@ export function BsmRange({colorType = "first-color", values, onChange, onFinalCh
|
||||
style={{
|
||||
...props.style,
|
||||
background: getTrackBackground({
|
||||
values: values,
|
||||
colors: ["#ccc", color, "#ccc"],
|
||||
min: min,
|
||||
max: max
|
||||
values,
|
||||
colors: colors ?? ["#ccc", color, "#ccc"],
|
||||
min,
|
||||
max
|
||||
}),
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,31 +1,32 @@
|
||||
import { ChangeEvent, CSSProperties } from "react"
|
||||
import equal from "fast-deep-equal";
|
||||
import { ComponentProps } from "react"
|
||||
import { useTranslation } from "renderer/hooks/use-translation.hook"
|
||||
|
||||
type Props = {
|
||||
className?: string,
|
||||
style?: CSSProperties,
|
||||
options?: BsmSelectOption[],
|
||||
onChange?: (value: string) => void
|
||||
type Props<T> = Omit<ComponentProps<"select">, "onChange"> & {
|
||||
options?: BsmSelectOption<T>[],
|
||||
selected?: T,
|
||||
onChange?: (value: T) => void,
|
||||
}
|
||||
|
||||
export function BsmSelect({className, style, options, onChange}: Props) {
|
||||
export function BsmSelect<T = unknown>(props: Props<T>) {
|
||||
|
||||
const t = useTranslation();
|
||||
|
||||
const handleChange = (event: ChangeEvent<HTMLSelectElement>) => {
|
||||
onChange?.(event.target.value);
|
||||
const handleChange: ComponentProps<"select">["onChange"] = (e) => {
|
||||
e.preventDefault();
|
||||
props.onChange?.(props.options?.[parseInt(e.target.value)]?.value);
|
||||
}
|
||||
|
||||
return (
|
||||
<select className={className} style={style} onChange={handleChange}>
|
||||
{options && options.map(option => (
|
||||
<option key={option.value} value={option.value}>{t(option.text)}</option>
|
||||
<select {...props} onChange={handleChange} defaultValue={props.options?.findIndex(opt => equal(opt.value, props.selected))}>
|
||||
{props.options && props.options.map((option, index) => (
|
||||
<option key={index} value={index}>{t(option.text)}</option>
|
||||
))}
|
||||
</select>
|
||||
)
|
||||
}
|
||||
|
||||
export interface BsmSelectOption{
|
||||
export interface BsmSelectOption<T>{
|
||||
text: string,
|
||||
value: string
|
||||
value: T
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { AnimatePresence, motion } from "framer-motion"
|
||||
|
||||
type Props = {
|
||||
visible?: boolean,
|
||||
className?: string
|
||||
}
|
||||
|
||||
export function GlowEffect({visible, className}: Props) {
|
||||
return (
|
||||
<AnimatePresence>
|
||||
{visible && <motion.div transition={{duration: .1}} initial={{opacity: 0}} animate={{opacity: 1}} exit={{opacity: 0}} className={`${className} glow-on-hover`}/>}
|
||||
</AnimatePresence>
|
||||
)
|
||||
}
|
||||
+1
-1
@@ -15,7 +15,7 @@ export function BsmIframeView() {
|
||||
return (
|
||||
<AnimatePresence>
|
||||
{iframeUrl && (
|
||||
<div className="top-0 absolute w-screen h-screen flex content-center items-center justify-center z-50">
|
||||
<div className="top-0 absolute w-screen h-screen flex content-center items-center justify-center z-[150]">
|
||||
<motion.span className="absolute w-full h-full bg-black top-0 right-0" initial={{opacity: 0}} animate={{opacity: .60}} exit={{opacity: 0}} transition={{duration: .2}}/>
|
||||
<motion.div ref={ref} className="z-[1] w-[calc(100vw-250px)] h-[calc(100vh-250px)] shadow-black shadow-md rounded-md overflow-hidden bg-black" initial={{y: "100vh"}} animate={{y: 0}} exit={{y: "100vh"}}>
|
||||
<iframe className="w-full h-full" src={iframeUrl}/>
|
||||
@@ -44,16 +44,32 @@ import { UnlinkIcon } from "./icons/unlink-icon.component";
|
||||
import { DownloadIcon } from "./icons/download-icon.component";
|
||||
import { FilterIcon } from "./icons/filter-icon.component";
|
||||
import DiscordIcon from "./icons/discord-icon.component";
|
||||
import { TwitterIcon } from "./icons/twitter-icon.component";
|
||||
import { Mee6Icon } from "./icons/mee6-icon.component";
|
||||
import { InfoIcon } from "./icons/info-icon.component";
|
||||
import { SyncIcon } from "./icons/sync-icon.component";
|
||||
import { VolumeUpIcon } from "./icons/volume-up-icon.component";
|
||||
import { VolumeOffIcon } from "./icons/volume-off-icon.component";
|
||||
import { VolumeDownIcon } from "./icons/volume-down-icon.component";
|
||||
import { GermanIcon } from "./flags/german-icon.component";
|
||||
import { MSModelType } from "shared/models/models/model-saber.model";
|
||||
import { ModelTypeAvatarIcon } from "./icons/model-type-avatar-icon.component";
|
||||
import { ModelTypeSaberIcon } from "./icons/model-type-saber-icon.component";
|
||||
import { ModelTypePlatformIcon } from "./icons/model-type-platform-icon.component";
|
||||
import { ModelTypeBloqIcon } from "./icons/model-type-bloq-icon.component";
|
||||
import { ChevronTopIcon } from "./icons/chevron-top-icon.component";
|
||||
|
||||
export type BsmIconType = BsvMapCharacteristic | (
|
||||
"settings"|"trash"|"favorite"|"folder"|"bsNote"|"check"|"three-dots"|"twitch"|"eye"|"play"|"checkCircleIcon"|"discord"|
|
||||
"terminal"|"desktop"|"oculus"|"add"|"cross"|"task"|"github"|"close"|"thumbUpFill"|"timerFill"|"pause"|
|
||||
"copy"|"steam"|"edit"|"export"|"patreon"|"search"|"bsMapDifficulty"|"link"|"unlink"|"download"|"filter"|
|
||||
"fr-FR-flag"|"es-ES-flag"|"en-US-flag"|"en-EN-flag"
|
||||
export type BsmIconType = BsvMapCharacteristic | MSModelType | (
|
||||
"settings"|"trash"|"favorite"|"folder"|"bsNote"|"check"|"three-dots"|"twitch"|"eye"|"play"|"checkCircleIcon"|"discord"|"info"|
|
||||
"terminal"|"desktop"|"oculus"|"add"|"cross"|"task"|"github"|"close"|"thumbUpFill"|"timerFill"|"pause"|"twitter"|"sync"|"chevron-top"|
|
||||
"copy"|"steam"|"edit"|"export"|"patreon"|"search"|"bsMapDifficulty"|"link"|"unlink"|"download"|"filter"|"mee6"|"volume-up"|"volume-off"|"volume-down"|
|
||||
"fr-FR-flag"|"es-ES-flag"|"en-US-flag"|"en-EN-flag"|"de-DE-flag"
|
||||
);
|
||||
|
||||
export const BsmIcon = memo(({className, icon, style}: {className?: string, icon: BsmIconType, style?: CSSProperties}) => {
|
||||
|
||||
// TODO : Very ugly very messy, need to find a better way to do this
|
||||
|
||||
const renderIcon = () => {
|
||||
if(icon === "settings"){ return <SettingIcon className={className} style={style}/> }
|
||||
if(icon === "trash"){ return <TrashIcon className={className} style={style}/> }
|
||||
@@ -69,6 +85,7 @@ export const BsmIcon = memo(({className, icon, style}: {className?: string, icon
|
||||
if(icon === "es-ES-flag"){ return <SpainIcon className={className} style={style}/> }
|
||||
if(icon === "en-US-flag"){ return <UsaIcon className={className} style={style}/> }
|
||||
if(icon === "en-EN-flag"){ return <UkIcon className={className} style={style}/> }
|
||||
if(icon === "de-DE-flag"){ return <GermanIcon className={className} style={style}/> }
|
||||
if(icon === "task"){ return <TaskIcon className={className} style={style}/> }
|
||||
if(icon === "copy"){ return <CopyIcon className={className} style={style}/> }
|
||||
if(icon === "steam"){ return <SteamIcon className={className} style={style}/> }
|
||||
@@ -99,6 +116,19 @@ export const BsmIcon = memo(({className, icon, style}: {className?: string, icon
|
||||
if(icon === "download"){ return <DownloadIcon className={className} style={style}/> }
|
||||
if(icon === "filter"){ return <FilterIcon className={className} style={style}/> }
|
||||
if(icon === "discord"){ return <DiscordIcon className={className} style={style}/> }
|
||||
if(icon === "twitter"){ return <TwitterIcon className={className} style={style}/> }
|
||||
if(icon === "mee6"){ return <Mee6Icon className={className} style={style}/> }
|
||||
if(icon === "info"){ return <InfoIcon className={className} style={style}/> }
|
||||
if(icon === "sync"){ return <SyncIcon className={className} style={style}/> }
|
||||
if(icon === "volume-up"){ return <VolumeUpIcon className={className} style={style}/> }
|
||||
if(icon === "volume-down"){ return <VolumeDownIcon className={className} style={style}/> }
|
||||
if(icon === "volume-off"){ return <VolumeOffIcon className={className} style={style}/> }
|
||||
if(icon === "chevron-top"){ return <ChevronTopIcon className={className} style={style}/> }
|
||||
|
||||
if(icon === MSModelType.Avatar){ return <ModelTypeAvatarIcon className={className} style={style}/> }
|
||||
if(icon === MSModelType.Saber){ return <ModelTypeSaberIcon className={className} style={style}/> }
|
||||
if(icon === MSModelType.Platfrom){ return <ModelTypePlatformIcon className={className} style={style}/> }
|
||||
if(icon === MSModelType.Bloq){ return <ModelTypeBloqIcon className={className} style={style}/> }
|
||||
return <TrashIcon className={className} style={style}/>
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { CSSProperties } from "react";
|
||||
|
||||
export function GermanIcon(props: {className?: string, style?: CSSProperties}) {
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="71px" height="48px" viewBox="0 0 71 48" version="1.1" className={props.className} style={props.style}>
|
||||
<defs/>
|
||||
<g id="Flags" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd" transform="translate(-239.000000, -805.000000)">
|
||||
<g transform="translate(70.000000, 70.000000)" fillRule="nonzero" id="Germany">
|
||||
<g transform="translate(169.000000, 735.000000)">
|
||||
<g id="Bolivia-9">
|
||||
<path d="M0.52,7 L0.52,16 L70.52,16 L70.52,7 C70.52,3.33282926 67.5471707,0.36 63.88,0.36 L7.17,0.36 C5.40723053,0.357345224 3.71575038,1.05574249 2.46834517,2.3012719 C1.22093997,3.54680131 0.519998001,5.23722853 0.52,7 Z" id="Shape" fill="#434A54"/>
|
||||
<polygon id="Shape" fill="#ED5565" points="0.52 31.74 70.52 31.74 70.52 16.07 0.52 16.07"/>
|
||||
<path d="M0.52,40.76 C0.52,44.4271707 3.49282926,47.4 7.16,47.4 L63.88,47.4 C67.5471707,47.4 70.52,44.4271707 70.52,40.76 L70.52,31.76 L0.52,31.76 L0.52,40.76 Z" id="Shape" fill="#F6BB42"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { CSSProperties } from "react";
|
||||
|
||||
export function ChevronTopIcon(props: {className?: string, style?: CSSProperties}) {
|
||||
return (
|
||||
<svg className={props.className} style={props.style} fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
|
||||
<path d="M260.811-366.051q-11.021-11.021-11.355-26.521-.333-15.5 10.689-26.522l193.333-193.333q5.892-5.892 12.475-8.457 6.583-2.565 14.047-2.565t14.047 2.565q6.583 2.565 12.475 8.457l193.667 193q11.021 10.514 10.981 26.054-.039 15.54-11.315 26.656-11.021 11.021-26.855 11.021-15.833 0-26.855-11.021L480-532.196 313.521-365.051q-10.355 11.022-25.894 10.649-15.54-.373-26.816-11.649Z"/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user