修复uninit数据和图标不同步的问题

This commit is contained in:
kuangshen04 2024-01-22 14:36:32 +08:00
parent b323fd836c
commit 7b994e53cb
1 changed files with 13 additions and 21 deletions

View File

@ -2096,9 +2096,6 @@ export class Player extends HTMLDivElement {
} }
} }
uninit() { uninit() {
this.expandedSlots = {};
this.disabledSlots = {};
delete this.name; delete this.name;
delete this.name1; delete this.name1;
delete this.tempname; delete this.tempname;
@ -2107,21 +2104,14 @@ export class Player extends HTMLDivElement {
delete this.hp; delete this.hp;
delete this.maxHp; delete this.maxHp;
delete this.hujia; delete this.hujia;
this.clearSkills(true);
if (this.name2) { if (this.name2) {
delete this.singleHp; delete this.singleHp;
delete this.name2; delete this.name2;
} }
for (var mark in this.marks) {
this.marks[mark].remove();
}
ui.updatem(this);
this.skipList = []; this.skipList = [];
this.skills = this.skills.filter(skill => { this.clearSkills(true);
return lib.skill[skill] && lib.skill[skill].superCharlotte;
});
this.initedSkills = []; this.initedSkills = [];
this.additionalSkills = {}; this.additionalSkills = {};
this.disabledSkills = {}; this.disabledSkills = {};
@ -2133,6 +2123,8 @@ export class Player extends HTMLDivElement {
this.tempSkills = {}; this.tempSkills = {};
this.storage = {}; this.storage = {};
this.marks = {}; this.marks = {};
this.expandedSlots = {};
this.disabledSlots = {};
this.ai = { friend: [], enemy: [], neutral: [] }; this.ai = { friend: [], enemy: [], neutral: [] };
this.$uninit(); this.$uninit();
@ -2140,10 +2132,10 @@ export class Player extends HTMLDivElement {
return this; return this;
} }
$uninit() { $uninit() {
this.$syncExpand();
this.$syncDisable(); this.$syncDisable();
if (this.isDisabledJudge()) {
game.broadcastAll(function (player) { game.broadcastAll(function (player) {
player.storage._disableJudge = false; delete player.storage._disableJudge;
for (var i = 0; i < player.node.judges.childNodes.length; i++) { for (var i = 0; i < player.node.judges.childNodes.length; i++) {
if (player.node.judges.childNodes[i].name == 'disable_judge') { if (player.node.judges.childNodes[i].name == 'disable_judge') {
player.node.judges.removeChild(player.node.judges.childNodes[i]); player.node.judges.removeChild(player.node.judges.childNodes[i]);
@ -2151,7 +2143,7 @@ export class Player extends HTMLDivElement {
} }
} }
}, this); }, this);
}
this.node.avatar.hide(); this.node.avatar.hide();
this.node.count.hide(); this.node.count.hide();
if (this.node.wuxing) { if (this.node.wuxing) {