Text HUD API для Space Engineers
Allows modders to add text to the players screen. This mod must be loaded along side any other mod that uses it.
Graphics update note: Post-Processing causes all HUD API text to be dark and blurry unless it uses the PostPP blendtype.
Workaround found, set BlendType to SDR to avoid blurring by post processing. New HudAPIv2 contains this option.
This mod is WIP. Works in Stable and Dev branches.
Features:
Add Text HUD elements
Add Text to world
Add Text attached to Entities.
Add Billboards to HUD elements
Adds an interactable mod menu.
BETA:
There is now a new API class that interfaces with this mod you can get it here:
[SteamLibrary folder]\steamapps\workshop\content\244850\758597413\Data\Scripts\HUDApi\HudAPIv2.cs
This one works entirely differently than the items below. Overall performance should be better and you wont have to constantly recreate messages.
In a Session Component init the mod using the Init Method
TextAPI = new HudAPIv2(onRegisteredCallback);
Note: onRegisteredCallback method will be called when the API registers to this mod you can then declare all HUD/Menu elements in that method.
Note before using any class make sure Heartbeat is true. If you try to call a constructor while Heartbeat is false it will lead to a crash.
Editing any class property will update it instantly, there is no longer any network messaging involved with the mod. This also means you have to now worry about thread safety.
The NotePad mod has already been updated with v2 calls if you need to unpack an example.
Modders:
You can change the color of the text with the <color=colorname> tag. No closing tag is required. You can use multiple colors in the same message.
<color=r,g,b> and <color=r,g,b,a> also supported. r = red [0-255] b = blue [0-255] g = green [0-255] a = alpha [0-255]
The Heartbeat property lets you know if the class has recieved a heartbeat, so you can be confident the player has the mod installed. If they do not then you can revert to any previous messaging scheme you had.
V1.2:
Backward compatible with V1.1
EntityMessage and SpaceMessages introduced. Space messages are static messages in 3d space, entity messages are attached to entities. See comments in the new file.
V1.3:
Backward compatible with V1.1 and V1.2
Updated HUDMessage to allow shadowing and automatic hiding when the User hides their HUD.
Small performance increase.
GetLineLength will return the world length of a string of text up to a return or end of string. Feed it one line at a time.
Added IsHUDVisible property that mods can use to determine if the player has his/her HUD visible.
V1.3.1:
All characters added
Fonts cleaned up a bit (less artifiacts)
V1.4.0
Added BillBoardHUDMessage to allow modders to place billboards directly on the HUD.
Added IsInMenu property so modders can easly get if a player is in a menu.
V2.0
See above notes, Backwards compatable with all previous versions.
V2.1
Added BlendTypeEnum Option to all Message Types, use PostPP to avoid post processing messing up your day! Defaults to Standard if new HudAPIv2.cs is not loaded to retain backwards compatability.
V2.5
Texture files eliminated, mod now uses a UV map to generate the font.
Monospace font added
Mod menu added
V2.51
Included some performance improvements.
Modders now can manually flush the cache by calling the Flush() method.
V2.52
Draw() Method added
Performance improvements
V2.53
MenuColorPicker added
Thanks to Digi for pointing me in the right direction to get it working properly with 3rd person.
Localization complete, now supports all characters - Thanks Midspace!
Mod List:
Notes (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=758966734
Easy Inventory (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=646796262
Aerodynamic Physics (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=571920453
Build Vision - http://steamcommunity.com/sharedfiles/filedetails/?id=756792814
Text Projector (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=762397930
Build Hints - http://steamcommunity.com/sharedfiles/filedetails/?id=762950855
Dock Assist (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=764754640
Stargate mod - http://steamcommunity.com/sharedfiles/filedetails/?id=754173702
Wormhole portal - http://steamcommunity.com/sharedfiles/filedetails/?id=377773977
Score Screen (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=767740490
Automatic Ore Pickup - http://steamcommunity.com/sharedfiles/filedetails/?id=657749341
Hunger and Thirst - http://steamcommunity.com/sharedfiles/filedetails/?id=591816613
Build Information - http://steamcommunity.com/sharedfiles/filedetails/?id=514062285
HudLcd - http://steamcommunity.com/sharedfiles/filedetails/?id=911144486
Graphics update note: Post-Processing causes all HUD API text to be dark and blurry unless it uses the PostPP blendtype.
Workaround found, set BlendType to SDR to avoid blurring by post processing. New HudAPIv2 contains this option.
This mod is WIP. Works in Stable and Dev branches.
Features:
Add Text HUD elements
Add Text to world
Add Text attached to Entities.
Add Billboards to HUD elements
Adds an interactable mod menu.
BETA:
There is now a new API class that interfaces with this mod you can get it here:
[SteamLibrary folder]\steamapps\workshop\content\244850\758597413\Data\Scripts\HUDApi\HudAPIv2.cs
This one works entirely differently than the items below. Overall performance should be better and you wont have to constantly recreate messages.
In a Session Component init the mod using the Init Method
TextAPI = new HudAPIv2(onRegisteredCallback);
Note: onRegisteredCallback method will be called when the API registers to this mod you can then declare all HUD/Menu elements in that method.
Note before using any class make sure Heartbeat is true. If you try to call a constructor while Heartbeat is false it will lead to a crash.
Editing any class property will update it instantly, there is no longer any network messaging involved with the mod. This also means you have to now worry about thread safety.
The NotePad mod has already been updated with v2 calls if you need to unpack an example.
Modders:
You can change the color of the text with the <color=colorname> tag. No closing tag is required. You can use multiple colors in the same message.
<color=r,g,b> and <color=r,g,b,a> also supported. r = red [0-255] b = blue [0-255] g = green [0-255] a = alpha [0-255]
The Heartbeat property lets you know if the class has recieved a heartbeat, so you can be confident the player has the mod installed. If they do not then you can revert to any previous messaging scheme you had.
V1.2:
Backward compatible with V1.1
EntityMessage and SpaceMessages introduced. Space messages are static messages in 3d space, entity messages are attached to entities. See comments in the new file.
V1.3:
Backward compatible with V1.1 and V1.2
Updated HUDMessage to allow shadowing and automatic hiding when the User hides their HUD.
Small performance increase.
GetLineLength will return the world length of a string of text up to a return or end of string. Feed it one line at a time.
Added IsHUDVisible property that mods can use to determine if the player has his/her HUD visible.
V1.3.1:
All characters added
Fonts cleaned up a bit (less artifiacts)
V1.4.0
Added BillBoardHUDMessage to allow modders to place billboards directly on the HUD.
Added IsInMenu property so modders can easly get if a player is in a menu.
V2.0
See above notes, Backwards compatable with all previous versions.
V2.1
Added BlendTypeEnum Option to all Message Types, use PostPP to avoid post processing messing up your day! Defaults to Standard if new HudAPIv2.cs is not loaded to retain backwards compatability.
V2.5
Texture files eliminated, mod now uses a UV map to generate the font.
Monospace font added
Mod menu added
V2.51
Included some performance improvements.
Modders now can manually flush the cache by calling the Flush() method.
V2.52
Draw() Method added
Performance improvements
V2.53
MenuColorPicker added
Thanks to Digi for pointing me in the right direction to get it working properly with 3rd person.
Localization complete, now supports all characters - Thanks Midspace!
Mod List:
Notes (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=758966734
Easy Inventory (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=646796262
Aerodynamic Physics (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=571920453
Build Vision - http://steamcommunity.com/sharedfiles/filedetails/?id=756792814
Text Projector (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=762397930
Build Hints - http://steamcommunity.com/sharedfiles/filedetails/?id=762950855
Dock Assist (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=764754640
Stargate mod - http://steamcommunity.com/sharedfiles/filedetails/?id=754173702
Wormhole portal - http://steamcommunity.com/sharedfiles/filedetails/?id=377773977
Score Screen (v2) - http://steamcommunity.com/sharedfiles/filedetails/?id=767740490
Automatic Ore Pickup - http://steamcommunity.com/sharedfiles/filedetails/?id=657749341
Hunger and Thirst - http://steamcommunity.com/sharedfiles/filedetails/?id=591816613
Build Information - http://steamcommunity.com/sharedfiles/filedetails/?id=514062285
HudLcd - http://steamcommunity.com/sharedfiles/filedetails/?id=911144486