46 lines
996 B
TypeScript
46 lines
996 B
TypeScript
|
import { _decorator, Component, Node, Label, Button, director } from 'cc';
|
||
|
import { UserMgr } from '../../module_basic/scripts/UserMgr';
|
||
|
import { tgxUIMgr } from '../../core_tgx/tgx';
|
||
|
import { UIEnterRoom } from 'db://assets/module_arean/ui_enter_room/UIEnterRoom';
|
||
|
const { ccclass, property } = _decorator;
|
||
|
|
||
|
@ccclass('RoomListItem')
|
||
|
export class RoomListItem extends Component {
|
||
|
@property(Label)
|
||
|
lblName: Label;
|
||
|
|
||
|
@property(Label)
|
||
|
lblRoomId: Label;
|
||
|
|
||
|
@property(Label)
|
||
|
lblPlayerNum: Label;
|
||
|
|
||
|
@property(Label)
|
||
|
lblSpectatorNum: Label;
|
||
|
|
||
|
@property(Button)
|
||
|
btnEnter: Button;
|
||
|
|
||
|
needPassword:boolean;
|
||
|
|
||
|
start() {
|
||
|
|
||
|
}
|
||
|
|
||
|
onBtnEnterClicked() {
|
||
|
if(this.needPassword){
|
||
|
tgxUIMgr.inst.showUI(UIEnterRoom,(ui:UIEnterRoom)=>{
|
||
|
ui.setFixedId(this.lblRoomId.string);
|
||
|
});
|
||
|
}
|
||
|
else{
|
||
|
UserMgr.inst.doTryEnterRoom(this.lblRoomId.string);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
update(deltaTime: number) {
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|