Compare commits

..

No commits in common. "master" and "v1.2.0" have entirely different histories.

22 changed files with 7290 additions and 9939 deletions

View File

@ -1 +0,0 @@
Js/Pixi.min.js

View File

@ -1,29 +0,0 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly",
"PIXI": "readonly",
"UtageInfo": "readonly",
"TextFunctions": "readonly",
"Player": "readonly",
"Shaders": "readonly",
"baseDimensions": "readonly",
"commonFunctions": "readonly",
"audioController": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"no-console": "off",
"no-unused-vars": [2, { "vars": "local", "argsIgnorePattern": "^(success|event|resource|delta|reject)$"}],
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-mixed-spaces-and-tabs": "off"
}
}

3
.gitignore vendored
View File

@ -3,8 +3,6 @@
web.config web.config
/Js/Typed /Js/Typed
/Js/[Pp]ixi.js /Js/[Pp]ixi.js
/Js/[Pp]ixi.js.map
/Js/[Pp]ixi.min.js.map
/node_modules /node_modules
/Js/XduPlayer.js /Js/XduPlayer.js
/Js/XduPlayer.min.js.map /Js/XduPlayer.min.js.map
@ -12,4 +10,3 @@ web.config
/Dist /Dist
/Css/main.min.css /Css/main.min.css
/Js/XduPlayer.min.js /Js/XduPlayer.min.js
/**/.*.swp

6
.gitmodules vendored
View File

@ -1,8 +1,4 @@
[submodule "Js/Translations"] [submodule "Js/Translations"]
path = Js/Translations path = Js/Translations
url = https://git.poweris.moe/yttt-xdu/xdutranslations.git url = https://git.poweris.moe/xdutranslations.git
branch = master
[submodule "CustomData"]
path = CustomData
url = https://git.poweris.moe/yttt-xdu/customdata.git
branch = . branch = .

View File

@ -15,36 +15,3 @@ DPI is now taken into account when resizing.
Added credits to mission modal. Added credits to mission modal.
Added ability to go fullscreen. Added ability to go fullscreen.
Missions JSON moved to translations submodule so missions can be added/enabled without disturbing main project. Missions JSON moved to translations submodule so missions can be added/enabled without disturbing main project.
## V1.2.1 (2018-12-29)
Custom asset support
Russian language support
Fix translation fallback
## V1.2.2 (2019-01-20)
Add language url parameter
Fix noise\_disappearance commands
## V1.3.0 (2019-05-13)
Macro support
DivaMovie
Changed metadata to include quests
Per-language quest enabling
Sort scenes into quests to reduce clutter
Preserve ColorTo tinting properly
urlparam: questSceneMstId
## V1.3.1 (2019-06-09)
Fix MoveCamera macro
## V1.4.0 (2019-09-29)
Updated Pixi.js to v5
## V1.5.0 (2020-07-31)
XDU Global support

2
Css/generic.min.css vendored
View File

@ -1 +1 @@
html{font-size:16px;font-family:arial;background-color:#393939;color:rgba(255,255,255,.7)}html body{border-color:rgba(255,255,255,.2)}html body a{color:#0096cf}html body a:not([href]){text-decoration:underline;cursor:pointer}html body .hover-span{color:#0096cf}.fade-in{opacity:0;transition:opacity .5s}.centered{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center} html{font-size:16px;font-family:arial;background-color:#393939;color:rgba(255,255,255,.7)}html body{border-color:rgba(255,255,255,.2)}html body a{color:#0096cf}html body a:not([href]){text-decoration:underline;cursor:pointer}html body .hover-span{color:#0096cf}.fade-in{opacity:0;transition:opacity .5s}

View File

@ -35,20 +35,10 @@
} }
@font-face { @font-face {
font-family: Orbitron-Medium; font-family: SourceCodePro-Regular;
src: url(../Fonts/Orbitron Medium.woff2) format('woff'); src: url(../Fonts/SourceCodePro-Regular.woff2) format('woff');
} }
@font-face {
font-family: PTSans;
src: url(../Fonts/PTSans.woff2) format('woff');
}
/*@font-face {
font-family: SourceSansVariable-Roman;
src: url(../Fonts/SourceSansVariable-Roman.woff2) format('woff');
}*/
@-webkit-keyframes smallbounce { @-webkit-keyframes smallbounce {
from { transform: translate(0, 5px); } from { transform: translate(0, 5px); }
to { transform: translate(0, -5px); } to { transform: translate(0, -5px); }
@ -62,30 +52,22 @@
to { transform: translate(0, -5px); } to { transform: translate(0, -5px); }
} }
html { height: 100%; } body { margin: 0; }
body { margin: 0; height: 100%; }
.flex-grow { flex-grow: 1; } .flex-grow { flex-grow: 1; }
.centered { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.hidden { opacity: 0; } .hidden { opacity: 0; }
.shown { opacity: 0; } .shown { opacity: 0; }
#app-container { position: relative; width: 1334px; height: 750px; display: flex; justify-content: center; align-items: center; } #app-container { position: relative; width: 1334px; height: 750px; display: flex; justify-content: center; align-items: center; }
#parent-container { height: 100%; display: flex; flex-direction: column; align-items: center; } #parent-container { display: flex; flex-direction: column; align-items: center; }
#text-container { color: white; position: absolute; margin: auto; height: 750px; width: 1334px; font-family: 'FOT-RodinNTLGPro'; } #text-container { color: white; position: absolute; margin: auto; height: 750px; width: 1334px; font-family: 'FOT-RodinNTLGPro'; }
#text-container.eng { font-family: 'FOT-RodinNTLGPro'; }
#text-container.jpn { font-family: 'FOT-RodinNTLGPro'; }
#text-container.rus { font-family: 'PTSans'; }
#text-container.cze { font-family: 'PTSans'; }
#text-container #fullscreen-button { position: absolute; top: 0.5rem; left: 0.5rem; font-size: 30px; line-height: 30px; opacity: 0.35; z-index: 11; } #text-container #fullscreen-button { position: absolute; top: 0.5rem; left: 0.5rem; font-size: 30px; line-height: 30px; opacity: 0.35; z-index: 11; }
#text-container #title { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 20px; transition: opacity 0.3s; cursor: default; user-select: none; } #text-container #title { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 20px; transition: opacity 0.3s; cursor: default; user-select: none; }
@ -122,13 +104,11 @@ body { margin: 0; height: 100%; }
#dialog-scroll img { height: 35px; } #dialog-scroll img { height: 35px; }
#title-container { padding: 2px 0; } #title-container { margin-bottom: 2px; }
#other-controls-container { padding-bottom: 4px; display: flex; width: 100%; justify-content: center; align-items: center; z-index: 10; } #other-controls-container { display: flex; width: 550px; justify-content: center; align-items: center; z-index: 10; }
#select-quest { min-width: 0; width: 25% } #select-mission { min-width: 0; }
#select-scene { min-width: 0; width: 25% }
#select-language { margin-left: 10px; } #select-language { margin-left: 10px; }
@ -158,12 +138,6 @@ body { margin: 0; height: 100%; }
#modal-buttons { bottom: 0; margin-top: auto; width: 100%; display: flex; justify-content: space-between; min-height: 21px; } #modal-buttons { bottom: 0; margin-top: auto; width: 100%; display: flex; justify-content: space-between; min-height: 21px; }
#mission-modal .follow-links { margin-top: auto; display: flex; flex-direction: column; text-align: center; width:100%; }
#mission-modal .follow-links .follow-links-header { font-weight: bold; }
#mission-modal .follow-links .follow-links-links { display: flex; flex-direction: row; justify-content: space-around; margin-top: 5px; }
@media screen and (max-width: 812px) { @media screen and (max-width: 812px) {
#modal-container { top: 0; bottom: 0; left: 0; right: 0; transform: none; } #modal-container { top: 0; bottom: 0; left: 0; right: 0; transform: none; }
.modal { width: 100%; height: 100%; border-radius: 0; } .modal { width: 100%; height: 100%; border-radius: 0; }

@ -1 +0,0 @@
Subproject commit e92af8f0d0c0d4246e44dd0b63508f9e460fe3a8

View File

@ -1,4 +1,5 @@
//(Math.exp(x)-1)/(Math.E-1) //(Math.exp(x)-1)/(Math.E-1)
//🔊
class bufferLoader { class bufferLoader {
constructor(context, soundMap, callback) { constructor(context, soundMap, callback) {

899
Js/BgmLoop.json Normal file
View File

@ -0,0 +1,899 @@
{
"bgm_adv_battle_01": {
"duration": 93.01484375,
"loop_end": {
"samples_48k": 4464640,
"samples_native": 2976427,
"seconds": 93.01334375
},
"loop_start": {
"samples_48k": 543504,
"samples_native": 362336,
"seconds": 11.323
}
},
"bgm_adv_comical_01": {
"duration": 57.7235625,
"loop_end": {
"samples_48k": 2770663,
"samples_native": 1847109,
"seconds": 57.72215625
},
"loop_start": {
"samples_48k": 250656,
"samples_native": 167104,
"seconds": 5.222
}
},
"bgm_adv_emergency_01": {
"duration": 98.295,
"loop_end": {
"samples_48k": 4718094,
"samples_native": 3145396,
"seconds": 98.293625
},
"loop_start": {
"samples_48k": 1304784,
"samples_native": 869856,
"seconds": 27.183
}
},
"bgm_adv_everyday_01": {
"duration": 75.8483125,
"loop_end": {
"samples_48k": 3640636,
"samples_native": 2427091,
"seconds": 75.84659375
},
"loop_start": {
"samples_48k": 349200,
"samples_native": 232800,
"seconds": 7.275
}
},
"bgm_adv_everyday_02": {
"duration": 70.43615625,
"loop_end": {
"samples_48k": 3380871,
"samples_native": 2253914,
"seconds": 70.4348125
},
"loop_start": {
"samples_48k": 588144,
"samples_native": 392096,
"seconds": 12.253
}
},
"bgm_adv_everyday_03": {
"duration": 78.99671875,
"loop_end": {
"samples_48k": 3791752,
"samples_native": 2527835,
"seconds": 78.99484375
},
"loop_start": {
"samples_48k": 436416,
"samples_native": 290944,
"seconds": 9.092
}
},
"bgm_adv_highlight_01": {
"duration": 97.1335,
"loop_end": {
"samples_48k": 4662328,
"samples_native": 3108219,
"seconds": 97.13184375
},
"loop_start": {
"samples_48k": 473232,
"samples_native": 315488,
"seconds": 9.859
}
},
"bgm_adv_highlight_02": {
"duration": 76.46521875,
"loop_end": {
"samples_48k": 3670234,
"samples_native": 2446823,
"seconds": 76.46321875
},
"loop_start": {
"samples_48k": 648768,
"samples_native": 432512,
"seconds": 13.516
}
},
"bgm_adv_highlight_03": {
"duration": 109.82465625,
"loop_end": {
"samples_48k": 5271502,
"samples_native": 3514335,
"seconds": 109.82296875
},
"loop_start": {
"samples_48k": 1476672,
"samples_native": 984448,
"seconds": 30.764
}
},
"bgm_adv_peace_01": {
"duration": 83.74309375,
"loop_end": {
"samples_48k": 4019584,
"samples_native": 2679723,
"seconds": 83.74134375
},
"loop_start": {
"samples_48k": 541344,
"samples_native": 360896,
"seconds": 11.278
}
},
"bgm_adv_sorrow_01": {
"duration": 75.9431875,
"loop_end": {
"samples_48k": 3645204,
"samples_native": 2430136,
"seconds": 75.94175
},
"loop_start": {
"samples_48k": 975936,
"samples_native": 650624,
"seconds": 20.332
}
},
"bgm_adv_tension_01": {
"duration": 66.506,
"loop_end": {
"samples_48k": 3192193,
"samples_native": 2128129,
"seconds": 66.50403125
},
"loop_start": {
"samples_48k": 411504,
"samples_native": 274336,
"seconds": 8.573
}
},
"bgm_home_01": {
"duration": 76.73034375,
"loop_end": {
"samples_48k": 3682962,
"samples_native": 2455308,
"seconds": 76.728375
},
"loop_start": {
"samples_48k": 850176,
"samples_native": 566784,
"seconds": 17.712
}
},
"bgm_raid_01": {
"duration": 111.7009375,
"loop_end": {
"samples_48k": 5361571,
"samples_native": 3574381,
"seconds": 111.69940625
},
"loop_start": {
"samples_48k": 1110144,
"samples_native": 740096,
"seconds": 23.128
}
},
"jingle_gacha": {
"duration": 15.652,
"loop_end": {
"samples_48k": 751200,
"samples_native": 500800,
"seconds": 15.65
},
"loop_start": {
"samples_48k": 290400,
"samples_native": 193600,
"seconds": 6.05
}
},
"musicBase": {
"duration": 86.40134375,
"loop_end": {
"samples_48k": 4147201,
"samples_native": 2764801,
"seconds": 86.40003125
},
"loop_start": {
"samples_48k": 0,
"samples_native": 0,
"seconds": 0.0
}
},
"music_apple": {
"duration": 86.01065625,
"loop_end": {
"samples_48k": 4128439,
"samples_native": 2752293,
"seconds": 86.00915625
},
"loop_start": {
"samples_48k": 0,
"samples_native": 0,
"seconds": 0.0
}
},
"music_asu_no_gaika": {
"duration": 89.30321875,
"loop_end": {
"samples_48k": 4286482,
"samples_native": 2857655,
"seconds": 89.30171875
},
"loop_start": {
"samples_48k": 961632,
"samples_native": 641088,
"seconds": 20.034
}
},
"music_beyond_the_blade": {
"duration": 107.07978125,
"loop_end": {
"samples_48k": 5139739,
"samples_native": 3426493,
"seconds": 107.07790625
},
"loop_start": {
"samples_48k": 1172256,
"samples_native": 781504,
"seconds": 24.422
}
},
"music_bye_bye_lullaby": {
"duration": 77.39109375,
"loop_end": {
"samples_48k": 3714693,
"samples_native": 2476462,
"seconds": 77.3894375
},
"loop_start": {
"samples_48k": 892320,
"samples_native": 594880,
"seconds": 18.59
}
},
"music_dangerous_sunshine": {
"duration": 99.20853125,
"loop_end": {
"samples_48k": 4761918,
"samples_native": 3174612,
"seconds": 99.206625
},
"loop_start": {
"samples_48k": 1238112,
"samples_native": 825408,
"seconds": 25.794
}
},
"music_dareka_no_tame_no_hikari": {
"duration": 108.5063125,
"loop_end": {
"samples_48k": 5208220,
"samples_native": 3472147,
"seconds": 108.50459375
},
"loop_start": {
"samples_48k": 2697264,
"samples_native": 1798176,
"seconds": 56.193
}
},
"music_edge_works_of_goddess_zababa": {
"duration": 91.3029375,
"loop_end": {
"samples_48k": 4382446,
"samples_native": 2921631,
"seconds": 91.30096875
},
"loop_start": {
"samples_48k": 1080480,
"samples_native": 720320,
"seconds": 22.51
}
},
"music_eiai_promise": {
"duration": 123.58634375,
"loop_end": {
"samples_48k": 5932080,
"samples_native": 3954720,
"seconds": 123.585
},
"loop_start": {
"samples_48k": 1861680,
"samples_native": 1241120,
"seconds": 38.785
}
},
"music_first_love_song": {
"duration": 104.9476875,
"loop_end": {
"samples_48k": 5037417,
"samples_native": 3358278,
"seconds": 104.9461875
},
"loop_start": {
"samples_48k": 585072,
"samples_native": 390048,
"seconds": 12.189
}
},
"music_fushichou_no_flamme": {
"duration": 129.0045,
"loop_end": {
"samples_48k": 6192121,
"samples_native": 4128081,
"seconds": 129.00253125
},
"loop_start": {
"samples_48k": 2669376,
"samples_native": 1779584,
"seconds": 55.612
}
},
"music_gekisou_gungnir": {
"duration": 100.545375,
"loop_end": {
"samples_48k": 4826109,
"samples_native": 3217406,
"seconds": 100.5439375
},
"loop_start": {
"samples_48k": 1120224,
"samples_native": 746816,
"seconds": 23.338
}
},
"music_gekisyou_infinity": {
"duration": 152.32209375,
"loop_end": {
"samples_48k": 7311394,
"samples_native": 4874263,
"seconds": 152.32071875
},
"loop_start": {
"samples_48k": 3361680,
"samples_native": 2241120,
"seconds": 70.035
}
},
"music_gekkabijin": {
"duration": 99.34246875,
"loop_end": {
"samples_48k": 4768356,
"samples_native": 3178904,
"seconds": 99.34075
},
"loop_start": {
"samples_48k": 1268592,
"samples_native": 845728,
"seconds": 26.429
}
},
"music_gekkou_no_tsurugi": {
"duration": 86.184875,
"loop_end": {
"samples_48k": 4136785,
"samples_native": 2757857,
"seconds": 86.18303125
},
"loop_start": {
"samples_48k": 833472,
"samples_native": 555648,
"seconds": 17.364
}
},
"music_genkaitoppa_g_beat": {
"duration": 121.08309375,
"loop_end": {
"samples_48k": 5811907,
"samples_native": 3874605,
"seconds": 121.08140625
},
"loop_start": {
"samples_48k": 1906128,
"samples_native": 1270752,
"seconds": 39.711
}
},
"music_genocide_saw": {
"duration": 95.9691875,
"loop_end": {
"samples_48k": 4606449,
"samples_native": 3070966,
"seconds": 95.9676875
},
"loop_start": {
"samples_48k": 1209408,
"samples_native": 806272,
"seconds": 25.196
}
},
"music_ginwan_airget_lamh": {
"duration": 99.313,
"loop_end": {
"samples_48k": 4766931,
"samples_native": 3177954,
"seconds": 99.3110625
},
"loop_start": {
"samples_48k": 1055424,
"samples_native": 703616,
"seconds": 21.988
}
},
"music_gohoushi_maidmode": {
"duration": 95.612125,
"loop_end": {
"samples_48k": 4589314,
"samples_native": 3059543,
"seconds": 95.61071875
},
"loop_start": {
"samples_48k": 1287408,
"samples_native": 858272,
"seconds": 26.821
}
},
"music_gokuren_igalima": {
"duration": 80.25296875,
"loop_end": {
"samples_48k": 3852064,
"samples_native": 2568043,
"seconds": 80.25134375
},
"loop_start": {
"samples_48k": 476784,
"samples_native": 317856,
"seconds": 9.933
}
},
"music_gun_bullet_xxx": {
"duration": 83.22640625,
"loop_end": {
"samples_48k": 3994797,
"samples_native": 2663198,
"seconds": 83.2249375
},
"loop_start": {
"samples_48k": 117312,
"samples_native": 78208,
"seconds": 2.444
}
},
"music_gyakkou_no_flugel": {
"duration": 114.43875,
"loop_end": {
"samples_48k": 5492964,
"samples_native": 3661976,
"seconds": 114.43675
},
"loop_start": {
"samples_48k": 1260816,
"samples_native": 840544,
"seconds": 26.267
}
},
"music_gyakkou_no_resolve": {
"duration": 111.3798125,
"loop_end": {
"samples_48k": 5346163,
"samples_native": 3564109,
"seconds": 111.37840625
},
"loop_start": {
"samples_48k": 1638576,
"samples_native": 1092384,
"seconds": 34.137
}
},
"music_hadakaninatte_natsu": {
"duration": 85.93515625,
"loop_end": {
"samples_48k": 4124794,
"samples_native": 2749863,
"seconds": 85.93321875
},
"loop_start": {
"samples_48k": 654768,
"samples_native": 436512,
"seconds": 13.641
}
},
"music_hajimarino_uta": {
"duration": 167.56865625,
"loop_end": {
"samples_48k": 8043231,
"samples_native": 5362154,
"seconds": 167.5673125
},
"loop_start": {
"samples_48k": 1400592,
"samples_native": 933728,
"seconds": 29.179
}
},
"music_hidamari_memoria": {
"duration": 107.5283125,
"loop_end": {
"samples_48k": 5161266,
"samples_native": 3440844,
"seconds": 107.526375
},
"loop_start": {
"samples_48k": 861504,
"samples_native": 574336,
"seconds": 17.948
}
},
"music_kimitoiu_otokanade_tsukirumade": {
"duration": 95.7555,
"loop_end": {
"samples_48k": 4596183,
"samples_native": 3064122,
"seconds": 95.7538125
},
"loop_start": {
"samples_48k": 845616,
"samples_native": 563744,
"seconds": 17.617
}
},
"music_koi_no_okehazama": {
"duration": 76.1594375,
"loop_end": {
"samples_48k": 3655587,
"samples_native": 2437058,
"seconds": 76.1580625
},
"loop_start": {
"samples_48k": 710064,
"samples_native": 473376,
"seconds": 14.793
}
},
"music_kono_ima_wo_ikite": {
"duration": 161.39909375,
"loop_end": {
"samples_48k": 7747063,
"samples_native": 5164709,
"seconds": 161.39715625
},
"loop_start": {
"samples_48k": 939792,
"samples_native": 626528,
"seconds": 19.579
}
},
"music_kyoushitsu_monochrome": {
"duration": 79.831625,
"loop_end": {
"samples_48k": 3831834,
"samples_native": 2554556,
"seconds": 79.829875
},
"loop_start": {
"samples_48k": 489168,
"samples_native": 326112,
"seconds": 10.191
}
},
"music_makenaiai_ga_kokoniaru": {
"duration": 93.74815625,
"loop_end": {
"samples_48k": 4499835,
"samples_native": 2999890,
"seconds": 93.7465625
},
"loop_start": {
"samples_48k": 1334880,
"samples_native": 889920,
"seconds": 27.81
}
},
"music_makyu_ichiibal": {
"duration": 81.071375,
"loop_end": {
"samples_48k": 3891351,
"samples_native": 2594234,
"seconds": 81.0698125
},
"loop_start": {
"samples_48k": 650016,
"samples_native": 433344,
"seconds": 13.542
}
},
"music_melodious_moonlight": {
"duration": 99.05025,
"loop_end": {
"samples_48k": 4754340,
"samples_native": 3169560,
"seconds": 99.04875
},
"loop_start": {
"samples_48k": 1230576,
"samples_native": 820384,
"seconds": 25.637
}
},
"music_nijiiro_no_flugel": {
"duration": 112.277,
"loop_end": {
"samples_48k": 5389231,
"samples_native": 3592821,
"seconds": 112.27565625
},
"loop_start": {
"samples_48k": 1157088,
"samples_native": 771392,
"seconds": 24.106
}
},
"music_orbital_beat": {
"duration": 74.67153125,
"loop_end": {
"samples_48k": 3584140,
"samples_native": 2389427,
"seconds": 74.66959375
},
"loop_start": {
"samples_48k": 1202976,
"samples_native": 801984,
"seconds": 25.062
}
},
"music_oukyo_sulsagana": {
"duration": 100.1548125,
"loop_end": {
"samples_48k": 4807359,
"samples_native": 3204906,
"seconds": 100.1533125
},
"loop_start": {
"samples_48k": 1065168,
"samples_native": 710112,
"seconds": 22.191
}
},
"music_over_killscythe_hell": {
"duration": 91.43084375,
"loop_end": {
"samples_48k": 4388601,
"samples_native": 2925734,
"seconds": 91.4291875
},
"loop_start": {
"samples_48k": 1212432,
"samples_native": 808288,
"seconds": 25.259
}
},
"music_practice_mode": {
"duration": 108.994625,
"loop_end": {
"samples_48k": 5231652,
"samples_native": 3487768,
"seconds": 108.99275
},
"loop_start": {
"samples_48k": 1314384,
"samples_native": 876256,
"seconds": 27.383
}
},
"music_ressou_gungnir": {
"duration": 141.42465625,
"loop_end": {
"samples_48k": 6788316,
"samples_native": 4525544,
"seconds": 141.42325
},
"loop_start": {
"samples_48k": 3042432,
"samples_native": 2028288,
"seconds": 63.384
}
},
"music_sakura_blizzard": {
"duration": 101.234875,
"loop_end": {
"samples_48k": 4859196,
"samples_native": 3239464,
"seconds": 101.23325
},
"loop_start": {
"samples_48k": 1204704,
"samples_native": 803136,
"seconds": 25.098
}
},
"music_santa_ga_machi_ni_yattekuru": {
"duration": 104.1534375,
"loop_end": {
"samples_48k": 4999269,
"samples_native": 3332846,
"seconds": 104.1514375
},
"loop_start": {
"samples_48k": 662304,
"samples_native": 441536,
"seconds": 13.798
}
},
"music_seigiwoshinjite_nigirishimete": {
"duration": 87.9635625,
"loop_end": {
"samples_48k": 4222179,
"samples_native": 2814786,
"seconds": 87.9620625
},
"loop_start": {
"samples_48k": 382512,
"samples_native": 255008,
"seconds": 7.969
}
},
"music_seiten_galaxy_cross": {
"duration": 126.5226875,
"loop_end": {
"samples_48k": 6073014,
"samples_native": 4048676,
"seconds": 126.521125
},
"loop_start": {
"samples_48k": 1793712,
"samples_native": 1195808,
"seconds": 37.369
}
},
"music_senkin_daurudabura": {
"duration": 110.1046875,
"loop_end": {
"samples_48k": 5284932,
"samples_native": 3523288,
"seconds": 110.10275
},
"loop_start": {
"samples_48k": 1316256,
"samples_native": 877504,
"seconds": 27.422
}
},
"music_senkin_daurudabura_test01": {
"duration": 82.6820625,
"loop_end": {
"samples_48k": 3968674,
"samples_native": 2645783,
"seconds": 82.68071875
},
"loop_start": {
"samples_48k": 0,
"samples_native": 0,
"seconds": 0.0
}
},
"music_senritsu_sorority": {
"duration": 162.176125,
"loop_end": {
"samples_48k": 7784385,
"samples_native": 5189590,
"seconds": 162.1746875
},
"loop_start": {
"samples_48k": 3414720,
"samples_native": 2276480,
"seconds": 71.14
}
},
"music_shinwasekai_karano_kyousyuu": {
"duration": 70.55734375,
"loop_end": {
"samples_48k": 3386688,
"samples_native": 2257792,
"seconds": 70.556
},
"loop_start": {
"samples_48k": 0,
"samples_native": 0,
"seconds": 0.0
}
},
"music_sorae": {
"duration": 128.56625,
"loop_end": {
"samples_48k": 6171114,
"samples_native": 4114076,
"seconds": 128.564875
},
"loop_start": {
"samples_48k": 2426880,
"samples_native": 1617920,
"seconds": 50.56
}
},
"music_stand_up_ready": {
"duration": 111.54221875,
"loop_end": {
"samples_48k": 5353941,
"samples_native": 3569294,
"seconds": 111.5404375
},
"loop_start": {
"samples_48k": 1302960,
"samples_native": 868640,
"seconds": 27.145
}
},
"music_the_moon_is_a_harsh_mistress": {
"duration": 96.8825,
"loop_end": {
"samples_48k": 4650280,
"samples_native": 3100187,
"seconds": 96.88084375
},
"loop_start": {
"samples_48k": 1302096,
"samples_native": 868064,
"seconds": 27.127
}
},
"music_trust_heart": {
"duration": 90.5468125,
"loop_end": {
"samples_48k": 4346170,
"samples_native": 2897447,
"seconds": 90.54521875
},
"loop_start": {
"samples_48k": 1176384,
"samples_native": 784256,
"seconds": 24.508
}
},
"music_waikyou_shenshoujin": {
"duration": 117.59053125,
"loop_end": {
"samples_48k": 5644249,
"samples_native": 3762833,
"seconds": 117.58853125
},
"loop_start": {
"samples_48k": 1612608,
"samples_native": 1075072,
"seconds": 33.596
}
},
"music_watashitoiu_otohibiki_sonosakini": {
"duration": 93.04259375,
"loop_end": {
"samples_48k": 4465980,
"samples_native": 2977320,
"seconds": 93.04125
},
"loop_start": {
"samples_48k": 716208,
"samples_native": 477472,
"seconds": 14.921
}
},
"music_zettou_amenohabakiri": {
"duration": 113.1419375,
"loop_end": {
"samples_48k": 5430724,
"samples_native": 3620483,
"seconds": 113.14009375
},
"loop_start": {
"samples_48k": 1179312,
"samples_native": 786208,
"seconds": 24.569
}
}
}

View File

@ -4,11 +4,6 @@ let rootUrl = `${window.location.protocol}//${window.location.host}/`;
const baseDimensions = {width: 1334, height: 750}; const baseDimensions = {width: 1334, height: 750};
const screenRatio = 9/16; const screenRatio = 9/16;
const CUSTOM = {
custom: 'Custom',
stock: 'Stock'
}
class commonFunctions { class commonFunctions {
static getFileText(file) { static getFileText(file) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -339,6 +334,7 @@ class commonFunctions {
if(props[i] == " ") { break; } if(props[i] == " ") { break; }
retval.color += props[i]; retval.color += props[i];
} }
retval.color = retval.color;
} }
return retval; return retval;
} }

View File

@ -2,7 +2,7 @@
const pixiApp = { const pixiApp = {
app: new PIXI.Application(baseDimensions), app: new PIXI.Application(baseDimensions),
loader: PIXI.Loader.shared loader: PIXI.loader
}; };
const utage = new UtageInfo(); const utage = new UtageInfo();
@ -10,17 +10,16 @@ const shaders = new Shaders();
const textFunc = new TextFunctions(); const textFunc = new TextFunctions();
let audio = undefined; //Cant create a audio context without user input. let audio = undefined; //Cant create a audio context without user input.
const player = new Player(pixiApp, utage, textFunc, audio, shaders); const player = new Player(pixiApp, utage, textFunc, audio, shaders);
const languages = ["eng", "jpn", "rus", "cze", "enm", "kor", "zho"]; const languages = ["eng", "jpn"];
const version = "YameteTomete XDUPlayer V1.5.0"; const version = "YameteTomete XDUPlayer V1.2.0";
let bodyLoaded = false; let bodyLoaded = false;
let utageLoaded = false; let utageLoaded = false;
let languagesLoaded = false; let languagesLoaded = false;
let selectedLang = "eng"; let selectedLang = "eng";
let currentScene = {}; let currentMission = undefined;
let currentSceneId = ""; let currentMissionMst = 0;
let scenePlaylist = []; let currentMissionIndex = 0;
let currentPart = ""; let currentMissionList = [];
let partPlaylist = [];
let urlParams = {}; let urlParams = {};
let screenw = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); let screenw = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
let screenh = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); let screenh = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
@ -28,22 +27,16 @@ let screenSizeTimeout = undefined;
let isMuted = false; let isMuted = false;
let volume = 0.5; let volume = 0.5;
let fullScreen = false; let fullScreen = false;
let prevScene = '{Select}'; let prevMission = '{Select}';
let prevQuest = '{Select}'; const availableMstIds = [202070, 202071, 202013, 338001, 338002, 338003, 338004]//[202070, 202013, 338001, 338002, 338003, 338004, 338005, 338006, 338007, 338009, 338010, 338011];
const emoji = {
LoudSound: String.fromCodePoint(0x1f50a),
Mute: String.fromCodePoint(0x1f507),
HeavyPlusSign: String.fromCodePoint(0x2795)
};
function onBodyLoaded() { function onBodyLoaded() {
bodyLoaded = true; bodyLoaded = true;
document.getElementById("title-tag").innerText = version; document.getElementById("title-tag").innerText = version;
document.addEventListener('webkitfullscreenchange', onFullScreenChange, false); document.addEventListener('webkitfullscreenchange', onFullScreenChange, false);
document.addEventListener('mozfullscreenchange', onFullScreenChange, false); document.addEventListener('mozfullscreenchange', onFullScreenChange, false);
document.addEventListener('fullscreenchange', onFullScreenChange, false); document.addEventListener('fullscreenchange', onFullScreenChange, false);
document.addEventListener('MSFullscreenChange', onFullScreenChange, false); document.addEventListener('MSFullscreenChange', onFullScreenChange, false);
} }
(function startLoad() { (function startLoad() {
@ -62,7 +55,6 @@ function onBodyLoaded() {
(function checkIsLoaded() { (function checkIsLoaded() {
if(bodyLoaded) { if(bodyLoaded) {
document.getElementById('loading-font').style.cssText = "display: none;"; document.getElementById('loading-font').style.cssText = "display: none;";
checkQueryParameters();
loadLocalStorage(); loadLocalStorage();
} }
if(utageLoaded && languagesLoaded) { if(utageLoaded && languagesLoaded) {
@ -78,8 +70,7 @@ function onBodyLoaded() {
function onAllLoaded(success) { function onAllLoaded(success) {
textFunc.findTextElements(); textFunc.findTextElements();
buildQuestSelectList(); buildMissionSelectList();
buildSceneSelectList();
buildLanguageList(); buildLanguageList();
let appContainer = document.getElementById('app-container'); let appContainer = document.getElementById('app-container');
appContainer.appendChild(pixiApp.app.view); appContainer.appendChild(pixiApp.app.view);
@ -105,16 +96,15 @@ function loadLocalStorage() {
audio.mute(isMuted); audio.mute(isMuted);
} }
if(isMuted) { if(isMuted) {
document.getElementById('mute-button').innerText = emoji.Mute; document.getElementById('mute-button').innerText = "🔇";
} else { } else {
document.getElementById('mute-button').innerText = emoji.LoudSound; document.getElementById('mute-button').innerText = "🔊";
} }
//language //language
let lang = urlParams['lang'] || localStorage.getItem('language') || "eng"; let lang = localStorage.getItem('language') || "eng";
if(languages.includes(lang)) { if(languages.includes(lang)) {
selectedLang = lang; selectedLang = lang;
} }
document.getElementById('text-container').className = selectedLang;
utage.setTranslationLanguage(selectedLang, '') utage.setTranslationLanguage(selectedLang, '')
.then((success) => { .then((success) => {
languagesLoaded = true; languagesLoaded = true;
@ -127,79 +117,27 @@ function loadLocalStorage() {
} }
} }
function buildQuestSelectList() { function buildMissionSelectList() {
let questBox = document.getElementById('select-quest'); let selectBox = document.getElementById('select-mission');
questBox.innerHTML = ''; selectBox.innerHTML = '';
for (let i = -1; i < utage.questList.length; ++i) { for(let i = -1; i < utage.missionsList.length; ++i) {
let opt = document.createElement('option')
if (i === -1) {
opt.setAttribute('value', '{Select}');
opt.innerText = 'Select Event';
} else {
let q = utage.questList[i];
let cust = q.IsCustom ? CUSTOM.custom : CUSTOM.stock;
let name = q.Name;
let tl_key = utage.questTranslations[cust][q.QuestMstId];
if (!tl_key) {
console.log("Failed to build quest list: missing translations");
continue;
}
if (!tl_key.Enabled && !utage.quests[cust][q.QuestMstId].Scenes.some((s) => { return utage.sceneTranslations[cust][s].Enabled === true })) {
continue;
}
name = tl_key.Name || name;
opt.setAttribute('value', `${cust}|${q.QuestMstId}`);
opt.innerText = name;
}
questBox.appendChild(opt);
}
}
function buildSceneSelectList() {
let sceneBox = document.getElementById('select-scene');
let questBox = document.getElementById('select-quest');
sceneBox.innerHTML = '';
let opt = document.createElement('option');
opt.setAttribute('value', '{Select}');
opt.innerText = "Select Scene";
if (questBox.value === '{Select}') {
sceneBox.appendChild(opt);
sceneBox.setAttribute("disabled", "true");
return;
} else {
sceneBox.removeAttribute("disabled");
}
let cust = questBox.value.split("|")[0];
let questMstId = questBox.value.split("|")[1];
for (let i = -2; i < utage.quests[cust][questMstId].Scenes.length; ++i) {
let opt = document.createElement('option'); let opt = document.createElement('option');
if (i === -2) { if(i === -1) {
opt.setAttribute('value', '{Select}'); opt.setAttribute('value', '{Select}');
opt.innerText = 'Select Scene'; opt.innerText = 'Select Mission';
} else if (i === -1) {
opt.setAttribute('value', '{All}');
opt.innerText = 'Play All';
} else { } else {
let questSceneMstId = utage.quests[cust][questMstId].Scenes[i]; let m = utage.missionsList[i];
let s = utage.scenes[cust][questSceneMstId]; if(!Object.keys(utage.groupedMissions[m.MstId].Missions).some((mis) => { return utage.groupedMissions[m.MstId].Missions[mis].Enabled === true })) {
opt.setAttribute('value', `${cust}|${questSceneMstId}`);
let name = s.Name;
let tl_key = utage.sceneTranslations[cust][questSceneMstId];
if (!tl_key) {
console.log("Failed to build scene list: missing translations");
continue; continue;
} }
if (!tl_key.Enabled) { opt.setAttribute('value', m.MstId);
continue; let name = m.Name;
if(utage.missionTranslations[m.MstId]) {
name = utage.missionTranslations[m.MstId].Name || name;
} }
name = tl_key.Name || name;
opt.innerText = name; opt.innerText = name;
} }
sceneBox.appendChild(opt); selectBox.appendChild(opt);
} }
} }
@ -217,85 +155,29 @@ function buildLanguageList() {
function checkQueryParameters() { function checkQueryParameters() {
urlParams = commonFunctions.readQueryParameters(); urlParams = commonFunctions.readQueryParameters();
if (languagesLoaded) { if(urlParams['mstid'] && urlParams['id'] && utage.groupedMissions[urlParams['mstid']] && utage.groupedMissions[urlParams['mstid']].Missions[urlParams['id']]) {
let cust; document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;";
if (urlParams['custom'] && urlParams['custom'] === "1") {
cust = CUSTOM.custom;
} else {
cust = CUSTOM.stock;
}
let playable = (urlParams['questscenemstid'] &&
utage.scenes[cust][urlParams['questscenemstid']] &&
utage.sceneTranslations[cust][urlParams['questscenemstid']] &&
utage.sceneTranslations[cust][urlParams['questscenemstid']].Enabled);
if(playable) {
document.getElementById('play-from-query').style.cssText = "position: fixed; z-index: 15; text-align: center; top: 50%; left: 50%; display: block;";
}
} }
} }
function playFromQuery(event) { function playFromQuery(event) {
let cust; missionChanged(urlParams['mstid'], urlParams['id']);
if (urlParams['custom'] && urlParams['custom'] === "1") {
cust = CUSTOM.custom;
} else {
cust = CUSTOM.stock;
}
sceneSet(urlParams['questscenemstid'], cust);
document.getElementById('play-from-query').style.cssText = "display: none;"; document.getElementById('play-from-query').style.cssText = "display: none;";
} }
function questDropDownChanged(event) { function missionDropDownChanged(event) {
if(!event || !event.currentTarget || !event.currentTarget.value) { return; }
buildSceneSelectList();
}
function sceneDropDownChanged(event) {
if(!event || !event.currentTarget || !event.currentTarget.value || event.currentTarget.value === '{Select}') { return; } if(!event || !event.currentTarget || !event.currentTarget.value || event.currentTarget.value === '{Select}') { return; }
if (event.currentTarget.value === '{All}') {
let quest = document.getElementById("select-quest");
let cust = quest.value.split("|")[0];
let questMstId = quest.value.split("|")[1];
let scene = utage.quests[cust][questMstId].Scenes;
resetPlaylist();
for (const s of scene) {
let tl_key = utage.sceneTranslations[cust][s];
if (tl_key) {
if (utage.sceneTranslations[cust][s].Enabled) {
utage.scenes[cust][s]['QuestSceneMstId'] = s;
scenePlaylist.push(utage.scenes[cust][s]);
}
}
}
playNext();
return;
}
let cont = document.getElementById("modal-container"); let cont = document.getElementById("modal-container");
let misId = event.currentTarget.value;
let cust = event.currentTarget.value.split("|")[0]; let mis = utage.groupedMissions[misId];
let questSceneMstId = event.currentTarget.value.split("|")[1]; if(!mis) { console.log(`Mission ${misId} not found`); return; }
let name = mis.Name;
let scene = utage.scenes[cust][questSceneMstId]; let summary = mis.SummaryText;
if(!scene) { console.log(`Scene ${questSceneMstId} not found`); return; }
let name = scene.Name;
let summary = scene.SummaryText;
let image = questSceneMstId;
if ("Image" in scene) {
image = scene.Image;
}
let credits = ""; let credits = "";
let tl_key = utage.sceneTranslations[cust][questSceneMstId]; if(utage.missionTranslations[mis.MstId]) {
name = utage.missionTranslations[mis.MstId].Name || name;
if(tl_key) { summary = utage.missionTranslations[mis.MstId].SummaryText || summary;
name = tl_key.Name || name; credits = utage.missionTranslations[mis.MstId].Credits || credits;
summary = tl_key.SummaryText || summary;
credits = tl_key.Credits || credits;
} }
if(!credits) { if(!credits) {
if(selectedLang === "eng") { if(selectedLang === "eng") {
@ -304,21 +186,19 @@ function sceneDropDownChanged(event) {
credits = "None"; credits = "None";
} }
} }
let chapterSelect = '<div><span>Chapter Select:</span><select id="ChapterSelect">'; let chapterSelect = '<div><span>Chapter Select:</span><select id="ChapterSelect">';
chapterSelect += `<option value="{All}">Play All</option>` for(let k of Object.keys(mis.Missions)) {
for (const p of scene.Parts) { var m = mis.Missions[k];
chapterSelect += `<option value="${p}">${p}</option>` if(m.Enabled) {
chapterSelect += `<option value="${m.Id}">${m.Id}</option>`
}
} }
let detailSrc = `${utage.rootDirectory}${(scene.IsCustom ? "CustomData" : "XDUData")}/Asset/Image/Quest/Snap/Detail/${image}.png`;
let iconSrc = `${utage.rootDirectory}${(scene.IsCustom ? "CustomData" : "XDUData")}/Asset/Image/Quest/Snap/Icon/${image}.png`;
chapterSelect += '</select></div>'; chapterSelect += '</select></div>';
cont.innerHTML = ` cont.innerHTML = `
<div id="mission-modal" class="modal"> <div id="mission-modal" class="modal">
<span class="mission-title">${name || 'none'}</span> <span class="mission-title">${name || 'none'}</span>
<img id="mission-detail" src="${detailSrc}"/> <img id="mission-detail" src="${utage.rootDirectory}XDUData/Asset/Image/Quest/Snap/Detail/${mis.MstId}.png"/>
<img id="mission-icon" src="${iconSrc}"/> <img id="mission-icon" src="${utage.rootDirectory}XDUData/Asset/Image/Quest/Snap/Icon/${mis.MstId}.png"/>
<div id="mission-summary">Summary: ${summary || 'none'}</div> <div id="mission-summary">Summary: ${summary || 'none'}</div>
<div class="flex-grow"></div> <div class="flex-grow"></div>
<div>Credits (${selectedLang}): ${credits}</div> <div>Credits (${selectedLang}): ${credits}</div>
@ -327,8 +207,8 @@ function sceneDropDownChanged(event) {
</div> </div>
<div id="modal-buttons"> <div id="modal-buttons">
<button onclick="closeMissionModal(event, false)">Close</button> <button onclick="closeMissionModal(event, false)">Close</button>
<span>MstId: ${questSceneMstId}</span> <span>MstId: ${mis.MstId}</span>
<button onclick="sceneSet('${questSceneMstId}', '${cust}')">Play</button> <button onclick="missionChanged(${mis.MstId})">Play</button>
</div> </div>
</div>`; </div>`;
document.getElementById("click-catcher").style.cssText = 'display: flex;'; document.getElementById("click-catcher").style.cssText = 'display: flex;';
@ -337,18 +217,10 @@ function sceneDropDownChanged(event) {
function closeMissionModal(event, wasStarted) { function closeMissionModal(event, wasStarted) {
if(!wasStarted) { if(!wasStarted) {
document.getElementById('select-scene').value = prevScene; document.getElementById('select-mission').value = prevMission;
document.getElementById('select-quest').value = prevQuest;
} else { } else {
prevScene = document.getElementById('select-scene').value; prevMission = document.getElementById('select-mission').value;
prevQuest = document.getElementById('select-quest').value;
} }
if (prevScene === '{Select}') {
document.getElementById('select-scene').setAttribute("disabled", "true");
} else {
document.getElementById('select-scene').removeAttribute("disabled");
}
closeModal(event); closeModal(event);
} }
@ -359,85 +231,55 @@ function closeModal(event) {
cont.innerHTML = ''; cont.innerHTML = '';
} }
function sceneSet(questSceneMstId, cust) { function missionChanged(mstId, value) {
resetPlaylist(); let mst = utage.groupedMissions[mstId];
let part = document.getElementById('ChapterSelect'); let name = mst.Name;
utage.scenes[cust][questSceneMstId]['QuestSceneMstId'] = questSceneMstId; if(utage.missionTranslations[mstId]) {
if (!part || part.value === '{All}') { name = utage.missionTranslations[mstId].Name || name;
scenePlaylist.push(utage.scenes[cust][questSceneMstId]);
} else {
currentScene = utage.scenes[cust][questSceneMstId];
try {
partPlaylist.push.apply(partPlaylist, currentScene.Parts.slice(currentScene.Parts.indexOf(part.value)));
} catch (error) {
console.log(error);
return;
}
} }
if(!value) {
playNext(); value = document.getElementById("ChapterSelect").value;
}
function playNext() {
if (!partPlaylist.length) {
if (!scenePlaylist.length) {
resetPlaylist();
return; // we're probably done
}
currentScene = scenePlaylist.shift();
partPlaylist = currentScene.Parts.slice();
} }
partChanged(partPlaylist.shift());
}
function partChanged(part) {
let cust = currentScene.IsCustom ? CUSTOM.custom : CUSTOM.stock;
let name = currentScene.Name;
let tl_key = utage.sceneTranslations[cust][currentScene.QuestSceneMstId];
if(tl_key) {
name = tl_key.Name || name;
}
if(!audio) { if(!audio) {
audio = new audioController(utage); audio = new audioController(utage);
audio.changeVolume(volume); audio.changeVolume(volume);
audio.mute(isMuted); audio.mute(isMuted);
player.audio = audio; player.audio = audio;
} }
player.resetAll() player.resetAll()
.then((success) => { .then((success) => {
if (scenePlaylist.length || partPlaylist.length) { let newMission = mst.Missions[value];
document.getElementById("skip-button").style.cssText = "display: inline-block;"; checkMissionList(mst.Missions, value);
} else { currentMission = newMission;
document.getElementById("skip-button").style.cssText = "display: none;"; currentMissionMst = mstId;
} if(!currentMission.Enabled) {
let promises = []; missionChanged(currentMissionMst, mst.Missions[currentMissionList[currentMissionIndex+1]].Id);
if(currentScene.IsCustom) { return;
promises.push(utage.parseMissionFile(`${utage.rootDirectory}CustomData/Utage/${currentScene.Folder}/Scenario/${part}_t.tsv`));
promises.push(utage.loadMissionTranslation(`${utage.rootDirectory}Js/Translations/MissionsCustom/${currentScene.Folder}/${part}_translations_${selectedLang}.json`));
} else {
promises.push(utage.parseMissionFile(`${utage.rootDirectory}XDUData/Utage/${currentScene.Folder}/Scenario/${part}_t.tsv`));
promises.push(utage.loadMissionTranslation(`${utage.rootDirectory}Js/Translations/Missions/${currentScene.Folder}/${part}_translations_${selectedLang}.json`));
} }
let promises = [
utage.parseMissionFile(`${utage.rootDirectory}XDUData/${newMission.Path.replace('Asset/', '').replace('.utage', '').replace('.tsv', '_t.tsv')}`),
utage.loadMissionTranslation(`${utage.rootDirectory}Js/Translations/Missions/${currentMission.Path.replace('Asset/Utage/', '').replace('Scenario/', '').replace('.utage', '').replace('.tsv', `_translations_${selectedLang}.json`)}`)
];
closeMissionModal(undefined, true); closeMissionModal(undefined, true);
Promise.all(promises) Promise.all(promises)
.then((success) => { .then((success) => {
document.getElementById("playing-title").innerText = `${name} (${part})`; document.getElementById("playing-title").innerText = `${name} (${value})`;
document.getElementById("title-tag").innerText = name; document.getElementById("title-tag").innerText = name;
currentPart = part;
player.playFile() player.playFile()
.then((success) => { .then((success) => {
playNext(); if(currentMissionIndex !== currentMissionList.length - 1) {
missionChanged(currentMissionMst, mst.Missions[currentMissionList[currentMissionIndex+1]].Id);
} else {
player.resetAll();
resetMissions();
}
}, (failure) => { }, (failure) => {
player.resetAll(); player.resetAll();
resetPlaylist(); resetMissions();
console.log(failure); console.log(failure);
}); });
}, (failure) => { }, (failure) => {
resetPlaylist(); resetMissions();
console.log(failure); console.log(failure);
}); });
}, (failure) => { }, (failure) => {
@ -449,32 +291,41 @@ function languageChanged(event) {
if(!event || !event.currentTarget || !event.currentTarget.value || event.currentTarget.value === '{Select}' || !languages.includes(event.currentTarget.value)) { return; } if(!event || !event.currentTarget || !event.currentTarget.value || event.currentTarget.value === '{Select}' || !languages.includes(event.currentTarget.value)) { return; }
selectedLang = event.currentTarget.value; selectedLang = event.currentTarget.value;
let missionPath = ''; let missionPath = '';
if(currentPart) { if(currentMission) {
if (currentScene.IsCustom) { missionPath = `${utage.rootDirectory}Js/Translations/Missions/${currentMission.Path.replace('Asset/Utage/', '').replace('Scenario/', '').replace('.utage', '').replace('.tsv', `_translations_${selectedLang}.json`)}`;
missionPath = `${utage.rootDirectory}Js/Translations/CustomMissions/${currentScene.Folder}/${currentPart}_translations_${selectedLang}.json`;
} else {
missionPath = `${utage.rootDirectory}Js/Translations/Missions/${currentScene.Folder}/${currentPart}_translations_${selectedLang}.json`;
}
} }
utage.setTranslationLanguage(selectedLang, missionPath) utage.setTranslationLanguage(selectedLang, missionPath)
.then((success) => { .then((success) => {
document.getElementById('text-container').className = selectedLang; buildMissionSelectList();
buildQuestSelectList();
buildSceneSelectList();
localStorage.setItem('language', selectedLang);
}); });
} }
function resetPlaylist() { function checkMissionList(missions, currentvalue) {
currentScene = {}; currentMissionList = [];
scenePlaylist = []; let i = 0;
currentPart = ""; for(var m of Object.keys(missions)) {
partPlaylist = []; currentMissionList.push(m);
if(m === currentvalue) {
currentMissionIndex = i;
}
++i;
}
if(currentMissionIndex + 1 === currentMissionList.length) {
document.getElementById("skip-button").style.cssText = "display: none;";
} else {
document.getElementById("skip-button").style.cssText = "display: inline-block;";
}
}
function resetMissions() {
currentMissionIndex = 0;
currentMissionList = [];
currentMission = undefined;
currentMissionMst = 0;
document.getElementById("skip-button").style.cssText = "display: inline-block;"; document.getElementById("skip-button").style.cssText = "display: inline-block;";
document.getElementById("playing-title").innerText = 'None'; document.getElementById("playing-title").innerText = 'None';
document.getElementById("title-tag").innerText = version; document.getElementById("title-tag").innerText = version;
document.getElementById("select-quest").value = '{Select}'; document.getElementById('select-mission').value = '{Select}';
buildSceneSelectList();
} }
function onMainClick(event) { function onMainClick(event) {
@ -488,10 +339,10 @@ function hideUiClicked(event) {
function skipClicked(event) { function skipClicked(event) {
if(player.uiHidden) { if(player.uiHidden) {
player.hideUiClicked(event); player.hideUiClicked(event);
} else if(player.runEvent) { } else if(player.runEvent && currentMissionIndex !== currentMissionList.length - 1) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
playNext(); missionChanged(currentMissionMst, utage.groupedMissions[currentMissionMst].Missions[currentMissionList[currentMissionIndex+1]].Id);
} }
} }
@ -537,17 +388,11 @@ function openHelpModal(event) {
iOS: 11+, no audio<br/> iOS: 11+, no audio<br/>
</div> </div>
</div> </div>
<div class="follow-links"> <a style="margin-top: auto; text-align: center; "href="https://discord.gg/fpQZQ8g">YameteTomete Discord</a>
<div class="follow-links-header">Follow YameteTomete</div>
<div class="follow-links-links">
<a href="https://discord.gg/fpQZQ8g" target="_blank" >Discord</a>
<a href="https://twitter.com/YameteTomete" target="_blank">Twitter</a>
</div>
</div>
<div style="margin-top: auto; text-align: center;">All Symphogear content belongs to its respective owners</div> <div style="margin-top: auto; text-align: center;">All Symphogear content belongs to its respective owners</div>
<div id="modal-buttons"> <div id="modal-buttons">
<button onclick="closeModal(event)">Close</button> <button onclick="closeModal(event)">Close</button>
<a href="https://git.poweris.moe/yttt-xdu/XDUPlayer" target="_blank">Source</a> <a href="https://git.poweris.moe/xduplayer.git/" target="_blank">Source</a>
</div> </div>
</div>`; </div>`;
document.getElementById("click-catcher").style.cssText = 'display: flex;'; document.getElementById("click-catcher").style.cssText = 'display: flex;';
@ -561,9 +406,9 @@ function toggleMute(event) {
} }
localStorage.setItem('ismuted', isMuted); localStorage.setItem('ismuted', isMuted);
if(isMuted) { if(isMuted) {
document.getElementById('mute-button').innerText = emoji.Mute; document.getElementById('mute-button').innerText = "🔇";
} else { } else {
document.getElementById('mute-button').innerText = emoji.LoudSound; document.getElementById('mute-button').innerText = "🔊";
} }
} }
@ -602,7 +447,7 @@ function onFullScreenChange(event) {
} else { } else {
document.getElementById('other-controls-container').style.cssText = ""; document.getElementById('other-controls-container').style.cssText = "";
document.getElementById('title-container').style.cssText = ""; document.getElementById('title-container').style.cssText = "";
document.getElementById('fullscreen-button').innerText = emoji.HeavyPlusSign; document.getElementById('fullscreen-button').innerText = "";
} }
onWindowResize(event, 0); onWindowResize(event, 0);
} }

19
Js/Pixi.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,25 @@
//http://glslsandbox.com/e#39992.0 //http://glslsandbox.com/e#39992.0
class Shaders { class Shaders {
constructor() { constructor() {
this.leftToRightFadeShader = ` this.leftToRightFadeShader = `
precision mediump float; precision mediump float;
varying vec2 vTextureCoord; varying vec2 vTextureCoord;
uniform vec4 inputPixel; uniform vec2 dimensions;
uniform highp vec4 outputFrame; uniform vec4 filterArea;
uniform float time; uniform float time;
uniform vec4 fadeincolor; uniform vec4 fadeincolor;
uniform vec4 fadeoutcolor; uniform vec4 fadeoutcolor;
vec2 mapCoord( vec2 coord ) {
coord *= filterArea.xy;
coord += filterArea.zw;
return coord;
}
void main( void ) { void main( void ) {
vec2 uv = vTextureCoord * inputPixel.xy / outputFrame.zw; vec2 uv = vTextureCoord;
vec2 mappedCoord = uv; vec2 mappedCoord = mapCoord(uv) / dimensions;
float step2 = time; float step2 = time;
float step3 = time + 0.2; float step3 = time + 0.2;
@ -30,16 +35,21 @@ class Shaders {
this.rightToLeftFadeShader = ` this.rightToLeftFadeShader = `
precision mediump float; precision mediump float;
varying vec2 vTextureCoord; varying vec2 vTextureCoord;
uniform vec4 inputPixel; uniform vec2 dimensions;
uniform highp vec4 outputFrame; uniform vec4 filterArea;
uniform float time; uniform float time;
uniform vec4 fadeincolor; uniform vec4 fadeincolor;
uniform vec4 fadeoutcolor; uniform vec4 fadeoutcolor;
vec2 mapCoord( vec2 coord ) {
coord *= filterArea.xy;
return coord;
}
void main( void ) { void main( void ) {
vec2 uv = vTextureCoord * inputPixel.xy / outputFrame.zw; vec2 uv = vTextureCoord;
vec2 mappedCoord = uv; vec2 mappedCoord = mapCoord(uv) / dimensions;
float step2 = (1.0 - time); float step2 = (1.0 - time);
float step3 = (1.0 - time) - 0.2; float step3 = (1.0 - time) - 0.2;
@ -55,16 +65,22 @@ class Shaders {
this.downToUpFadeShader = ` this.downToUpFadeShader = `
precision mediump float; precision mediump float;
varying vec2 vTextureCoord; varying vec2 vTextureCoord;
uniform vec4 inputPixel; uniform vec2 dimensions;
uniform highp vec4 outputFrame; uniform vec4 filterArea;
uniform float time; uniform float time;
uniform vec4 fadeincolor; uniform vec4 fadeincolor;
uniform vec4 fadeoutcolor; uniform vec4 fadeoutcolor;
vec2 mapCoord( vec2 coord ) {
coord *= filterArea.xy;
coord += filterArea.zw;
return coord;
}
void main( void ) { void main( void ) {
vec2 uv = vTextureCoord * inputPixel.xy / outputFrame.zw; vec2 uv = vTextureCoord;
vec2 mappedCoord = uv; vec2 mappedCoord = mapCoord(uv) / dimensions;
float step2 = (1.0 - time); float step2 = (1.0 - time);
float step3 = (1.0 - time) - 0.2; float step3 = (1.0 - time) - 0.2;
@ -80,16 +96,22 @@ class Shaders {
this.uptoDownFadeShader = ` this.uptoDownFadeShader = `
precision mediump float; precision mediump float;
varying vec2 vTextureCoord; varying vec2 vTextureCoord;
uniform vec4 inputPixel; uniform vec2 dimensions;
uniform highp vec4 outputFrame; uniform vec4 filterArea;
uniform float time; uniform float time;
uniform vec4 fadeincolor; uniform vec4 fadeincolor;
uniform vec4 fadeoutcolor; uniform vec4 fadeoutcolor;
vec2 mapCoord( vec2 coord ) {
coord *= filterArea.xy;
coord += filterArea.zw;
return coord;
}
void main( void ) { void main( void ) {
vec2 uv = vTextureCoord * inputPixel.xy / outputFrame.zw; vec2 uv = vTextureCoord;
vec2 mappedCoord = uv; vec2 mappedCoord = mapCoord(uv) / dimensions;
float step2 = time; float step2 = time;
float step3 = time + 0.2; float step3 = time + 0.2;
@ -106,6 +128,7 @@ class Shaders {
precision mediump float; precision mediump float;
varying vec2 vTextureCoord; varying vec2 vTextureCoord;
uniform sampler2D uSampler; uniform sampler2D uSampler;
uniform vec2 dimensions;
uniform float factor; uniform float factor;
vec4 Sepia( in vec4 color ) vec4 Sepia( in vec4 color )
@ -126,11 +149,10 @@ class Shaders {
} }
//https://jsfiddle.net/60e5pp8d/1/ //https://jsfiddle.net/60e5pp8d/1/
//v5 changes to shaders, https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters
// https://www.html5gamedevs.com/topic/42235-how-to-get-correct-fragment-shader-uv-in-pixi-50-rc0/
buildShaders() { buildShaders() {
let divalefttorightfade = new PIXI.Filter(null, this.leftToRightFadeShader, { let divalefttorightfade = new PIXI.Filter(null, this.leftToRightFadeShader, {
time: { type: 'f', value: 0 }, time: { type: 'f', value: 0 },
dimensions: { type: 'v2', value: [baseDimensions.width, baseDimensions.height] },
fadeincolor: { type: 'v4', value: [0.0,0.0,0.0,1.0] }, fadeincolor: { type: 'v4', value: [0.0,0.0,0.0,1.0] },
fadeoutcolor: { type: 'v4', value: [0.0,0.0,0.0,0.0] } fadeoutcolor: { type: 'v4', value: [0.0,0.0,0.0,0.0] }
}); });
@ -139,6 +161,7 @@ class Shaders {
let divarighttoleftfade = new PIXI.Filter(null, this.rightToLeftFadeShader, { let divarighttoleftfade = new PIXI.Filter(null, this.rightToLeftFadeShader, {
time: { type: 'f', value: 0 }, time: { type: 'f', value: 0 },
dimensions: { type: 'v2', value: [baseDimensions.width, baseDimensions.height] },
fadeincolor: { type: 'v4', value: [0.0,0.0,0.0,1.0] }, fadeincolor: { type: 'v4', value: [0.0,0.0,0.0,1.0] },
fadeoutcolor: { type: 'v4', value: [0.0,0.0,0.0,0.0] } fadeoutcolor: { type: 'v4', value: [0.0,0.0,0.0,0.0] }
}); });
@ -147,6 +170,7 @@ class Shaders {
let divauptodownfade = new PIXI.Filter(null, this.uptoDownFadeShader, { let divauptodownfade = new PIXI.Filter(null, this.uptoDownFadeShader, {
time: { type: 'f', value: 0 }, time: { type: 'f', value: 0 },
dimensions: { type: 'v2', value: [baseDimensions.width, baseDimensions.height] },
fadeincolor: { type: 'v4', value: [0.0,0.0,0.0,1.0] }, fadeincolor: { type: 'v4', value: [0.0,0.0,0.0,1.0] },
fadeoutcolor: { type: 'v4', value: [0.0,0.0,0.0,0.0] } fadeoutcolor: { type: 'v4', value: [0.0,0.0,0.0,0.0] }
}); });
@ -155,6 +179,7 @@ class Shaders {
let divadowntoupfade = new PIXI.Filter(null, this.downToUpFadeShader, { let divadowntoupfade = new PIXI.Filter(null, this.downToUpFadeShader, {
time: { type: 'f', value: 0 }, time: { type: 'f', value: 0 },
dimensions: { type: 'v2', value: [baseDimensions.width, baseDimensions.height] },
fadeincolor: { type: 'v4', value: [0.0,0.0,0.0,1.0] }, fadeincolor: { type: 'v4', value: [0.0,0.0,0.0,1.0] },
fadeoutcolor: { type: 'v4', value: [0.0,0.0,0.0,0.0] } fadeoutcolor: { type: 'v4', value: [0.0,0.0,0.0,0.0] }
}); });
@ -162,12 +187,15 @@ class Shaders {
this.shaders['divadowntoupfade'] = divadowntoupfade; this.shaders['divadowntoupfade'] = divadowntoupfade;
let sepia = new PIXI.Filter(null, this.sepiaShader, { let sepia = new PIXI.Filter(null, this.sepiaShader, {
factor: { type: 'f', value: 0.5 } factor: { type: 'f', value: 0.5 },
dimensions: { type: 'v2', value: [baseDimensions.width, baseDimensions.height] }
}); });
sepia.apply = baseShaderApply; sepia.apply = baseShaderApply;
this.shaders['sepia'] = sepia; this.shaders['sepia'] = sepia;
function baseShaderApply(filterManager, input, output) { function baseShaderApply(filterManager, input, output) {
this.uniforms.dimensions[0] = input.sourceFrame.width;
this.uniforms.dimensions[1] = input.sourceFrame.height;
filterManager.applyFilter(this, input, output); filterManager.applyFilter(this, input, output);
} }
} }

View File

@ -84,6 +84,7 @@ class TextFunctions {
function putText() { function putText() {
// skip over any HTML chars // skip over any HTML chars
this.dialogToDisplay.curPos = this.typeHtmlChars(this.dialogToDisplay.text, this.dialogToDisplay.curPos); this.dialogToDisplay.curPos = this.typeHtmlChars(this.dialogToDisplay.text, this.dialogToDisplay.curPos);
let substr = this.dialogToDisplay.text.substr(this.dialogToDisplay.curPos);
if (this.dialogToDisplay.curPos === this.dialogToDisplay.text.length) { if (this.dialogToDisplay.curPos === this.dialogToDisplay.text.length) {
this.showNextIndicator(true); this.showNextIndicator(true);
this.scrollingText = false; this.scrollingText = false;

@ -1 +1 @@
Subproject commit ac0bfbd699431e9befdd843379e7c91ad1014cec Subproject commit 5b7839ae9b5e47b5bd29d64c06c22a3b000d8959

View File

@ -6,9 +6,7 @@ class UtageInfo {
this.currentPlayingFile = []; this.currentPlayingFile = [];
this.rootDirectory = ``; this.rootDirectory = ``;
this.groupedMissions = {}; this.groupedMissions = {};
this.quests = {}; this.missionsList = [];
this.questList = [];
this.scenes = {};
this.characterInfo = {}; this.characterInfo = {};
this.layerInfo = {}; this.layerInfo = {};
this.localizeInfo = {}; this.localizeInfo = {};
@ -18,64 +16,38 @@ class UtageInfo {
this.currentTranslation = 'eng'; this.currentTranslation = 'eng';
this.translationsInner = {}; this.translationsInner = {};
this.charTranslationsInner = {}; this.charTranslationsInner = {};
this.questTranslationsInner = {}; this.missionTranslationsInner = {};
this.sceneTranslationsInner = {};
this.bgmLoopData = {}; this.bgmLoopData = {};
this.macros = {};
} }
loadUtageSettings() { loadUtageSettings(resolve, reject) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let promises = [ let promises = [
commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduQuest.json`), //0 commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduMissions.json`),
commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduScene.json`), //1 commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Character.tsv`),
commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Character.tsv`), //2 commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Layer.tsv`),
commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Layer.tsv`), //3 commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Localize.tsv`),
commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Localize.tsv`), //4 commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Param.tsv`),
//commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Param.tsv`),
//commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Scenario.tsv`), //commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Scenario.tsv`),
commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Sound.tsv`), //5 commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Sound.tsv`),
commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Texture.tsv`), //6 commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Settings/Texture.tsv`),
commonFunctions.getFileJson(`${this.rootDirectory}XDUData/Bgm/BgmLoop.json`), //7 commonFunctions.getFileJson(`${this.rootDirectory}Js/BgmLoop.json`),
commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduQuestCustom.json`), //8 commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduMissionsCustom.json`),
commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduSceneCustom.json`), //9
commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomCharacter.tsv`), //10
commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomSound.tsv`), //11
commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomTexture.tsv`), //12
commonFunctions.getFileText(`${this.rootDirectory}XDUData/Utage/Diva/Scenario/Macro.tsv`), //13
commonFunctions.getFileText(`${this.rootDirectory}CustomData/Utage/Diva/Settings/CustomMacro.tsv`), //14
]; ];
Promise.all(promises) Promise.all(promises)
.then((success) => { .then((success) => {
this.quests[CUSTOM.stock] = success[0]; this.groupMissions(success[0], success[8]);
this.questList = Object.keys(this.quests[CUSTOM.stock]).map((k) => { this.missionsList = Object.keys(this.groupedMissions).map((k) => {
return {QuestMstId: k, Name: this.quests[CUSTOM.stock][k].Name, IsCustom: false}; return {Name: this.groupedMissions[k].Name, MstId: this.groupedMissions[k].MstId};
}); });
this.quests[CUSTOM.custom] = success[8]; this.missionsList.sort();
for (const k of Object.keys(this.quests[CUSTOM.custom])) { this.parseCharacterInfo(success[1]);
this.questList.push({QuestMstId: k, Name: this.quests[CUSTOM.custom][k].Name, IsCustom: true}); this.parseLayerInfo(success[2]);
} this.parseLocalizeInfo(success[3]);
this.questList.sort((a, b) => { return a.QuestMstId - b.QuestMstId }); this.parseParamInfo(success[4]);
this.scenes[CUSTOM.stock] = success[1];
for (const k of Object.keys(this.scenes[CUSTOM.stock])) {
this.scenes[CUSTOM.stock][k]['IsCustom'] = false;
}
this.parseCharacterInfo(success[2]);
this.parseLayerInfo(success[3]);
this.parseLocalizeInfo(success[4]);
//this.parseParamInfo(success[4]);
this.parseSoundInfo(success[5]); this.parseSoundInfo(success[5]);
this.parseTextureInfo(success[6]); this.parseTextureInfo(success[6]);
this.bgmLoopData = success[7]; this.bgmLoopData = success[7];
this.scenes[CUSTOM.custom] = success[9];
for (const k of Object.keys(this.scenes[CUSTOM.custom])) {
this.scenes[CUSTOM.custom][k]['IsCustom'] = true;
}
this.parseCharacterInfo(success[10], true);
this.parseSoundInfo(success[11], true);
this.parseTextureInfo(success[12], true);
this.parseMacroFile(success[13]);
this.parseMacroFile(success[14]);
resolve(); resolve();
}, (failure) => { }, (failure) => {
reject(failure); reject(failure);
@ -109,6 +81,38 @@ class UtageInfo {
}); });
} }
groupMissions(missions, customMissions) {
for(let key of Object.keys(missions)) {
let mis = missions[key];
if(!this.groupedMissions[mis.MstId]) {
this.groupedMissions[mis.MstId] = {
Name: mis.Name,
SummaryText: mis.SummaryText,
MstId: mis.MstId,
Missions: {}
}
this.groupedMissions[mis.MstId].Missions[mis.Id] = { Id: mis.Id, Path: mis.Path, Enabled: mis.Enabled };
} else {
this.groupedMissions[mis.MstId].Missions[mis.Id] = { Id: mis.Id, Path: mis.Path, Enabled: mis.Enabled };
}
}
for(let key of Object.keys(customMissions)) {
let mis = customMissions[key];
if(!this.groupedMissions[mis.MstId]) {
this.groupedMissions[mis.MstId] = {
Name: mis.Name,
SummaryText: mis.SummaryText,
MstId: mis.MstId,
Missions: {}
}
this.groupedMissions[mis.MstId].Missions[mis.Id] = { Id: mis.Id, Path: mis.Path, Enabled: mis.Enabled };
} else {
this.groupedMissions[mis.MstId].Missions[mis.Id] = { Id: mis.Id, Path: mis.Path, Enabled: mis.Enabled };
}
}
}
get translations() { get translations() {
return this.translationsInner[this.currentTranslation]; return this.translationsInner[this.currentTranslation];
} }
@ -117,40 +121,20 @@ class UtageInfo {
return this.charTranslationsInner[this.currentTranslation]; return this.charTranslationsInner[this.currentTranslation];
} }
get questTranslations() { get missionTranslations() {
return this.questTranslationsInner[this.currentTranslation]; return this.missionTranslationsInner[this.currentTranslation];
}
get sceneTranslations() {
return this.sceneTranslationsInner[this.currentTranslation];
} }
setTranslationLanguage(key, missionPath) { setTranslationLanguage(key, missionPath) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.currentTranslation = key; this.currentTranslation = key;
let promises = [this.loadCharacterTranslations(key), let promises = [this.loadCharacterTranslations(key),
this.loadQuestNamesTranslations(key), this.loadMissionNamesTranslations(key)];
this.loadSceneNamesTranslations(key)];
if(missionPath) { if(missionPath) {
promises.push(this.loadMissionTranslation(missionPath, key)); promises.push(this.loadMissionTranslation(missionPath, key));
} }
Promise.all(promises) Promise.all(promises)
.then((success) => { .then((success) => {
// propagate language-based enables downwards from quests to scenes
for (const c of [CUSTOM.custom, CUSTOM.stock]) {
for (const k of Object.keys(this.questTranslationsInner[this.currentTranslation][c])) {
if (this.questTranslationsInner[this.currentTranslation][c][k].Enabled) {
for (const s of this.quests[c][k].Scenes) {
// only propagate if exists in translation file (THANKS GLOBAL) and translated name is supplied
if (c in this.sceneTranslationsInner[this.currentTranslation]
&& s in this.sceneTranslationsInner[this.currentTranslation][c]
&& this.sceneTranslationsInner[this.currentTranslation][c][s].Name != "") {
this.sceneTranslationsInner[this.currentTranslation][c][s].Enabled = true;
}
}
}
}
}
resolve(); resolve();
}, (failure) => { }, (failure) => {
console.log(failure); console.log(failure);
@ -181,7 +165,7 @@ class UtageInfo {
if(this.charTranslationsInner[this.currentTranslation]) { if(this.charTranslationsInner[this.currentTranslation]) {
resolve(); resolve();
} else { } else {
commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/nametranslations_${this.currentTranslation}.json`) commonFunctions.getFileJson(`${utage.rootDirectory}Js/Translations/nametranslations_${this.currentTranslation}.json`)
.then((success) => { .then((success) => {
this.charTranslationsInner[this.currentTranslation] = success; this.charTranslationsInner[this.currentTranslation] = success;
resolve(); resolve();
@ -193,20 +177,21 @@ class UtageInfo {
}); });
} }
loadQuestNamesTranslations() { loadMissionNamesTranslations() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if(this.questTranslationsInner[this.currentTranslation]) { if(this.missionTranslationsInner[this.currentTranslation]) {
resolve(); resolve();
} else { } else {
var promises = [ var promises = [
commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduQuestNames_${this.currentTranslation}.json`), commonFunctions.getFileJson(`${utage.rootDirectory}Js/Translations/XduMissionsNames_${this.currentTranslation}.json`),
commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduQuestNamesCustom_${this.currentTranslation}.json`) commonFunctions.getFileJson(`${utage.rootDirectory}Js/Translations/XduMissionsNamesCustom_${this.currentTranslation}.json`)
]; ];
Promise.all(promises) Promise.all(promises)
.then((success) => { .then((success) => {
this.questTranslationsInner[this.currentTranslation] = {}; for(let m of Object.keys(success[1])) {
this.questTranslationsInner[this.currentTranslation][CUSTOM.stock] = success[0]; success[0][m] = success[1][m];
this.questTranslationsInner[this.currentTranslation][CUSTOM.custom] = success[1]; }
this.missionTranslationsInner[this.currentTranslation] = success[0];
resolve(); resolve();
}, (failure) => { }, (failure) => {
console.log(failure); console.log(failure);
@ -216,61 +201,8 @@ class UtageInfo {
}); });
} }
loadSceneNamesTranslations() {
return new Promise((resolve, reject) => {
if(this.sceneTranslationsInner[this.currentTranslation]) {
resolve();
} else {
var promises = [
commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduSceneNames_${this.currentTranslation}.json`),
commonFunctions.getFileJson(`${this.rootDirectory}Js/Translations/XduSceneNamesCustom_${this.currentTranslation}.json`)
];
Promise.all(promises)
.then((success) => {
this.sceneTranslationsInner[this.currentTranslation] = {};
this.sceneTranslationsInner[this.currentTranslation][CUSTOM.stock] = success[0];
this.sceneTranslationsInner[this.currentTranslation][CUSTOM.custom] = success[1];
resolve();
}, (failure) => {
console.log(failure);
resolve();
});
}
});
}
parseMacroFile(file) {
let lines = file.split('\n');
let header = lines[0].split('\t');
let macro = false;
let name = "";
for (let i = 1; i < lines.length; ++i) {
let line = commonFunctions.readLine(lines[i], header);
if (line && !line.comment) {
if (macro === false) {
if (line.Command[0] === '*') {
name = line.Command.slice(1);
if (!(name in this.macros)) {
macro = true;
this.macros[name] = [];
}
}
} else {
if (line.Command === "EndMacro") {
macro = false;
continue;
}
if (!line.Command && !line.Arg1 && !line.Arg2 && !line.Arg3 && !line.Arg4 && !line.Arg5 && !line.Arg6) {
continue;
}
this.macros[name].push(line);
}
}
}
}
//http://madnesslabo.net/utage/?page_id=4521&lang=en //http://madnesslabo.net/utage/?page_id=4521&lang=en
parseCharacterInfo(text, custom = false) { parseCharacterInfo(text) {
let lines = text.split("\n"); let lines = text.split("\n");
let headers = []; let headers = [];
let lastCharName = ''; let lastCharName = '';
@ -295,10 +227,10 @@ class UtageInfo {
} }
if(read.FileName) { if(read.FileName) {
if(!read.FileName.startsWith('file://')) { if(!read.FileName.startsWith('file://')) {
read.FileName = `${this.rootDirectory}${(custom ? "CustomData" : "XDUData")}/Sample/Texture/Character/${read.FileName}`; read.FileName = `${this.rootDirectory}XDUData/Sample/Texture/Character/${read.FileName}`;
} else { } else {
read.FileName = read.FileName.replace('file://', ''); read.FileName = read.FileName.replace('file://', '');
read.FileName = `${this.rootDirectory}${(custom ? "CustomData" : "XDUData")}/${read.FileName}`; read.FileName = `${this.rootDirectory}XDUData/${read.FileName}`;
} }
} }
if(!this.characterInfo[lastCharName]) { if(!this.characterInfo[lastCharName]) {
@ -362,7 +294,7 @@ class UtageInfo {
} }
//http://madnesslabo.net/utage/?page_id=4519&lang=en //http://madnesslabo.net/utage/?page_id=4519&lang=en
parseSoundInfo(text, custom = false) { parseSoundInfo(text) {
let lines = text.split("\n"); let lines = text.split("\n");
let headers = []; let headers = [];
for(let i = 0; i < lines.length; ++i) { for(let i = 0; i < lines.length; ++i) {
@ -383,10 +315,10 @@ class UtageInfo {
let s = read.FileName.split(','); let s = read.FileName.split(',');
read.FileName = `${s[0].split('_').join('/')}/${s[1]}`; read.FileName = `${s[0].split('_').join('/')}/${s[1]}`;
} }
read.FileName = `${this.rootDirectory}${(custom ? "CustomData" : "XDUData")}/Se/${read.FileName}`; read.FileName = `${this.rootDirectory}XDUData/Se/${read.FileName}`;
break; break;
case 'bgm': case 'bgm':
read.FileName = `${this.rootDirectory}${(custom ? "CustomData" : "XDUData")}/Bgm/${read.FileName}`; read.FileName = `${this.rootDirectory}XDUData/Bgm/${read.FileName}`;
break; break;
} }
} }
@ -397,7 +329,7 @@ class UtageInfo {
} }
//http://madnesslabo.net/utage/?page_id=4520&lang=en //http://madnesslabo.net/utage/?page_id=4520&lang=en
parseTextureInfo(text, custom = false) { parseTextureInfo(text) {
let lines = text.split("\n"); let lines = text.split("\n");
let headers = []; let headers = [];
for(let i = 0; i < lines.length; ++i) { for(let i = 0; i < lines.length; ++i) {
@ -408,10 +340,10 @@ class UtageInfo {
let read = commonFunctions.readLine(line, headers); let read = commonFunctions.readLine(line, headers);
if(read && read.Label) { if(read && read.Label) {
if(!read.FileName.startsWith("file://")) { if(!read.FileName.startsWith("file://")) {
read.FileName = `${this.rootDirectory}${(custom ? "CustomData" : "XDUData")}/Sample/Texture/BG/${read.FileName}`; read.FileName = `${this.rootDirectory}XDUData/Sample/Texture/BG/${read.FileName}`;
} else { } else {
read.FileName = read.FileName.replace("file://", ''); read.FileName = read.FileName.replace("file://", '');
read.FileName = `${this.rootDirectory}${(custom ? "CustomData" : "XDUData")}/${read.FileName}`; read.FileName = `${this.rootDirectory}XDUData/${read.FileName}`;
} }
this.textureInfo[read.Label] = read; this.textureInfo[read.Label] = read;
} }

View File

@ -1,9 +1,7 @@
<!DOCTYPE HTML>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
<meta name="theme-color" content="#393939"/>
<title id="title-tag"></title> <title id="title-tag"></title>
<link rel="stylesheet" type="text/css" href="Css/generic.min.css"> <link rel="stylesheet" type="text/css" href="Css/generic.min.css">
<link rel="stylesheet" type="text/css" href="Css/main.min.css"> <link rel="stylesheet" type="text/css" href="Css/main.min.css">
@ -15,9 +13,10 @@
<script src="Js/TextFunctions.js"></script> <script src="Js/TextFunctions.js"></script>
<script src="Js/UtageParse.js"></script> <script src="Js/UtageParse.js"></script>
<script src="Js/Audio.js"></script> <script src="Js/Audio.js"></script>
<script src="Js/Player.js"></script>--> <script src="Js/Player.js"></script>
<script src="Js/Main.js"></script> -->
<script src="Js/XduPlayer.min.js"></script> <script src="Js/XduPlayer.min.js"></script>
<div id="loading-container" class="centered" style="z-index: 20;"> <div id="loading-container" class="centered">
<h2 id="loading-utage">Loading Utage Data...</h2> <h2 id="loading-utage">Loading Utage Data...</h2>
<h2 id="loading-font">Loading Page Data...</h2> <h2 id="loading-font">Loading Page Data...</h2>
</div> </div>
@ -25,11 +24,10 @@
<div id="title-container"><span>Now Playing: </span><span id="playing-title">None</span></div> <div id="title-container"><span>Now Playing: </span><span id="playing-title">None</span></div>
<div id="other-controls-container"> <div id="other-controls-container">
<div id="volume-control"> <div id="volume-control">
<span onclick="toggleMute(event)" id="mute-button">&#128266;</span> <!-- loud_sound --> <span onclick="toggleMute(event)" id="mute-button">🔊</span>
<input onchange="onVolumeChange(event)" id="volume-range" value="50" type="range" min="0" max="100" step="1"/> <input onchange="onVolumeChange(event)" id="volume-range" value="50" type="range" min="0" max="100" step="1"/>
</div> </div>
<select id="select-quest" onchange="questDropDownChanged(event);"></select> <select id="select-mission" onchange="missionDropDownChanged(event);"></select>
<select id="select-scene" disabled="true" onchange="sceneDropDownChanged(event);"></select>
<select id="select-language" onchange="languageChanged(event);"></select> <select id="select-language" onchange="languageChanged(event);"></select>
<a style="font-size: 20px; margin-left: 5px;" title="info/help" onclick="openHelpModal(event)">?</a> <a style="font-size: 20px; margin-left: 5px;" title="info/help" onclick="openHelpModal(event)">?</a>
</div> </div>
@ -37,7 +35,7 @@
The canvas then resizes as the canvas does and the text-container uses transform scale based off this resolution --> The canvas then resizes as the canvas does and the text-container uses transform scale based off this resolution -->
<div id="app-container" onclick="onMainClick(event);"> <div id="app-container" onclick="onMainClick(event);">
<div id="text-container"> <div id="text-container">
<div id="fullscreen-button" onclick="toggleFullscreen(event)">&#10133;</div> <!-- heavy_plus_sign --> <div id="fullscreen-button" onclick="toggleFullscreen(event)"></div>
<img id="main-ui-img" class="hidden" src="Images/newui_main.png"/> <img id="main-ui-img" class="hidden" src="Images/newui_main.png"/>
<button id="play-from-query" onclick="playFromQuery(event)" style="display: none;">Play</button> <button id="play-from-query" onclick="playFromQuery(event)" style="display: none;">Play</button>
<div id="title" class="hidden">Title Text</div> <div id="title" class="hidden">Title Text</div>

View File

@ -26,6 +26,9 @@ const cssToCopy = [
"Css/main.min.css", "Css/main.min.css",
"Css/generic.min.css" "Css/generic.min.css"
]; ];
const jsonFiles = [
"Js/BgmLoop.json",
];
const translations = [ const translations = [
"Js/Translations/**" "Js/Translations/**"
]; ];
@ -47,10 +50,10 @@ gulp.task('dist', gulp.series(
buildCss, buildCss,
copyCss copyCss
), ),
buildJson,
buildJsonTranslations, buildJsonTranslations,
copyHtml, copyHtml,
copyImages, copyImages
copyCustomData
), ),
) )
); );
@ -108,9 +111,10 @@ function copyImages() {
.pipe(gulp.dest('Dist/Images')); .pipe(gulp.dest('Dist/Images'));
} }
function copyCustomData() { function buildJson() {
return gulp.src('CustomData/**') return gulp.src(jsonFiles)
.pipe(gulp.dest('Dist/CustomData')); .pipe(jsonmin())
.pipe(gulp.dest('Dist/Js'));
} }
function buildJsonTranslations() { function buildJsonTranslations() {

14467
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,16 @@
{ {
"name": "XduPlayer", "name": "XduPlayer",
"version": "1.3.0", "version": "1.0.0",
"private": true, "private": true,
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"gulp": "~4.0.2", "gulp": "github:gulpjs/gulp#4.0",
"gulp-concat": "~2.6.1", "gulp-concat": "~2.6.1",
"gulp-cssmin": "~0.2.0", "gulp-cssmin": "~0.2.0",
"gulp-jsonminify": "^1.1.0", "gulp-jsonminify": "^1.1.0",
"gulp-rename": "~1.2.2", "gulp-rename": "~1.2.2",
"gulp-sourcemaps": "~2.6.4", "gulp-sourcemaps": "~2.6.4",
"gulp-uglify": "~3.0.0", "gulp-uglify": "~3.0.0",
"gulp-uglify-es": "~1.0.1", "gulp-uglify-es": "~1.0.1"
"npm": "^6.9.0",
"eslint": "^5.16.0"
} }
} }