126 lines
4.1 KiB
Lua
Raw Normal View History

2025-01-04 23:00:19 +08:00
require("Script.Global.DefaultSettings")
WidgetConfig = WidgetConfig or {}
-- UI 类型
WidgetConfig.EUIType = {
Default = 0,
Main = 2,
FaceNotice = 3,
GameEnd = 4,
SelectWeapon = 5,
}
if not UE_SERVER then
---@deprecated 暂时还不用
WidgetConfig.ShowMainBaseUI = {
NavigatorPanel = false, -- 导航面板
Image_0 = false, -- 导航指针
CanvasPanel_FreeCamera = true, -- 小眼睛
CanvasPanel_MiniMapAndSetting = true, -- 小地图
CanvasPanelSurviveKill = true, -- 剩余人数
Border_TopPlatformTipsColor = false, -- 顶部平台击杀提示
PlayerInfoSocket = true, -- 血条信息
SurviveInfoPanel = false, -- 存活人数
InvalidationBox_3 = true, -- 击杀/剩余, 背包,游戏Logo
ChatAndChatPanelCanvas = false, -- 聊天A
CanvasPanel_BackpackPanel = false, -- 背包
Backpack_Border = false, -- 背包
CanvasPanel_BackpackSlot = false, -- 背包
CanvasPanel_IDPanel = true, -- 玩家 ID左下角
};
WidgetConfig.ShowShootingUI = {
NewbieGuideCanvas = true, -- SwimControl
Fade = true, -- SwimControl
SwitchWeaponSlot_Mode2 = true, -- 武器栏1
SwitchWeaponSlot_Mode2_C_0 = true, -- 武器栏2
CustomProne = true, -- 卧倒
CustomCrouch = true, -- 蹲下
CustomFireBtnL = true, -- 攻击左
CustomFireBtnR = true, -- 攻击右
CustomSprint = true, -- 疾跑
CustomReload = true, -- 换弹
Ingame_TeamPanel_BP = true, -- 队伍
};
WidgetConfig.Ingame_TeamPanel = {
Canvas_Border_Team = true, -- 组队和队友信息
}
-- 默认UI的隐藏
---@param InShow bool
function WidgetConfig.HideDefaultUI(InShow)
---@type MainControlPanelTochButton_C
local MainControlPanel = GameBusinessManager.GetWidgetFromName(ingame, "MainControlPanelTochButton_C");
if MainControlPanel ~= nil then
---@type MainControlBaseUI_C
local MainControlBaseUI = MainControlPanel.MainControlBaseUI;
local Show = not InShow;
if MainControlBaseUI then
for i, v in pairs(WidgetConfig.ShowMainBaseUI) do
local Item = MainControlBaseUI[i];
if Item then UITool.ShowUI(v, Item); end
end
--MainControlBaseUI.Ingame_TeamPanel_BP = WidgetConfig.Ingame_TeamPanel.Canvas_Border_Team;
end
local ShootingUIPanel = MainControlPanel.ShootingUIPanel;
for i, v in pairs(WidgetConfig.ShowShootingUI) do
local Item = ShootingUIPanel[i];
if Item then UITool.ShowUI(v, Item); end
end
else
UGCLogSystem.Log('[UIUtils.ShowDefaultHUD] 无法加载 MainControlPanel');
end
end
WidgetConfig.EUILayerGroup = {
Negative = -1,
Least = 0,
Bottom = 1,
Low = 2,
Low1 = 3,
Up = 10001,
MainUI = 10003,
Medium = 10010,
High = 10020,
Top = 10030,
Topper = 10040,
Toppest = 10080,
Notice = 10100,
};
---@return table<EUIType, HUDConfigItem> key: int32 value: HUDConfigStruct
WidgetConfig.HUDConfig = {
[WidgetConfig.EUIType.Main] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/WB_Main.WB_Main_C'),
-- 是否仅显示一次
bShowOnce = true,
Layer = WidgetConfig.EUILayerGroup.Low,
bAddToTouch = true;
},
[WidgetConfig.EUIType.FaceNotice] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tool/WB_FaceNotice.WB_FaceNotice_C'),
-- 是否仅显示一次
bShowOnce = false,
Layer = WidgetConfig.EUILayerGroup.Medium,
},
[WidgetConfig.EUIType.GameEnd] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/GameEnd/WB_GameEnd.WB_GameEnd_C'),
-- 是否仅显示一次
bShowOnce = true,
Layer = WidgetConfig.EUILayerGroup.Top,
},
[WidgetConfig.EUIType.SelectWeapon] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapons/WB_SelectWeapon.WB_SelectWeapon_C'),
-- 是否仅显示一次
bShowOnce = false,
Layer = WidgetConfig.EUILayerGroup.Up,
},
}
end
return WidgetConfig