51 lines
911 B
JavaScript
51 lines
911 B
JavaScript
|
|
|
||
|
|
const ItemBase = require( "cmp.item.base" );
|
||
|
|
const BackPackConst = require( "backpack_const" );
|
||
|
|
const HeroController = require( "hero_controller" );
|
||
|
|
|
||
|
|
cc.Class( {
|
||
|
|
|
||
|
|
extends: ItemBase,
|
||
|
|
|
||
|
|
properties: {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
// 重载:刷新
|
||
|
|
freshAll: function() {
|
||
|
|
|
||
|
|
this._super();
|
||
|
|
|
||
|
|
// 等级刷新
|
||
|
|
this.setLevel( this.info.level );
|
||
|
|
},
|
||
|
|
|
||
|
|
// 重载:数量
|
||
|
|
setCount: function( _count ) {
|
||
|
|
// 不显示数量
|
||
|
|
},
|
||
|
|
|
||
|
|
// 单设:等级
|
||
|
|
setLevel: function( _lev ) {
|
||
|
|
nx.gui.setString( this.nodCount, "", "Lv." + _lev );
|
||
|
|
},
|
||
|
|
|
||
|
|
onFocus(){
|
||
|
|
if( nx.dt.objEmpty( this.info ) ) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
outFocus(){
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
setSelectCall(cb){
|
||
|
|
this.selfClick = true;
|
||
|
|
this.selfClickCall = cb;
|
||
|
|
this.openTouch( this.selfClick, this.selfClickCall.bind( this ) );
|
||
|
|
}
|
||
|
|
|
||
|
|
} );
|