summaryrefslogtreecommitdiff
path: root/sourcemod/scripting/gokz-hud/natives.sp
blob: bb877e23d7123b96bb189047a4f8b5bc94cc1c46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
void CreateNatives()
{
	CreateNative("GOKZ_HUD_ForceUpdateTPMenu", Native_ForceUpdateTPMenu);
	CreateNative("GOKZ_HUD_GetMenuShowing", Native_GetMenuShowing);
	CreateNative("GOKZ_HUD_SetMenuShowing", Native_SetMenuShowing);
	CreateNative("GOKZ_HUD_GetMenuSpectatorText", Native_GetSpectatorText);
}

public int Native_ForceUpdateTPMenu(Handle plugin, int numParams)
{
	SetForceUpdateTPMenu(GetNativeCell(1));
	return 0;
}

public int Native_GetMenuShowing(Handle plugin, int numParams)
{
	return view_as<int>(gB_MenuShowing[GetNativeCell(1)]);
}

public int Native_SetMenuShowing(Handle plugin, int numParams)
{
	gB_MenuShowing[GetNativeCell(1)] = view_as<bool>(GetNativeCell(2));
	return 0;
}

public int Native_GetSpectatorText(Handle plugin, int numParams)
{
	HUDInfo info;
	GetNativeArray(2, info, sizeof(HUDInfo));
	KZPlayer player = KZPlayer(GetNativeCell(1));
	FormatNativeString(3, 0, 0, GetNativeCell(4), _, "", FormatSpectatorTextForMenu(player, info));
	return 0;
}