ModSharp.GameHUD.Shared
1.0.2
dotnet add package ModSharp.GameHUD.Shared --version 1.0.2
NuGet\Install-Package ModSharp.GameHUD.Shared -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ModSharp.GameHUD.Shared" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ModSharp.GameHUD.Shared" Version="1.0.2" />
<PackageReference Include="ModSharp.GameHUD.Shared" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ModSharp.GameHUD.Shared --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ModSharp.GameHUD.Shared, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ModSharp.GameHUD.Shared@1.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ModSharp.GameHUD.Shared&version=1.0.2
#tool nuget:?package=ModSharp.GameHUD.Shared&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
[Core]MS-GameHUD
API for displaying messages to the player. GameText analogue
Required packages:
Installation:
- Compile or copy MS-GameHUD to
sharp/modules/MS-GameHUDfolger - Compile or copy MS-GameHUD-Shared to
sharp/shared/MS-GameHUD-Sharedfolger - Restart server
CVARs(temporarily, maybe there is a better method):
| Cvar | Parameter | Description |
|---|---|---|
ms_gamehud_method |
<0/1> | true - point_orient, false - teleport |
Example:
Add the dependency MS-GameHUD to your project:
using MS_GameHUD_Shared;
using static MS_GameHUD_Shared.IGameHUDAPI;
<My plugin class>: IModSharpModule
{
<...>
public void OnAllModulesLoaded() => GetGameHUD();
public void OnLibraryConnected(string name)
{
if (name.Equals("GameHUD")) GetGameHUD();
}
public void OnLibraryDisconnect(string name)
{
if (name.Equals("GameHUD")) _igamehud = null;
}
private IModSharpModuleInterface<IGameHUDAPI>? _igamehud;
private IGameHUDAPI? GetGameHUD()
{
if (_igamehud?.Instance is null) _igamehud = _modules.GetOptionalSharpModuleInterface<IGameHUDAPI>(IGameHUDAPI.Identity);
return _igamehud?.Instance;
}
<...>
}
Using API function. Description of parameters see in source code MS-GameHUD-Shared
public void MyExampleFunc(IPlayerController? player)
{
<...>
if (player.IsValid() && GetGameHUD() is { } _api)
{
<...>
_api.Native_GameHUD_SetParams(player, 0, new(20, 20, 80), new(255, 0, 0, 255));
_api.Native_GameHUD_Show(player, 0, "MyMessage", 10.0f);
<...>
_api.Native_GameHUD_Remove(player, 0);
<...>
}
<...>
}
Screenshot
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- ModSharp.Sharp.Shared (>= 2.1.88)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.