更新主页内容

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-15 02:32:00 +08:00
parent 93ae85e88b
commit d1783204ad
28 changed files with 1969 additions and 126 deletions

View File

@@ -1,5 +1,4 @@
import { _decorator, Component, Node } from 'cc';
import { app, JNGLayerBase } from '../../../App';
import { Prefab } from 'cc';
import ChatData from '../../../data/ChatData';
import { instantiate } from 'cc';
@@ -9,6 +8,8 @@ import { GUI } from '../../UIConfig';
import { GUIChatMessage } from '../../../consts/GActionType';
import { Widget } from 'cc';
import JScrollExceedHide from '../../../../../extensions/ngame/assets/ngame/util/components/JScrollExceedHide';
import { JNGLayerBase } from '../../../components/JNComponent';
import { app } from '../../../App';
const { ccclass, property } = _decorator;
@ccclass('MainChatView')

View File

@@ -1,5 +1,4 @@
import { _decorator, Component, Label, Node } from 'cc';
import { app, JNGLayerBase } from '../../App';
import { Toggle } from 'cc';
import { JNSyncAction } from '../../../../extensions/ngame/assets/ngame/sync/JNSyncAction';
import { director } from 'cc';
@@ -7,6 +6,8 @@ import { WorldCanvas } from '../../WorldCanvas';
import { StorageData, StorageEnum } from '../../consts/GData';
import { GUI } from '../UIConfig';
import { API } from '../../consts/API';
import { JNGLayerBase } from '../../components/JNComponent';
import { app } from '../../App';
const { ccclass, property } = _decorator;
@ccclass('HomeView')

View File

@@ -1,21 +1,39 @@
import { _decorator, Component, Label, Node } from 'cc';
import { app, JNGLayerBase } from '../../App';
import { GUI } from '../UIConfig';
import ChatData from '../../data/ChatData';
import PlayerData from '../../data/PlayerData';
import GBattleModeManager, { BattleMode } from '../../battle/GBattleModeManager';
import { JNGLayerBase } from '../../components/JNComponent';
import { app } from '../../App';
const { ccclass, property } = _decorator;
@ccclass('MainView')
export class MainView extends JNGLayerBase {
@property(Label)
playerNameLabel:Label; //玩家名称
onJNLoad(data?: any): void {
//默认无限模式
GBattleModeManager.getIns().Open(BattleMode.OnHook,true);
//发送消息
ChatData.getIns().onSend({
message:`${PlayerData.getIns().data.playerId} 加入游戏`
});
this.onUpdateView();
}
//更新UI界面
onUpdateView(){
this.playerNameLabel.string = PlayerData.getIns().getInfo().playerName;
}
//打开Demo页面
onOpenDemo(){
app.layer.Open(GUI.Home);
}
//打开聊天页面
@@ -23,6 +41,11 @@ export class MainView extends JNGLayerBase {
app.layer.Open(GUI.MainChat);
}
//点击打开无限模式
onOpenOnHook(){
GBattleModeManager.getIns().Open(BattleMode.OnHook,true);
}
}

View File

@@ -1,9 +1,10 @@
import { ProgressBar } from "cc";
import { _decorator } from "cc";
import { JNGLayerBase, app } from "../../App";
import { Label } from "cc";
import { GUI } from "../UIConfig";
import NoviceManager from "../../manager/NoviceManager";
import { JNGLayerBase } from "../../components/JNComponent";
import { app } from "../../App";
const { ccclass, property } = _decorator;
@ccclass('LoadingView')

View File

@@ -1,7 +1,8 @@
import { _decorator, Component, Node } from 'cc';
import { app, JNGLayerBase } from '../../App';
import { EditBox } from 'cc';
import { API } from '../../consts/API';
import { JNGLayerBase } from '../../components/JNComponent';
import { app } from '../../App';
const { ccclass, property } = _decorator;
@ccclass('NoviceNamingView')

View File

@@ -1,13 +1,13 @@
import { JNGLayerBase, TD, app } from '../../App';
import { TbGGlobalEnum } from '../../../resources/config/TbGGlobalEnum';
import { _decorator,Node } from 'cc';
import { sp } from 'cc';
import { UIPetAnim } from '../../consts/GData';
import { Sprite } from 'cc';
import { Color } from 'cc';
import { API } from '../../consts/API';
import { GUI } from '../UIConfig';
import PlayerPetData from '../../data/PlayerPetData';
import { JNGLayerBase } from '../../components/JNComponent';
import { app, TD } from '../../App';
const { ccclass, property } = _decorator;