Refactoring: extract base resources directory
This commit is contained in:
parent
a6df137a06
commit
fdf3012ade
@ -1,3 +1,6 @@
|
|||||||
|
var baseResDir = 'file:///E:/everlastingsummer/';
|
||||||
|
//var baseResDir = '/resources/es/';
|
||||||
|
|
||||||
function FadeInfo() {
|
function FadeInfo() {
|
||||||
this.fadeIn = false;
|
this.fadeIn = false;
|
||||||
this.fadeOut = false;
|
this.fadeOut = false;
|
||||||
@ -49,25 +52,23 @@ function toColor(num) {
|
|||||||
|
|
||||||
var PathResolver = new function () {
|
var PathResolver = new function () {
|
||||||
this.background = function (type, name) {
|
this.background = function (type, name) {
|
||||||
return "file:///E:/everlastingsummer/" + type.toLowerCase() + "/" + name + ".jpg";
|
return baseResDir + type.toLowerCase() + "/" + name + ".jpg";
|
||||||
};
|
};
|
||||||
this.sprite = function (whoid, params) {
|
this.sprite = function (whoid, params) {
|
||||||
var path = "file:///E:/everlastingsummer/sprites/";
|
var path = baseResDir + "sprites/";
|
||||||
path += whoid.toLowerCase() + "/";
|
path += whoid.toLowerCase() + "/";
|
||||||
path += (TextUtils.isEmpty(params) ? "normal" : params);
|
path += (TextUtils.isEmpty(params) ? "normal" : params);
|
||||||
path += ".png";
|
path += ".png";
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
this.music = function (name) {
|
this.music = function (name) {
|
||||||
// return "resources/music/" + name + ".ogg";
|
return baseResDir + "music/" + name + ".ogg";
|
||||||
return "file:///E:/everlastingsummer/music/" + name + ".ogg";
|
|
||||||
};
|
};
|
||||||
this.sound = function (name) {
|
this.sound = function (name) {
|
||||||
var path = "file:///E:/everlastingsummer/sfx/";
|
var path = baseResDir + "sfx/";
|
||||||
if (path.startsWith("sfx_")) path += name.substring(4);
|
if (path.startsWith("sfx_")) path += name.substring(4);
|
||||||
else path += name;
|
else path += name;
|
||||||
path += ".ogg";
|
path += ".ogg";
|
||||||
return path;
|
return path;
|
||||||
// return "resources/music/" + name + ".ogg";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user