|
@@ -23,11 +23,12 @@ export class game_list extends Component {
|
|
|
private m_data:LevelMessage = null;
|
|
|
private x_len:number = 0;
|
|
|
private onTouchActive:boolean = true;
|
|
|
- private onClickItem:boolean = false;
|
|
|
+ private content_original_pos:Vec3 = Vec3.ZERO;
|
|
|
private start_pos:Vec2 = Vec2.ZERO;
|
|
|
private page_limit_count:number = 6
|
|
|
|
|
|
protected start(): void {
|
|
|
+ this.content_original_pos = this.content.getPosition()
|
|
|
if(SdkUtil.KS_GAME) {
|
|
|
let p = this.btn_back.getPosition()
|
|
|
this.btn_back.setPosition(p.x,p.y-120,p.z)
|
|
@@ -119,21 +120,22 @@ export class game_list extends Component {
|
|
|
this.content.position = new Vec3(n_p.x-this.x_len ,this.content.position.y);
|
|
|
})
|
|
|
this.content.on(Node.EventType.TOUCH_END,()=>{
|
|
|
- if(this.onClickItem) { return }
|
|
|
this.x_len = 0
|
|
|
this.touchContentScroll()
|
|
|
- this.content.position = new Vec3(-19,this.content.position.y)
|
|
|
+ this.content.position = new Vec3(this.content_original_pos.x,this.content.position.y)
|
|
|
})
|
|
|
this.content.on(Node.EventType.TOUCH_CANCEL,()=>{
|
|
|
- if(this.onClickItem) { return }
|
|
|
this.x_len = 0
|
|
|
this.touchContentScroll()
|
|
|
- this.content.position = new Vec3(-19,this.content.position.y)
|
|
|
+ this.content.position = new Vec3(this.content_original_pos.x,this.content.position.y)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
touchContentScroll() {
|
|
|
this.onTouchActive = true
|
|
|
+ if(this.content.position.x==this.content_original_pos.x) {
|
|
|
+ return
|
|
|
+ }
|
|
|
if(this.content.position.x < 0) { // 向左滑动
|
|
|
this.onNextPage()
|
|
|
}
|
|
@@ -233,9 +235,7 @@ export class game_list extends Component {
|
|
|
let call = ()=>{
|
|
|
let url = http.get_level_info(item.getData().id)
|
|
|
gameManager.Singleton.showLoadingLevel()
|
|
|
- this.onClickItem = true
|
|
|
http.run_get_static(url,(err,data)=>{
|
|
|
- this.onClickItem = false
|
|
|
if(!err){
|
|
|
let _data:LevelInfoMessage = JSON.parse(data)
|
|
|
if(_data.code===config.MSG_CODE.SUCCESS){
|