Compare commits

...

94 Commits

Author SHA1 Message Date
Shidorien 74b91ee277 enhance BsmDropdownButton with maxHeight calculation and item height tracking 2026-01-30 21:07:28 +01:00
Shidorien 756cccf85c Handling of right-click outside the menu to close the menu 2026-01-30 20:38:02 +01:00
Iluhadesu 1591e32b4f Add v1.42.1 to bs-versions.json 2026-01-29 14:13:25 +00:00
frto027 57ca031e70 [feat-994] Add support for alternative mod repos (#995)
* [feat] Add support for alternative mod repos

* Fix lint errors

* Simplify code + Fix potential issues

---------

Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com>
2026-01-26 16:06:44 +01:00
Vyacheslav 49ef8203c8 fix: use electron.net for beatmods.com requests to avoid Cloudflare timeouts (#986)
* [fix] Use electron.net for beatmods.com requests

* [fix] Route beatmods.com file downloads through electron.net

* Add error handlers

* Refactor error handling in RequestService to ensure proper completion of file write operations

* fix lint errors

---------

Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com>
2026-01-23 13:48:12 +01:00
Zagrios d9a68e91ca [chore] update patreons.json (#991) 2026-01-21 04:15:23 +01:00
Zagrios 2a4e775cec [chore] update patreons.json (#987) 2026-01-10 05:08:05 +01:00
Zagrios 58529a2ea2 [chore] update patreons.json (#985) 2026-01-07 09:38:22 +01:00
Zagrios ff028c77a1 update workflow 2026-01-07 09:36:37 +01:00
Zagrios 8edfea66f2 update deps 2026-01-02 17:46:04 +01:00
Zagrios 378fa1150e [fix] Follow script redirect to get the JSON (#981) 2026-01-02 16:12:47 +01:00
silentrald 92a1232f85 [fix] handle launch option string properly (#895)
* [fix] refactored launch functions to handle wrapper executables

* [fix] properly parse launch option string

* [fix] support complex launch options for linux

* [fix] applied sonarcube comments

* [fix] apply launch option parsing to shortcut creation

* Change log message

* fix beat saber not launching on windows

---------

Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com>
2026-01-02 13:08:01 +01:00
tleydxdy 25047b6c0a Add workaround for headset with canted views (#918)
See https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2312
2026-01-02 09:43:07 +01:00
Ângelo Tadeucci 2512165898 fix: Playlist search modal losing state (#974)
fix: Playlist modal retaining state

Replaced usage of crypto.randomUUID() in React keys with a persistent 'id' property on modal objects. This ensures stable keys for modal overlays and modal components, preventing unnecessary re-renders and improving React reconciliation.
2025-12-29 23:21:13 +01:00
Zagrios bf1d9408d8 Do not run on forkl 2025-12-23 14:29:45 +01:00
Iluhadesu b076850f63 Add v1.42.0 to bs-versions.json 2025-12-18 16:26:32 +00:00
Zagrios ff8932ea99 [chore] update patreons.json (#971) 2025-12-07 09:17:55 +01:00
Zagrios 6d19d21116 Fix error prompted when uninstalling BSIPA but in fact was successfully uninstalled (#973) 2025-12-06 23:39:38 +01:00
Zagrios 58f8d8e243 Fix race condition when switching version while mods are loading (#972)
* Fix race condition when switching version while mods are loading

* add ts-node for webpack and update workflows
2025-12-06 23:03:46 +01:00
Zagrios 06bb2fe416 Merge branch 'master' of https://github.com/Zagrios/bs-manager 2025-12-06 22:26:56 +01:00
Zagrios 58211271e6 Node 22 to Node 24 + Use tsx instead of ts-node + add @emotion/is-prop-valid 2025-12-06 22:26:53 +01:00
Zagrios e3dc280d34 [chore] update patreons.json (#967) 2025-12-04 11:38:45 +01:00
Iluhadesu 1cd3aa762a Add v1.41.1 to bs-versions.json 2025-12-02 16:47:45 +00:00
Zagrios 94f682b6a2 [chore] update patreons.json (#961) 2025-11-15 08:48:03 +01:00
Zagrios ecb1b57c9b update electron to its latest version 2025-11-05 08:47:57 +01:00
WitheringAway 21fdea9c35 fix bsipa installation error on linux #945 (#948)
prevent overwriting wineprefix (#945)
2025-11-02 15:56:54 +01:00
silentrald 2073d8ffa4 [feat-930] added added date sorting for maps/songs (#931)
* [feat-930] added added date sorting for maps/songs

* [feat-930] add translations

* [feat-930] fixed date format issue

---------

Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com>
2025-11-02 15:45:49 +01:00
Zagrios c9c24479d3 [chore] update patreons.json (#957) 2025-11-02 15:44:52 +01:00
Zagrios cf0921051b Add info again for certificate validation 2025-10-31 07:09:37 +01:00
Iluhadesu 526a3c3ee8 Add v1.40.13 to bs-versions.json 2025-10-30 17:31:11 +00:00
Zagrios 2003507713 Add info for certificate validation 2025-10-26 12:00:39 +01:00
Zagrios 674aab3b4d [chore] update patreons.json (#954) 2025-10-25 12:12:52 +02:00
Zagrios 09c9f19dcb [chore] update patreons.json (#949) 2025-10-14 04:51:07 +02:00
WitheringAway 1cb3cc09a9 fix hhttps error in readme (#947) 2025-10-12 11:00:37 +02:00
WitheringAway e327074459 Switch out old issue creation links with templates (#946)
switch out old issue creation links with templates
2025-10-11 12:14:03 +02:00
Zagrios 56f80f14b2 [chore] update patreons.json (#942) 2025-10-07 08:48:07 +02:00
silentrald a8fc1e1a08 [bugfix-922] fix linux steam pathing issue (#943) 2025-10-07 08:45:18 +02:00
Zagrios d09ca56eeb [chore] update patreons.json (#940) 2025-10-03 21:17:31 +02:00
Zagrios 1df7045683 [chore] update patreons.json (#937) 2025-09-30 04:46:54 +02:00
Iluhadesu fd2795a1f7 Add v1.40.12 to bs-versions.json 2025-09-29 13:39:33 +00:00
Zagrios 47ff527f4d [chore] update patreons.json (#934) 2025-09-25 04:36:59 +02:00
Zagrios c6a3a1249c [chore] update patreons.json (#933) 2025-09-24 09:16:25 +02:00
Iluhadesu 3f1e3e27ba Add v1.40.11 to bs-versions.json 2025-09-23 06:18:39 +00:00
Zagrios 459b7797d0 [chore] update patreons.json (#929) 2025-09-20 07:00:31 +02:00
Zagrios cd89072c4c [chore] update patreons.json (#926) 2025-09-19 04:40:18 +02:00
Zagrios 092f10a6ab [chore] update patreons.json (#925) 2025-09-11 09:13:02 +02:00
Zagrios 4f43f3b833 [chore] update patreons.json (#924) 2025-09-05 08:46:02 +02:00
Zagrios 4a90ac466a [chore] update patreons.json (#920) 2025-08-31 21:43:28 +02:00
Zagrios 5ff8473a85 Update Patreon workflow to create pull requests for changes in patreons.json 2025-08-31 21:40:19 +02:00
Zagrios a5784e9b6e Refactor Patreon update workflow to commit and push changes directly instead of creating pull requests 2025-08-31 21:23:55 +02:00
Zagrios e62b79222b Update Patreon workflow to create pull requests for changes in patreons.json 2025-08-31 21:19:29 +02:00
Zagrios f3359cb43d Add update patreon workflow 2025-08-31 21:03:38 +02:00
Zagrios 390167f0b5 add script to update patreons.json 2025-08-31 20:54:57 +02:00
Zagrios 9964940020 bump to 1.5.4 2025-08-31 14:16:22 +02:00
Ika 0df4cef2a6 Improve french translation (#863)
* Improve french translation

* Update fr.json

* Update fr.json

---------

Co-authored-by: Ika <36999341+IkaOverride@users.noreply.github.com>
2025-08-31 14:06:01 +02:00
Liborsaf 846e1f55be [bugfix] Fix "exclude installed" filter not loading more maps (#904) 2025-08-30 13:37:34 +02:00
Zagrios 4dbc552ca9 Update depot downloader to 3.4.0 (#882)
* [fix/634] fixed issue on hovering on last song element

* restore itemHeight and add a bottom padding

* Update depotdownloader to 3.4.0

---------

Co-authored-by: silentrald <silentrald1216@gmail.com>
2025-08-30 13:31:33 +02:00
Zagrios 066ced228d [bugfix] 1.40.10 seen as 1.40.1 (#912)
* nothing

* [bugfix] We search fist the most recent version of beatsaber to fix the 1.40.1 issue
2025-08-29 19:15:39 +02:00
silentrald 40ebf89389 [feat-906] changed linux home directory to XDG_DATA_HOME (#907) 2025-08-29 19:13:39 +02:00
Iluhadesu 59892160c3 Just a little reformating 2025-08-28 21:01:07 +00:00
Iluhadesu 7f6e87bdfa Add 1.40.10 to bs-versions.json 2025-08-28 20:58:13 +00:00
Iluhadesu cde12371d7 Add v1.40.9 to bs-versions.json 2025-08-21 12:14:58 +00:00
Iluhadesu d9b4259b97 Revert "Add v6000.0.40 to bs-versions.json"
This reverts commit 9c20640fa7.
2025-07-28 14:06:52 +00:00
Iluhadesu 9c20640fa7 Add v6000.0.40 to bs-versions.json 2025-07-28 13:28:21 +00:00
Iluhadesu c7c28d6461 Change recommended version to 1.40.8 2025-07-24 21:57:31 +00:00
Iluhadesu 3859e04756 Add v1.40.8 to bs-versions.json 2025-07-24 17:44:21 +00:00
Meivyn d210c0f38d [bugfix] prevent corruption of the game when installing BSIPA (#894) 2025-07-12 09:45:07 +02:00
Iluhadesu 10f8685b68 Recommended version updated to 1.40.7 2025-07-11 13:06:38 +00:00
Iluhadesu a2052d6e0f Add v1.40.7 to bs-versions.json 2025-07-10 15:15:19 +00:00
Zagrios 5b5a4a0817 Make the "create steam shortcut" always visible + make buttons bigger (#892) 2025-07-01 09:30:47 +02:00
Zagrios a372707ebd Merge branch 'master' of https://github.com/Zagrios/bs-manager 2025-07-01 08:59:53 +02:00
Zagrios b1d9a29da9 [fix] do not change the installation path if its the same path 2025-07-01 08:59:51 +02:00
silentrald 46556cf3cc [fix] added error logging when getting the steam version path (#890) 2025-07-01 08:54:22 +02:00
silentrald 06c242eb01 [fix] fixed issue with double http prepending on http proxy (#889) 2025-06-21 13:54:04 +02:00
silentrald c6500f7cf6 [fix] use a caching method for ipv4/6 request calls (#872)
* Revert "[bugfix] Remove the ipv4/ipv6 stuff that cause more issue than is solves"

This reverts commit c763e0fefc.

* [fix] use a caching method for ipv4/6 request calls

* Add caching logs

---------

Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com>
2025-06-21 10:35:28 +02:00
silentrald b00d41f98f [fix] custom mods should be appended on version page load (#878)
* [fix] custom mods should be appended on version page load

* refactored the code to use hooks for readability

* Use "useCallback" to avoid unnecessary redeclarations

---------

Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com>
2025-06-14 14:53:56 +02:00
GaetanGrd e1b55e4019 Feature/language UI update (#797)
* split radio items into two columns for better layout

* Add SplitColumns prop to SettingRadioArray for flexible layout

* Add columnCount prop to SettingRadioArray for flexible layout

* REmove useless change

* fix dytnamic grid columns after compilation

* remove useless span

---------

Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com>
2025-06-14 14:01:07 +02:00
silentrald feb6ea3f87 [feat] added auto update option on advance settings for windows (#773)
* [feat] added auto update option on advance settings for windows

* minor fixes + translations

* [feat] added popover for manual bsm update

* [feat] added logic on update and restart

* [feat] fixed sonar issues and added missing translations

* Fix availve update and current app version were the same

* Add a "See changelog"

* Set autoupdate always enabled by default

---------

Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com>
2025-06-12 18:58:41 +02:00
Zagrios 9d945cdcfb update deps 2025-06-11 14:58:36 +02:00
Zagrios 5ea12c2c3a Merge branch 'master' of https://github.com/Zagrios/bs-manager 2025-06-10 14:49:01 +02:00
Zagrios 0a30867a12 add patreon 2025-06-10 14:48:59 +02:00
silentrald f46fee7ee7 [fix] handle downloadMap error within downloadPlaylistSongs (#873) 2025-06-10 14:47:23 +02:00
silentrald ed5f8fb073 [fix/634] fixed issue on hovering on last song element (#876)
* [fix/634] fixed issue on hovering on last song element

* restore itemHeight and add a bottom padding

---------

Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com>
2025-06-10 14:32:09 +02:00
Sapphire dfe63e525e [bugfix] Fix mod installation on NixOS (#870)
* fix(services/bs-mods-manager): inherit env on linux when starting bsipa

* fix(services/linux,bs-mods-manager): use proton wine on nixos
2025-06-08 15:43:06 +02:00
Vojtak42 207d3c782e Press CTRL+R after opening developer tools (#867) 2025-06-08 15:40:52 +02:00
Iluhadesu 56b462ad8a Set recommended version to 1.40.6 2025-06-05 17:24:06 +00:00
Iluhadesu 2e85c62c02 Add v1.40.6 to bs-versions.json 2025-06-05 15:49:22 +00:00
Zagrios 7fcef774a8 Merge branch 'master' of https://github.com/Zagrios/bs-manager 2025-05-27 12:06:24 +02:00
Zagrios 5337c4a61f update patreon 2025-05-27 12:06:22 +02:00
Iluhadesu ed158f55c5 Change recommanded version to 1.40.5 2025-05-18 18:48:58 +00:00
Iluhadesu 568ad7d051 Fix bs-versions.json 2025-05-15 15:20:22 +00:00
Iluhadesu e1ca8dbf99 Add versary to bs-versions.json 2025-05-15 15:12:53 +00:00
Zagrios 9bbc57008a bumb to 1.5.3 2025-04-27 16:33:01 +02:00
Zagrios 34dbfe4cf8 [bugfix] Launch mods weren't working 2025-04-27 14:15:54 +02:00
73 changed files with 4249 additions and 1548 deletions
+170
View File
@@ -0,0 +1,170 @@
import fetch from "node-fetch";
import fs from "fs";
import path from "path";
const API_BASE = "https://www.patreon.com/api/oauth2/v2";
function requireEnv(name) {
const value = process.env[name];
if (!value) {
throw new Error(`Missing required env var: ${name}`);
}
return value;
}
function mapTierTitleToType(tierTitle) {
if (!tierTitle) return undefined;
const normalized = String(tierTitle).toLowerCase();
if (normalized.includes("diamond")) return "diamond";
if (normalized.includes("gold")) return "gold";
return undefined;
}
function extractPreferredLink(userAttributes) {
if (!userAttributes || !userAttributes.social_connections) return undefined;
const sc = userAttributes.social_connections;
// Prefer Twitch, then YouTube, then Twitter/X
const providers = ["twitch", "youtube", "twitter"];
for (const provider of providers) {
const entry = sc[provider];
if (entry && entry.url) return entry.url;
}
return undefined;
}
async function fetchAllMembers(accessToken, campaignId) {
let url =
`${API_BASE}/campaigns/${encodeURIComponent(
campaignId
)}/members` +
"?include=user,currently_entitled_tiers" +
"&fields[member]=patron_status,full_name,pledge_relationship_start,last_charge_date" +
"&fields[user]=full_name,vanity,url,social_connections" +
"&fields[tier]=title" +
"&page[count]=100";
const headers = {
Authorization: `Bearer ${accessToken}`,
"User-Agent": process.env.PATREON_USER_AGENT || "BSManager - Patreon Sync",
};
const allMembers = [];
const usersById = new Map();
const tiersById = new Map();
while (url) {
const res = await fetch(url, { headers });
if (!res.ok) {
const text = await res.text();
throw new Error(`Failed to fetch members (${res.status}): ${text}`);
}
const json = await res.json();
if (Array.isArray(json.included)) {
for (const inc of json.included) {
if (inc.type === "user") {
usersById.set(inc.id, inc);
} else if (inc.type === "tier") {
tiersById.set(inc.id, inc);
}
}
}
if (Array.isArray(json.data)) {
allMembers.push(...json.data);
}
url = json.links && json.links.next ? json.links.next : undefined;
}
return { members: allMembers, usersById, tiersById };
}
function buildPatreonsList({ members, usersById, tiersById, existingLinkByUsername }) {
const uniqueByUsername = new Map();
for (const member of members) {
const attrs = member.attributes || {};
if (attrs.patron_status !== "active_patron") continue;
const userRel = member.relationships && member.relationships.user && member.relationships.user.data;
const user = userRel ? usersById.get(userRel.id) : undefined;
const userAttrs = (user && user.attributes) || {};
const tiersRel =
member.relationships &&
member.relationships.currently_entitled_tiers &&
member.relationships.currently_entitled_tiers.data;
let type;
if (Array.isArray(tiersRel) && tiersRel.length > 0) {
// Use first tier title match to determine type
const tier = tiersById.get(tiersRel[0].id);
type = mapTierTitleToType(tier && tier.attributes && tier.attributes.title);
}
const username = (userAttrs.vanity || userAttrs.full_name || user?.id || "[ ]").trim();
const link = type === "diamond" ? extractPreferredLink(userAttrs) : undefined;
// Determine first payment/relationship start date (fallback to last_charge_date)
const firstDateStr = attrs.pledge_relationship_start || attrs.last_charge_date || null;
let ts = Number.MAX_SAFE_INTEGER;
if (firstDateStr) {
const parsed = Date.parse(firstDateStr);
ts = Number.isNaN(parsed) ? Number.MAX_SAFE_INTEGER : parsed;
}
const entry = { username };
if (type) entry.type = type;
// Preserve link from existing JSON if present; otherwise use new link
const preservedLink = existingLinkByUsername && existingLinkByUsername.get(username);
if (preservedLink) entry.link = preservedLink;
else if (link) entry.link = link;
// Ensure uniqueness by username
if (!uniqueByUsername.has(username)) {
uniqueByUsername.set(username, { entry, ts });
}
}
return Array.from(uniqueByUsername.values())
.sort((a, b) => a.ts - b.ts)
.map((x) => x.entry);
}
async function main() {
const ACCESS_TOKEN = requireEnv("PATREON_ACCESS_TOKEN");
const CAMPAIGN_ID = requireEnv("PATREON_CAMPAIGN_ID");
const jsonPath = path.resolve(process.cwd(), "assets", "jsons", "patreons.json");
let existing = [];
try {
if (fs.existsSync(jsonPath)) {
const raw = fs.readFileSync(jsonPath, "utf8");
existing = JSON.parse(raw);
}
} catch (_) {
existing = [];
}
const existingLinkByUsername = new Map();
if (Array.isArray(existing)) {
for (const e of existing) {
if (e && e.username && e.link) existingLinkByUsername.set(e.username, e.link);
}
}
const { members, usersById, tiersById } = await fetchAllMembers(ACCESS_TOKEN, CAMPAIGN_ID);
const patreons = buildPatreonsList({ members, usersById, tiersById, existingLinkByUsername });
const output = `${JSON.stringify(patreons, null, "\t")}\n`;
fs.writeFileSync(jsonPath, output, "utf8");
// eslint-disable-next-line no-console
console.log(`Updated ${jsonPath} with ${patreons.length} active patrons.`);
}
main().catch((err) => {
// eslint-disable-next-line no-console
console.error(err);
process.exitCode = 1;
});
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.11.0
node-version: 24.11.1
cache: "npm"
# Update package lists
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.11.0
node-version: 24.11.1
cache: "npm"
- run: npm ci
- run: npm run lint
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.11.0
node-version: 24.11.1
cache: "npm"
- run: npm ci
- run: npm run build
+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.11.0
node-version: 24.11.1
cache: "npm"
- run: npm ci
- run: npm run build
+50
View File
@@ -0,0 +1,50 @@
name: Update Patreon supporters
on:
schedule:
- cron: "0 0 * * *" # Every day at 00:00 UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update-patreons:
if: github.repository == 'Zagrios/bs-manager' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run Patreon update script
env:
PATREON_ACCESS_TOKEN: ${{ secrets.PATREON_ACCESS_TOKEN }}
PATREON_CAMPAIGN_ID: ${{ secrets.PATREON_CAMPAIGN_ID }}
PATREON_USER_AGENT: BSManager - Patreon Sync (GitHub Action)
run: npx ts-node ./.erb/scripts/update-patreon.js
- name: Create Pull Request (only if changes)
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: "[chore] update patreons.json"
title: "[chore] update patreons.json"
body: |
Automated daily update of Patreon supporters.
branch: chore/patreon-update
delete-branch: true
add-paths: |
assets/jsons/patreons.json
+3 -3
View File
@@ -24,11 +24,11 @@
</p>
<p>
<a
href="https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=bug&template=-bug--bug-report.md&title=%5BBUG%5D+%3A+">Report
href="https://github.com/Zagrios/bs-manager/issues/new?template=1-bug-report.yaml">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
href="https://github.com/Zagrios/bs-manager/issues/new?template=2-feature-request.yaml">Request
Feature</a>
·
<a href="https://github.com/Zagrios/bs-manager/security/policy">Report a security vulnerability</a>
@@ -472,7 +472,7 @@
<div>
<h2>Credits</h2>
<ul>
<li><a href="https://github.com/Zagrios">Zagrios</a> - Lead Developer & Founder.</li>
<li><a href="https://github.com/Zagrios">Zagrios</a> - Lead Developer & Founder. (Mathieu Gries)</li>
<li><a href="https://github.com/Iluhadesu">Iluhadesu</a> - Co-Developer & Co-Founder, Discord Bot Developer.</li>
<li><a href="https://github.com/GaetanGrd">GaetanGrd</a> - Co-Developer & Co-Founder, Documentation Lead.</li>
<li><a href="https://github.com/cheddZy">cheddZy</a> - Icon Creator.</li>
+106
View File
@@ -847,7 +847,113 @@
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/510702041542166484",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/c27dac7f96e53672d020d97838cec1d5d28e3180.png",
"ReleaseDate": "1743515622",
"year": "2025"
},
{
"BSVersion": "1.40.5",
"BSManifest": "2447038720841508806",
"OculusBinaryId": "9120095564756808",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/502825275922317447",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/2b5845893d915902106aaf30b6d1a95f68a4b226.png",
"ReleaseDate": "1747321305",
"year": "2025"
},
{
"BSVersion": "1.40.6",
"BSManifest": "3050696685250334115",
"OculusBinaryId": "9315734585192904",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/510708375093248769",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/0f658ed39f480446e0dc5807b1591e8a18aef2f5.png",
"ReleaseDate": "1749135144",
"year": "2025"
},
{
"BSVersion": "1.40.7",
"BSManifest": "7263483117834945201",
"OculusBinaryId": "9533840436715650",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/510710285788516821",
"ReleaseImg": "https://clan.akamai.steamstatic.com/images//32055887/c34cf1f62f18898280e2bf905518ba71cce0cffd.png",
"ReleaseDate": "1752159922",
"year": "2025"
},
{
"BSVersion": "1.40.8",
"BSManifest": "8437413909225671968",
"OculusBinaryId": "9637940462972313",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/510712822654566578",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images//32055887/5e32755428ba8f737bf7e9cb7cfc58465b72818c.png",
"ReleaseDate": "1753369967",
"year": "2025",
"recommended": true
},
{
"BSVersion": "1.40.9",
"BSManifest": "3458990238328802301",
"OculusBinaryId": "9907754402657583",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/510715359276302413",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/2c6d12b6791daf434c74a5b7ab94a236789c6836.png",
"ReleaseDate": "1755776928",
"year": "2025"
},
{
"BSVersion": "1.40.10",
"BSManifest": "6631675572109548834",
"OculusBinaryId": "10067683139998041",
"ReleaseDate": "1756386614",
"year": "2025"
},
{
"BSVersion": "1.40.11",
"BSManifest": "2631032361926028583",
"OculusBinaryId": "23961660520173735",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/539991294395549709",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/a626005dae1a96ad8aafa4e65941e26b7918e073.png",
"ReleaseDate": "1758552138",
"year": "2025"
},
{
"BSVersion": "1.40.12",
"BSManifest": "1671670480231783169",
"OculusBinaryId": "24069417846064668",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/539991928250303115",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/2a5b01ea0613ac1674cb19e18547d0649ccd7464.png",
"ReleaseDate": "1759152049",
"year": "2025"
},
{
"BSVersion": "1.40.13",
"BSManifest": "5625229280277602839",
"OculusBinaryId": "24341751555497961",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/637948480724140077",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/90da819ce7dd3dbf1600472e0fea4be3c9a28694.png",
"ReleaseDate": "1761838104",
"year": "2025"
},
{
"BSVersion": "1.41.1",
"BSManifest": "1904061226749256371",
"OculusBinaryId": "24664294529910327",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/542249438751490862",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/6760ebbe87eafaf0215ddfac2858b3716844bc9d.png",
"ReleaseDate": "1764692794",
"year": "2025"
},
{
"BSVersion": "1.42.0",
"BSManifest": "3610593956417791952",
"OculusBinaryId": "24766479246358521",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/542251341653738360",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/9b9e66ee161deafcf4d9548ccf08dde9e4ae726a.png",
"ReleaseDate": "1766073892",
"year": "2025"
},
{
"BSVersion": "1.42.1",
"BSManifest": "4753635509173254286",
"OculusBinaryId": "25154695844203524",
"ReleaseURL": "https://steamcommunity.com/games/620980/announcements/detail/534373847137255841",
"ReleaseImg": "https://clan.fastly.steamstatic.com/images/32055887/b5b3f993a2a00861db9fdfb2eed68018e5d012ba.png",
"ReleaseDate": "1769692187",
"year": "2026"
}
]
+39 -126
View File
@@ -1,166 +1,79 @@
[
{
"username": "Shidorien"
},
{
"username": "iPixelGalaxy"
},
{
"username": "Emyte",
"type": "gold"
},
{
"username": "GoodOldNervy"
},
{
"username": "Naysy"
},
{
"username": "Falmil"
},
{
"username": "Anonymously42",
"type": "diamond",
"link": "https://www.twitch.tv/anonymously42tv"
},
{
"username": "Burt",
"type": "gold"
},
{
"username": "Phil",
"type": "gold"
},
{
"username": "Protocrush",
"type": "gold"
},
{
"username": "Karlito",
"type": "gold"
},
{
"username": ".sharkey"
},
{
"username": "Z3t4"
},
{
"username": "blot455",
"type": "diamond"
},
{
"username": "Lumberjack462",
"type": "diamond",
"link": "https://www.youtube.com/@lumberjack462"
},
{
"username": "Xero"
},
{
"username": "Minescence"
},
{
"username": "mereknom"
},
{
"username": "Jascha"
},
{
"username": "Celldweller",
"type": "gold"
},
{
"username": "rhythmshade"
},
{
"username": "liborsaf"
"username": "Rhythm Shade"
},
{
"username": "aatame3",
"type": "gold"
},
{
"username": "Joshua"
"username": "Joshua Knick"
},
{
"username": "Stuijvi",
"type": "gold"
},
{
"username": "_ monaka"
},
{
"username": "Better_Axel"
},
{
"username": "Riley",
"type": "gold"
},
{
"username": "Austin"
},
{
"username": "Fatalution",
"type": "diamond",
"link": "https://x.com/fatalution"
},
{
"username": "Taurus Arcade",
"type": "gold"
"username": "Austin Bauman"
},
{
"username": "Mozz_Zm"
},
{
"username": "clapxz"
},
{
"username": "Reflected Chop",
"type": "gold"
},
{
"username": "Furiouspupa"
},
{
"username": "Maximilian"
},
{
"username": "Paul Smith"
},
{
"username": "MunityVR",
"type": "gold"
},
{
{
"username": "Sk4venger"
},
{
"username": "Alexander Herman",
"type": "gold"
},
{
"username": "Arts Rimuro Suraimu",
"type": "gold"
},
{
"username": "Ricardo Boss"
},
{
{
"username": "Jesper Norsted"
},
{
"username": "Marcus Hamm"
},
{
"username": "jxkelol"
{
"username": "bosspie",
"type": "diamond"
},
{
"username": "paperwasp",
"type": "gold"
},
{
"username": "KingCrocman",
"type": "diamond"
}
{
"username": "bones",
"type": "gold"
},
{
"username": "Weed"
},
{
"username": "minefox54"
},
{
"username": "Elysee Buthidi",
"type": "gold"
},
{
"username": "Tindux",
"type": "diamond"
},
{
"username": "Einherjar",
"type": "diamond"
},
{
"username": "Daniel"
},
{
"username": "lethal_loops"
},
{
"username": "egg"
}
]
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "veraltet"
"outdated": "veraltet",
"update-text": "BSManager {version} ist verfügbar!",
"update-button": "Aktualisieren und neu starten",
"see-changelog": "Änderungen ansehen"
},
"nav-bar": {
"add-version": "Version hinzufügen",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "Dauer",
"likes": "Likes",
"date-uploaded": "Hochladedatum"
"date-uploaded": "Hochladedatum",
"added-date": "Hinzugefügt am"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "Diese Version enthält {nb} veraltete Mods. Möchten Sie sie aktualisieren?",
"dont-remind-me": "Nicht mehr daran erinnern",
"update": "Aktualisieren"
},
"third-party-mod-source-not-avaliable": {
"description": "Die Drittanbieter-Datenquelle „{name}“ ist nicht verfügbar. Bitte wechseln Sie in den Einstellungen zurück zu BeatMods und versuchen Sie es erneut."
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "Modulquelle",
"description": "Wähle eine andere Quelle als BeatMods.",
"website": "Webseite"
},
"patreon": {
"title": "BSManager Unterstützen 💖",
"description": "Unterstütze das Projekt und helfe uns, BSManager kontinuierlich zu verbessern.",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "Es ist ein Fehler aufgetreten, die Systemproxyeinstellungen können nicht geändert werden."
}
},
"auto-update": {
"title": "Automatische Aktualisierung",
"description": "BSManager wird beim Start der Anwendung automatisch aktualisiert.",
"error-notification": {
"message": "Ein Fehler ist aufgetreten, die Einstellungen für die automatische Aktualisierung können nicht geändert werden."
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "outdated"
"outdated": "outdated",
"update-text": "BSManager {version} is available!",
"update-button": "Update and Restart",
"see-changelog": "See changelog"
},
"nav-bar": {
"add-version": "Add a version",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "Duration",
"likes": "Likes",
"date-uploaded": "Date Uploaded"
"date-uploaded": "Date Uploaded",
"added-date": "Added Date"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "This version has {nb} outdated mods. Do you want to update them?",
"dont-remind-me": "Don't remind me",
"update": "Update"
},
"third-party-mod-source-not-avaliable": {
"description": "The third party mod source \"{name}\" is not avaliable. Please switch to BeatMods at setthings and try again."
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "Mod Source",
"description": "Choose a source other than BeatMods.",
"website": "website"
},
"patreon": {
"title": "Support BSManager 💖",
"description": "Support the project and help us to provide continuous improvements to BSManager.",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "An error occurred, unable to change system proxy settings."
}
},
"auto-update": {
"title": "Auto Update",
"description": "BSManager will automatically update when you launch the application.",
"error-notification": {
"message": "An error occurred, unable to change auto update settings."
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "obsoleto"
"outdated": "obsoleto",
"update-text": "¡BSManager {version} está disponible!",
"update-button": "Actualizar y reiniciar",
"see-changelog": "Ver los cambios"
},
"nav-bar": {
"add-version": "Agregar una versión",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "Duración",
"likes": "Me gusta",
"date-uploaded": "Fecha de subida"
"date-uploaded": "Fecha de subida",
"added-date": "Fecha de adición"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "Esta versión tiene {nb} mods desactualizados. ¿Quieres actualizarlos?",
"dont-remind-me": "No me lo recuerdes",
"update": "Actualizar"
},
"third-party-mod-source-not-avaliable": {
"description": "La fuente de datos de terceros \"{name}\" no está disponible. Vuelve a BeatMods en la configuración e inténtalo de nuevo."
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "Fuente del módulo",
"description": "Elija una fuente distinta a BeatMods.",
"website": "sitio web"
},
"patreon": {
"title": "Apoya BSManager 💖",
"description": "Apoya el proyecto y ayúdanos a proporcionar mejoras continuas a BSManager.",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "Ocurrió un error, no se pueden cambiar los ajustes del proxy del sistema."
}
},
"auto-update": {
"title": "Actualización automática",
"description": "BSManager se actualizará automáticamente al iniciar la aplicación.",
"error-notification": {
"message": "Ocurrió un error, no se pudo cambiar la configuración de actualización automática."
}
}
}
}
+119 -100
View File
@@ -33,11 +33,14 @@
},
"generic": {
"env": {
"parse": "Impossible d'analyser correctement la chaîne de variable d'environnement."
"parse": "Impossible de lire les variables d'environnement."
}
},
"title-bar": {
"outdated": "obsolète"
"outdated": "obsolète",
"update-text": "BSManager {version} est disponible!",
"update-button": "Mettre à jour et redémarrer",
"see-changelog": "Voir les changements"
},
"nav-bar": {
"add-version": "Ajouter une version",
@@ -51,23 +54,23 @@
"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.",
"oculus-description": "Si vous utilisez Beat Saber via Steam, cela permet d'utiliser l'environnement Oculus sans passer par SteamVR, pour un gain en performances potentiel. Ceci n'est pas obligatoire pour utiliser les casques Oculus.",
"desktop": "Mode FPFC",
"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!",
"desktop-description": "Ce mode vous permet d'utiliser votre clavier (WASD) et votre souris pour naviguer en jeu. Cela rend les tests beaucoup plus faciles, car vous n'avez pas à mettre de casque VR !",
"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.",
"outdated-tippy": "Cette version est obsolète et certains mods ou fonctionnalités peuvent ne plus fonctionner comme prévu. Préférez utiliser la version recommandée ({recommendedVersion}) de Beat Saber pour profiter des dernières fonctionnalités et correctifs.",
"advanced-launch": {
"button": "Options de lancement",
"placeholder": "Options de lancement ex: KEY=VALUE %command% fpfc",
"placeholder": "Options de lancement. Exemple : KEY=VALUE %command% fpfc",
"create-launch-option": "Créer une option de lancement"
},
"skipsteam": "Ignorer Steam",
"skipsteam-description": "Empêche Steam de s'ouvrir automatiquement avec Beat Saber, activez-le si vous utilisez un autre runtime VR comme WiVRn ou Monado avec lequel SteamVR pourrait interférer.",
"skipsteam-description": "Empêche Steam de s'ouvrir automatiquement avec Beat Saber, activez-le si vous utilisez un autre environnement VR comme WiVRn ou Monado avec lequel SteamVR pourrait interférer.",
"map-editor": "Éditeur de map",
"map-editor-description": "Lance l'éditeur officiel de map de Beat Saber au lieu du jeu.",
"proton-logs": "Journaux de Proton",
"proton-logs-description": "Active l'enregistrement des journaux Proton pour cette installation de Beat Saber sur \"{versionPath}\"."
"proton-logs": "Logs de Proton",
"proton-logs-description": "Active l'enregistrement des logs Proton pour cette installation de Beat Saber sur \"{versionPath}\"."
},
"maps": {
"search-bar": {
@@ -104,11 +107,12 @@
"sort": {
"name": "Nom",
"song-author": "Auteur de la chanson",
"map-author": "Auteur de la carte",
"map-author": "Auteur de la map",
"bpm": "BPM",
"duration": "Durée",
"likes": "J'aime",
"date-uploaded": "Date de téléchargement"
"date-uploaded": "Date de publication",
"added-date": "Date d'ajout"
}
},
"playlists": {
@@ -124,7 +128,7 @@
"sort": {
"title": "Titre",
"author": "Auteur",
"number-of-maps": "Nombre de cartes",
"number-of-maps": "Nombre de maps",
"duration": "Durée",
"notes-per-second": "NPS"
}
@@ -136,8 +140,8 @@
"no-internet": "Pas d'accès Internet",
"mods-not-available": "Aucun mod n'est encore disponible pour cette version de Beat Saber",
"status": {
"no-wineprefix": "Impossible de trouver le chemin WINEPREFIX de BSManager. Veuillez d'abord lancer Beat Saber dans BSManager.",
"beatmods-down": "Beatmods est actuellement inaccessible. Veuillez réessayer plus tard. Si le problème persiste, informez-nous sur {links}.",
"no-wineprefix": "Impossible de trouver le chemin WINEPREFIX de BSManager. Veuillez d'abord lancer Beat Saber depuis BSManager.",
"beatmods-down": "BeatMods est actuellement inaccessible. Veuillez réessayer plus tard. Si le problème persiste, informez-nous sur {links}.",
"unknown": "Une erreur inconnue s'est produite ¯\\_(ツ)_/¯"
},
"buttons": {
@@ -149,8 +153,8 @@
"header-bar": {
"name": "Nom",
"size": "Taille",
"installed": "Installé",
"latest": "Récent",
"installed": "Installée",
"latest": "Dernière",
"description": "Description",
"dropdown": {
"import-mods": "Importer des mods",
@@ -165,8 +169,8 @@
},
"notifications": {
"all-mods-already-installed": {
"title": "Mods déjà installées",
"description": "Tous les mods séléctionnées sont déjà installées"
"title": "Mods déjà installés",
"description": "Tous les mods sélectionnés sont déjà installés"
},
"outdated-mods": {
"title": "Mod obsolète",
@@ -175,6 +179,9 @@
"description-plural": "Cette version contient {nb} mods obsolètes. Voulez-vous les mettre à jour ?",
"dont-remind-me": "Ne plus me rappeler",
"update": "Mettre à jour"
},
"third-party-mod-source-not-avaliable": {
"description": "La source de données tierce « {name} » est indisponible. Veuillez revenir à Beatmods dans les paramètres et réessayer."
}
},
"drop-zone": {
@@ -206,17 +213,17 @@
"steam-and-oculus": {
"title": "Steam & Oculus",
"description": "Te déconnecter te permettra de changer de compte au prochain téléchargement de Beat Saber.",
"logout": "Déconnexion",
"logout": "Se déconnecter",
"logout-success": "Déconnexion réussie",
"download-platform": {
"title": "Plateforme par défaut",
"desc": "Choisi la plateforme par défaut qui sera utilisée pour télécharger les versions de Beat Saber.",
"desc": "Choisissez la plateforme par défaut qui sera utilisée pour télécharger les versions de Beat Saber.",
"always-ask": "Toujours demander"
}
},
"appearance": {
"title": "Apparence",
"description": "Choisis les deux couleurs principales de BSManager.",
"description": "Choisissez les deux couleurs principales de BSManager.",
"reset": "Réinitialiser",
"sub-title": "Thème",
"themes": {
@@ -227,7 +234,7 @@
},
"installation-folder": {
"title": "Dossier d'installation",
"description": "Changer le dossier qui contiendra tout le contenu téléchargé par BSManager."
"description": "Changez le dossier qui contiendra tout le contenu téléchargé par BSManager."
},
"proton-folder": {
"title": "Dossier Proton",
@@ -245,8 +252,8 @@
}
},
"language": {
"title": "Langage",
"description": "Sélectionne un langage.",
"title": "Langue",
"description": "Sélectionnez une langue.",
"languages": {
"en-EN": "English, UK",
"en-US": "English, US",
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "Source du module",
"description": "Choisissez une autre source que BeatMods.",
"website": "site web"
},
"patreon": {
"title": "Soutenir BSManager 💖",
"description": "Soutiens le projet et aide-nous à fournir des améliorations continues à BSManager.",
@@ -309,7 +321,7 @@
"description": "Paramètres avancés pour BSManager.",
"hardware-acceleration": {
"title": "Accélération matérielle",
"description": "Activez l'accélération matérielle pour utiliser votre GPU et améliorer les performances de BSManager. Désactivez cette option si vous rencontrez des chutes d'IPS.",
"description": "Activez l'accélération matérielle pour utiliser votre carte graphique et améliorer les performances de BSManager. Désactivez cette option si vous rencontrez des problèmes de performance.",
"modal": {
"title": "Redémarrage nécessaire",
"body": "Changer le paramètre d'accélération matérielle va quitter et relancer BSManager. Êtes-vous sûr de vouloir continuer ?",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "Une erreur est survenue, impossible de modifier les paramètres du proxy système."
}
},
"auto-update": {
"title": "Mise à jour automatique",
"description": "BSManager se mettra automatiquement à jour au lancement de l'application.",
"error-notification": {
"message": "Une erreur est survenue, impossible de modifier les paramètres de mise à jour automatique."
}
}
}
}
@@ -360,8 +379,8 @@
"file-not-supported": "Fichier non supporté"
},
"msg": {
"operation-running": "Attends la fin de l'opération en cours puis recommence.",
"no-internet": "Vérifie ta connexion internet et ressaye.",
"operation-running": "Veuillez attendre la fin de l'opération en cours puis recommencez.",
"no-internet": "Vérifiez votre connexion Internet et réessayez.",
"file-not-supported": "Seuls les fichiers {types} sont pris en charge."
}
}
@@ -377,9 +396,9 @@
"warnings": {
"msg": {
"ManifestChecksum": "Le manifeste précédemment téléchargé ne correspond pas au nouveau 🤔",
"ConnectionTimeout": "Ta connexion internet semble instable 🥶",
"ConnectionLost": "La connexion a été perdue, essayez à nouveau...",
"ConnectionError": "Impossible de se connecter à Steam, essayez à nouveau...",
"ConnectionTimeout": "Votre connexion internet semble instable 🥶",
"ConnectionLost": "La connexion a été perdue, essayez...",
"ConnectionError": "Impossible de se connecter à Steam, essayez...",
"Unknown": "Quelque chose d'étrange s'est produit 🤔 Votre connexion est probablement instable."
}
},
@@ -387,26 +406,26 @@
"msg": {
"401": "Steam ne semble pas vouloir nous laisser télécharger Beat Saber 😢",
"404": "Impossible de contacter les serveurs de Steam.",
"ExeNotFoundWindows": "\"DepotDownloader.exe\" est manquant. Veuillez vérifier si l'exécutable est mis en quarantaine par votre antivirus.",
"ExeNotFoundLinux": "L'exécutable \"DepotDownloader\" est manquanto.",
"ExeNotFoundWindows": "\"DepotDownloader.exe\" est manquant. Vérifiez que votre antivirus n'a pas mis le fichier en quarantaine.",
"ExeNotFoundLinux": "L'exécutable \"DepotDownloader\" est manquant.",
"Password": "Le mot de passe est invalide.",
"InvalidCredentials": "Identifiants de connexion invalides, connexion non approuvée, ou trop de tentatives de connexion.",
"NoManifest": "Aucun manifest n'a été trouvé.",
"NoManifest": "Aucun manifeste n'a été trouvé.",
"DirectoryCreate": "Impossible d'installer les dossiers nécessaires.",
"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 😕",
"DepotNotFound": "Impossible de télécharger Beat Saber 😥 réessayez plus tard 😕",
"NotCompleted": "Le téléchargement n'a pas pu se terminer ¯\\_(ツ)_/¯",
"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 😕",
"InvalidManifest": "Impossible de télécharger Beat Saber 😥 réessayez plus tard 😕",
"NoValidKey": "Impossible de télécharger Beat Saber 😥 réessayez plus tard 😕",
"NoManifestCode": "Impossible de télécharger Beat Saber 😥 réessayez 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 Beat Saber 🥱",
"ConnectionTimeout": "Impossible de se connecter à Steam 😕",
"SteamLib": "Si tu as cette erreur, signale le bug sur GitHub avec les logs stp.",
"SteamLib": "Si tu vois cette erreur, signale le bug sur GitHub avec les logs de BSManager.",
"ConnectionError": "Impossible de se connecter à Steam après 10 essais 🤯",
"LicenceError": "Impossible d'obtenir la liste des licences.",
"RateLimitExceeded": "Tu as essayé trop de fois attends un peu et recommence plus tard.",
"RateLimitExceeded": "Tu as essayé trop de fois, attends un peu et réessaye plus tard.",
"TokenRejected": "Votre token de connexion a été rejeté 😕 Veuillez réessayer.",
"AccessDenied": "L'accès à Steam a été refusé."
}
@@ -415,14 +434,14 @@
"oculus-download": {
"errors": {
"msg": {
"DOWNLOAD_MANIFEST_FAILED": "Impossible de télécharger le manifest de cette version. Votre token de connexion est peut-être invalide, ou vous ne possédez pas la version PC de Beat Saber.",
"MANIFEST_FILE_NOT_FOUND": "Impossible de trouver le manifest de cette version.",
"PARSE_MANIFEST_FILE_FAILED": "Une erreur c'est produite lors de la lecture du manifest.",
"DOWNLOAD_MANIFEST_FAILED": "Impossible de télécharger le manifeste de cette version. Votre token de connexion est peut-être invalide, ou vous ne possédez pas la version PC de Beat Saber.",
"MANIFEST_FILE_NOT_FOUND": "Impossible de trouver le manifeste de cette version.",
"PARSE_MANIFEST_FILE_FAILED": "Une erreur s'est produite lors de la lecture du manifeste.",
"ALREADY_DOWNLOADING": "Une version est déjà en cours de téléchargement.",
"UNABLE_TO_GET_MANIFEST": "Impossible d'obtenir le manifest nécessaire au téléchargement. Votre token de connexion est peut-être invalide, ou vous ne possédez pas la version PC de Beat Saber.",
"VERIFY_INTEGRITY_FAILED": "Une erreur c'est produite lors de la vérification des fichiers.",
"UNABLE_TO_GET_MANIFEST": "Impossible d'obtenir le manifeste nécessaire au téléchargement. Votre token de connexion est peut-être invalide, ou vous ne possédez pas la version PC de Beat Saber.",
"VERIFY_INTEGRITY_FAILED": "Une erreur s'est produite lors de la vérification des fichiers.",
"SOME_FILES_FAILED_TO_DOWNLOAD": "Certains fichiers n'ont pas pu être téléchargés.",
"META_LOGIN_TIMED_OUT": "Le Token de connexion à mis trop de temps à être récupéré.",
"META_LOGIN_TIMED_OUT": "Le token de connexion à mis trop de temps à être récupéré.",
"META_LOGIN_WINDOW_CLOSED_BY_USER": "La fenêtre de connexion à Meta a été fermée.",
"NO_META_AUTH_TOKEN": "Impossible de récupérer le token de connexion à Meta nécessaire au téléchargement.",
"UNKNOWN_ERROR": "Une erreur inconnue s'est produite."
@@ -445,7 +464,7 @@
},
"errors": {
"import-error": {
"desc": "Vérifier que le dossier sélectionné est une installation de Beat Saber."
"desc": "Vérifie que le dossier sélectionné est une installation de Beat Saber."
}
}
},
@@ -499,7 +518,7 @@
}
},
"check-all-enabled": {
"title": "OneClick désactivée(s)",
"title": "OneClick désactivé",
"description": "Une ou plusieurs installations OneClick sont désactivées. Rendez-vous dans les paramètres pour les activer.",
"actions": {
"settings": "Paramètres",
@@ -514,12 +533,12 @@
"titles": {
"BS_LAUNCHING": "Lancement...🚀",
"STEAM_LAUNCHING": "Steam se lance !",
"SKIPPING_STEAM_LAUNCH": "Sauter le lancement de Steam"
"SKIPPING_STEAM_LAUNCH": "Contourner le lancement de Steam"
},
"msg": {
"BS_LAUNCHING": "N'oublie pas de t'échauffer 😉",
"STEAM_LAUNCHING": "Beat Saber se lancera automatiquement après Steam.",
"SKIPPING_STEAM_LAUNCH": "J'espère que vous savez ce que vous faites :)"
"SKIPPING_STEAM_LAUNCH": "J'espère que tu sais ce que tu fais :)"
}
},
"errors": {
@@ -568,7 +587,7 @@
"UnknownError": "Une erreur inconnue s'est produite"
},
"msg": {
"CantEditSteam": "Tu ne peux pas modifier la version Steam, cependant tu peux la cloner."
"CantEditSteam": "Vous ne pouvez pas modifier la version Steam, vous pouvez cependant la cloner."
}
},
"success": {
@@ -632,8 +651,8 @@
"error": "Une erreur s'est produite lors de l'installation de la map"
},
"no-duplicates-maps": {
"title": "Pas de doublons",
"msg": "Aucune carte n'a été supprimée"
"title": "Aucun doublon",
"msg": "Aucune map n'a été supprimée"
},
"duplicates-maps-deleted": {
"title": "Doublons supprimés",
@@ -669,7 +688,7 @@
"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"
"msg": "Le partage du dossier 'UserData' peut générer des erreurs. En cas de soucis, déliez le dossier pour restaurer la sauvegarde"
}
},
"linking-error": {
@@ -701,7 +720,7 @@
"title": "Version obsolète",
"msg": "Cette version de Beat Saber est obsolète. Utilisez la version recommandée pour profiter des dernières fonctionnalités et correctifs.",
"actions": {
"do-not-remind": "Ne plus me rappeler",
"do-not-remind": "Ne plus me le rappeler",
"ok": "Ok"
}
},
@@ -754,7 +773,7 @@
"note": {
"use-the": "Utilisez l'",
"steam-mobile-app": "application mobile Steam",
"to-connect-with-qr": "pour vous connecter avec un QR code."
"to-connect-with-qr": "pour vous connecter avec un code QR."
}
},
"stay": "Se souvenir de moi"
@@ -774,20 +793,20 @@
"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)."
"p-2": "puis cliquez sur l'icône de l'engrenage dans le coin supérieur droit et sélectionnez \"Importer une version\", vous pouvez ensuite sélectionner 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 Beat Saber pour profiter des fonctionnalités de BSManager. L'importation copiera le dossier d'installation de Beat Saber sélectionné dans le dossier de versions de BSManager.",
"oculus-version": "Version Oculus",
"oculus-version-tooltip": "Cocher si c'est une version Oculus",
"oculus-version-tooltip": "Cochez si l'installation provient du magasin Oculus",
"buttons": {
"submit": "Importer une version"
}
},
"bs-uninstall": {
"title": "Désinstaller",
"description": "Es-tu sûr de vouloir désinstaller Beat Saber {version} ? Tu vas devoir la retélécharger pour y jouer.",
"description": "Êtes-vous sûr de vouloir désinstaller Beat Saber {version} ? Vous allez devoir la retélécharger pour y jouer.",
"buttons": {
"submit": "Désinstaller"
}
@@ -823,12 +842,12 @@
},
"uninstall-mod": {
"title": "Désinstaller",
"description": "Es-tu sûr de vouloir désinstaller {mod} ? Cela pourrait faire dysfonctionner d'autres mods installés.",
"description-bsipa": "Es-tu sûr de vouloir désinstaller BSIPA ? Après cela, tous les mods installés ne fonctionneront plus."
"description": "Êtes-vous sûr de vouloir désinstaller {mod} ? Cela pourrait faire dysfonctionner d'autres mods installés.",
"description-bsipa": "Êtes-vous sûr de vouloir désinstaller BSIPA ? Après cela, tous les mods installés ne fonctionneront plus."
},
"uninstall-all-mods": {
"title": "Désinstaller les mods",
"description": "Es-tu sûr de vouloir désinstaller tous les mods de la version {version} ? Cette opération ne pourra pas être annulée."
"description": "Êtes-vous sûr de vouloir désinstaller tous les mods de la version {version} ? Cette opération ne pourra pas être annulée."
},
"maps-actions": {
"delete-maps": {
@@ -837,8 +856,8 @@
"multiple": "Supprimer les maps ?"
},
"desc": {
"single": "Es-tu sur de vouloir supprimer la map {name} ?",
"multiple": "Es-tu sur de vouloir supprimer {nb} maps ?"
"single": "Êtes-vous sûr de vouloir supprimer la map {name} ?",
"multiple": "Êtes-vous sûr de vouloir supprimer {nb} maps ?"
},
"info": {
"desc": {
@@ -853,8 +872,8 @@
},
"delete-duplicate-maps": {
"title": "Supprimer les maps ?",
"desc": "Seule la map \"{map}\" est en double. Es-tu sûr de vouloir la supprimer ?",
"desc-plural": "{nb} maps en double ont été trouvées. Es-tu sûr de vouloir les supprimer ?"
"desc": "Seule la map \"{map}\" est un doublon. Êtes-vous sûr de vouloir la supprimer ?",
"desc-plural": "{nb} maps en double ont été trouvées. Êtes-vous sûr de vouloir les supprimer ?"
}
},
"link-contents": {
@@ -878,7 +897,7 @@
"search-btn": "Rechercher",
"loading-maps": "Chargement des maps...",
"no-maps-found": "Aucune map trouvée",
"no-internet": "Pas d'internet"
"no-internet": "Pas d'accès Internet"
},
"mods-disclaimer": {
"title": "avis de non-responsabilité",
@@ -941,7 +960,7 @@
"token-is-invalid": "Le Token est invalide.",
"save-my-token": "Sauvegarder mon token",
"have-token-saved": "J'ai déjà un token sauvegardé",
"save-token-info": "Ceci enregistrera votre token pour le réutiliser plus facilement. Vous devrez créer un mot de passe pour crypter votre token à des fins de stockage. Si jamais vous oubliez votre mot de passe, il vous suffit de fournir à nouveau votre token.",
"save-token-info": "Ceci enregistrera votre token pour le réutiliser plus facilement. Vous devrez créer un mot de passe pour chiffrer votre token à des fins de stockage. Si jamais vous oubliez votre mot de passe, il vous suffira de fournir à nouveau votre token.",
"password": "Mot de passe",
"password-too-short": "Mot de passe trop court",
"info-enter-password": "Pour télécharger Beat Saber, votre token de connexion à Oculus est nécessaire. Entrez le mot de passe utilisé pour sauvegarder votre token Oculus.",
@@ -962,7 +981,7 @@
},
"ask-install-path": {
"title": "Dossier d'installation",
"choose-folder-description": "Choisissez le dossier qui contiendra tout le contenu téléchargé par BSManager. (versions, mods, cartes, playlists, etc.)",
"choose-folder-description": "Choisissez le dossier qui contiendra tout le contenu téléchargé par BSManager. (versions, mods, maps, playlists, etc.)",
"default": "Par défaut",
"default-tooltip": "Par défaut, dans votre dossier personnel"
},
@@ -987,13 +1006,13 @@
"maps": {
"map-filter-panel": {
"duration": "Durée",
"nps": "Notes Par Seconde",
"nps": "Notes par seconde",
"njs": "Vitesse de saut des notes",
"tags": "tags",
"specificities": "général",
"requirements": "requis",
"exclude": "exclure",
"leaderboard": "tableau des leaders"
"leaderboard": "classement"
},
"map-types": {
"accuracy": "précision",
@@ -1046,11 +1065,11 @@
"automapper": "IA",
"curated": "recommandée",
"verified": "vérifiée",
"fullSpread": "panel complet"
"fullSpread": "toutes difficultés"
},
"map-leaderboard": {
"All": "Tout",
"Ranked": "Classée",
"Ranked": "Classé",
"BeatLeader": "BeatLeader",
"ScoreSaber": "ScoreSaber"
},
@@ -1068,10 +1087,10 @@
"by": "Par {songAutor}",
"mapped-by": "mappée par",
"delete": "Supprimer",
"preview": "Aperçu de la carte",
"preview": "Aperçu de la map",
"bsr-code": "Code BSR",
"download": "Télécharger la carte",
"downloading": "Téléchargement de la carte",
"download": "Télécharger la map",
"downloading": "Téléchargement de la map",
"cancel-download": "Annuler le téléchargement",
"hightlight-difficulty": "Surligner la difficulté"
}
@@ -1115,12 +1134,12 @@
"modals": {
"delete-model": {
"title": "Supprimer le modèle",
"desc": "Es-tu sûr de vouloir supprimer le modèle {modelName} ?",
"desc": "Êtes-vous 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": "Es-tu sûr de vouloir supprimer {nb} modèles ?",
"desc": "Êtes-vous sûr de vouloir supprimer {nb} modèles ?",
"linked-annotation": "Ces modèles seront supprimés de toutes les versions liées."
},
"download-models": {
@@ -1136,11 +1155,11 @@
"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)"
"status-desc": "Afficher seulement les modèles avec le statut spécifié. (profil seulement, et seulement pour l'auteur)"
},
"no-models": "Aucun modèles trouvés.",
"no-models": "Aucun modèle trouvé.",
"no-internet": "Pas de connexion internet.",
"error-occured": "Une erreur est survenue, réessaye plus tard."
"error-occured": "Une erreur est survenue, réessayez plus tard."
}
},
"notifications": {
@@ -1151,16 +1170,16 @@
"not-remind": "Ne plus me rappeler"
},
"export-success": {
"title": "Export terminé 🎉"
"title": "Exportation terminée 🎉"
}
}
},
"beat-saver": {
"maps-sorts": {
"Latest": "Dernière",
"Latest": "Récent",
"Relevance": "Pertinence",
"Rating": "Notes",
"Curated": "Recommandée"
"Rating": "Évaluation",
"Curated": "Recommandé"
}
},
"auto-update": {
@@ -1188,7 +1207,7 @@
"error-playlist-creation-title": "Erreur lors de la création de la playlist",
"error-playlist-creation-desc": "Une erreur est survenue lors de la création de la playlist.",
"playlist-created-title": "Playlist créée",
"playlist-created-desc": "La playlist a été créée avec succès. Tu peut maintenant synchroniser ses maps !",
"playlist-created-desc": "La playlist a été créée avec succès. Vous pouvez maintenant synchroniser ses maps !",
"download-playlist": "Télécharger la playlist",
"synchronize-playlist": "Synchroniser la playlist",
"synchronize-maps": "Synchroniser les maps",
@@ -1209,8 +1228,8 @@
"playlist-edit-error-title": "Erreur lors de l'édition de la playlist",
"playlist-edit-error-desc": "Une erreur est survenue lors de l'édition de la playlist.",
"playlist-edited-title": "Playlist éditée !",
"playlist-edited-desc": "La playlist a été modifiée avec succès. Tu peut maintenant synchroniser ses maps !",
"playlists-loading": "Chargement des playlist...",
"playlist-edited-desc": "La playlist a été modifiée avec succès. Vous pouvez maintenant synchroniser ses maps !",
"playlists-loading": "Chargement des playlists...",
"no-playlists": "Aucune playlist",
"download-playlists": "Télécharger des playlists",
"created-by": "Créée par",
@@ -1219,15 +1238,15 @@
"open-file": "Ouvrir le fichier",
"delete-playlist-ask": "Supprimer la playlist ?",
"delete-playlists-ask": "Supprimer les playlists ?",
"delete-playlist-desc": "Es-tu sur de vouloir supprimer la playlist \"{playlistTitle}\" ?",
"delete-playlists-desc": "Es-tu sur de vouloir supprimer {nb} playlists ?",
"delete-playlist-desc": "Êtes-vous sûr de vouloir supprimer la playlist \"{playlistTitle}\" ?",
"delete-playlists-desc": "Êtes-vous sûr de vouloir supprimer {nb} playlists ?",
"delete-maps": "Supprimer les maps",
"delete-playlist-maps-tip": "Si activé, toutes les maps de la playlist seront supprimées",
"delete-playlists-maps-tip": "Si activé, toutes les maps des playlists seront supprimées",
"export-playlist-ask": "Exporter la playlist ?",
"export-playlists-ask": "Exporter les playlists ?",
"export-playlist-desc": "Es-tu sur de vouloir exporter la playlist \"{playlistTitle}\" ?",
"export-playlists-desc": "Es-tu sur de vouloir exporter les {nb} playlists ?",
"export-playlist-desc": "Êtes-vous sûr de vouloir exporter la playlist \"{playlistTitle}\" ?",
"export-playlists-desc": "Êtes-vous sûr de vouloir exporter {nb} playlists ?",
"export-maps": "Exporter les maps",
"export-playlist-maps-tip": "Si activé, toutes les maps de la playlist seront également exportées",
"export-playlists-maps-tip": "Si activé, toutes les maps des playlists seront également exportées",
@@ -1239,15 +1258,15 @@
"understood": "J'ai compris",
"synchronize-playlist-ask": "Synchroniser la playlist ?",
"synchronize-playlists-ask": "Synchroniser les playlists ?",
"synchronize-playlist-desc": "Es-tu sur de vouloir synchroniser la playlist \"{playlistTitle}\" ?",
"synchronize-playlists-desc": "Es-tu sur de vouloir synchroniser les {nb} playlists ?",
"synchronize-playlist-desc": "Êtes-vous sûr de vouloir synchroniser la playlist \"{playlistTitle}\" ?",
"synchronize-playlists-desc": "Êtes-vous sûr de vouloir synchroniser {nb} playlists ?",
"synchronize-playlist-tip": "Cette action met à jour les playlists et télécharge les maps manquantes; cela peut durer plusieurs minutes.",
"synchronize": "Synchroniser",
"curated": "Recommandée",
"verified-mapper": "Mapper vérifié",
"empty-playlists": "Playlists vides",
"search-playlist": "Rechercher une playlist",
"no-playlists-found": "Aucune playlists trouvées",
"no-playlists-found": "Aucune playlist trouvée",
"error-occur-while-loading-playlists": "Une erreur est survenue lors du chargement des playlists",
"error-occur-while-loading-playlist": "Une erreur est survenue lors du chargement de la playlist",
"loading-maps": "Chargement des maps...",
@@ -1274,7 +1293,7 @@
"loading": "Chargement...",
"installed": "Installée",
"no-map-found": "Aucune map trouvée",
"edit-playlist-shortcuts": "Maintenez Maj ou Ctrl pour sélectionner plusieurs maps",
"edit-playlist-shortcuts": "Maintenir Maj ou Ctrl pour sélectionner plusieurs maps",
"add-to-playlist": "Ajouter à la playlist",
"remove-from-playlist": "Retirer de la playlist",
"playlist-is-empty": "La playlist est vide",
@@ -1284,7 +1303,7 @@
"duration": "Durée",
"nps": "Notes par secondes",
"date-picker": {
"start-date-end-date": "Date début — Date fin",
"start-date-end-date": "Date de début — Date de fin",
"all": "Tout",
"last-24h": "Dernières 24h",
"last-week": "Dernière semaine",
@@ -1295,18 +1314,18 @@
"all-playlists-have-been-successfully-imported": "Toutes les playlists ont été importées avec succès",
"no-playlist-found": "Aucune playlist trouvée",
"no-playlist-found-in-selected-files": "Aucune playlist trouvée dans les fichiers sélectionnés",
"some-playlists-not-imported": "Certaines playlists non importées",
"some-playlists-not-imported": "Certaines playlists n'ont pas été importées",
"some-playlists-have-been-imported": {
"INVALID_SOURCE": "Certaines playlists n'ont pas pu être trouvées",
"INVALID_PLAYLIST_FILE": "Certaines playlists ne sont pas valides",
"CANNOT_PARSE_PLAYLIST": "Certaines playlists ne sont pas lisibles",
"INVALID_PLAYLIST_FILE": "Certaines playlists sont invalides",
"CANNOT_PARSE_PLAYLIST": "Certaines playlists sont illisibles",
"unknown": "Certaines playlists n'ont pas pu être importées"
},
"no-playlists-imported": "Aucune playlist importée",
"no-playlists-imported-errors": {
"INVALID_SOURCE": "Les playlists n'ont pas été trouvées",
"INVALID_PLAYLIST_FILE": "Les playlists ne sont pas valides",
"CANNOT_PARSE_PLAYLIST": "Les playlists ne sont pas lisibles",
"INVALID_PLAYLIST_FILE": "Les playlists sont invalides",
"CANNOT_PARSE_PLAYLIST": "Les playlists sont illisibles",
"unknown": "Aucune playlist n'a pu être importée"
}
},
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "obsoleta"
"outdated": "obsoleta",
"update-text": "BSManager {version} è disponibile!",
"update-button": "Aggiorna e riavvia",
"see-changelog": "Vedi i cambiamenti"
},
"nav-bar": {
"add-version": "Aggiungi una versione",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "Durata",
"likes": "Mi piace",
"date-uploaded": "Data di caricamento"
"date-uploaded": "Data di caricamento",
"added-date": "Data di aggiunta"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "Questa versione ha {nb} mod obsoleti. Vuoi aggiornarli?",
"dont-remind-me": "Non ricordarmelo",
"update": "Aggiorna"
},
"third-party-mod-source-not-avaliable": {
"description": "La fonte dati di terze parti \"{name}\" non è disponibile. Torna a BeatMods nelle impostazioni e riprova."
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "Sorgente del modulo",
"description": "Scegli una fonte diversa da BeatMods.",
"website": "sito web"
},
"patreon": {
"title": "Sostieni BSManager 💖",
"description": "Supporta il progetto e aiutaci a provvedere continui miglioramenti a BSManager.",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "C'è stato un errore, impossibile cambiare le impostazioni del proxy di sistema."
}
},
"auto-update": {
"title": "Aggiornamento automatico",
"description": "BSManager si aggiornerà automaticamente all'avvio dell'applicazione.",
"error-notification": {
"message": "Si è verificato un errore, impossibile modificare le impostazioni di aggiornamento automatico."
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "時代遅れ"
"outdated": "時代遅れ",
"update-text": "BSManager {version} が利用可能です!",
"update-button": "更新して再起動",
"see-changelog": "変更点を確認"
},
"nav-bar": {
"add-version": "バージョンを追加",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "持続時間",
"likes": "いいね",
"date-uploaded": "アップロード日"
"date-uploaded": "アップロード日",
"added-date": "追加日"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "このバージョンには古いModが{nb}個あります。更新しますか?",
"dont-remind-me": "もう知らせない",
"update": "更新する"
},
"third-party-mod-source-not-avaliable": {
"description": "サードパーティのデータソース「{name}」は利用できません。設定でBeatModsに切り替えて、もう一度お試しください。"
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "モジュールソース",
"description": "BeatMods以外のソースを選択してください。",
"website": "Webサイト"
},
"patreon": {
"title": "BSManagerをサポートする 💖",
"description": "プロジェクトをサポートし、BSManagerの継続的な応援にご協力ください!",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "エラーが発生しました。システムプロキシ設定を変更できません。"
}
},
"auto-update": {
"title": "自動更新",
"description": "アプリケーション起動時にBSManagerが自動的に更新されます。",
"error-notification": {
"message": "エラーが発生し、自動更新の設定を変更できませんでした。"
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "구식"
"outdated": "구식",
"update-text": "BSManager {version} 가 사용 가능합니다!",
"update-button": "업데이트 후 재시작",
"see-changelog": "변경 사항 보기"
},
"nav-bar": {
"add-version": "버전 추가",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "지속 시간",
"likes": "좋아요",
"date-uploaded": "업로드 날짜"
"date-uploaded": "업로드 날짜",
"added-date": "추가 날짜"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "이 버전에는 {nb}개의 구식 모드가 있습니다. 업데이트하시겠습니까?",
"dont-remind-me": "다시는 알리지 않기",
"update": "업데이트"
},
"third-party-mod-source-not-avaliable": {
"description": "타사 데이터 소스 \"{name}\"을 사용할 수 없습니다. 설정에서 BeatMods로 다시 전환한 후 다시 시도해 주세요."
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "모듈 소스",
"description": "BeatMods 이외의 소스를 선택하세요.",
"website": "웹사이트"
},
"patreon": {
"title": "BSManager를 지원하기 💖",
"description": "프로젝트를 지원하고 BSManager의 지속적인 응원을 부탁드립니다!",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "오류가 발생했습니다. 시스템 프록시 설정을 변경할 수 없습니다."
}
},
"auto-update": {
"title": "자동 업데이트",
"description": "애플리케이션을 실행할 때 BSManager가 자동으로 업데이트됩니다.",
"error-notification": {
"message": "오류가 발생하여 자동 업데이트 설정을 변경할 수 없습니다."
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "Desatualizado"
"outdated": "Desatualizado",
"update-text": "BSManager {version} está disponível!",
"update-button": "Atualizar e reiniciar",
"see-changelog": "Ver os changelogs"
},
"nav-bar": {
"add-version": "Adicionar uma versão",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "Duração",
"likes": "Gostei",
"date-uploaded": "Data de envio"
"date-uploaded": "Data de envio",
"added-date": "Data de adição"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "Esta versão possui {nb} mods desatualizados. Deseja atualizá-los?",
"dont-remind-me": "Não me lembre",
"update": "Atualizar"
},
"third-party-mod-source-not-avaliable": {
"description": "A fonte de dados de terceiros \"{name}\" está indisponível. Por favor, volte para BeatMods nas configurações e tente novamente."
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "Fonte do módulo",
"description": "Escolha uma fonte diferente de BeatMods.",
"website": "site"
},
"patreon": {
"title": "Apoie BSManager 💖",
"description": "Apoie o projeto e nos ajude a continuar trazendo melhorias para o BSManager.",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "Um erro aconteceu, não foi possível alterar a configuração de proxy de sistema."
}
},
"auto-update": {
"title": "Atualização automática",
"description": "O BSManager será atualizado automaticamente ao iniciar o aplicativo.",
"error-notification": {
"message": "Ocorreu um erro, não foi possível alterar as configurações de atualização automática."
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "устаревший"
"outdated": "устаревший",
"update-text": "BSManager {version} доступен!",
"update-button": "Обновить и перезапустить",
"see-changelog": "Смотреть изменения"
},
"nav-bar": {
"add-version": "Добавить версию игры",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "Длительность",
"likes": "Лайки",
"date-uploaded": "Дата загрузки"
"date-uploaded": "Дата загрузки",
"added-date": "Дата добавления"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "В этой версии есть {nb} устаревших модов. Хотите их обновить?",
"dont-remind-me": "Не напоминать мне",
"update": "Обновить"
},
"third-party-mod-source-not-avaliable": {
"description": "Сторонний источник данных \"{name}\" недоступен. Пожалуйста, переключитесь обратно на BeatMods в настройках и попробуйте снова."
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "Исходный код модуля",
"description": "Выберите источник, отличный от BeatMods.",
"website": "веб-сайт"
},
"patreon": {
"title": "Поддержи BSManager 💖",
"description": "Поддержи проект, чтобы мы могли дальше улучшать BSManager.",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "Произошла ошибка, не удалось изменить настройки системного прокси."
}
},
"auto-update": {
"title": "Автообновление",
"description": "BSManager будет автоматически обновляться при запуске приложения.",
"error-notification": {
"message": "Произошла ошибка, не удалось изменить настройки автообновления."
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "lipas na"
"outdated": "lipas na",
"update-text": "Ang BSManager {version} ay available!",
"update-button": "I-update at i-restart",
"see-changelog": "Tingnan ang mga pagbabago"
},
"nav-bar": {
"add-version": "Magdagdag ng bersyon",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "Haba",
"likes": "Likes",
"date-uploaded": "Petsa ng Pagka-upload"
"date-uploaded": "Petsa ng Pagka-upload",
"added-date": "Petsa ng Pagdaragdag"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "Ang bersyon na ito ay may {nb} lipas na mga mod. Gusto mo bang i-update ang mga ito?",
"dont-remind-me": "Huwag akong paalalahanan",
"update": "I-update"
},
"third-party-mod-source-not-avaliable": {
"description": "Hindi magagamit ang third-party data source na \"{name}\". Bumalik sa BeatMods sa mga setting at subukang muli."
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "Pinagmulan ng modyul",
"description": "Pumili ng ibang mapagkukunan maliban sa BeatMods.",
"website": "website"
},
"patreon": {
"title": "Supportahan ang BSManager 💖",
"description": "Suportahan ang proyekto at tulungan kami na magbigay ng patuloy na mga pagdagdag ng feature sa BSManager.",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "Nagkaroon ng error, hindi ma-bago ang setting ng system proxy."
}
},
"auto-update": {
"title": "Awtomatikong Pag-update",
"description": "Ang BSManager ay awtomatikong mag-uupdate kapag binuksan mo ang aplikasyon.",
"error-notification": {
"message": "Nagkaroon ng error, hindi mababago ang mga setting ng awtomatikong pag-update."
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "застарілий"
"outdated": "застарілий",
"update-text": "BSManager {version} доступний!",
"update-button": "Оновити та перезапустити",
"see-changelog": "Переглянути зміни"
},
"nav-bar": {
"add-version": "Додати версію",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "Довжина",
"likes": "Лайки",
"date-uploaded": "Дата завантаження"
"date-uploaded": "Дата завантаження",
"added-date": "Дата додавання"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "Ця версія має {nb} застаріл(-ий/-і/-их) мод(-и/-ів). Ви хочете оновити їх?",
"dont-remind-me": "Не нагадувати",
"update": "Оновити"
},
"third-party-mod-source-not-avaliable": {
"description": "Джерело даних стороннього розробника \"{name}\" недоступне. Будь ласка, поверніться до BeatMods у налаштуваннях і спробуйте ще раз."
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "Джерело модуля",
"description": "Виберіть джерело, відмінне від BeatMods.",
"website": "вебсайт"
},
"patreon": {
"title": "Підтримайте BSManager 💖",
"description": "Підтримайте проєкт і допоможіть нам продовжувати вдосконалювати BSManager.",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "Сталася помилка, неможливо змінити налаштування системного проксі."
}
},
"auto-update": {
"title": "Автоматичне оновлення (Avtomatychne onovlennya)",
"description": "BSManager автоматично оновлюватиметься, коли ви запустите програму.",
"error-notification": {
"message": "Сталася помилка, неможливо змінити налаштування автоматичного оновлення."
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "過時"
"outdated": "過時",
"update-text": "BSManager {version} 可用!",
"update-button": "更新並重新啟動",
"see-changelog": "查看變更"
},
"nav-bar": {
"add-version": "新增版本",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "持續時間",
"likes": "喜歡",
"date-uploaded": "上傳日期"
"date-uploaded": "上傳日期",
"added-date": "新增日期"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "此版本有 {nb} 個過時的模組。您想更新它們嗎?",
"dont-remind-me": "不要提醒我",
"update": "更新"
},
"third-party-mod-source-not-avaliable": {
"description": "第三方資料來源「{name}」不可用,請在設定中切換回BeatMods再試。"
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "模組來源",
"description": "選擇一個除BeatMods之外的來源",
"website": "網站"
},
"patreon": {
"title": "支持 BSManager 💖",
"description": "支持該項目並幫助我們持續改進 BSManager。",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "發生錯誤,無法更改系統代理設置。"
}
},
"auto-update": {
"title": "自動更新",
"description": "啟動應用程式時,BSManager 將自動更新。",
"error-notification": {
"message": "發生錯誤,無法更改自動更新設定。"
}
}
}
}
+21 -2
View File
@@ -37,7 +37,10 @@
}
},
"title-bar": {
"outdated": "过时"
"outdated": "过时",
"update-text": "BSManager {version} 可用!",
"update-button": "更新并重新启动",
"see-changelog": "查看变更"
},
"nav-bar": {
"add-version": "添加版本",
@@ -108,7 +111,8 @@
"bpm": "BPM",
"duration": "持续时间",
"likes": "喜欢",
"date-uploaded": "上传日期"
"date-uploaded": "上传日期",
"added-date": "添加日期"
}
},
"playlists": {
@@ -175,6 +179,9 @@
"description-plural": "此版本有 {nb} 个过时的模组。您想更新它们吗?",
"dont-remind-me": "不要提醒我",
"update": "更新"
},
"third-party-mod-source-not-avaliable": {
"description": "第三方数据源“{name}”不可用,请在设置中切换回BeatMods再试。"
}
},
"drop-zone": {
@@ -280,6 +287,11 @@
}
}
},
"mod-repos": {
"title": "模组源",
"description": "选择一个除BeatMods之外的源",
"website": "网站"
},
"patreon": {
"title": "支持 BSManager 💖",
"description": "支持该项目并帮助我们持续改进 BSManager。",
@@ -337,6 +349,13 @@
"error-notification": {
"message": "发生错误,无法启用系统代理。"
}
},
"auto-update": {
"title": "自动更新",
"description": "启动应用程序时,BSManager 将自动更新。",
"error-notification": {
"message": "发生错误,无法更改自动更新设置。"
}
}
}
}
Binary file not shown.
Binary file not shown.
@@ -30,11 +30,12 @@
In the developer tools:
1. Open the __`Network`__ tab.
2. Filter for __`graph`__.
3. Click on the first request that appears.
4. Open the __`Payload`__ tab.
5. Scroll to the bottom to locate your token. It should start with __`FRL`__.
6. Select the token using your mouse and press `Ctrl` + `C` to copy it.
2. Press CTRL+R.
3. Filter for __`graph`__.
4. Click on the first request that appears.
5. Open the __`Payload`__ tab.
6. Scroll to the bottom to locate your token. It should start with __`FRL`__.
7. Select the token using your mouse and press `Ctrl` + `C` to copy it.
<div align="center">
<img src="../wiki/Guides/Login/How-to-obtain-your-Oculus-Token/GetYourOculusToken.png" alt="GetYourOculusToken.png" />
+3 -1
View File
@@ -15,7 +15,9 @@ const config = {
afterSign: ".erb/scripts/notarize.js",
afterPack: ".erb/scripts/after-pack.js",
win: {
signingHashAlgorithms: ["sha256"],
signtoolOptions: {
signingHashAlgorithms: ["sha256"],
},
target: [
"nsis",
"nsis-web"
+2 -1
View File
@@ -12,8 +12,9 @@ const config: Config = {
},
moduleFileExtensions: ["js", "jsx", "ts", "tsx", "json"],
moduleDirectories: ["node_modules", "src"],
testPathIgnorePatterns: ["release/app/dist"],
testPathIgnorePatterns: ["<rootDir>/release/app"],
setupFiles: ["./.erb/scripts/check-build-exists.ts"],
modulePathIgnorePatterns: ["<rootDir>/release/app"]
};
export default config;
+1569 -788
View File
File diff suppressed because it is too large Load Diff
+22 -17
View File
@@ -2,27 +2,28 @@
"name": "bs-manager",
"description": "Manage maps, mods and more for Beat Saber",
"main": "./.erb/dll/main.bundle.dev.js",
"version": "1.5.3-alpha.1",
"version": "1.5.4",
"scripts": {
"build-rust-scripts": "ts-node ./.erb/scripts/build-rust-scripts.js",
"build-rust-scripts": "tsx ./.erb/scripts/build-rust-scripts.js",
"build": "concurrently \"npm run build:main\" \"npm run build:renderer\"",
"build:dll": "cross-env NODE_ENV=development webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts",
"build:main": "cross-env NODE_ENV=production webpack --config ./.erb/configs/webpack.config.main.prod.ts",
"build:renderer": "cross-env NODE_ENV=production webpack --config ./.erb/configs/webpack.config.renderer.prod.ts",
"postinstall": "ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && npm run build:dll",
"postinstall": "tsx .erb/scripts/check-native-dep.js && electron-builder install-app-deps && npm run build:dll",
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir release/app",
"prestart": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.dev.ts",
"lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx",
"package": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never --config electron-builder.config.js && npm run build:dll",
"start": "ts-node ./.erb/scripts/check-port-in-use.js && npm run prestart && npm run start:renderer",
"package": "tsx ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never --config electron-builder.config.js && npm run build:dll",
"start": "tsx ./.erb/scripts/check-port-in-use.js && npm run prestart && npm run start:renderer",
"start:main": "concurrently -k \"cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --watch --config ./.erb/configs/webpack.config.main.dev.ts\" \"electronmon .\"",
"start:preload": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.preload.dev.ts",
"start:renderer": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./.erb/configs/webpack.config.renderer.dev.ts",
"test": "jest",
"test": "jest ./src/__tests__/**/*.test.ts",
"test:unit": "jest ./src/__tests__/unit",
"publish": "npm run build && electron-builder -c.win.certificateSha1=206941d969c4fa8a0e04d9427def361e13b02fd0 --config electron-builder.config.js --publish always --win --x64",
"publish:linux": "npm run build && electron-builder --config electron-builder.config.js --publish never --linux --x64",
"publish:flatpak": "npm run build && env DEBUG='@malept/flatpak-bundler' npx electron-builder --config electron-builder.config.js --publish never --linux flatpak"
"publish:flatpak": "npm run build && env DEBUG='@malept/flatpak-bundler' npx electron-builder --config electron-builder.config.js --publish never --linux flatpak",
"update:patreon": "tsx ./.erb/scripts/update-patreon.js"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
@@ -102,16 +103,16 @@
"autoprefixer": "^10.4.17",
"browserslist-config-erb": "^0.0.3",
"chalk": "^4.1.2",
"concurrently": "^8.2.2",
"concurrently": "^9.2.1",
"core-js": "^3.36.0",
"cross-env": "^7.0.3",
"cross-env": "^10.1.0",
"css-loader": "^6.10.0",
"css-minimizer-webpack-plugin": "^6.0.0",
"detect-port": "^1.5.1",
"electron": "^35.1.4",
"electron-builder": "^25.1.8",
"detect-port": "^2.1.0",
"electron": "39.2.7",
"electron-builder": "^26.0.12",
"electron-devtools-installer": "^4.0.0",
"electronmon": "^2.0.3",
"electronmon": "^2.0.4",
"eslint": "^8.56.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-erb": "^4.1.0",
@@ -144,6 +145,8 @@
"terser-webpack-plugin": "^5.3.10",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsx": "^4.19.2",
"typescript": "^5.3.3",
"url-loader": "^4.1.1",
"webpack": "^5.90.3",
@@ -153,6 +156,7 @@
"webpack-merge": "^5.10.0"
},
"dependencies": {
"@emotion/is-prop-valid": "1.4.0",
"@internationalized/date": "^3.5.4",
"@nextui-org/date-picker": "^2.0.7",
"@nextui-org/react": "^2.3.6",
@@ -170,7 +174,7 @@
"electron-updater": "^6.3.9",
"fast-deep-equal": "^3.1.3",
"format-duration": "^3.0.2",
"framer-motion": "^12.6.3",
"framer-motion": "12.23.26",
"fs-extra": "^11.3.0",
"global-agent": "^3.0.0",
"got": "^14.4.7",
@@ -180,7 +184,7 @@
"node-abi": "^4.2.0",
"node-fetch": "^3.3.2",
"pako": "^2.1.0",
"protobufjs": "^7.4.0",
"protobufjs": "^8.0.0",
"qrcode.react": "^4.2.0",
"query-process": "^0.0.3",
"react": "^18.2.0",
@@ -195,13 +199,14 @@
"rfdc": "^1.4.1",
"rxjs": "^7.8.2",
"sanitize-filename": "^1.6.3",
"semver": "^7.7.1",
"semver": "7.7.3",
"serialize-error": "^12.0.0",
"striptags": "^4.0.0-alpha.4",
"tailwind-merge": "^3.0.2",
"tailwindcss-scoped-groups": "^2.0.0",
"tippy.js": "^6.3.7",
"to-ico": "^1.1.5",
"tough-cookie": "^6.0.0",
"use-double-click": "^1.0.5",
"use-fit-text": "^2.4.0",
"yauzl": "^3.2.0"
@@ -244,6 +249,6 @@
"logLevel": "quiet"
},
"volta": {
"node": "22.14.0"
"node": "24.11.1"
}
}
+334 -12
View File
@@ -1,19 +1,19 @@
{
"name": "bs-manager",
"version": "1.5.3-alpha.1",
"version": "1.5.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bs-manager",
"version": "1.5.3-alpha.1",
"version": "1.5.4",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@resvg/resvg-js": "2.6.2",
"ps-list": "^7.2.0",
"query-process": "^0.0.3",
"regedit-rs": "^1.0.2"
"regedit-rs": "1.0.4"
}
},
"node_modules/@resvg/resvg-js": {
@@ -38,6 +38,118 @@
"@resvg/resvg-js-win32-x64-msvc": "2.6.2"
}
},
"node_modules/@resvg/resvg-js-android-arm-eabi": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-android-arm-eabi/-/resvg-js-android-arm-eabi-2.6.2.tgz",
"integrity": "sha512-FrJibrAk6v29eabIPgcTUMPXiEz8ssrAk7TXxsiZzww9UTQ1Z5KAbFJs+Z0Ez+VZTYgnE5IQJqBcoSiMebtPHA==",
"cpu": [
"arm"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-android-arm64": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-android-arm64/-/resvg-js-android-arm64-2.6.2.tgz",
"integrity": "sha512-VcOKezEhm2VqzXpcIJoITuvUS/fcjIw5NA/w3tjzWyzmvoCdd+QXIqy3FBGulWdClvp4g+IfUemigrkLThSjAQ==",
"cpu": [
"arm64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-darwin-arm64": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-darwin-arm64/-/resvg-js-darwin-arm64-2.6.2.tgz",
"integrity": "sha512-nmok2LnAd6nLUKI16aEB9ydMC6Lidiiq2m1nEBDR1LaaP7FGs4AJ90qDraxX+CWlVuRlvNjyYJTNv8qFjtL9+A==",
"cpu": [
"arm64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-darwin-x64": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-darwin-x64/-/resvg-js-darwin-x64-2.6.2.tgz",
"integrity": "sha512-GInyZLjgWDfsVT6+SHxQVRwNzV0AuA1uqGsOAW+0th56J7Nh6bHHKXHBWzUrihxMetcFDmQMAX1tZ1fZDYSRsw==",
"cpu": [
"x64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-linux-arm-gnueabihf": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-linux-arm-gnueabihf/-/resvg-js-linux-arm-gnueabihf-2.6.2.tgz",
"integrity": "sha512-YIV3u/R9zJbpqTTNwTZM5/ocWetDKGsro0SWp70eGEM9eV2MerWyBRZnQIgzU3YBnSBQ1RcxRZvY/UxwESfZIw==",
"cpu": [
"arm"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-linux-arm64-gnu": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-linux-arm64-gnu/-/resvg-js-linux-arm64-gnu-2.6.2.tgz",
"integrity": "sha512-zc2BlJSim7YR4FZDQ8OUoJg5holYzdiYMeobb9pJuGDidGL9KZUv7SbiD4E8oZogtYY42UZEap7dqkkYuA91pg==",
"cpu": [
"arm64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-linux-arm64-musl": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-linux-arm64-musl/-/resvg-js-linux-arm64-musl-2.6.2.tgz",
"integrity": "sha512-3h3dLPWNgSsD4lQBJPb4f+kvdOSJHa5PjTYVsWHxLUzH4IFTJUAnmuWpw4KqyQ3NA5QCyhw4TWgxk3jRkQxEKg==",
"cpu": [
"arm64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-linux-x64-gnu": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-linux-x64-gnu/-/resvg-js-linux-x64-gnu-2.6.2.tgz",
@@ -54,6 +166,54 @@
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-linux-x64-musl": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-linux-x64-musl/-/resvg-js-linux-x64-musl-2.6.2.tgz",
"integrity": "sha512-UOf83vqTzoYQO9SZ0fPl2ZIFtNIz/Rr/y+7X8XRX1ZnBYsQ/tTb+cj9TE+KHOdmlTFBxhYzVkP2lRByCzqi4jQ==",
"cpu": [
"x64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-win32-arm64-msvc": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-win32-arm64-msvc/-/resvg-js-win32-arm64-msvc-2.6.2.tgz",
"integrity": "sha512-7C/RSgCa+7vqZ7qAbItfiaAWhyRSoD4l4BQAbVDqRRsRgY+S+hgS3in0Rxr7IorKUpGE69X48q6/nOAuTJQxeQ==",
"cpu": [
"arm64"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-win32-ia32-msvc": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-win32-ia32-msvc/-/resvg-js-win32-ia32-msvc-2.6.2.tgz",
"integrity": "sha512-har4aPAlvjnLcil40AC77YDIk6loMawuJwFINEM7n0pZviwMkMvjb2W5ZirsNOZY4aDbo5tLx0wNMREp5Brk+w==",
"cpu": [
"ia32"
],
"license": "MPL-2.0",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@resvg/resvg-js-win32-x64-msvc": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@resvg/resvg-js-win32-x64-msvc/-/resvg-js-win32-x64-msvc-2.6.2.tgz",
@@ -99,6 +259,134 @@
"query-process-win32-x64-msvc": "0.0.3"
}
},
"node_modules/query-process-android-arm-eabi": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/query-process-android-arm-eabi/-/query-process-android-arm-eabi-0.0.3.tgz",
"integrity": "sha512-NB+9T+/poBcygDiG+7d2lJSeioP5ZyLT0HwUBdnLgNWvNCpzbJxydup1SLpnt5G2NF6nlTgbUZlH4hvxY7t/bw==",
"cpu": [
"arm"
],
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/query-process-android-arm64": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/query-process-android-arm64/-/query-process-android-arm64-0.0.3.tgz",
"integrity": "sha512-TiAw2yO62vQzM0s02471LToHyUs/PRkLGGlA715z10BPIM5NckzIe245AI45CDyH6tE/3nVHUd0LX/dfjQtTcw==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/query-process-linux-arm-gnueabihf": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/query-process-linux-arm-gnueabihf/-/query-process-linux-arm-gnueabihf-0.0.3.tgz",
"integrity": "sha512-w7NLHBKt7qselCDoh/PVWyeuEb2NiiDDf1A9UB4K3Ns/H24hK3NbfMMBm8mCFxUnFUqoVX8O+VMs7dD/FNlTxA==",
"cpu": [
"arm"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/query-process-linux-arm64-gnu": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/query-process-linux-arm64-gnu/-/query-process-linux-arm64-gnu-0.0.3.tgz",
"integrity": "sha512-nrPHjnSqCBuuN7IZkZWOnBpiJjyKOjfpT0Xt2EjSGp+I7C0CHbnhCL/vG1hBzaWZn0mxJ5nf0c5N0Fja7krnpQ==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/query-process-linux-arm64-musl": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/query-process-linux-arm64-musl/-/query-process-linux-arm64-musl-0.0.3.tgz",
"integrity": "sha512-vk8xMYTnS1PRKhwJgqLKyBAGIFP2CYZW2BsaKuNgQKUrDv7NnBaG7yukZT8niHNO1ycSrFpR/xqeJ8R23hO07A==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/query-process-linux-x64-gnu": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/query-process-linux-x64-gnu/-/query-process-linux-x64-gnu-0.0.3.tgz",
"integrity": "sha512-j1tGcNnGyVCABJ1PHZD1gKuyuomNzsPow3NDuZzUGjPqvKu67RsmKJJJOhMyT1SvUkcqdLFdtS1KTD20I4GS5Q==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/query-process-linux-x64-musl": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/query-process-linux-x64-musl/-/query-process-linux-x64-musl-0.0.3.tgz",
"integrity": "sha512-AOGrrI/Qcb30iKFstiW60zNG/HQevCY0Q38eMHGd7LrBZ5sEN7NzZOjzKp43KeNHejuZBDMxf0gdGAqDznOAng==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/query-process-win32-arm64-msvc": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/query-process-win32-arm64-msvc/-/query-process-win32-arm64-msvc-0.0.3.tgz",
"integrity": "sha512-LHvxbzMFwPPUXHe4bDCAqs1bYbp8j0bMW8XyJGPZnIYrnwHz6g8VE5WQEtXQxSznsbfVxAKJXUtn088EjDVazw==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/query-process-win32-x64-msvc": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/query-process-win32-x64-msvc/-/query-process-win32-x64-msvc-0.0.3.tgz",
@@ -115,25 +403,59 @@
}
},
"node_modules/regedit-rs": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/regedit-rs/-/regedit-rs-1.0.2.tgz",
"integrity": "sha512-4vEgiZNO1FCG8z/Zx3v/6PU1+eZ+ELe6R0ca+VB96Vw+Mi3M0IVHAjtMFbl97lUSX11dJqpyousX/wY8QcI1lA==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/regedit-rs/-/regedit-rs-1.0.4.tgz",
"integrity": "sha512-G+gESK8PvuqUec8LT4TrkbGvOOw4EzGd+kRn4zzmnnrWu0mgBD6P0zQPj+9EUIYW8L4BPETWiSkkyAFamc4JEg==",
"license": "MIT",
"engines": {
"node": ">= 10"
},
"optionalDependencies": {
"regedit-rs-win32-arm64-msvc": "1.0.2",
"regedit-rs-win32-ia32-msvc": "1.0.2",
"regedit-rs-win32-x64-msvc": "1.0.2"
"regedit-rs-win32-arm64-msvc": "1.0.4",
"regedit-rs-win32-ia32-msvc": "1.0.4",
"regedit-rs-win32-x64-msvc": "1.0.4"
}
},
"node_modules/regedit-rs-win32-arm64-msvc": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/regedit-rs-win32-arm64-msvc/-/regedit-rs-win32-arm64-msvc-1.0.4.tgz",
"integrity": "sha512-4oBCk+r8BnXT/SHJ+b6cKlhSy53oX++XdyqCCBOfrvy8hP7EX7rsp02vPgLErwCzQ4E42QLPIO0FoLRmGzTztg==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/regedit-rs-win32-ia32-msvc": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/regedit-rs-win32-ia32-msvc/-/regedit-rs-win32-ia32-msvc-1.0.4.tgz",
"integrity": "sha512-hhzZ7QCtQqUiM73H1NfqeRDU6eos778Kynk5SaV0IMHiNOgMgj2Mb0xQdWRovJgpquRgm+x0DS3cn2MbNZwuWQ==",
"cpu": [
"ia32"
],
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/regedit-rs-win32-x64-msvc": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/regedit-rs-win32-x64-msvc/-/regedit-rs-win32-x64-msvc-1.0.2.tgz",
"integrity": "sha512-ccCSyd5vWBKVWftBKLKzegqwwPMWcQtIW0ub66dCFFuv2s+x2EcZZWGdD9dVXX2Z6V9DU2JRPKgWUNjVPaj6Xg==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/regedit-rs-win32-x64-msvc/-/regedit-rs-win32-x64-msvc-1.0.4.tgz",
"integrity": "sha512-kb+965y6NKQijtCYYSvvE8puKAT3uyrHpr6HmZdGDZQb/iKNY2GmUX1/YrlYf9Kavdr5IJ9rkat6pokND+Npzw==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"win32"
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "bs-manager",
"version": "1.5.3-alpha.1",
"version": "1.5.4",
"description": "BSManager",
"main": "./dist/main/main.js",
"author": {
@@ -9,18 +9,18 @@
"url": "https://github.com/Zagrios/bs-manager"
},
"scripts": {
"rebuild": "node -r ts-node/register ../../.erb/scripts/electron-rebuild.js",
"link-modules": "node -r ts-node/register ../../.erb/scripts/link-modules.ts",
"rebuild": "tsx ../../.erb/scripts/electron-rebuild.js",
"link-modules": "tsx ../../.erb/scripts/link-modules.ts",
"postinstall": "npm run rebuild && npm run link-modules"
},
"dependencies": {
"@resvg/resvg-js": "2.6.2",
"ps-list": "^7.2.0",
"query-process": "^0.0.3",
"regedit-rs": "^1.0.2"
"regedit-rs": "1.0.4"
},
"license": "MIT",
"volta": {
"node": "20.11.0"
"node": "24.11.1"
}
}
+44 -14
View File
@@ -3,59 +3,89 @@ import { parseEnvString } from "main/helpers/env.helpers";
describe("Test parseEnvString", () => {
it("Empty", () => {
const envVars = parseEnvString("");
expect(envVars).toEqual({});
const { env, command } = parseEnvString("");
expect(env).toEqual({});
expect(command).toEqual("");
});
it("Single test; no quotes", () => {
const envString = "HELLO=World!";
const envVars = parseEnvString(envString);
expect(envVars).toEqual({
const { env, command } = parseEnvString(envString);
expect(env).toEqual({
HELLO: "World!",
});
expect(command).toEqual("");
});
it("Single test; single quotes", () => {
const envString = "SINGLE_QOUTE='Single quote with spaces'";
const envVars = parseEnvString(envString);
expect(envVars).toEqual({
const { env, command } = parseEnvString(envString);
expect(env).toEqual({
SINGLE_QOUTE: "Single quote with spaces",
});
expect(command).toEqual("");
});
it("Single test; double quotes", () => {
const envString = 'DOUBLE_QOUTE="Some random quote."';
const envVars = parseEnvString(envString);
expect(envVars).toEqual({
const { env, command } = parseEnvString(envString);
expect(env).toEqual({
DOUBLE_QOUTE: "Some random quote.",
});
expect(command).toEqual("");
});
it("Single test; empty value", () => {
const envString = "EMPTY=";
const envVars = parseEnvString(envString);
expect(envVars).toEqual({
const { env, command } = parseEnvString(envString);
expect(env).toEqual({
EMPTY: "",
});
expect(command).toEqual("");
});
it("Multiple test; combined", () => {
const envString = `HELLO=World! DOUBLE_QUOTE="Two Words" SINGLE_QUOTE='' EMPTY=`
const envVars = parseEnvString(envString);
expect(envVars).toEqual(expect.objectContaining({
const { env, command } = parseEnvString(envString);
expect(env).toEqual(expect.objectContaining({
HELLO: "World!",
DOUBLE_QUOTE: "Two Words",
SINGLE_QUOTE: "",
EMPTY: ""
}));
expect(command).toEqual("");
});
it("Key with numbers and lower case", () => {
const envString = "H3ll0=world";
const envVars = parseEnvString(envString);
expect(envVars).toEqual({
const { env, command } = parseEnvString(envString);
expect(env).toEqual({
H3ll0: "world",
});
expect(command).toEqual("");
});
it("Simple command", () => {
const { env, command } = parseEnvString("some-command");
expect(env).toEqual({});
expect(command).toBe("some-command");
});
it("Env with command", () => {
const { env, command } = parseEnvString("SAMPLE=value some-command");
expect(env).toEqual(expect.objectContaining({
SAMPLE: "value"
}));
expect(command).toBe("some-command");
});
it("Complex with %command%", () => {
const envString = "KEY=value gamescope -h 720 -H 1440 -S integer -- %command% ";
const { env, command } = parseEnvString(envString);
expect(env).toEqual(expect.objectContaining({
KEY: "value"
}));
expect(command).toBe("gamescope -h 720 -H 1440 -S integer -- %command%");
})
});
@@ -0,0 +1,114 @@
import { parseLaunchOptions } from "main/helpers/launchOptions.helper";
const SAMPLE_EXE = `"Beat Saber.exe"`;
const PROTON_EXE = `"proton" run ${SAMPLE_EXE}`;
describe("Test parseLaunchOptions", () => {
it("Empty", () => {
const {
env, cmdlet, args
} = parseLaunchOptions("", { commandReplacement: SAMPLE_EXE });
expect(env).toEqual({});
expect(cmdlet).toBe(SAMPLE_EXE);
expect(args).toBe("");
});
it("Envs", () => {
const { env, cmdlet, args } = parseLaunchOptions(
`HELLO=World! DOUBLE_QUOTE="Two Words" SINGLE_QUOTE='' EMPTY=`,
{ commandReplacement: SAMPLE_EXE }
);
expect(env).toEqual(expect.objectContaining({
HELLO: "World!",
DOUBLE_QUOTE: "Two Words",
SINGLE_QUOTE: "",
EMPTY: ""
}));
expect(cmdlet).toEqual(SAMPLE_EXE);
expect(args).toEqual("");
});
it("Env with %command%", () => {
const { env, cmdlet, args } = parseLaunchOptions(
`TEST=TEST %command%`,
{ commandReplacement: SAMPLE_EXE }
);
expect(env).toEqual(expect.objectContaining({
TEST: "TEST",
}));
expect(cmdlet).toEqual(SAMPLE_EXE);
expect(args).toEqual("");
});
it("Envs with arguments", () => {
const { env, cmdlet, args } = parseLaunchOptions(
`HELLO=World! DOUBLE_QUOTE="Two Words" SINGLE_QUOTE='' EMPTY= %command% --vr-mode`,
{ commandReplacement: SAMPLE_EXE }
);
expect(env).toEqual(expect.objectContaining({
HELLO: "World!",
DOUBLE_QUOTE: "Two Words",
SINGLE_QUOTE: "",
EMPTY: ""
}));
expect(cmdlet).toEqual(SAMPLE_EXE);
expect(args).toEqual("--vr-mode");
});
it("Linux Command 1", () => {
const { env, cmdlet, args } = parseLaunchOptions(
"gamemoderun %command%",
{ commandReplacement: PROTON_EXE }
);
expect(env).toEqual({});
expect(cmdlet).toBe("gamemoderun");
expect(args).toBe(PROTON_EXE);
});
it("Linux Command 2", () => {
const { env, cmdlet, args } = parseLaunchOptions(
"mangohud %command%",
{ commandReplacement: PROTON_EXE }
);
expect(env).toEqual({});
expect(cmdlet).toBe("mangohud");
expect(args).toBe(PROTON_EXE);
});
it("Linux Command 3", () => {
const { env, cmdlet, args } = parseLaunchOptions(
"gamescope -h 720 -H 1440 -S integer -- %command%",
{ commandReplacement: PROTON_EXE }
);
expect(env).toEqual({});
expect(cmdlet).toBe("gamescope");
expect(args).toBe(`-h 720 -H 1440 -S integer -- ${PROTON_EXE}`);
});
it("Linux Command 4", () => {
const { env, cmdlet, args } = parseLaunchOptions(
`LD_PRELOAD="" gamescope --hdr-enabled -f -h 1440 -r 144 --force-grab-cursor --framerate-limit 144 --mangoapp -- %command%`,
{ commandReplacement: PROTON_EXE }
);
expect(env).toEqual({
LD_PRELOAD: ""
});
expect(cmdlet).toBe("gamescope");
expect(args).toBe(`--hdr-enabled -f -h 1440 -r 144 --force-grab-cursor --framerate-limit 144 --mangoapp -- ${PROTON_EXE}`);
});
it("Complex Linux Command", () => {
const { env, cmdlet, args } = parseLaunchOptions(
"WINEPREFIX=some-path HELLO=World gamescope -h 720 -H 1440 -S integer -- %command% --debug",
{ commandReplacement: PROTON_EXE }
);
expect(env).toEqual(expect.objectContaining({
WINEPREFIX: "some-path",
HELLO: "World",
}));
expect(cmdlet).toBe("gamescope");
expect(args).toBe(`-h 720 -H 1440 -S integer -- ${PROTON_EXE} --debug`);
});
});
+6 -12
View File
@@ -27,7 +27,6 @@ jest.mock("electron-log", () => ({
jest.mock("ps-list", () => (): unknown[] => []);
const IS_WINDOWS = process.platform === "win32";
const IS_LINUX = process.platform === "linux";
describe("Test os.helpers bsmSpawn", () => {
@@ -51,6 +50,7 @@ describe("Test os.helpers bsmSpawn", () => {
STEAM_COMPAT_CLIENT_INSTALL_PATH: "/steam",
STEAM_COMPAT_APP_ID: BS_APP_ID,
SteamEnv: "1",
OXR_PARALLEL_VIEWS: "1",
});
}
});
@@ -89,14 +89,11 @@ describe("Test os.helpers bsmSpawn", () => {
it("Complex spawn command call (Mods install)", () => {
bsmSpawn(`"./BSIPA.exe" "./Beat Saber.exe" -n`, {
log: BsmShellLog.Command,
linux: { prefix: `"./wine64"` },
});
expect(spawnSpy).toHaveBeenCalledTimes(1);
expect(spawnSpy).toHaveBeenCalledWith(
process.platform === "win32"
? `"./BSIPA.exe" "./Beat Saber.exe" -n`
: `"./wine64" "./BSIPA.exe" "./Beat Saber.exe" -n`,
`"./BSIPA.exe" "./Beat Saber.exe" -n`,
expect.anything()
);
@@ -112,14 +109,11 @@ describe("Test os.helpers bsmSpawn", () => {
env: BS_ENV,
},
log: BsmShellLog.Command,
linux: { prefix: `"./proton" run` },
});
expect(spawnSpy).toHaveBeenCalledTimes(1);
expect(spawnSpy).toHaveBeenCalledWith(
IS_WINDOWS
? `"./Beat Saber.exe" --no-yeet fpfc`
: `"./proton" run "./Beat Saber.exe" --no-yeet fpfc`,
`"./Beat Saber.exe" --no-yeet fpfc`,
expect.objectContaining({
cwd: "/",
detached: true,
@@ -140,14 +134,15 @@ describe("Test os.helpers bsmSpawn", () => {
"STEAM_COMPAT_INSTALL_PATH",
"STEAM_COMPAT_CLIENT_INSTALL_PATH",
"STEAM_COMPAT_APP_ID",
"SteamEnv"
"SteamEnv",
"OXR_PARALLEL_VIEWS"
];
const newEnv = {
...BS_ENV,
something: "else",
more: "tests",
};
bsmSpawn(`"./Beat Saber.exe"`, {
bsmSpawn(`"./proton" run "./Beat Saber.exe"`, {
args: ["--no-yeet", "fpfc"],
options: {
cwd: "/",
@@ -155,7 +150,6 @@ describe("Test os.helpers bsmSpawn", () => {
env: newEnv,
},
log: BsmShellLog.Command,
linux: { prefix: `"./proton" run` },
flatpak: {
host: true,
env: flatpakEnv,
+62 -41
View File
@@ -21,6 +21,7 @@ enum EnvParserState {
QUOTE_VALUE,
DQUOTE_VALUE,
SPACE,
EXIT,
ERROR,
};
@@ -28,7 +29,19 @@ const isAlphaCharacter = (c: string) =>
(c >= "a" && c <= "z") || (c >= "A" && c <= "Z");
const isNumber = (c: string) => c >= "0" && c <= "9";
export function parseEnvString(envString: string): Record<string, string> {
/**
* Parses the env values from an envString command
*
* @params envString
* @returns ({
* env - parsed environment variables
* command - part of the env string which is the command
* })
*/
export function parseEnvString(envString: string): {
env: Record<string, string>;
command: string;
} {
const envVars: Record<string, string> = {};
let state: EnvParserState = EnvParserState.NAME_START;
@@ -39,13 +52,13 @@ export function parseEnvString(envString: string): Record<string, string> {
switch (state) {
case EnvParserState.NAME_START:
index = pos;
if (isAlphaCharacter(c) || c === "_") {
state = EnvParserState.NAME;
index = pos;
} else if (c !== " ") {
state = EnvParserState.ERROR;
state = EnvParserState.EXIT;
}
break;
break;
case EnvParserState.NAME:
if (c === "=") {
@@ -53,57 +66,65 @@ export function parseEnvString(envString: string): Record<string, string> {
newName = envString.substring(index, pos);
index = pos + 1;
} else if (!isAlphaCharacter(c) && !isNumber(c) && c !== "_") {
state = EnvParserState.ERROR;
state = EnvParserState.EXIT;
}
break;
break;
case EnvParserState.VALUE_START:
if (c === "'") {
++index;
state = EnvParserState.QUOTE_VALUE;
} else if (c === '"') {
++index;
state = EnvParserState.DQUOTE_VALUE;
} else if (c === " ") {
state = EnvParserState.NAME_START;
envVars[newName] = "";
} else {
state = EnvParserState.VALUE;
}
break;
++index;
state = EnvParserState.QUOTE_VALUE;
} else if (c === '"') {
++index;
state = EnvParserState.DQUOTE_VALUE;
} else if (c === " ") {
state = EnvParserState.NAME_START;
envVars[newName] = "";
} else {
state = EnvParserState.VALUE;
}
break;
case EnvParserState.VALUE:
if (c === " ") {
state = EnvParserState.NAME_START;
envVars[newName] = envString.substring(index, pos);
}
break;
state = EnvParserState.NAME_START;
envVars[newName] = envString.substring(index, pos);
}
break;
case EnvParserState.QUOTE_VALUE:
if (c === "'") {
state = EnvParserState.SPACE;
envVars[newName] = envString.substring(index, pos);
}
break;
state = EnvParserState.SPACE;
envVars[newName] = envString.substring(index, pos);
}
break;
case EnvParserState.DQUOTE_VALUE:
if (c === '"') {
state = EnvParserState.SPACE;
envVars[newName] = envString.substring(index, pos);
}
break;
state = EnvParserState.SPACE;
envVars[newName] = envString.substring(index, pos);
}
break;
case EnvParserState.SPACE:
if (c === " ") {
state = EnvParserState.NAME_START;
} else {
state = EnvParserState.ERROR;
}
break;
state = EnvParserState.NAME_START;
} else {
state = EnvParserState.ERROR;
}
break;
default:
}
// Early exit
if (state === EnvParserState.EXIT) {
return {
env: envVars,
command: envString.substring(index).trim()
};
}
if (state === EnvParserState.ERROR) {
throw new CustomError(
`parseEnvString failed: invalid character at position ${pos}`,
@@ -114,15 +135,15 @@ export function parseEnvString(envString: string): Record<string, string> {
if (state === EnvParserState.VALUE_START || state === EnvParserState.VALUE) {
envVars[newName] = envString.substring(index);
return envVars;
return { env: envVars, command: "" };
}
if (state === EnvParserState.NAME_START || state === EnvParserState.SPACE) {
return envVars;
return { env: envVars, command: "" };
}
throw new CustomError(
"parseEnvString failed: invalid ending state",
"generic.env.parse"
);
return {
env: envVars,
command: envString.substring(index + 1).trim(),
}
}
+2 -2
View File
@@ -32,7 +32,7 @@ export async function deleteFile(filepath: string) {
log.info("Deleting file", `"${filepath}"`);
await unlink(filepath);
} catch (error: any) {
log.error("Could not delete file", `"${filepath}"`);
log.error("Could not delete file", `"${filepath}"`, error);
throw CustomError.fromError(error, "generic.fs.delete-file");
}
}
@@ -42,7 +42,7 @@ export function deleteFileSync(filepath: string) {
log.info("Deleting file", `"${filepath}"`);
unlinkSync(filepath);
} catch (error: any) {
log.error("Could not delete file", `"${filepath}"`);
log.error("Could not delete file", `"${filepath}"`, error);
throw CustomError.fromError(error, "generic.fs.delete-file");
}
}
+59
View File
@@ -0,0 +1,59 @@
import { parseEnvString } from "./env.helpers";
const COMMAND_KEYWORD = "%command%";
/**
* Parses the launch options command into parts to be used for bsmSpawn
*
* @params command
* @params options.commandReplacement - Replaces the %command% string
* @params options.linux - If the application is running under linux. Can be toggled in testing to check if the logic works.
* @returns {
* env - environment variables
* cmdlet - BS.exe or a binary executable like gamemoderun and gamescope
* args - Arguments for the cmdlet.
* }
*/
export function parseLaunchOptions(launchOption: string, options: {
commandReplacement: string;
}): {
env: Record<string, string>;
cmdlet: string;
args: string;
} {
if (!launchOption) {
return { env: {}, cmdlet: options.commandReplacement, args: "" };
}
const parsed = parseEnvString(launchOption);
const { env } = parsed;
// If launch options only contains env strings
if (!parsed.command) {
return { env, cmdlet: options.commandReplacement, args: "" };
}
const command = parsed.command.indexOf(COMMAND_KEYWORD) === -1
? `${options.commandReplacement} ${parsed.command}`
: parsed.command.replace(COMMAND_KEYWORD, options.commandReplacement);
// Offset if it starts with a " or '
let offset = 0;
if (command.startsWith('"')) {
offset = command.indexOf('"', 1);
} else if (command.startsWith("'")) {
offset = command.indexOf("'", 1);
}
// First word/token is the cmdlet, the rest are the arguments
const index = command.indexOf(" ", offset);
if (index === -1) {
return { env, cmdlet: command.trim(), args: "" };
}
return {
env, cmdlet: command.substring(0, index),
args: command.substring(index + 1).trim(),
}
}
+4 -14
View File
@@ -3,13 +3,6 @@ import log from "electron-log";
import psList from "ps-list";
import { IS_FLATPAK } from "main/constants";
type LinuxOptions = {
// Add the prefix to the command
// eg. command - "./Beat Saber.exe" --no-yeet, prefix - "path/to/proton" run
// = "path/to/proton" run "./Beat Saber.exe" --no-yeet
prefix: string;
};
// Only applied if package as flatpak
type FlatpakOptions = {
// Force to use "flatpak-spawn --host" to run commands outside of the sandbox
@@ -24,11 +17,10 @@ export enum BsmShellLog {
};
interface BsmShellOptions<OptionsType> {
args?: string[];
args?: string[] | string;
options?: OptionsType;
// Look into BsmShellLog values
log?: number;
linux?: LinuxOptions;
flatpak?: FlatpakOptions;
};
@@ -37,7 +29,9 @@ export type BsmExecOptions = BsmShellOptions<cp.ExecOptions>;
function updateCommand(command: string, options: BsmSpawnOptions) {
if (options?.args) {
command += ` ${options.args.join(" ")}`;
command += typeof(options.args) === "string"
? ` ${options.args}`
: ` ${options.args.join(" ")}`;
}
if (process.platform === "linux") {
@@ -45,10 +39,6 @@ function updateCommand(command: string, options: BsmSpawnOptions) {
// All distros should support "bash" by default
options.options.shell = "bash";
if (options.linux?.prefix) {
command = `${options.linux.prefix} ${command}`;
}
if (options?.flatpak?.host) {
const envArgs = (options?.flatpak?.env && options?.options?.env)
&& options.flatpak.env
+9 -1
View File
@@ -51,7 +51,15 @@ async function enableWindowsProxy(enable: boolean): Promise<void> {
}
if (enable) {
const httpProxyUrl = `http://${await getProxyServer().catch(err => log.error(err))}`
const httpProxyServer = await getProxyServer().catch(err => log.error(err));
let httpProxyUrl: string | null = null;
if (httpProxyServer) {
// Prepend the http protocol
httpProxyUrl = httpProxyServer.startsWith("http://")
? httpProxyServer
: `http://${httpProxyServer}`;
}
globalProxyAgent.HTTP_PROXY = httpProxyUrl;
globalProxyAgent.HTTPS_PROXY = httpProxyUrl;
globalProxyAgent.NO_PROXY = `${await getProxyOverride().catch(err => log.error(err))}`;
+14
View File
@@ -39,3 +39,17 @@ ipc.on("bs-mods.beatmods-up", (_, reply) => {
const beatMods = BeatModsApiService.getInstance();
reply(from(beatMods.isUp()));
})
ipc.on("bs-mods.mod-repo.get-repo-list", (_, reply) => {
const beatMods = BeatModsApiService.getInstance();
reply(from(beatMods.getModRepoList()));
})
ipc.on("bs-mods.mod-repo.get-name", (_, reply) => {
const beatMods = BeatModsApiService.getInstance();
reply(from(beatMods.getSelectedModRepoAsync()));
})
ipc.on("bs-mods.mod-repo.select-name", (args, reply) => {
const beatMods = BeatModsApiService.getInstance();
reply(from(beatMods.selectModRepo(args)));
})
+5
View File
@@ -14,6 +14,11 @@ ipc.on("check-update", (_, reply) => {
reply(from(updaterService.isUpdateAvailable()));
});
ipc.on("get-available-update", (_, reply) => {
const updaterService = AutoUpdaterService.getInstance();
reply(from(updaterService.getAvailableUpdate()));
});
ipc.on("install-update", (_, reply) => {
const updaterService = AutoUpdaterService.getInstance();
reply(of(updaterService.quitAndInstall()));
+17 -7
View File
@@ -28,6 +28,7 @@ import { StaticConfigurationService } from "./services/static-configuration.serv
import { configureProxy } from './helpers/proxy.helpers';
import { deleteFileSync, deleteFolderSync } from "./helpers/fs.helpers";
import { tryit } from "shared/helpers/error.helpers";
import { AutoUpdate } from "shared/models/config";
const isDebug = process.env.NODE_ENV === "development" || process.env.DEBUG_PROD === "true";
const staticConfig = StaticConfigurationService.getInstance();
@@ -99,6 +100,10 @@ const findAssociatedFileInArgs = (args: string[]): string => {
const gotTheLock = app.requestSingleInstanceLock();
const init = () => {
initServicesMustBeInitialized();
}
if (!gotTheLock) {
app.quit();
} else {
@@ -121,11 +126,8 @@ if (!gotTheLock) {
app.whenReady().then(() => {
app.setAppUserModelId(APP_NAME);
initServicesMustBeInitialized();
init();
const deepLink = findDeepLinkInArgs(process.argv);
const associatedFile = findAssociatedFileInArgs(process.argv);
@@ -134,10 +136,18 @@ if (!gotTheLock) {
DeepLinkService.getInstance().dispatchLinkOpened(deepLink);
} else if (associatedFile) {
FileAssociationService.getInstance().handleFileAssociation(associatedFile);
} else if (process.platform === "linux") {
createWindow("index.html");
} else {
createWindow(process.platform === "linux"
? "index.html" : "launcher.html"
);
const configService = StaticConfigurationService.getInstance();
const autoUpdate = configService.get("auto-update", AutoUpdate.ALWAYS);
const update = autoUpdate !== AutoUpdate.NEVER;
if (autoUpdate === AutoUpdate.ONCE) {
configService.set("auto-update", AutoUpdate.NEVER);
}
// Skip launcher only if autoUpdate is strictly false
createWindow(update ? "launcher.html" : "index.html");
}
SteamLauncherService.getInstance().restoreSteamVR();
@@ -359,7 +359,18 @@ export class LocalPlaylistsManagerService {
continue;
}
const downloadedMap = await this.maps.downloadMap(mapDetail, version);
const downloadedMap = await this.maps.downloadMap(mapDetail, version)
.catch(error => {
log.error(
"Could not download map for playlist",
`[${mapDetail.id}] "${mapDetail.name}"`,
error
);
return null;
});
if (!downloadedMap) {
continue;
}
progress.data.downloadedMaps.push(downloadedMap);
progress.data.currentDownload = mapDetail;
@@ -1,13 +1,13 @@
import path from "path";
import { BSVersion } from "shared/bs-version.interface";
import { BsvMapDetail } from "shared/models/maps";
import { BsmLocalMap, BsmLocalMapsProgress, DeleteMapsProgress } from "shared/models/maps/bsm-local-map.interface";
import { BsmLocalMap, BsmLocalMapMetadata, 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, { BinaryLike } from "crypto";
import { lstatSync } from "fs";
import { copy, createReadStream, ensureDir, pathExists, pathExistsSync, realpath } from "fs-extra";
import { copy, createReadStream, ensureDir, existsSync, pathExists, pathExistsSync, readJson, realpath, writeJson } from "fs-extra";
import { RequestService } from "../../request.service";
import sanitize from "sanitize-filename";
import { DeepLinkService } from "../../deep-link.service";
@@ -31,6 +31,7 @@ import { CustomError } from "shared/models/exceptions/custom-error.class";
import { tryit } from "shared/helpers/error.helpers";
import { BsmZipExtractor } from "main/models/bsm-zip-extractor.class";
import { escapeRegExp } from "../../../../shared/helpers/string.helpers";
import dateFormat from "dateformat";
export class LocalMapsManagerService {
private static instance: LocalMapsManagerService;
@@ -46,6 +47,7 @@ export class LocalMapsManagerService {
public static readonly CUSTOM_LEVELS_FOLDER = "CustomLevels";
public static readonly RELATIVE_MAPS_FOLDER = path.join(LocalMapsManagerService.LEVELS_ROOT_FOLDER, LocalMapsManagerService.CUSTOM_LEVELS_FOLDER);
public static readonly SHARED_MAPS_FOLDER = "SharedMaps";
public static readonly METADATA_FILE = "metadata.json";
private readonly DEEP_LINKS = {
BeatSaver: "beatsaver",
@@ -138,16 +140,21 @@ export class LocalMapsManagerService {
public async loadMapInfoFromPath(mapPath: string): Promise<BsmLocalMap> {
const getUrlsAndReturn = (mapInfo: MapInfo, hash: string, mapPath: string): BsmLocalMap => {
const getUrlsAndReturn = (mapInfo: MapInfo, hash: string, mapPath: string, metadata: BsmLocalMapMetadata): BsmLocalMap => {
const coverUrl = pathToFileURL(path.join(mapPath, mapInfo.coverImageFilename)).href;
const songUrl = pathToFileURL(path.join(mapPath, mapInfo.songFilename)).href;
return { mapInfo, coverUrl, songUrl, hash, path: mapPath, songDetails: this.songDetailsCache.getSongDetails(hash) };
return {
mapInfo, coverUrl, songUrl, hash, path: mapPath,
songDetails: this.songDetailsCache.getSongDetails(hash),
metadata,
};
};
const cachedMapInfos = this.songCache.getMapInfoFromDirname(path.basename(mapPath));
if (cachedMapInfos) {
return getUrlsAndReturn(cachedMapInfos.mapInfo, cachedMapInfos.hash, mapPath);
const metadata = await this.getMetadata(mapPath);
return getUrlsAndReturn(cachedMapInfos.mapInfo, cachedMapInfos.hash, mapPath, metadata);
}
const files = await getFilesInFolder(mapPath);
@@ -166,8 +173,9 @@ export class LocalMapsManagerService {
}
const hash = await this.computeMapHash(mapPath, rawInfoString);
const metadata = await this.getMetadata(mapPath);
return getUrlsAndReturn(mapInfo, hash, mapPath);
return getUrlsAndReturn(mapInfo, hash, mapPath, metadata);
}
private async downloadMapZip(zipUrl: string): Promise<string> {
@@ -462,6 +470,21 @@ export class LocalMapsManagerService {
return localMap;
}
private async getMetadata(mapPath: string): Promise<BsmLocalMapMetadata> {
const metadataPath = path.join(mapPath, LocalMapsManagerService.METADATA_FILE);
if (existsSync(metadataPath)) {
return await readJson(metadataPath) as BsmLocalMapMetadata;
}
// Create the metadata then return it to the user
const metadata: BsmLocalMapMetadata = {
addedDate: dateFormat(new Date(), "yyyy-mm-dd'T'HH:MM:ss.l"),
};
await writeJson(metadataPath, metadata);
return metadata;
}
public async exportMaps(version: BSVersion, maps: BsmLocalMap[], outPath: string): Promise<Observable<Progression>> {
const archive = new Archive(outPath);
+14 -1
View File
@@ -1,8 +1,9 @@
import { autoUpdater, CancellationToken, ProgressInfo } from "electron-updater";
import { autoUpdater, CancellationToken, ProgressInfo, UpdateInfo } from "electron-updater";
import log from "electron-log";
import { gt } from "semver";
import { Progression } from "main/helpers/fs.helpers";
import { Observable } from "rxjs";
import { safeGt } from "shared/helpers/semver.helpers";
export class AutoUpdaterService {
private static instance: AutoUpdaterService;
@@ -31,6 +32,18 @@ export class AutoUpdaterService {
});
}
public async getAvailableUpdate(): Promise<UpdateInfo | null> {
return autoUpdater.checkForUpdates().then(info => {
if (info?.updateInfo && safeGt(info.updateInfo.version, autoUpdater.currentVersion.version)) {
return info.updateInfo;
}
return null;
}).catch((error: Error): UpdateInfo | null => {
log.error("Could not get update", error);
return null;
});
}
public downloadUpdate(): Observable<Progression> {
return new Observable<Progression>(observer => {
@@ -1,14 +1,12 @@
import { LaunchOption } from "shared/models/bs-launch";
import { BSLocalVersionService } from "../bs-local-version.service";
import { ChildProcessWithoutNullStreams, SpawnOptionsWithoutStdio } from "child_process";
import path from "path";
import log from "electron-log";
import { sToMs } from "../../../shared/helpers/time.helpers";
import { LinuxService } from "../linux.service";
import { BsmShellLog, bsmSpawn } from "main/helpers/os.helpers";
import { IS_FLATPAK } from "main/constants";
import { LaunchMods } from "shared/models/bs-launch/launch-option.interface";
import { parseEnvString } from "main/helpers/env.helpers";
export function buildBsLaunchArgs(launchOptions: LaunchOption): string[] {
const launchArgs = [];
@@ -30,10 +28,6 @@ export function buildBsLaunchArgs(launchOptions: LaunchOption): string[] {
launchArgs.push("editor");
}
if (launchOptions.command) {
launchArgs.push(launchOptions.command);
}
return Array.from(new Set(launchArgs).values());
}
@@ -47,20 +41,20 @@ export abstract class AbstractLauncherService {
this.localVersions = BSLocalVersionService.getInstance();
}
private readonly COMMAND_FORMAT = "%command%";
protected launchBeatSaberProcess(options: LaunchBeatSaberOptions): ChildProcessWithoutNullStreams {
const spawnOptions: SpawnOptionsWithoutStdio = {
detached: true,
cwd: options.beatSaberFolderPath,
env: options.env,
};
protected launchBSProcess(bsExePath: string, args: string[], options?: SpawnBsProcessOptions): ChildProcessWithoutNullStreams {
const spawnOptions: SpawnOptionsWithoutStdio = { detached: true, cwd: path.dirname(bsExePath), ...(options || {}) };
if(args.includes("--verbose")){
if (options.args?.includes("--verbose")){
spawnOptions.windowsVerbatimArguments = true;
}
spawnOptions.shell = true; // For windows to spawn properly
return bsmSpawn(`"${bsExePath}"`, {
args, options: spawnOptions, log: BsmShellLog.Command,
linux: { prefix: options?.protonPrefix || "" },
return bsmSpawn(options.cmdlet, {
args: options.args, options: spawnOptions, log: BsmShellLog.Command,
flatpak: {
host: IS_FLATPAK,
env: [
@@ -73,6 +67,7 @@ export abstract class AbstractLauncherService {
"STEAM_COMPAT_CLIENT_INSTALL_PATH",
"STEAM_COMPAT_APP_ID",
"SteamEnv",
"OXR_PARALLEL_VIEWS",
"PROTON_LOG",
"PROTON_LOG_DIR",
],
@@ -80,8 +75,8 @@ export abstract class AbstractLauncherService {
});
}
protected launchBs(bsExePath: string, args: string[], options?: SpawnBsProcessOptions): {process: ChildProcessWithoutNullStreams, exit: Promise<number>} {
const process = this.launchBSProcess(bsExePath, args, options);
protected launchBeatSaber(options: LaunchBeatSaberOptions): {process: ChildProcessWithoutNullStreams, exit: Promise<number>} {
const process = this.launchBeatSaberProcess(options);
let timeoutId: NodeJS.Timeout;
@@ -120,23 +115,13 @@ export abstract class AbstractLauncherService {
return { process, exit };
}
protected injectAdditionalArgsEnvs(
launchOptions: LaunchOption,
env: Record<string, string>
) {
if (!launchOptions.command) {
return;
}
const { command } = launchOptions;
const index = command.indexOf(this.COMMAND_FORMAT);
if (index === -1) {
return;
}
const envString = command.substring(0, index);
log.info("Parsing env string ", `"${envString}"`)
for (const [ key, value ] of Object.entries(parseEnvString(envString))) {
// Launch option helper function
protected mergeEnvVariables(
originalEnv: Record<string, string>,
newEnv: Record<string, string>
): Record<string, string> {
const env = { ...originalEnv };
for (const [ key, value ] of Object.entries(newEnv)) {
log.info(
key in env ? "Overriding" : "Injecting",
`${key}="${value}"`,
@@ -144,13 +129,21 @@ export abstract class AbstractLauncherService {
);
env[key] = value;
}
launchOptions.command = command.substring(index + this.COMMAND_FORMAT.length);
return env;
}
}
export type SpawnBsProcessOptions = {
protonPrefix?: string;
export type LaunchBeatSaberOptions = {
// To be passed to the bsmSpawn helper function
// Can be the Beat Saber exe or wrapper exe (for linux)
cmdlet: string;
env: Record<string, string>;
beatSaberFolderPath: string;
args?: string[]; // Appended to the cmdlet string
// Timeout value (in ms) to unref the Beat Saber process to BSM
unrefAfter?: number;
} & SpawnOptionsWithoutStdio;
}
@@ -9,6 +9,7 @@ import { pathExists } from "fs-extra";
import { AbstractLauncherService, buildBsLaunchArgs } from "./abstract-launcher.service";
import { isProcessRunning } from "../../helpers/os.helpers";
import { CustomError } from "../../../shared/models/exceptions/custom-error.class";
import { parseLaunchOptions } from "main/helpers/launchOptions.helper";
export class OculusLauncherService extends AbstractLauncherService implements StoreLauncherInterface {
@@ -49,19 +50,25 @@ export class OculusLauncherService extends AbstractLauncherService implements St
// Make sure Oculus is running
await this.oculus.startOculus().catch(err => log.error("Error while starting Oculus", err));
const env: Record<string, string> = {
let env: Record<string, string> = {
...process.env,
};
this.injectAdditionalArgsEnvs(launchOptions, env);
const {
env: parsedEnv,
cmdlet, args,
} = parseLaunchOptions(launchOptions.command, {
commandReplacement: exePath,
});
env = this.mergeEnvVariables(env, parsedEnv);
obs.next({type: BSLaunchEvent.BS_LAUNCHING});
// Launch Beat Saber
const bsProcess = this.launchBs(
exePath,
buildBsLaunchArgs(launchOptions),
{ env }
);
const bsProcess = this.launchBeatSaber({
env, cmdlet,
beatSaberFolderPath: bsPath,
args: [ args, ...buildBsLaunchArgs(launchOptions) ]
});
return bsProcess.exit.catch(err => {
throw CustomError.fromError(err, BSLaunchError.BS_EXIT_ERROR);
@@ -6,12 +6,13 @@ import { SteamService } from "../steam.service";
import path from "path";
import { BS_APP_ID, BS_EXECUTABLE, STEAMVR_APP_ID } from "../../constants";
import log from "electron-log";
import { AbstractLauncherService, buildBsLaunchArgs, SpawnBsProcessOptions } from "./abstract-launcher.service";
import { AbstractLauncherService, buildBsLaunchArgs, LaunchBeatSaberOptions } from "./abstract-launcher.service";
import { CustomError } from "../../../shared/models/exceptions/custom-error.class";
import { UtilsService } from "../utils.service";
import { exec, ChildProcessWithoutNullStreams } from "child_process";
import { LaunchMods } from "shared/models/bs-launch/launch-option.interface";
import { app, Event } from "electron";
import { parseLaunchOptions } from "main/helpers/launchOptions.helper";
export class SteamLauncherService extends AbstractLauncherService implements StoreLauncherInterface{
@@ -64,8 +65,8 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
});
}
protected launchBs(bsExePath: string, args: string[], options?: SpawnBsProcessOptions): {process: ChildProcessWithoutNullStreams, exit: Promise<number>} {
const process = this.launchBSProcess(bsExePath, args, options);
protected launchBeatSaber(options: LaunchBeatSaberOptions): {process: ChildProcessWithoutNullStreams, exit: Promise<number>} {
const process = this.launchBeatSaberProcess(options);
const exit = new Promise<number>((resolve, reject) => {
// Don't remove, useful for debugging!
@@ -146,24 +147,35 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
const steamPath = await this.steam.getSteamPath();
const env = {
let env: Record<string, string> = {
...process.env,
"SteamAppId": BS_APP_ID,
"SteamOverlayGameId": BS_APP_ID,
"SteamGameId": BS_APP_ID,
};
let protonPrefix = "";
// Linux setup
if (process.platform === "linux") {
const linuxSetup = await this.linux.setupLaunch(
if (launchOptions.admin) {
log.warn("Launching as admin is not supported on Linux! Starting the game as a normal user.");
launchOptions.admin = false;
}
Object.assign(env, await this.linux.buildEnvVariables(
launchOptions, steamPath, bsFolderPath
);
protonPrefix = linuxSetup.protonPrefix;
Object.assign(env, linuxSetup.env);
));
}
this.injectAdditionalArgsEnvs(launchOptions, env);
const {
env: parsedEnv,
cmdlet, args
} = parseLaunchOptions(launchOptions.command, {
commandReplacement: process.platform === "win32"
? `"${bsExePath}"`
: `${await this.linux.getProtonPrefix()} "${bsExePath}"`,
});
env = this.mergeEnvVariables(env, parsedEnv);
const launchArgs = buildBsLaunchArgs(launchOptions);
obs.next({type: BSLaunchEvent.BS_LAUNCHING});
@@ -171,9 +183,12 @@ export class SteamLauncherService extends AbstractLauncherService implements Sto
const spawnOpts = { env, cwd: bsFolderPath };
const launchPromise = !launchOptions.admin ? (
this.launchBs(bsExePath, launchArgs, {
...spawnOpts,
protonPrefix
this.launchBeatSaber({
env, cmdlet,
args: args
? [ args, ...launchArgs ]
: launchArgs,
beatSaberFolderPath: bsFolderPath,
}).exit
) : (
new Promise<number>(resolve => {
@@ -61,7 +61,7 @@ export class BSLocalVersionService {
return null;
}
const versionsDict = await this.remoteVersionService.getAvailableVersions();
const versionsDict = (await this.remoteVersionService.getAvailableVersions()).reverse();
let stream: ReadStream;
@@ -244,8 +244,12 @@ export class BSLocalVersionService {
private async getSteamVersion(): Promise<BSVersion> {
const steamBsFolder = await this.steamService.getGameFolder(BS_APP_ID, "Beat Saber");
if (!steamBsFolder || !(await pathExists(steamBsFolder))) {
return null;
if (!steamBsFolder) {
throw new Error("No Beat Saber Steam version found");
}
if (!(await pathExists(steamBsFolder))) {
throw new Error(`Beat Saber Steam version not found in "${steamBsFolder}"`);
}
return this.getVersionOfBSFolder(steamBsFolder, { steam: true });
@@ -265,7 +269,8 @@ export class BSLocalVersionService {
const versions: BSVersion[] = [];
const steamVersion = await this.getSteamVersion().catch(e => {
log.error("unable to get original Steam version", e);
log.error("Unable to get original Steam version", e);
return null;
});
if (steamVersion) {
@@ -26,6 +26,7 @@ export class InstallationLocationService {
private readonly staticConfig: StaticConfigurationService;
private readonly updateListeners: Set<Listener> = new Set();
private readonly installPath: string;
private _installationDirectory: string;
private constructor() {
@@ -34,6 +35,13 @@ export class InstallationLocationService {
this.staticConfig.$watch(this.STORE_INSTALLATION_PATH_KEY).subscribe(() => {
this.triggerListeners();
});
if (process.platform === "linux") {
this.installPath = process.env.XDG_DATA_HOME
|| path.join(process.env.HOME, ".local", "share");
} else {
this.installPath = app.getPath("home");
}
}
private triggerListeners(): void {
@@ -65,7 +73,7 @@ export class InstallationLocationService {
public defaultInstallationDirectory(): string {
const { result: oldPath } = tryit(() => path.join(app.getPath("documents"), this.INSTALLATION_FOLDER));
const installationDirectory = (oldPath && pathExistsSync(oldPath)) ? app.getPath("documents") : app.getPath("home");
const installationDirectory = (oldPath && pathExistsSync(oldPath)) ? app.getPath("documents") : this.installPath;
return path.join(installationDirectory, this.INSTALLATION_FOLDER);
}
@@ -85,7 +93,7 @@ export class InstallationLocationService {
return app.getPath("documents");
}
return app.getPath("home");
return this.installPath;
};
this._installationDirectory = installParentPath();
+53 -68
View File
@@ -10,6 +10,7 @@ import { BsmShellLog, bsmExec } from "main/helpers/os.helpers";
import { LaunchMods } from "shared/models/bs-launch/launch-option.interface";
import { SteamShortcutData } from "shared/models/steam/shortcut.model";
import { buildBsLaunchArgs } from "./bs-launcher/abstract-launcher.service";
import { parseLaunchOptions } from "main/helpers/launchOptions.helper";
export class LinuxService {
private static instance: LinuxService;
@@ -38,26 +39,11 @@ export class LinuxService {
return path.resolve(sharedFolder, "compatdata");
}
public async setupLaunch(
launchOptions: LaunchOption,
steamPath: string,
bsFolderPath: string
): Promise<{
protonPrefix: string;
env: Record<string, string>;
}> {
if (launchOptions.admin) {
log.warn("Launching as admin is not supported on Linux! Starting the game as a normal user.");
launchOptions.admin = false;
}
public async getProtonPrefix() {
const protonPath = await this.getProtonPath();
return {
protonPrefix: await this.isNixOS()
? `steam-run "${protonPath}" run`
: `"${protonPath}" run`,
env: await this.buildEnvVariables(launchOptions, steamPath, bsFolderPath)
};
return await this.isNixOS()
? `steam-run "${protonPath}" run`
: `"${protonPath}" run`;
}
private async getProtonPath(): Promise<string> {
@@ -81,7 +67,7 @@ export class LinuxService {
return protonPath;
}
private async buildEnvVariables(
public async buildEnvVariables(
launchOptions: LaunchOption,
steamPath: string,
bsFolderPath: string
@@ -105,6 +91,8 @@ export class LinuxService {
"STEAM_COMPAT_APP_ID": BS_APP_ID,
// Run game in steam environment; fixes #585 for unicode song titles
"SteamEnv": "1",
// Fix reflections in Monado
"OXR_PARALLEL_VIEWS": "1",
};
if (launchOptions.launchMods?.includes(LaunchMods.PROTON_LOGS)) {
@@ -129,12 +117,7 @@ export class LinuxService {
return fs.pathExistsSync(protonPath) && fs.pathExistsSync(winePath);
}
public async getWinePath(): Promise<string> {
if (await this.isNixOS()) {
// Use system wine for nixos
return "wine";
}
public getWinePath(): string {
if (!this.staticConfig.has("proton-folder")) {
throw new Error("proton-folder variable not set");
}
@@ -179,18 +162,42 @@ export class LinuxService {
// === Shortcuts === //
private getCommand(
protonPrefix: string,
bsFolderPath: string,
env: Record<string, string>,
launchOptions: LaunchOption
): string {
private async getCommand(
launchOptions: LaunchOption,
steamPath: string,
beatSaberFolderPath: string
): Promise<string> {
const protonPrefix = await this.getProtonPrefix();
const launchEnv = await this.buildEnvVariables(
launchOptions, steamPath, beatSaberFolderPath
);
const beatSaberExePath = path.join(beatSaberFolderPath, BS_EXECUTABLE);
const {
env: parsedEnv,
args: parsedArgs,
cmdlet,
} = parseLaunchOptions(launchOptions.command, {
commandReplacement: `${protonPrefix} ${beatSaberExePath}`,
});
const args = buildBsLaunchArgs(launchOptions);
log.debug("Launch arguments:", args, "Parsed arguments:", parsedArgs);
if (parsedArgs) {
args.unshift(parsedArgs);
}
const env = {
...launchEnv, ...parsedEnv,
SteamAppId: BS_APP_ID,
SteamOverlayGameId: BS_APP_ID,
SteamGameId: BS_APP_ID,
};
const envString = Object.entries(env)
.map(([ key, value ]) => `${key}="${value}"`)
.join(" ");
const bsExe = path.join(bsFolderPath, BS_EXECUTABLE);
const args = buildBsLaunchArgs(launchOptions).join(" ");
return `${envString} ${protonPrefix} "${bsExe}" ${args}`;
return `${envString} ${cmdlet} ${args.join(" ")}`;
}
public async createDesktopShortcut(
@@ -199,22 +206,11 @@ export class LinuxService {
icon: string,
launchOptions: LaunchOption,
steamPath: string,
bsFolderPath: string
beatSaberFolderPath: string
): Promise<boolean> {
try {
const {
protonPrefix, env
} = await this.setupLaunch(launchOptions, steamPath, bsFolderPath);
Object.assign(env, {
"SteamAppId": BS_APP_ID,
"SteamOverlayGameId": BS_APP_ID,
"SteamGameId": BS_APP_ID,
});
const command = this.getCommand(
protonPrefix, bsFolderPath,
env, launchOptions
const command = await this.getCommand(
launchOptions, steamPath, beatSaberFolderPath
);
const desktopEntry = [
@@ -222,7 +218,7 @@ export class LinuxService {
"Type=Application",
`Name=${name}`,
`Icon=${icon}`,
`Path=${bsFolderPath}`,
`Path=${beatSaberFolderPath}`,
`Exec=${command}`
].join("\n");
@@ -240,31 +236,20 @@ export class LinuxService {
icon: string,
launchOptions: LaunchOption,
steamPath: string,
bsFolderPath: string
beatSaberFolderPath: string
): Promise<SteamShortcutData> {
const env = await this.buildEnvVariables(
launchOptions, steamPath, bsFolderPath
const protonPath = await this.getProtonPath();
const command = await this.getCommand(
launchOptions, steamPath, beatSaberFolderPath
);
Object.assign(env, {
"SteamAppId": BS_APP_ID,
"SteamOverlayGameId": BS_APP_ID,
"SteamGameId": BS_APP_ID,
});
const protonPrefix = await this.isNixOS()
? "steam-run %command% run"
: "%command% run";
return {
AppName: shortcutName,
Exe: await this.getProtonPath(),
StartDir: bsFolderPath,
Exe: protonPath,
StartDir: beatSaberFolderPath,
icon,
OpenVR: "\x01",
LaunchOptions: this.getCommand(
protonPrefix, bsFolderPath,
env, launchOptions
)
LaunchOptions: command
};
}
@@ -3,18 +3,47 @@ import { BbmFullMod, BbmMod, BbmModVersion, BbmPlatform } from "../../../shared/
import { RequestService } from "../request.service";
import { BsStore } from "../../../shared/models/bs-store.enum";
import log from "electron-log"
import { StaticConfigurationService } from "../static-configuration.service";
import { ModRepo } from "shared/models/mods/repo.model";
export class BeatModsApiService {
private static instance: BeatModsApiService;
private readonly staticConfig: StaticConfigurationService;
private readonly requestService: RequestService;
public readonly MODS_REPO_URL = "https://beatmods.com";
private readonly MODS_REPO_API_URL = `${this.MODS_REPO_URL}/api`;
private static readonly MOD_REPO_LIST:ModRepo[] = [
{
id: "beatmods",
mods_repo_url: "https://beatmods.com",
mods_repo_api_url: "https://beatmods.com/api",
display_name: "BeatMods",
website: "https://beatmods.com"
},
{
id: "beatsabercn",
mods_repo_url: "https://beatmods.bsaber.cn",
mods_repo_api_url: "https://beatmods.bsaber.cn/api",
display_name: "CN中文镜像源",
website: "https://beatmods.bsaber.cn/front/mods"
}
];
private selectedModRepo: ModRepo = BeatModsApiService.MOD_REPO_LIST.find(repo => repo.default) || BeatModsApiService.MOD_REPO_LIST[0];
public getSelectedModRepo(): ModRepo {
return this.selectedModRepo;
}
private readonly versionModsCache = new Map<string, BbmFullMod[]>();
private readonly modsHashCache = new Map<string, BbmModVersion>();
private resetCache(){
this.versionModsCache.clear();
this.modsHashCache.clear();
}
public static getInstance(): BeatModsApiService {
if (!BeatModsApiService.instance) {
BeatModsApiService.instance = new BeatModsApiService();
@@ -23,23 +52,49 @@ export class BeatModsApiService {
}
private constructor() {
this.staticConfig = StaticConfigurationService.getInstance();
this.requestService = RequestService.getInstance();
const repoId = this.staticConfig.get("selected-mod-repo");
if(repoId){
this.selectedModRepo = BeatModsApiService.MOD_REPO_LIST.find(repo => repo.id === repoId) || BeatModsApiService.MOD_REPO_LIST[0];
}
}
public async isUp(): Promise<boolean> {
try {
// The data in status can be dropped
await this.requestService.getJSON<{}>(`${this.MODS_REPO_API_URL}/status`);
await this.requestService.getJSON<{}>(`${this.getSelectedModRepo().mods_repo_api_url}/status`);
return true;
} catch (error) {
log.error("Could not connect to beatmods", error);
log.error(`Could not connect to ${this.selectedModRepo.mods_repo_api_url}`, error);
return false;
}
}
private getVersionModsUrl(version: BSVersion): string {
const platform: BbmPlatform = version.oculus || version.metadata?.store === BsStore.OCULUS ? BbmPlatform.OculusPC : BbmPlatform.SteamPC;
return `${this.MODS_REPO_API_URL}/mods?status=verified&gameVersion=${version.BSVersion}&gameName=BeatSaber&platform=${platform}`;
return `${this.getSelectedModRepo().mods_repo_api_url}/mods?status=verified&gameVersion=${version.BSVersion}&gameName=BeatSaber&platform=${platform}`;
}
public async getModRepoList():Promise<ModRepo[]>{
return BeatModsApiService.MOD_REPO_LIST;
}
public async getSelectedModRepoAsync():Promise<ModRepo>{
return this.getSelectedModRepo();
}
public async selectModRepo(repoId:string): Promise<boolean>{
const selectedRepo = BeatModsApiService.MOD_REPO_LIST.find(repo => repo.id === repoId);
if(!selectedRepo){
return false;
}
this.selectedModRepo = selectedRepo;
this.staticConfig.set("selected-mod-repo", repoId);
this.resetCache()
return true;
}
private updateModsHashCache(mods: BbmModVersion[]): void {
@@ -76,8 +131,7 @@ export class BeatModsApiService {
}
return this.requestService.getJSON<{ modVersions: BbmModVersion[] }>(
`${this.MODS_REPO_API_URL}/hashlookup?hash=${hash}`,
{ silentError: true }
`${this.getSelectedModRepo().mods_repo_api_url}/hashlookup?hash=${hash}`
).then(({ data }) => {
this.updateModsHashCache(data?.modVersions ?? []);
return data?.modVersions?.at(0);
@@ -49,12 +49,11 @@ export class BsModsManagerService {
return undefined;
});
if(mod?.contentHashes?.some(content => content.path.includes("IPA.exe"))){
if (mod?.contentHashes?.some(content => content.path.includes("IPA.exe"))) {
return undefined;
}
return mod;
}
private async getModsInDir(
@@ -129,7 +128,7 @@ export class BsModsManagerService {
}
private async downloadZip(zipUrl: string): Promise<BsmZipExtractor> {
zipUrl = new URL(zipUrl, this.beatModsApi.MODS_REPO_URL).href;
zipUrl = new URL(zipUrl, this.beatModsApi.getSelectedModRepo().mods_repo_url).href;
log.info("Download mod zip", zipUrl);
@@ -145,9 +144,9 @@ export class BsModsManagerService {
return BsmZipExtractor.fromBuffer(buffer);
}
private async executeBSIPA(version: BSVersion, args: string[]): Promise<boolean> {
log.info("executeBSIPA", version?.BSVersion, args);
private async executeIPA(version: BSVersion, args: string[]): Promise<boolean> {
log.info("executeIPA", version?.BSVersion, args);
const versionPath = await this.bsLocalService.getVersionPath(version);
const ipaPath = path.join(versionPath, "IPA.exe");
@@ -157,39 +156,24 @@ export class BsModsManagerService {
return false;
}
const env: Record<string, string> = {};
const cmd = `"${ipaPath}" "${bsExePath}" ${args.join(" ")}`;
let winePath: string = "";
if (process.platform === "linux") {
const { error: winePathError, result: winePathResult } =
await tryit(async () => this.linuxService.getWinePath());
if (winePathError) {
log.error(winePathError);
return false;
}
winePath = `"${winePathResult}"`;
const winePrefix = this.linuxService.getWinePrefixPath();
if (!winePrefix) {
throw new CustomError("Could not find BSManager WINEPREFIX path", "no-wineprefix");
}
env.WINEPREFIX = winePrefix;
const command = await this.getCommand(ipaPath, bsExePath, args);
if (!command) {
return false;
}
return new Promise<boolean>(resolve => {
const processIPA = bsmSpawn(cmd, {
const processIPA = bsmSpawn(command.command, {
log: BsmShellLog.Command | BsmShellLog.EnvVariables,
options: {
cwd: versionPath,
detached: true,
shell: true,
env
env: command.env
},
linux: { prefix: winePath },
});
const timeout = setTimeout(() => {
log.info("Ipa process timeout");
log.info("IPA process timed out");
resolve(false)
}, sToMs(30));
@@ -203,16 +187,55 @@ export class BsModsManagerService {
processIPA.once("exit", code => {
clearTimeout(timeout);
if (code === 0) {
log.info("Ipa process exist with code 0");
return resolve(true);
}
log.error("Ipa process exist with non 0 code", code);
log.error("IPA process exited with non-zero code", code);
resolve(false);
});
});
}
private async getCommand(
ipaPath: string,
beatSaberExePath: string,
args: string[]
): Promise<{
env: Record<string, string>;
command: string;
} | null> {
const command = `"${ipaPath}" "${beatSaberExePath}" ${args.join(" ")}`;
if (process.platform === "win32") {
return {
env: { ...process.env },
command,
};
}
const { error: winePathError, result: winePathResult } =
tryit(() => this.linuxService.getWinePath());
if (winePathError) {
log.error(winePathError);
return null;
}
const winePath = await this.linuxService.isNixOS()
? `steam-run "${winePathResult}"`
: `"${winePathResult}"`;
const winePrefix = this.linuxService.getWinePrefixPath();
if (!winePrefix) {
throw new CustomError("Could not find BSManager WINEPREFIX path", "no-wineprefix");
}
return {
env: {
...process.env,
WINEPREFIX: winePrefix
},
command: `${winePath} ${command}`,
};
}
private getModDownload(modVersion: BbmModVersion): string {
return `/cdn/mod/${modVersion.zipHash}.zip`
}
@@ -222,7 +245,7 @@ export class BsModsManagerService {
const isBSIPA = mod.mod.name.toLowerCase() === "bsipa";
if(isBSIPA){
if (isBSIPA) {
await this.clearIpaFolder(version).catch(e => log.error("Error while clearing IPA folder", e));
}
@@ -269,9 +292,11 @@ export class BsModsManagerService {
log.info("Mod zip extraction end", mod.mod.name, "to", destDir, "success:", extracted);
const res = isBSIPA
// Executing IPA.exe when BSIPA is already installed could potentially corrupt the game.
const shouldRunIPA = isBSIPA && !pathExistsSync(path.join(versionPath, "winhttp.dll"));
const res = shouldRunIPA
? extracted &&
(await this.executeBSIPA(version, ["-n"]).catch(e => {
(await this.executeIPA(version, ["-n"]).catch(e => {
log.error(e);
return false;
}))
@@ -286,14 +311,14 @@ export class BsModsManagerService {
const versionPath = await this.bsLocalService.getVersionPath(version);
const ipaPath = path.join(versionPath, ModsInstallFolder.IPA);
if(!pathExistsSync(ipaPath)){
if (!pathExistsSync(ipaPath)) {
log.info("IPA folder does not exist, skipping");
return;
}
const contents = readdirSync(ipaPath, { withFileTypes: true });
for(const content of contents){
for (const content of contents) {
if (content.name === 'Backups' || content.name === 'Pending') {
continue;
@@ -306,13 +331,12 @@ export class BsModsManagerService {
: deleteFile(contentPath)
);
if(res.error){
if (res.error) {
log.error("Error while clearing IPA folder content", content.name, res.error);
}
}
log.info("IPA folder cleared successfully");
}
private async uninstallBSIPA(mod: BbmFullMod, version: BSVersion): Promise<void> {
@@ -324,15 +348,18 @@ export class BsModsManagerService {
return;
}
await this.executeBSIPA(version, ["--revert", "-n"]);
await this.executeIPA(version, ["--revert", "-n"]);
const promises = mod.version.contentHashes.map(content => {
const file = content.path.replaceAll("IPA/", "").replaceAll("Data", "Beat Saber_Data");
return deleteFile(path.join(verionPath, file));
return deleteFile(path.join(verionPath, file)).catch(err => {
log.info("Unable to delete IPA file, likely because it has been removed by the --revert command. Here is the error:", err);
});
});
await Promise.all(promises);
}
private async uninstallMod(mod: BbmFullMod, version: BSVersion): Promise<void> {
if (mod.mod.name.toLowerCase() === "bsipa") {
return this.uninstallBSIPA(mod, version);
@@ -343,13 +370,13 @@ export class BsModsManagerService {
const promises: Promise<void>[] = mod.version.contentHashes.map(async content => {
return (async () => {
const modPath = path.join(versionPath, content.path);
if(pathExistsSync(modPath)){
if (pathExistsSync(modPath)) {
log.info("Deleting mod", modPath);
await deleteFile(modPath);
}
const pendingPath = path.join(versionPath, "IPA", "Pending", content.path);
if(pathExistsSync(pendingPath)){
if (pathExistsSync(pendingPath)) {
log.info("Deleting pending mod", pendingPath);
return deleteFile(pendingPath);
}
@@ -513,12 +540,12 @@ export class BsModsManagerService {
const bsipa = popElement(mod => mod.mod.name.toLowerCase() === "bsipa", mods);
if(bsipa){
if (bsipa) {
const bsipaInstalled = await this.installMod(bsipa, version).catch(err => {
log.error("Error while installing BSIPA", err);
});
if(!bsipaInstalled){
if (!bsipaInstalled) {
throw CustomError.throw(new Error("BSIPA failed to install"), "cannot-install-bsipa");
}
+480 -64
View File
@@ -9,7 +9,9 @@ import { tryit } from 'shared/helpers/error.helpers';
import path from 'path';
import { pipeline } from 'stream/promises';
import sanitize from 'sanitize-filename';
import { app } from 'electron';
import internal from 'stream';
import { app, net } from 'electron';
import { CookieJar } from 'tough-cookie';
export class RequestService {
private static instance: RequestService;
@@ -17,49 +19,224 @@ export class RequestService {
'User-Agent': `BSManager/${app.getVersion()} (Electron/${process.versions.electron} Chrome/${process.versions.chrome} Node/${process.versions.node})`,
}
private readonly PREFERRED_FAMILY_TESTS = [4, 6];
private preferredFamilyCache: Record<string, number> = {};
public static getInstance(): RequestService {
if (!RequestService.instance) {
RequestService.instance = new RequestService();
}
return RequestService.instance;
}
private constructor() {}
public async getJSON<T = unknown>(url: string, options?: {
silentError?: boolean
}): Promise<{ data: T; headers: IncomingHttpHeaders }> {
try {
// @ts-ignore (ESM is not well supported in this project, We need to move out electron-react-boilerplate, and use Vite)
const res = await got(url, { responseType: 'json', headers: this.baseHeaders });
return { data: res.body as T, headers: res.headers };
} catch (err) {
if (options?.silentError !== true) {
log.error(`Failed to get JSON from URL: ${url}`, err);
}
throw err;
}
private isBeatmodsUrl(url: string): boolean {
const { hostname } = new URL(url);
return hostname === 'beatmods.com' || hostname.endsWith('.beatmods.com');
}
public downloadFile(
/**
* Uses Electron's Chromium network stack instead of Node's HTTP stack
* to avoid Cloudflare timeout issues that occur with beatmods.com
*/
private async requestWithElectronNet<T = unknown>(url: string): Promise<{ data: T; headers: IncomingHttpHeaders }> {
return new Promise<{ data: T; headers: IncomingHttpHeaders }>((resolve, reject) => {
const request = net.request({
method: 'GET',
url,
headers: this.baseHeaders,
});
let responseBody = Buffer.alloc(0);
let responseHeaders: IncomingHttpHeaders = {};
let isResolved = false;
const timeoutId = setTimeout(() => {
if (!isResolved) {
isResolved = true;
request.abort();
reject(new Error(`Request timeout for ${url}`));
}
}, 15000);
const cleanup = () => {
clearTimeout(timeoutId);
};
request.on('response', (response) => {
responseHeaders = response.headers as IncomingHttpHeaders;
// Validate HTTP status code (got throws on non-2xx by default)
const { statusCode } = response;
if (statusCode < 200 || statusCode >= 300) {
isResolved = true;
cleanup();
reject(new Error(`Request failed with status ${statusCode} for ${url}`));
return;
}
response.on('data', (chunk: Buffer) => {
responseBody = Buffer.concat([responseBody, chunk]);
});
response.on('end', () => {
if (isResolved) return;
isResolved = true;
cleanup();
try {
const bodyText = responseBody.toString('utf-8');
const data = JSON.parse(bodyText) as T;
resolve({ data, headers: responseHeaders });
} catch (parseError) {
reject(new Error(`Failed to parse JSON response from ${url}: ${parseError}`));
}
});
response.on('error', (error) => {
if (isResolved) return;
isResolved = true;
cleanup();
reject(new Error(`Response stream error for ${url}: ${error.message}`));
});
});
request.on('error', (error) => {
if (isResolved) return;
isResolved = true;
cleanup();
reject(new Error(`Network error requesting ${url}: ${error.message}`));
});
request.end();
});
}
public async getJSON<T = unknown>(url: string): Promise<{ data: T; headers: IncomingHttpHeaders }> {
// Node's HTTP stack has Cloudflare compatibility issues with beatmods.com
if (this.isBeatmodsUrl(url)) {
return this.requestWithElectronNet<T>(url);
}
const domain = (new URL(url)).hostname;
const cachedFamily = this.preferredFamilyCache[domain];
if (cachedFamily) {
try {
return await this.requestData<T>(url, cachedFamily);
} catch (error: any) {
throw new Error(`Request failed: ${url}`, error);
}
}
// Try on each IPv4/6 families on first request to a domain/website
for (const family of this.PREFERRED_FAMILY_TESTS) {
try {
const response = await this.requestData<T>(url, family);
log.info(`Caching "${domain}" with IPv${family}`);
this.preferredFamilyCache[domain] = family;
return response;
} catch (err) {
log.warn(`IPv${family} request failed, trying next one... URL: ${url}`, err);
}
}
throw new Error(`IPv4 and IPv6 requests failed for URL: ${url}`);
}
private async requestData<T>(url: string, family: number): Promise<{ data: T; headers: IncomingHttpHeaders }> {
const cookieJar = new CookieJar();
const first = await got(url, {
// @ts-ignore (ESM is not well supported in this project, We need to move out electron-react-boilerplate, and use Vite)
dnsLookupIpVersion: family,
cookieJar,
headers: this.baseHeaders
});
// Follow script redirect to get the JSON
if (first.headers['content-type']?.includes('text/html')) {
const cookieMatch = first.body.match(/document\.cookie="([^"]+)"/);
if (!cookieMatch) {
throw new Error("Cookie not found in JS");
}
const cookieString = cookieMatch[1];
const redirectMatch = first.body.match(/location\.href="([^"]+)"/);
if (!redirectMatch) {
throw new Error("Redirect URL not found");
}
const jsonUrl = redirectMatch[1];
await cookieJar.setCookie(cookieString, jsonUrl);
const second = await got(jsonUrl, {
// @ts-ignore (ESM is not well supported in this project, We need to move out electron-react-boilerplate, and use Vite)
dnsLookupIpVersion: family,
responseType: "json",
cookieJar,
headers: this.baseHeaders
});
return {
data: second.body as T,
headers: second.headers
};
}
return {
data: JSON.parse(first.body) as T,
headers: first.headers
};
}
/**
* Uses Electron's Chromium network stack instead of Node's HTTP stack
* to avoid Cloudflare timeout issues that occur with beatmods.com
*/
private downloadFileWithElectronNet(
url: string,
dest: string,
opt?: { preferContentDisposition?: boolean }
): Observable<Progression<string>> {
return new Observable<Progression<string>>((subscriber) => {
const progress: Progression<string> = { current: 0, total: 0 };
let file: WriteStream | undefined;
let isCompleted = false;
// @ts-ignore (ESM is not well supported in this project, We need to move out electron-react-boilerplate, and use Vite)
const stream = got.stream(url, { headers: this.baseHeaders });
const request = net.request({
method: 'GET',
url,
headers: this.baseHeaders,
});
stream.on('response', (response) => {
const cleanup = () => {
if (file) {
file.destroy();
}
};
const filename = opt?.preferContentDisposition ? this.getFilenameFromContentDisposition(response.headers['content-disposition']) : null;
request.on('response', (response) => {
// Validate HTTP status code (got throws on non-2xx by default)
const { statusCode } = response;
if (statusCode < 200 || statusCode >= 300) {
isCompleted = true;
cleanup();
subscriber.error(new Error(`Download failed with status ${statusCode} for ${url}`));
return;
}
const contentLength = response.headers['content-length'];
if (contentLength) {
const length = Array.isArray(contentLength) ? contentLength[0] : contentLength;
progress.total = parseInt(length, 10);
}
const filename = opt?.preferContentDisposition
? this.getFilenameFromContentDisposition(response.headers['content-disposition'] as string)
: null;
if (filename) {
dest = path.join(path.dirname(dest), sanitize(filename));
@@ -68,30 +245,145 @@ export class RequestService {
progress.data = dest;
file = createWriteStream(dest);
pipeline(stream, file).catch(err => {
file?.destroy();
file.on('error', (error) => {
cleanup();
tryit(() => deleteFileSync(dest));
subscriber.error(err);
if (!isCompleted) {
isCompleted = true;
subscriber.error(new Error(`File write error for ${dest}: ${error.message}`));
}
});
response.on('data', (chunk: Buffer) => {
if (file && !file.destroyed) {
progress.current += chunk.length;
subscriber.next(progress);
file.write(chunk);
}
});
response.on('end', () => {
if (isCompleted) return;
if (file && !file.destroyed) {
file.once('finish', () => {
if (isCompleted) return;
isCompleted = true;
subscriber.next(progress);
subscriber.complete();
});
file.end();
} else {
isCompleted = true;
subscriber.next(progress);
subscriber.complete();
}
});
response.on('error', (error) => {
if (isCompleted) return;
isCompleted = true;
cleanup();
tryit(() => deleteFileSync(dest));
subscriber.error(error);
});
});
stream.on('downloadProgress', ({ transferred, total }) => {
progress.current = transferred;
progress.total = total;
subscriber.next(progress);
request.on('error', (error) => {
if (isCompleted) return;
isCompleted = true;
cleanup();
tryit(() => deleteFileSync(dest));
subscriber.error(error);
});
stream.on('error', err => {
log.error(`Download failed for URL: ${url}`, err);
stream.destroy();
file?.destroy();
});
request.end();
stream.on('end', () => {
file?.end();
subscriber.next(progress);
subscriber.complete();
});
return () => {
request.abort();
cleanup();
};
}).pipe(
tap({ error: (e) => log.error(e, url, dest) }),
shareReplay(1)
);
}
public downloadFile(
url: string,
dest: string,
opt?: { preferContentDisposition?: boolean }
): Observable<Progression<string>> {
// Node's HTTP stack has Cloudflare compatibility issues with beatmods.com
if (this.isBeatmodsUrl(url)) {
return this.downloadFileWithElectronNet(url, dest, opt);
}
return new Observable<Progression<string>>((subscriber) => {
const progress: Progression<string> = { current: 0, total: 0 };
let attempt = 0;
let stream: got.GotEmitter & internal.Duplex;
const domain = (new URL(url)).hostname;
const cachedFamily = this.preferredFamilyCache[domain];
const familiesToTry = cachedFamily
? [ cachedFamily ] : this.PREFERRED_FAMILY_TESTS;
const tryNextFamily = () => {
if (attempt >= familiesToTry.length) {
subscriber.error(new Error(`Download failed over IPv4 and IPv6 for URL: ${url}`));
return;
}
const family = familiesToTry[attempt++];
let file: WriteStream | undefined;
// @ts-ignore (ESM is not well supported in this project, We need to move out electron-react-boilerplate, and use Vite)
stream = got.stream(url, { dnsLookupIpVersion: family, headers: this.baseHeaders });
stream.on('response', (response) => {
if (!cachedFamily) {
log.info(`Caching "${domain}" with IPv${family}`);
this.preferredFamilyCache[domain] = family;
}
const filename = opt?.preferContentDisposition ? this.getFilenameFromContentDisposition(response.headers['content-disposition']) : null;
if (filename) {
dest = path.join(path.dirname(dest), sanitize(filename));
}
progress.data = dest;
file = createWriteStream(dest);
pipeline(stream, file).catch(err => {
file?.destroy();
tryit(() => deleteFileSync(dest));
subscriber.error(err);
});
});
stream.on('downloadProgress', ({ transferred, total }) => {
progress.current = transferred;
progress.total = total;
subscriber.next(progress);
});
stream.on('error', err => {
log.warn(`Download failed over IPv${family} for URL: ${url}`, err);
stream.destroy();
file?.destroy();
tryNextFamily();
});
stream.on('end', () => {
file?.end();
subscriber.next(progress);
subscriber.complete();
});
};
tryNextFamily();
return () => {
stream?.destroy();
@@ -102,10 +394,111 @@ export class RequestService {
);
}
/**
* Uses Electron's Chromium network stack instead of Node's HTTP stack
* to avoid Cloudflare timeout issues that occur with beatmods.com
*/
private downloadBufferWithElectronNet(
url: string,
options?: got.GotOptions<null>
): Observable<Progression<Buffer, IncomingMessage>> {
return new Observable<Progression<Buffer, IncomingMessage>>((subscriber) => {
const progress: Progression<Buffer, IncomingMessage> = {
current: 0,
total: 0,
data: null,
};
// Convert headers to the format expected by electron.net (string | string[])
const electronHeaders: Record<string, string | string[]> = { ...this.baseHeaders };
if (options?.headers) {
for (const [key, value] of Object.entries(options.headers)) {
if (typeof value === 'string' || Array.isArray(value)) {
electronHeaders[key] = value;
} else if (value != null) {
electronHeaders[key] = String(value);
}
}
}
let data = Buffer.alloc(0);
let responseHeaders: IncomingHttpHeaders = {};
let isCompleted = false;
const request = net.request({
method: 'GET',
url,
headers: electronHeaders,
});
request.on('response', (response) => {
// Validate HTTP status code (got throws on non-2xx by default)
const { statusCode } = response;
if (statusCode < 200 || statusCode >= 300) {
isCompleted = true;
subscriber.error(new Error(`Download failed with status ${statusCode} for ${url}`));
return;
}
const contentLength = response.headers['content-length'];
if (contentLength) {
const length = Array.isArray(contentLength) ? contentLength[0] : contentLength;
progress.total = parseInt(length, 10);
}
responseHeaders = response.headers as IncomingHttpHeaders;
response.on('data', (chunk: Buffer) => {
data = Buffer.concat([data, chunk]);
progress.current = data.length;
subscriber.next(progress);
});
response.on('end', () => {
if (isCompleted) return;
isCompleted = true;
progress.data = data;
// Required to maintain API compatibility with got-based implementation
const mockResponse = {
headers: responseHeaders,
} as IncomingMessage;
progress.extra = mockResponse;
subscriber.next(progress);
subscriber.complete();
});
response.on('error', (error) => {
if (isCompleted) return;
isCompleted = true;
subscriber.error(error);
});
});
request.on('error', (error) => {
if (isCompleted) return;
isCompleted = true;
subscriber.error(error);
});
request.end();
return () => {
request.abort();
};
}).pipe(
tap({ error: (e) => log.error(e, url) }),
shareReplay(1)
);
}
public downloadBuffer(
url: string,
options?: got.GotOptions<null>
): Observable<Progression<Buffer, IncomingMessage>> {
// Node's HTTP stack has Cloudflare compatibility issues with beatmods.com
if (this.isBeatmodsUrl(url)) {
return this.downloadBufferWithElectronNet(url, options);
}
return new Observable<Progression<Buffer, IncomingMessage>>((subscriber) => {
const progress: Progression<Buffer, IncomingMessage> = {
@@ -116,37 +509,60 @@ export class RequestService {
const headers = { ...this.baseHeaders, ...(options?.headers ?? {}) };
// @ts-ignore (ESM is not well supported in this project, We need to move out electron-react-boilerplate, and use Vite)
const stream = got.stream(url, { ...(options ?? {}), headers });
let attempt = 0;
let stream: got.GotEmitter & internal.Duplex;
let data = Buffer.alloc(0);
let response: IncomingMessage;
const domain = (new URL(url)).hostname;
const cachedFamily = this.preferredFamilyCache[domain];
const familiesToTry = cachedFamily
? [ cachedFamily ] : this.PREFERRED_FAMILY_TESTS;
stream.once('response', (res) => {
response = res;
});
const tryNextFamily = () => {
if (attempt >= familiesToTry.length) {
subscriber.error(new Error(`Download failed over IPv4 and IPv6 for URL: ${url}`));
return;
}
stream.on('data', (chunk: Buffer) => {
data = Buffer.concat([data, chunk]);
});
const family = familiesToTry[attempt++];
// @ts-ignore (ESM is not well supported in this project, We need to move out electron-react-boilerplate, and use Vite)
stream = got.stream(url, { dnsLookupIpVersion: family, ...(options ?? {}), headers });
stream.on('downloadProgress', ({ transferred, total }) => {
progress.current = transferred;
progress.total = total;
subscriber.next(progress);
});
let data = Buffer.alloc(0);
let response: IncomingMessage;
stream.on('error', err => {
log.error(`Download failed for URL: ${url}`, err);
stream.destroy();
});
stream.once('response', (res) => {
if (!cachedFamily) {
log.info(`Caching "${domain}" with IPv${family}`);
this.preferredFamilyCache[domain] = family;
}
response = res;
});
stream.on('end', () => {
progress.data = data;
progress.extra = response;
subscriber.next(progress);
subscriber.complete();
});
stream.on('data', (chunk: Buffer) => {
data = Buffer.concat([data, chunk]);
});
stream.on('downloadProgress', ({ transferred, total }) => {
progress.current = transferred;
progress.total = total;
subscriber.next(progress);
});
stream.on('error', err => {
log.warn(`Download failed over IPv${family} for URL: ${url}`, err);
stream.destroy();
tryNextFamily();
});
stream.on('end', () => {
progress.data = data;
progress.extra = response;
subscriber.next(progress);
subscriber.complete();
});
};
tryNextFamily();
return () => {
stream?.destroy();
@@ -5,6 +5,7 @@ import { PROTON_BINARY_PREFIX, WINE_BINARY_PREFIX } from "main/constants";
import { Observable, Subject } from "rxjs";
import { CustomError } from "shared/models/exceptions/custom-error.class";
import { BSVersion } from "shared/bs-version.interface";
import { AutoUpdate } from "shared/models/config";
export class StaticConfigurationService {
private static instance: StaticConfigurationService;
@@ -30,8 +31,8 @@ export class StaticConfigurationService {
return this.store.has(key);
}
public get<K extends StaticConfigKeys>(key: K): StaticConfigKeyValues[K] {
return this.store.get<K>(key) as StaticConfigKeyValues[K];
public get<K extends StaticConfigKeys>(key: K, defaultValue?: StaticConfigKeyValues[K]): StaticConfigKeyValues[K] {
return this.store.get<K>(key, defaultValue) as StaticConfigKeyValues[K];
}
public take<K extends StaticConfigKeys>(key: K, cb: (val: StaticConfigKeyValues[K]) => void): void {
@@ -90,6 +91,8 @@ export interface StaticConfigKeyValues {
"use-symlinks": boolean;
"use-system-proxy": boolean;
"last-version-launched": BSVersion;
"auto-update": AutoUpdate;
"selected-mod-repo": string;
// Linux Specific static configs
"proton-folder": string;
@@ -249,7 +249,7 @@ export const LocalMapsListPanel = forwardRef<unknown, Props>(({
return (
<VirtualScroll
classNames={{ mainDiv: className, rows: "gap-x-2 px-2 py-2" }}
classNames={{ mainDiv: className, rows: "gap-x-2 px-2 pt-2 pb-[108px]" }}
itemHeight={108}
maxColumns={3}
minItemWidth={400}
@@ -6,13 +6,12 @@ import { BsmButton } from "renderer/components/shared/bsm-button.component";
import { LaunchOption } from "shared/models/bs-launch";
import { useService } from "renderer/hooks/use-service.hook";
import { BSLauncherService } from "renderer/services/bs-launcher.service";
import { useMemo, useState } from "react";
import { useState } from "react";
import { BsNoteFill } from "renderer/components/svgs/icons/bs-note-fill.component";
import { useThemeColor } from "renderer/hooks/use-theme-color.hook";
import { ChevronTopIcon } from "renderer/components/svgs/icons/chevron-top-icon.component";
import Tippy from "@tippyjs/react";
import { LaunchMod } from "shared/models/bs-launch/launch-option.interface";
import { BsStore } from "shared/models/bs-store.enum";
export const CreateLaunchShortcutModal: ModalComponent<{ steamShortcut: boolean, launchOption: LaunchOption }, BSVersion> = ({resolver, options: {data}}) => {
@@ -26,10 +25,6 @@ export const CreateLaunchShortcutModal: ModalComponent<{ steamShortcut: boolean,
const [command, setCommand] = useState(launchOption.command || "");
const [steamShortcut, setSteamShortcut] = useState(false);
const isSteamVersion = useMemo(() => {
return data.steam || data.metadata?.store === BsStore.STEAM;
}, [data]);
const completeModal = () => {
launchOption.command = command.trim();
resolver({exitCode: ModalExitCode.COMPLETED, data: { launchOption, steamShortcut }});
@@ -96,17 +91,15 @@ export const CreateLaunchShortcutModal: ModalComponent<{ steamShortcut: boolean,
</div>
</div>
</div>
{isSteamVersion && (
<Tippy placement="right" theme="default" content={t("modals.create-launch-shortcut.steam-shortcut-tippy")}>
<div className="h-full flex items-center gap-1.5 mt-3 mb-4 w-fit pr-1">
<BsmCheckbox className="h-5 aspect-square relative z-[1]" checked={steamShortcut} onChange={e => setSteamShortcut(() => e)} />
<span>{t("modals.create-launch-shortcut.create-steam-shortcut")}</span>
</div>
</Tippy>
)}
<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={completeModal} withBar={false} text="modals.create-launch-shortcut.valid-btn" />
<Tippy placement="right" theme="default" content={t("modals.create-launch-shortcut.steam-shortcut-tippy")}>
<div className="h-full flex items-center gap-1.5 mt-3 mb-4 w-fit pr-1">
<BsmCheckbox className="h-5 aspect-square relative z-[1]" checked={steamShortcut} onChange={e => setSteamShortcut(() => e)} />
<span>{t("modals.create-launch-shortcut.create-steam-shortcut")}</span>
</div>
</Tippy>
<div className="grid grid-flow-col grid-cols-2 gap-4 h-8">
<BsmButton typeColor="cancel" className="h-full flex items-center justify-center rounded-md text-center transition-all" onClick={() => resolver({ exitCode: ModalExitCode.CANCELED })} withBar={false} text="misc.cancel" />
<BsmButton typeColor="primary" className="h-full flex items-center justify-center rounded-md text-center transition-all" onClick={completeModal} withBar={false} text="modals.create-launch-shortcut.valid-btn" />
</div>
</form>
)
@@ -119,7 +119,7 @@ export const DownloadMapsModal: ModalComponent<void, { version: BSVersion; owned
setMaps(prev => [...prev, ...maps])
if (maps.length < tryToLoad) {
handleLoadMore();
handleLoadMore(false);
return;
}
@@ -185,9 +185,9 @@ export const DownloadMapsModal: ModalComponent<void, { version: BSVersion; owned
setSearchParams(() => searchParamsLocal);
};
const handleLoadMore = () => {
const handleLoadMore = (skipLoading: boolean = true) => {
if(loading){ return; }
if(skipLoading && loading){ return; }
setSearchParams(prev => {
return { ...prev, page: prev.page + 1 };
@@ -74,9 +74,9 @@ export function Modal() {
return (
<AnimatePresence>
{currentModal ? <motion.span key={crypto.randomUUID()} onClick={onOverlayClicked} className="fixed size-full bg-black z-[90]" initial={{ opacity: 0 }} animate={{ opacity: currentModal && 0.6 }} exit={{ opacity: 0 }} transition={{ duration: 0.2 }} /> : undefined}
{currentModal ? <motion.span key="modal-overlay" onClick={onOverlayClicked} className="fixed size-full bg-black z-[90]" initial={{ opacity: 0 }} animate={{ opacity: currentModal && 0.6 }} exit={{ opacity: 0 }} transition={{ duration: 0.2 }} /> : undefined}
{modals?.map(modal => (
<motion.div key={crypto.randomUUID()} className="fixed z-[90] top-1/2 left-1/2" initial={{ y: "100vh", x: "-50%" }} animate={{y: "-50%", scale: modal === currentModal ? 1 : 0, opacity: modal === currentModal ? 1 : 0, display: modal === currentModal ? "block" : ["block", "none"]}} exit={{ y: "100vh" }}>
<motion.div key={modal.id} className="fixed z-[90] top-1/2 left-1/2" initial={{ y: "100vh", x: "-50%" }} animate={{y: "-50%", scale: modal === currentModal ? 1 : 0, opacity: modal === currentModal ? 1 : 0, display: modal === currentModal ? "block" : ["block", "none"]}} exit={{ y: "100vh" }}>
{renderModal(modal)}
</motion.div>
))}
@@ -8,10 +8,11 @@ type Props<T> = {
selectedItemId?: number;
selectedItemValue?: T;
direction?: CSSProperties["flexDirection"],
columnCount?: number;
onItemSelected?: (item: RadioItem<T>) => void
};
export function SettingRadioArray<T>({ id, items, selectedItemId, selectedItemValue, onItemSelected, direction = "column" }: Props<T>) {
export function SettingRadioArray<T>({ id, items, selectedItemId, selectedItemValue, onItemSelected, direction = "column",columnCount = 1, }: Props<T>) {
const t = useTranslation();
const isSelected = (item: RadioItem<T>) => {
@@ -19,17 +20,17 @@ export function SettingRadioArray<T>({ id, items, selectedItemId, selectedItemVa
}
return (
<div id={id} className="w-full flex gap-1.5" style={{flexDirection: direction}}>
<div id={id} className="w-full grid gap-1.5" style={{flexDirection: direction, gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))`}}>
{items.map(i => (
<div onClick={() => onItemSelected(i)} key={i.id} className={`py-3 w-full flex cursor-pointer justify-between items-center rounded-md px-2 transition-colors duration-300 ${isSelected(i) ? "bg-light-main-color-3 dark:bg-main-color-3" : "bg-light-main-color-1 dark:bg-main-color-1"} ${i.className}`}>
<div onClick={() => onItemSelected(i)} key={i.id} className={`h-12 py-3 w-full flex cursor-pointer justify-between rounded-md px-2 transition-colors duration-300 ${isSelected(i) ? "bg-light-main-color-3 dark:bg-main-color-3" : "bg-light-main-color-1 dark:bg-main-color-1"} ${i.className}`}>
<div className="flex items-center">
<div className="h-5 rounded-full aspect-square border-2 border-gray-800 dark:border-white p-[3px] mr-2">
<motion.span initial={{ scale: 0 }} animate={{ scale: isSelected(i) ? 1 : 0 }} className="h-full w-full block bg-gray-800 dark:bg-white rounded-full" />
</div>
<h2 className="font-extrabold">{t(i.text)}</h2>
<h2 className="font-extrabold text-nowrap">{t(i.text)}</h2>
</div>
{i.icon && (
<div className="flex items-center">
<div className="flex items-center text-right">
{i.textIcon && <span className="text-sm">{t(i.textIcon)}</span>}
{i.icon}
</div>
@@ -1,4 +1,4 @@
import { forwardRef, LegacyRef, useImperativeHandle, useRef, useState } from "react";
import { forwardRef, LegacyRef, useEffect, useImperativeHandle, useRef, useState } from "react";
import { BsmIconType, BsmIcon } from "../svgs/bsm-icon.component";
import { BsmButton, BsmButtonType } from "./bsm-button.component";
import { useTranslation } from "renderer/hooks/use-translation.hook";
@@ -32,14 +32,25 @@ type Props = {
children?: JSX.Element;
text?: string;
textClassName?: string;
maxVisibleItems?: number;
};
export const BsmDropdownButton = forwardRef(({ className, classNames, buttonColor, items, align, withBar = true, icon = "settings", buttonClassName, menuTranslationY, children, text, textClassName }: Props, fowardRed) => {
export const BsmDropdownButton = forwardRef(({ className, classNames, buttonColor, items, align, withBar = true, icon = "settings", buttonClassName, menuTranslationY, children, text, textClassName, maxVisibleItems }: Props, fowardRed) => {
const [expanded, setExpanded] = useState(false);
const t = useTranslation();
const ref = useRef(fowardRed);
useClickOutside(ref, () => setExpanded(false));
const itemRef = useRef<HTMLDivElement>(null);
const [itemHeight, setItemHeight] = useState<number>();
const maxHeight = itemHeight && maxVisibleItems ? itemHeight * maxVisibleItems + 8 : undefined;
useEffect(() => {
if (itemRef.current) {
setItemHeight(itemRef.current.offsetHeight);
}
}, [items]);
useImperativeHandle(
fowardRed,
() => ({
@@ -73,13 +84,13 @@ export const BsmDropdownButton = forwardRef(({ className, classNames, buttonColo
})();
return (
<div ref={ref as unknown as LegacyRef<HTMLDivElement>} className={cn(className, classNames?.mainContainer)}>
<div ref={ref as unknown as LegacyRef<HTMLDivElement>} className={cn(className, classNames?.mainContainer)} >
<BsmButton onClick={() => setExpanded(!expanded)} className={cn(buttonClassName ?? defaultButtonClassName, classNames?.button)} icon={icon} active={expanded} textClassName={textClassName} onClickOutside={handleClickOutside} withBar={withBar} text={text} typeColor={buttonColor} iconClassName={classNames?.iconClassName}/>
<div className={cn(`py-1 w-fit absolute cursor-pointer top-[calc(100%-4px)] rounded-md bg-inherit text-sm text-gray-800 dark:text-gray-200 shadow-md shadow-black transition-[scale] duration-150 ease-in-out ${alignClass}`, classNames?.itemsContainer)} style={{ scale: expanded ? "1" : "0", translate: `0 ${menuTranslationY}` }}>
<div className={cn(`py-1 w-fit absolute cursor-pointer top-[calc(100%-4px)] rounded-md bg-inherit text-sm text-gray-800 dark:text-gray-200 shadow-md shadow-black transition-[scale] duration-150 ease-in-out ${alignClass} overflow-y-auto scrollbar-thin `, classNames?.itemsContainer)} style={{ scale: expanded ? "1" : "0", translate: `0 ${menuTranslationY}`, maxHeight}}>
{items?.map(
i =>
(i, index) =>
i && (
<div key={crypto.randomUUID()} onClick={() => { setExpanded(() => false); i.onClick?.()}} className="flex w-full px-3 py-2 hover:backdrop-brightness-150">
<div ref={index === 0 ? itemRef : undefined} key={crypto.randomUUID()} onClick={() => { setExpanded(() => false); i.onClick?.()}} className="flex w-full px-3 py-2 hover:backdrop-brightness-150">
{i.icon && <BsmIcon icon={i.icon} className="h-5 w-5 mr-1 text-inherit" />}
<span className="w-max">{t(i.text)}</span>
</div>
@@ -12,36 +12,47 @@ import { useService } from "renderer/hooks/use-service.hook";
import { lastValueFrom } from "rxjs";
import { useWindowControls } from "renderer/hooks/use-window-controls.hook";
import { useTranslationV2 } from "renderer/hooks/use-translation.hook";
import Tippy from "@tippyjs/react";
import { StaticConfigurationService } from "renderer/services/static-configuration.service";
import { AutoUpdate } from "shared/models/config";
import { UpdateInfo } from "electron-updater";
function TitleBarTags() {
function useVersion() {
const ipcService = useService(IpcService);
const t = useTranslationV2();
const [previewVersion, setPreviewVersion] = useState("");
const [outdated, setOutdated] = useState(false);
const [currentVersion, setCurrentVersion] = useState("");
const [latestVersion, setLatestVersion] = useState<UpdateInfo | null>(null);
useEffect(() => {
const requests: Promise<any>[] = [
lastValueFrom(ipcService.sendV2("current-version"))
];
if (window.electron.platform === "linux") {
requests.push(lastValueFrom(ipcService.sendV2("check-update")));
}
Promise.all(requests).then(([ currentVersion, outdated ]) => {
handlePrerelease(currentVersion);
setOutdated(outdated);
Promise.all([
lastValueFrom(ipcService.sendV2("current-version")),
lastValueFrom(ipcService.sendV2("get-available-update"))
]).then(([ currentVersion, latestVersion ]) => {
setCurrentVersion(currentVersion);
setLatestVersion(latestVersion);
});
}, []);
const handlePrerelease = (version: string) => {
return { currentVersion, latestVersion };
}
function TitleBarTags({ version, latestVersion }: Readonly<{
version: string;
latestVersion: UpdateInfo | null;
}>) {
const t = useTranslationV2();
const previewVersion = (() => {
if (version.toLowerCase().includes("alpha")) {
return setPreviewVersion("ALPHA");
return "ALPHA";
}
if (version.toLowerCase().includes("beta")) {
return setPreviewVersion("BETA");
return "BETA";
}
}
return "";
})();
return <>
{previewVersion &&
@@ -49,7 +60,7 @@ function TitleBarTags() {
{previewVersion}
</span>
}
{outdated &&
{latestVersion &&
<span className="bg-warning-500 text-black rounded-full ml-1 text-[10px] italic px-1 uppercase h-3.5 font-bold">
{t.text("title-bar.outdated")}
</span>
@@ -57,12 +68,65 @@ function TitleBarTags() {
</>;
}
function AutoUpdateButton({ latestVersion }: Readonly<{
latestVersion: UpdateInfo | null;
}>) {
const configService = useService(StaticConfigurationService);
const ipcService = useService(IpcService);
const { text: t } = useTranslationV2();
const isLinux = window.electron.platform === "linux";
const updateAndRestart = async () => {
await configService.set("auto-update", AutoUpdate.ONCE);
await lastValueFrom(ipcService.sendV2("restart-app"));
};
const renderTippyContent = () => {
return (
<div className="p-2">
<div>{t("title-bar.update-text", { version: latestVersion.version })}</div>
{latestVersion?.version ? (
<a href={`https://github.com/Zagrios/bs-manager/releases/tag/v${latestVersion.version}`} target="_blank" className="cursor-pointer underline text-sm hover:text-gray-300">{t("title-bar.see-changelog")}</a>
) : null}
{!isLinux &&
<BsmButton typeColor="primary"
className="text-center rounded-md px-2 py-1 mt-2"
text={t("title-bar.update-button")}
withBar={false}
onClick={() => updateAndRestart()}
/>
}
</div>
)
}
return latestVersion && (
<Tippy
zIndex={1000}
placement="bottom"
content={renderTippyContent()}
theme="default"
hideOnClick
interactive
>
<BsmButton
className="shrink-0 w-11 h-full aspect-square !bg-transparent flex items-start p-0.5"
icon="download"
withBar={false}
/>
</Tippy>
);
}
export default function TitleBar({ template = "index.html" }: { template: AppWindow }) {
const audio = useService(AudioPlayerService);
const windowControls = useWindowControls();
const volume = useObservable(() => audio.volume$, audio.volume);
const color = useThemeColor("first-color");
const { currentVersion, latestVersion } = useVersion();
const [maximized, setMaximized] = useState(false);
@@ -107,7 +171,7 @@ export default function TitleBar({ template = "index.html" }: { template: AppWin
<div id="drag-region" className="grow basis-0 h-full">
<div id="window-title" className="pl-1">
<span className="text-gray-800 dark:text-gray-100 font-bold text-xs italic">BSManager</span>
<TitleBarTags />
<TitleBarTags version={currentVersion} latestVersion={latestVersion} />
</div>
</div>
<div id="window-controls" className="h-full flex shrink-0 items-center">
@@ -117,6 +181,7 @@ export default function TitleBar({ template = "index.html" }: { template: AppWin
</div>
<BsmButton className="shrink-0 h-[23px] w-[23px] aspect-square !bg-transparent flex items-start" iconClassName={volumeIcon === "volume-down" ? "-translate-x-[1.8px]" : null} icon={volumeIcon} withBar={false} onClick={() => audio.toggleMute()} />
</div>
<AutoUpdateButton latestVersion={latestVersion} />
<button onClick={minimizeWindow} className="text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-[#4F545C] cursor-pointer w-11 h-full shrink-0 flex justify-center items-center" id="min-button">
<svg aria-hidden="false" width="12" height="12" viewBox="0 0 12 12">
<rect fill="currentColor" width="10" height="1" x="1" y="6" />
@@ -1,4 +1,4 @@
import { useEffect, useMemo, useState } from "react";
import { useCallback, useEffect, useMemo, useState } from "react";
import { BsmButton } from "renderer/components/shared/bsm-button.component";
import { useObservable } from "renderer/hooks/use-observable.hook";
import { useTranslationV2 } from "renderer/hooks/use-translation.hook";
@@ -19,7 +19,7 @@ import { safeLt } from "shared/helpers/semver.helpers";
import { WarningIcon } from "renderer/components/svgs/icons/warning-icon.component";
import Tippy from "@tippyjs/react";
import { CustomLaunchOption, LaunchModItemProps, LaunchOptionsPanel } from "./launch-options-panel.component";
import { LaunchMods } from "shared/models/bs-launch/launch-option.interface";
import { LaunchMod, LaunchMods } from "shared/models/bs-launch/launch-option.interface";
import { OculusIcon } from "renderer/components/svgs/icons/oculus-icon.component";
import { DesktopIcon } from "renderer/components/svgs/icons/desktop-icon.component";
import { TerminalIcon } from "renderer/components/svgs/icons/terminal-icon.component";
@@ -30,29 +30,13 @@ import { CreateCustomLaunchOptionModal } from "renderer/components/modal/modal-t
type Props = { version: BSVersion };
export function LaunchSlide({ version }: Props) {
const { text: t, element: te } = useTranslationV2();
const configService = useService(ConfigurationService);
function useLaunchMods() {
const bsLauncherService = useService(BSLauncherService);
const bsDownloader = useService(BsDownloaderService);
const versions = useService(BSVersionManagerService);
const modal = useService(ModalService);
const configService = useService(ConfigurationService);
const [advancedLaunch, setAdvancedLaunch] = useState(false);
const [command, setCommand] = useState<string>(configService.get<string>("launch-command") || "");
const customLaunchOptions = useObservable<CustomLaunchOption[]>(() => configService.watch<CustomLaunchOption[]>("custom-launch-options"), []);
const [customLaunchModsArgs, setCustomLaunchModsArgs] = useState<string[]>([]);
const versionDownloading = useObservable(() => bsDownloader.downloadingVersion$);
const [activeLaunchMods, setActiveLaunchMods] = useState<string[]>(configService.get("launch-mods") ?? []);
const [pinnedLaunchMods, setPinnedLaunchMods] = useState<string[]>(configService.get("pinned-launch-mods" as DefaultConfigKey) ?? []);
const versionRunning = useObservable(() => bsLauncherService.versionRunning$);
useEffect(() => {
configService.set("launch-command", command);
}, [command]);
useEffect(() => {
configService.set("pinned-launch-mods", pinnedLaunchMods);
}, [pinnedLaunchMods])
@@ -65,24 +49,66 @@ export function LaunchSlide({ version }: Props) {
}
}, [activeLaunchMods]);
const toggleActiveLaunchMod = (checked: boolean, launchMod: string) => checked
const toggleActiveLaunchMod = useCallback((checked: boolean, launchMod: string) => checked
? setActiveLaunchMods(prev => [...prev, launchMod])
: setActiveLaunchMods(prev => prev.filter(mod => mod !== launchMod));
: setActiveLaunchMods(prev => prev.filter(mod => mod !== launchMod)),
[]);
const togglePinnedLaunchMod = (pinned: boolean, launchMod: string) => pinned
const togglePinnedLaunchMod = useCallback((pinned: boolean, launchMod: string) => pinned
? setPinnedLaunchMods(prev => [...prev, launchMod])
: setPinnedLaunchMods(prev => prev.filter(mod => mod !== launchMod));
: setPinnedLaunchMods(prev => prev.filter(mod => mod !== launchMod)),
[]);
const launchModItems = useMemo<LaunchModItemProps[]>(() => {
return {
activeLaunchMods,
pinnedLaunchMods,
toggleActiveLaunchMod,
togglePinnedLaunchMod,
}
}
let protonLogsPath: string[] = [];
if (window.electron.platform === "linux") {
protonLogsPath = version.steam
? [version.path, "Logs"]
: ["BSInstances", version.name, "Logs"];
}
function useCustomLaunchMods({
activeLaunchMods, pinnedLaunchMods,
toggleActiveLaunchMod,
togglePinnedLaunchMod,
}: {
activeLaunchMods: string[];
pinnedLaunchMods: string[];
const customOptions = customLaunchOptions?.map<LaunchModItemProps>(option => ({
toggleActiveLaunchMod: (checked: boolean, launchMod: string) => void;
togglePinnedLaunchMod: (checked: boolean, launchMod: string) => void;
}) {
const configService = useService(ConfigurationService);
const modalService = useService(ModalService);
const customLaunchOptions = useObservable<CustomLaunchOption[]>(() => (
configService.watch<CustomLaunchOption[]>("custom-launch-options")
), []);
const [customLaunchModsArgs, setCustomLaunchModsArgs] = useState<string[]>([]);
useEffect(() => {
const command = customLaunchOptions
?.map(option => option.data.command || "")
.filter(Boolean);
setCustomLaunchModsArgs(() => command ?? []);
}, [customLaunchOptions]);
const deleteCustomLaunchOption = useCallback((id: string) => {
const newCustomLaunchOptions = (customLaunchOptions ?? []).filter(mode => mode.id !== id);
configService.set("custom-launch-options", newCustomLaunchOptions);
}, [customLaunchOptions]);
const saveCustomLaunchOption = useCallback(async (option: Partial<CustomLaunchOption>) => {
const result = await modalService.openModal(CreateCustomLaunchOptionModal, { data: option });
if(result.exitCode !== ModalExitCode.COMPLETED) { return; }
const newCustomLaunchOptions = (customLaunchOptions ?? []).filter(mode => mode.id !== result.data.id);
newCustomLaunchOptions.push(result.data);
configService.set("custom-launch-options", newCustomLaunchOptions);
}, [customLaunchOptions]);
const getCustomLaunch = useCallback(() => {
return customLaunchOptions?.map<LaunchModItemProps>(option => ({
id: option.id,
label: option.label,
active: activeLaunchMods.includes(option.id),
@@ -104,6 +130,57 @@ export function LaunchSlide({ version }: Props) {
deleteCustomLaunchOption(option.id);
},
})) ?? [];
}, [customLaunchOptions, activeLaunchMods, pinnedLaunchMods])
return {
customLaunchOptions,
customLaunchModsArgs,
getCustomLaunch,
saveCustomLaunchOption
};
}
export function LaunchSlide({ version }: Props) {
const { text: t, element: te } = useTranslationV2();
const configService = useService(ConfigurationService);
const bsLauncherService = useService(BSLauncherService);
const bsDownloader = useService(BsDownloaderService);
const versions = useService(BSVersionManagerService);
const [advancedLaunch, setAdvancedLaunch] = useState(false);
const [command, setCommand] = useState<string>(configService.get<string>("launch-command") || "");
const versionDownloading = useObservable(() => bsDownloader.downloadingVersion$);
const versionRunning = useObservable(() => bsLauncherService.versionRunning$);
const {
activeLaunchMods, pinnedLaunchMods,
toggleActiveLaunchMod, togglePinnedLaunchMod,
} = useLaunchMods();
const {
customLaunchOptions, customLaunchModsArgs,
getCustomLaunch, saveCustomLaunchOption,
} = useCustomLaunchMods({
activeLaunchMods, pinnedLaunchMods,
toggleActiveLaunchMod,
togglePinnedLaunchMod,
});
useEffect(() => {
configService.set("launch-command", command);
}, [command]);
const launchModItems = useMemo<LaunchModItemProps[]>(() => {
let protonLogsPath: string[] = [];
if (window.electron.platform === "linux") {
protonLogsPath = version.steam
? [version.path, "Logs"]
: ["BSInstances", version.name, "Logs"];
}
const customOptions = getCustomLaunch();
return [
{
@@ -176,7 +253,7 @@ export function LaunchSlide({ version }: Props) {
const launch = async () => {
const launch$ = bsLauncherService.launch({
version,
launchMods: activeLaunchMods.map(mod => LaunchMods[mod as keyof typeof LaunchMods]).filter(Boolean),
launchMods: activeLaunchMods.filter(mod => Object.values(LaunchMods).includes(mod as LaunchMod)) as LaunchMod[],
command: [command, ...customLaunchModsArgs].filter(Boolean).join(" ").trim(),
});
@@ -187,19 +264,6 @@ export function LaunchSlide({ version }: Props) {
return safeLt(version?.BSVersion, versions.getRecommendedVersion()?.BSVersion);
}, [version]);
const saveCustomLaunchOption = async (option: Partial<CustomLaunchOption>) => {
const result = await modal.openModal(CreateCustomLaunchOptionModal, { data: option });
if(result.exitCode !== ModalExitCode.COMPLETED) { return; }
const newCustomLaunchOptions = (customLaunchOptions ?? []).filter(mode => mode.id !== result.data.id);
newCustomLaunchOptions.push(result.data);
configService.set("custom-launch-options", newCustomLaunchOptions);
}
const deleteCustomLaunchOption = (id: string) => {
const newCustomLaunchOptions = (customLaunchOptions ?? []).filter(mode => mode.id !== id);
configService.set("custom-launch-options", newCustomLaunchOptions);
}
return (
<div className="w-full shrink-0 items-center relative flex flex-col justify-start overflow-hidden">
<div className="flex flex-col gap-3 justify-center items-center mb-4">
@@ -23,6 +23,7 @@ import { Dropzone } from "renderer/components/shared/dropzone.component";
import { ModsGridStatus } from "shared/models/mods/mod-ipc.model";
import { BsmLink } from "renderer/components/shared/bsm-link.component";
import { DISCORD_URL, GITHUB_URL } from "shared/constants";
import { ModRepo } from "shared/models/mods/repo.model";
export type ModsSlideRef = {
loadMods: () => Promise<void>;
@@ -55,6 +56,8 @@ export const ModsSlide = forwardRef<ModsSlideRef, Props>(({ version, isActive, o
const downloadRef = useRef(null);
const [downloadWith, setDownloadWidth] = useState(0);
const [selectedModRepo, setSelectedModRepo] = useState(null as ModRepo)
const modsToCategoryMap = (mods: BbmFullMod[]): Map<BbmCategories, BbmFullMod[]> => {
if (!mods) {
return new Map<BbmCategories, BbmFullMod[]>();
@@ -218,10 +221,15 @@ export const ModsSlide = forwardRef<ModsSlideRef, Props>(({ version, isActive, o
loadMods
}), [version]);
useEffect(()=>{
modsManager.getSelectedModRepo().then(repo=>setSelectedModRepo(repo));
}, []);
useEffect(() => {
let isCancelled = false;
if(!isActive){
return noop();
return noop;
}
ensureDisclaimerAccepted().then(async canLoad => {
@@ -229,13 +237,30 @@ export const ModsSlide = forwardRef<ModsSlideRef, Props>(({ version, isActive, o
return onDisclamerDecline?.();
}
if (isCancelled) return;
const status = await modsManager.getModsGridStatus();
if (isCancelled) return;
setGridStatus(() => status);
loadMods();
if (status !== ModsGridStatus.OK) {
return;
}
modsManager.getVersionModsState(version).then(({ available, installed }) => {
if (isCancelled) return;
const defaultMods = installed?.length ? [] : available.filter(m => m.mod.category === BbmCategories.Core || m.mod.category === BbmCategories.Essential);
setModsAvailable(() => modsToCategoryMap(available));
setModsSelected(available.filter(m => m.mod.category === BbmCategories.Core || defaultMods.some(d => m.mod.name.toLowerCase() === d.mod.name.toLowerCase()) || installed.some(i => m.mod.id === i.mod.id)));
setModsInstalled(modsToCategoryMap(installed));
});
});
return () => {
isCancelled = true;
setMoreInfoMod(null);
setModsAvailable(null);
setModsInstalled(null);
@@ -266,6 +291,18 @@ export const ModsSlide = forwardRef<ModsSlideRef, Props>(({ version, isActive, o
const renderStatus = () => {
if (gridStatus === ModsGridStatus.BEATMODS_DOWN) {
if(selectedModRepo && selectedModRepo.id !== "beatmods"){
return <ModStatus image={BeatConflictImg}>
<span className="text-xl text-center px-2 mt-3 italic">
{
t("pages.version-viewer.mods.notifications.third-party-mod-source-not-avaliable.description",
{name:selectedModRepo ? selectedModRepo.display_name : "null"}
)
}
</span>
</ModStatus>
}
return <ModStatus image={BeatConflictImg}>
<span className="text-xl text-center px-2 mt-3 italic">
{te("pages.version-viewer.mods.status.beatmods-down", {links: (<>
+2 -2
View File
@@ -12,9 +12,9 @@ export function useClickOutside(ref: MutableRefObject<any>, handler: ComponentPr
}
};
document.addEventListener("click", handleClickOutside);
document.addEventListener("mousedown", handleClickOutside);
return () => {
document.removeEventListener("click", handleClickOutside);
document.removeEventListener("mousedown", handleClickOutside);
};
}, [ref]);
}
+85 -8
View File
@@ -48,6 +48,9 @@ import { InstallationLocationService } from "renderer/services/installation-loca
import { AutoUpdaterService } from "renderer/services/auto-updater.service";
import { OculusDownloaderService } from "renderer/services/bs-version-download/oculus-downloader.service";
import { DISCORD_URL } from "shared/constants";
import { AutoUpdate } from "shared/models/config";
import { BsModsManagerService } from "renderer/services/bs-mods-manager.service";
import { ModRepo } from "shared/models/mods/repo.model";
export function SettingsPage() {
@@ -68,6 +71,7 @@ export function SettingsPage() {
const versionLinker = useService(VersionFolderLinkerService);
const staticConfig = useService(StaticConfigurationService);
const installationLocationService = useService(InstallationLocationService);
const bsModManagerService = useService(BsModsManagerService);
const autoUpdater = useService(AutoUpdaterService);
const { firstColor, secondColor } = useThemeColor();
@@ -99,6 +103,8 @@ export function SettingsPage() {
const [playlistsDeepLinkEnabled, setPlaylistsDeepLinkEnabled] = useState(false);
const [modelsDeepLinkEnabled, setModelsDeepLinkEnabled] = useState(false);
const [hasDownloaderSession, setHasDownloaderSession] = useState(false);
const [modRepoList, setModRepoList] = useState([] as ModRepo[]);
const [modRepo, setModRepo] = useState("");
const appVersion = useObservable(() => autoUpdater.getAppVersion());
useEffect(() => {
@@ -108,6 +114,15 @@ export function SettingsPage() {
playlistsManager.isDeepLinksEnabled().then(enabled => setPlaylistsDeepLinkEnabled(() => enabled));
modelsManager.isDeepLinksEnabled().then(enabled => setModelsDeepLinkEnabled(() => enabled));
bsModManagerService.getModRepoList().then(list =>{
setModRepoList(list);
bsModManagerService.getSelectedModRepo().then(repo => {
setModRepo(repo.id);
})
});
staticConfig.get("proton-folder").then(setProtonFolder);
}, []);
@@ -156,6 +171,13 @@ export function SettingsPage() {
i18nService.setLanguage(item.value);
};
const handleChangeModRepo = (repo: RadioItem<string>) => {
bsModManagerService.selectModRepo(repo.value).then(result=>{
if(result){
setModRepo(repo.value)
}
})
}
const setDefaultProtonFolder = async () => {
if (!progressBarService.require()) {
return;
@@ -201,11 +223,18 @@ export function SettingsPage() {
const fileChooserRes = await lastValueFrom(ipcService.sendV2("choose-folder"));
if (!fileChooserRes.canceled && fileChooserRes.filePaths?.length) {
const newInstallationPath = fileChooserRes.filePaths[0];
if(newInstallationPath === installationFolder){
return;
}
progressBarService.showFake(0.008);
notificationService.notifySuccess({ title: "notifications.settings.move-folder.success.titles.transfer-started", desc: "notifications.settings.move-folder.success.descs.transfer-started" });
lastValueFrom(installationLocationService.setInstallationFolder(fileChooserRes.filePaths[0], true)).then(res => {
lastValueFrom(installationLocationService.setInstallationFolder(newInstallationPath, true)).then(res => {
progressBarService.complete();
progressBarService.hide();
@@ -239,8 +268,8 @@ export function SettingsPage() {
const openSupportPage = () => linkOpener.open("https://www.patreon.com/bsmanager");
const openGithub = () => linkOpener.open("https://github.com/Zagrios/bs-manager");
const openReportBug = () => linkOpener.open("https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=bug&template=-bug--bug-report.md&title=%5BBUG%5D+%3A+");
const openRequestFeatures = () => linkOpener.open("https://github.com/Zagrios/bs-manager/issues/new?assignees=Zagrios&labels=enhancement&template=-feat---feature-request.md&title=%5BFEAT.%5D+%3A+");
const openReportBug = () => linkOpener.open("https://github.com/Zagrios/bs-manager/issues/new?template=1-bug-report.yaml");
const openRequestFeatures = () => linkOpener.open("https://github.com/Zagrios/bs-manager/issues/new?template=2-feature-request.yaml");
const openDiscord = () => linkOpener.open(DISCORD_URL);
const openTwitter = () => linkOpener.open("https://twitter.com/BSManager_");
@@ -497,7 +526,18 @@ export function SettingsPage() {
</SettingContainer>
<SettingContainer title="pages.settings.language.title" description="pages.settings.language.description">
<SettingRadioArray items={languagesItems} selectedItemValue={languageSelected} onItemSelected={handleChangeLanguage} />
<SettingRadioArray items={languagesItems} selectedItemValue={languageSelected} onItemSelected={handleChangeLanguage} columnCount={2} />
</SettingContainer>
<SettingContainer title="pages.settings.mod-repos.title" description="pages.settings.mod-repos.description">
<SettingRadioArray items={modRepoList.map((repo,index)=>({
id:index,
value: repo.id,
text: repo.display_name,
icon: repo.website ?
<BsmButton onClick={()=>linkOpener.open(repo.website, false)} className="px-2 font-bold italic text-sm rounded-md" text="pages.settings.mod-repos.website" withBar={false} />
: null
}))} selectedItemValue={modRepo} onItemSelected={handleChangeModRepo} />
</SettingContainer>
<SettingContainer title="pages.settings.patreon.title" description="pages.settings.patreon.description">
@@ -546,11 +586,17 @@ function AdvancedSettings() {
const [hardwareAccelerationEnabled, setHardwareAccelerationEnabled] = useState(true);
const [useSymlink, setUseSymlink] = useState(false);
const [useSystemProxy, setUseSystemProxy] = useState(false);
const [autoUpdate, setAutoUpdate] = useState<AutoUpdate>(AutoUpdate.NEVER);
useEffect(() => {
staticConfig.get("disable-hadware-acceleration").then(disabled =>setHardwareAccelerationEnabled(() => disabled !== true));
staticConfig.get("use-symlinks").then(useSymlinks => setUseSymlink(() => useSymlinks));
staticConfig.get("use-system-proxy").then(useSystemProxy => setUseSystemProxy(() => useSystemProxy));
if (window.electron.platform === "win32") {
staticConfig.get("use-symlinks").then(useSymlinks => setUseSymlink(() => useSymlinks));
staticConfig.get("use-system-proxy").then(useSystemProxy => setUseSystemProxy(() => useSystemProxy));
staticConfig.get("auto-update").then(res => setAutoUpdate(() => res ?? AutoUpdate.ALWAYS));
}
}, []);
const onChangeHardwareAcceleration = async (newHardwareAccelerationEnabled: boolean) => {
@@ -631,12 +677,43 @@ function AdvancedSettings() {
setUseSystemProxy(() => newUseSystemProxy);
}
const advancedItems: Item[] = [{
const onChangeAutoUpdate = async (value: boolean) => {
if (window.electron.platform !== "win32") {
return;
}
const newAutoUpdate = value ? AutoUpdate.ALWAYS : AutoUpdate.NEVER;
const { error } = await tryit(() => staticConfig.set("auto-update", newAutoUpdate));
if (error) {
notification.notifyError({
title: "notifications.types.error",
desc: "pages.settings.advanced.auto-update.error-notification.message",
});
return;
}
setAutoUpdate(() => newAutoUpdate);
}
const advancedItems: Item[] = [];
if (window.electron.platform === "win32") {
advancedItems.push({
checked: autoUpdate === AutoUpdate.ALWAYS,
text: t.text("pages.settings.advanced.auto-update.title"),
desc: t.text("pages.settings.advanced.auto-update.description"),
onChange: onChangeAutoUpdate
});
}
advancedItems.push({
checked: hardwareAccelerationEnabled,
text: t.text("pages.settings.advanced.hardware-acceleration.title"),
desc: t.text("pages.settings.advanced.hardware-acceleration.description"),
onChange: onChangeHardwareAcceleration
}];
});
if (window.electron.platform === "win32") {
advancedItems.push({
checked: useSymlink,
@@ -1,4 +1,4 @@
import { Observable, BehaviorSubject, throwError, of, lastValueFrom } from "rxjs";
import { Observable, BehaviorSubject, throwError, of, lastValueFrom, from } from "rxjs";
import { catchError, map, tap } from "rxjs/operators";
import { BSVersion } from "shared/bs-version.interface";
import { IpcService } from "./ipc.service";
@@ -10,6 +10,7 @@ import { BbmFullMod, BbmModVersion } from "shared/models/mods/mod.interface";
import { logRenderError } from "renderer";
import { ModsGridStatus } from "shared/models/mods/mod-ipc.model";
import { LinuxService } from "./linux.service";
import { ModRepo } from "shared/models/mods/repo.model";
export class BsModsManagerService {
private static instance: BsModsManagerService;
@@ -226,4 +227,18 @@ export class BsModsManagerService {
return ModsGridStatus.OK;
}
public async getModRepoList(): Promise<ModRepo[]> {
return lastValueFrom(this.ipcService.sendV2("bs-mods.mod-repo.get-repo-list")).catch(() => [] as ModRepo[]);
}
public async getSelectedModRepo(): Promise<ModRepo> {
return lastValueFrom(this.ipcService.sendV2("bs-mods.mod-repo.get-name").pipe(
catchError(() => from(this.getModRepoList()).pipe(map(list => list.find(repo => repo.default) || list[0])))
));
}
public async selectModRepo(name:string): Promise<boolean> {
return lastValueFrom(this.ipcService.sendV2("bs-mods.mod-repo.select-name", name)).catch(() => false);
}
}
+2 -2
View File
@@ -24,7 +24,7 @@ export class ModalService {
const promise = new Promise<ModalResponse<T>>(resolve => {
resolver = resolve as (value: ModalResponse | PromiseLike<ModalResponse>) => void;
});
const modalObj = {modal: modal as ModalComponent, resolver, options};
const modalObj = {id: crypto.randomUUID(), modal: modal as ModalComponent, resolver, options};
this._modalToShow$.next([...this._modalToShow$.getValue(), modalObj]);
promise.then(() => {
@@ -41,7 +41,7 @@ export class ModalService {
export type ModalOptions<T = unknown> = { readonly data?: T, readonly noStyle?: boolean, readonly closable?: boolean }
export type ModalComponent<Return = unknown, Receive = unknown> = ({ resolver, options }: { readonly resolver: (x: ModalResponse<Return>) => void; readonly options?: ModalOptions<Receive> }) => JSX.Element;
export type ModalObject = {modal: ModalComponent, resolver: (value: ModalResponse | PromiseLike<ModalResponse>) => void, options: ModalOptions};
export type ModalObject = {id: string, modal: ModalComponent, resolver: (value: ModalResponse | PromiseLike<ModalResponse>) => void, options: ModalOptions};
export const enum ModalExitCode {
NO_CHOICE = -1,
+8
View File
@@ -0,0 +1,8 @@
export enum AutoUpdate {
ALWAYS = "always",
// When "Update and restart" is clicked
ONCE = "once",
NEVER = "never",
}
+6
View File
@@ -21,6 +21,8 @@ import { LocalBPList, LocalBPListsDetails } from "../playlists/local-playlist.mo
import { StaticConfigGetIpcRequestResponse, StaticConfigKeys, StaticConfigSetIpcRequest } from "main/services/static-configuration.service";
import { BbmFullMod, BbmModVersion, ExternalMod } from "../mods/mod.interface";
import { OculusDownloadInfo } from "main/services/bs-version-download/bs-oculus-downloader.service";
import { UpdateInfo } from "electron-updater";
import { ModRepo } from "../mods/repo.model";
export type IpcReplier<T> = (data: Observable<T>) => void;
@@ -89,6 +91,9 @@ export interface IpcChannelMapping {
"bs-mods.uninstall-mods": { request: { mods: BbmFullMod[]; version: BSVersion }, response: Progression };
"bs-mods.uninstall-all-mods": { request: BSVersion, response: Progression };
"bs-mods.beatmods-up": { request: void, response: boolean };
"bs-mods.mod-repo.get-repo-list": { request: void, response: ModRepo[]};
"bs-mods.mod-repo.get-name": { request: void, response: ModRepo};
"bs-mods.mod-repo.select-name": { request: string, response: boolean};
/* ** bs-playlist-ipcs ** */
"one-click-install-playlist": { request: string, response: Progression<DownloadPlaylistProgressionData> };
@@ -122,6 +127,7 @@ export interface IpcChannelMapping {
/* ** launcher-ipcs ** */
"download-update": { request: void, response: Progression };
"check-update": { request: void, response: boolean };
"get-available-update": { request: void, response: UpdateInfo | null };
"install-update": { request: void, response: void };
/* ** model-saber.ipcs ** */
@@ -8,6 +8,12 @@ export interface BsmLocalMap {
mapInfo: MapInfo;
songDetails?: SongDetails;
path: string;
metadata?: BsmLocalMapMetadata;
}
export interface BsmLocalMapMetadata {
// Date of download or import
addedDate: string;
}
export interface BsmLocalMapsProgress {
+7
View File
@@ -35,6 +35,13 @@ export const mapSorter = new Sorter<BsmLocalMap>({
return !map2.songDetails ? Comparison.GREATER : map1.songDetails.uploadedAt - map2.songDetails.uploadedAt;
},
"added-date": (map1, map2) => {
if (!map1.metadata) {
return map2.metadata ? Comparison.LESSER : Comparison.EQUAL;
}
return !map2.metadata ? Comparison.GREATER : map1.metadata.addedDate.localeCompare(map2.metadata.addedDate);
}
},
tiebreak: sortName,
defaultKey: "name"
+8
View File
@@ -0,0 +1,8 @@
export interface ModRepo {
id: string
mods_repo_url: string
mods_repo_api_url: string
display_name: string
website?: string
default?: boolean
}