diff --git a/.gitignore b/.gitignore index 9edaaf1..7b9958e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ -/VirtualCast.exe -/config.json -/config.yaml -/config.yml /*.lnk /node_modules diff --git a/readme.md b/readme.md index 7a005b8..8016b64 100644 --- a/readme.md +++ b/readme.md @@ -77,7 +77,7 @@ allow_direct_view: true ------ ![](demo.gif) -1. [バーチャルキャストを起動.js.cmd]を `VirtualCast.exe` があるフォルダに保存します。 +1. [バーチャルキャストを起動.js.cmd]を好きなフォルダに保存します。 2. `バーチャルキャストを起動.js.cmd` をダブルクリックして実行します。 3. `config.json` の内容をもとに `config.yaml` が作成された後、バーチャルキャストが起動します。 **※記述しているニコニ立体番号が多い場合、`config.yaml` の作成にしばらくかかります。** 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 d43b1ad..2b58f54 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" @@ -12,12 +12,13 @@ EXIT %errorlevel% */ * @see {@link https://github.com/esperecyan/virtualcast-config} */ (function () { +var Shell = WSH.CreateObject('WScript.Shell'); /** * st@C̃t@CB * @constant {string} */ -var EXE_FILE_NAME = 'VirtualCast.exe'; +var EXE_URL = 'steam://rungameid/947890'; /** * config.json `niconico.charcter_models` Ɏwłő̃fB @@ -26,7 +27,13 @@ var EXE_FILE_NAME = 'VirtualCast.exe'; var MAX_NICONICO_CHARCTER_MODELS_COUNT = 16; /** - * o͐t@CB + * o͐tH_pXB + * @constant {string} + */ +var CONFIG_FOLDER_PATH = Shell.ExpandEnvironmentStrings('%USERPROFILE%\\Documents\\My Games\\VirtualCast'); + +/** + * o͐t@CpXB * @constant {string} */ var OUTPUT_FILE_NAME = 'config.json'; @@ -53,7 +60,6 @@ var DELAY_MILISECONDS = 1000; var FileSystemObject = WSH.CreateObject('Scripting.FileSystemObject'); -var Shell = WSH.CreateObject('WScript.Shell'); var htmlfile = WSH.CreateObject('htmlfile'); htmlfile.write(''); var JSON = htmlfile.parentWindow.JSON; @@ -148,15 +154,13 @@ function isValidConfig(config, filename) return true; } -var folder = FileSystemObject.GetFolder(FileSystemObject.GetParentFolderName(WSH.ScriptFullName)); +var folder = FileSystemObject.GetFolder(CONFIG_FOLDER_PATH); -var exeFile, outputFile, inputFile; +var outputFile, inputFile; var files = new Enumerator(folder.files); for (; !files.atEnd(); files.moveNext()) { var file = files.item(); - if (file.Name === EXE_FILE_NAME) { - exeFile = file; - } else if (file.Name === OUTPUT_FILE_NAME) { + if (file.Name === OUTPUT_FILE_NAME) { outputFile = file; } else if (INPUT_FILE_NAMES.includes(file.Name)) { if (inputFile) { @@ -173,16 +177,6 @@ for (; !files.atEnd(); files.moveNext()) { } } -if (!exeFile) { - Shell.Popup( - 'u' + EXE_FILE_NAME + 'v‚܂Bu' + WSH.ScriptName + 'v𓯂tH_ɓKv܂B', - 0, - WSH.ScriptName, - vbOKOnly + vbCritical - ); - return; -} - if (inputFile) { // config.yaml config.json if ((outputFile || folder).Attributes & ReadOnly) { @@ -336,11 +330,7 @@ if (inputFile) { return; } -var command = '"' + folder.Path + '\\' + EXE_FILE_NAME + '"'; -for (var i = 0, l = WSH.Arguments.length; i < l; i++) { - command += ' ' + WSH.Arguments(i); -} -Shell.Run(command); +Shell.Run('explorer ' + EXE_URL); })();