125 lines
4.1 KiB
Lua
125 lines
4.1 KiB
Lua
require("Script.Global.DefaultSettings")
|
||
|
||
WidgetConfig = WidgetConfig or {}
|
||
|
||
-- UI 类型
|
||
WidgetConfig.EUIType = {
|
||
Default = 0,
|
||
Test = 1,
|
||
Main = 2,
|
||
FaceNotice = 3,
|
||
Tips1 = 4,
|
||
GameEnd = 5,
|
||
SelectMode = 6,
|
||
}
|
||
|
||
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,
|
||
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.FaceNotice] = {
|
||
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tool/WB_FaceNotice.WB_FaceNotice_C'),
|
||
-- 是否仅显示一次
|
||
bShowOnce = false,
|
||
Layer = WidgetConfig.EUILayerGroup.MainUI,
|
||
},
|
||
[WidgetConfig.EUIType.Main] = {
|
||
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/WB_Main.WB_Main_C'),
|
||
-- 是否仅显示一次
|
||
bShowOnce = true,
|
||
Layer = WidgetConfig.EUILayerGroup.Low,
|
||
bAddToTouch = true;
|
||
},
|
||
[WidgetConfig.EUIType.GameEnd] = {
|
||
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/GameEnd/WB_GameEnd.WB_GameEnd_C'),
|
||
-- 是否仅显示一次
|
||
bShowOnce = true,
|
||
Layer = WidgetConfig.EUILayerGroup.High,
|
||
},
|
||
[WidgetConfig.EUIType.Test] = {
|
||
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/InTest/WB_InTestWidget.WB_InTestWidget_C'),
|
||
-- 是否仅显示一次
|
||
bShowOnce = false,
|
||
Layer = WidgetConfig.EUILayerGroup.Toppest,
|
||
},
|
||
}
|
||
end
|
||
|
||
return WidgetConfig |