Merge branch 'libccy:PR-Branch' into PR-Branch
This commit is contained in:
commit
55913de845
|
@ -814,6 +814,7 @@ export class Get extends Uninstantable {
|
|||
"[object Object]": true,
|
||||
"[object Array]": true,
|
||||
"[object Arguments]": true,
|
||||
"[object Date]": true
|
||||
};
|
||||
|
||||
if (typeof obj !== "object" || obj === null || !canTranverse[getType(obj)])
|
||||
|
@ -827,16 +828,22 @@ export class Get extends Uninstantable {
|
|||
const target =
|
||||
constructor
|
||||
? (
|
||||
// 这三类数据处理单独处理
|
||||
// 这四类数据处理单独处理
|
||||
// (实际上需要处理的只有Map和Set)
|
||||
// 除此之外的就只能祝愿有拷贝构造函数了
|
||||
(Array.isArray(obj) || obj instanceof Map || obj instanceof Set)
|
||||
(Array.isArray(obj) || obj instanceof Map || obj instanceof Set || constructor === Object)
|
||||
// @ts-ignore
|
||||
? new constructor()
|
||||
: (
|
||||
(constructor.name in window && /\[native code\]/.test(constructor.toString()))
|
||||
// @ts-ignore
|
||||
: new constructor(obj)
|
||||
? new constructor(obj)
|
||||
: obj
|
||||
)
|
||||
)
|
||||
: Object.create(null);
|
||||
if (target === obj) return target;
|
||||
|
||||
map.set(obj, target);
|
||||
|
||||
if (obj instanceof Map) {
|
||||
|
|
|
@ -468,6 +468,7 @@ export async function boot() {
|
|||
|
||||
if (extensionlist.length && (config.get('mode') != 'connect' || show_splash)) {
|
||||
_status.extensionLoading = [];
|
||||
_status.extensionLoaded = [];
|
||||
|
||||
const bannedExtensions = Reflect.get(window, 'bannedExtensions');
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ export class VCard {
|
|||
* @param { string } [nature]
|
||||
*/
|
||||
constructor(suitOrCard, numberOrCards, name, nature) {
|
||||
|
||||
if (Array.isArray(suitOrCard)) {
|
||||
/**
|
||||
* @type {string}
|
||||
|
@ -92,8 +91,6 @@ export class VCard {
|
|||
if (typeof nature == 'string') this.nature = nature;
|
||||
if (!this.storage) this.storage = {};
|
||||
if (!this.cards) this.cards = [];
|
||||
|
||||
this._args = [suitOrCard, numberOrCards, name, nature];
|
||||
}
|
||||
sameSuitAs(card) {
|
||||
return get.suit(this) == get.suit(card);
|
||||
|
|
|
@ -4190,7 +4190,7 @@ class Create extends Uninstantable {
|
|||
}
|
||||
editnode.classList.remove('disabled');
|
||||
};
|
||||
var clickButton = async () => {
|
||||
var clickButton = async function () {
|
||||
if (currentButton == this) {
|
||||
resetEditor();
|
||||
return;
|
||||
|
@ -8652,6 +8652,48 @@ class Create extends Uninstantable {
|
|||
clickCapt.call(node[lib.config.character_dialog_tool]);
|
||||
}
|
||||
}
|
||||
|
||||
//仅仅下面是新加的,by Curpond
|
||||
|
||||
let container = dialog.querySelector('.content-container>.content')
|
||||
let Searcher = ui.create.div('.searcher.caption')
|
||||
let input = document.createElement('input')
|
||||
input.style.textAlign = 'center'
|
||||
input.style.border = 'solid 2px #294510'
|
||||
input.style.borderRadius = '6px'
|
||||
input.style.fontWeight = 'bold'
|
||||
input.style.fontSize = '21px'
|
||||
let find = ui.create.button(['find', '搜索'], 'tdnodes')
|
||||
find.style.display = 'inline'
|
||||
let clickfind = function (e) {
|
||||
e.stopPropagation()
|
||||
let value = input.value
|
||||
if (value == '') {
|
||||
game.alert('搜索不能为空')
|
||||
input.focus()
|
||||
return
|
||||
}
|
||||
let list = []
|
||||
for (let btn of dialog.buttons) {
|
||||
|
||||
if ((new RegExp(value, 'g').test(get.translation(btn.link)))) {
|
||||
btn.classList.remove('nodisplay')
|
||||
} else {
|
||||
btn.classList.add('nodisplay')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
input.addEventListener('keyup', (e) => {
|
||||
|
||||
if (e.key == 'Enter') clickfind(e)
|
||||
})
|
||||
find.listen(clickfind)
|
||||
Searcher.appendChild(input)
|
||||
Searcher.appendChild(find)
|
||||
container.prepend(Searcher)
|
||||
|
||||
|
||||
return dialog;
|
||||
}
|
||||
static dialog() {
|
||||
|
|
Loading…
Reference in New Issue