From 0e22d4fb6e5468d1706bcace3dec9177f5fe755b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?100=E3=81=AE=E4=BA=BA?= <100@pokemori.jp> Date: Wed, 5 Sep 2018 22:31:35 +0900 Subject: [PATCH] =?UTF-8?q?=E8=B5=B7=E5=8B=95=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=A7=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=82=80?= =?UTF-8?q?=E3=83=A2=E3=83=87=E3=83=AB=E3=82=92=E5=88=87=E3=82=8A=E6=9B=BF?= =?UTF-8?q?=E3=81=88=E3=82=89=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 136 ++++++++++++++++++ ...43\202\222\350\265\267\345\213\225.js.cmd" | 37 +++++ 2 files changed, 173 insertions(+) diff --git a/readme.md b/readme.md index 2e8ed43..e2e1c51 100644 --- a/readme.md +++ b/readme.md @@ -87,6 +87,142 @@ allow_direct_view: true [バーチャルキャストを起動.js.cmd]: https://esperecyan.github.io/virtualcast-config/%E3%83%90%E3%83%BC%E3%83%81%E3%83%A3%E3%83%AB%E3%82%AD%E3%83%A3%E3%82%B9%E3%83%88%E3%82%92%E8%B5%B7%E5%8B%95.js.cmd +起動オプション +-------------- +### `--esperecyan-niconico-character-models-offset-16x=[数字]` +`niconico.character_models` の順番をズラします。 + +例: + +```yaml +niconico: + character_models: + - 32797 + - 32806 + - 32813 + - 32819 + - 32830 + - 32865 + - 32872 + - 32876 + - 32898 + - 32899 + - 32928 + - 32947 + - 32952 + - 32969 + - 33010 + - 33028 + - 40000 + - 40001 + - 40023 + - 40051 + - 40077 + - 40093 + - 40258 + - 40363 + - 40463 + - 40480 + - 40481 + - 40524 + - 40567 + - 40624 + - 40660 + - 40677 + - 41036 +``` + +#### `--esperecyan-niconico-character-models-offset-16x=0` の場合 +指定しなかった場合と同じ。 + +#### `--esperecyan-niconico-character-models-offset-16x=1` の場合 + +```json +{ + "niconico": { + "character_models": [ + 40000, + 40001, + 40023, + 40051, + 40077, + 40093, + 40258, + 40363, + 40463, + 40480, + 40481, + 40524, + 40567, + 40624, + 40660, + 40677, + 41036, + 32797, + 32806, + 32813, + 32819, + 32830, + 32865, + 32872, + 32876, + 32898, + 32899, + 32928, + 32947, + 32952, + 32969, + 33010, + 33028 + ] + } +} +``` + +#### `--esperecyan-niconico-character-models-offset-16x=2` の場合 + +```json +{ + "niconico": { + "character_models": [ + 41036, + 32797, + 32806, + 32813, + 32819, + 32830, + 32865, + 32872, + 32876, + 32898, + 32899, + 32928, + 32947, + 32952, + 32969, + 33010, + 33028, + 40000, + 40001, + 40023, + 40051, + 40077, + 40093, + 40258, + 40363, + 40463, + 40480, + 40481, + 40524, + 40567, + 40624, + 40660, + 40677 + ] + } +} +``` + Contribution ------------ Pull Request、または Issue よりお願いいたします。 diff --git "a/\343\203\220\343\203\274\343\203\201\343\203\243\343\203\253\343\202\255\343\203\243\343\202\271\343\203\210\343\202\222\350\265\267\345\213\225.js.cmd" "b/\343\203\220\343\203\274\343\203\201\343\203\243\343\203\253\343\202\255\343\203\243\343\202\271\343\203\210\343\202\222\350\265\267\345\213\225.js.cmd" index 8ead280..ad2e513 100644 --- "a/\343\203\220\343\203\274\343\203\201\343\203\243\343\203\253\343\202\255\343\203\243\343\202\271\343\203\210\343\202\222\350\265\267\345\213\225.js.cmd" +++ "b/\343\203\220\343\203\274\343\203\201\343\203\243\343\203\253\343\202\255\343\203\243\343\202\271\343\203\210\343\202\222\350\265\267\345\213\225.js.cmd" @@ -19,6 +19,12 @@ EXIT %errorlevel% */ */ var EXE_FILE_NAME = 'VirtualCast.exe'; +/** + * config.json `niconico.charcter_models` Ɏwłő̃fB + * @constant {string} + */ +var MAX_NICONICO_CHARCTER_MODELS_COUNT = 16; + /** * o͐t@CB * @constant {string} @@ -204,6 +210,22 @@ if (inputFile) { return; } + if (typeof config.niconico === 'object' && config.niconico !== null + && Array.isArray(config.niconico.character_models)) { + for (var i = 0, l = WSH.Arguments.length; i < l; i++) { + if (WSH.Arguments(i).startsWith('--esperecyan-niconico-character-models-offset-16x=')) { + var offset = Number.parseInt( + WSH.Arguments(i).replace('--esperecyan-niconico-character-models-offset-16x=', '') + ) * MAX_NICONICO_CHARCTER_MODELS_COUNT; + if (config.niconico.character_models.length > offset) { + config.niconico.character_models + = config.niconico.character_models.concat(config.niconico.character_models.splice(0, offset)); + } + break; + } + } + } + putFileContents(folder.Path + '\\' + OUTPUT_FILE_NAME, JSON.stringify(config, null, '\t').replace(/\n/g, '\r\n')); } else if (outputFile) { // config.json config.yaml @@ -3023,6 +3045,21 @@ if (!Array.prototype.includes) { } }); } + +/** + * @see [String.prototype.startsWith() - JavaScript | MDN]{@link + * https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#Polyfill} + * @license CC0-1.0 + */ +if (!String.prototype.startsWith) { + String.prototype.startsWith = function(search, pos) { + return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; + }; +} + +if (!Number.parseInt) { + Number.parseInt = parseInt; +} }