future 1 سال پیش
والد
کامیت
31c4b20f39

+ 4 - 9
assets/data/data.ts

@@ -21,6 +21,7 @@ export class attributes_data{
     public src_name:string = "";
     public ani:string = "";
     public scene_rule_tips_data:scene_tips_rule_data = new scene_tips_rule_data; //场景的规则和提示
+    public scene_more_scene_show_arrow:boolean = false;  //场景多场景显示箭头
     public edit_active:boolean = true;  //是否激活
     public is_interaction:boolean = true;  //开启交互
     public is_show:boolean = true; //默认显示
@@ -80,7 +81,6 @@ export class att_drag_data{
     public drag_size_height:number = 0;
     public drag_pos_x:number = 0;
     public drag_pos_y:number = 0;
-    public z_index:number = 0; //层级(方便查看,和前台没关系)
     public other_event_id:number = -1; //其他拖拽的完成事件
     public is_err_drag_back:boolean = true; //拖拽错误是否回归原位
     public other_drag_list:att_drag_data[] = [];
@@ -454,8 +454,9 @@ export class event_item_stop_play_loop_sound{
 }
 export class event_item_delete_drag_other {
     public widget_id:number = -1;
-    public delete_drag_other_index:number = -1;
-    public widget_list:event_widget_more_delete_drag_other_event_item[] = [] //列表
+    public widget_remark:string = '';//备注
+    public delete_drag_other_index:number = -1; //废弃
+    public widget_list:event_item_delete_drag_other[] = [] //列表
 }
 
 export class event_item_play_sound { //播放一个音效
@@ -559,12 +560,6 @@ export class event_widget_more_event_item extends base_event_item {
     public binding_widget_remark:string = ''; //备注
 }
 
-export class event_widget_more_delete_drag_other_event_item extends base_event_item {
-    public widget_id:number = -1;
-    public widget_remark:string = '';//备注
-    public delete_drag_other_index:number = -1; 
-}
-
 export class event_group_event_item_event_item extends base_event_item{
     public event_item:event_item = new event_item
     public delay_time:number = 0;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 696 - 219
assets/edit_game.scene


+ 7 - 7
assets/resources/prefab/edit_event.prefab

@@ -21087,7 +21087,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 80,
+      "width": 246.6650390625,
       "height": 50.4
     },
     "_anchorPoint": {
@@ -21123,11 +21123,11 @@
       "b": 0,
       "a": 255
     },
-    "_string": "输入",
+    "_string": "输入索引(从0开始)",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 40,
-    "_fontSize": 40,
+    "_actualFontSize": 30,
+    "_fontSize": 30,
     "_fontFamily": "Arial",
     "_lineHeight": 40,
     "_overflow": 0,
@@ -21192,7 +21192,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 65.797,
+      "x": 85.797,
       "y": 0,
       "z": 0
     },
@@ -38118,8 +38118,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 1920,
-      "height": 1920
+      "width": 1919.9999999999998,
+      "height": 1919.9999999999998
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 11 - 11
assets/resources/prefab/edit_event_more_delete_drag_other_item.prefab

@@ -430,7 +430,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -131.595,
+      "x": -63,
       "y": 0,
       "z": 0
     },
@@ -471,7 +471,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 80,
+      "width": 205.55419921875,
       "height": 50.4
     },
     "_anchorPoint": {
@@ -507,11 +507,11 @@
       "b": 0,
       "a": 255
     },
-    "_string": "输入",
+    "_string": "输入索引(从0开始)",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 40,
-    "_fontSize": 40,
+    "_actualFontSize": 25,
+    "_fontSize": 25,
     "_fontFamily": "Arial",
     "_lineHeight": 40,
     "_overflow": 0,
@@ -576,7 +576,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 65.797,
+      "x": 106.797,
       "y": 0,
       "z": 0
     },
@@ -626,7 +626,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -78,
+      "x": -48,
       "y": 20,
       "z": 0
     },
@@ -667,7 +667,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 158,
+      "width": 98,
       "height": 40
     },
     "_anchorPoint": {
@@ -762,7 +762,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -78,
+      "x": -48,
       "y": 20,
       "z": 0
     },
@@ -803,7 +803,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 158,
+      "width": 98,
       "height": 40
     },
     "_anchorPoint": {
@@ -889,7 +889,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 160,
+      "width": 100,
       "height": 40
     },
     "_anchorPoint": {

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 80 - 809
assets/resources/prefab/task/other_drag_list_item.prefab


+ 6 - 1
assets/script/edit/Attributes.ts

@@ -89,7 +89,7 @@ export class Attributes extends Component {
         this.attributes_map.set("show",this.attributes_show)
         this.attributes_map.set("scene_set",this.attributes_scene_setting)
         this.attributes_remark.getComponent(attributes_remark).initView(this.onChangeRemark.bind(this))
-        this.attributes_scene_setting.getComponent(attributes_scene_setting).initView(this.onChangSceneTipsRuleStatus.bind(this))
+        this.attributes_scene_setting.getComponent(attributes_scene_setting).initView(this.onChangSceneTipsRuleStatus.bind(this),this.onChangSceneAttributesStatus.bind(this))
         this.attributes_show.getComponent(attributes_show).initView(this.onChangShowStatus.bind(this))
         this.attributes_dir.getComponent(attributes_dir).initView(this.onChangeDir.bind(this))
         this.attributes_z_index.getComponent(attributes_z_index).initView(this.onChangeZIndex.bind(this))
@@ -133,6 +133,10 @@ export class Attributes extends Component {
         ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.scene_rule_tips)
     }
 
+    onChangSceneAttributesStatus(data:attributes_data) {
+        ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.scene_rule_tips)
+    }
+
     onChangShowStatus(show:boolean){
         this.cur_att_data.is_show = show;
         ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView,this.cur_att_data,config.attributes_list_type.show)
@@ -387,6 +391,7 @@ export class Attributes extends Component {
             
             let scene_set = this.getSceneSetingCom()
             if(this.cur_att_data.type===config.attributes_type.scene){
+                scene_set.update_att_info(this.cur_att_data)
                 if(this.cur_att_data.scene_rule_tips_data!=null){
                     scene_set.update_att(this.cur_att_data.scene_rule_tips_data)
                 }else{

+ 28 - 3
assets/script/edit/attributes/attributes_scene_setting.ts

@@ -1,5 +1,5 @@
-import { _decorator, Component, EditBox, instantiate, Node, Prefab } from 'cc';
-import { scene_tips_rule_data, ui_att_item } from '../../../data/data';
+import { _decorator, Component, EditBox, instantiate, Node, Prefab, Toggle } from 'cc';
+import { attributes_data, scene_tips_rule_data, ui_att_item } from '../../../data/data';
 import { scene_tips_rule_item } from './scene_tips_rule_item';
 import { config } from '../../config';
 const { ccclass, property } = _decorator;
@@ -15,11 +15,16 @@ export class attributes_scene_setting extends Component {
     @property(Node) tips:Node = null;
     @property(Node) answer:Node = null;
     @property(EditBox) edit_des:EditBox = null;
+    @property(Node) show_arrow_node:Node = null;
+    @property(Toggle) toggle_show_arrow:Toggle = null;
     private call_back = null;
+    private m_attributes_call = null;
+    private m_attributes_data:attributes_data = null;
     private m_data:scene_tips_rule_data = null;
-    public initView(call){
+    public initView(call,attributes_call){
 
         this.call_back = call;
+        this.m_attributes_call = attributes_call;
 
         this.btn_add_rule.on(Node.EventType.TOUCH_END,()=>{
             this.addRule()
@@ -29,6 +34,26 @@ export class attributes_scene_setting extends Component {
             this.m_data.scene_des = this.edit_des.string;
             this.update_att(this.m_data)
         })
+
+        this.toggle_show_arrow.node.on(Toggle.EventType.TOGGLE, ()=>{
+            this.m_attributes_data.scene_more_scene_show_arrow = !this.m_attributes_data.scene_more_scene_show_arrow
+            if(this.m_attributes_call!=null) {
+                this.m_attributes_call(this.m_attributes_data)
+            }
+        })
+    }
+
+    public update_att_info(data:attributes_data){
+        this.m_attributes_data = data
+        if(this.m_attributes_data.type===config.attributes_type.scene) {
+            this.show_arrow_node.active = true
+            if(this.m_attributes_data.scene_more_scene_show_arrow==undefined) {
+                this.m_attributes_data.scene_more_scene_show_arrow = true
+            }
+            this.toggle_show_arrow.isChecked = this.m_attributes_data.scene_more_scene_show_arrow
+        } else {
+            this.show_arrow_node.active = false
+        }
     }
 
     public update_att(data:scene_tips_rule_data){

+ 0 - 10
assets/script/edit/attributes/other_drag_list_item.ts

@@ -18,7 +18,6 @@ export class other_drag_list_item extends Component {
     @property(Node) btn_delete:Node = null;
     @property(EditBox) editBox_remark:EditBox = null;
     @property(Node) btn_is_show:Node = null;
-    @property(EditBox) editBox_z_index:EditBox = null;
     private m_data:att_drag_data = null;
     private delete_call = null;
     public initView(data:att_drag_data,call){
@@ -51,8 +50,6 @@ export class other_drag_list_item extends Component {
             // console.log('this.m_data.is_show_inTheEditor=',this.m_data.is_show_inTheEditor)
             this.change()
         }, this)
-
-        this.editBox_z_index.node.on('editing-did-ended', this.change, this)
     }
     change(){
         this.m_data.drag_pos_x = parseInt(this.drag_x.string);
@@ -62,8 +59,6 @@ export class other_drag_list_item extends Component {
         this.m_data.drag_size_height = parseInt(this.drag_height.string);
 
         this.m_data.remark = this.editBox_remark.string;
-
-        this.m_data.z_index = parseInt(this.editBox_z_index.string)
        
         ClientEvent.dispatchEvent(config.Event.UpdateAttributesToView, Attributes.Singleton.get_cur_att_data(),config.attributes_list_type.drag)
     }
@@ -85,11 +80,6 @@ export class other_drag_list_item extends Component {
             data.is_show_inTheEditor = true
         }
         this.btn_is_show.getComponent(Toggle).isChecked = data.is_show_inTheEditor
-
-        if(data.z_index==undefined) {
-            data.z_index = 0
-        }
-        this.editBox_z_index.string = data.z_index.toString()
     }
 }
 

+ 9 - 5
assets/script/edit/event/edit_event_more_delete_drag_other_item.ts

@@ -1,5 +1,5 @@
 import { _decorator, Component, EditBox, Label, Node } from 'cc';
-import { event_widget_more_delete_drag_other_event_item } from '../../../data/data';
+import { event_item_delete_drag_other } from '../../../data/data';
 import { tools } from '../../tools';
 const { ccclass, property } = _decorator;
 
@@ -9,12 +9,16 @@ export class edit_event_more_delete_drag_other_item extends Component {
     @property(Node) lab_remark:Node = null
     @property(EditBox) editbox:EditBox = null
     @property(Node) btn_delete:Node = null
-    private m_data:event_widget_more_delete_drag_other_event_item = null
+    private m_data:event_item_delete_drag_other = null
     private m_delete_callback:Function
     start() {
         this.editbox.node.on(EditBox.EventType.EDITING_DID_ENDED, ()=> {
-            let index = parseInt(this.editbox.string)
-            this.m_data.delete_drag_other_index = index;
+            if(this.editbox.string.length>0) {
+                let index = parseInt(this.editbox.string)
+                this.m_data.delete_drag_other_index = index;
+            } else {
+                this.m_data.delete_drag_other_index = -1;
+            }
         })
         this.btn_delete.on(Node.EventType.TOUCH_END, ()=> {
             if(this.m_delete_callback!=null) {
@@ -25,7 +29,7 @@ export class edit_event_more_delete_drag_other_item extends Component {
         })
     }
 
-    initView(data:event_widget_more_delete_drag_other_event_item, delete_callback:Function) {
+    initView(data:event_item_delete_drag_other, delete_callback:Function) {
         this.m_data = data
         this.m_delete_callback = delete_callback
         this.lab_id.getComponent(Label).string = 'id:' + data.widget_id

+ 2 - 2
assets/script/edit/event/event_delete_drag_other_data_view.ts

@@ -1,5 +1,5 @@
 import { _decorator, Component, EditBox, instantiate, Label, Node, Prefab } from 'cc';
-import { event_item_delete_drag_other, event_widget_more_delete_drag_other_event_item, widget_item_data } from '../../../data/data';
+import { event_item_delete_drag_other, widget_item_data } from '../../../data/data';
 import { Attributes } from '../Attributes';
 import { tools } from '../../tools';
 import { config } from '../../config';
@@ -83,7 +83,7 @@ export class event_delete_drag_other_data_view extends Component {
             return tools.showToast("当前场景没有添加拖拽控件!")
         }
         tools.show_select_widget_list(list,(item:widget_item_data)=>{
-            let more_item = new event_widget_more_delete_drag_other_event_item
+            let more_item = new event_item_delete_drag_other
             more_item.widget_id = item.att.id
             more_item.widget_remark = item.att.remark
             more_item.delete_drag_other_index = -1

+ 0 - 6
assets/script/edit/widget_item.ts

@@ -132,10 +132,6 @@ export class widget_item extends Component {
             item.off(Node.EventType.TOUCH_MOVE)
             item.parent = this.other_drag_content;
             item.position = new Vec3(element.drag_pos_x,element.drag_pos_y)
-            if(element.z_index==undefined) {
-                element.z_index=0
-            } 
-            item.setSiblingIndex(element.z_index)
             item.getComponent(UITransform).setContentSize(new Size(element.drag_size_width,element.drag_size_height))
             item.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
                 let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
@@ -438,8 +434,6 @@ export class widget_item extends Component {
                             item.parent = this.other_drag_content;
                             item.position = new Vec3(element.drag_pos_x,element.drag_pos_y)
                             item.getComponent(UITransform).setContentSize(new Size(element.drag_size_width,element.drag_size_height))
-                            if(element.z_index==undefined) { element.z_index=0 }
-                            item.setSiblingIndex(element.z_index)
                             item.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
                                 let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
                                 let n_p = this.node.getComponent(UITransform).convertToNodeSpaceAR(p)

+ 37 - 25
assets/script/run/scene_page.ts

@@ -1,5 +1,5 @@
 import { _decorator, Color, Component, instantiate, misc, Node, Prefab, Size, Sprite, tween, Tween, UIOpacity, UITransform, Vec3, Widget } from 'cc';
-import { ani_frame, att_ani_data, attributes_data, event_item, guo_ju_qing_dai_dao_ju, scene_item_data, widget_item_data, zhao_xi_jie_data, zhao_xi_jie_item_data } from '../../data/data';
+import { ani_frame, att_ani_data, attributes_data, event_item, event_item_delete_drag_other, guo_ju_qing_dai_dao_ju, scene_item_data, widget_item_data, zhao_xi_jie_data, zhao_xi_jie_item_data } from '../../data/data';
 import { config } from '../config';
 import { tools } from '../tools';
 import { gameManager } from './gameManager';
@@ -104,13 +104,43 @@ export class scene_page extends Component {
         }else if(event.type===config.event_type.delete_drag_other_data){
             let wd = event.event_item_delete_drag_other_data.widget_id
             let index = event.event_item_delete_drag_other_data.delete_drag_other_index
-            item = this.mWidgetList.get(wd)
-            if(item){
-                item.getComponent(widget_drag).deleteOtherDrag(index)
-            }else{
-                tools.showToast("删除拖拽目标配置错误!")
+            let other_widget_list = event.event_item_delete_drag_other_data.widget_list
+            if(other_widget_list.length==0) {
+                item = this.mWidgetList.get(wd)
+                if(item){
+                    item.getComponent(widget_drag).deleteOtherDrag(index)
+                }else{
+                    // tools.showToast("删除拖拽目标配置错误!")
+                }
+            } else {
+                let data_list:event_item_delete_drag_other[] = JSON.parse(JSON.stringify(other_widget_list))
+                let first_data = new event_item_delete_drag_other
+                first_data.widget_id = wd
+                first_data.delete_drag_other_index = index
+                data_list.unshift(first_data)
+                var data_map:Map<number,number> = new Map;
+                for(let i=0;i<data_list.length;i++) {
+                    const element = data_list[i]
+                    let wd = element.widget_id
+                    let index = element.delete_drag_other_index
+                    if(index!=-1) {
+                        let e_item = this.mWidgetList.get(wd)
+                        if(e_item){
+                            let minus_index = 0
+                            if(data_map.get(wd)==null) {
+                                data_map.set(wd,0)
+                            } else {
+                                let v = data_map.get(wd)
+                                minus_index = v+1
+                                data_map.set(wd,minus_index)
+                            }
+                            // console.log('minus_index=',minus_index)
+                            let c_index = index - minus_index
+                            e_item.getComponent(widget_drag).deleteOtherDrag(c_index)
+                        }
+                    }
+                }
             }
-            this.eventWidgetMoreDeleteDragOtheList(event.event_item_delete_drag_other_data, event)
         }else if(event.type===config.event_type.active_event) {
             let data = event.event_item_active_event_data
             this.eventMoreBindingWidgetList(data, event) 
@@ -139,24 +169,6 @@ export class scene_page extends Component {
             }
         }  
     }
-    eventWidgetMoreDeleteDragOtheList(data, event:event_item) {
-        if(data!=null) {
-            if(data.widget_list==null||data.widget_list.length==0) {
-                return
-            }
-            for(let i=0;i<data.widget_list.length;i++) {
-                const element = data.widget_list[i]
-                let wd = element.widget_id
-                let index = element.delete_drag_other_index
-                if(index!=-1) {
-                    let e_item = this.mWidgetList.get(wd)
-                    if(e_item){
-                        e_item.getComponent(widget_drag).deleteOtherDrag(index)
-                    }
-                }
-            }
-        }
-    }
     on_zhao_bu_tong_finish(widget:zhao_xi_jie_item_data){
        let item =   this.mWidgetList.get(widget.widget_id)
        if(item===null){

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است