Finish migrating the appearance configuration menu.
This commit is contained in:
parent
47a1531291
commit
7bb8ba9a8e
|
@ -1,9 +1,55 @@
|
|||
import { ANIMATION } from "./configuration/animation.js";
|
||||
import { AUTOMATIC_BORDER_COUNT } from "./configuration/automatic-border-count.js";
|
||||
import { AUTOMATIC_BORDER_START } from "./configuration/automatic-border-start.js";
|
||||
import { BLUR_UI } from "./configuration/blur-ui.js";
|
||||
import { BORDER_STYLE } from "./configuration/border-style.js";
|
||||
import { BUTTON_CHARACTER_PREFIX } from "./configuration/button-character-prefix.js";
|
||||
import { BUTTON_CHARACTER_STYLE } from "./configuration/button-character-style.js";
|
||||
import { BUTTON_PRESS } from "./configuration/button-press.js";
|
||||
import { CARD_BACK_STYLE } from "./configuration/card-back-style.js";
|
||||
import { CARD_SHAPE } from "./configuration/card-shape.js";
|
||||
import { CARD_STYLE } from "./configuration/card-style.js";
|
||||
import { CARD_TEMPORARY_NAME } from "./configuration/card-temporary-name.js";
|
||||
import { CARD_TEXT_FONT } from "./configuration/card-text-font.js";
|
||||
import { CHANGE_SKIN_AUTOMATICALLY } from "./configuration/change-skin-automatically.js";
|
||||
import { CHANGE_SKIN } from "./configuration/change-skin.js";
|
||||
import { CONTROL_STYLE } from "./configuration/control-style.js";
|
||||
import { CURSOR_STYLE } from "./configuration/cursor-style.js";
|
||||
import { CUSTOM_BUTTON_CONTROL_BOTTOM } from "./configuration/custom-button-control-bottom.js";
|
||||
import { CUSTOM_BUTTON_CONTROL_TOP } from "./configuration/custom-button-control-top.js";
|
||||
import { CUSTOM_BUTTON_SYSTEM_BOTTOM } from "./configuration/custom-button-system-bottom.js";
|
||||
import { CUSTOM_BUTTON_SYSTEM_TOP } from "./configuration/custom-button-system-top.js";
|
||||
import { CUSTOM_BUTTON } from "./configuration/custom-button.js";
|
||||
import { DAMAGE_SHAKE } from "./configuration/damage-shake.js";
|
||||
import { DIE_MOVE } from "./configuration/die-move.js";
|
||||
import { FOLD_CARD } from "./configuration/fold-card.js";
|
||||
import { FOLD_MODE } from "./configuration/fold-mode.js";
|
||||
import { GLASS_UI } from "./configuration/glass-ui.js";
|
||||
import { GLOBAL_FONT } from "./configuration/global-font.js";
|
||||
import { GLOW_PHASE } from "./configuration/glow-phase.js";
|
||||
import { HP_STYLE } from "./configuration/hp-style.js";
|
||||
import { IDENTITY_FONT } from "./configuration/identity-font.js";
|
||||
import { IMAGE_BACKGROUND_BLUR } from "./configuration/image-background-blur.js";
|
||||
import { IMAGE_BACKGROUND_RANDOM } from "./configuration/image-background-random.js";
|
||||
import { IMAGE_BACKGROUND } from "./configuration/image-background.js";
|
||||
import { JIU_EFFECT } from "./configuration/jiu-effect.js";
|
||||
import { LAYOUT } from "./configuration/layout.js";
|
||||
import { LINK_STYLE_2 } from "./configuration/link-style-2.js";
|
||||
import { MENU_STYLE } from "./configuration/menu-style.js";
|
||||
import { NAME_FONT } from "./configuration/name-font.js";
|
||||
import { PHONE_LAYOUT } from "./configuration/phone-layout.js";
|
||||
import { PLAYER_BORDER } from "./configuration/player-border.js";
|
||||
import { PLAYER_HEIGHT_NOVA } from "./configuration/player-height-nova.js";
|
||||
import { PLAYER_HEIGHT } from "./configuration/player-height.js";
|
||||
import { PLAYER_STYLE } from "./configuration/player-style.js";
|
||||
import { RADIUS_SIZE } from "./configuration/radius-size.js";
|
||||
import { SEPARATE_CONTROL } from "./configuration/separate-control.js";
|
||||
import { SKILL_ANIMATION_TYPE } from "./configuration/skill-animation-type.js";
|
||||
import { SPLASH_STYLE } from "./configuration/splash-style.js";
|
||||
import { SUITS_FONT } from "./configuration/suits-font.js";
|
||||
import { TARGET_SHAKE } from "./configuration/target-shake.js";
|
||||
import { THEME } from "./configuration/theme.js";
|
||||
import { TURNED_STYLE } from "./configuration/turned-style.js";
|
||||
import { UI_ZOOM } from "./configuration/ui-zoom.js";
|
||||
|
||||
export const CONFIGURATION = {
|
||||
|
@ -13,5 +59,129 @@ export const CONFIGURATION = {
|
|||
player_height: PLAYER_HEIGHT,
|
||||
player_height_nova: PLAYER_HEIGHT_NOVA,
|
||||
ui_zoom: UI_ZOOM,
|
||||
image_background: IMAGE_BACKGROUND
|
||||
image_background: IMAGE_BACKGROUND,
|
||||
image_background_random: IMAGE_BACKGROUND_RANDOM,
|
||||
image_background_blur: IMAGE_BACKGROUND_BLUR,
|
||||
phonelayout: PHONE_LAYOUT,
|
||||
change_skin: CHANGE_SKIN,
|
||||
change_skin_auto: CHANGE_SKIN_AUTOMATICALLY,
|
||||
card_style: CARD_STYLE,
|
||||
cardback_style: CARD_BACK_STYLE,
|
||||
hp_style: HP_STYLE,
|
||||
player_style: PLAYER_STYLE,
|
||||
border_style: BORDER_STYLE,
|
||||
autoborder_count: AUTOMATIC_BORDER_COUNT,
|
||||
autoborder_start: AUTOMATIC_BORDER_START,
|
||||
player_border: PLAYER_BORDER,
|
||||
menu_style: MENU_STYLE,
|
||||
control_style: CONTROL_STYLE,
|
||||
custom_button: CUSTOM_BUTTON,
|
||||
custom_button_system_top: CUSTOM_BUTTON_SYSTEM_TOP,
|
||||
custom_button_system_bottom: CUSTOM_BUTTON_SYSTEM_BOTTOM,
|
||||
custom_button_control_top: CUSTOM_BUTTON_CONTROL_TOP,
|
||||
custom_button_control_bottom: CUSTOM_BUTTON_CONTROL_BOTTOM,
|
||||
radius_size: RADIUS_SIZE,
|
||||
glow_phase: GLOW_PHASE,
|
||||
fold_card: FOLD_CARD,
|
||||
fold_mode: FOLD_MODE,
|
||||
seperate_control: SEPARATE_CONTROL,
|
||||
blur_ui: BLUR_UI,
|
||||
glass_ui: GLASS_UI,
|
||||
damage_shake: DAMAGE_SHAKE,
|
||||
button_press: BUTTON_PRESS,
|
||||
jiu_effect: JIU_EFFECT,
|
||||
animation: ANIMATION,
|
||||
skill_animation_type: SKILL_ANIMATION_TYPE,
|
||||
die_move: DIE_MOVE,
|
||||
target_shake: TARGET_SHAKE,
|
||||
turned_style: TURNED_STYLE,
|
||||
link_style2: LINK_STYLE_2,
|
||||
cardshape: CARD_SHAPE,
|
||||
cardtempname: CARD_TEMPORARY_NAME,
|
||||
buttoncharacter_style: BUTTON_CHARACTER_STYLE,
|
||||
buttoncharacter_prefix: BUTTON_CHARACTER_PREFIX,
|
||||
cursor_style: CURSOR_STYLE,
|
||||
name_font: NAME_FONT,
|
||||
identity_font: IDENTITY_FONT,
|
||||
cardtext_font: CARD_TEXT_FONT,
|
||||
global_font: GLOBAL_FONT,
|
||||
suits_font: SUITS_FONT,
|
||||
update(config, map) {
|
||||
if (config.custom_button) {
|
||||
map.custom_button_system_top.show();
|
||||
map.custom_button_system_bottom.show();
|
||||
map.custom_button_control_top.show();
|
||||
map.custom_button_control_bottom.show();
|
||||
}
|
||||
else {
|
||||
map.custom_button_system_top.hide();
|
||||
map.custom_button_system_bottom.hide();
|
||||
map.custom_button_control_top.hide();
|
||||
map.custom_button_control_bottom.hide();
|
||||
}
|
||||
if (config.change_skin) {
|
||||
map.change_skin_auto.show();
|
||||
}
|
||||
else {
|
||||
map.change_skin_auto.hide();
|
||||
}
|
||||
if (config.image_background_random) {
|
||||
map.image_background_blur.show();
|
||||
map.image_background.hide();
|
||||
}
|
||||
else {
|
||||
map.image_background.show();
|
||||
if (config.image_background == "default") {
|
||||
map.image_background_blur.hide();
|
||||
}
|
||||
else {
|
||||
map.image_background_blur.show();
|
||||
}
|
||||
}
|
||||
if (config.layout == "long" || config.layout == "mobile") {
|
||||
map.cardshape.show();
|
||||
map.phonelayout.show();
|
||||
}
|
||||
else {
|
||||
if (config.layout == "long2" || config.layout == "nova") {
|
||||
map.phonelayout.show();
|
||||
map.cardshape.show();
|
||||
}
|
||||
else {
|
||||
map.phonelayout.hide();
|
||||
map.cardshape.hide();
|
||||
}
|
||||
}
|
||||
if (config.layout == "long") {
|
||||
map.player_height.show();
|
||||
}
|
||||
else {
|
||||
if (config.layout == "long2") {
|
||||
map.player_height.show();
|
||||
}
|
||||
else {
|
||||
map.player_height.hide();
|
||||
}
|
||||
}
|
||||
if (config.layout == "nova") {
|
||||
map.player_height_nova.show();
|
||||
}
|
||||
else {
|
||||
map.player_height_nova.hide();
|
||||
}
|
||||
if (config.touchscreen) {
|
||||
map.cursor_style.hide();
|
||||
}
|
||||
else {
|
||||
map.cursor_style.show();
|
||||
}
|
||||
if (config.border_style == "auto") {
|
||||
map.autoborder_count.show();
|
||||
map.autoborder_start.show();
|
||||
}
|
||||
else {
|
||||
map.autoborder_count.hide();
|
||||
map.autoborder_start.hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
export const ANIMATION = {
|
||||
name: "游戏特效",
|
||||
intro: "开启后出现属性伤害、回复体力等情况时会显示动画",
|
||||
init: false,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,20 @@
|
|||
import { ITEM } from "./automatic-border-count/item.js";
|
||||
|
||||
const introduction = document.createElement("body");
|
||||
const kill = document.createElement("strong");
|
||||
kill.textContent = "击杀";
|
||||
introduction.append(kill, " 每击杀一人,边框提升两级", document.createElement("br"));
|
||||
const damage = document.createElement("strong");
|
||||
damage.textContent = "伤害";
|
||||
introduction.append(damage, " 每造成两点伤害,边框提升一级", document.createElement("br"));
|
||||
const mix = document.createElement("strong");
|
||||
mix.textContent = "混合";
|
||||
introduction.append(mix, " 击杀量决定边框颜色,伤害量决定边框装饰");
|
||||
|
||||
export const AUTOMATIC_BORDER_COUNT = {
|
||||
name: "边框升级方式",
|
||||
intro: introduction.innerHTML,
|
||||
init: "kill",
|
||||
item: ITEM,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const ITEM = {
|
||||
kill: "击杀",
|
||||
damage: "伤害",
|
||||
mix: "混合"
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
import { ITEM } from "./automatic-border-start/item.js";
|
||||
|
||||
export const AUTOMATIC_BORDER_START = {
|
||||
name: "基础边框颜色",
|
||||
init: "bronze",
|
||||
item: ITEM,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const ITEM = {
|
||||
bronze: "铜",
|
||||
silver: "银",
|
||||
gold: "金"
|
||||
};
|
|
@ -0,0 +1,15 @@
|
|||
export const BLUR_UI = {
|
||||
name: "模糊效果",
|
||||
intro: "在暂停或打开菜单时开启模糊效果",
|
||||
init: false,
|
||||
unfrequent: true,
|
||||
onclick(bool) {
|
||||
game.saveConfig("blur_ui", bool);
|
||||
if (bool) {
|
||||
ui.window.classList.add("blur_ui");
|
||||
}
|
||||
else {
|
||||
ui.window.classList.remove("blur_ui");
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,125 @@
|
|||
import { ITEM } from "./border-style/item.js";
|
||||
|
||||
export const BORDER_STYLE = {
|
||||
name: "角色边框",
|
||||
init: "default",
|
||||
intro: "设置角色边框的样式,当设为自动时,样式将随着一局游戏中伤害或击杀的数量自动改变",
|
||||
item: ITEM,
|
||||
visualBar(node, item, create, switcher) {
|
||||
if (node.created) {
|
||||
return;
|
||||
}
|
||||
var button;
|
||||
for (var i = 0; i < node.parentNode.childElementCount; i++) {
|
||||
if (node.parentNode.childNodes[i]._link == "custom") {
|
||||
button = node.parentNode.childNodes[i];
|
||||
}
|
||||
}
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
node.created = true;
|
||||
var deletepic;
|
||||
ui.create.filediv(".menubutton", "添加图片", node, function (file) {
|
||||
if (file) {
|
||||
game.putDB("image", "border_style", file, function () {
|
||||
game.getDB("image", "border_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
button.style.backgroundImage = "url(" + data + ")";
|
||||
button.className = "button character";
|
||||
button.style.backgroundSize = "100% 100%";
|
||||
node.classList.add("showdelete");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
});
|
||||
}
|
||||
}).inputNode.accept = "image/*";
|
||||
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
|
||||
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
|
||||
game.deleteDB("image", "border_style");
|
||||
button.style.backgroundImage = "none";
|
||||
button.className = "button character dashedmenubutton";
|
||||
node.classList.remove("showdelete");
|
||||
if (lib.config.border_style == "custom") {
|
||||
lib.configMenu.appearence.config.border_style.onclick("default");
|
||||
switcher.lastChild.innerHTML = "默认";
|
||||
}
|
||||
button.classList.add("transparent");
|
||||
}
|
||||
});
|
||||
},
|
||||
visualMenu(node, link, name, config) {
|
||||
node.className = "button character";
|
||||
node.style.backgroundSize = "";
|
||||
node.style.height = "108px";
|
||||
node.dataset.decoration = "";
|
||||
if (link == "default" || link == "custom" || link == "auto") {
|
||||
node.style.backgroundImage = "none";
|
||||
node.className = "button character dashedmenubutton";
|
||||
}
|
||||
else {
|
||||
if (link.startsWith("dragon_")) {
|
||||
link = link.slice(7);
|
||||
node.dataset.decoration = link;
|
||||
}
|
||||
node.setBackgroundImage("theme/style/player/" + link + "1.png");
|
||||
node.style.backgroundSize = "100% 100%";
|
||||
}
|
||||
if (link == "custom") {
|
||||
node.classList.add("transparent");
|
||||
game.getDB("image", "border_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
node.style.backgroundImage = "url(" + data + ")";
|
||||
node.className = "button character";
|
||||
node.parentNode.lastChild.classList.add("showdelete");
|
||||
node.style.backgroundSize = "100% 100%";
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
onclick(layout) {
|
||||
game.saveConfig("border_style", layout);
|
||||
if (ui.css.border_stylesheet) {
|
||||
ui.css.border_stylesheet.remove();
|
||||
delete ui.css.border_stylesheet;
|
||||
}
|
||||
if (layout == "custom") {
|
||||
game.getDB("image", "border_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.border_stylesheet) {
|
||||
ui.css.border_stylesheet.remove();
|
||||
}
|
||||
ui.css.border_stylesheet = lib.init.sheet();
|
||||
ui.css.border_stylesheet.id = "ui.css.border";
|
||||
ui.css.border_stylesheet.sheet.insertRule(`#window .player>.framebg{display:block;background-image:url("${fileLoadedEvent.target.result}")}`, 0);
|
||||
ui.css.border_stylesheet.sheet.insertRule(".player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}", 0);
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
else if (layout != "default" && layout != "auto") {
|
||||
ui.css.border_stylesheet = lib.init.sheet();
|
||||
if (layout.startsWith("dragon_")) {
|
||||
layout = layout.slice(7);
|
||||
ui.arena.dataset.framedecoration = layout;
|
||||
}
|
||||
else {
|
||||
ui.arena.dataset.framedecoration = "";
|
||||
}
|
||||
ui.css.border_stylesheet.sheet.insertRule(`#window .player>.framebg,#window #arena.long.mobile:not(.fewplayer) .player[data-position="0"]>.framebg{display:block;background-image:url("${lib.assetURL}theme/style/player/${layout}1.png")}`, 0);
|
||||
ui.css.border_stylesheet.sheet.insertRule(`#window #arena.long:not(.fewplayer) .player>.framebg, #arena.oldlayout .player>.framebg{background-image:url("${lib.assetURL}theme/style/player/${layout}3.png")}`, 0);
|
||||
ui.css.border_stylesheet.sheet.insertRule(".player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}", 0);
|
||||
}
|
||||
},
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
export const ITEM = {
|
||||
gold: "金框",
|
||||
silver: "银框",
|
||||
bronze: "铜框",
|
||||
dragon_gold: "金龙",
|
||||
dragon_silver: "银龙",
|
||||
dragon_bronze: "玉龙",
|
||||
custom: "自定",
|
||||
auto: "自动",
|
||||
default: "默认"
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
import { ITEM } from "./button-character-prefix/item.js";
|
||||
|
||||
export const BUTTON_CHARACTER_PREFIX = {
|
||||
name: "武将前缀",
|
||||
init: "default",
|
||||
item: ITEM,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const ITEM = {
|
||||
default: "默认",
|
||||
simple: "不显示颜色",
|
||||
off: "不显示前缀"
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
import { ITEM } from "./button-character-style/item.js";
|
||||
|
||||
export const BUTTON_CHARACTER_STYLE = {
|
||||
name: "选将样式",
|
||||
init: "default",
|
||||
item: ITEM,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const ITEM = {
|
||||
default: "默认",
|
||||
simple: "精简",
|
||||
old: "旧版"
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
export const BUTTON_PRESS = {
|
||||
name: "按钮效果",
|
||||
intro: "选项条被按下时将有按下效果",
|
||||
init: true,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,138 @@
|
|||
import { ITEM } from "./card-back-style/item.js";
|
||||
|
||||
export const CARD_BACK_STYLE = {
|
||||
name: "卡背样式",
|
||||
intro: "设置背面朝上的卡牌的样式",
|
||||
init: "default",
|
||||
item: ITEM,
|
||||
visualBar(node, item, create, switcher) {
|
||||
if (node.created) {
|
||||
return;
|
||||
}
|
||||
var button;
|
||||
for (var i = 0; i < node.parentNode.childElementCount; i++) {
|
||||
if (node.parentNode.childNodes[i]._link == "custom") {
|
||||
button = node.parentNode.childNodes[i];
|
||||
}
|
||||
}
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
node.created = true;
|
||||
var deletepic;
|
||||
ui.create.filediv(".menubutton", "添加图片", node, function (file) {
|
||||
if (file) {
|
||||
game.putDB("image", "cardback_style", file, function () {
|
||||
game.getDB("image", "cardback_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
button.style.backgroundImage = "url(" + data + ")";
|
||||
button.className = "button character";
|
||||
node.classList.add("showdelete");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
});
|
||||
}
|
||||
}).inputNode.accept = "image/*";
|
||||
ui.create.filediv(".menubutton.deletebutton.addbutton", "添加翻转图片", node, function (file) {
|
||||
if (file) {
|
||||
game.putDB("image", "cardback_style2", file, function () {
|
||||
node.classList.add("hideadd");
|
||||
});
|
||||
}
|
||||
}).inputNode.accept = "image/*";
|
||||
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
|
||||
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
|
||||
game.deleteDB("image", "cardback_style");
|
||||
game.deleteDB("image", "cardback_style2");
|
||||
button.style.backgroundImage = "none";
|
||||
button.className = "button character dashedmenubutton";
|
||||
node.classList.remove("showdelete");
|
||||
node.classList.remove("hideadd");
|
||||
if (lib.config.cardback_style == "custom") {
|
||||
lib.configMenu.appearence.config.cardback_style.onclick("default");
|
||||
switcher.lastChild.innerHTML = "默认";
|
||||
}
|
||||
button.classList.add("transparent");
|
||||
}
|
||||
});
|
||||
},
|
||||
visualMenu(node, link, name, config) {
|
||||
node.style.backgroundSize = "100% 100%";
|
||||
switch (link) {
|
||||
case "default": case "custom": {
|
||||
node.style.backgroundImage = "none";
|
||||
node.className = "button character dashedmenubutton";
|
||||
break;
|
||||
}
|
||||
case "new": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/new.png"); break;
|
||||
case "feicheng": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/feicheng.png"); break;
|
||||
case "official": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/official.png"); break;
|
||||
case "liusha": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/liusha.png"); break;
|
||||
case "ol": node.className = "button character"; node.setBackgroundImage("theme/style/cardback/image/ol.png"); break;
|
||||
case "wood": node.className = "button card fullskin"; node.setBackgroundImage("theme/woodden/wood.jpg"); node.style.backgroundSize = "initial"; break;
|
||||
case "music": node.className = "button card fullskin"; node.setBackgroundImage("theme/music/wood3.png"); break;
|
||||
}
|
||||
if (link == "custom") {
|
||||
node.classList.add("transparent");
|
||||
game.getDB("image", "cardback_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
node.style.backgroundImage = "url(" + data + ")";
|
||||
node.className = "button character";
|
||||
node.parentNode.lastChild.classList.add("showdelete");
|
||||
game.getDB("image", "cardback_style2", function (file) {
|
||||
if (file) {
|
||||
node.parentNode.lastChild.classList.add("hideadd");
|
||||
}
|
||||
});
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
onclick(layout) {
|
||||
game.saveConfig("cardback_style", layout);
|
||||
var style = ui.css.cardback_style;
|
||||
ui.css.cardback_style = lib.init.css(lib.assetURL + "theme/style/cardback", lib.config.cardback_style);
|
||||
style.remove();
|
||||
if (ui.css.cardback_stylesheet) {
|
||||
ui.css.cardback_stylesheet.remove();
|
||||
delete ui.css.cardback_stylesheet;
|
||||
}
|
||||
if (ui.css.cardback_stylesheet2) {
|
||||
ui.css.cardback_stylesheet2.remove();
|
||||
delete ui.css.cardback_stylesheet2;
|
||||
}
|
||||
if (layout == "custom") {
|
||||
game.getDB("image", "cardback_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.cardback_stylesheet) {
|
||||
ui.css.cardback_stylesheet.remove();
|
||||
}
|
||||
ui.css.cardback_stylesheet = lib.init.sheet(".card:empty,.card.infohidden{background-image:url(" + fileLoadedEvent.target.result + ")}");
|
||||
game.getDB("image", "cardback_style2", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.cardback_stylesheet2) {
|
||||
ui.css.cardback_stylesheet2.remove();
|
||||
}
|
||||
ui.css.cardback_stylesheet2 = lib.init.sheet(".card.infohidden:not(.infoflip){background-image:url(" + fileLoadedEvent.target.result + ")}");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
export const ITEM = {
|
||||
official: "原版",
|
||||
feicheng: "废城",
|
||||
liusha: "流沙",
|
||||
ol: "手杀",
|
||||
custom: "自定",
|
||||
default: "默认"
|
||||
};
|
|
@ -0,0 +1,34 @@
|
|||
import { ITEM } from "./card-shape/item.js";
|
||||
|
||||
export const CARD_SHAPE = {
|
||||
name: "手牌显示",
|
||||
intro: "将手牌设置为正方形或长方形",
|
||||
init: "default",
|
||||
unfrequent: true,
|
||||
item: ITEM,
|
||||
onclick(item) {
|
||||
var linked = false;
|
||||
if (game.me && game.me.isLinked()) {
|
||||
linked = true;
|
||||
}
|
||||
game.saveConfig("cardshape", item);
|
||||
if (item == "oblong" && (game.layout == "long" || game.layout == "mobile" || game.layout == "long2" || game.layout == "nova")) {
|
||||
ui.arena.classList.add("oblongcard");
|
||||
ui.window.classList.add("oblongcard");
|
||||
}
|
||||
else {
|
||||
ui.arena.classList.remove("oblongcard");
|
||||
ui.window.classList.remove("oblongcard");
|
||||
}
|
||||
if (linked) {
|
||||
if (get.is.linked2(game.me)) {
|
||||
game.me.classList.remove("linked");
|
||||
game.me.classList.add("linked2");
|
||||
}
|
||||
else {
|
||||
game.me.classList.add("linked");
|
||||
game.me.classList.remove("linked2");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,4 @@
|
|||
export const ITEM = {
|
||||
default: "默认",
|
||||
oblong: "长方"
|
||||
};
|
|
@ -0,0 +1,114 @@
|
|||
import { ITEM } from "./card-style/item.js";
|
||||
|
||||
export const CARD_STYLE = {
|
||||
name: "卡牌样式",
|
||||
init: "default",
|
||||
intro: "设置正面朝上的卡牌的样式",
|
||||
item: ITEM,
|
||||
visualBar(node, item, create, switcher) {
|
||||
if (node.created) {
|
||||
return;
|
||||
}
|
||||
var button;
|
||||
for (var i = 0; i < node.parentNode.childElementCount; i++) {
|
||||
if (node.parentNode.childNodes[i]._link == "custom") {
|
||||
button = node.parentNode.childNodes[i];
|
||||
}
|
||||
}
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
node.created = true;
|
||||
var deletepic;
|
||||
ui.create.filediv(".menubutton", "添加图片", node, function (file) {
|
||||
if (file) {
|
||||
game.putDB("image", "card_style", file, function () {
|
||||
game.getDB("image", "card_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
button.style.backgroundImage = "url(" + data + ")";
|
||||
button.className = "button card fullskin";
|
||||
node.classList.add("showdelete");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
});
|
||||
}
|
||||
}).inputNode.accept = "image*";
|
||||
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
|
||||
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
|
||||
game.deleteDB("image", "card_style");
|
||||
button.style.backgroundImage = "none";
|
||||
button.className = "button character dashedmenubutton";
|
||||
node.classList.remove("showdelete");
|
||||
if (lib.config.card_style == "custom") {
|
||||
lib.configMenu.appearence.config.card_style.onclick("default");
|
||||
switcher.lastChild.innerHTML = "默认";
|
||||
}
|
||||
button.classList.add("transparent");
|
||||
}
|
||||
});
|
||||
},
|
||||
visualMenu(node, link, name, config) {
|
||||
node.className = "button card fullskin";
|
||||
node.style.backgroundSize = "100% 100%";
|
||||
switch (link) {
|
||||
case "default": case "custom": {
|
||||
if (lib.config.theme == "simple") {
|
||||
node.style.backgroundImage = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))";
|
||||
node.className = "button character";
|
||||
}
|
||||
else {
|
||||
node.style.backgroundImage = "none";
|
||||
node.className = "button character dashedmenubutton";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "new": node.setBackgroundImage("theme/style/card/image/new.png"); break;
|
||||
case "ol": node.setBackgroundImage("theme/style/card/image/ol.png"); break;
|
||||
case "wood": node.setBackgroundImage("theme/woodden/wood.jpg"); node.style.backgroundSize = "initial"; break;
|
||||
case "music": node.setBackgroundImage("theme/music/wood3.png"); break;
|
||||
case "simple": node.setBackgroundImage("theme/simple/card.png"); break;
|
||||
}
|
||||
if (link == "custom") {
|
||||
node.classList.add("transparent");
|
||||
game.getDB("image", "card_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
node.style.backgroundImage = "url(" + data + ")";
|
||||
node.className = "button card fullskin";
|
||||
node.parentNode.lastChild.classList.add("showdelete");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
onclick(layout) {
|
||||
game.saveConfig("card_style", layout);
|
||||
var style = ui.css.card_style;
|
||||
ui.css.card_style = lib.init.css(lib.assetURL + "theme/style/card", lib.config.card_style);
|
||||
style.remove();
|
||||
if (ui.css.card_stylesheet) {
|
||||
ui.css.card_stylesheet.remove();
|
||||
delete ui.css.card_stylesheet;
|
||||
}
|
||||
if (layout == "custom") {
|
||||
game.getDB("image", "card_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.card_stylesheet) {
|
||||
ui.css.card_stylesheet.remove();
|
||||
}
|
||||
ui.css.card_stylesheet = lib.init.sheet(".card:not(*:empty){background-image:url(" + fileLoadedEvent.target.result + ")}");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
export const ITEM = {
|
||||
wood: "木纹",
|
||||
music: "音乐",
|
||||
simple: "原版",
|
||||
ol: "手杀",
|
||||
custom: "自定",
|
||||
default: "默认"
|
||||
};
|
|
@ -0,0 +1,28 @@
|
|||
import { ITEM } from "./card-temporary-name/item.js";
|
||||
|
||||
export const CARD_TEMPORARY_NAME = {
|
||||
name: "视为卡牌名称显示",
|
||||
intro: "显示强制视为类卡牌(如武魂),包括拆顺对话框内的判定牌(国色)转换等名称的显示方式",
|
||||
init: "image",
|
||||
unfrequent: true,
|
||||
item: ITEM,
|
||||
onclick(item) {
|
||||
game.saveConfig("cardtempname", item);
|
||||
if (!game.me || !game.me.getCards) return;
|
||||
var hs = game.me.getCards("h");
|
||||
for (var i = 0; i < hs.length; i++) {
|
||||
if (hs[i]._tempName) {
|
||||
switch (item) {
|
||||
case "default":
|
||||
case "horizon":
|
||||
case "image":
|
||||
ui.create.cardTempName(hs[i]);
|
||||
break;
|
||||
default:
|
||||
hs[i]._tempName.delete();
|
||||
delete hs[i]._tempName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
export const ITEM = {
|
||||
default: "纵向",
|
||||
horizon: "横向",
|
||||
image: "图片",
|
||||
off: "禁用"
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
import { ITEM } from "./card-text-font/item.js";
|
||||
|
||||
export const CARD_TEXT_FONT = {
|
||||
name: "卡牌字体",
|
||||
init: "default",
|
||||
unfrequent: true,
|
||||
item: ITEM,
|
||||
textMenu(node, link) {
|
||||
if (link != "default") {
|
||||
node.style.fontFamily = link;
|
||||
}
|
||||
node.style.fontSize = "20px";
|
||||
},
|
||||
onclick(font) {
|
||||
game.saveConfig("cardtext_font", font);
|
||||
lib.init.cssstyles();
|
||||
}
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
export const ITEM = {};
|
|
@ -0,0 +1,18 @@
|
|||
import { Game } from "../../../../game.js";
|
||||
import { status } from "../../../../status.js";
|
||||
import { Click } from "../../../../ui/click.js";
|
||||
import { ITEM } from "./change-skin-automatically/item.js";
|
||||
|
||||
export const CHANGE_SKIN_AUTOMATICALLY = {
|
||||
name: "自动换肤",
|
||||
init: "off",
|
||||
item: ITEM,
|
||||
intro: "游戏每进行一段时间自动为一个随机角色更换皮肤",
|
||||
onclick(item) {
|
||||
Game.saveConfig("change_skin_auto", item);
|
||||
clearTimeout(status.skintimeout);
|
||||
if (item != "off") {
|
||||
status.skintimeout = setTimeout(Click.autoskin, parseInt(item));
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
export const ITEM = {
|
||||
off: "关闭",
|
||||
"30000": "半分钟",
|
||||
"60000": "一分钟",
|
||||
"120000": "两分钟",
|
||||
"300000": "五分钟"
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const CHANGE_SKIN = {
|
||||
name: "开启换肤",
|
||||
init: true,
|
||||
intro: "在武将的右键菜单中换肤,皮肤可在选项-文件-图片文件-皮肤图片中添加"
|
||||
};
|
|
@ -0,0 +1,116 @@
|
|||
import { ITEM } from "./control-style/item.js";
|
||||
|
||||
export const CONTROL_STYLE = {
|
||||
name: "按钮背景",
|
||||
init: "default",
|
||||
item: ITEM,
|
||||
visualBar(node, item, create, switcher) {
|
||||
if (node.created) {
|
||||
return;
|
||||
}
|
||||
var button;
|
||||
for (var i = 0; i < node.parentNode.childElementCount; i++) {
|
||||
if (node.parentNode.childNodes[i]._link == "custom") {
|
||||
button = node.parentNode.childNodes[i];
|
||||
}
|
||||
}
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
node.created = true;
|
||||
var deletepic;
|
||||
ui.create.filediv(".menubutton", "添加图片", node, function (file) {
|
||||
if (file) {
|
||||
game.putDB("image", "control_style", file, function () {
|
||||
game.getDB("image", "control_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
button.style.backgroundImage = "url(" + data + ")";
|
||||
button.className = "button character controlbutton";
|
||||
node.classList.add("showdelete");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
});
|
||||
}
|
||||
}).inputNode.accept = "image/*";
|
||||
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
|
||||
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
|
||||
game.deleteDB("image", "control_style");
|
||||
button.style.backgroundImage = "none";
|
||||
button.className = "button character controlbutton dashedmenubutton";
|
||||
node.classList.remove("showdelete");
|
||||
if (lib.config.control_style == "custom") {
|
||||
lib.configMenu.appearence.config.control_style.onclick("default");
|
||||
switcher.lastChild.innerHTML = "默认";
|
||||
}
|
||||
button.classList.add("transparent");
|
||||
}
|
||||
});
|
||||
},
|
||||
visualMenu(node, link, name, config) {
|
||||
node.className = "button character controlbutton";
|
||||
node.style.backgroundSize = "";
|
||||
switch (link) {
|
||||
case "default": case "custom": {
|
||||
node.style.backgroundImage = "none";
|
||||
node.classList.add("dashedmenubutton");
|
||||
break;
|
||||
}
|
||||
case "wood": node.setBackgroundImage("theme/woodden/wood.jpg"); break;
|
||||
case "music": node.style.backgroundImage = "linear-gradient(#4b4b4b, #464646)"; break;
|
||||
case "simple": node.style.backgroundImage = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; break;
|
||||
}
|
||||
if (link == "custom") {
|
||||
node.classList.add("transparent");
|
||||
game.getDB("image", "control_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
node.style.backgroundImage = "url(" + data + ")";
|
||||
node.className = "button character controlbutton";
|
||||
node.parentNode.lastChild.classList.add("showdelete");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
onclick(layout) {
|
||||
game.saveConfig("control_style", layout);
|
||||
if (ui.css.control_stylesheet) {
|
||||
ui.css.control_stylesheet.remove();
|
||||
delete ui.css.control_stylesheet;
|
||||
}
|
||||
if (layout == "custom") {
|
||||
game.getDB("image", "control_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.control_stylesheet) {
|
||||
ui.css.control_stylesheet.remove();
|
||||
}
|
||||
ui.css.control_stylesheet = lib.init.sheet(`#window .control,.menubutton:not(.active):not(.highlight):not(.red):not(.blue),#window #system>div>div{background-image:url("${fileLoadedEvent.target.result}")}`);
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
else if (layout != "default") {
|
||||
var str = "";
|
||||
switch (layout) {
|
||||
case "wood": str = `url("${lib.assetURL}theme/woodden/wood.jpg")`; break;
|
||||
case "music": str = "linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px"; break;
|
||||
case "simple": str = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px"; break;
|
||||
}
|
||||
if (layout == "wood") {
|
||||
ui.css.control_stylesheet = lib.init.sheet("#window .control,#window .menubutton,#window #system>div>div,#window #system>div>.pressdown2{background-image:" + str + "}");
|
||||
}
|
||||
else {
|
||||
ui.css.control_stylesheet = lib.init.sheet("#window .control,.menubutton:not(.active):not(.highlight):not(.red):not(.blue),#window #system>div>div{background-image:" + str + "}");
|
||||
}
|
||||
}
|
||||
},
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
export const ITEM = {
|
||||
wood: "木纹",
|
||||
music: "音乐",
|
||||
simple: "简约",
|
||||
custom: "自定",
|
||||
default: "默认"
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
import { ITEM } from "./cursor-style/item.js";
|
||||
|
||||
export const CURSOR_STYLE = {
|
||||
name: "鼠标指针",
|
||||
init: "auto",
|
||||
intro: "设置为固定后鼠标指针将不随移动到的区域而变化",
|
||||
unfrequent: true,
|
||||
item: ITEM,
|
||||
onclick(item) {
|
||||
game.saveConfig("cursor_style", item);
|
||||
if (item == "pointer") {
|
||||
ui.window.classList.add("nopointer");
|
||||
}
|
||||
else {
|
||||
ui.window.classList.remove("nopointer");
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,4 @@
|
|||
export const ITEM = {
|
||||
auto: "自动",
|
||||
pointer: "固定"
|
||||
};
|
|
@ -0,0 +1,12 @@
|
|||
import { CUSTOM_BUTTON_ITEM } from "./custom-button-item.js";
|
||||
|
||||
export const CUSTOM_BUTTON_CONTROL_BOTTOM = {
|
||||
name: "技能下部高度",
|
||||
init: "0x",
|
||||
item: CUSTOM_BUTTON_ITEM,
|
||||
unfrequent: true,
|
||||
onclick(item) {
|
||||
game.saveConfig("custom_button_control_bottom", item);
|
||||
lib.configMenu.appearence.config.custom_button.onclick("skip");
|
||||
}
|
||||
};
|
|
@ -0,0 +1,12 @@
|
|||
import { CUSTOM_BUTTON_ITEM } from "./custom-button-item.js";
|
||||
|
||||
export const CUSTOM_BUTTON_CONTROL_TOP = {
|
||||
name: "技能上部高度",
|
||||
init: "0x",
|
||||
item: CUSTOM_BUTTON_ITEM,
|
||||
unfrequent: true,
|
||||
onclick(item) {
|
||||
game.saveConfig("custom_button_control_top", item);
|
||||
lib.configMenu.appearence.config.custom_button.onclick("skip");
|
||||
}
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
export const CUSTOM_BUTTON_ITEM = {
|
||||
"-5x": "-5px",
|
||||
"-4x": "-4px",
|
||||
"-3x": "-3px",
|
||||
"-2x": "-2px",
|
||||
"-1x": "-1px",
|
||||
"0x": "默认",
|
||||
"1x": "1px",
|
||||
"2x": "2px",
|
||||
"3x": "3px",
|
||||
"4x": "4px",
|
||||
"5x": "5px"
|
||||
};
|
|
@ -0,0 +1,12 @@
|
|||
import { CUSTOM_BUTTON_ITEM } from "./custom-button-item.js";
|
||||
|
||||
export const CUSTOM_BUTTON_SYSTEM_BOTTOM = {
|
||||
name: "菜单下部高度",
|
||||
init: "0x",
|
||||
item: CUSTOM_BUTTON_ITEM,
|
||||
unfrequent: true,
|
||||
onclick(item) {
|
||||
game.saveConfig("custom_button_system_bottom", item);
|
||||
lib.configMenu.appearence.config.custom_button.onclick("skip");
|
||||
}
|
||||
};
|
|
@ -0,0 +1,12 @@
|
|||
import { CUSTOM_BUTTON_ITEM } from "./custom-button-item.js";
|
||||
|
||||
export const CUSTOM_BUTTON_SYSTEM_TOP = {
|
||||
name: "菜单上部高度",
|
||||
init: "0x",
|
||||
item: CUSTOM_BUTTON_ITEM,
|
||||
unfrequent: true,
|
||||
onclick(item) {
|
||||
game.saveConfig("custom_button_system_top", item);
|
||||
lib.configMenu.appearence.config.custom_button.onclick("skip");
|
||||
}
|
||||
};
|
|
@ -0,0 +1,34 @@
|
|||
export const CUSTOM_BUTTON = {
|
||||
name: "自定义按钮高度",
|
||||
init: false,
|
||||
unfrequent: true,
|
||||
onclick(bool) {
|
||||
if (bool !== "skip") {
|
||||
game.saveConfig("custom_button", bool);
|
||||
}
|
||||
if (ui.css.buttonsheet) {
|
||||
ui.css.buttonsheet.remove();
|
||||
}
|
||||
if (lib.config.custom_button) {
|
||||
var cbnum1 = 6 + (parseInt(lib.config.custom_button_system_top) || 0);
|
||||
var cbnum2 = 6 + (parseInt(lib.config.custom_button_system_bottom) || 0);
|
||||
var cbnum3 = 3 + (parseInt(lib.config.custom_button_control_top) || 0);
|
||||
var cbnum4 = 3 + (parseInt(lib.config.custom_button_control_bottom) || 0);
|
||||
var cbnum5 = 2;
|
||||
var cbnum6 = 2;
|
||||
if (cbnum3 < 0) {
|
||||
cbnum5 += cbnum3;
|
||||
cbnum3 = 0;
|
||||
}
|
||||
if (cbnum4 < 0) {
|
||||
cbnum6 += cbnum4;
|
||||
cbnum4 = 0;
|
||||
}
|
||||
ui.css.buttonsheet = lib.init.sheet(
|
||||
"#system>div>div, .caption>div>.tdnode{padding-top:" + cbnum1 + "px !important;padding-bottom:" + cbnum2 + "px !important}",
|
||||
"#control>.control>div{padding-top:" + cbnum3 + "px;padding-bottom:" + cbnum4 + "px}",
|
||||
"#control>.control{padding-top:" + cbnum5 + "px;padding-bottom:" + cbnum6 + "px}"
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
export const DAMAGE_SHAKE = {
|
||||
name: "伤害抖动",
|
||||
intro: "角色受到伤害时的抖动效果",
|
||||
init: true,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,9 @@
|
|||
import { ITEM } from "./die-move/item.js";
|
||||
|
||||
export const DIE_MOVE = {
|
||||
name: "阵亡效果",
|
||||
intro: "阵亡后武将的显示效果",
|
||||
init: "flip",
|
||||
unfrequent: true,
|
||||
item: ITEM
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const ITEM = {
|
||||
off: "关闭",
|
||||
move: "移动",
|
||||
flip: "翻面"
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const FOLD_CARD = {
|
||||
name: "折叠手牌",
|
||||
init: true,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
export const FOLD_MODE = {
|
||||
name: "折叠模式菜单",
|
||||
intro: "关闭后模式菜单中“更多”内的项目将直接展开",
|
||||
init: true,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,15 @@
|
|||
export const GLASS_UI = {
|
||||
name: "玻璃主题",
|
||||
intro: "为游戏主题打开玻璃效果(手机暂不支持)",
|
||||
init: false,
|
||||
unfrequent: true,
|
||||
onclick(bool) {
|
||||
game.saveConfig("glass_ui", bool);
|
||||
if (bool) {
|
||||
ui.window.classList.add("glass_ui");
|
||||
}
|
||||
else {
|
||||
ui.window.classList.remove("glass_ui");
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,21 @@
|
|||
import { ITEM } from "./global-font/item.js";
|
||||
|
||||
export const GLOBAL_FONT = {
|
||||
name: "界面字体",
|
||||
init: "default",
|
||||
unfrequent: true,
|
||||
item: ITEM,
|
||||
textMenu(node, link) {
|
||||
if (link != "default") {
|
||||
node.style.fontFamily = link;
|
||||
}
|
||||
else {
|
||||
node.style.fontFamily = `"STHeiti","SimHei","Microsoft JhengHei","Microsoft YaHei","WenQuanYi Micro Hei","Suits",Helvetica,Arial,sans-serif`;
|
||||
}
|
||||
node.style.fontSize = "20px";
|
||||
},
|
||||
onclick(font) {
|
||||
game.saveConfig("global_font", font);
|
||||
lib.init.cssstyles();
|
||||
}
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
export const ITEM = {};
|
|
@ -0,0 +1,13 @@
|
|||
import { ITEM } from "./glow-phase/item.js";
|
||||
|
||||
export const GLOW_PHASE = {
|
||||
name: "当前回合角色高亮",
|
||||
unfrequent: true,
|
||||
init: "yellow",
|
||||
intro: "设置当前回合角色的边框颜色",
|
||||
item: ITEM,
|
||||
onclick(bool) {
|
||||
game.saveConfig("glow_phase", bool);
|
||||
lib.init.cssstyles();
|
||||
}
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
export const ITEM = {
|
||||
none: "无",
|
||||
yellow: "黄色",
|
||||
green: "绿色",
|
||||
purple: "紫色"
|
||||
};
|
|
@ -0,0 +1,177 @@
|
|||
import { ITEM } from "./hp-style/item.js";
|
||||
|
||||
export const HP_STYLE = {
|
||||
name: "体力条样式",
|
||||
init: "ol",
|
||||
item: ITEM,
|
||||
visualBar(node, item, create, switcher) {
|
||||
if (node.created) {
|
||||
return;
|
||||
}
|
||||
var button;
|
||||
for (var i = 0; i < node.parentNode.childElementCount; i++) {
|
||||
if (node.parentNode.childNodes[i]._link == "custom") {
|
||||
button = node.parentNode.childNodes[i];
|
||||
}
|
||||
}
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
node.created = true;
|
||||
var deletepic;
|
||||
ui.create.filediv(".menubutton.addbutton", "添加图片", node, function (file) {
|
||||
if (file && node.currentDB) {
|
||||
game.putDB("image", "hp_style" + node.currentDB, file, function () {
|
||||
game.getDB("image", "hp_style" + node.currentDB, function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
button.childNodes[node.currentDB - 1].style.backgroundImage = "url(" + data + ")";
|
||||
button.classList.add("shown");
|
||||
node.classList.add("showdelete");
|
||||
node.currentDB++;
|
||||
if (node.currentDB > 4) {
|
||||
node.classList.add("hideadd");
|
||||
button.classList.remove("transparent");
|
||||
delete node.currentDB;
|
||||
}
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
});
|
||||
}
|
||||
}).inputNode.accept = "image/*";
|
||||
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
|
||||
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
|
||||
game.deleteDB("image", "hp_style1");
|
||||
game.deleteDB("image", "hp_style2");
|
||||
game.deleteDB("image", "hp_style3");
|
||||
game.deleteDB("image", "hp_style4");
|
||||
for (var i = 0; i < button.childElementCount; i++) {
|
||||
button.childNodes[i].style.backgroundImage = "none";
|
||||
}
|
||||
node.classList.remove("showdelete");
|
||||
node.classList.remove("hideadd");
|
||||
if (lib.config.hp_style == "custom") {
|
||||
lib.configMenu.appearence.config.hp_style.onclick("default");
|
||||
switcher.lastChild.innerHTML = "默认";
|
||||
}
|
||||
button.classList.add("transparent");
|
||||
button.classList.remove("shown");
|
||||
node.currentDB = 1;
|
||||
}
|
||||
});
|
||||
},
|
||||
visualMenu(node, link, name, config) {
|
||||
node.className = "button hpbutton dashedmenubutton";
|
||||
node.innerHTML = "";
|
||||
for (var i = 1; i <= 4; i++) {
|
||||
var div = ui.create.div(node);
|
||||
if (link == "default") {
|
||||
ui.create.div(div);
|
||||
}
|
||||
else if (link != "custom") {
|
||||
div.setBackgroundImage("theme/style/hp/image/" + link + i + ".png");
|
||||
}
|
||||
if (i == 4) {
|
||||
div.style.webkitFilter = "grayscale(1)";
|
||||
}
|
||||
}
|
||||
if (link == "custom") {
|
||||
node.classList.add("transparent");
|
||||
var getDB = function (num) {
|
||||
node.parentNode.lastChild.currentDB = num;
|
||||
game.getDB("image", "hp_style" + num, function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
node.childNodes[num - 1].style.backgroundImage = "url(" + data + ")";
|
||||
node.classList.add("shown");
|
||||
node.parentNode.lastChild.classList.add("showdelete");
|
||||
if (num < 4) {
|
||||
getDB(num + 1);
|
||||
}
|
||||
else {
|
||||
node.parentNode.lastChild.classList.add("hideadd");
|
||||
node.classList.remove("transparent");
|
||||
delete node.parentNode.firstChild.currentDB;
|
||||
}
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
getDB(1);
|
||||
}
|
||||
},
|
||||
onclick(layout) {
|
||||
game.saveConfig("hp_style", layout);
|
||||
var style = ui.css.hp_style;
|
||||
ui.css.hp_style = lib.init.css(lib.assetURL + "theme/style/hp", lib.config.hp_style);
|
||||
style.remove();
|
||||
if (ui.css.hp_stylesheet1) {
|
||||
ui.css.hp_stylesheet1.remove();
|
||||
delete ui.css.hp_stylesheet1;
|
||||
}
|
||||
if (ui.css.hp_stylesheet2) {
|
||||
ui.css.hp_stylesheet2.remove();
|
||||
delete ui.css.hp_stylesheet2;
|
||||
}
|
||||
if (ui.css.hp_stylesheet3) {
|
||||
ui.css.hp_stylesheet3.remove();
|
||||
delete ui.css.hp_stylesheet3;
|
||||
}
|
||||
if (ui.css.hp_stylesheet4) {
|
||||
ui.css.hp_stylesheet4.remove();
|
||||
delete ui.css.hp_stylesheet4;
|
||||
}
|
||||
if (layout == "custom") {
|
||||
game.getDB("image", "hp_style1", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.hp_stylesheet1) {
|
||||
ui.css.hp_stylesheet1.remove();
|
||||
}
|
||||
ui.css.hp_stylesheet1 = lib.init.sheet(`.hp:not(.text):not(.actcount)[data-condition="high"]>div:not(.lost){background-image:url(${fileLoadedEvent.target.result})}`);
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
game.getDB("image", "hp_style2", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.hp_stylesheet2) {
|
||||
ui.css.hp_stylesheet2.remove();
|
||||
}
|
||||
ui.css.hp_stylesheet2 = lib.init.sheet(`.hp:not(.text):not(.actcount)[data-condition="mid"]>div:not(.lost){background-image:url(${fileLoadedEvent.target.result})}`);
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
game.getDB("image", "hp_style3", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.hp_stylesheet3) {
|
||||
ui.css.hp_stylesheet3.remove();
|
||||
}
|
||||
ui.css.hp_stylesheet3 = lib.init.sheet(`.hp:not(.text):not(.actcount)[data-condition="low"]>div:not(.lost){background-image:url(${fileLoadedEvent.target.result})}`);
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
game.getDB("image", "hp_style4", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.hp_stylesheet4) {
|
||||
ui.css.hp_stylesheet4.remove();
|
||||
}
|
||||
ui.css.hp_stylesheet4 = lib.init.sheet(`.hp:not(.text):not(.actcount)>.lost{background-image:url(${fileLoadedEvent.target.result})}`);
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,10 @@
|
|||
export const ITEM = {
|
||||
default: "默认",
|
||||
emotion: "表情",
|
||||
glass: "勾玉",
|
||||
round: "国战",
|
||||
ol: "手杀",
|
||||
xinglass: "双鱼",
|
||||
xinround: "OL",
|
||||
custom: "自定"
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
import { ITEM } from "./identity-font/item.js";
|
||||
|
||||
export const IDENTITY_FONT = {
|
||||
name: "身份字体",
|
||||
init: "huangcao",
|
||||
unfrequent: true,
|
||||
item: ITEM,
|
||||
textMenu(node, link) {
|
||||
if (link != "default") {
|
||||
node.style.fontFamily = link;
|
||||
}
|
||||
node.style.fontSize = "20px";
|
||||
},
|
||||
onclick(font) {
|
||||
game.saveConfig("identity_font", font);
|
||||
lib.init.cssstyles();
|
||||
}
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
export const ITEM = {};
|
|
@ -0,0 +1,21 @@
|
|||
import { Game } from "../../../../game.js";
|
||||
import { UI } from "../../../../ui.js";
|
||||
import { configuration } from "../../../configuration.js";
|
||||
|
||||
export const IMAGE_BACKGROUND_BLUR = {
|
||||
name: "背景模糊",
|
||||
init: false,
|
||||
onclick(bool) {
|
||||
Game.saveConfig("image_background_blur", bool);
|
||||
if (configuration.image_background_blur) {
|
||||
UI.background.style.filter = "blur(8px)";
|
||||
UI.background.style.webkitFilter = "blur(8px)";
|
||||
UI.background.style.transform = "scale(1.05)";
|
||||
}
|
||||
else {
|
||||
UI.background.style.filter = "";
|
||||
UI.background.style.webkitFilter = "";
|
||||
UI.background.style.transform = "";
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
import { Game } from "../../../../game.js";
|
||||
import { Initialization } from "../../../initialization.js";
|
||||
|
||||
export const IMAGE_BACKGROUND_RANDOM = {
|
||||
name: "随机背景",
|
||||
init: false,
|
||||
onclick(bool) {
|
||||
Game.saveConfig("image_background_random", bool);
|
||||
Initialization.background();
|
||||
}
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const JIU_EFFECT = {
|
||||
name: "喝酒效果",
|
||||
init: true,
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,35 @@
|
|||
import { ITEM } from "./link-style-2/item.js";
|
||||
|
||||
export const LINK_STYLE_2 = {
|
||||
name: "横置样式",
|
||||
intro: "设置角色被横置时的样式",
|
||||
init: "chain",
|
||||
unfrequent: true,
|
||||
item: ITEM,
|
||||
onclick(style) {
|
||||
var list = [];
|
||||
for (var i = 0; i < game.players.length; i++) {
|
||||
if (game.players[i].isLinked()) {
|
||||
list.push(game.players[i]);
|
||||
}
|
||||
}
|
||||
game.saveConfig("link_style2", style);
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
if (get.is.linked2(list[i])) {
|
||||
list[i].classList.add("linked2");
|
||||
list[i].classList.remove("linked");
|
||||
}
|
||||
else {
|
||||
list[i].classList.add("linked");
|
||||
list[i].classList.remove("linked2");
|
||||
}
|
||||
}
|
||||
if (style == "chain") {
|
||||
ui.arena.classList.remove("nolink");
|
||||
}
|
||||
else {
|
||||
ui.arena.classList.add("nolink");
|
||||
}
|
||||
ui.updatem();
|
||||
}
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const ITEM = {
|
||||
chain: "铁索",
|
||||
rotate: "横置",
|
||||
mark: "标记"
|
||||
};
|
|
@ -0,0 +1,114 @@
|
|||
import { ITEM } from "./menu-style/item.js";
|
||||
|
||||
export const MENU_STYLE = {
|
||||
name: "菜单背景",
|
||||
init: "default",
|
||||
item: ITEM,
|
||||
visualBar(node, item, create, switcher) {
|
||||
if (node.created) {
|
||||
return;
|
||||
}
|
||||
var button;
|
||||
for (var i = 0; i < node.parentNode.childElementCount; i++) {
|
||||
if (node.parentNode.childNodes[i]._link == "custom") {
|
||||
button = node.parentNode.childNodes[i];
|
||||
}
|
||||
}
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
node.created = true;
|
||||
var deletepic;
|
||||
ui.create.filediv(".menubutton", "添加图片", node, function (file) {
|
||||
if (file) {
|
||||
game.putDB("image", "menu_style", file, function () {
|
||||
game.getDB("image", "menu_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
button.style.backgroundImage = `url(${data})`;
|
||||
button.style.backgroundSize = "cover";
|
||||
button.className = "button character";
|
||||
node.classList.add("showdelete");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
});
|
||||
}
|
||||
}).inputNode.accept = "image/*";
|
||||
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
|
||||
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
|
||||
game.deleteDB("image", "menu_style");
|
||||
button.style.backgroundImage = "none";
|
||||
button.style.backgroundSize = "auto";
|
||||
button.className = "button character dashedmenubutton";
|
||||
node.classList.remove("showdelete");
|
||||
if (lib.config.menu_style == "custom") {
|
||||
lib.configMenu.appearence.config.menu_style.onclick("default");
|
||||
switcher.lastChild.innerHTML = "默认";
|
||||
}
|
||||
button.classList.add("transparent");
|
||||
}
|
||||
});
|
||||
},
|
||||
visualMenu(node, link, name, config) {
|
||||
node.className = "button character";
|
||||
node.style.backgroundSize = "auto";
|
||||
switch (link) {
|
||||
case "default": case "custom": {
|
||||
node.style.backgroundImage = "none";
|
||||
node.classList.add("dashedmenubutton");
|
||||
break;
|
||||
}
|
||||
case "wood": node.setBackgroundImage("theme/woodden/wood2.png"); break;
|
||||
case "music": node.style.backgroundImage = "linear-gradient(#4b4b4b, #464646)"; break;
|
||||
case "simple": node.style.backgroundImage = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; break;
|
||||
}
|
||||
if (link == "custom") {
|
||||
node.classList.add("transparent");
|
||||
game.getDB("image", "menu_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
node.style.backgroundImage = "url(" + data + ")";
|
||||
node.style.backgroundSize = "cover";
|
||||
node.className = "button character";
|
||||
node.parentNode.lastChild.classList.add("showdelete");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
onclick(layout) {
|
||||
game.saveConfig("menu_style", layout);
|
||||
if (ui.css.menu_stylesheet) {
|
||||
ui.css.menu_stylesheet.remove();
|
||||
delete ui.css.menu_stylesheet;
|
||||
}
|
||||
if (layout == "custom") {
|
||||
game.getDB("image", "menu_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.menu_stylesheet) {
|
||||
ui.css.menu_stylesheet.remove();
|
||||
}
|
||||
ui.css.menu_stylesheet = lib.init.sheet(`html #window>.dialog.popped,html .menu,html .menubg{background-image:url("${fileLoadedEvent.target.result}");background-size:cover}`);
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
else if (layout != "default") {
|
||||
var str = "";
|
||||
switch (layout) {
|
||||
case "wood": str = `url("${lib.assetURL}theme/woodden/wood2.png")`; break;
|
||||
case "music": str = "linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px"; break;
|
||||
case "simple": str = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px"; break;
|
||||
}
|
||||
ui.css.menu_stylesheet = lib.init.sheet(`html #window>.dialog.popped,html .menu,html .menubg{background-image:${str}}`);
|
||||
}
|
||||
},
|
||||
unfrequent: true,
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
export const ITEM = {
|
||||
wood: "木纹",
|
||||
music: "音乐",
|
||||
simple: "简约",
|
||||
custom: "自定",
|
||||
default: "默认"
|
||||
};
|
|
@ -0,0 +1,18 @@
|
|||
import { ITEM } from "./name-font/item.js";
|
||||
|
||||
export const NAME_FONT = {
|
||||
name: "人名字体",
|
||||
init: "xingkai",
|
||||
unfrequent: true,
|
||||
item: ITEM,
|
||||
textMenu(node, link) {
|
||||
if (link != "default") {
|
||||
node.style.fontFamily = link;
|
||||
}
|
||||
node.style.fontSize = "20px";
|
||||
},
|
||||
onclick(font) {
|
||||
game.saveConfig("name_font", font);
|
||||
lib.init.cssstyles();
|
||||
}
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
export const ITEM = {};
|
|
@ -0,0 +1,22 @@
|
|||
import { Game } from "../../../../game.js";
|
||||
import { Is } from "../../../../get/is.js";
|
||||
import { Library } from "../../../../library.js";
|
||||
import { UI } from "../../../../ui.js";
|
||||
import { css } from "../../../../ui/css.js";
|
||||
|
||||
export const PHONE_LAYOUT = {
|
||||
name: "触屏布局",
|
||||
init: false,
|
||||
onclick(bool) {
|
||||
if (Is.nomenu("phonelayout", bool)) return false;
|
||||
Game.saveConfig("phonelayout", bool);
|
||||
if (Is.phoneLayout()) {
|
||||
css.phone.href = `${Library.assetURL}layout/default/phone.css`;
|
||||
UI.arena.classList.add("phone");
|
||||
}
|
||||
else {
|
||||
css.phone.href = "";
|
||||
UI.arena.classList.remove("phone");
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,37 @@
|
|||
import { ITEM } from "./player-border/item.js";
|
||||
|
||||
export const PLAYER_BORDER = {
|
||||
name: "边框宽度",
|
||||
init: "normal",
|
||||
intro: "设置角色的边框宽度",
|
||||
unfrequent: true,
|
||||
item: ITEM,
|
||||
onclick(item) {
|
||||
game.saveConfig("player_border", item);
|
||||
if (item != "wide" || game.layout == "long" || game.layout == "long2") {
|
||||
ui.arena.classList.add("slim_player");
|
||||
}
|
||||
else {
|
||||
ui.arena.classList.remove("slim_player");
|
||||
}
|
||||
if (item == "slim") {
|
||||
ui.arena.classList.add("uslim_player");
|
||||
}
|
||||
else {
|
||||
ui.arena.classList.remove("uslim_player");
|
||||
}
|
||||
if (item == "narrow") {
|
||||
ui.arena.classList.add("mslim_player");
|
||||
}
|
||||
else {
|
||||
ui.arena.classList.remove("mslim_player");
|
||||
}
|
||||
if (item == "normal" && lib.config.mode != "brawl" && (game.layout == "long" || game.layout == "long2")) {
|
||||
ui.arena.classList.add("lslim_player");
|
||||
}
|
||||
else {
|
||||
ui.arena.classList.remove("lslim_player");
|
||||
}
|
||||
ui.window.dataset.player_border = item;
|
||||
}
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
export const ITEM = {
|
||||
slim: "细",
|
||||
narrow: "窄",
|
||||
normal: "中",
|
||||
wide: "宽"
|
||||
};
|
|
@ -1,4 +1,4 @@
|
|||
export const ITEM = {
|
||||
export const PLAYER_HEIGHT_ITEM = {
|
||||
short: "矮",
|
||||
default: "中",
|
||||
long: "高"
|
|
@ -1,12 +1,13 @@
|
|||
import { Game } from "../../../../game.js";
|
||||
import { UI } from "../../../../ui.js";
|
||||
import { ITEM } from "./player-height-nova/item.js";
|
||||
import { PLAYER_HEIGHT_ITEM } from "./player-height-item.js";
|
||||
|
||||
export const PLAYER_HEIGHT_NOVA = {
|
||||
name: "角色高度",
|
||||
init: "short",
|
||||
item: ITEM,
|
||||
item: PLAYER_HEIGHT_ITEM,
|
||||
onclick(item) {
|
||||
game.saveConfig("player_height_nova", item);
|
||||
Game.saveConfig("player_height_nova", item);
|
||||
UI.arena.dataset.player_height_nova = item;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Game } from "../../../../game.js";
|
||||
import { UI } from "../../../../ui.js";
|
||||
import { ITEM } from "./player-height/item.js";
|
||||
import { PLAYER_HEIGHT_ITEM } from "./player-height-item.js";
|
||||
|
||||
export const PLAYER_HEIGHT = {
|
||||
name: "角色高度",
|
||||
init: "long",
|
||||
item: ITEM,
|
||||
item: PLAYER_HEIGHT_ITEM,
|
||||
onclick(item) {
|
||||
Game.saveConfig("player_height", item);
|
||||
UI.arena.dataset.player_height = item;
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
export const ITEM = {
|
||||
short: "矮",
|
||||
default: "中",
|
||||
long: "高"
|
||||
};
|
|
@ -0,0 +1,115 @@
|
|||
import { ITEM } from "./player-style/item.js";
|
||||
|
||||
export const PLAYER_STYLE = {
|
||||
name: "角色背景",
|
||||
init: "default",
|
||||
intro: "设置角色的背景图片",
|
||||
item: ITEM,
|
||||
visualBar(node, item, create, switcher) {
|
||||
if (node.created) {
|
||||
return;
|
||||
}
|
||||
var button;
|
||||
for (var i = 0; i < node.parentNode.childElementCount; i++) {
|
||||
if (node.parentNode.childNodes[i]._link == "custom") {
|
||||
button = node.parentNode.childNodes[i];
|
||||
}
|
||||
}
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
node.created = true;
|
||||
var deletepic;
|
||||
ui.create.filediv(".menubutton", "添加图片", node, function (file) {
|
||||
if (file) {
|
||||
game.putDB("image", "player_style", file, function () {
|
||||
game.getDB("image", "player_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
button.style.backgroundImage = "url(" + data + ")";
|
||||
button.className = "button character";
|
||||
button.style.backgroundSize = "100% 100%";
|
||||
node.classList.add("showdelete");
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
});
|
||||
}
|
||||
}).inputNode.accept = "image/*";
|
||||
deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () {
|
||||
if (confirm("确定删除自定义图片?(此操作不可撤销)")) {
|
||||
game.deleteDB("image", "player_style");
|
||||
button.style.backgroundImage = "none";
|
||||
button.className = "button character dashedmenubutton";
|
||||
node.classList.remove("showdelete");
|
||||
if (lib.config.player_style == "custom") {
|
||||
lib.configMenu.appearence.config.player_style.onclick("default");
|
||||
switcher.lastChild.innerHTML = "默认";
|
||||
}
|
||||
button.classList.add("transparent");
|
||||
}
|
||||
});
|
||||
},
|
||||
visualMenu(node, link, name, config) {
|
||||
node.className = "button character";
|
||||
node.style.backgroundSize = "";
|
||||
node.style.height = "108px";
|
||||
switch (link) {
|
||||
case "default": case "custom": {
|
||||
node.style.backgroundImage = "none";
|
||||
node.className = "button character dashedmenubutton";
|
||||
break;
|
||||
}
|
||||
case "wood": node.setBackgroundImage("theme/woodden/wood.jpg"); break;
|
||||
case "music": node.style.backgroundImage = "linear-gradient(#4b4b4b, #464646)"; break;
|
||||
case "simple": node.style.backgroundImage = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; break;
|
||||
}
|
||||
if (link == "custom") {
|
||||
node.classList.add("transparent");
|
||||
game.getDB("image", "player_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
var data = fileLoadedEvent.target.result;
|
||||
node.style.backgroundImage = "url(" + data + ")";
|
||||
node.className = "button character";
|
||||
node.parentNode.lastChild.classList.add("showdelete");
|
||||
node.style.backgroundSize = "100% 100%";
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
},
|
||||
onclick(layout) {
|
||||
game.saveConfig("player_style", layout);
|
||||
if (ui.css.player_stylesheet) {
|
||||
ui.css.player_stylesheet.remove();
|
||||
delete ui.css.player_stylesheet;
|
||||
}
|
||||
if (layout == "custom") {
|
||||
game.getDB("image", "player_style", function (fileToLoad) {
|
||||
if (!fileToLoad) return;
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function (fileLoadedEvent) {
|
||||
if (ui.css.player_stylesheet) {
|
||||
ui.css.player_stylesheet.remove();
|
||||
}
|
||||
ui.css.player_stylesheet = lib.init.sheet(`#window .player{background-image:url("${fileLoadedEvent.target.result}");background-size:100% 100%;}`);
|
||||
};
|
||||
fileReader.readAsDataURL(fileToLoad, "UTF-8");
|
||||
});
|
||||
}
|
||||
else if (layout != "default") {
|
||||
var str = "";
|
||||
switch (layout) {
|
||||
case "wood": str = `url("${lib.assetURL}theme/woodden/wood.jpg")`; break;
|
||||
case "music": str = "linear-gradient(#4b4b4b, #464646)"; break;
|
||||
case "simple": str = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; break;
|
||||
}
|
||||
ui.css.player_stylesheet = lib.init.sheet(`#window .player{background-image:${str}}`);
|
||||
}
|
||||
},
|
||||
unfrequent: true
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
export const ITEM = {
|
||||
wood: "木纹",
|
||||
music: "音乐",
|
||||
simple: "简约",
|
||||
custom: "自定",
|
||||
default: "默认"
|
||||
};
|
|
@ -0,0 +1,12 @@
|
|||
import { ITEM } from "./radius-size/item.js";
|
||||
|
||||
export const RADIUS_SIZE = {
|
||||
name: "圆角大小",
|
||||
init: "default",
|
||||
item: ITEM,
|
||||
unfrequent: true,
|
||||
onclick(item) {
|
||||
game.saveConfig("radius_size", item);
|
||||
ui.window.dataset.radius_size = item;
|
||||
}
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
export const ITEM = {
|
||||
off: "关闭",
|
||||
reduce: "减小",
|
||||
default: "默认",
|
||||
increase: "增大"
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
export const SEPARATE_CONTROL = {
|
||||
name: "分离选项条",
|
||||
init: true,
|
||||
unfrequent: true,
|
||||
intro: "开启后玩家在进行选择时不同的选项将分开,而不是连在一起"
|
||||
};
|
|
@ -0,0 +1,9 @@
|
|||
import { ITEM } from "./skill-animation-type/item.js";
|
||||
|
||||
export const SKILL_ANIMATION_TYPE = {
|
||||
name: "技能特效",
|
||||
intro: "开启后觉醒技、限定技将显示全屏文字",
|
||||
init: "default",
|
||||
unfrequent: true,
|
||||
item: ITEM
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const ITEM = {
|
||||
default: "默认",
|
||||
old: "旧版",
|
||||
off: "关闭"
|
||||
};
|
|
@ -0,0 +1,6 @@
|
|||
export const SUITS_FONT = {
|
||||
name: "替换花色字体",
|
||||
init: true,
|
||||
unfrequent: true,
|
||||
intro: "使用全角字符的花色替代系统自带的花色(重启游戏后生效)"
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
import { ITEM } from "./target-shake/item.js";
|
||||
|
||||
export const TARGET_SHAKE = {
|
||||
name: "目标效果",
|
||||
intro: "一名玩家成为卡牌或技能的目标时的显示效果",
|
||||
init: "off",
|
||||
item: ITEM,
|
||||
unfrequent: true,
|
||||
onclick(bool) {
|
||||
game.saveConfig("target_shake", bool);
|
||||
ui.arena.dataset.target_shake = bool;
|
||||
}
|
||||
};
|
|
@ -0,0 +1,5 @@
|
|||
export const ITEM = {
|
||||
off: "关闭",
|
||||
zoom: "缩放",
|
||||
shake: "抖动"
|
||||
};
|
|
@ -0,0 +1,15 @@
|
|||
export const TURNED_STYLE = {
|
||||
name: "翻面文字",
|
||||
intro: "角色被翻面时显示“翻面”",
|
||||
init: true,
|
||||
unfrequent: true,
|
||||
onclick(bool) {
|
||||
game.saveConfig("turned_style", bool);
|
||||
if (bool) {
|
||||
ui.arena.classList.remove("hide_turned");
|
||||
}
|
||||
else {
|
||||
ui.arena.classList.add("hide_turned");
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,7 +1,7 @@
|
|||
import { Is } from "../../../get/is.js";
|
||||
import { Library } from "../../../library.js";
|
||||
import { AUTO_CHECK_UPDATE } from "./configuration/auto-check-update.js";
|
||||
import { AUTO_CONFIRM } from "./configuration/auto-confirm.js";
|
||||
import { AUTOMATICALLY_CHECK_UPDATE } from "./configuration/automatically-check-update.js";
|
||||
import { AUTOMATICALLY_CONFIRM } from "./configuration/automatically-confirm.js";
|
||||
import { COMPATIBLE_MODE } from "./configuration/compatible-mode.js";
|
||||
import { CONFIRM_EXIT } from "./configuration/confirm-exit.js";
|
||||
import { DEVELOPER } from "./configuration/developer.js";
|
||||
|
@ -39,7 +39,7 @@ import { SWIPE } from "./configuration/swipe.js";
|
|||
import { SYNCHRONIZE_SPEED } from "./configuration/synchronize-speed.js";
|
||||
import { TAO_ENEMY } from "./configuration/tao-enemy.js";
|
||||
import { TOUCHSCREEN } from "./configuration/touchscreen.js";
|
||||
import { UN_AUTO_CHOOSE } from "./configuration/un-auto-choose.js";
|
||||
import { UN_AUTOMATICALLY_CHOOSE } from "./configuration/un-automatically-choose.js";
|
||||
import { UPDATE_LINK } from "./configuration/update-link.js";
|
||||
import { VIDEO } from "./configuration/video.js";
|
||||
import { WUXIE_SELF } from "./configuration/wuxie-self.js";
|
||||
|
@ -50,9 +50,9 @@ export const CONFIGURATION = {
|
|||
compatiblemode: COMPATIBLE_MODE,
|
||||
confirm_exit: CONFIRM_EXIT,
|
||||
keep_awake: KEEP_AWAKE,
|
||||
auto_confirm: AUTO_CONFIRM,
|
||||
auto_confirm: AUTOMATICALLY_CONFIRM,
|
||||
skip_shan: SKIP_SHAN,
|
||||
unauto_choose: UN_AUTO_CHOOSE,
|
||||
unauto_choose: UN_AUTOMATICALLY_CHOOSE,
|
||||
wuxie_self: WUXIE_SELF,
|
||||
tao_enemy: TAO_ENEMY,
|
||||
enable_drag: ENABLE_DRAG,
|
||||
|
@ -79,7 +79,7 @@ export const CONFIGURATION = {
|
|||
video: VIDEO,
|
||||
max_loadtime: MAXIMUM_LOAD_TIME,
|
||||
mousewheel: MOUSE_WHEEL,
|
||||
auto_check_update: AUTO_CHECK_UPDATE,
|
||||
auto_check_update: AUTOMATICALLY_CHECK_UPDATE,
|
||||
lucky_star: LUCKY_STAR,
|
||||
dev: DEVELOPER,
|
||||
fuck_sojson: FUCK_SO_JSON,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export const AUTO_CHECK_UPDATE = {
|
||||
export const AUTOMATICALLY_CHECK_UPDATE = {
|
||||
name: "自动检查游戏更新",
|
||||
intro: "进入游戏时检查更新",
|
||||
init: false,
|
|
@ -1,4 +1,4 @@
|
|||
export const AUTO_CONFIRM = {
|
||||
export const AUTOMATICALLY_CONFIRM = {
|
||||
name: "自动确认",
|
||||
init: true,
|
||||
unfrequent: true,
|
|
@ -8,6 +8,9 @@ export const EXTENSION_SOURCE = {
|
|||
return configuration.extension_sources;
|
||||
},
|
||||
intro() {
|
||||
return `获取在线扩展时的地址。当前地址:${document.createElement("br").outerHTML}${configuration.extension_sources[configuration.extension_source]}`;
|
||||
const introduction = document.createElement("body");
|
||||
introduction.append("获取在线扩展时的地址。当前地址:", document.createElement("br"));
|
||||
introduction.append(configuration.extension_sources[configuration.extension_source]);
|
||||
return introduction.innerHTML;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
import { Game } from "../../../../game.js";
|
||||
|
||||
const introduction = document.createElement("body");
|
||||
introduction.append("防止屏幕自动关闭", document.createElement("br"));
|
||||
introduction.append("注:旧版本通过NoSleep.js实现的屏幕常亮可能会影响外置音频的音量");
|
||||
|
||||
export const KEEP_AWAKE = {
|
||||
name: "屏幕常亮",
|
||||
init: false,
|
||||
unfrequent: true,
|
||||
intro: `防止屏幕自动关闭${document.createElement("br").outerHTML}注:旧版本通过NoSleep.js实现的屏幕常亮可能会影响外置音频的音量`,
|
||||
intro: introduction.innerHTML,
|
||||
onclick(bool) {
|
||||
Game.saveConfig("keep_awake", bool);
|
||||
if (bool) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export const UN_AUTO_CHOOSE = {
|
||||
export const UN_AUTOMATICALLY_CHOOSE = {
|
||||
name: "拆顺手牌选择",
|
||||
init: false,
|
||||
unfrequent: true,
|
Loading…
Reference in New Issue