|
@@ -2,6 +2,7 @@ import { _decorator, Component, Label, Node, Sprite } from 'cc';
|
|
|
import { tools } from '../../tools';
|
|
|
import { bag_item_data, event_item, widget_item_data, zhao_xi_jie_item_data } from '../../../data/data';
|
|
|
import { Attributes } from '../Attributes';
|
|
|
+import { config } from '../../config';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('select_task_zhao_xi_jie_item')
|
|
@@ -15,6 +16,9 @@ export class select_task_zhao_xi_jie_item extends Component {
|
|
|
@property(Node) btn_select_finishi_event:Node = null;
|
|
|
@property(Node) lab_select_finishi_event:Node = null;
|
|
|
@property(Node) btn_clear_finishi_event:Node = null;
|
|
|
+ @property(Node) btn_select_finishi_widget:Node = null;
|
|
|
+ @property(Node) lab_select_finishi_widget:Node = null;
|
|
|
+ @property(Node) btn_clear_finishi_widget:Node = null;
|
|
|
protected m_call_back = null;
|
|
|
protected m_data:zhao_xi_jie_item_data = null;
|
|
|
protected m_index:number = 0;
|
|
@@ -32,6 +36,9 @@ export class select_task_zhao_xi_jie_item extends Component {
|
|
|
if(this.m_data.finish_event_id==undefined||this.m_data.finish_event_id==null) {
|
|
|
this.m_data.finish_event_id = -1
|
|
|
}
|
|
|
+ if(this.m_data.finish_widget_id==undefined||this.m_data.finish_widget_id==null) {
|
|
|
+ this.m_data.finish_widget_id = -1
|
|
|
+ }
|
|
|
this.btn_add_tip_res.on(Node.EventType.TOUCH_END,()=>{
|
|
|
tools.select_res_list((data:bag_item_data)=>{
|
|
|
this.m_data.tips_res = data.url;
|
|
@@ -63,7 +70,7 @@ export class select_task_zhao_xi_jie_item extends Component {
|
|
|
}
|
|
|
})
|
|
|
this.btn_select_finishi_event.on(Node.EventType.TOUCH_END, ()=>{
|
|
|
- let list = Attributes.Singleton.getEventList()
|
|
|
+ let list = Attributes.Singleton.getEventListByType(config.event_type.text_sound)
|
|
|
tools.show_select_evele_list(list,(data:event_item)=>{
|
|
|
this.m_data.finish_event_id = data.event_id
|
|
|
this.updateShowStatus()
|
|
@@ -73,12 +80,32 @@ export class select_task_zhao_xi_jie_item extends Component {
|
|
|
if(this.m_data.finish_event_id==-1) {
|
|
|
return
|
|
|
}
|
|
|
- tools.show_dialog("是否清空完成事件?",()=>{
|
|
|
+ tools.show_dialog("是否清空?",()=>{
|
|
|
this.m_data.finish_event_id = -1
|
|
|
this.updateShowStatus()
|
|
|
})
|
|
|
})
|
|
|
|
|
|
+ this.btn_select_finishi_widget.on(Node.EventType.TOUCH_END, ()=>{
|
|
|
+ let list = Attributes.Singleton.get_cur_scene_widget_by_type(config.Widget_Type_List.UI_TOP)
|
|
|
+ if(list.length<=0){
|
|
|
+ return tools.showToast("当前场景没有弹窗控件!")
|
|
|
+ }
|
|
|
+ tools.show_select_widget_list(list,(item:widget_item_data)=>{
|
|
|
+ this.m_data.finish_widget_id = item.att.id;
|
|
|
+ this.updateShowStatus()
|
|
|
+ },this.m_data.finish_widget_id)
|
|
|
+ })
|
|
|
+ this.btn_clear_finishi_widget.on(Node.EventType.TOUCH_END, ()=>{
|
|
|
+ if(this.m_data.finish_widget_id==-1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ tools.show_dialog("是否清空?",()=>{
|
|
|
+ this.m_data.finish_widget_id = -1
|
|
|
+ this.updateShowStatus()
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
this.updateShowStatus()
|
|
|
}
|
|
|
|
|
@@ -90,8 +117,21 @@ export class select_task_zhao_xi_jie_item extends Component {
|
|
|
tools.loadUrl(this.m_data.res,this.node.getComponent(Sprite))
|
|
|
this.lab_select_widget.getComponent(Label).string = this.m_data.widget_id!=-1?`当前选择的控件:${this.m_data.widget_id}`:"选择控件"
|
|
|
this.lab_select_res.getComponent(Label).string = this.m_data.res_name.length>0?this.m_data.res_name:"选择资源"
|
|
|
- this.lab_select_finishi_event.getComponent(Label).string = this.m_data.finish_event_id!=-1?`当前完成的事件:${this.m_data.finish_event_id}`:"选择完成事件"
|
|
|
tools.loadUrl(this.m_data.tips_res,this.btn_add_tip_res.getComponent(Sprite))
|
|
|
+
|
|
|
+ this.lab_select_finishi_event.getComponent(Label).string = this.m_data.finish_event_id!=-1?`文字及语音事件id:${this.m_data.finish_event_id}`:"选择文字及语音完成事件"
|
|
|
+ if(this.m_data.finish_event_id==-1) {
|
|
|
+ this.btn_clear_finishi_event.active = false
|
|
|
+ } else {
|
|
|
+ this.btn_clear_finishi_event.active = true
|
|
|
+ }
|
|
|
+
|
|
|
+ this.lab_select_finishi_widget.getComponent(Label).string = this.m_data.finish_widget_id!=-1?`弹窗控件id:${this.m_data.finish_widget_id}`:"选择完成弹窗控件"
|
|
|
+ if(this.m_data.finish_widget_id==-1) {
|
|
|
+ this.btn_clear_finishi_widget.active = false
|
|
|
+ } else {
|
|
|
+ this.btn_clear_finishi_widget.active = true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|