You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.9 KiB
70 lines
2.9 KiB
//#region 文件引入
|
|
import { _decorator, Button, Component, Label, Node, sp, Sprite,Animation, RichText } from "cc";
|
|
import BaseUIForm from "../../Mgr_UI/BaseUIForm";
|
|
import { OFFLINE_PARAMS } from "../../const/GGameData";
|
|
import RoleDataMgr from "../../Mgr_LocalData/RoleDataMgr";
|
|
import { EGlobalEvent } from "../../MesEvent/EGlobalEvent";
|
|
import MesMgr from "../../MesEvent/MesMgr";
|
|
import UIMgr from "../../Mgr_UI/UIMgr";
|
|
import { MainConfig } from "db://assets/Launch/_MainConfig";
|
|
import { EUIForms } from "../../const/UIFormCnf";
|
|
import PlatformManager from "../../Platform/PlatformManager";
|
|
import Base64 from "../../Mgr_LocalData/Base/Base64";
|
|
import { Global } from "../../Global";
|
|
import { EPlatformType } from "../../Platform/T/EPlatformType";
|
|
|
|
//#endregion 文件引入
|
|
const {ccclass, property,menu} = _decorator;
|
|
@ccclass("MainBgUI_Proxy")
|
|
export default class MainBgUI_Proxy extends BaseUIForm{
|
|
//#region 节点自动生成
|
|
|
|
//#endregion 节点自动生成
|
|
onButtonClick(button:Button){
|
|
|
|
/**点击事件触发*/
|
|
switch (button) {
|
|
default:
|
|
ConsoleEx.Log(button);
|
|
break;
|
|
}
|
|
}
|
|
|
|
protected start(): void {
|
|
const feed_game_scene = PlatformManager.PlatformInstance.GetFeedType();
|
|
// 复访,弹出奖励弹窗
|
|
if(feed_game_scene === 3){
|
|
UIMgr.Ins.ShowUI(EUIForms.PopFeedGetCoinUI);
|
|
}
|
|
// 离线时长不超过20分钟,不弹出离线窗口
|
|
RoleDataMgr.Ins.initOfflineInfo();
|
|
const offlinetimes = RoleDataMgr.Ins.offlineSeconds;
|
|
if (offlinetimes < OFFLINE_PARAMS.REWARD_TIME) {
|
|
if (feed_game_scene === -1 && offlinetimes > OFFLINE_PARAMS.REWARD_TIME / 4) {
|
|
this.scheduleOnce(() => {
|
|
UIMgr.Ins.ShowTipsUI(`离线时间已攒${Math.floor(offlinetimes / 60)}分钟`);
|
|
}, 0.8);
|
|
}
|
|
}else{
|
|
// 超过20分钟弹出离线窗口
|
|
MainConfig.isAutoOpenOffline = true;
|
|
// this.scheduleOnce(() => {
|
|
// MesMgr.event(EGlobalEvent.OUTLINE_UPDATE, true);
|
|
// }, 0.8);
|
|
}
|
|
|
|
// let loginState = PlatformManager.PlatformInstance.loginState;
|
|
// if (!loginState.uid && !!loginState.openid) {
|
|
// loginState.uid = Base64.encode(`${loginState.openid}_10086`)
|
|
// }
|
|
// MainConfig.isGmOpen = PlatformManager.PlatformInstance.platform == EPlatformType.Web || Global.CsvMgr.CheckWlist(loginState.uid);
|
|
// MainConfig.isGmOpen && (UIMgr.Ins.ShowUI(EUIForms.DebugUI));
|
|
// 每秒刷新
|
|
this.schedule(this.SecondTick, 1.0);
|
|
}
|
|
|
|
/**每秒执行 */
|
|
SecondTick() {
|
|
this.mDataMgr.Pass.add_PlayedTime(1);
|
|
}
|
|
}
|