mirror of
https://gitee.com/dgflash/oops-framework.git
synced 2026-09-03 02:23:47 +08:00
兼容最新版本框架
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"ver": "2.0.3",
|
||||
"ver": "2.0.4",
|
||||
"importer": "animation-clip",
|
||||
"imported": true,
|
||||
"uuid": "0430e564-9665-435e-9895-7b8e19fcb0b9",
|
||||
"files": [
|
||||
".cconb"
|
||||
".bin"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"ver": "2.0.3",
|
||||
"ver": "2.0.4",
|
||||
"importer": "animation-clip",
|
||||
"imported": true,
|
||||
"uuid": "99c3c7ad-3086-4333-81e6-19b82da0c89d",
|
||||
"files": [
|
||||
".cconb"
|
||||
".bin"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"ver": "2.0.3",
|
||||
"ver": "2.0.4",
|
||||
"importer": "animation-clip",
|
||||
"imported": true,
|
||||
"uuid": "4cecde51-d46d-4b20-b02e-e58f063ec56f",
|
||||
"files": [
|
||||
".cconb"
|
||||
".bin"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
|
||||
@@ -1,18 +1,51 @@
|
||||
{
|
||||
"type": "dev",
|
||||
"config": {
|
||||
"version": "1.0.5",
|
||||
"package": "com.oops.game",
|
||||
"localDataKey": "oops",
|
||||
"localDataIv": "framework",
|
||||
"httpServer": "http://192.168.0.150/main/",
|
||||
"httpTimeout": 10000,
|
||||
"frameRate": "60",
|
||||
"loadingTimeoutGui": 1000,
|
||||
"webSocketIp": "127.0.0.1",
|
||||
"webSocketProt": "8081",
|
||||
"webSocketHeartTime": 6000,
|
||||
"webSocketReceiveTime": 10000,
|
||||
"webSocketReconnetTimeOut": 3000
|
||||
"dev": {
|
||||
"version": "1.0.0",
|
||||
"localDataKey": "oops",
|
||||
"localDataIv": "framework",
|
||||
"frameRate": 60,
|
||||
"loadingTimeoutGui": 1000,
|
||||
"mobileSafeArea": false,
|
||||
"stats": true,
|
||||
"httpServer": "http://192.168.0.1/",
|
||||
"httpTimeout": 10000,
|
||||
"webSocketServer": "ws://127.0.0.1:8080",
|
||||
"webSocketHeartTime": 6000,
|
||||
"webSocketReceiveTime": 10000,
|
||||
"webSocketReconnetTimeOut": 3000
|
||||
},
|
||||
"test": {
|
||||
"version": "1.0.0",
|
||||
"localDataKey": "oops",
|
||||
"localDataIv": "framework",
|
||||
"frameRate": 60,
|
||||
"loadingTimeoutGui": 1000,
|
||||
"mobileSafeArea": false,
|
||||
"stats": false,
|
||||
"httpServer": "http://192.168.0.2/",
|
||||
"httpTimeout": 10000,
|
||||
"webSocketServer": "wss://127.0.0.1:8081",
|
||||
"webSocketHeartTime": 6000,
|
||||
"webSocketReceiveTime": 10000,
|
||||
"webSocketReconnetTimeOut": 3000
|
||||
},
|
||||
"prod": {
|
||||
"version": "1.0.0",
|
||||
"localDataKey": "oops",
|
||||
"localDataIv": "framework",
|
||||
"frameRate": 60,
|
||||
"loadingTimeoutGui": 1000,
|
||||
"mobileSafeArea": false,
|
||||
"stats": false,
|
||||
"httpServer": "http://192.168.0.150/",
|
||||
"httpTimeout": 10000,
|
||||
"webSocketServer": "wss://127.0.0.1:8082",
|
||||
"webSocketHeartTime": 6000,
|
||||
"webSocketReceiveTime": 10000,
|
||||
"webSocketReconnetTimeOut": 3000
|
||||
}
|
||||
},
|
||||
"gui": [
|
||||
{
|
||||
|
||||
@@ -346,7 +346,7 @@
|
||||
"b": 255,
|
||||
"a": 255
|
||||
},
|
||||
"_string": "01:48:52",
|
||||
"_string": "01:48:07",
|
||||
"_horizontalAlign": 1,
|
||||
"_verticalAlign": 1,
|
||||
"_actualFontSize": 40,
|
||||
@@ -386,7 +386,7 @@
|
||||
"y": 2
|
||||
},
|
||||
"_shadowBlur": 2,
|
||||
"countDown": 6532,
|
||||
"countDown": 6487,
|
||||
"dayFormat": "{0} day",
|
||||
"timeFormat": "{0}:{1}:{2}",
|
||||
"zeroize": true,
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "74d4a589-399e-401e-96c4-9abd888d7266",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"compressionType": {},
|
||||
"isRemoteBundle": {}
|
||||
}
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
* @Author: dgflash
|
||||
* @Date: 2021-07-03 16:13:17
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-05 10:13:47
|
||||
*/
|
||||
|
||||
import { Node, tween, Vec3 } from "cc";
|
||||
import { UICallbacks } from "db://oops-framework/core/gui/layer/LayerUIElement";
|
||||
import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { UIID } from "../config/GameUIConfig";
|
||||
|
||||
/** 提示窗口管理 */
|
||||
class TipsManager {
|
||||
test(callback?: Function) {
|
||||
let operate: any = {
|
||||
title: 'common_prompt_title_sys',
|
||||
content: "common_prompt_content",
|
||||
okWord: 'common_prompt_ok',
|
||||
cancelWord: 'common_prompt_cancal',
|
||||
okFunc: () => {
|
||||
console.log("okFunc");
|
||||
},
|
||||
cancelFunc: () => {
|
||||
console.log("cancelFunc");
|
||||
},
|
||||
needCancel: true
|
||||
};
|
||||
oops.gui.open(UIID.Confirm, operate, this.getPopCommonEffect());
|
||||
}
|
||||
|
||||
alert(content: string, cb?: Function, title?: string, okWord?: string) {
|
||||
let operate: any = {
|
||||
title: title ? title : 'common_prompt_title_sys',
|
||||
content: content,
|
||||
okWord: okWord ? okWord : 'common_prompt_ok',
|
||||
okFunc: () => {
|
||||
cb && cb();
|
||||
},
|
||||
needCancel: false
|
||||
};
|
||||
oops.gui.open(UIID.Confirm, operate, tips.getPopCommonEffect());
|
||||
}
|
||||
|
||||
confirm(content: string, cb: Function, okWord: string = "common_prompt_ok") {
|
||||
let operate: any = {
|
||||
title: 'common_prompt_title_sys',
|
||||
content: content,
|
||||
okWord: okWord,
|
||||
cancelWord: 'common_prompt_cancal',
|
||||
okFunc: () => {
|
||||
cb && cb()
|
||||
},
|
||||
cancelFunc: () => {
|
||||
|
||||
},
|
||||
needCancel: true
|
||||
};
|
||||
oops.gui.open(UIID.Confirm, operate, tips.getPopCommonEffect());
|
||||
}
|
||||
|
||||
/** 弹窗动画 */
|
||||
private getPopCommonEffect(callbacks?: UICallbacks) {
|
||||
let newCallbacks: UICallbacks = {
|
||||
// 节点添加动画
|
||||
onAdded: (node, params) => {
|
||||
node.setScale(0.1, 0.1, 0.1);
|
||||
|
||||
tween(node)
|
||||
.to(0.2, { scale: new Vec3(1, 1, 1) })
|
||||
.start();
|
||||
},
|
||||
// 节点删除动画
|
||||
onBeforeRemove: (node, next) => {
|
||||
tween(node)
|
||||
.to(0.2, { scale: new Vec3(0.1, 0.1, 0.1) })
|
||||
.call((target, data) => {
|
||||
next();
|
||||
})
|
||||
.start();
|
||||
},
|
||||
}
|
||||
|
||||
if (callbacks) {
|
||||
if (callbacks && callbacks.onAdded) {
|
||||
let onAdded = callbacks.onAdded;
|
||||
// @ts-ignore
|
||||
callbacks.onAdded = (node: Node, params: any) => {
|
||||
onAdded(node, params);
|
||||
|
||||
// @ts-ignore
|
||||
newCallbacks.onAdded(node, params);
|
||||
};
|
||||
}
|
||||
|
||||
if (callbacks && callbacks.onBeforeRemove) {
|
||||
let onBeforeRemove = callbacks.onBeforeRemove;
|
||||
callbacks.onBeforeRemove = (node, params) => {
|
||||
onBeforeRemove(node, params);
|
||||
|
||||
// @ts-ignore
|
||||
newCallbacks.onBeforeRemove(node, params);
|
||||
};
|
||||
}
|
||||
return callbacks;
|
||||
}
|
||||
return newCallbacks;
|
||||
}
|
||||
}
|
||||
|
||||
export var tips = new TipsManager();
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "9748eae2-11c2-4ea7-a392-76767faa1b39",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
|
||||
import { LabelChange } from "../../../../extensions/oops-plugin-framework/assets/libs/gui/label/LabelChange";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { smc } from "../common/ecs/SingletonModuleComp";
|
||||
import { tips } from "../common/prompt/TipsManager";
|
||||
import { RoleViewInfoComp } from "../role/view/RoleViewInfoComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
@@ -126,7 +125,7 @@ export class Demo extends GameComponent {
|
||||
/** 打开角色界面 */
|
||||
private async btn_open_role_info(event: EventTouch, data: any) {
|
||||
var role = smc.account.AccountModel.role;
|
||||
var node = await oops.gui.openAsync(UIID.Demo_Role_Info, "传递参数");
|
||||
var node = await oops.gui.open(UIID.Demo_Role_Info, { data: "传递参数" });
|
||||
if (node) role.add(node.getComponent(RoleViewInfoComp)!);
|
||||
}
|
||||
|
||||
@@ -144,22 +143,6 @@ export class Demo extends GameComponent {
|
||||
}
|
||||
}
|
||||
|
||||
/** 弹出提示框 */
|
||||
private btn_common_prompt(event: EventTouch, data: any) {
|
||||
tips.test(() => {
|
||||
|
||||
});
|
||||
tips.test(() => {
|
||||
|
||||
});
|
||||
tips.confirm("内容1", () => {
|
||||
|
||||
}, "确认1");
|
||||
tips.confirm("内容2", () => {
|
||||
|
||||
}, "确认2");
|
||||
}
|
||||
|
||||
/** 漂浮提示框 */
|
||||
private btn_notify_show(event: EventTouch, data: any) {
|
||||
oops.gui.toast("common_prompt_content", true);
|
||||
@@ -175,7 +158,6 @@ export class Demo extends GameComponent {
|
||||
|
||||
/** 背景音乐 */
|
||||
private btn_audio_open1(event: EventTouch, data: any) {
|
||||
oops.audio.music.volume = 0.5;
|
||||
oops.audio.music.loadAndPlay("audios/nocturne");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-01 13:49:35
|
||||
*/
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCEntity } from "db://oops-framework/module/common/CCEntity";
|
||||
import { Account } from "../account/Account";
|
||||
import { InitResComp, InitResSystem } from "./bll/InitRes";
|
||||
import { InitResComp } from "./bll/InitRes";
|
||||
|
||||
/**
|
||||
* 游戏进入初始化模块
|
||||
@@ -14,7 +15,7 @@ import { InitResComp, InitResSystem } from "./bll/InitRes";
|
||||
* 2、加载默认资源
|
||||
*/
|
||||
@ecs.register('Initialize')
|
||||
export class Initialize extends ecs.Entity {
|
||||
export class Initialize extends CCEntity {
|
||||
/** 帐号管理 */
|
||||
account: Account = null!;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ export class InitResSystem extends ecs.ComblockSystem implements ecs.IEntityEnte
|
||||
/** 加载完成进入游戏内容加载界面 */
|
||||
private onComplete(queue: AsyncQueue, e: Initialize) {
|
||||
queue.complete = async () => {
|
||||
var node = await oops.gui.openAsync(UIID.Loading);
|
||||
var node = await oops.gui.open(UIID.Loading);
|
||||
if (node) e.add(node.getComponent(LoadingViewComp) as ecs.Comp);
|
||||
e.remove(InitResComp);
|
||||
};
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
import { _decorator, Component, game, sys } from "cc";
|
||||
import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { UIID } from "../../common/config/GameUIConfig";
|
||||
import { tips } from "../../common/prompt/TipsManager";
|
||||
import { Hot, HotOptions } from "./Hot";
|
||||
import { LoadingViewComp } from "./LoadingViewComp";
|
||||
|
||||
@@ -139,6 +138,7 @@ export class HotUpdate extends Component {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
tips.alert(oops.language.getLangByID("update_nowifi_tip") + size, callback);
|
||||
callback();
|
||||
// tips.alert(oops.language.getLangByID("update_nowifi_tip") + size, callback);
|
||||
}
|
||||
}
|
||||
@@ -5,22 +5,21 @@
|
||||
* @LastEditTime: 2022-08-29 13:37:08
|
||||
*/
|
||||
import { _decorator, sys } from "cc";
|
||||
import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { JsonUtil } from "../../../../../extensions/oops-plugin-framework/assets/core/utils/JsonUtil";
|
||||
import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCVMParentComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCVMParentComp";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { JsonUtil } from "db://oops-framework/core/utils/JsonUtil";
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCViewVM } from "db://oops-framework/module/common/CCViewVM";
|
||||
import { GameEvent } from "../../common/config/GameEvent";
|
||||
import { UIID } from "../../common/config/GameUIConfig";
|
||||
import { smc } from "../../common/ecs/SingletonModuleComp";
|
||||
import { TableRoleJob } from "../../common/table/TableRoleJob";
|
||||
import { TableRoleLevelUp } from "../../common/table/TableRoleLevelUp";
|
||||
import { Initialize } from "../Initialize";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 游戏资源加载 */
|
||||
@ccclass('LoadingViewComp')
|
||||
@ecs.register('LoadingView', false)
|
||||
export class LoadingViewComp extends CCVMParentComp {
|
||||
export class LoadingViewComp extends CCViewVM<Initialize> {
|
||||
/** VM 组件绑定数据 */
|
||||
data: any = {
|
||||
/** 加载资源当前进度 */
|
||||
@@ -82,8 +81,7 @@ export class LoadingViewComp extends CCVMParentComp {
|
||||
this.data.prompt = oops.language.getLangByID("loading_load_json");
|
||||
|
||||
return new Promise(async (resolve, reject) => {
|
||||
await JsonUtil.loadAsync(TableRoleJob.TableName);
|
||||
await JsonUtil.loadAsync(TableRoleLevelUp.TableName);
|
||||
await JsonUtil.loadDir();
|
||||
resolve(null);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
* @LastEditTime: 2022-08-01 13:49:32
|
||||
*/
|
||||
import { Node, Vec3 } from "cc";
|
||||
import { CCEntity } from "db://oops-framework/module/common/CCEntity";
|
||||
import { ViewUtil } from "../../../../extensions/oops-plugin-framework/assets/core/utils/ViewUtil";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { MoveToComp } from "../common/ecs/position/MoveTo";
|
||||
import { RoleChangeJobComp, RoleChangeJobSystem } from "./bll/RoleChangeJob";
|
||||
import { RoleUpgradeComp, RoleUpgradeSystem } from "./bll/RoleUpgrade";
|
||||
import { RoleChangeJobComp } from "./bll/RoleChangeJob";
|
||||
import { RoleUpgradeComp } from "./bll/RoleUpgrade";
|
||||
import { RoleAnimatorType } from "./model/RoleEnum";
|
||||
import { RoleModelBaseComp } from "./model/RoleModelBaseComp";
|
||||
import { RoleModelComp } from "./model/RoleModelComp";
|
||||
@@ -29,7 +30,7 @@ import { RoleViewInfoComp } from "./view/RoleViewInfoComp";
|
||||
* 5、与玩家互动的玩法(升级、转职、攻击等)
|
||||
*/
|
||||
@ecs.register('Role')
|
||||
export class Role extends ecs.Entity {
|
||||
export class Role extends CCEntity {
|
||||
// 数据层
|
||||
RoleModel!: RoleModelComp;
|
||||
RoleModelBase!: RoleModelBaseComp; // 角色初始资质
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* @LastEditTime: 2022-08-05 10:32:42
|
||||
*/
|
||||
|
||||
import { sp, _decorator } from "cc";
|
||||
import { _decorator, sp } from "cc";
|
||||
import { CCView } from "db://oops-framework/module/common/CCView";
|
||||
import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { Role } from "../Role";
|
||||
import { RoleEvent } from "../RoleEvent";
|
||||
import { RoleViewAnimator } from "./RoleViewAnimator";
|
||||
@@ -19,7 +19,7 @@ const { ccclass, property } = _decorator;
|
||||
/** 角色显示组件 */
|
||||
@ccclass('RoleViewComp') // 定义为 Cocos Creator 组件
|
||||
@ecs.register('RoleView', false) // 定义为 ECS 组件
|
||||
export class RoleViewComp extends CCComp {
|
||||
export class RoleViewComp extends CCView<Role> {
|
||||
@property({ type: sp.Skeleton, tooltip: '角色动画' })
|
||||
spine: sp.Skeleton = null!;
|
||||
|
||||
|
||||
@@ -5,18 +5,19 @@
|
||||
* @LastEditTime: 2023-08-16 14:44:08
|
||||
*/
|
||||
import { EventTouch, Node, _decorator } from "cc";
|
||||
import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCView } from "db://oops-framework/module/common/CCView";
|
||||
import { UIID } from "../../common/config/GameUIConfig";
|
||||
import { SingletonModuleComp } from "../../common/ecs/SingletonModuleComp";
|
||||
import { Role } from "../Role";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 角色信息界面 */
|
||||
@ccclass('RoleViewInfoComp')
|
||||
@ecs.register('RoleViewInfo', false)
|
||||
export class RoleViewInfoComp extends CCComp {
|
||||
export class RoleViewInfoComp extends CCView<Role> {
|
||||
onAdded(args: any) {
|
||||
console.log(args);
|
||||
return true;
|
||||
@@ -41,12 +42,7 @@ export class RoleViewInfoComp extends CCComp {
|
||||
}
|
||||
|
||||
reset() {
|
||||
oops.gui.remove(UIID.Demo_Role_Info, false);
|
||||
|
||||
// 注:模拟二次删除清理缓存
|
||||
// setTimeout(() => {
|
||||
// oops.gui.remove(UIID.Demo_Role_Info);
|
||||
// }, 1000);
|
||||
oops.gui.remove(UIID.Demo_Role_Info);
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"creator": {
|
||||
"version": "3.8.6"
|
||||
"version": "3.8.7"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "oops-framework",
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"2d": {
|
||||
"_value": true
|
||||
},
|
||||
"xr": {
|
||||
"sorting-2d": {
|
||||
"_value": false
|
||||
},
|
||||
"rich-text": {
|
||||
@@ -189,6 +189,9 @@
|
||||
},
|
||||
"legacy-pipeline": {
|
||||
"_value": false
|
||||
},
|
||||
"xr": {
|
||||
"_value": false
|
||||
}
|
||||
},
|
||||
"flags": {
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
"customSplash": {
|
||||
"id": "customSplash",
|
||||
"label": "customSplash",
|
||||
"enable": true,
|
||||
"enable": false,
|
||||
"customSplash": {
|
||||
"complete": true,
|
||||
"form": "https://creator-api.cocos.com/api/form/show?sid=af447cd43b16009ccb9a94ab7b8412ef"
|
||||
"complete": false,
|
||||
"form": "https://creator-api.cocos.com/api/form/show?"
|
||||
}
|
||||
},
|
||||
"removeSplash": {
|
||||
"id": "removeSplash",
|
||||
"label": "removeSplash",
|
||||
"enable": true,
|
||||
"enable": false,
|
||||
"removeSplash": {
|
||||
"complete": true,
|
||||
"form": "https://creator-api.cocos.com/api/form/show?sid=af447cd43b16009ccb9a94ab7b8412ef"
|
||||
"complete": false,
|
||||
"form": "https://creator-api.cocos.com/api/form/show?"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user