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, } 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, -- 组队和队友信息 } function WidgetConfig.ShowExpressionUI() local QuickExpressionUIBPClass = UE.LoadClass("/Game/BluePrints/ControlInput/IngameUI/QuickExpressionUIBP.QuickExpressionUIBP_C") if QuickExpressionUIBPClass then UGCLogSystem.Log("[WidgetConfig.ShowExpressionUI] QuickExpressionUIBPClass is true") local UI_QuickExpressionUIBP = UserWidget.NewWidgetObjectBP(LocalPlayerController, QuickExpressionUIBPClass) -- MainControlBaseUI.CanvasPanel_Main:AddChild(UI_QuickExpressionUIBP) UI_QuickExpressionUIBP:AddToViewport(10000); UGCLogSystem.Log("[WidgetConfig.ShowExpressionUI]") else UGCLogSystem.Log("[WidgetConfig.ShowExpressionUI] QuickExpressionUIBPClass is nil") end end -- 默认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 --WidgetConfig.ShowExpressionUI() 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 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.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, }, } end return WidgetConfig