127 lines
5.1 KiB
Lua
127 lines
5.1 KiB
Lua
|
WidgetConfig = WidgetConfig or {}
|
||
|
|
||
|
-- 默认UI的隐藏
|
||
|
---@param InShow bool
|
||
|
function WidgetConfig.HideDefaultUI(InShow)
|
||
|
---@type MainControlPanelTochButton_C
|
||
|
local MainControlPanel = GameBusinessManager.GetWidgetFromName(ingame, "MainControlPanelTochButton_C");
|
||
|
if MainControlPanel ~= nil then
|
||
|
local MainControlBaseUI = MainControlPanel.MainControlBaseUI;
|
||
|
local Show = not InShow
|
||
|
MainControlBaseUI.NavigatorPanel:SetVisibility(ESlateVisibility.Collapsed); --导航面板
|
||
|
MainControlBaseUI.Image_0:SetVisibility(ESlateVisibility.Collapsed); --导航指针
|
||
|
MainControlBaseUI.CanvasPanel_FreeCamera:SetAdvancedCollapsed(Show); --小眼睛
|
||
|
MainControlBaseUI.CanvasPanel_MiniMapAndSetting:SetAdvancedCollapsed(Show); --小地图
|
||
|
MainControlBaseUI.SignalReceivingAreaTIPS_UIBP:SetAdvancedCollapsed(Show);
|
||
|
MainControlBaseUI.CanvasPanelSurviveKill:AddAdvancedCollapsedCount(1) --- 剩余人数、淘汰数
|
||
|
--MainControlBaseUI.Border_TopPlatformTipsColor:SetAdvancedCollapsed(Show); --顶部平台击杀提示
|
||
|
MainControlBaseUI.PlayerInfoSocket:SetAdvancedCollapsed(Show); --血条信息
|
||
|
MainControlBaseUI.SurviveInfoPanel:SetVisibility(ESlateVisibility.Collapsed) --- 存活人数
|
||
|
MainControlBaseUI.ChatAndChatPanelCanvas:SetAdvancedCollapsed(Show); --聊天A
|
||
|
MainControlBaseUI.InvalidationBox_3:AddAdvancedCollapsedCount(1); -- 背包
|
||
|
MainControlBaseUI.CanvasPanel_BackpackPanel:AddAdvancedCollapsedCount(1); -- 背包
|
||
|
MainControlBaseUI.CanvasPanel_AutoJoinPanel:AddAdvancedCollapsedCount(1); -- 距离军事竞赛还有xx秒
|
||
|
if MainControlBaseUI.QuickExpressionUIBP ~= nil then
|
||
|
MainControlBaseUI.QuickExpressionUIBP.Switcher_Expression:SetAdvancedCollapsed(Show) --表情
|
||
|
end
|
||
|
|
||
|
local ShootingUIPanel = MainControlPanel.ShootingUIPanel;
|
||
|
ShootingUIPanel.NewbieGuideCanvas:SetAdvancedCollapsed(Show); --SwimControl
|
||
|
ShootingUIPanel.Fade:SetAdvancedCollapsed(Show);
|
||
|
else
|
||
|
UGCLogSystem.Log('[UIUtils.ShowDefaultHUD] 无法加载 MainControlPanel');
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function WidgetConfig.CloseAutoJoinPanel()
|
||
|
local MainControlPanel = GameBusinessManager.GetWidgetFromName(ingame, "MainControlPanelTochButton_C");
|
||
|
if MainControlPanel ~= nil then
|
||
|
local MainControlBaseUI = MainControlPanel.MainControlBaseUI;
|
||
|
if MainControlBaseUI then
|
||
|
if MainControlBaseUI.CanvasPanel_AutoJoinPanel then
|
||
|
MainControlBaseUI.CanvasPanel_AutoJoinPanel:SetVisibility(ESlateVisibility.Collapsed); -- 距离军事竞赛还有xx秒
|
||
|
end
|
||
|
end
|
||
|
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,
|
||
|
};
|
||
|
|
||
|
-- UI 类型
|
||
|
WidgetConfig.EUIType = {
|
||
|
Default = 0,
|
||
|
Main = 1,
|
||
|
Settlement = 2,
|
||
|
FaceNotice = 3,
|
||
|
SelectMap = 4, -- 地图选择界面
|
||
|
Backpack = 5, -- 背包配置页面
|
||
|
Spectation = 6, -- 观战界面
|
||
|
SelectSoldier = 7, -- 选择兵种界面
|
||
|
RoundWin = 8, -- 回合结束胜利
|
||
|
}
|
||
|
|
||
|
---@return table<EUIType, HUDConfigItem> key: int32 value: HUDConfigStruct
|
||
|
WidgetConfig.HUDConfig = {
|
||
|
[WidgetConfig.EUIType.Main] = {
|
||
|
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/WB_Main.WB_Main_C'),
|
||
|
-- 是否仅显示一次
|
||
|
bShowOnce = false,
|
||
|
Layer = WidgetConfig.EUILayerGroup.Low,
|
||
|
bAddToTouch = true;
|
||
|
},
|
||
|
[WidgetConfig.EUIType.Settlement] = {
|
||
|
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Settlement/WB_TeamSettlement.WB_TeamSettlement_C'),
|
||
|
-- 是否仅显示一次
|
||
|
bShowOnce = true,
|
||
|
Layer = WidgetConfig.EUILayerGroup.Toppest,
|
||
|
},
|
||
|
[WidgetConfig.EUIType.FaceNotice] = {
|
||
|
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tool/WB_FaceNotice.WB_FaceNotice_C'),
|
||
|
-- 随时可以查看
|
||
|
bShowOnce = false,
|
||
|
Layer = WidgetConfig.EUILayerGroup.Top,
|
||
|
},
|
||
|
[WidgetConfig.EUIType.Spectation] = {
|
||
|
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/WB_Spectation.WB_Spectation_C'),
|
||
|
-- 随时可以查看
|
||
|
bShowOnce = false,
|
||
|
Layer = WidgetConfig.EUILayerGroup.Medium,
|
||
|
},
|
||
|
[WidgetConfig.EUIType.SelectMap] = {
|
||
|
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/WB_SelectLevel.WB_SelectLevel_C'),
|
||
|
-- 随时可以查看
|
||
|
bShowOnce = true,
|
||
|
Layer = WidgetConfig.EUILayerGroup.High + 1,
|
||
|
},
|
||
|
[WidgetConfig.EUIType.SelectSoldier] = {
|
||
|
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectSoldier/WB_SelectSoldier.WB_SelectSoldier_C'),
|
||
|
bShowOnce = true,
|
||
|
Layer = WidgetConfig.EUILayerGroup.High,
|
||
|
},
|
||
|
[WidgetConfig.EUIType.Backpack] = {
|
||
|
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/WB_Backpack1.WB_Backpack1_C'),
|
||
|
-- 随时可以查看
|
||
|
bShowOnce = false,
|
||
|
Layer = WidgetConfig.EUILayerGroup.Medium,
|
||
|
},
|
||
|
[WidgetConfig.EUIType.RoundWin] = {
|
||
|
Path = UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/WB_RoundWin.WB_RoundWin_C'),
|
||
|
-- 随时可以查看
|
||
|
bShowOnce = false,
|
||
|
Layer = WidgetConfig.EUILayerGroup.Top,
|
||
|
},
|
||
|
}
|
||
|
|
||
|
return WidgetConfig
|