代码格式化
This commit is contained in:
@@ -48,10 +48,10 @@ export const respath = {
|
|||||||
return config.H_SCREEN ? "resources/dc/TrophyRoomCell_H.lh" : "resources/dc/TrophyRoomCell.lh"
|
return config.H_SCREEN ? "resources/dc/TrophyRoomCell_H.lh" : "resources/dc/TrophyRoomCell.lh"
|
||||||
},
|
},
|
||||||
|
|
||||||
font_Bold : "fonts/Inter-Bold-700.ttf",
|
font_Bold: "fonts/Inter-Bold-700.ttf",
|
||||||
font_Medium : "fonts/Inter-Medium-500.ttf",
|
font_Medium: "fonts/Inter-Medium-500.ttf",
|
||||||
font_Regular : "fonts/Inter-Regular-400.ttf",
|
font_Regular: "fonts/Inter-Regular-400.ttf",
|
||||||
font_SemiBold : "fonts/Inter-SemiBold-600.ttf",
|
font_SemiBold: "fonts/Inter-SemiBold-600.ttf",
|
||||||
|
|
||||||
// ===============================
|
// ===============================
|
||||||
bg_done: "images/bg_done.png",
|
bg_done: "images/bg_done.png",
|
||||||
@@ -64,10 +64,9 @@ export const respath = {
|
|||||||
home_top_dc_bg_finish: "images/bg_dc_top2.png",
|
home_top_dc_bg_finish: "images/bg_dc_top2.png",
|
||||||
dc_top_bg_normal: "images/img_dc_bg2.png",
|
dc_top_bg_normal: "images/img_dc_bg2.png",
|
||||||
dc_top_bg_finish: "images/img_dc_finished.png",
|
dc_top_bg_finish: "images/img_dc_finished.png",
|
||||||
dc_lights: new Array(),
|
|
||||||
get_dc_lights: function func(): string[] {
|
get_dc_lights: function func(): string[] {
|
||||||
|
const dc_lights: Array<string> = []
|
||||||
const prefix = "sequences/lottie_trophy_light_2x/lottie_trophy_light_2x_00"
|
const prefix = "sequences/lottie_trophy_light_2x/lottie_trophy_light_2x_00"
|
||||||
if (respath.dc_lights.length < 1) {
|
|
||||||
for (let i = 0; i < 120; i++) {
|
for (let i = 0; i < 120; i++) {
|
||||||
let endStr = i.toString()
|
let endStr = i.toString()
|
||||||
if (i < 10) {
|
if (i < 10) {
|
||||||
@@ -76,10 +75,9 @@ export const respath = {
|
|||||||
endStr = `0${i}`
|
endStr = `0${i}`
|
||||||
}
|
}
|
||||||
const path = `${prefix + endStr}.png`
|
const path = `${prefix + endStr}.png`
|
||||||
respath.dc_lights.push(path)
|
dc_lights.push(path)
|
||||||
}
|
}
|
||||||
}
|
return dc_lights
|
||||||
return respath.dc_lights
|
|
||||||
},
|
},
|
||||||
|
|
||||||
trophy_bg_light_gold: "trophys/img_trophy_bg_light_gold.png",
|
trophy_bg_light_gold: "trophys/img_trophy_bg_light_gold.png",
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export class ResourceManager {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private started : boolean = false
|
private started: boolean = false
|
||||||
public startSchedule(): void {
|
public startSchedule(): void {
|
||||||
if (this.started)
|
if (this.started)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Stage } from "./Stage"
|
import type { Stage } from "./Stage"
|
||||||
|
|
||||||
const { regClass } = Laya
|
const { regClass } = Laya
|
||||||
|
|
||||||
@@ -22,20 +22,20 @@ export class Candy extends Laya.Script {
|
|||||||
|
|
||||||
public onInit(handler: any): void {
|
public onInit(handler: any): void {
|
||||||
this._stage = handler
|
this._stage = handler
|
||||||
this.owner.on(Laya.Event.CLICK, this, ()=>{
|
this.owner.on(Laya.Event.CLICK, this, () => {
|
||||||
if (this.available === false)
|
if (this.available === false)
|
||||||
return
|
return
|
||||||
this._stage.onApplyCandy(this.show, false)
|
this._stage.onApplyCandy(this.show, false)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.owner.on(Laya.Event.MOUSE_DOWN, this, ()=>{
|
this.owner.on(Laya.Event.MOUSE_DOWN, this, () => {
|
||||||
if (this.available === false)
|
if (this.available === false)
|
||||||
return
|
return
|
||||||
Laya.Tween.to(this.bg_sprite, { alpha: 0 }, 200)
|
Laya.Tween.to(this.bg_sprite, { alpha: 0 }, 200)
|
||||||
Laya.Tween.to(this.mask_sprite, { alpha: 0.1 }, 200)
|
Laya.Tween.to(this.mask_sprite, { alpha: 0.1 }, 200)
|
||||||
Laya.Tween.to(this.offset, { scaleX: 0.92, scaleY: 0.92 }, 200)
|
Laya.Tween.to(this.offset, { scaleX: 0.92, scaleY: 0.92 }, 200)
|
||||||
})
|
})
|
||||||
this.owner.on(Laya.Event.MOUSE_UP, this, ()=>{
|
this.owner.on(Laya.Event.MOUSE_UP, this, () => {
|
||||||
if (this.available === false)
|
if (this.available === false)
|
||||||
return
|
return
|
||||||
Laya.Tween.to(this.bg_sprite, { alpha: 0.12 }, 200)
|
Laya.Tween.to(this.bg_sprite, { alpha: 0.12 }, 200)
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ export class Difficulty extends Laya.Script {
|
|||||||
private offset: Laya.Box
|
private offset: Laya.Box
|
||||||
// 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
|
// 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
|
||||||
onAwake(): void {
|
onAwake(): void {
|
||||||
|
|
||||||
this.offset = this.owner.getChildByName("bottom").getChildByName("offset") as Laya.Box
|
this.offset = this.owner.getChildByName("bottom").getChildByName("offset") as Laya.Box
|
||||||
this.offset.y = this.offset.width
|
this.offset.y = this.offset.width
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ export class UISequenceAnimation extends Laya.Script {
|
|||||||
this.owner.skin = path
|
this.owner.skin = path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.currentIndex++
|
this.currentIndex++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export class CalendarUnit extends Laya.Script {
|
|||||||
this.sprite_pie.graphics.clear()
|
this.sprite_pie.graphics.clear()
|
||||||
this.sprite_pie.graphics.drawPie(this.pieSize, this.pieSize, this.pieSize, 0, 360 * this.progress, "#ffffff")
|
this.sprite_pie.graphics.drawPie(this.pieSize, this.pieSize, this.pieSize, 0, 360 * this.progress, "#ffffff")
|
||||||
this.sprite_mask.graphics.clear()
|
this.sprite_mask.graphics.clear()
|
||||||
this.sprite_mask.graphics.drawCircle(this.obj_mask.width/2, this.obj_mask.width/2, this.obj_mask.width/2, "#1d5cdc")
|
this.sprite_mask.graphics.drawCircle(this.obj_mask.width / 2, this.obj_mask.width / 2, this.obj_mask.width / 2, "#1d5cdc")
|
||||||
} else {
|
} else {
|
||||||
this.obj_pie.visible = false
|
this.obj_pie.visible = false
|
||||||
this.obj_mask.visible = false
|
this.obj_mask.visible = false
|
||||||
@@ -113,7 +113,7 @@ export class CalendarUnit extends Laya.Script {
|
|||||||
this.sprite_pie.graphics.clear()
|
this.sprite_pie.graphics.clear()
|
||||||
this.sprite_pie.graphics.drawPie(this.pieSize, this.pieSize, this.pieSize, 0, 360 * this.progress, "#2d3138")
|
this.sprite_pie.graphics.drawPie(this.pieSize, this.pieSize, this.pieSize, 0, 360 * this.progress, "#2d3138")
|
||||||
this.sprite_mask.graphics.clear()
|
this.sprite_mask.graphics.clear()
|
||||||
this.sprite_mask.graphics.drawCircle(this.obj_mask.width/2, this.obj_mask.width/2, this.obj_mask.width/2, "#ffffff")
|
this.sprite_mask.graphics.drawCircle(this.obj_mask.width / 2, this.obj_mask.width / 2, this.obj_mask.width / 2, "#ffffff")
|
||||||
} else {
|
} else {
|
||||||
this.obj_pie.visible = false
|
this.obj_pie.visible = false
|
||||||
this.obj_mask.visible = false
|
this.obj_mask.visible = false
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export class TrophyRoom extends Laya.Script {
|
|||||||
}
|
}
|
||||||
let index = -1
|
let index = -1
|
||||||
for (let j = 1; j < cellCount + 1; j++) {
|
for (let j = 1; j < cellCount + 1; j++) {
|
||||||
let obj_cell = obj_year.getChildAt(j)
|
const obj_cell = obj_year.getChildAt(j)
|
||||||
const hbox = obj_cell.getChildByName("HBox")
|
const hbox = obj_cell.getChildByName("HBox")
|
||||||
for (let k = 0; k < hbox.numChildren; k++) {
|
for (let k = 0; k < hbox.numChildren; k++) {
|
||||||
const unit = hbox.getChildAt(k).getComponent(TrophyUnit)
|
const unit = hbox.getChildAt(k).getComponent(TrophyUnit)
|
||||||
|
|||||||
Reference in New Issue
Block a user