This commit is contained in:
PC-20230316NUNE\Administrator
2024-01-10 19:09:14 +08:00
parent 0d745b9715
commit d0d80bb9ad
34 changed files with 764 additions and 146 deletions

View File

@@ -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();
}
}

View File

@@ -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));
}
}