mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import GOnHookData from '../../../data/GOnHookData';
|
||||
import { TD } from '../../../App';
|
||||
import GOnHookData, { GOnHookDataEnum } from '../../../data/GOnHookData';
|
||||
import { app, TD } from '../../../App';
|
||||
import { Label } from 'cc';
|
||||
import { TbGEntity } from '../../../config/data/schema';
|
||||
const { ccclass, property } = _decorator;
|
||||
@@ -9,9 +9,20 @@ const { ccclass, property } = _decorator;
|
||||
export class GameDifficultyTitle extends Component {
|
||||
|
||||
@property(Label)
|
||||
title:Label;
|
||||
title:Label; //标题
|
||||
@property(Node)
|
||||
progress:Node; //进度
|
||||
|
||||
protected update(dt: number): void {
|
||||
onLoad(){
|
||||
app.event.on(GOnHookDataEnum.UPDATE,this.onUpdateView,this);
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
app.event.off(GOnHookDataEnum.UPDATE,this.onUpdateView,this);
|
||||
}
|
||||
|
||||
onUpdateView(): void {
|
||||
|
||||
let info = GOnHookData.getIns().info;
|
||||
let sign = null;
|
||||
@@ -25,6 +36,12 @@ export class GameDifficultyTitle extends Component {
|
||||
|
||||
//显示难度
|
||||
this.title.string = `难度 : ${table.data.level}-${table.data.childLevel}`;
|
||||
//显示进度
|
||||
this.progress.children.forEach((item,index) => {
|
||||
if(index < GOnHookData.getIns().getProgress())
|
||||
item.active = true;
|
||||
else item.active = false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
@@ -2,7 +2,7 @@ import { Label } from 'cc';
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import ResourceData, { ResourceEvent, ResourceType } from '../../../data/ResourceData';
|
||||
import { Enum } from 'cc';
|
||||
import { app } from '../../../App';
|
||||
import { app, TD } from '../../../App';
|
||||
import NumberTools from '../../../tools/NumberTools';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -14,6 +14,10 @@ export class PlayerResourceShow extends Component {
|
||||
@property({type:Enum(ResourceType)})
|
||||
type:ResourceType = ResourceType.Gold;
|
||||
|
||||
//显示名称
|
||||
@property(Label)
|
||||
tig:Label;
|
||||
|
||||
//显示文本
|
||||
@property(Label)
|
||||
show:Label;
|
||||
@@ -34,6 +38,8 @@ export class PlayerResourceShow extends Component {
|
||||
//刷新
|
||||
onUpdateView(){
|
||||
|
||||
//更新名称
|
||||
this.tig && (this.tig.string = `${TD.TbGResource.get(this.type).name}:`);
|
||||
//更新资源数量
|
||||
this.show.string = `${NumberTools.NumberStr(ResourceData.getIns().getValue(this.type))}`;
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { ResourceIcon } from '../ResourceIcon';
|
||||
import ResourceData from '../../../../data/ResourceData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PlayerResourceIcon')
|
||||
@@ -10,7 +11,7 @@ export class PlayerResourceIcon extends Component {
|
||||
|
||||
//设置 ( 资源Id )
|
||||
set(id:number){
|
||||
|
||||
this.icon.set(id,ResourceData.getIns().getValue(id))
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,20 @@
|
||||
import { _decorator } from 'cc';
|
||||
import JNScrollViewItem from '../../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { PlayerResourceIcon } from './PlayerResourceIcon';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PlayerResourceIconScroll')
|
||||
export class PlayerResourceIconScroll extends JNScrollViewItem<number> {
|
||||
|
||||
@property(PlayerResourceIcon)
|
||||
icon:PlayerResourceIcon;
|
||||
|
||||
onInit(data:number){
|
||||
|
||||
this.icon.set(data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "fd24051f-603b-4413-bdc2-f88ea8cd3a3e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { PlayerResourceIcon } from './PlayerResourceIcon';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PlayerResourceIconSelect')
|
||||
export class PlayerResourceIconSelect extends Component {
|
||||
|
||||
@property(PlayerResourceIcon)
|
||||
icon:PlayerResourceIcon;
|
||||
|
||||
//选中节点
|
||||
@property(Node)
|
||||
select:Node;
|
||||
|
||||
//不可选中节点
|
||||
@property(Node)
|
||||
noselect:Node;
|
||||
|
||||
//是否被选中
|
||||
_isSelect:boolean = false;
|
||||
get isSelect(){
|
||||
return this._isSelect;
|
||||
}
|
||||
set isSelect(data:boolean){
|
||||
this._isSelect = data;
|
||||
this.onUpdateSelect();
|
||||
}
|
||||
|
||||
//是否不可选中
|
||||
_isNoSelect:boolean = false;
|
||||
get isNoSelect(){
|
||||
return this._isNoSelect;
|
||||
}
|
||||
set isNoSelect(data:boolean){
|
||||
this._isNoSelect = data;
|
||||
this.onUpdateSelect();
|
||||
}
|
||||
|
||||
onLoad(){
|
||||
this.onUpdateSelect();
|
||||
this.noselect.active = false;
|
||||
this.select.active = false;
|
||||
}
|
||||
|
||||
|
||||
//设置
|
||||
set(id:number){
|
||||
|
||||
this.icon.set(id);
|
||||
|
||||
}
|
||||
|
||||
onUpdateSelect(){
|
||||
|
||||
this.select.active = this.isSelect;
|
||||
this.noselect.active = this.isNoSelect;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c1ae1056-03c0-4291-b34e-7f9dcd04e8de",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import JNScrollViewItem from '../../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { PlayerResourceIconSelect } from './PlayerResourceIconSelect';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PlayerResourceIconSelectScroll')
|
||||
export class PlayerResourceIconSelectScroll extends JNScrollViewItem<number> {
|
||||
|
||||
@property(PlayerResourceIconSelect)
|
||||
icon:PlayerResourceIconSelect;
|
||||
|
||||
onInit(data:number){
|
||||
|
||||
this.icon.set(data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "6ac191b2-7f6a-4990-80de-7111564e8c4f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -5,6 +5,8 @@ import { Label } from 'cc';
|
||||
import GBattleModeManager, { BattleMode } from '../../battle/GBattleModeManager';
|
||||
import { app, TD } from '../../App';
|
||||
import { GUI } from '../UIConfig';
|
||||
import { PlayerResourceShow } from '../Consts/Resource/PlayerResourceShow';
|
||||
import ResourceData from '../../data/ResourceData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('DungeonShowItem')
|
||||
@@ -14,8 +16,14 @@ export class DungeonShowItem extends JNScrollViewItem<TB.TbGSysDungeon> {
|
||||
@property(Label)
|
||||
title:Label;
|
||||
|
||||
//资源
|
||||
@property(PlayerResourceShow)
|
||||
resource:PlayerResourceShow;
|
||||
|
||||
onInit(){
|
||||
|
||||
this.resource.type = this.data.consume.id;
|
||||
this.resource.onUpdateView();
|
||||
this.onUpdateView();
|
||||
|
||||
}
|
||||
@@ -29,8 +37,17 @@ export class DungeonShowItem extends JNScrollViewItem<TB.TbGSysDungeon> {
|
||||
//点击副本
|
||||
onClickDungeon(){
|
||||
|
||||
GBattleModeManager.getIns().Open(BattleMode[`${this.data.type}`],true,TD[`${this.data.tigs}`].getDataList()[0].data);
|
||||
app.layer.Close(GUI.DungeonView);
|
||||
if(ResourceData.getIns().getValue(this.data.consume.id) >= this.data.consume.value){
|
||||
//打开副本
|
||||
GBattleModeManager.getIns().Open(BattleMode[`${this.data.type}`],true,{
|
||||
dungeonId:this.data.id,
|
||||
dungeonItemId:TD[`${this.data.tigs}`].getDataList()[0].id,
|
||||
data:TD[`${this.data.tigs}`].getDataList()[0].data
|
||||
});
|
||||
app.layer.Close(GUI.DungeonView);
|
||||
}else{
|
||||
app.layer.Open(GUI.Tips,{text:"没有钥匙了.."});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -83,6 +83,8 @@ export class MainView extends JNGLayerBase {
|
||||
|
||||
//点击挂机按钮
|
||||
onOpenOnHookView(){
|
||||
//取消挂机
|
||||
GOnHookManager.getIns().isOnHook = false;
|
||||
app.layer.Open(GUI.MainOnHookView);
|
||||
}
|
||||
|
||||
@@ -121,6 +123,11 @@ export class MainView extends JNGLayerBase {
|
||||
app.layer.Open(GUI.DungeonView);
|
||||
}
|
||||
|
||||
//点击打开背包
|
||||
onClickPacksack(){
|
||||
app.layer.Open(GUI.PacksackView);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -8,6 +8,7 @@ import { TablePetIconSelectScroll } from '../../Consts/Pet/table/TablePetIconSel
|
||||
import { Label } from 'cc';
|
||||
import GOnHookManager from '../../../manager/battle/mode/GOnHookManager';
|
||||
import { GUI } from '../../UIConfig';
|
||||
import { Toggle } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MainOnHookView')
|
||||
@@ -20,6 +21,10 @@ export class MainOnHookView extends JNGLayerBase {
|
||||
//挂机按钮
|
||||
@property(Label)
|
||||
onHookLabel:Label;
|
||||
|
||||
//是否自动下一关
|
||||
@property(Toggle)
|
||||
toggle:Toggle;
|
||||
|
||||
onJNLoad(){
|
||||
|
||||
@@ -55,6 +60,7 @@ export class MainOnHookView extends JNGLayerBase {
|
||||
onClickOnHook(){
|
||||
GOnHookManager.getIns().onHookCatchPets = this.views.getItems<TablePetIconSelectScroll>().filter(item => item.select.isSelect).map(item => item.data)
|
||||
GOnHookManager.getIns().isOnHook = !GOnHookManager.getIns().isOnHook;
|
||||
GOnHookManager.getIns().isAutoNext = this.toggle.isChecked;
|
||||
app.layer.Open(GUI.Tips,{text:`${(GOnHookManager.getIns().isOnHook) ? "挂机" : "取消挂机"} 设置成功`})
|
||||
this.close();
|
||||
}
|
||||
|
@@ -1,17 +1,26 @@
|
||||
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 ResourceData from '../../data/ResourceData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//背包页面
|
||||
@ccclass('PacksackView')
|
||||
export class PacksackView extends JNLayerBase {
|
||||
|
||||
//背包
|
||||
@property(JNScrollView)
|
||||
views:JNScrollView;
|
||||
|
||||
onJNLoad(data?: any): void {
|
||||
super.onJNLoad(data)
|
||||
super.onJNLoad(data);
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
//更新页面
|
||||
onUpdateView(){
|
||||
|
||||
this.views.refreshData(ResourceData.getIns().getIds());
|
||||
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@ export enum GUI{
|
||||
IntoBattleView = "IntoBattleView", //上阵页面
|
||||
MainOnHookView = "MainOnHookView", //挂机弹窗
|
||||
MapSelectView = "MapSelectView", //地图选择页面
|
||||
PacksackView = "PacksackView", //背包页面
|
||||
|
||||
/** 副本 */
|
||||
DungeonView = "DungeonView", //副本页面
|
||||
@@ -118,6 +119,11 @@ const UIMainConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
uri: "prefab/ui/地图/地图选择页面",
|
||||
anims:BackOutScale,
|
||||
},
|
||||
[GUI.PacksackView]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/资源/资源背包页面",
|
||||
anims:BackOutScale,
|
||||
},
|
||||
}
|
||||
|
||||
//宠物页面
|
||||
|
Reference in New Issue
Block a user