@@ -551,12 +551,14 @@ class Monogatari {
551551
552552 for ( const category of Object . keys ( Monogatari . assets ( ) ) ) {
553553 for ( const asset of Object . values ( Monogatari . assets ( category ) ) ) {
554+ const directory = `${ Monogatari . setting ( 'AssetsPath' ) . root } /${ Monogatari . setting ( 'AssetsPath' ) [ category ] } ` ;
554555 if ( FileSystem . isImage ( asset ) ) {
555- promises . push ( Preload . image ( `assets/${ category } /${ asset } ` ) . finally ( ( ) => {
556+
557+ promises . push ( Preload . image ( `${ directory } /${ asset } ` ) . finally ( ( ) => {
556558 $_ ( '[data-ui="load-progress"]' ) . value ( parseInt ( $_ ( '[data-ui="load-progress"]' ) . value ( ) ) + 1 ) ;
557559 } ) ) ;
558560 } else {
559- promises . push ( Preload . file ( `assets/ ${ category } /${ asset } ` ) . finally ( ( ) => {
561+ promises . push ( Preload . file ( `${ directory } /${ asset } ` ) . finally ( ( ) => {
560562 $_ ( '[data-ui="load-progress"]' ) . value ( parseInt ( $_ ( '[data-ui="load-progress"]' ) . value ( ) ) + 1 ) ;
561563 } ) ) ;
562564 }
@@ -572,10 +574,11 @@ class Monogatari {
572574 if ( typeof character . Directory !== 'undefined' ) {
573575 directory = character . Directory + '/' ;
574576 }
577+ directory = `${ Monogatari . setting ( 'AssetsPath' ) . root } /${ Monogatari . setting ( 'AssetsPath' ) . characters } /${ directory } ` ;
575578
576579 if ( typeof character . Images !== 'undefined' ) {
577580 for ( const image of Object . values ( character . Images ) ) {
578- promises . push ( Preload . image ( 'assets/characters/' + directory + image ) . finally ( ( ) => {
581+ promises . push ( Preload . image ( ` ${ directory } ${ image } ` ) . finally ( ( ) => {
579582 $_ ( '[data-ui="load-progress"]' ) . value ( parseInt ( $_ ( '[data-ui="load-progress"]' ) . value ( ) ) + 1 ) ;
580583 } ) ) ;
581584 }
@@ -584,15 +587,15 @@ class Monogatari {
584587
585588 if ( typeof character . Side !== 'undefined' ) {
586589 for ( const image of Object . values ( character . Side ) ) {
587- promises . push ( Preload . image ( 'assets/characters/' + directory + image ) . finally ( ( ) => {
590+ promises . push ( Preload . image ( ` ${ directory } ${ image } ` ) . finally ( ( ) => {
588591 $_ ( '[data-ui="load-progress"]' ) . value ( parseInt ( $_ ( '[data-ui="load-progress"]' ) . value ( ) ) + 1 ) ;
589592 } ) ) ;
590593 }
591594 assetCount += 1 ;
592595 }
593596
594597 if ( typeof character . Face !== 'undefined' ) {
595- promises . push ( Preload . image ( 'assets/characters/' + directory + character . Face ) . finally ( ( ) => {
598+ promises . push ( Preload . image ( ` ${ directory } ${ character . Face } ` ) . finally ( ( ) => {
596599 $_ ( '[data-ui="load-progress"]' ) . value ( parseInt ( $_ ( '[data-ui="load-progress"]' ) . value ( ) ) + 1 ) ;
597600 } ) ) ;
598601 assetCount += 1 ;
@@ -667,7 +670,7 @@ class Monogatari {
667670 <figure data-load-slot='${ slot } ' class='row__column row_column--6 row__column--tablet--4 row__column--desktop--3 row__column--desktop-large--2 animated flipInX'>
668671 <button class='fas fa-times' data-delete='${ slot } '></button>
669672 <small class='badge'>${ name } </small>
670- <img src='assets/ scenes/${ image } ' alt=''>
673+ <img src=" ${ Monogatari . setting ( 'AssetsPath' ) . root } / ${ Monogatari . setting ( 'AssetsPath' ) . scenes } /${ image } " alt=''>
671674 <figcaption>${ moment ( data . date ) . format ( 'MMMM Do YYYY, h:mm:ss a' ) } </figcaption>
672675 </figure>
673676 ` ) ;
@@ -676,7 +679,7 @@ class Monogatari {
676679 <figure data-save='${ slot } ' class='row__column row_column--6 row__column--tablet--4 row__column--desktop--3 row__column--desktop-large--2'>
677680 <button class='fas fa-times' data-delete='${ slot } '></button>
678681 <small class='badge'>${ name } </small>
679- <img src='assets/ scenes/${ image } ' alt=''>
682+ <img src=" ${ Monogatari . setting ( 'AssetsPath' ) . root } / ${ Monogatari . setting ( 'AssetsPath' ) . scenes } /${ image } " alt=''>
680683 <figcaption>${ moment ( data . date ) . format ( 'MMMM Do YYYY, h:mm:ss a' ) } </figcaption>
681684 </figure>
682685 ` ) ;
@@ -721,7 +724,7 @@ class Monogatari {
721724 <figure data-load-slot='${ slot } ' class='row__column row_column--6 row__column--tablet--4 row__column--desktop--3 row__column--desktop-large--2 animated flipInX'>
722725 <button class='fas fa-times' data-delete="${ Monogatari . setting ( 'AutoSaveLabel' ) } _${ i } "></button>
723726 <small class='badge'>${ name } </small>
724- <img src='assets/ scenes/${ image } ' alt=''>
727+ <img src=" ${ Monogatari . setting ( 'AssetsPath' ) . root } / ${ Monogatari . setting ( 'AssetsPath' ) . scenes } /${ image } " alt=''>
725728 <figcaption>${ moment ( data . date ) . format ( 'MMMM Do YYYY, h:mm:ss a' ) } </figcaption>
726729 </figure>
727730 ` ) ;
@@ -1498,6 +1501,9 @@ Monogatari._assets = {
14981501 scenes : { }
14991502} ;
15001503
1504+ // These are the default settings and they are overwritten by the user's settings
1505+ // New elements here will no conflict with the user's settings and allows a better
1506+ // update experience
15011507Monogatari . _settings = {
15021508
15031509 // Initial Label *
@@ -1556,7 +1562,23 @@ Monogatari._settings = {
15561562 // If this value is set to 0, no skipping will be allowed but if it's set
15571563 // to a higher number, skipping will be allowed and that value will be taken
15581564 // as the speed in milliseconds with which the game will skip through the script
1559- 'Skip' : 0
1565+ 'Skip' : 0 ,
1566+
1567+ // Define the directories where the assets are located. The root directory is
1568+ // the holder for the other asset specific directories, this directories are
1569+ // used when retrieving the files on the game.
1570+ 'AssetsPath' : {
1571+ 'root' : 'assets' ,
1572+ 'characters' : 'characters' ,
1573+ 'icons' : 'icons' ,
1574+ 'images' : 'images' ,
1575+ 'music' : 'music' ,
1576+ 'scenes' : 'scenes' ,
1577+ 'sound' : 'sound' ,
1578+ 'ui' : 'ui' ,
1579+ 'video' : 'video' ,
1580+ 'voice' : 'voice'
1581+ }
15601582} ;
15611583
15621584Monogatari . _preferences = {
0 commit comments