Add the general config menu.

This commit is contained in:
Tipx-L 2023-12-06 02:25:36 -08:00
parent c53db8f4f5
commit 076b86f851
66 changed files with 781 additions and 47 deletions

View File

@ -1,4 +1,5 @@
import { status as _status } from "./status";
import { Library } from "./library.js";
import { status } from "./status.js";
export class Get {
constructor() {
@ -9,14 +10,14 @@ export class Get {
* @template T
* @overload
* @param {T} key
* @returns {typeof _status.event[T]}
* @returns {typeof status.event[T]}
*/
/**
* @overload
* @returns {typeof _status.event}
* @returns {typeof status.event}
*/
static event(key) {
return key ? _status.event[key] : _status.event;
return key ? status.event[key] : status.event;
}
/**
@ -27,27 +28,27 @@ export class Get {
if (str._tempTranslate) return str._tempTranslate;
var str2;
if (arg == "viewAs" && str.viewAs) {
str2 = get.translation(str.viewAs);
str2 = this.translation(str.viewAs);
}
else {
str2 = get.translation(str.name);
str2 = this.translation(str.name);
}
if (str2 == "杀") {
str2 = "";
if (typeof str.nature == "string") {
let natures = str.nature.split(lib.natureSeparator).sort(lib.sort.nature);
let natures = str.nature.split(Library.natureSeparator).sort(Library.sort.nature);
for (let nature of natures) {
str2 += lib.translate["nature_" + nature] || lib.translate[nature] || "";
str2 += Library.translate["nature_" + nature] || Library.translate[nature] || "";
}
}
str2 += "杀";
}
if (get.itemtype(str) == "card" || str.isCard) {
if (_status.cardtag && str.cardid) {
if (this.itemtype(str) == "card" || str.isCard) {
if (status.cardtag && str.cardid) {
var tagstr = "";
for (var i in _status.cardtag) {
if (_status.cardtag[i].contains(str.cardid)) {
tagstr += lib.translate[i + "_tag"];
for (var i in status.cardtag) {
if (status.cardtag[i].contains(str.cardid)) {
tagstr += Library.translate[i + "_tag"];
}
}
if (tagstr) {
@ -55,57 +56,57 @@ export class Get {
}
}
if (str.suit && str.number || str.isCard) {
var cardnum = get.number(str, false) || "";
var cardnum = this.number(str, false) || "";
if ([1, 11, 12, 13].contains(cardnum)) {
cardnum = { "1": "A", "11": "J", "12": "Q", "13": "K" }[cardnum]
}
if (arg == "viewAs" && str.viewAs != str.name && str.viewAs) {
str2 += "" + get.translation(str) + "";
str2 += "" + this.translation(str) + "";
}
else {
str2 += "【" + get.translation(get.suit(str, false)) + cardnum + "】";
str2 += "【" + this.translation(this.suit(str, false)) + cardnum + "】";
}
}
}
return str2;
}
if (Array.isArray(str)) {
var str2 = get.translation(str[0], arg);
var str2 = this.translation(str[0], arg);
for (var i = 1; i < str.length; i++) {
str2 += "、" + get.translation(str[i], arg);
str2 += "、" + this.translation(str[i], arg);
}
return str2;
}
if (get.itemtype(str) == "natures") {
let natures = str.split(lib.natureSeparator).sort(lib.sort.nature);
if (this.itemtype(str) == "natures") {
let natures = str.split(Library.natureSeparator).sort(Library.sort.nature);
var str2 = "";
for (var nature of natures) {
str2 += lib.translate["nature_" + nature] || lib.translate[nature] || "";
str2 += Library.translate["nature_" + nature] || Library.translate[nature] || "";
}
return str2;
}
if (arg == "skill") {
if (lib.translate[str + "_ab"]) return lib.translate[str + "_ab"];
if (lib.translate[str]) return lib.translate[str].slice(0, 2);
if (Library.translate[str + "_ab"]) return Library.translate[str + "_ab"];
if (Library.translate[str]) return Library.translate[str].slice(0, 2);
return str;
}
else if (arg == "info") {
if (lib.translate[str + "_info"]) return lib.translate[str + "_info"];
if (Library.translate[str + "_info"]) return Library.translate[str + "_info"];
var str2 = str.slice(0, str.length - 1);
if (lib.translate[str2 + "_info"]) return lib.translate[str2 + "_info"];
if (Library.translate[str2 + "_info"]) return Library.translate[str2 + "_info"];
if (str.lastIndexOf("_") > 0) {
str2 = str.slice(0, str.lastIndexOf("_"));
if (lib.translate[str2 + "_info"]) return lib.translate[str2 + "_info"];
if (Library.translate[str2 + "_info"]) return Library.translate[str2 + "_info"];
}
str2 = str.slice(0, str.length - 2);
if (lib.translate[str2 + "_info"]) return lib.translate[str2 + "_info"];
if (lib.skill[str] && lib.skill[str].prompt) return lib.skill[str].prompt;
if (Library.translate[str2 + "_info"]) return Library.translate[str2 + "_info"];
if (Library.skill[str] && Library.skill[str].prompt) return Library.skill[str].prompt;
}
if (lib.translate[str]) {
return lib.translate[str];
if (Library.translate[str]) {
return Library.translate[str];
}
if (typeof str == "string") {
if (lib.translate["nature_" + str]) return lib.translate["nature_" + str];
if (Library.translate["nature_" + str]) return Library.translate["nature_" + str];
return str;
}
if (typeof str == "number" || typeof str == "boolean") {

1
noname/get/is.js Normal file
View File

@ -0,0 +1 @@
export class Is { }

View File

@ -1,4 +1,4 @@
import { CharacterInformation } from "./character-information";
import { CharacterInformation } from "./character-information.js";
interface CharacterPack extends Record<string, Record<string, CharacterInformation>> { }

1
noname/library/cheat.js Normal file
View File

@ -0,0 +1 @@
export class Cheat { }

View File

@ -2,5 +2,5 @@ import { config } from "./general/config.js";
export const general = {
name: "通用",
config: config
config
};

View File

@ -1,7 +1,187 @@
import { lowPerformance } from "./config/low-performance.js";
import { mountCombine } from "./config/mount-combine.js";
import { Is } from "../../../get/is.js";
import { Library } from "../../../library.js";
import { AUTO_CHECK_UPDATE } from "./config/auto-check-update.js";
import { AUTO_CONFIRM } from "./config/auto-confirm.js";
import { COMPATIBLE_MODE } from "./config/compatible-mode.js";
import { CONFIRM_EXIT } from "./config/confirm-exit.js";
import { DEVELOPER } from "./config/developer.js";
import { DOUBLE_CLICK_INTRODUCTION } from "./config/double-click-introduction.js";
import { ENABLE_DRAG_LINE } from "./config/enable-drag-line.js";
import { ENABLE_DRAG } from "./config/enable-drag.js";
import { ENABLE_TOUCH_DRAG_LINE } from "./config/enable-touch-drag-line.js";
import { ENABLE_VIBRATE } from "./config/enable-vibrate.js";
import { ERROR_STOP } from "./config/error-stop.js";
import { EXTENSION_CREATE } from "./config/extension-create.js";
import { EXTENSION_DELETE } from "./config/extension-delete.js";
import { EXTENSION_SOURCE } from "./config/extension-source.js";
import { FUCK_SO_JSON } from "./config/fuck-so-json.js";
import { GAME_SPEED } from "./config/game-speed.js";
import { HOVER_ALL } from "./config/hover-all.js";
import { HOVER_HAND_CARD } from "./config/hover-hand-card.js";
import { HOVERATION } from "./config/hoveration.js";
import { KEEP_AWAKE } from "./config/keep-awake.js";
import { LONG_PRESS_INFORMATION } from "./config/long-press-information.js";
import { LOW_PERFORMANCE } from "./config/low-performance.js";
import { LUCKY_STAR } from "./config/lucky-star.js";
import { MAXIMUM_LOAD_TIME } from "./config/maximum-load-time.js";
import { MOUNT_COMBINE } from "./config/mount-combine.js";
import { MOUSE_WHEEL } from "./config/mouse-wheel.js";
import { RIGHT_CLICK } from "./config/right-click.js";
import { RIGHT_INFORMATION } from "./config/right-information.js";
import { ROUND_MENU_FUNCTION } from "./config/round-menu-function.js";
import { SHOW_SPLASH } from "./config/show-splash.js";
import { SKIP_SHAN } from "./config/skip-shan.js";
import { SWIPE_DOWN } from "./config/swipe-down.js";
import { SWIPE_LEFT } from "./config/swipe-left.js";
import { SWIPE_RIGHT } from "./config/swipe-right.js";
import { SWIPE_UP } from "./config/swipe-up.js";
import { SWIPE } from "./config/swipe.js";
import { SYNCHRONIZE_SPEED } from "./config/synchronize-speed.js";
import { TAO_ENEMY } from "./config/tao-enemy.js";
import { TOUCHSCREEN } from "./config/touchscreen.js";
import { UN_AUTO_CHOOSE } from "./config/un-auto-choose.js";
import { UPDATE_LINK } from "./config/update-link.js";
import { VIDEO } from "./config/video.js";
import { WUXIE_SELF } from "./config/wuxie-self.js";
export const config = {
mount_combine: mountCombine,
low_performance: lowPerformance
mount_combine: MOUNT_COMBINE,
low_performance: LOW_PERFORMANCE,
compatiblemode: COMPATIBLE_MODE,
confirm_exit: CONFIRM_EXIT,
keep_awake: KEEP_AWAKE,
auto_confirm: AUTO_CONFIRM,
skip_shan: SKIP_SHAN,
unauto_choose: UN_AUTO_CHOOSE,
wuxie_self: WUXIE_SELF,
tao_enemy: TAO_ENEMY,
enable_drag: ENABLE_DRAG,
enable_dragline: ENABLE_DRAG_LINE,
enable_touchdragline: ENABLE_TOUCH_DRAG_LINE,
touchscreen: TOUCHSCREEN,
swipe: SWIPE,
swipe_down: SWIPE_DOWN,
swipe_up: SWIPE_UP,
swipe_left: SWIPE_LEFT,
swipe_right: SWIPE_RIGHT,
round_menu_func: ROUND_MENU_FUNCTION,
show_splash: SHOW_SPLASH,
game_speed: GAME_SPEED,
sync_speed: SYNCHRONIZE_SPEED,
enable_vibrate: ENABLE_VIBRATE,
right_click: RIGHT_CLICK,
longpress_info: LONG_PRESS_INFORMATION,
right_info: RIGHT_INFORMATION,
hover_all: HOVER_ALL,
hover_handcard: HOVER_HAND_CARD,
hoveration: HOVERATION,
doubleclick_intro: DOUBLE_CLICK_INTRODUCTION,
video: VIDEO,
max_loadtime: MAXIMUM_LOAD_TIME,
mousewheel: MOUSE_WHEEL,
auto_check_update: AUTO_CHECK_UPDATE,
lucky_star: LUCKY_STAR,
dev: DEVELOPER,
fuck_sojson: FUCK_SO_JSON,
errstop: ERROR_STOP,
update_link: UPDATE_LINK,
extension_source: EXTENSION_SOURCE,
extension_create: EXTENSION_CREATE,
extension_delete: EXTENSION_DELETE,
update(config, map) {
if ("ontouchstart" in document) {
map.touchscreen.show();
}
else {
map.touchscreen.hide();
}
if (Library.device || Library.node) {
map.auto_check_update.show();
}
else {
map.auto_check_update.hide();
}
if (Library.device) {
map.enable_vibrate.show();
map.keep_awake.show();
}
else {
map.enable_vibrate.hide();
map.keep_awake.hide();
}
if (config.touchscreen) {
map.mousewheel.hide();
map.hover_all.hide();
map.hover_handcard.hide();
map.hoveration.hide();
map.right_info.hide();
map.right_click.hide();
map.longpress_info.show();
map.swipe.show();
if (config.swipe) {
map.swipe_up.show();
map.swipe_down.show();
map.swipe_left.show();
map.swipe_right.show();
}
else {
map.swipe_up.hide();
map.swipe_down.hide();
map.swipe_left.hide();
map.swipe_right.hide();
}
}
else {
map.mousewheel.show();
map.hover_all.show();
map.right_info.show();
map.right_click.show();
map.longpress_info.hide();
if (!config.hover_all) {
map.hover_handcard.hide();
map.hoveration.hide();
}
else {
map.hover_handcard.show();
map.hoveration.show();
}
map.swipe.hide();
map.swipe_up.hide();
map.swipe_down.hide();
map.swipe_left.hide();
map.swipe_right.hide();
}
if (config.enable_drag) {
if (config.touchscreen) {
map.enable_dragline.hide();
map.enable_touchdragline.show();
}
else {
map.enable_dragline.show();
map.enable_touchdragline.hide();
}
}
else {
map.enable_dragline.hide();
map.enable_touchdragline.hide();
}
if (!Is.phoneLayout()) {
map.round_menu_func.hide();
}
else {
map.round_menu_func.show();
}
if (!Library.node && Library.device != "ios") {
map.confirm_exit.show();
}
else {
map.confirm_exit.hide();
}
if (config.dev) {
map.errstop.show();
}
else {
map.errstop.hide();
}
}
};

View File

@ -0,0 +1,6 @@
export const AUTO_CHECK_UPDATE = {
name: "自动检查游戏更新",
intro: "进入游戏时检查更新",
init: false,
unfrequent: true
};

View File

@ -0,0 +1,6 @@
export const AUTO_CONFIRM = {
name: "自动确认",
init: true,
unfrequent: true,
intro: "当候选目标只有1个时点击目标后无需再点击确认"
};

View File

@ -0,0 +1,17 @@
import { Game } from "../../../../game.js";
import { UI } from "../../../../ui.js";
export const COMPATIBLE_MODE = {
name: "兼容模式",
init: false,
intro: "开启兼容模式可防止扩展使游戏卡死并提高对旧扩展的兼容性,但对游戏速度有一定影响,若无不稳定或不兼容的扩展建议关闭",
onclick(bool) {
Game.saveConfig("compatiblemode", bool);
if (bool) {
UI.window.classList.add("compatiblemode");
}
else {
UI.window.classList.remove("compatiblemode");
}
}
};

View File

@ -0,0 +1,6 @@
export const CONFIRM_EXIT = {
name: "确认退出",
init: false,
unfrequent: true,
intro: "离开游戏前弹出确认对话框"
};

View File

@ -0,0 +1,26 @@
import { Game } from "../../../../game.js";
import { status } from "../../../../status.js";
import { Cheat } from "../../../cheat.js";
export const DEVELOPER = {
name: "开发者模式",
intro: "开启后可使用浏览器控制台控制游戏,同时可更新到开发版",
init: false,
onclick(bool) {
Game.saveConfig("dev", bool);
if (status.connectMode) return;
if (bool) {
Cheat.i();
}
else {
delete window.cheat;
delete window.game;
delete window.ui;
delete window.get;
delete window.ai;
delete window.lib;
delete window._status;
}
},
unfrequent: true
};

View File

@ -0,0 +1,6 @@
export const DOUBLE_CLICK_INTRODUCTION = {
name: "双击显示武将资料",
init: true,
unfrequent: true,
intro: "双击武将头像后显示其资料卡"
};

View File

@ -0,0 +1,6 @@
export const ENABLE_DRAG_LINE = {
name: "拖拽指示线",
init: true,
unfrequent: true,
intro: "拖拽时显示虚线,可能降低游戏速度"
};

View File

@ -0,0 +1,6 @@
export const ENABLE_DRAG = {
name: "启用拖拽",
init: true,
intro: "按住卡牌后可将卡牌拖至目标",
unfrequent: true
};

View File

@ -0,0 +1,6 @@
export const ENABLE_TOUCH_DRAG_LINE = {
name: "拖拽指示线",
init: false,
unfrequent: true,
intro: "拖拽时显示虚线,可能降低游戏速度"
};

View File

@ -0,0 +1,5 @@
export const ENABLE_VIBRATE = {
name: "开启震动",
intro: "回合开始时使手机震动",
init: false
};

View File

@ -0,0 +1,5 @@
export const ERROR_STOP = {
name: "出错时停止游戏",
init: false,
unfrequent: true
};

View File

@ -0,0 +1,51 @@
import { Game } from "../../../../game.js";
import { UI } from "../../../../ui.js";
import { Create } from "../../../../ui/create.js";
import { config } from "../../../config.js";
export const EXTENSION_CREATE = {
name: "添加获取扩展地址",
clear: true,
unfrequent: true,
onclick() {
Game.prompt("请输入地址名称", str => {
if (!str) return;
var map = config.extension_sources;
Game.prompt(`请输入${str}的地址`, str2 => {
if (!str2) return;
delete map[str];
map[str] = str2;
Game.saveConfig("extension_sources", map);
Game.saveConfig("extension_source", str);
var nodexx = UI.extension_source;
nodexx.updateInner();
var nodeyy = nodexx._link.menu;
var nodezz = nodexx._link.config;
for (var i = 0; i < nodeyy.childElementCount; i++) {
if (nodeyy.childNodes[i]._link != str) continue;
nodeyy.childNodes[i].remove();
break;
}
var textMenu = Create.div("", str, nodeyy, function () {
var node = this.parentNode._link;
var config = node._link.config;
node._link.current = this.link;
var tmpName = node.lastChild.innerHTML;
node.lastChild.innerHTML = config.item[this._link];
if (config.onclick && config.onclick.call(node, this._link, this) === false) {
node.lastChild.innerHTML = tmpName;
}
if (config.update) {
config.update();
}
});
textMenu._link = str;
nodezz.item[name] = str;
alert(`已添加扩展地址:${str}`);
});
});
}
};

View File

@ -0,0 +1,38 @@
import { Game } from "../../../../game.js";
import { UI } from "../../../../ui.js";
import { config } from "../../../config.js";
export const EXTENSION_DELETE = {
name: "删除当前扩展地址",
clear: true,
unfrequent: true,
onclick() {
var bool = false, map = config.extension_sources;
for (var i in map) {
if (i != config.extension_source) {
bool = true;
break;
}
}
if (!bool) {
alert("不能删除最后一个扩展地址!");
return;
}
var name = config.extension_source;
Game.saveConfig("extension_source", i);
delete map[name];
Game.saveConfig("extension_sources", map);
var nodexx = UI.extension_source;
nodexx.updateInner();
var nodeyy = nodexx._link.menu;
var nodezz = nodexx._link.config;
for (var i = 0; i < nodeyy.childElementCount; i++) {
if (nodeyy.childNodes[i]._link == name) {
nodeyy.childNodes[i].remove();
break;
}
}
delete nodezz.item[name];
alert(`已删除扩展地址:${name}`);
}
};

View File

@ -0,0 +1,13 @@
import { config } from "../../../config.js";
export const EXTENSION_SOURCE = {
name: "获取扩展地址",
init: "GitHub Proxy",
unfrequent: true,
get item() {
return config.extension_sources;
},
intro() {
return `获取在线扩展时的地址。当前地址:${document.createElement("br").outerHTML}${config.extension_sources[config.extension_source]}`;
}
};

View File

@ -0,0 +1,4 @@
export const FUCK_SO_JSON = {
name: "检测加密扩展",
init: false
};

View File

@ -0,0 +1,8 @@
import { ITEM } from "./game-speed/item.js";
export const GAME_SPEED = {
name: "游戏速度",
init: "mid",
item: ITEM,
intro: "设置不同游戏操作间的时间间隔"
};

View File

@ -0,0 +1,8 @@
export const ITEM = {
vslow: "慢",
slow: "较慢",
mid: "中",
fast: "较快",
vfast: "快",
vvfast: "很快"
};

View File

@ -0,0 +1,7 @@
export const HOVER_ALL = {
name: "悬停显示信息",
init: true,
unfrequent: true,
restart: true,
intro: "悬停后弹出菜单"
};

View File

@ -0,0 +1,6 @@
export const HOVER_HAND_CARD = {
name: "悬停手牌显示信息",
init: true,
unfrequent: true,
intro: "悬停手牌后弹出菜单"
};

View File

@ -0,0 +1,9 @@
import { ITEM } from "./hoveration/item.js";
export const HOVERATION = {
name: "悬停菜单弹出时间",
unfrequent: true,
intro: "鼠标移至目标到弹出菜单的时间间隔",
init: "1000",
item: ITEM
};

View File

@ -0,0 +1,7 @@
export const ITEM = {
"500": "0.5秒",
"700": "0.7秒",
"1000": "1秒",
"1500": "1.5秒",
"2500": "2.5秒"
};

View File

@ -0,0 +1,24 @@
import { Game } from "../../../../game.js";
export const KEEP_AWAKE = {
name: "屏幕常亮",
init: false,
unfrequent: true,
intro: `防止屏幕自动关闭${document.createElement("br").outerHTML}旧版本通过NoSleep.js实现的屏幕常亮可能会影响外置音频的音量`,
onclick(bool) {
Game.saveConfig("keep_awake", bool);
if (bool) {
if (window.plugins && window.plugins.insomnia) window.plugins.insomnia.keepAwake();
else if (window.noSleep) {
document.addEventListener(lib.config.touchscreen ? "touchend" : "click", function enableNoSleepX() {
document.removeEventListener(lib.config.touchscreen ? "touchend" : "click", enableNoSleepX, false);
window.noSleep.enable();
}, false);
}
}
else {
if (window.plugins && window.plugins.insomnia) window.plugins.insomnia.allowSleepAgain();
else if (window.noSleep) window.noSleep.disable();
}
}
};

View File

@ -0,0 +1,7 @@
export const LONG_PRESS_INFORMATION = {
name: "长按显示信息",
init: true,
unfrequent: true,
restart: true,
intro: "长按后弹出菜单"
};

View File

@ -1,7 +1,7 @@
import { Game } from "../../../../game.js";
import { UI } from "../../../../ui.js";
export const lowPerformance = {
export const LOW_PERFORMANCE = {
name: "流畅模式",
init: false,
intro: "减少部分游戏特效,提高游戏速度",

View File

@ -0,0 +1,6 @@
export const LUCKY_STAR = {
name: "幸运星模式",
intro: "在涉及随机数等的技能中,必定得到效果最好的结果。(联机模式无效)",
init: false,
unfrequent: true
};

View File

@ -0,0 +1,20 @@
import { Game } from "../../../../game.js";
import { Library } from "../../../../library.js";
import { ITEM } from "./maximum-load-time/item.js";
export const MAXIMUM_LOAD_TIME = {
name: "最长载入时间",
intro: "设置游戏从启动到完成载入所需的最长时间,超过此时间未完成载入会报错,若设备较慢或安装了较多扩展可适当延长此时间",
init: "5000",
unfrequent: true,
item: ITEM,
onclick(item) {
Game.saveConfig("max_loadtime", item);
if (item == "5000") {
localStorage.removeItem(`${Library.configprefix}loadtime`);
}
else {
localStorage.setItem(`${Library.configprefix}loadtime`, item);
}
}
};

View File

@ -0,0 +1,6 @@
export const ITEM = {
5000: "5秒",
10000: "10秒",
20000: "20秒",
60000: "60秒"
};

View File

@ -1,7 +1,7 @@
const listItem = document.createElement("li");
listItem.textContent = "将进攻坐骑栏和防御坐骑栏合并为同一个位置(重启后生效)。";
export const mountCombine = {
export const MOUNT_COMBINE = {
name: "合并坐骑栏",
init: false,
intro: listItem.outerHTML,

View File

@ -0,0 +1,23 @@
import { Game } from "../../../../game.js";
import { UI } from "../../../../ui.js";
import { Click } from "../../../../ui/click.js";
import { config } from "../../../config.js";
export const MOUSE_WHEEL = {
name: "滚轮控制手牌",
init: true,
unfrequent: true,
intro: "开启后滚轮可使手牌横向滚动在mac等可横向滚动的设备上建议关闭",
onclick(bool) {
Game.saveConfig("mousewheel", bool);
if (config.touchscreen) return;
if (config.mousewheel) {
UI.handcards1Container.onmousewheel = Click.mousewheel;
UI.handcards2Container.onmousewheel = Click.mousewheel;
}
else {
UI.handcards1Container.onmousewheel = null;
UI.handcards2Container.onmousewheel = null;
}
}
};

View File

@ -0,0 +1,15 @@
import { Game } from "../../../../game.js";
import { Is } from "../../../../get/is.js";
import { ITEM } from "./right-click/item.js";
export const RIGHT_CLICK = {
name: "右键操作",
init: "pause",
intro: "在空白区域点击右键时的操作",
unfrequent: true,
item: ITEM,
onclick(item) {
if (Is.nomenu("right_click", item)) return false;
Game.saveConfig("right_click", item);
}
};

View File

@ -0,0 +1,6 @@
export const ITEM = {
pause: "暂停",
shortcut: "工具",
config: "选项",
auto: "托管"
};

View File

@ -0,0 +1,7 @@
export const RIGHT_INFORMATION = {
name: "右键显示信息",
init: true,
unfrequent: true,
restart: true,
intro: "右键点击后弹出菜单"
};

View File

@ -0,0 +1,15 @@
import { Game } from "../../../../game.js";
import { Is } from "../../../../get/is.js";
import { ITEM } from "./round-menu-function/item.js";
export const ROUND_MENU_FUNCTION = {
name: "触屏按钮操作",
intro: "点击屏幕中圆形按钮时执行的操作",
init: "system",
unfrequent: true,
item: ITEM,
onclick(item) {
if (Is.nomenu("round_menu_func", item)) return false;
Game.saveConfig("round_menu_func", item);
}
};

View File

@ -0,0 +1,6 @@
export const ITEM = {
system: "显示按钮",
menu: "打开菜单",
pause: "切换暂停",
auto: "切换托管"
};

View File

@ -0,0 +1,8 @@
import { ITEM } from "./show-splash/item.js";
export const SHOW_SPLASH = {
name: "显示开始界面",
intro: "游戏开始前进入模式选择画面",
init: "init",
item: ITEM
};

View File

@ -0,0 +1,5 @@
export const ITEM = {
off: "关闭",
init: "首次启动",
always: "保持开启"
};

View File

@ -0,0 +1,6 @@
export const SKIP_SHAN = {
name: "无闪自动取消",
init: false,
unfrequent: true,
intro: "当自己需要使用或打出【闪】时,若自己没有【闪】,则跳过该步骤"
};

View File

@ -0,0 +1,15 @@
import { Game } from "../../../../game.js";
import { Is } from "../../../../get/is.js";
import { SWIPE_ITEM } from "./swipe-item.js";
export const SWIPE_DOWN = {
name: "下划操作",
init: "menu",
unfrequent: true,
intro: "向下滑动时执行的操作",
item: SWIPE_ITEM,
onclick(item) {
if (Is.nomenu("swipe_down", item)) return false;
Game.saveConfig("swipe_down", item);
}
};

View File

@ -0,0 +1,8 @@
export const SWIPE_ITEM = {
system: "显示按钮",
menu: "打开菜单",
pause: "切换暂停",
auto: "切换托管",
chat: "显示聊天",
off: "关闭"
};

View File

@ -0,0 +1,15 @@
import { Game } from "../../../../game.js";
import { Is } from "../../../../get/is.js";
import { SWIPE_ITEM } from "./swipe-item.js";
export const SWIPE_LEFT = {
name: "左划操作",
intro: "向左滑动时执行的操作",
init: "system",
unfrequent: true,
item: SWIPE_ITEM,
onclick(item) {
if (Is.nomenu("swipe_left", item)) return false;
Game.saveConfig("swipe_left", item);
}
};

View File

@ -0,0 +1,15 @@
import { Game } from "../../../../game.js";
import { Is } from "../../../../get/is.js";
import { SWIPE_ITEM } from "./swipe-item.js";
export const SWIPE_RIGHT = {
name: "右划操作",
intro: "向右滑动时执行的操作",
init: "system",
unfrequent: true,
item: SWIPE_ITEM,
onclick(item) {
if (Is.nomenu("swipe_right", item)) return false;
Game.saveConfig("swipe_right", item);
}
};

View File

@ -0,0 +1,15 @@
import { Game } from "../../../../game.js";
import { Is } from "../../../../get/is.js";
import { SWIPE_ITEM } from "./swipe-item.js";
export const SWIPE_UP = {
name: "上划操作",
intro: "向上滑动时执行的操作",
init: "auto",
unfrequent: true,
item: SWIPE_ITEM,
onclick(item) {
if (Is.nomenu("swipe_up", item)) return false;
Game.saveConfig("swipe_up", item);
}
};

View File

@ -0,0 +1,6 @@
export const SWIPE = {
name: "滑动手势",
init: true,
unfrequent: true,
intro: "在非滚动区域向四个方向滑动可执行对应操作"
};

View File

@ -0,0 +1,5 @@
export const SYNCHRONIZE_SPEED = {
name: "限制结算速度",
intro: "在动画结算完成前不执行下一步操作,开启后游戏操作的间隔更长但画面更浏畅,在游戏较卡时建议开启",
init: true
};

View File

@ -0,0 +1,6 @@
export const TAO_ENEMY = {
name: "不对敌方出桃",
init: false,
intro: "双方阵营明确的模式中(如对决),敌方角色濒死时不询问出桃",
unfrequent: true
};

View File

@ -0,0 +1,14 @@
import { Game } from "../../../../game.js";
import { Is } from "../../../../get/is.js";
export const TOUCHSCREEN = {
name: "触屏模式",
init: false,
restart: true,
unfrequent: true,
intro: "开启后可使触屏设备反应更快,但无法使用鼠标操作",
onclick(bool) {
if (Is.nomenu("touchscreen", bool)) return false;
Game.saveConfig("touchscreen", bool);
}
};

View File

@ -0,0 +1,6 @@
export const UN_AUTO_CHOOSE = {
name: "拆顺手牌选择",
init: false,
unfrequent: true,
intro: "拆牌或者顺牌时,就算只能选择对方的手牌依然手动选择"
};

View File

@ -0,0 +1,15 @@
import { Game } from "../../../../game.js";
import { Library } from "../../../../library.js";
import { updateURLs } from "../../../update-urls.js";
import { ITEM } from "./update-link/item.js";
export const UPDATE_LINK = {
name: "更新地址",
init: "coding",
unfrequent: true,
item: ITEM,
onclick(item) {
Game.saveConfig("update_link", item);
Library.updateURL = updateURLs[item] || updateURLs.coding;
}
};

View File

@ -0,0 +1,4 @@
export const ITEM = {
coding: "CSDN",
github: "GitHub"
};

View File

@ -0,0 +1,9 @@
import { ITEM } from "./video/item.js";
export const VIDEO = {
name: "保存录像",
init: "20",
intro: "游戏结束后保存录像在最大条数,超过后将从最早的录像开始删除(已收藏的录像不计入条数)",
item: ITEM,
unfrequent: true
};

View File

@ -0,0 +1,8 @@
export const ITEM = {
"0": "关闭",
"5": "五局",
"10": "十局",
"20": "二十局",
"50": "五十局",
"10000": "无限"
};

View File

@ -0,0 +1,6 @@
export const WUXIE_SELF = {
name: "不无懈自己",
init: true,
unfrequent: true,
intro: "自己使用的单目标普通锦囊即将生效时,不询问无懈"
};

View File

@ -1,4 +1,5 @@
interface Config extends Record<string, any> {
extension_sources: Record<string, string>;
favouriteCharacter: string[];
}

View File

@ -1,4 +1,4 @@
import { Player } from "./element/player";
import { Player } from "./element/player.js";
interface DynamicTranslate extends Record<string, (player: Player) => string> { }

View File

@ -1,7 +1,9 @@
import { GameEvent } from "./element/game-event.js";
import { Player } from "./element/player.js";
import { VCard } from "./element/v-card.js";
export const element = {
Player,
VCard,
GameEvent
};

View File

@ -1,5 +1,5 @@
import { GameEvent } from "./library/element/game-event.js";
import { aiStatus } from "./status/ai.js";
import { ai } from "./status/ai.js";
import { cardTag } from "./status/card-tag.js";
import { postReconnect } from "./status/post-reconnect.js";
@ -11,7 +11,7 @@ export const status = {
clicked: false,
auto: false,
event: GameEvent.initialGameEvent(),
ai: aiStatus,
ai,
lastdragchange: [],
skillaudio: [],
dieClose: [],

View File

@ -1,7 +1,7 @@
import { Player } from "../library/element/player";
import { Player } from "../library/element/player.js";
interface AIStatus extends Record<string, any> {
interface AI extends Record<string, any> {
customAttitude: ((from: Player, to: Player) => number)[];
}
export const aiStatus: AIStatus;
export const ai: AI;

View File

@ -1,3 +1,3 @@
export const aiStatus = {
export const ai = {
customAttitude: []
};

View File

@ -2,7 +2,7 @@ import { GameEvent } from "../library/element/game-event";
export interface GlobalHistory {
cardMove: GameEvent[];
custom: any[];
custom: unknown[];
useCard: GameEvent[];
changeHp: GameEvent[];
everything: GameEvent[];

1
noname/ui/create.js Normal file
View File

@ -0,0 +1 @@
export class Create { }