2022-04-14 18:22:00 +08:00
|
|
|
//var AppPath = "file:///home/notify/develop/FreeKill";
|
2022-03-23 19:40:28 +08:00
|
|
|
var PHOTO_BACK_DIR = AppPath + "/image/photo/back/";
|
|
|
|
var PHOTO_DIR = AppPath + "/image/photo/";
|
|
|
|
var GENERAL_DIR = AppPath + "/image/generals/";
|
2022-05-01 18:37:13 +08:00
|
|
|
var GENERALCARD_DIR = AppPath + "/image/card/general/";
|
2022-03-23 19:40:28 +08:00
|
|
|
var STATE_DIR = AppPath + "/image/photo/state/";
|
2022-04-14 18:22:00 +08:00
|
|
|
var STATUS_DIR = AppPath + "/image/photo/status/";
|
2022-03-23 19:40:28 +08:00
|
|
|
var ROLE_DIR = AppPath + "/image/photo/role/";
|
|
|
|
var DEATH_DIR = AppPath + "/image/photo/death/";
|
|
|
|
var MAGATAMA_DIR = AppPath + "/image/photo/magatama/";
|
|
|
|
var CARD_DIR = AppPath + "/image/card/";
|
|
|
|
var CARD_SUIT_DIR = AppPath + "/image/card/suit/";
|
2022-04-14 18:22:00 +08:00
|
|
|
var DELAYED_TRICK_DIR = AppPath + "/image/card/delayedTrick/";
|
|
|
|
var EQUIP_ICON_DIR = AppPath + "/image/card/equipIcon/";
|
|
|
|
var PIXANIM_DIR = AppPath + "/image/anim/"
|
2023-01-12 22:53:22 +08:00
|
|
|
var TILE_ICON_DIR = AppPath + "/image/button/tileicon/"
|
2023-02-15 19:54:35 +08:00
|
|
|
|
|
|
|
function getGeneralPicture(name) {
|
|
|
|
let data = JSON.parse(Backend.callLuaFunction("GetGeneralData", [name]));
|
|
|
|
let extension = data.extension;
|
|
|
|
let path = AppPath + "/packages/" + extension + "/image/generals/" + name + ".jpg";
|
|
|
|
if (Backend.exists(path)) {
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
return GENERAL_DIR + "0.jpg";
|
|
|
|
}
|
|
|
|
|
|
|
|
function getCardPicture(cid) {
|
|
|
|
let data = JSON.parse(Backend.callLuaFunction("GetCardData", [cid]));
|
|
|
|
let extension = data.extension;
|
|
|
|
let name = data.name;
|
|
|
|
let path = AppPath + "/packages/" + extension + "/image/card/" + name + ".png";
|
|
|
|
if (Backend.exists(path)) {
|
|
|
|
return path;
|
2023-03-09 12:19:16 +08:00
|
|
|
} else {
|
|
|
|
for (let dir of Backend.ls(AppPath + "/packages/")) {
|
|
|
|
path = AppPath + "/packages/" + dir + "/image/card/" + name + ".png";
|
|
|
|
if (Backend.exists(path)) return path;
|
|
|
|
}
|
2023-02-15 19:54:35 +08:00
|
|
|
}
|
|
|
|
return CARD_DIR + "unknown.png";
|
|
|
|
}
|