{ Mods: [] };
+ beatSaberVersion: string = '';
modSwitchInProgress: boolean = false;
modIDBeingSwitched: string = null;
selectedMod: ModDefinition;
@@ -35,6 +36,7 @@ export class MainModsComponent implements OnInit, AfterViewInit {
) {
this.configSvc.configUpdated.subscribe((cfg: BeatOnConfig) => {
this.config = cfg.Config;
+ this.beatSaberVersion = cfg.BeatSaberVersion;
});
}
@@ -104,41 +106,9 @@ export class MainModsComponent implements OnInit, AfterViewInit {
let isInit = false;
this.configSvc.getConfig().subscribe((cfg: BeatOnConfig) => {
this.config = cfg.Config;
- /*
- if (!isInit) {
- isInit = true;
- this.selectedMod = cfg.Config.Mods[0];
- const obj: Object = {
- Name: this.selectedMod.Name,
- Author: this.selectedMod.Author,
- Description: this.selectedMod.Description,
- InfoUrl: this.selectedMod.InfoUrl,
- };
- this.ngxSmartModalService.setModalData(obj, 'myModal');
- }
- var saberMod = new ModDefinition();
- saberMod.TargetBeatSaberVersion = '1.0.0';
- saberMod.ID = '1';
- saberMod.Author = 'Yuuki';
- saberMod.Name = 'Custom Sabers';
- saberMod.InfoUrl = 'http://www.google.com';
- saberMod.Description =
- 'Change the color of your sabers! Choose between a wide spectrum of colors and jam with your favorite mix!';
- saberMod.Category = ModCategory.Saber;
- this.config.Mods.push(saberMod);
- var randomSongSelect = new ModDefinition();
- randomSongSelect.TargetBeatSaberVersion = '1.0.0';
- randomSongSelect.ID = '2';
- randomSongSelect.Author = 'Yuuki';
- randomSongSelect.Name = 'Random Song Selection';
- randomSongSelect.InfoUrl = 'http://www.google.com';
- randomSongSelect.Description =
- "Tired of deciding what song to play? This mod gives you the ability to randomly select a song from your long list of maps you'll probably never get to.";
- randomSongSelect.Category = ModCategory.Gameplay;
- this.config.Mods.push(randomSongSelect);*/
+ this.beatSaberVersion = cfg.BeatSaberVersion;
});
}
-
getModBG(mod: ModDefinition) {
if (!mod.CoverImageFilename) {
if (mod.Category == ModCategory.Saber) {
@@ -160,24 +130,53 @@ export class MainModsComponent implements OnInit, AfterViewInit {
}
toggleMod(ev: MatSlideToggleChange, mod: ModDefinition) {
- this.modIDBeingSwitched = mod.ID;
- this.modSwitchInProgress = true;
- let msg = new ClientSetModStatus();
- msg.ModID = mod.ID;
- msg.Status = ev.checked ? ModStatusType.Installed : ModStatusType.NotInstalled;
- let sub;
- sub = this.msgSvc.actionResponseMessage.subscribe((ev: HostActionResponse) => {
- if (ev.ResponseToMessageID == msg.MessageID) {
- this.modIDBeingSwitched = null;
- this.modSwitchInProgress = false;
- sub.unsubscribe();
- if (!ev.Success) {
- //todo: show error
- console.log('mod id ' + msg.ModID + ' did not switch properly');
+ const switchMod = () => {
+ this.modIDBeingSwitched = mod.ID;
+ this.modSwitchInProgress = true;
+ let msg = new ClientSetModStatus();
+ msg.ModID = mod.ID;
+ msg.Status = ev.checked ? ModStatusType.Installed : ModStatusType.NotInstalled;
+ let sub;
+ sub = this.msgSvc.actionResponseMessage.subscribe((ev: HostActionResponse) => {
+ if (ev.ResponseToMessageID == msg.MessageID) {
+ this.modIDBeingSwitched = null;
+ this.modSwitchInProgress = false;
+ sub.unsubscribe();
+ if (!ev.Success) {
+ //todo: show error
+ console.log('mod id ' + msg.ModID + ' did not switch properly');
+ }
}
- }
- });
- this.msgSvc.sendClientMessage(msg);
+ });
+ this.msgSvc.sendClientMessage(msg);
+ };
+
+ if (ev.checked && mod.TargetBeatSaberVersion != this.beatSaberVersion) {
+ const dialogRef = this.dialog.open(ConfirmDialogComponent, {
+ width: '470px',
+ height: '240px',
+ disableClose: true,
+ data: {
+ title: 'Mod Compatibility Warning',
+ subTitle:
+ 'The mod is for Beat Saber: ' +
+ mod.TargetBeatSaberVersion +
+ '\nYou have version:\t\t' +
+ this.beatSaberVersion +
+ '\nThis mod may fail to activate, it may cause Beat Saber to crash, or it may work fine.\nAre you sure you want to turn it on?',
+ button1Text: 'Enable Mod',
+ },
+ });
+ dialogRef.afterClosed().subscribe(res => {
+ if (res == 1) {
+ switchMod();
+ } else {
+ ev.source.checked = false;
+ }
+ });
+ } else {
+ switchMod();
+ }
}
getModSwitch(mod) {
if (mod == null) return false;
diff --git a/frontend/src/app/models/BeatOnConfig.ts b/frontend/src/app/models/BeatOnConfig.ts
index a497c8b..330db07 100644
--- a/frontend/src/app/models/BeatOnConfig.ts
+++ b/frontend/src/app/models/BeatOnConfig.ts
@@ -5,4 +5,5 @@ export interface BeatOnConfig {
Config: QuestomConfig;
IsCommitted: boolean;
SyncConfig: SyncSaberConfig;
+ BeatSaberVersion: string;
}
diff --git a/frontend/src/app/models/StartupStatus.ts b/frontend/src/app/models/StartupStatus.ts
new file mode 100644
index 0000000..3420809
--- /dev/null
+++ b/frontend/src/app/models/StartupStatus.ts
@@ -0,0 +1,3 @@
+export interface StartupStatus {
+ UpgradeRestoreAvailable: boolean;
+}
diff --git a/frontend/src/app/services/beat-on-api.service.ts b/frontend/src/app/services/beat-on-api.service.ts
index a4e0a67..6e9d399 100644
--- a/frontend/src/app/services/beat-on-api.service.ts
+++ b/frontend/src/app/services/beat-on-api.service.ts
@@ -97,4 +97,7 @@ export class BeatOnApiService {
quitBeatOn() {
return this.http.post(this.hostname + '/host/mod/exit', {});
}
+ getStartupStatus() {
+ return this.http.get(this.hostname + '/host/mod/startupstatus');
+ }
}
diff --git a/frontend/src/app/setup/setup.component.html b/frontend/src/app/setup/setup.component.html
index 5086358..cf3f768 100644
--- a/frontend/src/app/setup/setup.component.html
+++ b/frontend/src/app/setup/setup.component.html
@@ -11,7 +11,7 @@ Welcome to Beat On!
Beat On will modify and reinstall your copy of Beat Saber so that it can support custom songs and some additional modifications.
After the modifications to Beat Saber during the setup process, Beat On will allow you to download songs on the Quest from this app, upload songs from your computer, manage custom playlists from the Quest or your computer's browser and install some types of other modifications.
- This version of Beat On is intended for Beat Saber version 1.1.0!
+ This version of Beat On is intended for Beat Saber version 1.1.0 and 1.2.0!
It is remotely possible that it may work with future versions of Beat Saber without modification, however it is highly likely that if a new version of Beat Saber has been released, this will result in a Beat Saber that doesn't work and you will need to wait for an update to Beat On.
If at any point you have problems with Beat Saber or Beat On, uninstalling Beat Saber (either through Beat On or another tool like adb) and reinstalling Beat Saber from the Oculus Store will revert Beat Saber back to normal.
diff --git a/frontend/src/app/song-pack-manager/song-pack-manager.component.scss b/frontend/src/app/song-pack-manager/song-pack-manager.component.scss
index f94970f..9634cf7 100644
--- a/frontend/src/app/song-pack-manager/song-pack-manager.component.scss
+++ b/frontend/src/app/song-pack-manager/song-pack-manager.component.scss
@@ -349,7 +349,7 @@ button.right {
}
.pack-container > li.collection-song,
-div.collection-song, div.packOuter {
+div.collection-song, div.packOuter:not(.cdk-drag-preview) {
transform: none !important;
}
diff --git a/frontend/src/app/tools/tools.component.ts b/frontend/src/app/tools/tools.component.ts
index a50e169..e7972d8 100644
--- a/frontend/src/app/tools/tools.component.ts
+++ b/frontend/src/app/tools/tools.component.ts
@@ -81,21 +81,7 @@ export class ToolsComponent implements OnInit {
this.beatOnApi.resetAssets().subscribe(
(data: any) => {
dialogRef.close();
- const dialogRef2 = this.dialog.open(ProgressSpinnerDialogComponent, {
- width: '450px',
- height: '350px',
- disableClose: true,
- data: { mainText: 'Loading Songs Folder. Please wait...' },
- });
- this.beatOnApi.reloadSongsFromFolders().subscribe(
- (data: any) => {
- dialogRef2.close();
- this.beatOnApi.restoreCommittedConfig().subscribe(ret => {});
- },
- err => {
- dialogRef2.close();
- }
- );
+ this.beatOnApi.restoreCommittedConfig().subscribe(ret => {});
},
err => {
dialogRef.close();