各类弹窗重新设计,使用opps 集成的方式

This commit is contained in:
2024-11-27 17:20:15 +08:00
parent 4ae407bd20
commit 4ba91e95fa
10 changed files with 1870 additions and 292 deletions

View File

@@ -0,0 +1,63 @@
[
{
"__type__": "cc.Prefab",
"_name": "item_info",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "item_info",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 2
},
"_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
},
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c46/YsCPVOJYA4mWEpNYRx"
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "9851f9ee-65d3-42c9-8d06-2e1eaf0b8301",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "item_info"
}
}

View File

@@ -945,10 +945,10 @@
"height": 63,
"rawWidth": 37,
"rawHeight": 63,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 42,
"borderBottom": 17,
"borderLeft": 17,
"borderRight": 17,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -10375,10 +10375,10 @@
"height": 130,
"rawWidth": 65,
"rawHeight": 130,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderTop": 58,
"borderBottom": 59,
"borderLeft": 29,
"borderRight": 28,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
@@ -10605,8 +10605,8 @@
"height": 63,
"rawWidth": 37,
"rawHeight": 63,
"borderTop": 29,
"borderBottom": 30,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 16,
"borderRight": 16,
"packable": true,

File diff suppressed because it is too large Load Diff

View File

@@ -16,8 +16,6 @@ export enum UIID {
Netinstable,
/** 角色控制 */
Role_Controller,
/** 奖励界面 */
Rewards,
}
/** 打开界面方式的配置数据 */
@@ -25,6 +23,5 @@ export var UIConfigData: { [key: number]: UIConfig } = {
[UIID.Loading]: { layer: LayerType.UI, prefab: "loading/prefab/loading", bundle: "resources" },
[UIID.Netinstable]: { layer: LayerType.PopUp, prefab: "common/prefab/netinstable" },
[UIID.Window]: { layer: LayerType.Dialog, prefab: "common/prefab/window" },
[UIID.Rewards]: { layer: LayerType.Dialog, prefab: "gui/rewards" },
[UIID.Role_Controller]: { layer: LayerType.UI, prefab: "gui/role_controller" },
}

View File

@@ -17,7 +17,6 @@ import { HeroViewComp } from "./HeroViewComp";
import { BoxSet } from "../common/config/BoxSet";
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
import { HeroInfo,MonSet } from "../common/config/heroSet";
import { Role } from "../Role/Role";
import { MoveToComp } from "../common/ecs/position/MoveTo";
import { Talents } from "../common/config/TalentSet";
import { MonModelComp } from "../mon/MonModelComp";

View File

@@ -1,4 +1,4 @@
import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,UITransform,v3 } from "cc";
import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,tween,UITransform,v3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { smc } from "../common/SingletonModuleComp";
@@ -93,6 +93,12 @@ export class CardControllerComp extends CCComp {
this.node.getChildByName("bar").getChildByName("home_btn").getChildByName("bg").active=false
}
item_info_show(){
this.node.getChildByName("item_info").setScale(1,1,1)
}
item_info_hide(){
this.node.getChildByName("item_info").setScale(0,0,1)
}
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();

View File

@@ -0,0 +1,29 @@
import { _decorator } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('ItemInfoComp')
@ecs.register('ItemInfo', false)
export class ItemInfoComp extends CCComp {
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {
// switch (event) {
// case ModuleEvent.Cmd:
// break;
// }
// }
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "8a98f43a-eefc-40aa-8ab5-b7f25f01eef3",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -16,6 +16,7 @@ const { ccclass, property } = _decorator;
@ccclass('VictoryComp')
@ecs.register('Victory', false)
export class VictoryComp extends CCComp {
reward_lv:number=1
reward_num:number=2
rerawd_item:any={}
@@ -25,14 +26,14 @@ export class VictoryComp extends CCComp {
}
private do_victiry() {
if(this.if_show) return
this.node.getChildByName("Node").active = true;
this.node.getChildByName("Node").setScale(1,1,1)
this.getReward(true)
this.node.getChildByName("Node").getChildByName("defeat").active = false
this.node.getChildByName("Node").getChildByName("victory").active = true;
}
private do_defeat() {
if(this.if_show) return
this.node.getChildByName("Node").active = true;
this.node.getChildByName("Node").setScale(1,1,1)
this.getReward(false)
this.node.getChildByName("Node").getChildByName("victory").active = false;
this.node.getChildByName("Node").getChildByName("defeat").active = true
@@ -53,7 +54,7 @@ export class VictoryComp extends CCComp {
this.if_show=true
}
end_mission(){
this.node.getChildByName("Node").active=false
this.node.getChildByName("Node").setScale(0,0,0)
this.if_show=false
}