mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 10:16:14 +00:00
提交
This commit is contained in:
File diff suppressed because it is too large
Load Diff
9
JisolGameCocos/assets/resources/prefab/ui/模式/OnHook.meta
Normal file
9
JisolGameCocos/assets/resources/prefab/ui/模式/OnHook.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "9cba9069-da44-48a9-aba5-3c29cb53c065",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
1976
JisolGameCocos/assets/resources/prefab/ui/模式/OnHook/OnHook排行榜.prefab
Normal file
1976
JisolGameCocos/assets/resources/prefab/ui/模式/OnHook/OnHook排行榜.prefab
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"ver": "1.1.49",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "96d65d45-9df6-4b13-8253-d740249f2ae4",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "OnHook排行榜"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"ver": "1.1.49",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "293353b4-edba-4914-8182-bead1548dc57",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "OnHook排行榜节点"
|
||||
}
|
||||
}
|
@@ -2720,6 +2720,9 @@
|
||||
"__id__": 85
|
||||
},
|
||||
"petPreview": null,
|
||||
"tacticalLabel": {
|
||||
"__id__": 99
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
@@ -93,6 +93,14 @@ export interface ResourceOV{
|
||||
version:number; //版本号
|
||||
}
|
||||
|
||||
export interface ModeOnHookRankingOV{
|
||||
playerId:number; //游戏玩家Id
|
||||
playerName:string; //游戏玩家名称
|
||||
levelId:number; //玩家关卡Id
|
||||
rank:number; //玩家当前排名
|
||||
mapId:number; //地图Id
|
||||
}
|
||||
|
||||
export const API = {
|
||||
|
||||
UserRegister : async () => RData(await app.api.post(`/user/register`)) as UserVO, //玩家注册
|
||||
@@ -118,5 +126,8 @@ export const API = {
|
||||
/********** 资源接口 ******************/
|
||||
GetPlayerResource: async () => RData(await app.api.get(`/game/resource/get`),false) as ResourceOV[], //获取玩家资源
|
||||
|
||||
/********** 排行榜接口(无限模式) *******************/
|
||||
GOnHookRankings: async (mapId:number) => RData(await app.api.get(`/game/mode/onHook/onRankings/${mapId}`),false) as ModeOnHookRankingOV[], //获取玩家资源
|
||||
|
||||
}
|
||||
|
||||
|
@@ -112,11 +112,11 @@ export default class GOnHookManager extends Singleton{
|
||||
|
||||
//生成野怪
|
||||
onSpawnSreeps = NGameUtil.ThrottleASync((async () => {
|
||||
GAPI.GOnHookSpawnCreeps().then(data => {
|
||||
data.pets.forEach(pet => {
|
||||
this._sreeps.set(pet.key,pet as GOnHookPet);
|
||||
})
|
||||
});
|
||||
let data = await GAPI.GOnHookSpawnCreeps();
|
||||
if(!data) return;
|
||||
data.pets.forEach(pet => {
|
||||
this._sreeps.set(pet.key,pet as GOnHookPet);
|
||||
})
|
||||
}).bind(this))
|
||||
|
||||
//获取下一只野怪
|
||||
|
@@ -83,24 +83,26 @@ export class PlayerTacticalItem extends Component {
|
||||
//如果拖拽了则不生效点击事件
|
||||
if(this.drag.isMove) return;
|
||||
|
||||
//如果没有宠物则弹出选择宠物 负责 删除宠物
|
||||
if(this.petId){
|
||||
//移除宠物
|
||||
//提示是否移除宠物
|
||||
app.layer.Open(GUI.SelectionBox,{
|
||||
tigText:"是否移除宠物?",
|
||||
cancel:()=>{},
|
||||
confirm:async ()=>{
|
||||
//移除宠物 (0就是移除)
|
||||
await PlayerTacticalData.getIns().UpdateIndexTactical(this.index,0);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
//选择宠物
|
||||
app.layer.Open(GUI.IntoBattleView,{
|
||||
index:this.index, //当前选择的阵法下标
|
||||
});
|
||||
}
|
||||
// //如果没有宠物则弹出选择宠物 负责 删除宠物
|
||||
// if(this.petId){
|
||||
// //移除宠物
|
||||
// //提示是否移除宠物
|
||||
// app.layer.Open(GUI.SelectionBox,{
|
||||
// tigText:"是否移除宠物?",
|
||||
// cancel:()=>{},
|
||||
// confirm:async ()=>{
|
||||
// //移除宠物 (0就是移除)
|
||||
// await PlayerTacticalData.getIns().UpdateIndexTactical(this.index,0);
|
||||
// }
|
||||
// })
|
||||
// }else{
|
||||
// }
|
||||
|
||||
//选择宠物
|
||||
app.layer.Open(GUI.IntoBattleView,{
|
||||
index:this.index, //当前选择的阵法下标
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//交换阵法
|
||||
|
@@ -95,6 +95,11 @@ export class MainView extends JNGLayerBase {
|
||||
app.layer.Open(GUI.MapSelectView);
|
||||
}
|
||||
|
||||
//点击排行榜
|
||||
onOpenOnHookRinking(){
|
||||
app.layer.Open(GUI.OnHookRinkingView);
|
||||
}
|
||||
|
||||
//点击下一关
|
||||
async onClickNextLevel(){
|
||||
GOnHookManager.getIns().onNextLevel();
|
||||
|
9
JisolGameCocos/assets/script/ui/Mode/OnHook.meta
Normal file
9
JisolGameCocos/assets/script/ui/Mode/OnHook.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "3e290ee9-c2f6-45f0-9d24-52f03fc8de30",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import JNScrollViewItem from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { ModeOnHookRankingOV } from '../../../consts/API';
|
||||
import { Label } from 'cc';
|
||||
import { TD } from '../../../App';
|
||||
import GOnHookData from '../../../data/GOnHookData';
|
||||
import { TbGEntity } from '../../../config/data/schema';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('OnHookRinkingItem')
|
||||
export class OnHookRinkingItem extends JNScrollViewItem<ModeOnHookRankingOV> {
|
||||
|
||||
//排名
|
||||
@property(Label)
|
||||
rinking:Label;
|
||||
|
||||
//玩家名称
|
||||
@property(Label)
|
||||
playerName:Label;
|
||||
|
||||
//关卡名称
|
||||
@property(Label)
|
||||
levelName:Label;
|
||||
|
||||
onInit(myData:ModeOnHookRankingOV){
|
||||
this.data = myData;
|
||||
|
||||
this.rinking.string = `${this.data.rank}`;
|
||||
this.playerName.string = `${this.data.playerName}`;
|
||||
|
||||
let table:{data:TbGEntity.TOnHookLevel} = TD[TD.TbGOnHookMaps.get(this.data.mapId)?.sign].get(this.data.levelId);
|
||||
if(table)
|
||||
this.levelName.string = `难度 : ${table.data.level}-${table.data.childLevel}`;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "1cbc57bf-4f5e-4a96-a054-97af1394b599",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { JNGLayerBase } from '../../../components/JNComponent';
|
||||
import { API } from '../../../consts/API';
|
||||
import { TD } from '../../../App';
|
||||
import JNScrollView from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView';
|
||||
import { OnHookRinkingItem } from './OnHookRinkingItem';
|
||||
import PlayerData from '../../../data/PlayerData';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/**
|
||||
* OnHook 排行榜
|
||||
*/
|
||||
@ccclass('OnHookRinkingView')
|
||||
export class OnHookRinkingView extends JNGLayerBase {
|
||||
|
||||
mapId:number;
|
||||
|
||||
@property(JNScrollView)
|
||||
rankings:JNScrollView;
|
||||
|
||||
@property(OnHookRinkingItem)
|
||||
myItem:OnHookRinkingItem;
|
||||
|
||||
onJNLoad(mapId?: number): void {
|
||||
|
||||
this.mapId = mapId || TD.TbGOnHookMaps.getDataList()[0].id;
|
||||
super.onJNLoad(mapId);
|
||||
|
||||
this.onInit();
|
||||
|
||||
}
|
||||
|
||||
async onInit(){
|
||||
|
||||
let ranks = await API.GOnHookRankings(this.mapId);
|
||||
|
||||
this.rankings.refreshData(ranks.filter(item => item.rank <= 10));
|
||||
let myData = ranks.filter(item => item.playerId == PlayerData.getIns().data.playerId)[0]
|
||||
if(myData)
|
||||
this.myItem.onInit(myData);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "7eb7c0ae-51dd-437d-a37f-80dfcfcfc7d2",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -12,6 +12,7 @@ import { GUI } from '../UIConfig';
|
||||
import PlayerTacticalData from '../../data/PlayerTacticalData';
|
||||
import { PetIconSelectScroll } from '../Consts/Pet/PetIconSelectScroll';
|
||||
import { PetPreviewWindow } from '../Consts/Pet/info/PetPreviewWindow';
|
||||
import { Label } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//上阵页面
|
||||
@@ -25,6 +26,9 @@ export class IntoBattleView extends JNLayerBase {
|
||||
@property(PetPreviewWindow)
|
||||
petPreview:PetPreviewWindow; //宠物显示窗口
|
||||
|
||||
@property(Label)
|
||||
tacticalLabel:Label;//上阵文本
|
||||
|
||||
//宠物数据
|
||||
pets:PlayerPetOV[] = [];
|
||||
|
||||
@@ -51,6 +55,14 @@ export class IntoBattleView extends JNLayerBase {
|
||||
|
||||
//获取所有玩家宠物
|
||||
this.pets = PlayerPetData.getIns().getData();
|
||||
|
||||
//获取当前阵法下标是否存在宠物
|
||||
let petId = PlayerTacticalData.getIns().getItem(this.tIndex);
|
||||
if(petId){
|
||||
//如果存在则默认选中
|
||||
this.index = this.pets.indexOf(PlayerPetData.getIns().petIdQueryPetInfo(petId));
|
||||
}
|
||||
|
||||
this.views.refreshData(this.pets);
|
||||
|
||||
//设置不可选中
|
||||
@@ -83,6 +95,14 @@ export class IntoBattleView extends JNLayerBase {
|
||||
this.petPreview.bind(this.pets[this.index]);
|
||||
}
|
||||
|
||||
this.onUpdateTactical();
|
||||
}
|
||||
|
||||
//刷新上阵
|
||||
onUpdateTactical(){
|
||||
//获取当前阵法下标是否存在宠物
|
||||
let petId = PlayerTacticalData.getIns().getItem(this.tIndex);
|
||||
this.tacticalLabel.string = `${petId ? "下阵" : "上阵"}`
|
||||
}
|
||||
|
||||
//点击Item
|
||||
@@ -102,13 +122,21 @@ export class IntoBattleView extends JNLayerBase {
|
||||
app.layer.Open(GUI.Tips,{text:"请选择要上阵的宠物."})
|
||||
return;
|
||||
}
|
||||
if(this.views.getItems<PetIconSelectScroll>()[this.index].select.isNoSelect) {
|
||||
app.layer.Open(GUI.Tips,{text:"当前宠物已上阵"})
|
||||
//获取当前阵法下标是否存在宠物
|
||||
let petId = PlayerTacticalData.getIns().getItem(this.tIndex);
|
||||
|
||||
if(petId) {
|
||||
//下阵
|
||||
await PlayerTacticalData.getIns().UpdateIndexTactical(this.tIndex,0);
|
||||
app.layer.Open(GUI.Tips,{text:"下阵成功"});
|
||||
//上阵完 关闭页面
|
||||
app.layer.CloseNode(this.node);
|
||||
return;
|
||||
}
|
||||
|
||||
//修改上阵信息
|
||||
await PlayerTacticalData.getIns().UpdateIndexTactical(this.tIndex,this.pets[this.index].petId);
|
||||
app.layer.Open(GUI.Tips,{text:"上阵成功"});
|
||||
|
||||
//上阵完 关闭页面
|
||||
app.layer.CloseNode(this.node);
|
||||
|
@@ -28,6 +28,7 @@ export enum GUI{
|
||||
/**游戏模式页面 */
|
||||
PVPModeMatchView = "PVPModeMatchView", //PVP模式匹配页面
|
||||
CampGuardianView = "CampGuardianView", //阵营守护战斗页面
|
||||
OnHookRinkingView = "OnHookRinkingView", //OnHook 排行榜页面
|
||||
|
||||
Home = "Home", //主页面
|
||||
Main = "Main", //主页面2
|
||||
@@ -137,6 +138,11 @@ const UIGModeConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
uri: "prefab/ui/模式/CampGuardian/阵营守护战斗页面",
|
||||
anims:BackOutScale
|
||||
},
|
||||
[GUI.OnHookRinkingView]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/模式/OnHook/OnHook排行榜",
|
||||
anims:BackOutScale
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
Submodule JisolGameCocos/extensions/ngame updated: 10cb5e3839...f147b04ddd
Reference in New Issue
Block a user