mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交开宝箱
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "3f2e01bd-60eb-4e48-a26c-06b4a91283e6",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { GAttribute } from '../../../../consts/entity/EntityData';
|
||||
import JNScrollViewItem from '../../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { Label } from 'cc';
|
||||
import { TD } from '../../../../App';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PetEquipAttributeItem')
|
||||
export class PetEquipAttributeItem extends JNScrollViewItem<GAttribute> {
|
||||
|
||||
//名称
|
||||
@property(Label)
|
||||
attributeName:Label;
|
||||
|
||||
//值
|
||||
@property(Label)
|
||||
attributeValue:Label;
|
||||
|
||||
onInit(){
|
||||
|
||||
this.attributeName.string = TD.TbGAttribute.get(this.data.id).name+":";
|
||||
this.attributeValue.string = `${this.data.value}`;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "8ce0b443-3cd1-4546-8143-b6f7c2b745f4",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { PetEquip } from '../../../../consts/API';
|
||||
import JNScrollView from '../../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PetEquipAttributeView')
|
||||
export class PetEquipAttributeView extends Component {
|
||||
|
||||
//基础属性
|
||||
@property(JNScrollView)
|
||||
baseView:JNScrollView;
|
||||
|
||||
//高级属性
|
||||
@property(JNScrollView)
|
||||
highView:JNScrollView;
|
||||
|
||||
info:PetEquip;
|
||||
|
||||
set(info:PetEquip){
|
||||
this.info = info;
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
onUpdateView(){
|
||||
|
||||
this.baseView.refreshData(this.info.equipBaseAttributes);
|
||||
this.highView.refreshData(this.info.equipHighAttributes);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c8ab3e3c-fa86-45d0-876d-efdf461d9347",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -10,6 +10,8 @@ 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';
|
||||
import { Button } from 'cc';
|
||||
import { EventTouch } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -102,6 +104,20 @@ export class MainForgingBench extends JComponent {
|
||||
await PetEquipData.getIns().upForgingBench();
|
||||
}
|
||||
|
||||
//打开指定装备
|
||||
onClickEquip(event: EventTouch){
|
||||
|
||||
let equip = PetEquipData.getIns().getPetEquip(event.target.getSiblingIndex() + 1);
|
||||
|
||||
if(!equip){
|
||||
app.layer.Open(GUI.Tips,{text:"快锻造装备吧~"});
|
||||
return;
|
||||
}
|
||||
|
||||
app.layer.Open(GUI.PetEquipForgingPopupView,equip)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
9
JisolGameCocos/assets/script/ui/Home/Item.meta
Normal file
9
JisolGameCocos/assets/script/ui/Home/Item.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "4c58e5a6-9a16-484d-b204-7423597c851b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
49
JisolGameCocos/assets/script/ui/Home/Item/MainPlayerInfo.ts
Normal file
49
JisolGameCocos/assets/script/ui/Home/Item/MainPlayerInfo.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Label } from 'cc';
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import PlayerData from '../../../data/PlayerData';
|
||||
import GBattleData, { GBattleDataEnum } from '../../../data/GBattleData';
|
||||
import { app } from '../../../App';
|
||||
import { tween } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MainPlayerInfo')
|
||||
export class MainPlayerInfo extends Component {
|
||||
|
||||
//玩家名称
|
||||
@property(Label)
|
||||
playerNameLabel:Label;
|
||||
|
||||
//玩家战力
|
||||
@property(Label)
|
||||
playerFC:Label;
|
||||
|
||||
_FC:number = 0;
|
||||
get FC(){
|
||||
return this._FC
|
||||
}
|
||||
set FC(value:number){
|
||||
this._FC = value;
|
||||
this.playerFC.string = `${Math.floor(value)}`;
|
||||
}
|
||||
|
||||
protected onLoad(): void {
|
||||
this.onUpdateView();
|
||||
app.event.on(GBattleDataEnum.UPDARE_ATTRIBUTE_SUCCESS,this.onUpdateView,this);
|
||||
}
|
||||
|
||||
protected onDestroy(): void {
|
||||
app.event.off(GBattleDataEnum.UPDARE_ATTRIBUTE_SUCCESS,this.onUpdateView,this);
|
||||
}
|
||||
|
||||
onUpdateView() {
|
||||
this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerName}`;
|
||||
|
||||
//过度
|
||||
tween(this.getComponent(MainPlayerInfo))
|
||||
.to(.5,{FC:GBattleData.getIns().data.getAllFC()})
|
||||
.start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "fea8eb51-1d9e-4683-a678-05e498a071a8",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -16,9 +16,6 @@ const { ccclass, property } = _decorator;
|
||||
@ccclass('MainView')
|
||||
export class MainView extends JNGLayerBase {
|
||||
|
||||
@property(Label)
|
||||
playerNameLabel:Label; //玩家名称
|
||||
|
||||
@property(Label)
|
||||
onHookLabel:Label; //挂机文本
|
||||
|
||||
@@ -60,7 +57,6 @@ export class MainView extends JNGLayerBase {
|
||||
|
||||
//更新UI界面
|
||||
onUpdateView(){
|
||||
this.playerNameLabel.string = `${PlayerData.getIns().getInfo().playerName}`;
|
||||
this.onUpdateOnHookInfo();
|
||||
this.onUpdateOnHook();
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ import { app, TD } from '../../App';
|
||||
import { TablePetEquipIcon } from '../Consts/PetEquip/table/TablePetEquipIcon';
|
||||
import PetEquipData from '../../data/PetEquipData';
|
||||
import { PetEquipIcon } from '../Consts/PetEquip/icon/PetEquipIcon';
|
||||
import { PetEquipAttributeView } from '../Consts/PetEquip/PetEquipAttributeView/PetEquipAttributeView';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//弹出锻造装备页面
|
||||
@@ -20,6 +21,10 @@ export class PetEquipForgingPopupView extends JNLayerBase {
|
||||
@property(PetEquipIcon)
|
||||
icon:PetEquipIcon;
|
||||
|
||||
//装备属性展示
|
||||
@property(PetEquipAttributeView)
|
||||
attribute:PetEquipAttributeView;
|
||||
|
||||
info:PetEquip;
|
||||
|
||||
onJNLoad(info:PetEquip){
|
||||
@@ -31,8 +36,10 @@ export class PetEquipForgingPopupView extends JNLayerBase {
|
||||
|
||||
}
|
||||
|
||||
//刷新页面
|
||||
onUpdateView(){
|
||||
this.icon.set(this.info);
|
||||
this.attribute.set(this.info);
|
||||
}
|
||||
|
||||
//点击穿戴装备
|
||||
|
@@ -2,6 +2,10 @@ 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 PetEquipData from '../../data/PetEquipData';
|
||||
import { NodeEventType } from 'cc';
|
||||
import { app } from '../../App';
|
||||
import { GUI } from '../UIConfig';
|
||||
import { PetEquip } from '../../consts/API';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PetEquipView')
|
||||
@@ -13,6 +17,9 @@ export class PetEquipView extends JNLayerBase {
|
||||
|
||||
onJNLoad(data?: any): void {
|
||||
super.onJNLoad(data);
|
||||
|
||||
//添加子节点事件
|
||||
this.list.addItemEvent(NodeEventType.TOUCH_END,this.onClickItem.bind(this));
|
||||
}
|
||||
|
||||
onJNLoadAnimEnd(): void {
|
||||
@@ -21,6 +28,12 @@ export class PetEquipView extends JNLayerBase {
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
onClickItem(index:number){
|
||||
|
||||
app.layer.Open(GUI.PetEquipForgingPopupView,this.list.getData<PetEquip>()[index])
|
||||
|
||||
}
|
||||
|
||||
onUpdateView(){
|
||||
|
||||
this.list.refreshData(PetEquipData.getIns().equips);
|
||||
|
@@ -56,7 +56,12 @@ const UISystemConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
[GUI.Tips]:{
|
||||
layer:GLayer.Tips,
|
||||
uri: "prefab/ui/系统页面/提示/TipsView",
|
||||
anims:BackOutScale
|
||||
anims:{
|
||||
front:JNLayerAnim.Enlarge,
|
||||
back:JNLayerAnim.Smaller,
|
||||
frontInfo:{key:"position",start:v3(720,0,0),end:v3(0,0,0)},
|
||||
backInfo:{key:"position",start:v3(0,0,0),end:v3(720,0,0)}
|
||||
}
|
||||
},
|
||||
[GUI.Debugger]:{
|
||||
layer:GLayer.Popup,
|
||||
|
Reference in New Issue
Block a user