!= to !==

This commit is contained in:
2025-05-28 20:12:56 +08:00
parent 34eec38036
commit 8da20ab53e
6 changed files with 11 additions and 11 deletions

View File

@@ -42,7 +42,7 @@ export class DOStage {
}
const levelStr = LevelManager.getInstance().getLevelStr(this.data.difficulty, this.data.index)
if (!levelStr || levelStr.length != 81) {
if (!levelStr || levelStr.length !== 81) {
console.log("levelStr error", this.data.difficulty, this.data.index, levelStr)
}
const list = new Map()

View File

@@ -92,7 +92,7 @@ export class DOUser {
}
public set_trophyNew(record: TrophyRecord, isNew: boolean): void {
if (record.isNew != isNew) {
if (record.isNew !== isNew) {
record.isNew = isNew
StorageManager.getInstance().onUserChanged()
}

View File

@@ -131,7 +131,7 @@ export class LevelManager {
// 检查关卡配置
this.levelMap.forEach((list, key) => {
for (let i = 0; i < list.length; i++) {
if (list[i].length != 81) {
if (list[i].length !== 81) {
console.error("关卡配置有误>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", key, i)
}
}

View File

@@ -130,7 +130,7 @@ export class Block extends Laya.Script {
if (score > 0)
G_ShowScoreTips(score.toString(), this.label_show.parent)
} else {
if (this.data.get_score() != 0)
if (this.data.get_score() !== 0)
this.data.set_score(0)
}
this.data.clean_notes()

View File

@@ -222,7 +222,7 @@ export class Stage extends Laya.Script {
for (let i = 0; i < blocks.length; i++) {
score += blocks[i].get_score()
}
if (this.score_current != score) { // 分数发生变化
if (this.score_current !== score) { // 分数发生变化
this.score_current = score
this.score_step = Math.ceil((this.score_current - this.score_last) / 24)
if (this.score_current > this.score_last)
@@ -238,7 +238,7 @@ export class Stage extends Laya.Script {
if (this.score_animation_wait_frame < 0)
this.score_animation_wait_frame = 0
if (this.score_animation_wait_frame <= 0) {
if (this.score_current != this.score_last) {
if (this.score_current !== this.score_last) {
if (this.score_current > this.score_last) {
this.score_last += this.score_step
if (this.score_last > this.score_current)
@@ -286,7 +286,7 @@ export class Stage extends Laya.Script {
if (animated) { // 填数状态播放闪动效果
for (var i = 0; i < relateds.length; i++) { // 相关且数字相同
if (relateds[i].getData().get_show() === block.getData().get_show()) { // 播放变红动效
if (relateds[i].getData().get_index() != block.getData().get_index()) {
if (relateds[i].getData().get_index() !== block.getData().get_index()) {
// relateds[i].setBlockColor(config.BLOCK_COLOR.WHITE)
relateds[i].setBlockColor(config.BLOCK_COLOR.RED, 0.4, true, config.BLOCK_COLOR.GREY, 1)
}
@@ -295,7 +295,7 @@ export class Stage extends Laya.Script {
} else {
for (var i = 0; i < relateds.length; i++) { // 相关且数字相同
if (relateds[i].getData().get_show() === block.getData().get_show()) { // 直接变红
if (relateds[i].getData().get_index() != block.getData().get_index()) {
if (relateds[i].getData().get_index() !== block.getData().get_index()) {
relateds[i].setBlockColor(config.BLOCK_COLOR.RED, 0.4)
}
}
@@ -355,7 +355,7 @@ export class Stage extends Laya.Script {
}
onClickNote(evt: Laya.Event): void {
if (evt != null) {
if (evt !== null) {
this.data.set_note_open(!this.data.get_note_open())
}
this.btn_note_normal.visible = this.data.get_note_open() === false
@@ -428,7 +428,7 @@ export class Stage extends Laya.Script {
} else {
for (var i = 0; i < relateds.length; i++) {
const obj = relateds[i]
if (obj.getData().get_show() === showNumber && obj.getData().get_index() != this.selectedBlock.getData().get_index()) {
if (obj.getData().get_show() === showNumber && obj.getData().get_index() !== this.selectedBlock.getData().get_index()) {
obj.setFadeAnimation()
}
}

View File

@@ -87,7 +87,7 @@ export class TopBar extends Laya.Script {
obj.on(Laya.Event.CLICK, this, (evt: Laya.Event) => {
const common = evt.target.getComponent(CommonData)
const difficulty = Laya.LocalStorage.getItem("difficulty")
if (common.strValue != difficulty) {
if (common.strValue !== difficulty) {
if (Laya.LocalStorage.getItem("showToggle") === "true") {
const title = "Start New Game"
const content = "Current game progress will be lost"