future 1 年之前
父節點
當前提交
8ff00aed03
共有 2 個文件被更改,包括 432 次插入115 次删除
  1. 409 114
      assets/edit_game.scene
  2. 23 1
      assets/script/edit/uiWidget/widget_not_have_interact.ts

File diff suppressed because it is too large
+ 409 - 114
assets/edit_game.scene


+ 23 - 1
assets/script/edit/uiWidget/widget_not_have_interact.ts

@@ -1,14 +1,36 @@
-import { _decorator, Component, Node } from 'cc';
+import { _decorator, Component, Node, SpriteFrame } from 'cc';
 import { not_have_interact_data } from '../../../data/data';
 import { receive_widget_item } from './receive_widget_item';
+import { Attributes } from '../Attributes';
+import { tools } from '../../tools';
+import { ClientEvent } from '../../clientEvent';
+import { config } from '../../config';
 const { ccclass, property } = _decorator;
 
 @ccclass('widget_not_have_interact')
 export class widget_not_have_interact extends Component {
     @property(Node) bg_widget_info:Node = null;
+    @property(Node) btn_original_size:Node = null;
     private m_data:not_have_interact_data = null;
+    protected start(): void {
+        this.btn_original_size.on(Node.EventType.TOUCH_END, ()=>{
+            if(this.m_data.bg.res.length==0) {
+                return tools.showToast('还没有图片')
+            }
+            tools.loadUrl(this.m_data.bg.res,null,(sf:SpriteFrame)=>{
+                this.m_data.bg.width = sf.originalSize.width
+                this.m_data.bg.height = sf.originalSize.height
+                this.updateStatus()
+                ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,Attributes.Singleton.get_cur_att_data(),config.attributes_list_type.top)
+            })
+        })
+    }
     public initView(data:not_have_interact_data){
         this.m_data = data;
+        this.updateStatus()
+    }
+
+    private updateStatus() {
         this.bg_widget_info.getComponent(receive_widget_item).updateView(this.m_data.bg)
     }
 }

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