添加横屏页面

This commit is contained in:
2025-05-26 19:57:17 +08:00
parent 354194358b
commit 468f40351d
71 changed files with 11796 additions and 42067 deletions

View File

@@ -1,3 +1,5 @@
import { config } from "../../constants/config";
const { regClass, property } = Laya;
@regClass()
@@ -89,6 +91,10 @@ export class CalendarUnit extends Laya.Script {
this.obj_star.visible = this.progress >= 1
var blockSize = 48
if (config.H_SCREEN)
blockSize = 33
if (this.selected) {
this.label_show.color = "#ffffff"
this.obj_selected.visible = true
@@ -96,7 +102,7 @@ export class CalendarUnit extends Laya.Script {
this.obj_pie.visible = true
this.obj_mask.visible = true
this.sprite_pie.graphics.clear()
this.sprite_pie.graphics.drawPie(48, 48, 48, 0, 360*this.progress, "#ffffff")
this.sprite_pie.graphics.drawPie(blockSize, blockSize, blockSize, 0, 360*this.progress, "#ffffff")
this.sprite_mask.graphics.clear()
this.sprite_mask.graphics.drawCircle(0.5, 0.5, 0.5, "#1d5cdc")
}
@@ -112,7 +118,7 @@ export class CalendarUnit extends Laya.Script {
this.obj_pie.visible = true
this.obj_mask.visible = true
this.sprite_pie.graphics.clear()
this.sprite_pie.graphics.drawPie(48, 48, 48, 0, 360*this.progress, "#2d3138")
this.sprite_pie.graphics.drawPie(blockSize, blockSize, blockSize, 0, 360*this.progress, "#2d3138")
this.sprite_mask.graphics.clear()
this.sprite_mask.graphics.drawCircle(0.5, 0.5, 0.5, "#ffffff")
}

View File

@@ -60,10 +60,12 @@ export class DailyChallenge extends Laya.Script {
private indexMax: number
onAwake(): void {
this.btn_back.on(Laya.Event.CLICK, this, ()=>{
UIManager.getInstance().loadHomeUI()
this.owner.destroy()
})
if (this.btn_back) {
this.btn_back.on(Laya.Event.CLICK, this, ()=>{
UIManager.getInstance().loadHomeUI()
UIManager.getInstance().closeDCUI()
})
}
var user = StorageManager.getInstance().getUser()
this.btn_trophy_red.visible = user.get_trophyHasUnread()
@@ -80,7 +82,7 @@ export class DailyChallenge extends Laya.Script {
var month = now.getMonth() + 1
var dayNow = this.selectedUnit.day
var stageID = `${year}-${month}-${dayNow}`
var doStage = StorageManager.getInstance().loadStage(stageID)
var doStage = StorageManager.getInstance().getStage(stageID)
console.log("play >>>>>>>>>>>>>>>>>>>>>>>", stageID, doStage)
if (!doStage) {
var stageName = `${config.MONTH_ABBRS[month-1]} ${dayNow}`
@@ -217,7 +219,7 @@ export class DailyChallenge extends Laya.Script {
if (progress >= 1) {
this.btn_play.visible = false
this.obj_summary.visible = true
var doStage = StorageManager.getInstance().loadStage(stageID)
var doStage = StorageManager.getInstance().getStage(stageID)
this.label_diffucuty.text = doStage.get_difficulty()
this.label_score.text = doStage.get_score().toString()
this.label_time.text = Utility_ConvertSecondToString(doStage.get_duration())
@@ -225,7 +227,7 @@ export class DailyChallenge extends Laya.Script {
else {
this.btn_play.visible = true
this.obj_summary.visible = false
var doStage = StorageManager.getInstance().loadStage(stageID)
var doStage = StorageManager.getInstance().getStage(stageID)
if (doStage) {
this.label_play.text = "Continue"
}

View File

@@ -2,8 +2,10 @@
import { config } from "../../constants/config";
import { respath } from "../../constants/respath";
import { MONTH_LIST } from "../../models/DCManager";
import { UIManager } from "../../models/UIManager";
import { TrophyUnit } from "./TrophyUnit";
const { regClass, property } = Laya;
@@ -12,8 +14,8 @@ const { regClass, property } = Laya;
export class TrophyRoom extends Laya.Script {
declare owner : Laya.Box;
@property(Laya.Button)
public btn_back: Laya.Button;
@property(Laya.Box)
public btn_back: Laya.Box;
@property(Laya.Box)
public obj_items: Laya.Box;
@@ -21,8 +23,12 @@ export class TrophyRoom extends Laya.Script {
//第一次执行update之前执行只会执行一次
onStart(): void {
var trophyCountOfCell = 3
if (config.H_SCREEN)
trophyCountOfCell = 5
this.btn_back.on(Laya.Event.CLICK, this, ()=>{
this.owner.destroy()
UIManager.getInstance().closeTrophyUI()
})
var infos: Array<any> = new Array()
@@ -52,7 +58,7 @@ export class TrophyRoom extends Laya.Script {
list.push(obj)
}
console.log(">>>>>>>>>>>>years=", years)
Laya.loader.load(respath.trophy_year_ui_res).then((go)=>{
Laya.loader.load(respath.trophy_year_ui_res()).then((go)=>{
for (var i=1; i<years.length; i++) {
var obj_year = this.obj_items.getChildAt(i)
if (!obj_year) {
@@ -61,11 +67,11 @@ export class TrophyRoom extends Laya.Script {
}
}
Laya.loader.load(respath.trophy_cell_ui_res).then((go)=>{
Laya.loader.load(respath.trophy_cell_ui_res()).then((go)=>{
var itemsHeight = 0
for (var i=0; i<years.length; i++) {
var list = monthMap.get(years[i])
var cellCount = Math.ceil(list.length/3)
var cellCount = Math.ceil(list.length/trophyCountOfCell)
var yearHeight = 120 + cellCount * 444
itemsHeight += yearHeight