弹窗优化

This commit is contained in:
Spmario233 2024-02-17 20:34:51 +08:00
parent d054a49d68
commit 4aa5de80d4
3 changed files with 10 additions and 2 deletions

View File

@ -1888,7 +1888,8 @@ export class Game extends Uninstantable {
delete _status.extension;
}
}catch(e1){
alert(`加载《${name}》扩展的precontent时出错。\n${decodeURI(e1.stack)}`);
console.log(`加载《${name}》扩展的precontent时出现错误。`,e1);
if(!lib.config.extension_alert) alert(`加载《${name}》扩展的precontent时出现错误。\n该错误本身可能并不影响扩展运行。您可以在“设置→通用→无视扩展报错”中关闭此弹窗。\n${decodeURI(e1.stack)}`);
}
if (content) lib.extensions.push([name, content, config, _status.evaluatingExtension, objectPackage || {}]);

View File

@ -590,7 +590,8 @@ export async function onload(resetGameTimeout) {
try{
await (gnc.is.coroutine(lib.extensions[i][1]) ? gnc.of(lib.extensions[i][1]) : lib.extensions[i][1]).call(lib.extensions[i], lib.extensions[i][2], lib.extensions[i][4]);
}catch(e){
alert(`加载《${lib.extensions[i][0]}》扩展的content时出错。\n${decodeURI(e.stack)}`);
console.log(`加载《${lib.extensions[i][0]}》扩展的content时出现错误。`,e);
if(!lib.config.extension_alert) alert(`加载《${lib.extensions[i][0]}》扩展的content时出现错误。\n该错误本身可能并不影响扩展运行。您可以在“设置→通用→无视扩展报错”中关闭此弹窗。\n${decodeURI(e.stack)}`);
}
if (lib.extensions[i][4]) {
if (lib.extensions[i][4].character) {

View File

@ -1132,9 +1132,15 @@ export class Library extends Uninstantable {
},
unfrequent: true,
},
extension_alert: {
name: '无视扩展报错',
init: false,
unfrequent: true,
},
fuck_sojson: {
name: '检测加密扩展',
init: false,
unfrequent: true,
},
errstop: {
name: '出错时停止游戏',