|
@@ -39,6 +39,11 @@ export class widget_item extends Component {
|
|
|
private m_count_down:Node = null;
|
|
|
private x_len:number = 0;
|
|
|
private y_len:number = 0;
|
|
|
+ private m_isShowWidgetList:boolean = false;
|
|
|
+ public initIsShowWidgetList() {
|
|
|
+ // 点击->控件列表,不显示拖拽其他按钮
|
|
|
+ this.m_isShowWidgetList = true
|
|
|
+ }
|
|
|
public initView(data:widget_item_data,call=null,cur_select_id:number=-1){
|
|
|
this.m_data = data;
|
|
|
this.lab_name.getComponent(Label).string = data.name + (this.m_data.att?`id:${this.m_data.att.id}`:"");
|
|
@@ -122,7 +127,7 @@ export class widget_item extends Component {
|
|
|
}
|
|
|
this.other_drag_content.removeAllChildren()
|
|
|
for (let index = 0; index < this.m_att.drag_data.other_drag_list.length; index++) {
|
|
|
- const element = this.m_att.drag_data.other_drag_list[index];
|
|
|
+ const element:att_drag_data = this.m_att.drag_data.other_drag_list[index];
|
|
|
let item = instantiate(this.drag)
|
|
|
item.off(Node.EventType.TOUCH_MOVE)
|
|
|
item.parent = this.other_drag_content;
|
|
@@ -135,7 +140,7 @@ export class widget_item extends Component {
|
|
|
this.m_att.drag_data.other_drag_list[index].drag_pos_x = item.position.x;
|
|
|
this.m_att.drag_data.other_drag_list[index].drag_pos_y = item.position.y;
|
|
|
})
|
|
|
- item.getComponent(Sprite).color = Color.YELLOW
|
|
|
+ item.getComponent(Sprite).color = this.getOtherDragListColor(index) //Color.YELLOW
|
|
|
}
|
|
|
this.lab_drag.getComponent(Label).string = `${this.m_data.name}id:${this.m_att.id}`
|
|
|
}
|
|
@@ -196,7 +201,9 @@ export class widget_item extends Component {
|
|
|
this.m_att.drag_data = new att_drag_data;
|
|
|
}
|
|
|
this.drag.active = true;
|
|
|
- this.initDrag()
|
|
|
+ if(this.m_isShowWidgetList == false) {
|
|
|
+ this.initDrag()
|
|
|
+ }
|
|
|
}else if(this.m_data.type===config.Widget_Type_List.SLIDE_TYPE){
|
|
|
this.slide.active = true;
|
|
|
if(this.m_att.slide_data===null){
|
|
@@ -423,7 +430,7 @@ export class widget_item extends Component {
|
|
|
this.m_att.drag_data.other_drag_list[index].drag_pos_x = item.position.x;
|
|
|
this.m_att.drag_data.other_drag_list[index].drag_pos_y = item.position.y;
|
|
|
})
|
|
|
- item.getComponent(Sprite).color = Color.YELLOW
|
|
|
+ item.getComponent(Sprite).color = this.getOtherDragListColor(index) //Color.YELLOW
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -514,6 +521,16 @@ export class widget_item extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ getOtherDragListColor(index:number):Color {
|
|
|
+ var color_index = index
|
|
|
+ if(index >= config.COLOR_LIST.length) {
|
|
|
+ let count = Math.floor(index / config.COLOR_LIST.length)
|
|
|
+ color_index = index - (config.COLOR_LIST.length * count)
|
|
|
+ }
|
|
|
+ return config.COLOR_LIST[color_index]
|
|
|
+ // return Color.YELLOW
|
|
|
+ }
|
|
|
+
|
|
|
Shiny(){
|
|
|
this.img_select.active = true;
|
|
|
this.img_select.getComponent(UITransform).setContentSize(this.node.getComponent(UITransform).contentSize)
|