You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdLike2048/assets/script/game/ConfigRes.ts

701 lines
36 KiB

3 weeks ago
import { AudioClip, Prefab, SpriteFrame } from "cc";
import { IUIConfig, UILayer } from "../../mx/module/ui/UIManager";
import { POP_ANIM, popAnimOnce, popReveal } from "../../mx/module/ui/popAnim";
import { ResPakage } from 'db://assets/mx/module/res/ResourcesManager';
import { ResPkgName } from 'db://assets/mx/module/res/ResPkgName';
import { ChapterNewPlayTypeEnum } from "./ChapterPlayTypes";
/** Asset Bundle 名称(与 Cocos 分包 `bundleName` 一致) */
export enum GBundle {
// 首包 / 常驻
/** 首包(不可删除,不要修改) */
First = "first",
/** 公共资源,进游戏加载且不卸载 */
Comm = "comm",
/** 道具/技能图标(全量,按需/静默预载) */
Items = "icons",
/** 游戏音效 */
Audio = "audio",
// 主界面 Tab
/** 首页 */
Home = "home",
/** 商店 */
Shop = "shop",
/** 角色 */
Role = "role",
/** 武器 */
Weapon = "weapon",
/** 神将武器 */
Shenjiang = "shenjiang",
/** 副本 */
Replica = "replica",
/** 排行榜 */
Rank = "rank",
// 合并弹窗(子目录按功能模块划分)
/** 通用弹窗 */
PopCommon = "popCommon",
/** 局内弹窗 */
PopBattle = "popBattle",
// 战斗
/** 战斗 UI 与局内 prefab */
BattleGame = "battleGame",
/** 战斗地图 */
BattleMap = "battleMap",
/** 怪物模型与血条 */
BattleGameMonster = "battleGameMonster",
/** 新方案英雄攻技预制体(进战斗按上阵英雄筛) */
BattleHero = "battleHero",
/** 机制场景特效 */
MechanismEffect = "mechanismEffect",
// allBuyShops 子包(物理路径 bundles/allBuyShops/*)
/** 月卡 */
PopMonthCard = "giftMonth",
/** 首充礼包 */
FirstRecharge = "firstRecharge",
/** 连续购买 */
ContinuouslyBag = "continuouslyBag",
/** 基金 */
PopFund = "fund",
/** 章节礼包 */
ChapterGiftBg = "chapterGift",
/** 钻石商店 */
DiamondShop = "diamondShop",
/** 英雄字形(prefab/text + heroTemplate),进首页加载,局外常驻 */
Heros = "heros",
/**宝石仓库页面 */
Gemstone = "gemstone",
3 weeks ago
}
/** 多语言资源包:文本 JSON 与 img/spine 同属 `lang_{code}` bundle */
export function getLangBundle(code: string): string {
return `lang_${code}`;
}
/** 语言包内动态资源路径(img/spine 在 bundle 内,由 LangSprite/LangSpine 加载) */
export function langResPath(_bundleName: string, relative: string): string {
return relative.replace(/^\//, '');
}
export class GLangPath {
/** 语言表 JSON:`config/lang_cn` */
static table(code: string): string {
return `config/lang_${code}`;
}
}
/** audio bundle 内资源子目录 */
export class GAudioPath {
static Bgm = 'bgm/';
static SfxUi = 'sfx/ui/';
static SfxVoice = 'sfx/voice/';
static SfxWeapon = 'sfx/weapon/';
}
/**资源路径配置 */
export class GPath {
/**UI预制体 */
static UIPrefab = "prefab/";
/**普通预制体 */
static Prefab = "prefab/";
/**音频默认目录(UI 点击等) */
static Audio = GAudioPath.SfxUi;
/** 合并弹窗包内:功能模块 prefab 目录 */
static popPrefab(module: string) { return `${module}/prefab/`; }
/** 合并弹窗包内:模块相对资源路径(动态加载,资源在 bundle 内) */
static popRes(module: string, relative: string) {
return `${module}/${relative}`;
}
/**texture文件夹资源 */
static texture(name: string | number) { return "texture/" + name; }
/**宣传头像 */
static PublicizeHead(name: string | number) { return "texture/head/" + name; }
/**游戏头像 */
static GameHead(name: string | number) { return "texture/head/" + name; }
/** Headicon 表头像(icons/head/) */
static HeadIcon(name: string | number) { return "head/" + name; }
/** Rank 段位昵称图(icons/level/) */
static RankLevelIcon(name: string | number) { return "level/" + name; }
/**主页图片资源 */
static Home(name: string | number) { return "texture/main/" + name; }
/**主页关卡图 */
static Chapter(name: string | number) { return "texture/chapter/" + name; }
/**道具图标 */
static Item(name: string | number) { return "item/" + name; }
/**道具图标 */
static SkillItem(name: string | number) { return "skillItem/" + name; }
/** 技能特效预制体(prefab/skill/) */
static HeroSkillPrefab() { return "prefab/skill/"; }
/**武器类型图标 */
static WeaponType(name: string | number) { return "texture/武器类型/" + name; }
/**成就图标 */
static Achievement(name: string | number) { return "texture/" + name; }
/**武器底 */
static WeaponBottom(name: string | number) { return "texture/" + name; }
/**武器品质框(资源在 weapon/texture/) */
static WeaponLevelUp(name: string | number) { return "texture/" + name; }
/** 每日商店技能图标(icons/shopSkill/{name}) */
static ShopSkill(name: string | number) { return "shopSkill/" + name; }
/** 战斗界面主动 buff 品质底(battleGame/texture/skillbg1_{quality}) */
static BattleGameSkillBg(quality: number) {
const q = Math.max(1, Math.floor(Number(quality) || 0));
return `texture/skillbg1_${q}`;
}
/** 战斗界面被动 buff 品质底(battleGame/texture/skillbg2_{quality}) */
static BattleGamePassiveSkillBg(quality: number) {
const q = Math.max(1, Math.floor(Number(quality) || 0));
return `texture/skillbg2_${q}`;
}
/** 组合英雄品质框(battleGame/texture/英雄品质_{quality}) */
static BattleHeroQuality(quality: number) {
return `texture/英雄品质_${Math.floor(quality)}`;
}
/** 每日商店飘字标题(icons/shopSkillTitle/{name}) */
static ShopSkillTitle(name: string | number) { return "shopSkillTitle/" + name; }
1 week ago
/**通用金币图标(icons/img/金币) */
static CommPeach() { return "img/金币"; }
/** 五行属性图标(icons/img/金|木|水|火|土) */
static ElementAttr(name: string) { return "img/" + name; }
3 weeks ago
/**障碍物 */
static ObstacleItem(name: string | number) { return "texture/摆放路障/" + name; }
/**障碍物预制体 */
static ObstaclePrefab(name: string | number) { return "prefab/障碍物/" + name; }
/**boss血条 */
static BossHpProgress(name: string | number) { return "texture/BOSS血条/" + name; }
/**结算页面 */
static BattleResult(name: string | number) { return `battleGameResult/texture/胜利失败复活/${name}`; }
//品级
static PingjiKuang(name: string | number) { return "img/" + name; }
/**机制图标 */
static MechIcon(name: string | number) { return "texture/机制图标/" + name; }
/**障碍物图标 */
static ObstacleIcon3(name: string | number) { return "obstacle3/" + name; }
//等级横图标
static LevelUpIconH(name: string | number) { return "img/" + name; }
//等级竖图标
static LevelUpIconV(name: string | number) { return "img/" + name; }
/** 新机制图标(icons/newMechanism/) */
static newMechanism(name: string) { return `newMechanism/${name}`; }
//战斗伤害统计图片
static DamageStatistics(name: string) { return "texture/战斗统计功能/" + name; }
//抽卡模式
static ChoukaMode(name: string) { return "texture/抽卡模式/" + name; }
//选择皮肤(icons 包:assets/bundles/icons/skin/skin_${id}.png)
static SelectSkin(name: string) { return `skin/skin_${name}`; }
/** 皮肤 spine 预制体目录(icons 包内动态加载) */
static SkinDir(skinId: string | number) { return `skin/${skinId}/`; }
//对话图片
static DialogIcon(name: string) { return "texture/" + name; }
//属性
static Attribute(name: string) { return "shuxing/" + name; }
//技能框
static SkillBox(name: string) { return "引导框/imgs/" + name; }
}
/**UI面板配置 */
export enum UIID {
/**等待图标 */
WatiIcon = 100,
/**首页 */
Home = 101,
/**设置 */
Settings = 104,
/**投诉 */
Complain = 105,
/**侧边栏 */
Sidebar = 106,
/**领取奖励弹窗 */
GetReward = 107,
/**消息框 */
Msg = 108,
/**消息确认框 */
MsgBox = 109,
/**主界面 */
MainUI = 111,
/**商店 */
Shop = 200,
/**角色页面 */
Role = 201,
/** 名将库(神将武器) */
Weapon = 203,
/**微信聊天 */
WXChat = 301,
/**选择结果弹窗 */
SelectResultPop = 30101,
/**剧情 */
StoryLine = 401,
/**财经新闻 */
FinanceNews = 402,
/**引导剧情 */
StoryGuide = 404,
/**道具不足跳转弹窗 */
SkipPop = 508,
/**战斗游戏界面 */
BattleGame = 601,
/**武器升级界面 */
WeaponLevelUp = 602,
/**战斗成功 */
BattleSuccess = 605,
/**战斗失败 */
BattleFail = 606,
/**战斗复活 */
BattleRevive = 607,
/**战斗暂停 */
BattlePause = 608,
/**宝箱升级详情 */
boxLevelupDetail = 609,
/**道具详情 */
ItemDetailBox = 610,
/**购买道具框 */
buyItemBox = 611,
/**签到7天 */
sign7Day = 612,
/**道具详情 */
ItemDetailBox2 = 614,
/**等级升级 */
pageUserLevelup = 615,
/**新机制引导遮罩 — 已移除 */
// NewGuideMask = 616,
/**等级升级详情 */
pageUserLevelupDetail = 617,
/**购买体力 */
buyPower = 619,
/**领取新道具弹窗 */
GetNewGoodid = 622,
/**CDK面板 */
PanelCDK = 626,
/**新机制 */
newMechanism = 627,
/**武器碎片 */
WeaponSuiPian = 628,
/**更新公告 */
PopNotice = 633,
/** 排行榜(省榜/总榜) */
Rank = 676,
/** 省榜每日俸禄 */
PopEmolument = 684,
/**修复界面 */
xiufuBox = 645,
/**GM存档编辑器 */
PopGM = 663,
/**战斗武器详情 */
BattleWeaponDesc = 664,
/**战斗单字详情 */
BattleWeaponDesc1 = 687,
/**战斗组合武将详情 */
BattleWeaponDescHero = 688,
/**战斗加速 */
PopBattleSpeed = 665,
/**自动合成 */
PopAutoM = 666,
/**战斗图鉴 */
PopIllustrated = 667,
/**保留文字 */
saveText = 668,
/**帮助 */
PopHelp = 669,
/** 名将库回收 */
popHuishou = 677,
/** 武器介绍 */
mingjiangIntroduction = 678,
/** 每日商店替换道具 */
PopReplaceSkill = 679,
/** 匹配对手 */
match = 680,
/** 公用确认弹窗 */
PopToast = 681,
/** 结算每日 buff 购买 */
PopDailyShopBuy = 685,
/** 每日商店抽奖弹窗 */
PopDailyShopLottery = 686,
/** 获得新武器弹窗 */
PopNewWeapon = 689,
/** Boss 出场弹窗 */
BattleBoss = 690,
/**宝石仓库页面 */
PanelGemstone = 691,
/** 获得新宝石弹窗 */
PopGetGem = 692,
/** 宝石信息弹窗 */
PopGemInfo = 693,
1 week ago
/** 结算每日 buff 翻牌 */
PopDailyShopOpen = 694,
/** 金币不足看广告确认弹窗 */
PopCoinToast = 695,
4 days ago
/** 局内 Battlebuff 三选一 */
PopSelect = 696,
3 weeks ago
}
/**UI资源配置 */
export const UIConfigs: { [key: number]: IUIConfig } = {
[UIID.WatiIcon]: { desc: "等待图标", layer: UILayer.Loading, bundle: GBundle.Comm, path: GPath.UIPrefab, name: "waitIcon" },
[UIID.Home]: { desc: "首页", layer: UILayer.MainUI, bundle: GBundle.Home, path: GPath.UIPrefab, name: "PanelHome" },
[UIID.MainUI]: { desc: "主界面", layer: UILayer.Menu, bundle: GBundle.Comm, path: GPath.UIPrefab, name: "MainUI" },
[UIID.Settings]: { desc: "设置", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('settings'), name: "PanelSettings", popAnim: POP_ANIM.standard },
[UIID.PanelCDK]: { desc: "CDK面板", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('settings'), name: "PanelCDK", popAnim: POP_ANIM.standard },
[UIID.Complain]: { desc: "投诉", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('complain'), name: "PanelComplain", popAnim: POP_ANIM.standard },
[UIID.Sidebar]: { desc: "侧边栏", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('sidebar'), name: "PanelSidebar", popAnim: POP_ANIM.standard },
[UIID.GetReward]: { desc: "领取奖励弹窗", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('getReward'), name: "GetReward", popAnim: POP_ANIM.bounce },
[UIID.Msg]: { desc: "消息框", layer: UILayer.Loading, bundle: GBundle.First, path: GPath.UIPrefab, name: "msg" },
[UIID.MsgBox]: { desc: "消息确认框", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('popAndTips'), name: "MsgBox", popAnim: POP_ANIM.standard },
//在此新增UI面板配置
[UIID.Shop]: { desc: "商店", layer: UILayer.MainUI, bundle: GBundle.Shop, path: GPath.UIPrefab, name: "pageDailyShop" },
[UIID.Role]: { desc: "角色页面", layer: UILayer.MainUI, bundle: GBundle.Role, path: GPath.UIPrefab, name: "pageRole" },
[UIID.Weapon]: { desc: "神将武器", layer: UILayer.MainUI, bundle: GBundle.Shenjiang, path: GPath.UIPrefab, name: "PanelShenjiang" },
[UIID.PopNewWeapon]: { desc: "获得新武器", layer: UILayer.Pop, bundle: GBundle.Shenjiang, path: GPath.UIPrefab, name: "PopNewWeapon", popAnim: POP_ANIM.standard },
[UIID.popHuishou]: { desc: "回收武器", layer: UILayer.Pop, bundle: GBundle.Shenjiang, path: GPath.UIPrefab, name: "popHuishou", popAnim: POP_ANIM.standard },
[UIID.mingjiangIntroduction]: { desc: "武器介绍", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('mingjiangIntroduction'), name: "mingjiangIntroduction", popAnim: { mask: 'none', center: 'scale', close: 2 } },
1 week ago
[UIID.PopCoinToast]: { desc: "金币不足看广告确认弹窗", layer: UILayer.Pop, bundle: GBundle.Comm, path: GPath.UIPrefab, name: "PopCoinToast" },
3 weeks ago
[UIID.match]: { desc: "匹配对手", layer: UILayer.Page, bundle: GBundle.PopCommon, path: GPath.popPrefab('match'), name: "match" },
[UIID.PopToast]: { desc: "公用确认弹窗", layer: UILayer.Pop, bundle: GBundle.Comm, path: GPath.UIPrefab, name: "PopToast" },
[UIID.Rank]: { desc: "排行榜", layer: UILayer.Pop, bundle: GBundle.Rank, path: GPath.UIPrefab, name: "Rank", popAnim: POP_ANIM.standard },
[UIID.PopEmolument]: { desc: "省榜俸禄", layer: UILayer.Pop, bundle: GBundle.Rank, path: GPath.UIPrefab, name: "PopEmolument", popAnim: POP_ANIM.standard },
[UIID.WeaponLevelUp]: { desc: "武器升级界面", layer: UILayer.Page, bundle: GBundle.PopCommon, path: GPath.popPrefab('weaponLevelUp'), name: "WeaponLevelUp", popAnim: POP_ANIM.standard },
[UIID.BattleGame]: { desc: "战斗界面", layer: UILayer.Page, bundle: GBundle.BattleGame, path: GPath.UIPrefab, name: "BattleGame" },
[UIID.BattleSuccess]: { desc: "战斗成功", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('battleGameResult'), name: "BattleSuccess", popAnim: POP_ANIM.maskOnly },
[UIID.BattleFail]: { desc: "战斗失败", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('battleGameResult'), name: "BattleFail", popAnim: POP_ANIM.maskOnly },
[UIID.BattleRevive]: { desc: "战斗复活", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('battleGameResult'), name: "BattleRevive", popAnim: POP_ANIM.maskOnly },
[UIID.BattlePause]: { desc: "战斗暂停", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('battleGameResult'), name: "BattlePause", pauseBattle: true, popAnim: POP_ANIM.standard },
[UIID.BattleWeaponDesc]: { desc: "战斗武器详情", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('battleGameResult'), name: "BattleWeaponDesc", popAnim: popAnimOnce(POP_ANIM.standard) },
[UIID.BattleWeaponDesc1]: { desc: "战斗单字详情", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('battleGameResult'), name: "BattleWeaponDesc1", popAnim: popAnimOnce(POP_ANIM.standard) },
[UIID.BattleWeaponDescHero]: { desc: "战斗组合武将详情", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('battleGameResult'), name: "BattleWeaponDescHero", popAnim: popAnimOnce(POP_ANIM.standard) },
[UIID.BattleBoss]: { desc: "Boss出场", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('battleGameResult'), name: "BattleBoss", pauseBattle: true, popAnim: POP_ANIM.none },
[UIID.boxLevelupDetail]: { desc: "宝箱升级详情", layer: UILayer.Pop, bundle: GBundle.Shop, path: GPath.UIPrefab, name: "boxLevelupDetail", popAnim: POP_ANIM.maskOnly },
[UIID.ItemDetailBox]: { desc: "道具详情", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('popAndTips'), name: "ItemDetailBox", popAnim: POP_ANIM.standard },
[UIID.ItemDetailBox2]: { desc: "道具详情2", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('popAndTips'), name: "ItemDetailBox2", popAnim: POP_ANIM.standard },
[UIID.buyItemBox]: { desc: "购买道具框", layer: UILayer.Pop, bundle: GBundle.Shop, path: GPath.UIPrefab, name: "buyItemBox", popAnim: POP_ANIM.standard },
[UIID.sign7Day]: { desc: "签到7天", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('sign7Day'), name: "sign7Day", popAnim: popReveal('ui_Days', ['btnGet', 'btnVideo']) },
[UIID.pageUserLevelup]: { desc: "用户等级升级", layer: UILayer.Pop, bundle: GBundle.Role, path: GPath.UIPrefab, name: "pageUserLevelup", popAnim: POP_ANIM.none },
[UIID.pageUserLevelupDetail]: { desc: "等级升级详情", layer: UILayer.Pop, bundle: GBundle.Role, path: GPath.UIPrefab, name: "pageUserLevelupDetail", popAnim: POP_ANIM.bounce },
[UIID.buyPower]: { desc: "购买体力", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('buyPower'), name: "buyPower", popAnim: popReveal(['单体力', '3体力'], ['btnVideo', 'btnShare', 'btnClose']) },
[UIID.GetNewGoodid]: { desc: "领取新道具弹窗", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('getReward'), name: "GetNewGoodid", popAnim: popReveal('ui_icon') },
/**新机制弹窗 */
[UIID.newMechanism]: { desc: "新机制弹窗", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('newMechanism'), name: "newMechanism", pauseBattle: true, popAnim: POP_ANIM.standard },
/**武器随机应变弹窗 */
[UIID.WeaponSuiPian]: { desc: "武器随机应变弹窗", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('WeaponSuiPian'), name: "WeaponSuiPian", popAnim: POP_ANIM.standard },
/**更新公告弹窗 */
[UIID.PopNotice]: { desc: "更新公告弹窗", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('popNotice'), name: "PopNotice", popAnim: POP_ANIM.standard },
/**修复界面 */
[UIID.xiufuBox]: { desc: "修复界面", layer: UILayer.Pop, bundle: GBundle.BattleGame, path: GPath.UIPrefab, name: "xiufuBox", popAnim: POP_ANIM.standard },
[UIID.PopGM]: { desc: "GM存档编辑器", layer: UILayer.Pop, bundle: GBundle.Comm, path: GPath.UIPrefab, name: "PopGM", popAnim: POP_ANIM.none },
/**战斗加速弹窗 */
[UIID.PopBattleSpeed]: { desc: "战斗加速弹窗", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('PopBattleSpeed'), name: "PopBattleSpeed", pauseBattle: true, popAnim: POP_ANIM.standard },
[UIID.PopAutoM]: { desc: "自动合成弹窗", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('PopAutoM'), name: "PopAutoM", pauseBattle: true, popAnim: POP_ANIM.standard },
[UIID.PopIllustrated]: { desc: "战斗图鉴", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('popIllustrated'), name: "PopIllustrated", pauseBattle: true, popAnim: POP_ANIM.standard },
4 days ago
[UIID.PopSelect]: { desc: "局内buff三选一", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('popSelect'), name: "PopSelect", pauseBattle: true, popAnim: POP_ANIM.standard },
3 weeks ago
[UIID.saveText]: { desc: "保留文字", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('saveText'), name: "saveText", popAnim: POP_ANIM.bounce },
[UIID.PopHelp]: { desc: "副本玩法说明", layer: UILayer.Pop, bundle: GBundle.PopBattle, path: GPath.popPrefab('PopHelp'), name: "PopHelp", pauseBattle: true, popAnim: POP_ANIM.standard },
/**宝石仓库页面 */
[UIID.PanelGemstone]: { desc: "宝石仓库页面", layer: UILayer.Page, bundle: GBundle.Gemstone, path: GPath.UIPrefab, name: "PanelGemstone" },
/**获得新宝石弹窗 */
[UIID.PopGetGem]: { desc: "获得新宝石", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('popGetGem'), name: "PopGetGem", popAnim: POP_ANIM.standard },
/**宝石信息弹窗 */
[UIID.PopGemInfo]: { desc: "宝石信息", layer: UILayer.Pop, bundle: GBundle.PopCommon, path: GPath.popPrefab('popGemInfo'), name: "PopGemInfo", popAnim: POP_ANIM.standard },
3 weeks ago
}
/** @deprecated 请从 db://assets/mx/module/res/ResPkgName 导入 */
export { ResPkgName } from 'db://assets/mx/module/res/ResPkgName';
function _pushUiPrefab(ress: ResPakage['ress'], uiId: UIID): void {
const conf = UIConfigs[uiId];
if (!conf) return;
ress.push({ name: conf.name, bundle: conf.bundle, path: conf.path, type: Prefab });
}
function _pushQualityFrames(ress: ResPakage['ress'], bundle: GBundle): void {
for (let i = 1; i <= 4; i++) {
ress.push({ name: `H${i}/spriteFrame`, bundle, path: "img/", type: SpriteFrame });
}
for (let i = 1; i <= 4; i++) {
ress.push({ name: `V${i}/spriteFrame`, bundle, path: "img/", type: SpriteFrame });
}
}
/** 启动最小必加载资源 */
export const getBootResPakage = (): ResPakage => {
const ress: ResPakage['ress'] = [
{ name: `ItemGrid`, bundle: GBundle.Comm, path: GPath.Prefab, type: Prefab },
{ name: `gm`, bundle: GBundle.First, path: GPath.Prefab, type: Prefab },
];
return {
name: ResPkgName.BootRes,
isReleaseable: false,
ress,
};
};
/** @deprecated 请用 getBootResPakage */
export const getCommResPakage: Function = () => getBootResPakage();
/** 进大厅前加载:PanelHome */
export const getMainShellResPakage = (): ResPakage => ({
name: ResPkgName.MainShellRes,
isReleaseable: true,
ress: [
{ name: `PanelHome`, bundle: GBundle.Home, path: GPath.UIPrefab, type: Prefab },
],
});
/**主场景资源包 */
export const getMainResPakage: Function = () => getMainShellResPakage();
/** 进首页加载:英雄字形 + 模板,局外常驻不随战斗释放 */
export const getHerosResPakage = (): ResPakage => {
const ress: ResPakage['ress'] = [
{ name: 'heroTemplate', bundle: GBundle.Heros, path: GPath.Prefab, type: Prefab },
];
return {
name: ResPkgName.HerosRes,
isReleaseable: false,
ress,
};
};
/** 大厅高频弹窗:进大厅 decode,进战可释放预制,popCommon zip 常驻 */
export function getHallWarmUiIds(): readonly UIID[] {
return [
UIID.Settings,
UIID.MsgBox,
UIID.PopToast,
UIID.buyPower,
UIID.GetReward,
UIID.PopNotice,
];
}
/**
* 进大厅后静默预热:新产品首页高频弹窗(磁盘仅有这些 prefab)。
*/
export const getHallWarmResPakage = (): ResPakage => {
const ress: ResPakage['ress'] = [];
const uiIds = getHallWarmUiIds();
for (const id of uiIds) {
_pushUiPrefab(ress, id);
}
return {
name: ResPkgName.HallWarmRes,
isReleaseable: true,
ress,
};
};
/** 进首页后静默下载的战斗分包(只 loadBundle,不 acquire、不 load 资源) */
export function getBattleSilentBundles(): readonly string[] {
return [
GBundle.Heros,
GBundle.BattleGame,
GBundle.BattleMap,
GBundle.BattleGameMonster,
GBundle.BattleHero,
GBundle.PopBattle,
];
}
/** 新产品磁盘上全部业务分包(闲时 zip 补齐;不含永久包与 lang_*) */
export function getAllDownloadableBundles(): readonly string[] {
return [
GBundle.Rank,
GBundle.Shenjiang,
GBundle.BattleGame,
GBundle.BattleMap,
GBundle.BattleGameMonster,
GBundle.BattleHero,
GBundle.PopBattle,
];
}
/** 战斗包下载完后静默 preload 的大厅页/弹窗(HallWarm 已 load 的不重复) */
export function getHallSilentUiIds(): readonly UIID[] {
return [
UIID.match,
UIID.Weapon,
UIID.Rank,
UIID.Sidebar,
UIID.Complain,
UIID.popHuishou,
UIID.PopNewWeapon,
UIID.PopEmolument,
UIID.ItemDetailBox,
UIID.mingjiangIntroduction,
];
}
/** 进 BattleGame 后静默 preload 的局内弹窗(仅磁盘上有的预制) */
export function getBattleSilentUiIds(): readonly UIID[] {
return [
UIID.BattlePause,
UIID.BattleSuccess,
UIID.BattleFail,
UIID.BattleBoss,
UIID.BattleWeaponDesc1,
UIID.BattleWeaponDescHero,
UIID.PopIllustrated,
4 days ago
UIID.PopSelect,
3 weeks ago
UIID.PopBattleSpeed,
];
}
/** 大厅 idle 后预载:长尾弹窗,与 enterHall 错峰降低峰值 */
export const getHallWarmLongTailResPakage = (): ResPakage => {
const ress: ResPakage['ress'] = [];
const uiIds: UIID[] = [
UIID.Sidebar,
UIID.Complain,
UIID.ItemDetailBox,
UIID.ItemDetailBox2,
];
for (const id of uiIds) {
_pushUiPrefab(ress, id);
}
return {
name: ResPkgName.HallWarmLongTailRes,
isReleaseable: true,
ress,
};
};
/** @deprecated 请用 getHallWarmResPakage + getHallWarmLongTailResPakage */
export const getHallWarmAllResPakage = (): ResPakage => {
const core = getHallWarmResPakage();
const tail = getHallWarmLongTailResPakage();
return {
name: ResPkgName.HallWarmRes,
isReleaseable: true,
ress: [...core.ress, ...tail.ress],
};
};
/**根据章节配置获取章节动画名称 */
export const getChapterAnim: Function = (config: ITableLevel): string[] => {
switch (config.id) {//[动画节点(文件名),待机动画,选中出现动画,出现后待机动画]
case 1: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 2: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 3: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 4: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 5: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 6: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 7: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 8: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 9: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 10: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 11: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 12: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 13: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 13: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 14: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 15: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 16: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 17: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 18: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 19: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 20: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 21: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 22: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 23: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 24: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 25: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 26: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 27: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 28: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 29: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 30: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 31: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 32: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 33: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 34: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 35: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 36: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 37: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 38: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 39: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 40: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 41: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 42: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 43: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 44: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 45: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 46: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 47: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 48: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 49: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 50: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 51: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 52: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 53: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 54: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 55: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 56: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 57: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 58: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 59: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 60: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 61: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 62: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 63: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 64: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 65: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 66: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 67: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 68: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 69: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 70: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 71: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 72: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 73: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 74: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 75: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 76: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 77: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 78: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 79: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 80: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 81: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 82: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 83: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 84: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 85: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 86: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 87: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 88: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 89: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 90: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
case 91: return ['首页选关1_5', '2商业街待机', '2商业街选中', '2商业街选中待机']
case 92: return ['首页选关1_5', '3医院待机', '3医院选中', '3医院选中待机']
case 93: return ['首页选关1_5', '4超市待机', '4超市选中', '4超市选中待机']
case 94: return ['首页选关1_5', '5地铁站待机', '5地铁站选中', '5地铁站选中待机']
case 95: return ['首页选关6_9', '6烂尾楼待机', '6烂尾楼选中', '6烂尾楼选中待机']
case 96: return ['首页选关6_9', '7公园待机', '7公园选中', '7公园选中待机']
case 97: return ['首页选关6_9', '8大桥待机', '8大桥选中', '8大桥选中待机']
case 98: return ['首页选关6_9', '9海港待机', '9海港选中', '9海港选中待机']
case 99: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
default: return ['首页选关1_5', '1教室待机', '1教室选中', '1教室选中待机']
}
}