Now the player name can be saved via webui (BeatStream)

This commit is contained in:
RoxCian 2021-04-25 16:32:41 +08:00
parent c3ad4e8c62
commit ee92f52b59
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# BeatStream
Plugin Version: **v1.0.1**
Plugin Version: **v1.0.2**
Supported Versions:

View File

@ -20,8 +20,10 @@ export namespace Bst2HandlersWebUI {
sfxStreamNoteTail: number
}) => {
try {
let base = await DB.FindOne<IBst2Base>(data.refid, { collection: "bst.bst2.player.base" })
let customization = await DB.FindOne<IBst2Customization>(data.refid, { collection: "bst.bst2.player.customization" })
if (customization == null) throw new Error("No profile for refid=" + data.refid)
if (!customization || !base) throw new Error("No profile for refid=" + data.refid)
base.name = data.name
customization.custom[0] = data.rippleNote
customization.custom[2] = data.sfxNormalNote
customization.custom[3] = data.sfxRippleNote
@ -30,6 +32,7 @@ export namespace Bst2HandlersWebUI {
customization.custom[6] = data.backgroundBrightness
customization.custom[7] = (data.judgeText << 0) | (data.rippleNoteGuide << 1) | (data.streamNoteGuide << 2) | (data.sfxStreamNoteTail << 3) | (data.sfxFine << 4)
customization.custom[9] = data.judgeText
DBM.update<IBst2Base>(data.refid, { collection: "bst.bst2.player.base" }, base)
DBM.update<IBst2Customization>(data.refid, { collection: "bst.bst2.player.customization" }, customization)
UtilityHandlersWebUI.pushMessage("Save BeatStream Animtribe settings succeeded!", 2, WebUIMessageType.success, data.refid)
} catch (e) {