From a4de30c5a551f5c4f21cf0e31cef720feff4d3eb Mon Sep 17 00:00:00 2001 From: ThePedroo Date: Wed, 11 Oct 2023 13:37:44 -0300 Subject: [PATCH] add: newLine option to helper This commit adds a new option to the helper which removes the unecessary \n between 2 definitions. --- OS_SUPPORT.md | 4 +- TODO.md | 2 +- .../main/java/com/perforvnm/MainActivity.kt | 3 - src/coder.js | 10 +- src/finalizer.js | 103 --------------- src/helper.js | 124 +++++++++++++++--- src/menu.js | 44 +++---- 7 files changed, 133 insertions(+), 157 deletions(-) delete mode 100644 src/finalizer.js diff --git a/OS_SUPPORT.md b/OS_SUPPORT.md index b048dd8..b777321 100644 --- a/OS_SUPPORT.md +++ b/OS_SUPPORT.md @@ -16,7 +16,9 @@ The optimizations are the options that the coder can use to optimize the VN code ##### Version support -\>= `v1.22.0 & v1.20.0`: Supported +\>= `v1.22.0 & v1.20.0`: Supported without `preCalculateScenesInfo` & `hashAchievementIds` + +\>= `v1.23.0 & v1.21.0`: Supported ### Scenes diff --git a/TODO.md b/TODO.md index 602fde0..60f9043 100644 --- a/TODO.md +++ b/TODO.md @@ -2,4 +2,4 @@ - (Customizability) Allow to remove footer and add buttons manually. - (Code quality) Only add necessary `import`s. -- (Code quality) `multiDefinitions` helper for avoiding the \n between 2 resource imports. +- (Optimization) Create functions for stopping the music and sound effects. diff --git a/android/app/src/main/java/com/perforvnm/MainActivity.kt b/android/app/src/main/java/com/perforvnm/MainActivity.kt index 19427b9..5611242 100644 --- a/android/app/src/main/java/com/perforvnm/MainActivity.kt +++ b/android/app/src/main/java/com/perforvnm/MainActivity.kt @@ -323,7 +323,6 @@ class MainActivity : Activity() { ) val sdp88 = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._88sdp) - val sdpminus3 = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._minus3sdp) layoutParamsStart.gravity = Gravity.BOTTOM or Gravity.START @@ -722,7 +721,6 @@ class MainActivity : Activity() { ) val sdp135 = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._135sdp) - val sdp77 = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._77sdp) layoutParamsSeekBar.gravity = Gravity.TOP or Gravity.START @@ -1179,7 +1177,6 @@ class MainActivity : Activity() { } val sdp100 = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._100sdp) - val sdp70 = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._70sdp) val layoutParamsSavesBackground = LayoutParams( diff --git a/src/coder.js b/src/coder.js index ace16ed..bb5dde0 100644 --- a/src/coder.js +++ b/src/coder.js @@ -1,10 +1,8 @@ import fs from 'fs' import helper from './helper.js' -import finalizer from './finalizer.js' import achievements from './achievements.js' -import { nextTick } from 'process' global.visualNovel = { menu: null, info: null, internalInfo: {}, code: '', scenes: [], subScenes: [], achievements: [], customXML: [], optimizations: {} } global.PerforVNM = { @@ -174,13 +172,13 @@ function finalize() { when (scene) {`, 2 ) - let savesSwitchCode = finalizer.sceneEachInit() + let savesSwitchCode = '' if (visualNovel.scenes.length) { let scenesCode = '' visualNovel.scenes.forEach((scene, i) => { - savesSwitchCode += finalizer.sceneEach(scene) + savesSwitchCode += helper.sceneEach(scene) if (i != visualNovel.scenes.length - 1) { const nextScene = visualNovel.scenes[i + 1] @@ -419,7 +417,7 @@ ${finishScene.join('\n')}\n\n`, 8, 0) }) visualNovel.subScenes.forEach((scene, i) => { - savesSwitchCode += finalizer.sceneEach(scene) + savesSwitchCode += helper.sceneEach(scene) if (scene.next) { const nextScene = visualNovel.scenes.find((nScene) => nScene.name == scene.next) @@ -650,7 +648,7 @@ ${finishScene.join('\n')}\n\n`, 6, 0) helper.replace('__PERFORVNM_SAVES_SWITCH__', defaultSaveSwitchCode) helper.replace('__PERFORVNM_HEADERS__', '\nimport kotlin.math.roundToInt') } else { - helper.replace('__PERFORVNM_SAVES_SWITCH__', finalizer.sceneEachFinalize(savesSwitchCode)) + helper.replace('__PERFORVNM_SAVES_SWITCH__', helper.sceneEachFinalize(savesSwitchCode)) } helper.replace('__PERFORVNM_HEADERS__', '') diff --git a/src/finalizer.js b/src/finalizer.js deleted file mode 100644 index e8364b8..0000000 --- a/src/finalizer.js +++ /dev/null @@ -1,103 +0,0 @@ -import helper from './helper.js' - -function sceneEachInit() { - return helper.codePrepare(` - when (buttonData.get${visualNovel.optimizations.hashScenesNames ? 'Int' : 'String'}("scene")) {`, 0, 4 - ) -} - -function sceneEach(scene) { - let savesSwitchLocal = helper.codePrepare(` - ${helper.getSceneId(scene.name)} -> { - when (characterData.getString("name")) {`, 0, 6, false - ) - - scene.characters.forEach((character) => { - let optimizedSetImage = '' - if (visualNovel.optimizations.preCalculateScenesInfo) { - optimizedSetImage = helper.codePrepare(` - imageViewCharacter.setImageResource(R.raw.${character.image})\n\n `, 8 - ) - } - switch (character.position.side) { - case 'left': { - savesSwitchLocal += helper.codePrepare(` - "${character.name}" -> { - ${optimizedSetImage}val leftDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) - - layoutParamsImageViewCharacter.setMargins(leftDpLoad + leftDpCharacter, topDpLoad, 0, 0) - }`, 0, 4, false - ) - - break - } - case 'leftTop': { - savesSwitchLocal += helper.codePrepare(` - "${character.name}" -> { - ${optimizedSetImage}val leftDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) - val topDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.top * 0.25)}sdp) - - layoutParamsImageViewCharacter.setMargins(leftDpLoad + leftDpCharacter, topDpLoad + topDpCharacter, 0, 0) - }`, 0, 4, false - ) - - break - } - case 'right': { - savesSwitchLocal += helper.codePrepare(` - "${character.name}" -> { - ${optimizedSetImage}val rightDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) - - layoutParamsImageViewCharacter.setMargins(leftDpLoad - rightDpCharacter, topDpLoad, 0, 0) - }`, 0, 4, false - ) - - break - } - case 'rightTop': { - savesSwitchLocal += helper.codePrepare(` - "${character.name}" -> { - ${optimizedSetImage}val rightDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) - val topDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.top * 0.25)}sdp) - - layoutParamsImageViewCharacter.setMargins(leftDpLoad - rightDpCharacter, topDpLoad + topDpCharacter, 0, 0) - }`, 0, 4, false - ) - - break - } - case 'top': { - savesSwitchLocal += helper.codePrepare(` - "${character.name}" -> { - ${optimizedSetImage}val topDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) - - layoutParamsImageViewCharacter.setMargins(leftDpLoad, topDpLoad + topDpCharacter, 0, 0) - }`, 0, 4, false - ) - - break - } - case 'center': { - savesSwitchLocal += helper.codePrepare(` - "${character.name}" -> { - ${optimizedSetImage}layoutParamsImageViewCharacter.setMargins(leftDpLoad, topDpLoad, 0, 0) - }`, 0, 4, false - ) - - break - } - } - }) - - return savesSwitchLocal + '\n' + helper.codePrepare('}\n', 0, 12, false) + helper.codePrepare('}', 0, 10, false) -} - -function sceneEachFinalize(savesSwitchCode) { - return savesSwitchCode + '\n' + helper.codePrepare('}', 0, 8, false) -} - -export default { - sceneEachInit, - sceneEach, - sceneEachFinalize -} \ No newline at end of file diff --git a/src/helper.js b/src/helper.js index 6a5938f..b3bc2c2 100644 --- a/src/helper.js +++ b/src/helper.js @@ -199,19 +199,14 @@ function addResource(page, resource) { return page } -function addMultipleResources(page, page2, resource) { - addResource(page, resource) - addResource(page2, resource) -} - -function getResource(page, resource, add) { +function getResource(page, resource) { const cResource = page.resources.find((cResource) => resource.dp == cResource.dp && resource.type == cResource.type) if (resource.type == 'sdp') { if (!visualNovel.optimizations.reuseResources) return { definition: null, - inlined: `resources.getDimensionPixelSize(resources.getIdentifier("_${resource.dp}${resource.type}", "dimen", getPackageName()))`, - variable: `resources.getDimensionPixelSize(resources.getIdentifier("_${resource.dp}${resource.type}", "dimen", getPackageName()))`, + inlined: `resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${resource.dp}${resource.type})`, + variable: `resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${resource.dp}${resource.type})`, additionalSpace: '\n' } @@ -237,8 +232,6 @@ function getResource(page, resource, add) { additionalSpace: '\n' } - if (add) console.log(page.resources) - if (cResource) return { definition: null, inlined: `__PERFORVNM_${resource.dp}_${resource.type}_INLINE__`, @@ -256,13 +249,11 @@ function getResource(page, resource, add) { } } -function getMultipleResources(page, page2, resource, add) { +function getMultipleResources(page, page2, resource) { let cResource = null - cResource = getResource(page, resource, add) - if (add) console.log(cResource) - if (cResource.definition) cResource = getResource(page2, resource, add) - if (add) console.log(cResource) + cResource = getResource(page, resource) + if (cResource.definition) cResource = getResource(page2, resource) return cResource } @@ -291,11 +282,11 @@ function finalizeResources(page, code) { } if (resource.type == 'sdp') { - code = code.replace(defineRegex, `val ${resource.type}${resource.dp} = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${resource.dp}${resource.type})\n\n${spaces}`) + code = code.replace(defineRegex, `val ${resource.type}${resource.dp} = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${resource.dp}${resource.type})${resource.newLines ? resource.newLines : '\n\n'}${spaces}`) code = code.replace(inlineRegex, `resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${resource.dp}${resource.type})`) code = code.replace(variableRegex, `${resource.type}${resource.dp}`) } else { - code = code.replace(defineRegex, `val ${resource.type}${resource.dp} = resources.getDimension(com.intuit.ssp.R.dimen._${resource.dp}${resource.type})\n\n${spaces}`) + code = code.replace(defineRegex, `val ${resource.type}${resource.dp} = resources.getDimension(com.intuit.ssp.R.dimen._${resource.dp}${resource.type})${resource.newLines ? resource.newLines : '\n\n'}${spaces}`) code = code.replace(inlineRegex, `resources.getDimension(com.intuit.ssp.R.dimen._${resource.dp}${resource.type})`) code = code.replace(variableRegex, `${resource.type}${resource.dp}`) } @@ -341,6 +332,100 @@ function removeAllDoubleLines(code) { } } + +function sceneEach(scene) { + let savesSwitchLocal = helper.codePrepare(` + ${helper.getSceneId(scene.name)} -> { + when (characterData.getString("name")) {`, 0, 6, false + ) + + scene.characters.forEach((character) => { + let optimizedSetImage = '' + if (visualNovel.optimizations.preCalculateScenesInfo) { + optimizedSetImage = helper.codePrepare(` + imageViewCharacter.setImageResource(R.raw.${character.image})\n\n `, 8 + ) + } + switch (character.position.side) { + case 'left': { + savesSwitchLocal += helper.codePrepare(` + "${character.name}" -> { + ${optimizedSetImage}val leftDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) + + layoutParamsImageViewCharacter.setMargins(leftDpLoad + leftDpCharacter, topDpLoad, 0, 0) + }`, 0, 4, false + ) + + break + } + case 'leftTop': { + savesSwitchLocal += helper.codePrepare(` + "${character.name}" -> { + ${optimizedSetImage}val leftDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) + val topDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.top * 0.25)}sdp) + + layoutParamsImageViewCharacter.setMargins(leftDpLoad + leftDpCharacter, topDpLoad + topDpCharacter, 0, 0) + }`, 0, 4, false + ) + + break + } + case 'right': { + savesSwitchLocal += helper.codePrepare(` + "${character.name}" -> { + ${optimizedSetImage}val rightDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) + + layoutParamsImageViewCharacter.setMargins(leftDpLoad - rightDpCharacter, topDpLoad, 0, 0) + }`, 0, 4, false + ) + + break + } + case 'rightTop': { + savesSwitchLocal += helper.codePrepare(` + "${character.name}" -> { + ${optimizedSetImage}val rightDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) + val topDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.top * 0.25)}sdp) + + layoutParamsImageViewCharacter.setMargins(leftDpLoad - rightDpCharacter, topDpLoad + topDpCharacter, 0, 0) + }`, 0, 4, false + ) + + break + } + case 'top': { + savesSwitchLocal += helper.codePrepare(` + "${character.name}" -> { + ${optimizedSetImage}val topDpCharacter = resources.getDimensionPixelSize(com.intuit.sdp.R.dimen._${Math.round(character.position.margins.side * 0.25)}sdp) + + layoutParamsImageViewCharacter.setMargins(leftDpLoad, topDpLoad + topDpCharacter, 0, 0) + }`, 0, 4, false + ) + + break + } + case 'center': { + savesSwitchLocal += helper.codePrepare(` + "${character.name}" -> { + ${optimizedSetImage}layoutParamsImageViewCharacter.setMargins(leftDpLoad, topDpLoad, 0, 0) + }`, 0, 4, false + ) + + break + } + } + }) + + return savesSwitchLocal + '\n' + helper.codePrepare('}\n', 0, 12, false) + helper.codePrepare('}', 0, 10, false) +} + +function sceneEachFinalize(savesSwitchCode) { + return helper.codePrepare(` + when (buttonData.get${visualNovel.optimizations.hashScenesNames ? 'Int' : 'String'}("scene")) {`, 0, 4 + ) + savesSwitchCode + '\n' + + helper.codePrepare('}', 0, 8, false) +} + export default { writeFunction, replace, @@ -352,7 +437,6 @@ export default { verifyParams, codePrepare, addResource, - addMultipleResources, getResource, getMultipleResources, finalizeResources, @@ -360,5 +444,7 @@ export default { hash, getSceneId, getAchievementId, - removeAllDoubleLines + removeAllDoubleLines, + sceneEach, + sceneEachFinalize } diff --git a/src/menu.js b/src/menu.js index 65054cc..043bde9 100644 --- a/src/menu.js +++ b/src/menu.js @@ -1,7 +1,5 @@ import helper from './helper.js' -let gCustomCode = null - function init(options) { const checks = { 'textColor': { @@ -473,8 +471,6 @@ function finalize(menu) { customCode = helper.finalizeResources(menu, customCode) - gCustomCode = customCode - let mainCode = 'val sharedPreferences = getSharedPreferences("VNConfig", Context.MODE_PRIVATE)\n' if (menu.background.music) { @@ -527,12 +523,12 @@ function finalize(menu) { const ssp13Main = helper.getMultipleResources(menu, menu.pages.main, { type: 'ssp', dp: '13' }) menu.pages.main = helper.addResource(menu.pages.main, { type: 'ssp', dp: '13', spaces: 4 }) - const sdp88Main = helper.getMultipleResources(menu, menu.pages.main, { type: 'sdp', dp: '88' }) - menu.pages.main = helper.addResource(menu.pages.main, { type: 'sdp', dp: '88', spaces: 4 }) - const sdpMinus3Main = helper.getMultipleResources(menu, menu.pages.main, { type: 'sdp', dp: 'minus3' }) menu.pages.main = helper.addResource(menu.pages.main, { type: 'sdp', dp: 'minus3', spaces: 4 }) + const sdp88Main = helper.getMultipleResources(menu, menu.pages.main, { type: 'sdp', dp: '88' }) + menu.pages.main = helper.addResource(menu.pages.main, { type: 'sdp', dp: '88', spaces: 4, newLines: sdpMinus3Main.definition ? '\n' : '\n\n' }) + const sdp161Main = helper.getMultipleResources(menu, menu.pages.main, { type: 'sdp', dp: '161' }) menu.pages.main = helper.addResource(menu.pages.main, { type: 'sdp', dp: '161', spaces: 4 }) @@ -724,7 +720,7 @@ function finalize(menu) { menu.pages.about = helper.addResource(menu.pages.about, { type: 'sdp', dp: 'minus3', spaces: 4 }) const sdp88About = helper.getMultipleResources(menu, menu.pages.about, { type: 'sdp', dp: '88' }) - menu.pages.about = helper.addResource(menu.pages.about, { type: 'sdp', dp: '88', spaces: 4 }) + menu.pages.about = helper.addResource(menu.pages.about, { type: 'sdp', dp: '88', spaces: 4, newLines: sdpMinus3About.definition ? '\n' : '\n\n' }) const sdp53About = helper.getMultipleResources(menu, menu.pages.about, { type: 'sdp', dp: '53' }) menu.pages.about = helper.addResource(menu.pages.about, { type: 'sdp', dp: '53', spaces: 4 }) @@ -989,12 +985,12 @@ function finalize(menu) { const ssp13Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'ssp', dp: '13' }) menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'ssp', dp: '13', spaces: 4 }) - const sdp88Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '88' }) - menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '88', spaces: 4 }) - const sdpMinus3Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: 'minus3' }) menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: 'minus3', spaces: 4 }) + const sdp88Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '88' }) + menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '88', spaces: 4, newLines: sdpMinus3Settings.definition ? '\n' : '\n\n' }) + const sdp161Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '161' }) menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '161', spaces: 4 }) @@ -1043,21 +1039,21 @@ function finalize(menu) { const ssp16Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'ssp', dp: '16' }) menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'ssp', dp: '16', spaces: 4 }) - const sdp149Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '149' }) - menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '149', spaces: 4 }) - const sdp53Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '53' }) menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '53', spaces: 4 }) + const sdp149Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '149' }) + menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '149', spaces: 4, newLines: sdp53Settings.definition ? '\n' : '\n\n' }) + const sdp150Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '150' }) menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '150', spaces: 4 }) - const sdp135Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '135' }) - menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '135', spaces: 4 }) - const sdp77Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '77' }) menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '77', spaces: 4 }) + const sdp135Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '135' }) + menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '135', spaces: 4, newLines: sdp77Settings.definition ? '\n' : '\n\n' }) + const sdp443Settings = helper.getMultipleResources(menu, menu.pages.settings, { type: 'sdp', dp: '443' }) menu.pages.settings = helper.addResource(menu.pages.settings, { type: 'sdp', dp: '443', spaces: 4 }) @@ -1546,7 +1542,7 @@ function finalize(menu) { menu.pages.saves = helper.addResource(menu.pages.saves, { type: 'sdp', dp: 'minus3', spaces: 4 }) const sdp88Saves = helper.getMultipleResources(menu, menu.pages.saves, { type: 'sdp', dp: '88' }) - menu.pages.saves = helper.addResource(menu.pages.saves, { type: 'sdp', dp: '88', spaces: 4 }) + menu.pages.saves = helper.addResource(menu.pages.saves, { type: 'sdp', dp: '88', spaces: 4, newLines: sdpMinus3Saves.definition ? '\n' : '\n\n' }) const sdp161Saves = helper.getMultipleResources(menu, menu.pages.saves, { type: 'sdp', dp: '161' }) menu.pages.saves = helper.addResource(menu.pages.saves, { type: 'sdp', dp: '161', spaces: 4 }) @@ -1596,12 +1592,12 @@ function finalize(menu) { const sdp300Saves = helper.getMultipleResources(menu, menu.pages.saves, { type: 'sdp', dp: '287' }) menu.pages.saves = helper.addResource(menu.pages.saves, { type: 'sdp', dp: '287', spaces: 4 }) - const sdp100Saves = helper.getMultipleResources(menu, menu.pages.savesFor, { type: 'sdp', dp: '100' }) - menu.pages.savesFor = helper.addResource(menu.pages.savesFor, { type: 'sdp', dp: '100', spaces: 6 }) - const sdp70Saves = helper.getMultipleResources(menu, menu.pages.savesFor, { type: 'sdp', dp: '70' }) menu.pages.savesFor = helper.addResource(menu.pages.savesFor, { type: 'sdp', dp: '70', spaces: 6 }) + const sdp100Saves = helper.getMultipleResources(menu, menu.pages.savesFor, { type: 'sdp', dp: '100' }) + menu.pages.savesFor = helper.addResource(menu.pages.savesFor, { type: 'sdp', dp: '100', spaces: 6, newLines: sdp70Saves.definition ? '\n' : '\n\n' }) + let scenesInfoCalculations = '' if (visualNovel.optimizations.preCalculateScenesInfo) { scenesInfoCalculations = helper.codePrepare(`\n @@ -1896,12 +1892,12 @@ __PERFORVNM_SAVES_SWITCH__ const ssp13Achievements = helper.getMultipleResources(menu, menu.pages.achievements, { type: 'ssp', dp: '13' }) menu.pages.achievements = helper.addResource(menu.pages.achievements, { type: 'ssp', dp: '13', spaces: 4 }) - const sdp88Achievements = helper.getMultipleResources(menu, menu.pages.achievements, { type: 'sdp', dp: '88' }) - menu.pages.achievements = helper.addResource(menu.pages.achievements, { type: 'sdp', dp: '88', spaces: 4 }) - const sdpMinus3Achievements = helper.getMultipleResources(menu, menu.pages.achievements, { type: 'sdp', dp: 'minus3' }) menu.pages.achievements = helper.addResource(menu.pages.achievements, { type: 'sdp', dp: 'minus3', spaces: 4 }) + const sdp88Achievements = helper.getMultipleResources(menu, menu.pages.achievements, { type: 'sdp', dp: '88' }) + menu.pages.achievements = helper.addResource(menu.pages.achievements, { type: 'sdp', dp: '88', spaces: 4, newLines: sdpMinus3Achievements.definition ? '\n' : '\n\n' }) + const sdp161Achievements = helper.getMultipleResources(menu, menu.pages.achievements, { type: 'sdp', dp: '161' }) menu.pages.achievements = helper.addResource(menu.pages.achievements, { type: 'sdp', dp: '161', spaces: 4 })