Lapistoria+ : Add force unlock option

This commit is contained in:
cracrayol 2022-09-28 18:36:10 +02:00
parent b4588e6c47
commit 1c408d84c4
4 changed files with 43 additions and 0 deletions

View File

@ -369,6 +369,18 @@ const getProfile = async (refid: string, name?: string) => {
player.item.push(item);
}
if(U.GetConfig("enable_force_unlock")) {
for(let i = 1; i <= GAME_MAX_MUSIC_ID; i++) {
player.item.push({
type: K.ITEM('u8', 0),
id: K.ITEM('u16', i),
param: K.ITEM('u16', 15),
is_new: K.ITEM('bool', 0),
get_time: K.ITEM('u64', BigInt(0)),
});
}
}
// Add version specific datas
const params = await utils.readParams(refid, version);
utils.addExtraData(player, params, extraData);

View File

@ -275,6 +275,18 @@ const getProfile = async (refid: string, name?: string) => {
player.item.push(item);
}
if(U.GetConfig("enable_force_unlock")) {
for(let i = 1; i <= GAME_MAX_MUSIC_ID; i++) {
player.item.push({
type: K.ITEM('u8', 0),
id: K.ITEM('u16', i),
param: K.ITEM('u16', 15),
is_new: K.ITEM('bool', 0),
get_time: K.ITEM('u64', BigInt(0)),
});
}
}
// Add version specific datas
const params = await utils.readParams(refid, version);
utils.addExtraData(player, params, extraData);

View File

@ -462,6 +462,18 @@ const getProfile = async (refid: string, version: string, name?: string) => {
});
}
if(U.GetConfig("enable_force_unlock")) {
for(let i = 1; i <= GAME_MAX_MUSIC_ID[version]; i++) {
player.item.push({
type: K.ITEM('u8', 0),
id: K.ITEM('u16', i),
param: K.ITEM('u16', 15),
is_new: K.ITEM('bool', 0),
get_time: K.ITEM('u64', BigInt(0)),
});
}
}
// Usaneko events
if (version == 'v24') {
const date = new Date();

View File

@ -30,6 +30,13 @@ export function register() {
default: true,
});
R.Config("enable_force_unlock", {
name: "Unlock all songs",
desc: "Force unlocking all songs (Lapistoria and later).",
type: "boolean",
default: true,
});
R.WebUIEvent('importPnmData', importPnmData);
R.WebUIEvent('updatePnmPlayerInfo', async (data: any) => {