mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -6,6 +6,7 @@ import { v3 } from 'cc';
|
||||
import { PlayerPetOV } from '../../../consts/API';
|
||||
import { Label } from 'cc';
|
||||
import { PlayerPetEvent } from '../../../data/PlayerPetData';
|
||||
import PetEquipData from '../../../data/PetEquipData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PetIcon')
|
||||
@@ -17,6 +18,10 @@ export class PetIcon extends Component {
|
||||
@property(Node)
|
||||
starNode:Node; //星星
|
||||
|
||||
@property(Label)
|
||||
levelLabel:Label; //等级
|
||||
|
||||
|
||||
info:PlayerPetOV;
|
||||
|
||||
onLoad(){
|
||||
@@ -53,6 +58,9 @@ export class PetIcon extends Component {
|
||||
this.starNode.active = true;
|
||||
this.starNode.getComponentInChildren(Label).string = `${this.info.petStar}`;
|
||||
}
|
||||
|
||||
//设置宠物等级
|
||||
this.levelLabel.string = `Lv ${PetEquipData.getIns().getForgingBenchPetLevel(this.info.petId)}`
|
||||
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@ import { PetEquip } from '../../../../consts/API';
|
||||
import { Sprite } from 'cc';
|
||||
import TbResource, { IconTypeEnum } from '../../../../tools/TbResource';
|
||||
import { TD } from '../../../../App';
|
||||
import { Label } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PetEquipIcon')
|
||||
@@ -15,6 +16,9 @@ export class PetEquipIcon extends Component {
|
||||
@property(Node)
|
||||
notEquip:Node;
|
||||
|
||||
@property(Label)
|
||||
levelLabel:Label; //等级
|
||||
|
||||
info:PetEquip;
|
||||
|
||||
onLoad(){
|
||||
@@ -24,6 +28,7 @@ export class PetEquipIcon extends Component {
|
||||
//刷新页面
|
||||
onUpdateView(){
|
||||
|
||||
this.levelLabel.node.active = false;
|
||||
this.notEquip.active = true;
|
||||
if(!this.info) return;
|
||||
|
||||
@@ -32,6 +37,9 @@ export class PetEquipIcon extends Component {
|
||||
let config = TD.TbGRoleEquip.get(this.info.equipCfgId);
|
||||
TbResource.loadSpriteIcon(IconTypeEnum.宠物装备,config.icon,this.sprite,this);
|
||||
TbResource.loadSpriteIcon(IconTypeEnum.品质,config.quality,this.quality,this);
|
||||
|
||||
this.levelLabel.node.active = true;
|
||||
this.levelLabel.string = `Lv ${this.info.equipLevel}`;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -6,12 +6,21 @@ import { API, PlayerPetOV } from '../../../consts/API';
|
||||
import { PetIconSelectShow } from '../../Consts/Pet/PetIconSelectShow';
|
||||
import PlayerPetData from '../../../data/PlayerPetData';
|
||||
import { PetEquipIcon } from '../../Consts/PetEquip/icon/PetEquipIcon';
|
||||
import { Label } from 'cc';
|
||||
import TimeUtil from '../../../../../extensions/ngame/assets/ngame/util/TimeUtil';
|
||||
import { ResourceType } from '../../../data/ResourceData';
|
||||
import JComponent from '../../../../../extensions/ngame/assets/ngame/util/components/JComponent';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
//锻造台
|
||||
@ccclass('MainForgingBench')
|
||||
export class MainForgingBench extends Component {
|
||||
export class MainForgingBench extends JComponent {
|
||||
|
||||
|
||||
//锻造等级显示
|
||||
@property(Label)
|
||||
forgingLevel:Label;
|
||||
|
||||
//锻造宠
|
||||
@property(PetIconSelectShow)
|
||||
@@ -37,6 +46,14 @@ export class MainForgingBench extends Component {
|
||||
app.event.off(PetEquipDataEnum.UPDATE_EQUIP,this.onUpdateEquip,this);
|
||||
}
|
||||
|
||||
updates(){
|
||||
if(PetEquipData.getIns().forgingUpTimeExcess){
|
||||
this.forgingLevel.string = `(锻造等级: ${PetEquipData.getIns().info.currentForgingQuality} ) ${TimeUtil.remainderString(PetEquipData.getIns().forgingBenchUpEnd)}`;
|
||||
}else{
|
||||
this.forgingLevel.string = `(锻造等级: ${PetEquipData.getIns().info.currentForgingQuality} )`;
|
||||
}
|
||||
}
|
||||
|
||||
onUpdateView(){
|
||||
this.onUpdateForging();
|
||||
this.onUpdateEquip();
|
||||
@@ -77,6 +94,14 @@ export class MainForgingBench extends Component {
|
||||
|
||||
}
|
||||
|
||||
//点击升级锻造台
|
||||
async onClickUpForgingBench(){
|
||||
if(PetEquipData.getIns().forgingUpTimeExcess)
|
||||
await PetEquipData.getIns().useSpeedUpForgingBench(ResourceType.SpeedUp);
|
||||
else
|
||||
await PetEquipData.getIns().upForgingBench();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -3,23 +3,18 @@ import JNScrollViewItem from '../../../../../extensions/ngame/assets/ngame/util/
|
||||
import { GOnHookPet } from '../../../../../extensions/ngame/assets/ngame/message/proto';
|
||||
import { PetIcon } from '../../Consts/Pet/PetIcon';
|
||||
import { PetIconSelect } from '../../Consts/Pet/PetIconSelect';
|
||||
import { TablePetIconSelect } from '../../Consts/Pet/table/TablePetIconSelect';
|
||||
import { TD } from '../../../App';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MainSreepsIcon')
|
||||
export class MainSreepsIcon extends JNScrollViewItem<GOnHookPet> {
|
||||
|
||||
@property(PetIconSelect)
|
||||
icon:PetIconSelect;
|
||||
@property(TablePetIconSelect)
|
||||
icon:TablePetIconSelect;
|
||||
|
||||
start(){
|
||||
this.icon.set({
|
||||
petTbId: this.data.petTbId,
|
||||
petId: 0,
|
||||
petPlayerId: 0,
|
||||
petLevel: 0,
|
||||
petStar: 0,
|
||||
petStarExp: 0
|
||||
});
|
||||
this.icon.set(TD.TbGRole.get(this.data.petTbId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import { TB } from '../../config/data/schema';
|
||||
import { app, TD } from '../../App';
|
||||
import { TablePetEquipIcon } from '../Consts/PetEquip/table/TablePetEquipIcon';
|
||||
import PetEquipData from '../../data/PetEquipData';
|
||||
import { PetEquipIcon } from '../Consts/PetEquip/icon/PetEquipIcon';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//弹出锻造装备页面
|
||||
@@ -16,8 +17,8 @@ const { ccclass, property } = _decorator;
|
||||
export class PetEquipForgingPopupView extends JNLayerBase {
|
||||
|
||||
//装备展示
|
||||
@property(TablePetEquipIcon)
|
||||
icon:TablePetEquipIcon;
|
||||
@property(PetEquipIcon)
|
||||
icon:PetEquipIcon;
|
||||
|
||||
info:PetEquip;
|
||||
|
||||
@@ -31,8 +32,7 @@ export class PetEquipForgingPopupView extends JNLayerBase {
|
||||
}
|
||||
|
||||
onUpdateView(){
|
||||
let config = TD.TbGRoleEquip.get(this.info.equipCfgId);
|
||||
this.icon.set(config);
|
||||
this.icon.set(this.info);
|
||||
}
|
||||
|
||||
//点击穿戴装备
|
||||
|
Reference in New Issue
Block a user