2025-01-04 23:00:19 +08:00

166 lines
5.6 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

require("Script.Global.DefaultSettings")
WidgetConfig = WidgetConfig or {}
-- UI 类型
WidgetConfig.EUIType = {
Default = 0,
Test = 1,
Main = 2,
FaceNotice = 3,
Tips1 = 4,
GameEnd = 5,
SelectMode = 6,
SelectWeapon = 7,
AllWeapon = 8,
White = 9,
SelectSoldier = 10,
PlayerScores = 11,
}
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 = true, -- 背包
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
MainControlPanel.SkillLayer:SetVisibility(ESlateVisibility.Collapsed);
UGCEventSystem.SetTimerLoop(UGCGameSystem.GameState, function()
MainControlPanel.SkillLayer:SetVisibility(ESlateVisibility.Collapsed);
end, 1);
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.Test] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/InTest/WB_InTestWidget.WB_InTestWidget_C'),
-- 是否仅显示一次
bShowOnce = false,
Layer = WidgetConfig.EUILayerGroup.Low1,
},
[WidgetConfig.EUIType.Tips1] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tip/WB_Tip1.WB_Tip1_C'),
-- 是否仅显示一次
bShowOnce = false,
Layer = WidgetConfig.EUILayerGroup.Top + 1,
},
[WidgetConfig.EUIType.SelectWeapon] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapons/WB_SelectWeapons.WB_SelectWeapons_C'),
-- 是否仅显示一次
bShowOnce = false,
Layer = WidgetConfig.EUILayerGroup.Up,
},
[WidgetConfig.EUIType.White] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tool/WB_White.WB_White_C'),
-- 是否仅显示一次
bShowOnce = false,
Layer = WidgetConfig.EUILayerGroup.Low,
},
[WidgetConfig.EUIType.SelectSoldier] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectSoldier/WB_SelectSoldier.WB_SelectSoldier_C'),
-- 是否仅显示一次
bShowOnce = true,
Layer = WidgetConfig.EUILayerGroup.MainUI,
},
[WidgetConfig.EUIType.PlayerScores] = {
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tool/WB_PlayerScores.WB_PlayerScores_C'),
-- 是否仅显示一次
bShowOnce = false,
Layer = WidgetConfig.EUILayerGroup.MainUI,
},
}
end
return WidgetConfig