|
@@ -1,10 +1,11 @@
|
|
|
-import { _decorator, Canvas, Color, Component, Director, Game, game, instantiate, misc, Node, Prefab, Size, Sprite, tween, Tween, UI, UIOpacity, UITransform, Vec3, View, Widget } from 'cc';
|
|
|
+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, scene_item_data, widget_item_data, zhao_xi_jie_item_data } from '../../data/data';
|
|
|
import { config } from '../config';
|
|
|
import { tools } from '../tools';
|
|
|
import { gameManager } from './gameManager';
|
|
|
import { widget_base } from './widget/widget_base';
|
|
|
import { ClientEvent } from '../clientEvent';
|
|
|
+import { widget_drag } from './widget/widget_drag';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
class BindTarget{
|
|
|
color : Color;
|
|
@@ -41,14 +42,9 @@ export class scene_page extends Component {
|
|
|
}else{
|
|
|
this.content.getComponent(Widget).enabled = false;
|
|
|
}
|
|
|
- this.node.getComponent(Widget).target = this.node.parent;
|
|
|
+
|
|
|
this.mAnimationList = this.mSceneAtt.animation_list;
|
|
|
- // console.log(" this.mAnimationList", this.mAnimationList)
|
|
|
- // let width = View.instance.getVisibleSize().width/this.content.getComponent(UITransform).contentSize.width;
|
|
|
- // let height = View.instance.getVisibleSize().height/this.content.getComponent(UITransform).contentSize.height;
|
|
|
- // if(height>1){
|
|
|
- // this.content.scale = new Vec3(1,height,1)
|
|
|
- // }
|
|
|
+ console.log(" this.mAnimationList", this.mAnimationList)
|
|
|
if(this.mIsMask){
|
|
|
this.maskView.active = true;
|
|
|
}else{
|
|
@@ -59,7 +55,14 @@ export class scene_page extends Component {
|
|
|
ClientEvent.on(config.EventRun.SHOW_ZHAO_BU_TONG_FINISH_STATUS,this.on_zhao_bu_tong_finish.bind(this),this)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ public checkFinish(widget_id:number):boolean{
|
|
|
+ let widget = this.mWidgetList.get(widget_id)
|
|
|
+ if(!widget){
|
|
|
+ tools.showToast("配置监听其他控件错误")
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return widget.getComponent(widget_base).getIsFinish();
|
|
|
+ }
|
|
|
protected onDestroy(): void {
|
|
|
this.mWidgetList.clear()
|
|
|
ClientEvent.off(config.EventRun.SHOW_ZHAO_BU_TONG_FINISH_STATUS,this.on_zhao_bu_tong_finish.bind(this),this)
|
|
@@ -71,7 +74,7 @@ export class scene_page extends Component {
|
|
|
if(item){
|
|
|
item.getComponent(widget_base).beActive(widgetId,event)
|
|
|
}
|
|
|
- // console.log("event.type",event.type)
|
|
|
+ console.log("event.type",event.type)
|
|
|
if(event.type===config.event_type.scene_ani){
|
|
|
|
|
|
let ani_id = event.event_item_scene_ani.ani_id;
|
|
@@ -86,6 +89,15 @@ export class scene_page extends Component {
|
|
|
}else{
|
|
|
return tools.showToast(`错误的动画配置!id:${this.mData.att.id}-请检查`)
|
|
|
}
|
|
|
+ }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("删除拖拽目标配置错误!")
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
on_zhao_bu_tong_finish(widget:zhao_xi_jie_item_data){
|
|
@@ -209,7 +221,7 @@ export class scene_page extends Component {
|
|
|
self.content.getComponent(Sprite).color = tar.color;
|
|
|
self.content.getComponent(UIOpacity).opacity = tar.opacity;
|
|
|
// self.content.getComponent(UITransform).setContentSize(tar.size)
|
|
|
- // self.content.position = tar.pos
|
|
|
+ self.content.position = tar.pos
|
|
|
self.content.angle = tar.rotation;
|
|
|
}
|
|
|
}).call(()=>{
|