var _crossengine_game_sys_init = Game_System.prototype.initialize
Game_System.prototype.initialize = function() {
_crossengine_game_sys_init.call(this);
//create a list of image files in our character directory.
// This is necessary for the automatic pose recognition
// so for example you can have $Character(f6).png and $Character(f6)_idle(f3).png
// and the default pose code to apply _idle will detect the right character name
//
this.crossEngine={};
//var fs = require ("fs");
//yanfly's doodads have a solution for path name changing when deployed
//which I am using!
//var path = require('path');
//var base = path.dirname(process.mainModule.filename);
//let dir = fs.readdirSync( './img/characters/' );
//let dir = fs.readdirSync( path.join(base, '/img/characters/'));
//MODIFY THIS
let dir = ["!Chest.png", "!Crystal.png", "!Door2.png", "!Flame.png", "!Other1.png", "!Other2.png", "!Switch1.png", "!Switch2.png", "$!JitterTest(f1).png", "$Area01.png", "$bigBullet(f1)(d1).png", "$Bulletin01.png", "$B_ChargedShot(f12)(s4)(y-8)(d-1).png", "$E_Angel(d1)(f1)(y124).png", "$E_Angel(f1)(y124).png", "$E_Angel(f1).png", "$E_Angel(f1)_act01.png", "$E_Angel(f1)_casting.png", "$E_Angel(f1)_damage.png", "$E_Bat.png", "$E_Bat_act01.png", "$E_Bat_attacking.png", "$E_Bat_casting.png", "$E_Bat_damage.png", "$E_Behemoth(f1).png", "$E_Behemoth(f1)_act01.png", "$E_Behemoth(f1)_damage.png", "$E_BehemothG(f1).png", "$E_BehemothG(f1)_act01.png", "$E_FireSpirit(f1).png", "$E_FireSpirit(f1)_act01.png", "$E_FireSpirit(f1)_damage.png", "$E_Ghost.png", "$E_Ghost_act01.png", "$E_Ghost_attacking.png", "$E_Ghost_casting.png", "$E_Ghost_damage.png", "$E_Imp.png", "$E_Imp_act01.png", "$E_Imp_attacking.png", "$E_Imp_casting.png", "$E_Imp_damage.png", "$E_Imp_melee.png", "$E_Minotaur.png", "$E_Minotaur_damage(d1)(f3)(s1).png", "$E_Slime.png", "$E_Slime_act.png", "$E_Slime_act01.png", "$E_Slime_attacking.png", "$E_Slime_casting.png", "$E_Slime_damage.png", "$E_Succubus(f1).png", "$E_Succubus(f1)_act01.png", "$E_Succubus(f1)_casting.png", "$E_Succubus(f1)_damage.png", "$E_Werewolf(f1)(d2).png", "$E_Werewolf(f1).png", "$E_Willowisp(f1).png", "$E_Willowisp(f1)_act01.png", "$E_Willowisp(f1)_attacking.png", "$E_Willowisp(f1)_damage.png", "$Hero01.png", "$Hero01_act01.png", "$Hero01_act02.png", "$Hero01_bow01(f3)(s1).png", "$Hero01_bow02(f3)(s1).png", "$Hero01_cast01.png", "$Hero01_casting.png", "$Hero01_damage.png", "$Hero01_dash.png", "$Hero01_idle.png", "$Hero01_jump.png", "$Hero01_pick.png", "$Hero01_shd01.png", "$Hero01_swd01(f3)(y16)(s1).png", "$Hero01_swd02(f3)(y16)(s3).png", "$Hero01_sword01.png", "$Hero01_victory.png", "$Hero02.png", "$Hero02_act01.png", "$Hero02_act02(Y30).png", "$Hero02_bow01(F3)(S1).png", "$Hero02_cast01.png", "$Hero02_casting.png", "$Hero02_damage.png", "$Hero02_dash.png", "$Hero02_idle.png", "$Hero02_jump.png", "$Hero02_pick.png", "$Hero02_shd01.png", "$Hero02_spear01(f3)(y30)(s1).png", "$Hero02_victory.png", "$Hero03.png", "$Hero03_act01.png", "$Hero03_act02.png", "$Hero03_bow01(f3)(s1).png", "$Hero03_cast01.png", "$Hero03_casting.png", "$Hero03_damage.png", "$Hero03_dash.png", "$Hero03_idle.png", "$Hero03_jump.png", "$Hero03_pick.png", "$Hero03_victory.png", "$Hero01_standing.png"];
this.crossEngine.characterNameList = dir.filter( elm => elm.match(new RegExp(`.*\.(png)`, 'ig')));
this.crossEngine.characterNameListLC=['hello world'];//this should never appear in game.
//slice off the .png extension
for (var index =0; index<this.crossEngine.characterNameList.length;index++)
{
this.crossEngine.characterNameList[index]=this.crossEngine.characterNameList[index].slice(0, -4);
//create a lower case version of it so that we can do case matching for poses
this.crossEngine.characterNameListLC[index]=this.crossEngine.characterNameList[index].toLowerCase();
}
};