|
@@ -8,6 +8,7 @@ import { tools } from '../tools';
|
|
|
import { cur_edit_scene } from './cur_edit_scene';
|
|
|
import { widget_item } from './widget_item';
|
|
|
import { ClientEvent } from '../clientEvent';
|
|
|
+import { Attributes } from './Attributes';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('base_view')
|
|
@@ -52,11 +53,16 @@ export class base_view extends Component {
|
|
|
this.next_page()
|
|
|
})
|
|
|
this.updatePageNumber()
|
|
|
+ if(Attributes.is_show_more_scene_arrow==false) {
|
|
|
+ this.hideAllBtn()
|
|
|
+ }
|
|
|
ClientEvent.on(config.Event.ChangeSelectPage,this.ChangeSelectPage,this)
|
|
|
+ ClientEvent.on(config.Event.UpdateAttributesToView,this.ChangeArrow,this)
|
|
|
}
|
|
|
|
|
|
protected onDestroy(): void {
|
|
|
ClientEvent.off(config.Event.ChangeSelectPage,this.ChangeSelectPage,this)
|
|
|
+ ClientEvent.off(config.Event.UpdateAttributesToView,this.ChangeArrow,this)
|
|
|
}
|
|
|
|
|
|
ChangeSelectPage(page:number){
|
|
@@ -66,6 +72,16 @@ export class base_view extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ ChangeArrow(data:attributes_data,update_type:string) {
|
|
|
+ if(update_type==config.attributes_list_type.show_more_scene_arrow){
|
|
|
+ if(Attributes.is_show_more_scene_arrow) {
|
|
|
+ this.showBtn()
|
|
|
+ } else {
|
|
|
+ this.hideAllBtn()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public getAtt(){
|
|
|
|
|
|
}
|
|
@@ -195,34 +211,7 @@ export class base_view extends Component {
|
|
|
this.updatePageView()
|
|
|
this.m_edit_scene.cur_edit_scene_node.getComponent(cur_edit_scene).onClickScene()
|
|
|
|
|
|
- if(this.m_data.type == config.Scene_Type_List.many_screen_switch_up_down) {
|
|
|
- if(this.m_data.page_list.length == 0) {
|
|
|
- this.btn_up.active = true
|
|
|
- this.btn_down.active = true
|
|
|
- return
|
|
|
- }
|
|
|
- this.btn_up.active = true
|
|
|
- this.btn_down.active = true
|
|
|
- if(this.m_cur_page==0) {
|
|
|
- this.btn_up.active = false
|
|
|
- } else if(this.m_cur_page >= this.m_data.page_list.length - 1) {
|
|
|
- this.btn_down.active = false
|
|
|
- }
|
|
|
-
|
|
|
- } else if(this.m_data.type == config.Scene_Type_List.many_screen_switch_left_right) {
|
|
|
- if(this.m_data.page_list.length == 0) {
|
|
|
- this.btn_left.active = true
|
|
|
- this.btn_right.active = true
|
|
|
- return
|
|
|
- }
|
|
|
- this.btn_left.active = true
|
|
|
- this.btn_right.active = true
|
|
|
- if(this.m_cur_page==0) {
|
|
|
- this.btn_left.active = false
|
|
|
- } else if(this.m_cur_page >= this.m_data.page_list.length - 1) {
|
|
|
- this.btn_right.active = false
|
|
|
- }
|
|
|
- }
|
|
|
+ this.showBtn()
|
|
|
}
|
|
|
|
|
|
updatePageView(){
|
|
@@ -297,6 +286,40 @@ export class base_view extends Component {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ showBtn() {
|
|
|
+ if(Attributes.is_show_more_scene_arrow==false) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.m_data.type == config.Scene_Type_List.many_screen_switch_up_down) {
|
|
|
+ if(this.m_data.page_list.length == 0) {
|
|
|
+ this.btn_up.active = true
|
|
|
+ this.btn_down.active = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.btn_up.active = true
|
|
|
+ this.btn_down.active = true
|
|
|
+ if(this.m_cur_page==0) {
|
|
|
+ this.btn_up.active = false
|
|
|
+ } else if(this.m_cur_page >= this.m_data.page_list.length - 1) {
|
|
|
+ this.btn_down.active = false
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if(this.m_data.type == config.Scene_Type_List.many_screen_switch_left_right) {
|
|
|
+ if(this.m_data.page_list.length == 0) {
|
|
|
+ this.btn_left.active = true
|
|
|
+ this.btn_right.active = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.btn_left.active = true
|
|
|
+ this.btn_right.active = true
|
|
|
+ if(this.m_cur_page==0) {
|
|
|
+ this.btn_left.active = false
|
|
|
+ } else if(this.m_cur_page >= this.m_data.page_list.length - 1) {
|
|
|
+ this.btn_right.active = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
hideAllBtn(){
|
|
|
this.btn_down.active = false;
|
|
|
this.btn_up.active = false;
|