23 lines
		
	
	
		
			533 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
		
		
			
		
	
	
			23 lines
		
	
	
		
			533 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
|  | local GameplayStatics = import("GameplayStatics") | ||
|  | local WidgetUtils = {} | ||
|  | 
 | ||
|  | local function GetHud(wco) | ||
|  |     local pc = GameplayStatics.GetPlayerController(wco, 0) | ||
|  |     if pc == nil then return end | ||
|  |     return pc:GetHud() | ||
|  | end | ||
|  | 
 | ||
|  | function WidgetUtils.Show(wco, widget_name) | ||
|  |     local hud = GetHud(wco) | ||
|  |     if not hud then return end | ||
|  |     return hud:ShowWidget(widget_name) | ||
|  | end | ||
|  | 
 | ||
|  | function WidgetUtils.Hide(wco, widget_name) | ||
|  |     local hud = GetHud(wco) | ||
|  |     if not hud then return end | ||
|  |     return hud:PopWidget(widget_name) | ||
|  | end | ||
|  | 
 | ||
|  | 
 | ||
|  | return WidgetUtils |