1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import { _decorator, Button, Component, Node } from 'cc';
- import { Layout_Hall } from './Layout_Hall';
- import { UI_Rank } from '../UI_Rank/UI_Rank';
- import { UI_Settings } from '../UI_Settings/UI_Settings';
- import { UI_Sign } from '../UI_Sign/UI_Sign';
- import { UI_Invite } from '../UI_Invite/UI_Invite';
- import { GameUILayers, gui } from '../../../core/ui/ui';
- import ui_base from '../../../core/ui/ui_base';
- import { ResUtil } from '../../../core/util/ResUtil';
- import { ModuleDef } from '../../../Scripts/ModuleDef';
- import { SceneDef } from '../../../Scripts/SceneDef';
- import { UI_Store } from '../UI_Store/UI_Store';
- import { UI_SideBar } from '../UI_SideBar/UI_SideBar';
- import { UI_Task } from '../UI_Task/UI_Task';
- import { Hall } from '../../hall/Hall';
- import { ch } from 'db://assets/ch/ch';
- const { ccclass, property } = _decorator;
- @ccclass('UI_Hall')
- export class UI_Hall extends ui_base {
- constructor() {
- super(ModuleDef.GAME, 'ui/UI_Hall/Hall', GameUILayers.GAME, Layout_Hall);
- }
- protected onCreated() {
- const layout = this.getLayout<Layout_Hall>();
- this.onButtonEvent(layout.Start_Btn, () => {
- gui.close(UI_Hall);
- ResUtil.loadScene(SceneDef.GAME, ModuleDef.GAME, true);
- });
- this.onButtonEvent(layout.Settings_Btn, () => {
- gui.show(UI_Settings);
- });
- this.onButtonEvent(layout.Rank_Btn, async() => {
- await Hall.getInstance().player.loadPfInfo();
- gui.show(UI_Rank);
- });
- this.onButtonEvent(layout.Sign_Btn, () => {
- gui.show(UI_Sign);
- });
- this.onButtonEvent(layout.Invite_Btn, () => {
- gui.show(UI_Invite);
- });
- this.onButtonEvent(layout.Store_Btn, () => {
- gui.show(UI_Store);
- });
- this.onButtonEvent(layout.Task_Btn, () => {
- gui.show(UI_Task);
- })
- if (chsdk.checkHasSidebar()) {
- layout.SideBar_Btn.node.active = true;
- this.onButtonEvent(layout.SideBar_Btn, () => {
- gui.show(UI_SideBar);
- });
- } else {
- layout.SideBar_Btn.node.active = false;
- }
- }
- update(deltaTime: number) {
- }
- }
|