---@class WB_InTest_Side_C:UUserWidget ---@field VerticalBox_Main UVerticalBox --Edit Below-- ---@type WB_InTest_Side_C local WB_InTest_Side = { bInitDoOnce = false; }; function WB_InTest_Side:Construct() self:LuaInit(); end local TestMap = { --{ Func = function() WB_InTest_Side:SendRPC("Test_AddRangeParts") end, Text = "测试添加配件", }, --{ Func = function() WB_InTest_Side:SendRPC("Test_AddBolt") end, Text = "测试添加弩箭", }, { Func = function() WB_InTest_Side:SendRPC("Test_SetBuff", EBuffType.AddHealth) end, Text = "测试buff血量", }, { Func = function() WB_InTest_Side:SendRPC("Test_AddBuff", "Test1") end, Text = "测试添加Buff", }, { Func = function() WB_InTest_Side:SendRPC("Test_MiniFunc", "Test_SpawnActor", LocalPlayerKey) end, Text = "测试大世界生成", }, { Func = function() WB_InTest_Side:SendRPC("Test_MiniFunc", "Test_Random") end, Text = "测试随机数", }, { Func = function() WB_InTest_Side:Test_ShowTips1(10, ELogColor.Cyan, "测试显示 Tips1: %s", "xxx") end, Text = "测试 Tips1", }, }; function WB_InTest_Side:LuaInit() if self.bInitDoOnce then return end UITool.HideAllChildren(self.VerticalBox_Main); for i, v in pairs(TestMap) do self.VerticalBox_Main:GetChildAt(i):SetFunc(v.Func, self, v.Text); self.VerticalBox_Main:GetChildAt(i):SetVisibility(ESlateVisibility.Visible); end self.bInitDoOnce = true; end function WB_InTest_Side:OpenSettings() ---@type MainControlPanelTochButton_C local MainControlPanel = GameBusinessManager.GetWidgetFromName(ingame, "MainControlPanelTochButton_C"); if MainControlPanel then MainControlPanel.MainControlBaseUI:OpenSettingPanel(); end end function WB_InTest_Side:SendRPC(InStr, ...) if InStr == "Test_MiniFunc" then LocalPlayerController:MiniFunc(...); end UnrealNetwork.CallUnrealRPC(LocalPlayerController, LocalPlayerController, "Test_Func", InStr, ...); end WB_InTest_Side.IsPawnShow = true; function WB_InTest_Side:HideSelf() local Pawn = UGCGameSystem.GetPlayerPawnByPlayerKey(LocalPlayerKey); Pawn:HiddenMySelf(self.IsPawnShow); self.IsPawnShow = not self.IsPawnShow; end function WB_InTest_Side:Test_SwitchScope() local MainControlPanel = GameBusinessManager.GetWidgetFromName(ingame, "MainControlPanelTochButton_C") if MainControlPanel ~= nil then local ChangeSight = MainControlPanel.MainControlBaseUI.ChangeSight_UIBP; ChangeSight:SetVisibility(ESlateVisibility.Visible); ChangeSight:ShowList(); end end -- function WB_InTest_Side:Tick(MyGeometry, InDeltaTime) -- end -- function WB_InTest_Side:Destruct() -- end function WB_InTest_Side:UISomething() LocalPlayerController:KillSomeCount(10); self:SendRPC("UISomething") end function WB_InTest_Side:Test_ShowTips1(...) UITool.ShowTips1(...); end return WB_InTest_Side;