mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
9
JisolGameCocos/assets/script/ui/Debugger.meta
Normal file
9
JisolGameCocos/assets/script/ui/Debugger.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "0f91175c-f75a-4be8-8d8c-217af4538fb4",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
47
JisolGameCocos/assets/script/ui/Debugger/Debugger.ts
Normal file
47
JisolGameCocos/assets/script/ui/Debugger/Debugger.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import JNLayerBase from '../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase';
|
||||
import { Prefab } from 'cc';
|
||||
import { TD } from '../../App';
|
||||
import { instantiate } from 'cc';
|
||||
import { Button } from 'cc';
|
||||
import { EventHandler } from 'cc';
|
||||
import { Input } from 'cc';
|
||||
import { TB, TbGResource } from '../../config/data/schema';
|
||||
import { API } from '../../consts/API';
|
||||
import { Label } from 'cc';
|
||||
import { EditBox } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('Debugger')
|
||||
export class Debugger extends JNLayerBase {
|
||||
|
||||
@property(EditBox)
|
||||
text:EditBox;
|
||||
|
||||
@property(Node)
|
||||
resources:Node;
|
||||
|
||||
@property(Prefab)
|
||||
debuger:Prefab;
|
||||
|
||||
onJNLoad(data?: any): void {
|
||||
super.onJNLoad();
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
onUpdateView(){
|
||||
TD.TbGResource.getDataList().forEach(config => {
|
||||
let debuger:Node;
|
||||
this.resources.addChild(debuger = instantiate(this.debuger));
|
||||
debuger.on(Input.EventType.TOUCH_END,async () => await this.onClickResources(config),this);
|
||||
debuger.getComponentInChildren(Label).string = config.name;
|
||||
})
|
||||
}
|
||||
|
||||
async onClickResources(config:TB.TbGResource){
|
||||
await API.DebuggerAddResource(config.id,parseInt(this.text.string) || 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "73341f32-5e98-4e17-ab66-ecdfba295c25",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -105,6 +105,11 @@ export class MainView extends JNGLayerBase {
|
||||
app.layer.Open(GUI.Tips,{text:"敬请期待"})
|
||||
}
|
||||
|
||||
//打开Debugger
|
||||
onClickDebugger(){
|
||||
app.layer.Open(GUI.Debugger);
|
||||
}
|
||||
|
||||
//点击下一关
|
||||
async onClickNextLevel(){
|
||||
GOnHookManager.getIns().onNextLevel();
|
||||
|
@@ -4,6 +4,9 @@ import { Sprite } from 'cc';
|
||||
import { PetEquip } from '../../consts/API';
|
||||
import { resources } from 'cc';
|
||||
import { SpriteFrame } from 'cc';
|
||||
import TbResource, { IconTypeEnum } from '../../tools/TbResource';
|
||||
import { TB } from '../../config/data/schema';
|
||||
import { TD } from '../../App';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//弹出锻造装备页面
|
||||
@@ -16,9 +19,10 @@ export class PetEquipForgingPopupView extends JNLayerBase {
|
||||
|
||||
onJNLoad(info:PetEquip){
|
||||
|
||||
resources.load(`icon/宠物装备/${info.equipCfgId}`,SpriteFrame,(error,data) => {
|
||||
this.icon.spriteFrame = data;
|
||||
})
|
||||
super.onJNLoad(info);
|
||||
|
||||
let config = TD.TbGRoleEquip.get(info.equipCfgId);
|
||||
TbResource.loadSpriteIcon(IconTypeEnum.宠物装备,config.icon,this.icon,this);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -13,6 +13,7 @@ export enum GUI{
|
||||
Loading = "Loading", //加载页面
|
||||
Tips = "Tips", //提示
|
||||
SelectionBox = "SelectionBox", //选择提示页面 (用于玩家确定该操作)
|
||||
Debugger = "Debugger", //Debugger
|
||||
|
||||
/** 新手引导 */
|
||||
NoviceNamingView = "NoviceNamingView", //新手引导页面 - 取名
|
||||
@@ -56,6 +57,11 @@ const UISystemConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
uri: "prefab/ui/系统页面/提示/TipsView",
|
||||
anims:BackOutScale
|
||||
},
|
||||
[GUI.Debugger]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/Debugger/Debugger",
|
||||
anims:BackOutScale
|
||||
},
|
||||
[GUI.SelectionBox]:{
|
||||
layer:GLayer.Tips,
|
||||
uri: "prefab/ui/系统页面/选择提示/SelectionBox",
|
||||
|
Reference in New Issue
Block a user