Explorar o código

通用提示弹窗

wujia hai 6 meses
pai
achega
3b6af43815

+ 12 - 6
assets/package/prefab/ui/tips/CommomTips.prefab

@@ -1184,9 +1184,11 @@
   },
   {
     "__type__": "cc.ClickEvent",
-    "target": null,
+    "target": {
+      "__id__": 1
+    },
     "component": "",
-    "_componentId": "995a5ONk2pJD7rK6RU/nsFU",
+    "_componentId": "d4f32a8UWJDhbF42yreMhtx",
     "handler": "onTouchButton",
     "customEventData": ""
   },
@@ -1559,9 +1561,11 @@
   },
   {
     "__type__": "cc.ClickEvent",
-    "target": null,
+    "target": {
+      "__id__": 1
+    },
     "component": "",
-    "_componentId": "995a5ONk2pJD7rK6RU/nsFU",
+    "_componentId": "d4f32a8UWJDhbF42yreMhtx",
     "handler": "onTouchButton",
     "customEventData": ""
   },
@@ -1934,9 +1938,11 @@
   },
   {
     "__type__": "cc.ClickEvent",
-    "target": null,
+    "target": {
+      "__id__": 1
+    },
     "component": "",
-    "_componentId": "995a5ONk2pJD7rK6RU/nsFU",
+    "_componentId": "d4f32a8UWJDhbF42yreMhtx",
     "handler": "onTouchButton",
     "customEventData": ""
   },

+ 7 - 7
assets/package/prefab/ui/tips/ItemMsg.prefab

@@ -859,7 +859,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 345,
+      "y": 160,
       "z": 0
     },
     "_lrot": {
@@ -1258,7 +1258,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 230,
+      "y": 45,
       "z": 0
     },
     "_lrot": {
@@ -1927,7 +1927,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 70,
+      "y": -115,
       "z": 0
     },
     "_lrot": {
@@ -2311,7 +2311,7 @@
         "__id__": 113
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 119
@@ -3053,7 +3053,7 @@
         "__id__": 155
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 175
@@ -4438,7 +4438,7 @@
         "__id__": 194
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 209
@@ -5282,7 +5282,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 704,
-      "height": 818
+      "height": 448
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 173 - 159
assets/package/prefab/ui/tower/tower.prefab


+ 6 - 0
assets/script/framework/config/LayerConf.ts

@@ -15,6 +15,9 @@ export enum ViewID {
     MailMain,                       //邮箱
     MailDetail,                     //邮件
     Bulletin,                     //公告
+
+    CommonTips,                   //通用提示
+    ItemMsg,                     //物品详情
 }
 
 export let Layer_Conf: { [key: number]: LayerConf } = {
@@ -31,4 +34,7 @@ export let Layer_Conf: { [key: number]: LayerConf } = {
     [ViewID.MailDetail]: { bundle: "mail", url: "prefab/MailDetail", type: LayerType.UI, anim: 2 },
     [ViewID.SelectServer]: { bundle: "package", url: "prefab/login/SelectServer", type: LayerType.UI, anim: 2 },
     [ViewID.Bulletin]: { bundle: "package", url: "prefab/login/Bulletin", type: LayerType.UI, anim: 2 },
+
+    [ViewID.CommonTips]: { bundle: "package", url: "prefab/ui/tips/CommomTips", type: LayerType.UI, anim: 2 },
+    [ViewID.ItemMsg]: { bundle: "package", url: "prefab/ui/tips/ItemMsg", type: LayerType.UI, anim: 2 },
 };

+ 8 - 8
assets/script/game/ui/common/CommonTips.ts

@@ -35,6 +35,9 @@ export class CommonTips extends BaseView {
 		this.cancelBtnTx.string = StringUtil.getLanguageData('取消');
 		this.confirmBtnTx.string = StringUtil.getLanguageData('确定');
 		this.closeBtnTx.string = StringUtil.getLanguageData('关闭');
+		this.closeBtn.active = false;
+		this.cancelBtn.active = false;
+		this.confirmBtn.active = false;
 	}
 
 	protected onDestroy() {
@@ -42,17 +45,14 @@ export class CommonTips extends BaseView {
 	}
 
 	//UI开打时会调用,如果有初始化代码应该放到此函数
-	onOpen(openType: TipsOpereteEnum, content: string, callback?:void) {
-		this._callback = callback;
-		this.contentTx.string = content;
-		if (openType==TipsOpereteEnum.yes) {
-			this.cancelBtn.active = false;
-			this.confirmBtn.active = false;
+	onOpen(args) {
+		this._callback = args.callback;
+		this.contentTx.string = args.content;
+		if (args.openType==TipsOpereteEnum.yes) {
 			this.closeBtn.active = true;
-		} else if (openType==TipsOpereteEnum.yes_no) {
+		} else if (args.openType==TipsOpereteEnum.yes_no) {
 			this.cancelBtn.active = true;
 			this.confirmBtn.active = true;
-			this.closeBtn.active = false;
 		}
 	}
 

+ 1 - 1
assets/script/game/ui/common/ItemMsg.ts

@@ -40,7 +40,7 @@ export class ItemMsg extends BaseView {
 	}
 
 	//UI开打时会调用,如果有初始化代码应该放到此函数
-	onOpen() {
+	onOpen(data) {
 		tween(this.closeTips.node.getComponent(UIOpacity))
 			.to(1, { opacity: 255 })
 			.to(1.2, { opacity: 10 })

+ 1 - 1
assets/script/game/ui/mail/MailMain.ts

@@ -63,7 +63,7 @@ export class MailMain extends BaseView {
 		Framework.event.addEvent(GameEvent.MailUpdate, () => {
 			this.updateMainPanel();
 			this.updateMailNum();
-        }, this);
+		}, this);
 
 		tween(this.closeTips.node.getComponent(UIOpacity))
 			.to(1, { opacity: 255 })

+ 9 - 0
assets/script/game/ui/tower/TowerUI.ts

@@ -18,6 +18,7 @@ import { isValid } from 'cc';
 import { HeroDataPool } from './data/HeroData';
 import { StringUtil } from '../../../framework/util/StringUtil';
 import { MaterialUtil } from '../../../framework/util/MaterialUtil';
+import { ViewID } from '../../../framework/config/LayerConf';
 
 
 //地图比例尺 1:70
@@ -1004,4 +1005,12 @@ export class TowerUI extends BaseView {
 		let valueOld = this.damageCountData.get(typeID) || 0
 		this.damageCountData.set(typeID,value+valueOld)
 	}
+
+	//UI事件处理
+	private onTouchButton(event: Event) {
+		let target: any = event.target;
+		if (target.name == 'addHero-004') {
+			Framework.layer.open(ViewID.MailMain)
+		}
+	}
 }

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio