This commit is contained in:
PC-20230316NUNE\Administrator 2024-01-09 11:52:44 +08:00
parent a153d98cf1
commit b2a5a6c491
967 changed files with 2612 additions and 431 deletions

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "c2d8ad68-b042-4f5d-b721-2b97d38170f4",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,359 @@
[
{
"__type__": "cc.Prefab",
"_name": "DebugItem",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "DebugItem",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 8
},
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": {
"__id__": 14
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -250,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 512,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "815A770y1M44n4IYnvsekr"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_string": "button",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 1,
"_enableWrapText": false,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "03TGLPRydAUKm/mgL7jW5T"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c4ViamPyFNgLLAcEAgtYSU",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 9
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "9dDWDj0bFNZ5mZGqD06LE3"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 11
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "cfnZoelBZEn4nvkzFbZswI"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 13
},
"clickEvents": [],
"_interactable": true,
"_transition": 2,
"_normalColor": {
"__type__": "cc.Color",
"r": 214,
"g": 214,
"b": 214,
"a": 255
},
"_hoverColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_pressedColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_normalSprite": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_hoverSprite": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_pressedSprite": {
"__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_disabledSprite": {
"__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": {
"__id__": 1
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fdfZMrUD5LeJ3JUsm5gbF3"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "82Bvk1koJK0rGlT67CNSun",
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "d9221815-2379-432c-adaf-0e3e67db4683",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "DebugItem"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "1d27889d-80e1-43e7-bcae-1457e3aa6a0a",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "Debugger"
}
}

View File

@ -184,8 +184,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
"width": 80,
"height": 80
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -421,6 +421,9 @@
"mask": true,
"maskOpcity": 80,
"isClickMaskeClose": true,
"icon": {
"__id__": 6
},
"_id": ""
},
{

View File

@ -14,7 +14,7 @@ import { JsonLoad, JsonUtil } from "../../extensions/ngame/assets/ngame/util/Jso
import NGameMessage from "../../extensions/ngame/assets/ngame/util/NGameMessage";
import GBattleModeManager from "./battle/GBattleModeManager";
import { GLayer, GUI, UIConfig } from "./ui/UIConfig";
import JLoaderSystem from "../../extensions/ngame/assets/ngame/system/JLoaderSystem";
import JLoaderBundle from "../../extensions/ngame/assets/ngame/system/JLoaderBundle";
import { sp } from "cc";
import { SpriteFrame } from "cc";
import Loading from "../../extensions/ngame/assets/ngame/util/Loading";
@ -28,12 +28,12 @@ import AppAction from "./AppAction";
import { Asset } from "cc";
import { Component } from "cc";
let APIPath = `http://localhost:8080`
let WsPath = `ws://localhost:8080/websocket`
// let APIPath = `http://localhost:8080`
// let WsPath = `ws://localhost:8080/websocket`
// let APIPath = `http://192.168.1.23:8080`
// let WsPath = `ws://192.168.1.23:8080/websocket`
// let APIPath = `http://192.168.0.119:8080`
// let WsPath = `ws://192.168.0.119:8080/websocket`
let APIPath = `http://192.168.0.119:8080`
let WsPath = `ws://192.168.0.119:8080/websocket`
// let APIPath = `https://api.pet.jisol.cn`
// let WsPath = `wss://api.pet.jisol.cn/websocket`
@ -141,7 +141,7 @@ export class JNGConfig extends SystemBase{
}
//资源初始器
export class JLoaderBattle extends JLoaderSystem{
export class JLoaderBattle extends JLoaderBundle{
static loading = "JLoaderBattle";
static loadingInit = "JLoaderBattle_Init";
@ -272,7 +272,8 @@ export const app = {
battle : GBattleModeManager.getIns(), //战斗
config : new JNGConfig(), //配置文件
battleRes : new JLoaderBattle("battle"), //battle包
tbRes : new JLoaderSystem("tbresource"), //tbresource包
tbRes : new JLoaderBundle("tbresource"), //tbresource包
res : new JLoaderBundle("resources"), //resources包
data : new AppData(), //游戏基础信息
action : new AppAction(), //游戏行为
loading : new Loading({

View File

@ -127,6 +127,9 @@ export interface EquipForgingBench{
export const API = {
/********** debugger *****************/
DebuggerAddResource : async (type:number,value:number) => RData(await app.api.post(`/debugger/add/resource/${type}/${value}`),true) as Boolean, //Debuger 添加指定资源
UserRegister : async () => RData(await app.api.post(`/user/register`)) as UserVO, //玩家注册
UserLogin : async (account:string,password:string) => RData(await app.api.post(`/user/login`,{userId:account,userPass:password})) as UserLoginVO, //玩家登录
GetPlayerInfo : async () => RData(await app.api.get(`/game/player/info`),false) as PlayerInfoOV, //获取玩家信息

View File

@ -34,7 +34,14 @@ export default class PetEquipData extends BaseData{
//锻造
async forging(){
return await API.PetEquipForging();
return this.addEquip(await API.PetEquipForging());
}
//添加装备
addEquip(equip:PetEquip):PetEquip{
if(this.equips.filter(item => item.equipId == equip.equipId).length) return null;
this.equips.push(equip);
return equip;
}
//设置锻造宠

View File

@ -1,45 +1,22 @@
import { Asset } from "cc";
import { app } from "../App";
import { Sprite } from "cc";
import { SpriteFrame } from "cc";
import { Node } from "cc";
import { Component } from "cc";
export enum IconTypeEnum{
= "品质",
= "宠物装备",
}
export default class TbResource {
static load<T extends Asset>(res:string,onComplete?:((err: Error | null, data: T) => void)){
app.tbRes.get().load<T>(res,onComplete)
}
static loadSpriteFrame(res:string,sprite:Sprite,comp:Component){
this.load<SpriteFrame>(res,(err,data:SpriteFrame) => {
if(!data) return;
if(!sprite.isValid || !comp.isValid) {
//提前销毁
data.addRef();
data.decRef();
}
sprite.spriteFrame = data;
//添加引用标记
data.addRef();
//添加销毁资源引用
let onDestroy = comp["onDestroy"];
comp["onDestroy"] = () => {
if(onDestroy)
onDestroy.bind(comp)();
//销毁引用
if(sprite.isValid && sprite.spriteFrame == data) sprite.spriteFrame = null;
data.decRef();
}
})
app.tbRes.loadSpriteFrame(res,sprite,comp)
}
//加载资源ICON
static loadSpriteIcon(type:IconTypeEnum,id:string | number,sprite:Sprite,comp:Component){
app.tbRes.loadSpriteFrame(`icon/${type}/${id}/spriteFrame`,sprite,comp)
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "0f91175c-f75a-4be8-8d8c-217af4538fb4",
"files": [],
"subMetas": {},
"userData": {}
}

View 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);
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "73341f32-5e98-4e17-ab66-ecdfba295c25",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -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();

View File

@ -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);
}

View File

@ -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",

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Some files were not shown because too many files have changed in this diff Show More