mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -38,7 +38,7 @@ export class ModeRender extends Component {
|
||||
let hitNode = instantiate(this.hitPrefab);
|
||||
|
||||
this.node.addChild(hitNode);
|
||||
hitNode.position = rolePos.add(v3(0,100,0));
|
||||
hitNode.position = rolePos.add(v3(0,40,0));
|
||||
|
||||
hitNode.getComponent(ModeRenderHitText).setText(info.hit);
|
||||
|
||||
|
@@ -17,10 +17,6 @@ export class TablePetIcon extends Component {
|
||||
|
||||
info:TB.TbGRole;
|
||||
|
||||
onLoad(){
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
//刷新页面
|
||||
onUpdateView(){
|
||||
|
||||
|
@@ -16,11 +16,21 @@ export class RewardClaimView extends JNGLayerBase {
|
||||
onJNLoad(data?: TbGEntity.TReward[]): void {
|
||||
super.onJNLoad(data);
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
onJNLoadAnimEnd(): void {
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
onUpdateView(){
|
||||
this.views.refreshData(this.data);
|
||||
|
||||
//逐个出现
|
||||
this.data.forEach((item,index) => {
|
||||
this.scheduleOnce(() => {
|
||||
this.views.addData(item);
|
||||
},.1 * index);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,30 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { RewardIcon } from './RewardIcon';
|
||||
import { TbGEntity } from '../../../config/data/schema';
|
||||
import JNScrollViewItem from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { tween } from 'cc';
|
||||
import { v3 } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('RewardIconScrollScaleAnim')
|
||||
export class RewardIconScrollScaleAnim extends JNScrollViewItem<TbGEntity.TReward> {
|
||||
|
||||
@property(RewardIcon)
|
||||
icon:RewardIcon;
|
||||
|
||||
onLoad(){
|
||||
//播放缩放动画
|
||||
this.node.scale = v3(0,0,0);
|
||||
tween(this.node)
|
||||
.to(.2,{scale:v3(1,1,1)})
|
||||
.start();
|
||||
}
|
||||
|
||||
onInit(data:TbGEntity.TReward){
|
||||
|
||||
this.icon.set(data);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "fccbd792-47da-4c8d-a8f9-6ecb5daaea4e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -128,6 +128,11 @@ export class MainView extends JNGLayerBase {
|
||||
app.layer.Open(GUI.PacksackView);
|
||||
}
|
||||
|
||||
//点击商店页面
|
||||
onClickShop(){
|
||||
app.layer.Open(GUI.ShopView);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
9
JisolGameCocos/assets/script/ui/Shop.meta
Normal file
9
JisolGameCocos/assets/script/ui/Shop.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "f9441538-3d5c-43d4-9bf1-1ede88d23161",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
53
JisolGameCocos/assets/script/ui/Shop/ShopGiftItem.ts
Normal file
53
JisolGameCocos/assets/script/ui/Shop/ShopGiftItem.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { TB, TbGEnum } from '../../config/data/schema';
|
||||
import JNScrollViewItem from '../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { TD } from '../../App';
|
||||
import { Label } from 'cc';
|
||||
import JNScrollView from '../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView';
|
||||
import GiftData from '../../data/GiftData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('ShopGiftItem')
|
||||
export class ShopGiftItem extends JNScrollViewItem<TB.TbGShop> {
|
||||
|
||||
@property(Label)
|
||||
giftName:Label; //礼包名称
|
||||
|
||||
@property(Label)
|
||||
giftLimit:Label; //限购
|
||||
|
||||
@property(JNScrollView)
|
||||
views:JNScrollView; //礼包列表
|
||||
|
||||
gift: TB.TbGGift;
|
||||
|
||||
onInit(data: TB.TbGShop): void {
|
||||
|
||||
this.gift = TD.TbGGift.get(data.giftId);
|
||||
|
||||
}
|
||||
|
||||
protected start(): void {
|
||||
|
||||
this.giftName.string = this.data.tig;
|
||||
|
||||
if(this.gift.limit == TbGEnum.TGiftLimit.Unlimited)
|
||||
this.giftLimit.string = "( 无限 )";
|
||||
if(this.gift.limit == TbGEnum.TGiftLimit.DayLimit)
|
||||
this.giftLimit.string = `每天( ${GiftData.getIns().getGiftDayRecordCount(this.gift.id)}/${this.gift.limitValue} )`;
|
||||
if(this.gift.limit == TbGEnum.TGiftLimit.Limit)
|
||||
this.giftLimit.string = `限制( ${GiftData.getIns().getGiftRecordCount(this.gift.id)}/${this.gift.limitValue} )`;
|
||||
|
||||
this.views.refreshData(this.gift.rewards);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//点击购买礼包
|
||||
async onClickBuy(){
|
||||
await GiftData.getIns().buy(this.gift.id)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "3c689f59-1914-4f82-b32f-9b60142cd8f8",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
43
JisolGameCocos/assets/script/ui/Shop/ShopView.ts
Normal file
43
JisolGameCocos/assets/script/ui/Shop/ShopView.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
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 { app, TD } from '../../App';
|
||||
import GiftData, { GiftDataEnum } from '../../data/GiftData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//商店页面
|
||||
@ccclass('ShopView')
|
||||
export class ShopView extends JNLayerBase {
|
||||
|
||||
//商店礼包列表
|
||||
@property(JNScrollView)
|
||||
views:JNScrollView
|
||||
|
||||
async onJNLoad(data?: any) {
|
||||
|
||||
super.onJNLoad(data);
|
||||
|
||||
await this.onUpdateView();
|
||||
|
||||
//监听
|
||||
app.event.on(GiftDataEnum.BUY,this.onUpdateView,this)
|
||||
|
||||
}
|
||||
|
||||
onJNClose(): void {
|
||||
super.onJNClose();
|
||||
app.event.off(GiftDataEnum.BUY,this.onUpdateView,this)
|
||||
}
|
||||
|
||||
async onUpdateView() {
|
||||
|
||||
await GiftData.getIns().UpdateGiftRecord();
|
||||
await GiftData.getIns().UpdateGiftDayRecord();
|
||||
|
||||
this.views.refreshData(TD.TbGShop.getDataList());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
9
JisolGameCocos/assets/script/ui/Shop/ShopView.ts.meta
Normal file
9
JisolGameCocos/assets/script/ui/Shop/ShopView.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "eb3d9ece-55ba-4a24-8103-75b6ae2c3f4d",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -26,6 +26,7 @@ export enum GUI{
|
||||
MainOnHookView = "MainOnHookView", //挂机弹窗
|
||||
MapSelectView = "MapSelectView", //地图选择页面
|
||||
PacksackView = "PacksackView", //背包页面
|
||||
ShopView = "ShopView", //商店页面
|
||||
|
||||
/** 副本 */
|
||||
DungeonView = "DungeonView", //副本页面
|
||||
@@ -54,6 +55,12 @@ const BackOutScale:JNLayerAnimInfo = {
|
||||
front:JNLayerAnim.BackOutOpen,
|
||||
back:JNLayerAnim.BackInClose
|
||||
}
|
||||
const BackOutMove:JNLayerAnimInfo = {
|
||||
front:JNLayerAnim.Enlarge,
|
||||
back:JNLayerAnim.Smaller,
|
||||
frontInfo:{key:"position",start:v3(1280,0,0),end:v3(0,0,0)},
|
||||
backInfo:{key:"position",start:v3(0,0,0),end:v3(1280,0,0)}
|
||||
}
|
||||
|
||||
|
||||
//系统UI
|
||||
@@ -92,7 +99,7 @@ const UISystemConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
},
|
||||
},
|
||||
[GUI.RewardClaimView]:{
|
||||
layer:GLayer.View,
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/常用预制体/奖励/领取奖励页面",
|
||||
anims:BackOutScale
|
||||
},
|
||||
@@ -103,12 +110,7 @@ const UIMainConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
[GUI.MainChat]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/主页/聊天/MainChatView",
|
||||
anims:{
|
||||
front:JNLayerAnim.Enlarge,
|
||||
back:JNLayerAnim.Smaller,
|
||||
frontInfo:{key:"position",start:v3(0,-1280,0),end:v3(0,0,0)},
|
||||
backInfo:{key:"position",start:v3(0,0,0),end:v3(0,-1280,0)}
|
||||
}
|
||||
anims:BackOutMove
|
||||
},
|
||||
[GUI.IntoBattleView]:{
|
||||
layer:GLayer.Popup,
|
||||
@@ -130,6 +132,11 @@ const UIMainConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
uri: "prefab/ui/资源/资源背包页面",
|
||||
anims:BackOutScale,
|
||||
},
|
||||
[GUI.ShopView]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/商店/商店页面",
|
||||
anims:BackOutMove,
|
||||
},
|
||||
}
|
||||
|
||||
//宠物页面
|
||||
@@ -198,7 +205,12 @@ const UIGModeConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
[GUI.OnHookRinkingView]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/模式/OnHook/OnHook排行榜",
|
||||
anims:BackOutScale
|
||||
anims:{
|
||||
front:JNLayerAnim.Enlarge,
|
||||
back:JNLayerAnim.Smaller,
|
||||
frontInfo:{key:"position",start:v3(1280,0,0),end:v3(0,0,0)},
|
||||
backInfo:{key:"position",start:v3(0,0,0),end:v3(1280,0,0)}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user