mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
我也不知道在做什么 反正做的东西不少....
This commit is contained in:
40
JisolGameCocos/assets/script/ui/Map/MapSelectShowItem.ts
Normal file
40
JisolGameCocos/assets/script/ui/Map/MapSelectShowItem.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import JNScrollViewItem from '../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { TB } from '../../../resources/config/data/schema';
|
||||
import { Label } from 'cc';
|
||||
import { Sprite } from 'cc';
|
||||
import TbResource from '../../tools/TbResource';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MapSelectShowItem')
|
||||
export class MapSelectShowItem extends JNScrollViewItem<TB.TbGOnHookMaps> {
|
||||
|
||||
@property({type:Sprite,displayName:"地图预览图"})
|
||||
mapImage:Sprite;
|
||||
|
||||
@property({type:Label,displayName:"地图名称"})
|
||||
mapName:Label;
|
||||
|
||||
@property({type:Label,displayName:"地图介绍"})
|
||||
mapText:Label;
|
||||
|
||||
onInit(data: TB.TbGOnHookMaps): void {
|
||||
|
||||
this.onUpdateView();
|
||||
|
||||
}
|
||||
|
||||
//刷新页面
|
||||
onUpdateView(){
|
||||
|
||||
this.mapName.string = this.data.name;
|
||||
this.mapText.string = this.data.introduce;
|
||||
|
||||
//加载预览图
|
||||
TbResource.loadSpriteFrame(this.data.mapImage,this.mapImage,this);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "e30501ff-fe51-4db6-9fc9-aaf7df8f6ba0",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
23
JisolGameCocos/assets/script/ui/Map/MapSelectView.ts
Normal file
23
JisolGameCocos/assets/script/ui/Map/MapSelectView.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import JNLayerBase from '../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase';
|
||||
import JNScrollView from '../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView';
|
||||
import { TD } from '../../App';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MapSelectView')
|
||||
export class MapSelectView extends JNLayerBase {
|
||||
|
||||
//地图列表
|
||||
@property(JNScrollView)
|
||||
views:JNScrollView;
|
||||
|
||||
onJNLoad(data?: any): void {
|
||||
super.onJNLoad(data);
|
||||
|
||||
this.views.refreshData(TD.TbGOnHookMaps.getDataList())
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "dcbf1c81-3947-4aae-9a11-bd14764750a0",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user