mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update
This commit is contained in:
@@ -3,6 +3,9 @@ import { _decorator } from "cc";
|
||||
import { JNGLayerBase, app } from "../../App";
|
||||
import { Label } from "cc";
|
||||
import { GUI } from "../UIConfig";
|
||||
import { API } from "../../consts/API";
|
||||
import { GAction } from "../../consts/GActionEnum";
|
||||
import NoviceManager from "../Novice/NoviceManager";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('LoadingView')
|
||||
@@ -29,9 +32,10 @@ export default class LoadingView extends JNGLayerBase {
|
||||
|
||||
async onSuccess(){
|
||||
|
||||
//打开主页
|
||||
await app.layer.Open(GUI.Home);
|
||||
await NoviceManager.getIns().onStart();
|
||||
|
||||
//关闭加载页
|
||||
await app.layer.Open(GUI.Home);
|
||||
app.layer.Close(GUI.Loading);
|
||||
|
||||
}
|
||||
|
9
JisolGameCocos/assets/script/ui/Novice.meta
Normal file
9
JisolGameCocos/assets/script/ui/Novice.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "22b638a6-c17e-4935-adb5-b5309777f71c",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
20
JisolGameCocos/assets/script/ui/Novice/NoviceManager.ts
Normal file
20
JisolGameCocos/assets/script/ui/Novice/NoviceManager.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import Singleton from "../../../../extensions/ngame/assets/ngame/util/Singleton";
|
||||
import { app } from "../../App";
|
||||
import { GUI } from "../UIConfig";
|
||||
|
||||
export default class NoviceManager extends Singleton{
|
||||
|
||||
//新手引导执行
|
||||
async onStart(){
|
||||
|
||||
if(!(app.data.getPlayerInfo().novice)){
|
||||
//如果没有过引导则打开引导页面
|
||||
await app.layer.OpenToClose(GUI.NoviceNamingView);
|
||||
}
|
||||
|
||||
console.log("新手引导结束");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "8b5cc1e0-3fa2-4ee3-b93b-2da9878f9c8c",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
24
JisolGameCocos/assets/script/ui/Novice/NoviceNamingView.ts
Normal file
24
JisolGameCocos/assets/script/ui/Novice/NoviceNamingView.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { app, JNGLayerBase } from '../../App';
|
||||
import { EditBox } from 'cc';
|
||||
import { API } from '../../consts/API';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('NoviceNamingView')
|
||||
export class NoviceNamingView extends JNGLayerBase {
|
||||
|
||||
@property(EditBox)
|
||||
text:EditBox;
|
||||
|
||||
//保存名称
|
||||
async onSave(){
|
||||
if(this.text.string){
|
||||
await API.SavePlayerInfo(this.text.string);
|
||||
//关闭页面
|
||||
app.layer.CloseNode(this.node);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "ccac142a-85d0-4cc2-9f66-e71110e1d69d",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { JNGLayerBase } from '../../App';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('NoviceSelectPetView')
|
||||
export class NoviceSelectPetView extends JNGLayerBase {
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "0bc93bda-24b6-4fb9-809c-d5d4ebbf22ec",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -13,6 +13,10 @@ export enum GUI{
|
||||
Loading = "Loading", //加载页面
|
||||
Tips = "Tips", //提示
|
||||
|
||||
/** 新手引导 */
|
||||
NoviceNamingView = "NoviceNamingView", //新手引导页面 - 取名
|
||||
NoviceSelectPetView = "NoviceSelectPetView", //新手引导页面 - 选择宠物
|
||||
|
||||
Home = "Home", //主页面
|
||||
}
|
||||
|
||||
@@ -21,7 +25,7 @@ export enum GUI{
|
||||
const UISystemConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
[GUI.Tips]:{
|
||||
layer:GLayer.Tips,
|
||||
uri: "prefab/ui/System/Tips/TipsView",
|
||||
uri: "prefab/ui/系统页面/Tips/TipsView",
|
||||
anims:{
|
||||
front:JNLayerAnim.BackOutOpen,
|
||||
back:JNLayerAnim.BackInClose
|
||||
@@ -29,7 +33,7 @@ const UISystemConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
},
|
||||
[GUI.Login]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/System/LoginView",
|
||||
uri: "prefab/ui/系统页面/LoginView",
|
||||
anims:{
|
||||
front:JNLayerAnim.BackOutOpen,
|
||||
back:JNLayerAnim.BackInClose
|
||||
@@ -37,7 +41,7 @@ const UISystemConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
},
|
||||
[GUI.Loading]:{
|
||||
layer:GLayer.View,
|
||||
uri: "prefab/ui/Loading/LoadingView",
|
||||
uri: "prefab/ui/加载页面/LoadingView",
|
||||
anims:{
|
||||
back:JNLayerAnim.Smaller,
|
||||
backInfo:{key:"position",start:v3(0,0,0),end:v3(-720,0,0)}
|
||||
@@ -45,10 +49,32 @@ const UISystemConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
},
|
||||
}
|
||||
|
||||
//新手引导页面
|
||||
const UINoviceConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
|
||||
[GUI.NoviceNamingView]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/新手引导页面/NoviceNamingView",
|
||||
anims:{
|
||||
front:JNLayerAnim.BackOutOpen,
|
||||
back:JNLayerAnim.BackInClose
|
||||
}
|
||||
},
|
||||
[GUI.NoviceSelectPetView]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/新手引导页面/NoviceSelectPetView",
|
||||
anims:{
|
||||
front:JNLayerAnim.BackOutOpen,
|
||||
back:JNLayerAnim.BackInClose
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
export const UIConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
[GUI.Home]:{
|
||||
layer:GLayer.View,
|
||||
uri: "prefab/ui/Home/HomeView",
|
||||
uri: "prefab/ui/主页/HomeView",
|
||||
anims:{
|
||||
front:JNLayerAnim.Enlarge,
|
||||
back:JNLayerAnim.Smaller,
|
||||
@@ -56,6 +82,7 @@ export const UIConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
backInfo:{key:"position",start:v3(0,0,0),end:v3(-720,0,0)}
|
||||
},
|
||||
},
|
||||
...UISystemConfig
|
||||
...UISystemConfig, //系统页面
|
||||
...UINoviceConfig, //新手引导页面
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user