webtalekit-alpha 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +12 -0
- package/.clinerules +65 -0
- package/.history/README_20240812174230.md +193 -0
- package/.history/README_20240812175424.md +185 -0
- package/.history/README_20240812191012.md +185 -0
- package/.history/README_20240812191155.md +185 -0
- package/.history/README_20240812191211.md +185 -0
- package/.history/README_20240812192035.md +185 -0
- package/.history/dist/src/core/index_20240815021552.js +474 -0
- package/.history/dist/src/core/index_20240815022042.js +476 -0
- package/.history/dist/src/core/index_20240815022206.js +476 -0
- package/.history/dist/src/core/index_20240815023104.js +478 -0
- package/.history/dist/src/core/index_20240817022019.js +494 -0
- package/.history/dist/src/core/index_20240818013827.js +493 -0
- package/.history/dist/src/core/index_20240820001418.js +502 -0
- package/.history/package_20240812174230.json +45 -0
- package/.history/package_20240825011731.json +45 -0
- package/.history/package_20240825011739.json +44 -0
- package/.history/parser/parser_20240812174230.js +50 -0
- package/.history/parser/parser_20240825012739.js +47 -0
- package/.history/parser/parser_20240825012835.js +52 -0
- package/.history/src/core/drawer_20240813091343.ts +262 -0
- package/.history/src/core/drawer_20240815232345.ts +262 -0
- package/.history/src/core/drawer_20240815232350.ts +262 -0
- package/.history/src/core/drawer_20240816025257.ts +357 -0
- package/.history/src/core/drawer_20240816025358.ts +357 -0
- package/.history/src/core/drawer_20240816030148.ts +365 -0
- package/.history/src/core/drawer_20240816231033.ts +294 -0
- package/.history/src/core/drawer_20240816231107.ts +262 -0
- package/.history/src/core/drawer_20240816231234.ts +268 -0
- package/.history/src/core/drawer_20240817013836.ts +290 -0
- package/.history/src/core/drawer_20240817015150.ts +289 -0
- package/.history/src/core/drawer_20240817015353.ts +290 -0
- package/.history/src/core/drawer_20240817021254.ts +291 -0
- package/.history/src/core/drawer_20240817023440.ts +295 -0
- package/.history/src/core/drawer_20240817023445.ts +295 -0
- package/.history/src/core/drawer_20240818015327.ts +295 -0
- package/.history/src/core/drawer_20240819231006.ts +318 -0
- package/.history/src/core/drawer_20240820002829.ts +317 -0
- package/.history/src/core/drawer_20240820003141.ts +295 -0
- package/.history/src/core/drawer_20240824010043.ts +295 -0
- package/.history/src/core/drawer_20240825013311.ts +293 -0
- package/.history/src/core/drawer_20240902235257.ts +295 -0
- package/.history/src/core/drawer_20240904002038.ts +262 -0
- package/.history/src/core/drawer_20240904004020.ts +262 -0
- package/.history/src/core/drawer_20240904004238.ts +262 -0
- package/.history/src/core/drawer_20240904005648.ts +262 -0
- package/.history/src/core/drawer_20240904005808.ts +262 -0
- package/.history/src/core/drawer_20240904010523.ts +262 -0
- package/.history/src/core/drawer_20240904011611.ts +262 -0
- package/.history/src/core/drawer_20240904011740.ts +262 -0
- package/.history/src/core/index_20240812190102.js +443 -0
- package/.history/src/core/index_20240812190105.js +443 -0
- package/.history/src/core/index_20240812205421.js +452 -0
- package/.history/src/core/index_20240812213441.js +452 -0
- package/.history/src/core/index_20240812214203.js +453 -0
- package/.history/src/core/index_20240813090823.js +453 -0
- package/.history/src/core/index_20240813230449.js +452 -0
- package/.history/src/core/index_20240813230539.js +452 -0
- package/.history/src/core/index_20240813231447.js +453 -0
- package/.history/src/core/index_20240813231449.js +453 -0
- package/.history/src/core/index_20240813231511.js +453 -0
- package/.history/src/core/index_20240813231531.js +453 -0
- package/.history/src/core/index_20240813231913.js +453 -0
- package/.history/src/core/index_20240813232356.js +453 -0
- package/.history/src/core/index_20240813232640.js +453 -0
- package/.history/src/core/index_20240813232900.js +453 -0
- package/.history/src/core/index_20240814221127.js +454 -0
- package/.history/src/core/index_20240814221322.js +454 -0
- package/.history/src/core/index_20240814221526.js +454 -0
- package/.history/src/core/index_20240814222048.js +454 -0
- package/.history/src/core/index_20240814222918.js +459 -0
- package/.history/src/core/index_20240814223136.js +459 -0
- package/.history/src/core/index_20240814223501.js +464 -0
- package/.history/src/core/index_20240814224347.js +468 -0
- package/.history/src/core/index_20240815013712.js +474 -0
- package/.history/src/core/index_20240815021534.js +474 -0
- package/.history/src/core/index_20240815023143.js +477 -0
- package/.history/src/core/index_20240815023207.js +479 -0
- package/.history/src/core/index_20240815023344.js +481 -0
- package/.history/src/core/index_20240815035600.js +479 -0
- package/.history/src/core/index_20240815041549.js +480 -0
- package/.history/src/core/index_20240815185515.js +481 -0
- package/.history/src/core/index_20240815192158.js +481 -0
- package/.history/src/core/index_20240815222912.js +482 -0
- package/.history/src/core/index_20240815224052.js +483 -0
- package/.history/src/core/index_20240815224843.js +484 -0
- package/.history/src/core/index_20240815224850.js +483 -0
- package/.history/src/core/index_20240815231706.js +479 -0
- package/.history/src/core/index_20240816025748.js +483 -0
- package/.history/src/core/index_20240816030102.js +484 -0
- package/.history/src/core/index_20240817013329.js +485 -0
- package/.history/src/core/index_20240817013526.js +485 -0
- package/.history/src/core/index_20240817013819.js +488 -0
- package/.history/src/core/index_20240817013829.js +488 -0
- package/.history/src/core/index_20240817014921.js +494 -0
- package/.history/src/core/index_20240817022057.js +494 -0
- package/.history/src/core/index_20240817023316.js +493 -0
- package/.history/src/core/index_20240818005637.js +493 -0
- package/.history/src/core/index_20240818005721.js +493 -0
- package/.history/src/core/index_20240818011804.js +493 -0
- package/.history/src/core/index_20240818013835.js +493 -0
- package/.history/src/core/index_20240818014310.js +493 -0
- package/.history/src/core/index_20240818014323.js +493 -0
- package/.history/src/core/index_20240818014333.js +493 -0
- package/.history/src/core/index_20240818020725.js +496 -0
- package/.history/src/core/index_20240819195504.js +497 -0
- package/.history/src/core/index_20240819202012.js +495 -0
- package/.history/src/core/index_20240819231228.js +501 -0
- package/.history/src/core/index_20240819232555.js +502 -0
- package/.history/src/core/index_20240819233404.js +502 -0
- package/.history/src/core/index_20240820003114.js +495 -0
- package/.history/src/core/index_20240820003120.js +495 -0
- package/.history/src/core/index_20240820003331.js +495 -0
- package/.history/src/core/index_20240820004126.js +498 -0
- package/.history/src/core/index_20240820004357.js +497 -0
- package/.history/src/core/index_20240820005103.js +498 -0
- package/.history/src/core/index_20240820005110.js +499 -0
- package/.history/src/core/index_20240820005206.js +497 -0
- package/.history/src/core/index_20240820005352.js +497 -0
- package/{src/core/index.js → .history/src/core/index_20240823224904.ts} +75 -231
- package/.history/src/core/index_20240823224905.js +505 -0
- package/.history/src/core/index_20240823231631.ts +530 -0
- package/.history/src/core/index_20240823231735.ts +530 -0
- package/.history/src/core/index_20240823232123.ts +539 -0
- package/.history/src/core/index_20240823232329.ts +539 -0
- package/.history/src/core/index_20240823233058.ts +539 -0
- package/.history/src/core/index_20240823234946.ts +539 -0
- package/.history/src/core/index_20240824005956.ts +534 -0
- package/.history/src/core/index_20240824010113.ts +534 -0
- package/.history/src/core/index_20240824010124.ts +534 -0
- package/.history/src/core/index_20240824010212.ts +534 -0
- package/.history/src/core/index_20240824010218.ts +534 -0
- package/.history/src/core/index_20240824010407.ts +534 -0
- package/.history/src/core/index_20240824010611.ts +534 -0
- package/.history/src/core/index_20240824010623.ts +534 -0
- package/.history/src/core/index_20240824010652.ts +534 -0
- package/.history/src/core/index_20240824011007.ts +534 -0
- package/.history/src/core/index_20240824210450.ts +534 -0
- package/.history/src/core/index_20240824210703.ts +534 -0
- package/.history/src/core/index_20240824210708.ts +534 -0
- package/.history/src/core/index_20240824211001.ts +537 -0
- package/.history/src/core/index_20240824211258.ts +537 -0
- package/.history/src/core/index_20240824211654.ts +537 -0
- package/.history/src/core/index_20240824211723.ts +537 -0
- package/.history/src/core/index_20240824211808.ts +538 -0
- package/.history/src/core/index_20240824214041.js +538 -0
- package/.history/src/core/index_20240824215312.ts +538 -0
- package/.history/src/core/index_20240824215341.ts +538 -0
- package/.history/src/core/index_20240824220703.ts +538 -0
- package/.history/src/core/index_20240824220709.ts +538 -0
- package/.history/src/core/index_20240825012244.ts +536 -0
- package/.history/src/core/index_20240825012435.ts +539 -0
- package/.history/src/core/index_20240825012440.ts +539 -0
- package/.history/src/core/index_20240826005054.ts +539 -0
- package/.history/src/core/index_20240826005321.ts +540 -0
- package/.history/src/core/index_20240826005410.ts +539 -0
- package/.history/src/core/index_20240826005418.ts +539 -0
- package/.history/src/core/index_20240830231825.ts +539 -0
- package/.history/src/core/index_20240831022416.ts +539 -0
- package/.history/src/core/index_20240901222314.js +459 -0
- package/.history/src/core/index_20240901222951.js +459 -0
- package/.history/src/core/index_20240901223824.js +471 -0
- package/.history/src/core/index_20240901223833.js +468 -0
- package/.history/src/core/index_20240902223954.js +447 -0
- package/.history/src/core/index_20240902224000.js +446 -0
- package/.history/src/core/index_20240902230345.js +448 -0
- package/.history/src/core/index_20240902231130.js +449 -0
- package/.history/src/core/index_20240902231559.js +449 -0
- package/.history/src/core/index_20240902232135.js +449 -0
- package/.history/src/core/index_20240902232809.js +452 -0
- package/.history/src/core/index_20240902232815.js +452 -0
- package/.history/src/core/index_20240903000104.js +467 -0
- package/.history/src/core/index_20240904001731.js +444 -0
- package/.history/src/core/index_20240904002038.ts +539 -0
- package/.history/src/core/index_20240904011848.js +444 -0
- package/.history/src/core/index_20240904012138.js +444 -0
- package/.history/src/core/index_20240904012743.js +444 -0
- package/.history/src/core/index_20240904013051.js +444 -0
- package/.history/src/core/resourceManager_20240403231531.ts +16 -0
- package/.history/src/core/resourceManager_20240823232627.ts +17 -0
- package/.history/src/core/resourceManager_20240824214014.js +16 -0
- package/.history/src/core/resourceManager_20240824214620.js +17 -0
- package/.history/src/core/scenarioManager_20240812203410.ts +86 -0
- package/.history/src/core/scenarioManager_20240812203839.ts +94 -0
- package/.history/src/core/scenarioManager_20240812213437.ts +85 -0
- package/.history/src/core/scenarioManager_20240813225852.ts +85 -0
- package/.history/src/core/scenarioManager_20240823235010.ts +85 -0
- package/.history/src/core/scenarioManager_20240904002038.ts +94 -0
- package/.history/src/core/scenarioManager_20240904012411.ts +94 -0
- package/.history/src/core/scenarioManager_20240904012519.ts +94 -0
- package/.history/src/index_20240403231531.js +6 -0
- package/.history/src/index_20240429233436.js +8 -0
- package/.history/src/index_20240429233926.js +8 -0
- package/.history/src/index_20240429234401.js +7 -0
- package/.history/src/index_20240429234404.js +6 -0
- package/.history/src/resource/soundObject_20240419004314.ts +71 -0
- package/.history/src/resource/soundObject_20240815034420.ts +66 -0
- package/.history/src/resource/soundObject_20240815034836.ts +79 -0
- package/.history/src/resource/soundObject_20240815034919.ts +87 -0
- package/.history/src/resource/soundObject_20240815040724.ts +81 -0
- package/.history/src/resource/soundObject_20240815041022.ts +87 -0
- package/.history/src/resource/soundObject_20240815042103.ts +87 -0
- package/.history/src/resource/soundObject_20240823235929.ts +91 -0
- package/.history/src/resource/soundObject_20240824213129.ts +99 -0
- package/.history/src/resource/soundObject_20240824213611.ts +101 -0
- package/.history/src/resource/soundObject_20240824215734.ts +101 -0
- package/.history/src/resource/soundObject_20240825004926.ts +101 -0
- package/.history/src/resource/soundObject_20240825004947.ts +101 -0
- package/.history/src/utils/logger_20240812174230.ts +13 -0
- package/.history/src/utils/logger_20240823232736.ts +14 -0
- package/.history/src/utils/logger_20240824214930.js +14 -0
- package/.history/src/utils/store_20240812174230.ts +17 -0
- package/.history/src/utils/store_20240823232948.ts +29 -0
- package/.history/src/utils/store_20240824214020.js +17 -0
- package/.history/src/utils/store_20240824214955.js +29 -0
- package/.history/src/utils/waitUtil_20240812174230.ts +4 -0
- package/.history/src/utils/waitUtil_20240823232739.ts +4 -0
- package/.history/src/utils/waitUtil_20240824214024.js +4 -0
- package/.history/src/utils/waitUtil_20240824215009.js +4 -0
- package/.history/test/js/title_20240428215305.js +254 -0
- package/.history/test/js/title_20240429221911.js +227 -0
- package/.history/test/js/title_20240429222806.js +243 -0
- package/.history/test/js/title_20240429222854.js +263 -0
- package/.history/test/js/title_20240429222906.js +263 -0
- package/.history/test/js/title_20240429235639.js +263 -0
- package/.history/test/js/title_20240429235840.js +263 -0
- package/.history/test/js/title_20240430014721.js +262 -0
- package/.history/test/js/title_20240430014759.js +254 -0
- package/.history/test/js/title_20240430134612.js +285 -0
- package/.history/test/js/title_20240430141051.js +285 -0
- package/.history/test/js/title_20240430173745.js +245 -0
- package/.history/tsconfig_20240812174230.json +22 -0
- package/.history/tsconfig_20240824010157.json +19 -0
- package/.history/tsconfig_20240824220700.json +20 -0
- package/.history/tsconfig_20240825011301.json +20 -0
- package/.history/webpack.config_20240423002825.js +37 -0
- package/.history/webpack.config_20240430001157.js +38 -0
- package/.history/webpack.config_20240430001309.js +37 -0
- package/.history/webpack.config_20240430002112.js +37 -0
- package/CLAUDE.md +96 -0
- package/LICENSE +21 -0
- package/README.md +108 -39
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/core/drawer.ts.html +1264 -0
- package/coverage/lcov-report/core/index.html +146 -0
- package/coverage/lcov-report/core/resourceManager.ts.html +136 -0
- package/coverage/lcov-report/core/scenarioManager.ts.html +373 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/resource/ImageObject.ts.html +433 -0
- package/coverage/lcov-report/resource/index.html +131 -0
- package/coverage/lcov-report/resource/soundObject.ts.html +346 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/utils/TextMeasurer.ts.html +520 -0
- package/coverage/lcov-report/utils/index.html +161 -0
- package/coverage/lcov-report/utils/logger.ts.html +142 -0
- package/coverage/lcov-report/utils/store.ts.html +151 -0
- package/coverage/lcov-report/utils/waitUtil.ts.html +97 -0
- package/coverage/lcov.info +882 -0
- package/dist/README.md +294 -0
- package/dist/engineConfig.json +10 -0
- package/dist/package.json +51 -0
- package/dist/parser/cli.js +61 -0
- package/dist/parser/parser.js +53 -0
- package/{src → dist/src}/core/drawer.js +0 -9
- package/dist/src/core/drawer.js.map +1 -0
- package/dist/src/core/index.js +969 -0
- package/{src → dist/src}/core/scenarioManager.js +5 -6
- package/dist/src/core/scenarioManager.js.map +1 -0
- package/{src → dist/src}/resource/soundObject.js +4 -2
- package/dist/src/resource/soundObject.js.map +1 -0
- package/dist/src/utils/fallbackTemplate.js +13 -0
- package/dist/src/utils/fallbackTemplate.js.map +1 -0
- package/dist/webtalekit-alpha-0.2.13.tgz +0 -0
- package/docs/event-system-specification.md +493 -0
- package/docs/glossary.html +833 -0
- package/docs/index.html +296 -0
- package/docs/tag-reference.html +1317 -0
- package/docs/ui-template-guide.html +1068 -0
- package/example/README.md +29 -0
- package/example/engineConfig.json +10 -0
- package/example/package-lock.json +5145 -0
- package/example/package.json +26 -0
- package/example/src/index.js +13 -0
- package/example/src/resource/background/beach.jpg +0 -0
- package/example/src/resource/background/city.jpg +0 -0
- package/example/src/resource/background/crossroad.jpg +0 -0
- package/example/src/resource/background/forest.jpg +0 -0
- package/example/src/resource/background/laboratory.jpg +0 -0
- package/example/src/resource/background/library.jpg +0 -0
- package/example/src/resource/background/living_room.jpg +0 -0
- package/example/src/resource/background/music_room.jpg +0 -0
- package/example/src/resource/background/stage.jpg +0 -0
- package/example/src/resource/background/sunset.jpg +0 -0
- package/example/src/resource/background/title_bg.png +0 -0
- package/example/src/resource/bgm/calm_music.wav +0 -0
- package/example/src/resource/bgm/doorbell.mp3 +0 -0
- package/example/src/resource/bgm/nc366476_Virtual_Voyage.mp3 +0 -0
- package/example/src/resource/bgm/title_theme.mp3 +0 -0
- package/example/src/resource/chara/dancer.png +0 -0
- package/example/src/resource/chara/guest.png +0 -0
- package/example/src/resource/chara/guide.png +0 -0
- package/example/src/resource/chara/scientist.png +0 -0
- package/example/src/resource/config.js +0 -0
- package/example/src/resource/se/doorbell.mp3 +0 -0
- package/example/src/resource/system/systemPicture/01_message/message.png +0 -0
- package/example/src/resource/system/systemPicture/02_button/button.png +0 -0
- package/example/src/resource/system/systemPicture/02_button/button2.png +0 -0
- package/example/src/resource/system/systemPicture/02_button/button3.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/auto.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/auto2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/close.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/close2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/config.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/config2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/load.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/load2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/log.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/log2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/menu.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/menu2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/qload.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/qload2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/qsave.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/qsave2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/save.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/save2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/screen.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/screen2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/skip.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/skip2.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/title.png +0 -0
- package/example/src/resource/system/systemPicture/03_system_button/title2.png +0 -0
- package/example/src/resource/system/systemPicture//345/210/251/347/224/250/350/246/217/347/264/204.txt +0 -0
- package/example/src/resource/system/wait.gif +0 -0
- package/example/src/scene/animation.scene +28 -0
- package/example/src/scene/background.scene +29 -0
- package/example/src/scene/character.scene +26 -0
- package/example/src/scene/choice.scene +97 -0
- package/example/src/scene/dialog.scene +105 -0
- package/example/src/scene/effects.scene +38 -0
- package/example/src/scene/en/animation.scene +28 -0
- package/example/src/scene/en/background.scene +26 -0
- package/example/src/scene/en/character.scene +26 -0
- package/example/src/scene/en/choice.scene +32 -0
- package/example/src/scene/en/effects.scene +37 -0
- package/example/src/scene/en/sound.scene +26 -0
- package/example/src/scene/en/text.scene +26 -0
- package/example/src/scene/en/title.scene +39 -0
- package/example/src/scene/if_test.scene +37 -0
- package/example/src/scene/resource-error-test.scene +15 -0
- package/example/src/scene/save-load-test.scene +48 -0
- package/example/src/scene/sound.scene +26 -0
- package/example/src/scene/test_error.scene +21 -0
- package/example/src/scene/text.scene +34 -0
- package/example/src/scene/title.scene +51 -0
- package/example/src/screen/incoming.html +474 -0
- package/example/src/screen/title.html +135 -0
- package/example/src/template.html +16 -0
- package/example/test-results/.last-run.json +4 -0
- package/example/webpack.config.js +69 -0
- package/image.png +0 -0
- package/package.json +3 -1
- package/playwright-report/index.html +71 -0
- package/s-plan1-5Light-s-1.jpg +0 -0
- package/test-results/.last-run.json +6 -0
- package/tests/e2e/if-global-attribute.spec.js +90 -0
- package/tests/e2e/resource-error-handling.spec.js +58 -0
- package/tests/e2e/screenshots/before-error-check.png +0 -0
- package/tests/e2e/screenshots/choices.png +0 -0
- package/tests/e2e/screenshots/message-window-click-wait.png +0 -0
- package/src/core/drawer.js.map +0 -1
- package/src/core/scenarioManager.js.map +0 -1
- package/src/resource/soundObject.js.map +0 -1
- /package/{src → dist/src}/core/resourceManager.js +0 -0
- /package/{src → dist/src}/core/resourceManager.js.map +0 -0
- /package/{src → dist/src}/resource/ImageObject.js +0 -0
- /package/{src → dist/src}/resource/ImageObject.js.map +0 -0
- /package/{src → dist/src}/utils/logger.js +0 -0
- /package/{src → dist/src}/utils/logger.js.map +0 -0
- /package/{src → dist/src}/utils/store.js +0 -0
- /package/{src → dist/src}/utils/store.js.map +0 -0
- /package/{src → dist/src}/utils/waitUtil.js +0 -0
- /package/{src → dist/src}/utils/waitUtil.js.map +0 -0
|
@@ -32,7 +32,6 @@ export class Core {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
constructor() {
|
|
35
|
-
// gameContainerの初期化(HTMLのgameContainerを取得する)
|
|
36
35
|
this.gameContainer = document.getElementById('gameContainer')
|
|
37
36
|
// Drawerの初期化(canvasタグのサイズを設定する)
|
|
38
37
|
this.drawer = new Drawer(this.gameContainer)
|
|
@@ -44,23 +43,17 @@ export class Core {
|
|
|
44
43
|
this.usedSounds = {}
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
outputLog('call', 'debug'
|
|
49
|
-
// ゲームの設定情報をセットする
|
|
50
|
-
engineConfig = config
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async start(initScene) {
|
|
54
|
-
outputLog('call', 'debug', initScene)
|
|
46
|
+
async start() {
|
|
47
|
+
outputLog('call', 'debug')
|
|
55
48
|
// TODO: ブラウザ用のビルドの場合は、最初にクリックしてもらう
|
|
56
49
|
// titleタグの内容を書き換える
|
|
57
50
|
document.title = engineConfig.title
|
|
58
51
|
// sceneファイルを読み込む
|
|
59
|
-
await this.loadScene(
|
|
52
|
+
await this.loadScene('title')
|
|
60
53
|
// 画面を表示する
|
|
61
54
|
await this.loadScreen(this.sceneConfig)
|
|
62
55
|
// 入力イベントを設定する
|
|
63
|
-
document.
|
|
56
|
+
document.addEventListener('keydown', (e) => {
|
|
64
57
|
if (e.key === 'Enter') {
|
|
65
58
|
this.onNextHandler()
|
|
66
59
|
} else if (e.key === 'Control') {
|
|
@@ -68,13 +61,13 @@ export class Core {
|
|
|
68
61
|
this.isNext = true
|
|
69
62
|
}
|
|
70
63
|
})
|
|
71
|
-
document.
|
|
64
|
+
document.addEventListener('keyup', (e) => {
|
|
72
65
|
if (e.key === 'Control') {
|
|
73
66
|
this.drawer.isSkip = true
|
|
74
67
|
this.isNext = false
|
|
75
68
|
}
|
|
76
69
|
})
|
|
77
|
-
document.
|
|
70
|
+
document.addEventListener('click', (e) => {
|
|
78
71
|
this.onNextHandler()
|
|
79
72
|
})
|
|
80
73
|
|
|
@@ -91,11 +84,6 @@ export class Core {
|
|
|
91
84
|
outputLog('call', 'debug', sceneFileName)
|
|
92
85
|
// sceneファイルを読み込む
|
|
93
86
|
this.sceneFile = await import(/* webpackChunkName: "[request]" */ `/src/js/${sceneFileName}.js`)
|
|
94
|
-
// sceneファイルの初期化処理を実行
|
|
95
|
-
if (this.sceneFile.init) {
|
|
96
|
-
this.sceneFile.init(this.getAPIForScript())
|
|
97
|
-
}
|
|
98
|
-
// シナリオの進行状況を初期化
|
|
99
87
|
this.scenarioManager.setScenario(this.sceneFile.scenario, sceneFileName)
|
|
100
88
|
this.sceneConfig = { ...this.sceneConfig, ...this.sceneFile.sceneConfig }
|
|
101
89
|
outputLog('sceneFile', 'debug', this.sceneFile)
|
|
@@ -109,12 +97,6 @@ export class Core {
|
|
|
109
97
|
var parser = new DOMParser()
|
|
110
98
|
var doc = parser.parseFromString(htmlString, 'text/html')
|
|
111
99
|
this.gameContainer.innerHTML = doc.getElementById('main').innerHTML
|
|
112
|
-
// 既に読み込んだスタイルシートがあったら削除する
|
|
113
|
-
const styleTags = document.head.getElementsByTagName('style')
|
|
114
|
-
for (const styleTag of styleTags) {
|
|
115
|
-
document.head.removeChild(styleTag)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
100
|
// Styleタグを取り出して、headタグに追加する
|
|
119
101
|
const styleElement = doc.head.getElementsByTagName('style')[0]
|
|
120
102
|
document.head.appendChild(styleElement)
|
|
@@ -142,8 +124,9 @@ export class Core {
|
|
|
142
124
|
return
|
|
143
125
|
}
|
|
144
126
|
outputLog('scenarioObject', 'debug', scenarioObject)
|
|
145
|
-
//
|
|
127
|
+
// prettier-ignore
|
|
146
128
|
const boundFunction = this.commandList[scenarioObject.type || 'text'].bind(this)
|
|
129
|
+
// prettier-ignore
|
|
147
130
|
outputLog(`boundFunction:${boundFunction.name.split(' ')[1]}`, 'debug', scenarioObject)
|
|
148
131
|
scenarioObject = await this.httpHandler(scenarioObject)
|
|
149
132
|
await boundFunction(scenarioObject)
|
|
@@ -158,7 +141,7 @@ export class Core {
|
|
|
158
141
|
scenarioObject.content = scenarioObject.content.concat(scenarioObject.then || scenarioObject.error)
|
|
159
142
|
}
|
|
160
143
|
outputLog('call', 'debug', scenarioObject)
|
|
161
|
-
|
|
144
|
+
|
|
162
145
|
// 名前が設定されている場合は、名前を表示する
|
|
163
146
|
if (scenarioObject.name) {
|
|
164
147
|
this.drawer.drawName(scenarioObject.name)
|
|
@@ -168,33 +151,40 @@ export class Core {
|
|
|
168
151
|
|
|
169
152
|
//prettier-ignore
|
|
170
153
|
this.onNextHandler = () => { this.drawer.isSkip = true }
|
|
171
|
-
this.drawer.clearText() // テキスト表示領域をクリア
|
|
172
154
|
// 表示する文章を1行ずつ表示する
|
|
173
|
-
for (const
|
|
174
|
-
|
|
175
|
-
if (typeof
|
|
176
|
-
|
|
155
|
+
for (const line of scenarioObject.content) {
|
|
156
|
+
// scenarioObject.content内にオブジェクトが含まれている場合は、クリア処理をスキップする
|
|
157
|
+
if (scenarioObject.content.some(item => typeof item === 'object' && item !== null)) {
|
|
158
|
+
|
|
159
|
+
} else {
|
|
160
|
+
this.drawer.clearText(); // テキスト表示領域をクリア
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (typeof line === 'string') {
|
|
164
|
+
await this.drawer.drawText(this.expandVariable(line), line.speed || 50)
|
|
177
165
|
} else {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
166
|
+
const container = this.drawer.createDecoratedElement(line);
|
|
167
|
+
await this.drawer.drawText(this.expandVariable(line.content[0]), line.speed || 50, container)
|
|
168
|
+
}
|
|
169
|
+
//prettier-ignore
|
|
170
|
+
this.onNextHandler = () => { this.isNext = true }
|
|
171
|
+
if (typeof line.wait === 'number') {
|
|
172
|
+
if (line.wait > 0 || this.isAuto) {
|
|
173
|
+
const waitTime = line.wait || 1500
|
|
174
|
+
// 指定された時間だけ待機
|
|
175
|
+
await sleep(waitTime)
|
|
187
176
|
}
|
|
177
|
+
} else {
|
|
178
|
+
// 改行ごとに入力待ち
|
|
179
|
+
await this.clickWait()
|
|
188
180
|
}
|
|
189
181
|
}
|
|
190
|
-
await this.waitHandler({ wait: scenarioObject.time })
|
|
191
182
|
this.drawer.isSkip = false
|
|
192
183
|
this.scenarioManager.setHistory(scenarioObject.content)
|
|
193
184
|
}
|
|
194
185
|
|
|
195
186
|
expandVariable(text) {
|
|
196
187
|
outputLog('call', 'debug', text)
|
|
197
|
-
if (typeof text !== 'string') return text
|
|
198
188
|
return text.replace(/{{([^{}]+)}}/g, (match) => {
|
|
199
189
|
const expr = match.slice(2, -2)
|
|
200
190
|
const returnValue = this.executeCode(`return ${expr}`)
|
|
@@ -202,31 +192,6 @@ export class Core {
|
|
|
202
192
|
})
|
|
203
193
|
}
|
|
204
194
|
|
|
205
|
-
async waitHandler(line) {
|
|
206
|
-
// line.timeがある場合、line.waitに代入する
|
|
207
|
-
if (line.time) line.wait = line.time
|
|
208
|
-
outputLog('call', 'debug', line)
|
|
209
|
-
//prettier-ignore
|
|
210
|
-
this.onNextHandler = () => { this.isNext = true }
|
|
211
|
-
outputLog('wait type', 'debug', typeof line.wait)
|
|
212
|
-
|
|
213
|
-
// line.waitが数値に変換可能な文字列の場合、数値に変換
|
|
214
|
-
if (typeof line.wait === 'string' && !isNaN(Number(line.wait))) {
|
|
215
|
-
line.wait = Number(line.wait)
|
|
216
|
-
}
|
|
217
|
-
if (typeof line.wait === 'number') {
|
|
218
|
-
outputLog('wait number', 'debug', line.wait)
|
|
219
|
-
if (line.wait > 0 || this.isAuto) {
|
|
220
|
-
const waitTime = line.wait || 1500
|
|
221
|
-
// 指定された時間だけ待機
|
|
222
|
-
await sleep(waitTime)
|
|
223
|
-
}
|
|
224
|
-
} else {
|
|
225
|
-
// 改行ごとに入力待ち
|
|
226
|
-
await this.clickWait()
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
195
|
// クリック待ち処理
|
|
231
196
|
async clickWait() {
|
|
232
197
|
outputLog('call', 'debug')
|
|
@@ -247,60 +212,30 @@ export class Core {
|
|
|
247
212
|
outputLog('call', 'debug', line)
|
|
248
213
|
// say(name:string, pattern: string, voice: {playの引数}, ...text)
|
|
249
214
|
if (line.voice) await this.soundHandler({ path: line.voice, play: undefined })
|
|
250
|
-
await this.textHandler({ content: line.content, name: line.name
|
|
215
|
+
await this.textHandler({ content: line.content, name: line.name })
|
|
251
216
|
this.scenarioManager.setHistory(line)
|
|
252
217
|
}
|
|
253
218
|
|
|
254
219
|
async choiceHandler(line) {
|
|
255
220
|
outputLog('call', 'debug', line)
|
|
256
|
-
|
|
257
|
-
if (line.prompt) this.textHandler(line.prompt)
|
|
258
|
-
// ムスタッシュ構文があるときは、変数の展開
|
|
259
|
-
line.content.forEach((choice) => {
|
|
260
|
-
choice.label = this.expandVariable(choice.label)
|
|
261
|
-
})
|
|
221
|
+
if (line.prompt) this.textHandler(line.prompt) // promptがある場合は、表示する
|
|
262
222
|
const { selectId, onSelect: selectHandler } = await this.drawer.drawChoices(line)
|
|
263
223
|
if (selectHandler !== undefined) {
|
|
264
224
|
this.scenarioManager.addScenario(selectHandler)
|
|
265
225
|
}
|
|
266
226
|
this.scenarioManager.setHistory({ line, ...selectId })
|
|
267
|
-
document.querySelector('#interactiveView').style.visibility = 'hidden'
|
|
268
227
|
}
|
|
269
228
|
|
|
270
229
|
jumpHandler(line) {
|
|
271
230
|
outputLog('call:', 'debug', line.index)
|
|
272
|
-
// ジャンプ先が現在の行より小さいときは、今の行とジャンプ先の行の間で、sub=falseの行を抽出して、scenarioManagerに追加する
|
|
273
|
-
if (line.index < this.scenarioManager.getIndex()) {
|
|
274
|
-
// scenarioManagerからシナリオを取得
|
|
275
|
-
const scenario = this.scenarioManager.getScenario()
|
|
276
|
-
// 結合用に、ジャンプ先までのインデックスを取得
|
|
277
|
-
const noEditScenarioList = {
|
|
278
|
-
before: scenario.slice(0, line.index),
|
|
279
|
-
after: scenario.slice(this.scenarioManager.getIndex()),
|
|
280
|
-
}
|
|
281
|
-
outputLog('noEditScenarioList', 'debug', noEditScenarioList)
|
|
282
|
-
// ジャンプ先のインデックスまでのシナリオを取得
|
|
283
|
-
const scenarioList = scenario.slice(line.index, this.scenarioManager.getIndex())
|
|
284
|
-
outputLog('scenarioList', 'debug', scenarioList)
|
|
285
|
-
// sub=falseの行だけを取得
|
|
286
|
-
const subFalseScenario = scenarioList.filter((line) => !line.sub)
|
|
287
|
-
outputLog('subFalseScenario', 'debug', subFalseScenario)
|
|
288
|
-
// scenarioManagerに追加
|
|
289
|
-
this.scenarioManager.setScenario([...noEditScenarioList.before, ...subFalseScenario, ...noEditScenarioList.after])
|
|
290
|
-
outputLog('scenarioManager', 'debug', this.scenarioManager.getScenario())
|
|
291
|
-
}
|
|
292
231
|
this.newpageHandler()
|
|
293
232
|
this.scenarioManager.setIndex(Number(line.index))
|
|
294
233
|
}
|
|
295
234
|
|
|
296
235
|
async showHandler(line) {
|
|
297
236
|
outputLog('line', 'debug', line)
|
|
298
|
-
// ムスタッシュ構文があるときは、変数の展開
|
|
299
|
-
Object.keys(line).forEach((item) => {
|
|
300
|
-
line[item] = this.expandVariable(line[item])
|
|
301
|
-
})
|
|
302
237
|
// 表示する画像の情報を管理オブジェクトに追加
|
|
303
|
-
const modeList = { bg: 'background', cutin: '', chara: '', cg: 'background', effect: 'effect' }
|
|
238
|
+
const modeList = { 'bg': 'background', 'cutin': '', 'chara': '', 'cg': 'background', 'effect': 'effect' }
|
|
304
239
|
const key = Object.keys(modeList).includes(line.mode) ? modeList[line.mode] : line.name || line.src.split('/').pop()
|
|
305
240
|
const baseLine = engineConfig.resolution.height / 2
|
|
306
241
|
const centerPoint = {
|
|
@@ -308,7 +243,6 @@ export class Core {
|
|
|
308
243
|
center: { x: engineConfig.resolution.width * 0.5, y: baseLine },
|
|
309
244
|
right: { x: engineConfig.resolution.width * 0.75, y: baseLine },
|
|
310
245
|
}
|
|
311
|
-
line.src = this.expandVariable(line.src) || line.name
|
|
312
246
|
|
|
313
247
|
const image = await this.getImageObject(line)
|
|
314
248
|
// 画像の表示位置を設定
|
|
@@ -330,9 +264,9 @@ export class Core {
|
|
|
330
264
|
if (line.pos) {
|
|
331
265
|
const pos = line.pos.split(':')
|
|
332
266
|
const baseLines = {
|
|
333
|
-
top: 0
|
|
267
|
+
top: 0,
|
|
334
268
|
middle: engineConfig.resolution.height / 2,
|
|
335
|
-
bottom: engineConfig.resolution.height
|
|
269
|
+
bottom: engineConfig.resolution.height,
|
|
336
270
|
}
|
|
337
271
|
// エイリアスが設定されている場合、画像の中心点を求めて、画像の表示位置を設定する
|
|
338
272
|
position.x = centerPoint[pos[0]].x - size.width / 2
|
|
@@ -351,47 +285,24 @@ export class Core {
|
|
|
351
285
|
look: line.look,
|
|
352
286
|
entry: line.entry,
|
|
353
287
|
}
|
|
354
|
-
|
|
355
288
|
outputLog('displayedImages', 'debug', this.displayedImages[key])
|
|
356
289
|
if (line.sepia) this.displayedImages[key].image.setSepia(line.sepia)
|
|
357
290
|
if (line.mono) this.displayedImages[key].image.setMonochrome(line.mono)
|
|
358
291
|
if (line.blur) this.displayedImages[key].image.setBlur(line.blur)
|
|
359
292
|
if (line.opacity) this.displayedImages[key].image.setOpacity(line.opacity)
|
|
360
|
-
|
|
361
|
-
if (line.transition === 'fade') {
|
|
362
|
-
// フェードイン効果で表示
|
|
363
|
-
await this.drawer.fadeIn(line.duration || 2000, await this.getImageObject(line), {
|
|
364
|
-
pos: position,
|
|
365
|
-
size,
|
|
366
|
-
look: line.look,
|
|
367
|
-
entry: line.entry,
|
|
368
|
-
})
|
|
369
|
-
this.drawer.show(this.displayedImages)
|
|
370
|
-
} else {
|
|
371
|
-
// 通常の表示処理
|
|
372
|
-
this.drawer.show(this.displayedImages)
|
|
373
|
-
}
|
|
293
|
+
this.drawer.show(this.displayedImages)
|
|
374
294
|
outputLog('this.displayedImages', 'debug', this.displayedImages)
|
|
375
295
|
}
|
|
376
296
|
|
|
377
|
-
|
|
297
|
+
hideHandler(line) {
|
|
378
298
|
outputLog('call', 'debug', line)
|
|
379
|
-
|
|
380
|
-
if (line.mode === 'cg') {
|
|
299
|
+
if(line.mode === 'cg') {
|
|
381
300
|
this.displayedImages = { ...this.tempImages }
|
|
382
301
|
this.tempImages = {}
|
|
383
302
|
} else {
|
|
384
303
|
delete this.displayedImages[line.name]
|
|
385
304
|
}
|
|
386
305
|
this.drawer.show(this.displayedImages)
|
|
387
|
-
if (line.transition === 'fade') {
|
|
388
|
-
// フェードアウト効果で非表示
|
|
389
|
-
await this.drawer.fadeOut(line.duration || 1000, targetImage.image, {
|
|
390
|
-
pos: targetImage.pos,
|
|
391
|
-
size: targetImage.size,
|
|
392
|
-
look: targetImage.look,
|
|
393
|
-
})
|
|
394
|
-
}
|
|
395
306
|
}
|
|
396
307
|
|
|
397
308
|
async moveToHandler(line) {
|
|
@@ -403,15 +314,13 @@ export class Core {
|
|
|
403
314
|
|
|
404
315
|
async getImageObject(line) {
|
|
405
316
|
outputLog('call', 'debug', line)
|
|
406
|
-
const name = line.name || line.src.split('/').pop()
|
|
407
317
|
let image
|
|
408
318
|
// 既にインスタンスがある場合は、それを使う
|
|
409
|
-
if (
|
|
410
|
-
const targetImage = this.displayedImages[name]
|
|
319
|
+
if (line.name) {
|
|
320
|
+
const targetImage = this.displayedImages[line.name]
|
|
411
321
|
const imageObject = targetImage ? targetImage.image : new ImageObject()
|
|
412
322
|
image = await imageObject.setImageAsync(line.src)
|
|
413
323
|
} else {
|
|
414
|
-
outputLog('new ImageObject', 'debug')
|
|
415
324
|
image = await new ImageObject().setImageAsync(line.src)
|
|
416
325
|
}
|
|
417
326
|
return image
|
|
@@ -420,24 +329,24 @@ export class Core {
|
|
|
420
329
|
async soundHandler(line) {
|
|
421
330
|
outputLog('call', 'debug', line)
|
|
422
331
|
let soundObject = null
|
|
423
|
-
if
|
|
332
|
+
if(line.mode === 'bgm') {
|
|
424
333
|
if (this.bgm.isPlaying) {
|
|
425
334
|
this.bgm.stop()
|
|
426
335
|
}
|
|
427
336
|
soundObject = await this.getSoundObject(line)
|
|
428
337
|
this.bgm = soundObject
|
|
429
338
|
} else {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
339
|
+
// soundObjectを作成
|
|
340
|
+
soundObject = await this.getSoundObject(line)
|
|
341
|
+
// playプロパティが存在する場合は、再生する
|
|
342
|
+
}
|
|
343
|
+
if ('play' in line) {
|
|
344
|
+
'loop' in line ? soundObject.play(true) : soundObject.play()
|
|
345
|
+
} else if ('stop' in line) {
|
|
346
|
+
soundObject.stop()
|
|
347
|
+
} else if ('pause' in line) {
|
|
348
|
+
soundObject.pause()
|
|
349
|
+
}
|
|
441
350
|
// soundObjectを管理オブジェクトに追加
|
|
442
351
|
const key = line.name || line.src.split('/').pop()
|
|
443
352
|
this.usedSounds[key] = {
|
|
@@ -447,10 +356,9 @@ export class Core {
|
|
|
447
356
|
|
|
448
357
|
async getSoundObject(line) {
|
|
449
358
|
outputLog('call', 'debug', line)
|
|
450
|
-
const name = line.name || line.src.split('/').pop()
|
|
451
359
|
let resource
|
|
452
|
-
if (
|
|
453
|
-
const targetResource = this.usedSounds[name]
|
|
360
|
+
if (line.name) {
|
|
361
|
+
const targetResource = this.usedSounds[line.name]
|
|
454
362
|
const soundObject = targetResource ? targetResource.audio : new SoundObject()
|
|
455
363
|
resource = await soundObject.setAudioAsync(line.src)
|
|
456
364
|
} else {
|
|
@@ -478,9 +386,13 @@ export class Core {
|
|
|
478
386
|
outputLog('call', 'debug', line)
|
|
479
387
|
const isTrue = this.executeCode(`return ${line.condition}`)
|
|
480
388
|
outputLog(`${isTrue}`, 'debug')
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
389
|
+
if (isTrue) {
|
|
390
|
+
outputLog('', 'debug', line.content[0].content)
|
|
391
|
+
this.scenarioManager.addScenario(line.content[0].content)
|
|
392
|
+
} else {
|
|
393
|
+
outputLog('', 'debug', line.content[1].content)
|
|
394
|
+
this.scenarioManager.addScenario(line.content[1].content)
|
|
395
|
+
}
|
|
484
396
|
}
|
|
485
397
|
|
|
486
398
|
async routeHandler(line) {
|
|
@@ -490,22 +402,18 @@ export class Core {
|
|
|
490
402
|
this.bgm = null
|
|
491
403
|
}
|
|
492
404
|
this.newpageHandler()
|
|
493
|
-
if (this.sceneFile.cleanUp) {
|
|
494
|
-
// 終了処理を実行する
|
|
495
|
-
this.sceneFile.cleanUp()
|
|
496
|
-
}
|
|
497
405
|
// sceneファイルを読み込む
|
|
498
406
|
await this.loadScene(line.to)
|
|
499
407
|
// 画面を表示する
|
|
500
408
|
await this.loadScreen(this.sceneConfig)
|
|
501
|
-
|
|
502
|
-
|
|
409
|
+
// BGMを再生する
|
|
410
|
+
this.bgm.play(true)
|
|
503
411
|
}
|
|
504
412
|
|
|
505
413
|
// Sceneファイルに、ビルド時に実行処理を追加して、そこに処理をお願いしたほうがいいかも?
|
|
506
414
|
callHandler(line) {
|
|
507
415
|
outputLog('call', 'debug', line)
|
|
508
|
-
this.executeCode(line.
|
|
416
|
+
this.executeCode(line.func)
|
|
509
417
|
}
|
|
510
418
|
|
|
511
419
|
async httpHandler(line) {
|
|
@@ -570,16 +478,22 @@ export class Core {
|
|
|
570
478
|
return line
|
|
571
479
|
}
|
|
572
480
|
|
|
481
|
+
async waitHandler(line) {
|
|
482
|
+
outputLog('call', 'debug', line)
|
|
483
|
+
if (line.time) {
|
|
484
|
+
await sleep(line.time)
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
573
488
|
setBackground(image) {
|
|
574
|
-
this.displayedImages[
|
|
489
|
+
this.displayedImages["background"] = image
|
|
575
490
|
}
|
|
576
491
|
|
|
577
492
|
getBackground() {
|
|
578
|
-
return this.displayedImages[
|
|
493
|
+
return this.displayedImages["background"].image
|
|
579
494
|
}
|
|
580
495
|
|
|
581
496
|
executeCode(code) {
|
|
582
|
-
outputLog('call', 'debug', code)
|
|
583
497
|
try {
|
|
584
498
|
const context = { ...this.sceneFile }
|
|
585
499
|
const func = new Function(...Object.keys(context), code)
|
|
@@ -588,74 +502,4 @@ export class Core {
|
|
|
588
502
|
console.error('Error executing code:', error)
|
|
589
503
|
}
|
|
590
504
|
}
|
|
591
|
-
|
|
592
|
-
// Scriptから安全にアクセスできるメソッドを定義
|
|
593
|
-
getAPIForScript() {
|
|
594
|
-
return {
|
|
595
|
-
drawer: {
|
|
596
|
-
drawName: this.drawer.drawName.bind(this.drawer),
|
|
597
|
-
drawText: this.drawer.drawText.bind(this.drawer),
|
|
598
|
-
drawChoices: this.drawer.drawChoices.bind(this.drawer),
|
|
599
|
-
clearText: this.drawer.clearText.bind(this.drawer),
|
|
600
|
-
show: this.drawer.show.bind(this.drawer),
|
|
601
|
-
moveTo: this.drawer.moveTo.bind(this.drawer),
|
|
602
|
-
fadeIn: this.drawer.fadeIn.bind(this.drawer),
|
|
603
|
-
fadeOut: this.drawer.fadeOut.bind(this.drawer),
|
|
604
|
-
},
|
|
605
|
-
sound: {
|
|
606
|
-
play: this.soundHandler.bind(this),
|
|
607
|
-
stop: (name) => this.soundHandler({ name, stop: true }),
|
|
608
|
-
pause: (name) => this.soundHandler({ name, pause: true }),
|
|
609
|
-
},
|
|
610
|
-
scenario: {
|
|
611
|
-
jump: this.jumpHandler.bind(this),
|
|
612
|
-
addScene: this.scenarioManager.addScenario.bind(this.scenarioManager),
|
|
613
|
-
getProgress: () => this.scenarioManager.progress,
|
|
614
|
-
setProgress: (progress) => (this.scenarioManager.progress = progress),
|
|
615
|
-
getIndex: () => this.scenarioManager.getIndex(),
|
|
616
|
-
setIndex: (index) => this.scenarioManager.setIndex(index),
|
|
617
|
-
hasNext: () => this.scenarioManager.hasNext(),
|
|
618
|
-
next: () => this.scenarioManager.next(),
|
|
619
|
-
getHistory: () => this.scenarioManager.getHistory(),
|
|
620
|
-
setHistory: (history) => this.scenarioManager.setHistory(history),
|
|
621
|
-
setScenario: (scenario) => this.scenarioManager.setScenario(scenario),
|
|
622
|
-
getScenario: () => this.scenarioManager.getScenario(),
|
|
623
|
-
getSceneName: () => this.scenarioManager.progress.currentScene,
|
|
624
|
-
setScreenName: (name) => (this.sceneConfig.name = name),
|
|
625
|
-
},
|
|
626
|
-
images: {
|
|
627
|
-
get: this.getImageObject.bind(this),
|
|
628
|
-
getAll: () => this.displayedImages,
|
|
629
|
-
set: (name, image) => (this.displayedImages[name] = image),
|
|
630
|
-
delete: (name) => delete this.displayedImages[name],
|
|
631
|
-
},
|
|
632
|
-
sounds: {
|
|
633
|
-
get: (name) => this.usedSounds[name],
|
|
634
|
-
getAll: () => this.usedSounds,
|
|
635
|
-
set: (name, sound) => (this.usedSounds[name] = sound),
|
|
636
|
-
delete: (name) => delete this.usedSounds[name],
|
|
637
|
-
load: this.getSoundObject.bind(this),
|
|
638
|
-
},
|
|
639
|
-
background: {
|
|
640
|
-
set: this.setBackground.bind(this),
|
|
641
|
-
get: this.getBackground.bind(this),
|
|
642
|
-
},
|
|
643
|
-
wait: this.waitHandler.bind(this),
|
|
644
|
-
clickWait: this.clickWait.bind(this),
|
|
645
|
-
core: {
|
|
646
|
-
text: this.textHandler.bind(this),
|
|
647
|
-
choice: this.choiceHandler.bind(this),
|
|
648
|
-
show: this.showHandler.bind(this),
|
|
649
|
-
newpage: this.newpageHandler.bind(this),
|
|
650
|
-
hide: this.hideHandler.bind(this),
|
|
651
|
-
jump: this.jumpHandler.bind(this),
|
|
652
|
-
sound: this.soundHandler.bind(this),
|
|
653
|
-
say: this.sayHandler.bind(this),
|
|
654
|
-
if: this.ifHandler.bind(this),
|
|
655
|
-
moveto: this.moveToHandler.bind(this),
|
|
656
|
-
route: this.routeHandler.bind(this),
|
|
657
|
-
wait: this.waitHandler.bind(this),
|
|
658
|
-
},
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
505
|
}
|