atl/sm/gui
import "atl/sm/gui"GUI helpers (sm.gui): chat, alerts, interaction text, the game's built-in GUIs, and HUD, text and fade helpers. GUIs themselves are sm.Gui.
Functions
Section titled "Functions"func Chat(message string)Posts a chat message.
func Alert(text string, seconds float64, queued bool)Shows centered alert text for seconds, optionally after any queued alerts.
func KeyBinding(action string, colored bool) stringThe key bound to an input action (e.g. "Use"), formatted for interaction text.
func Interaction(action, label string)Sets the interaction text: "[key] label", e.g. gui.Interaction("Use", "Toggle").
func SetInteractionText(text1, binding1, text2, binding2, text3 string)Sets the interaction text from raw parts (sm.gui.setInteractionText).
func CreateAmmunitionContainerGui(destroyOnClose bool) sm.Guifunc CreateBatteryContainerGui(destroyOnClose bool) sm.Guifunc CreateChallengeHUDGui(destroyOnClose bool) sm.Guifunc CreateChallengeMessageGui(destroyOnClose bool) sm.Guifunc CreateCharacterCustomizationGui(destroyOnClose bool) sm.Guifunc CreateChemicalContainerGui(destroyOnClose bool) sm.Guifunc CreateCompassHudGui(destroyOnClose bool) sm.Guifunc CreateContainerGui(destroyOnClose bool) sm.Guifunc CreateCraftBotGui(destroyOnClose bool) sm.Guifunc CreateDressBotGui(destroyOnClose bool) sm.Guifunc CreateEngineGui(destroyOnClose bool) sm.Guifunc CreateFertilizerContainerGui(destroyOnClose bool) sm.Guifunc CreateGasContainerGui(destroyOnClose bool) sm.Guifunc CreateGlowstickContainerGui(destroyOnClose bool) sm.Guifunc CreateHideoutGui(destroyOnClose bool) sm.Guifunc CreateLogbookGui(destroyOnClose bool) sm.Guifunc CreateMechanicStationGui(destroyOnClose bool) sm.Guifunc CreateMininghubDispenserGui(destroyOnClose bool) sm.Guifunc CreateNameTagGui(destroyOnClose bool) sm.Guifunc CreateOreCrusherContainerGui(destroyOnClose bool) sm.Guifunc CreatePortableCrafterGui(destroyOnClose bool) sm.Guifunc CreateProspectorContainerGui(destroyOnClose bool) sm.Guifunc CreateQuestTrackerGui(destroyOnClose bool) sm.Guifunc CreateRefineryContainerGui(destroyOnClose bool) sm.Guifunc CreateSawbotGui(destroyOnClose bool) sm.Guifunc CreateSeatGui(destroyOnClose bool) sm.Guifunc CreateSeatUpgradeGui(destroyOnClose bool) sm.Guifunc CreateSeedContainerGui(destroyOnClose bool) sm.Guifunc CreateSteeringBearingGui(destroyOnClose bool) sm.Guifunc CreateSurvivalHudGui(destroyOnClose bool) sm.Guifunc CreateWaterContainerGui(destroyOnClose bool) sm.Guifunc CreateWorkbenchGui(destroyOnClose bool) sm.GuiThe game's built-in GUIs, e.g. gui.CreateContainerGui(). All [client]. Each creates the GUI its name says, tracked like sm.GuiFromLayout.
func CurrentLanguage() string[client] The game's language.
func Translate(text string) string[client] Replaces "#{TAG}" localization tags with the current language's text.
func TicksToTimeString(ticks int) stringFormats ticks as "HH:MM:SS".
func HasActiveGui() bool[client] True while any GUI is open.
func HideGui(hide bool)func HideHotbar(hide bool)[client] Hides or shows the whole HUD / the hotbar.
func BlockInGameMenu(block bool)[client] Blocks the in-game menu.
func SetProgressFraction(fraction float64)[client] Fills the circle around the crosshair, 0..1.
func SetCharacterDebugText(c sm.Character, text string, clear bool)[client] Dev mode: shows text above a character's head.
func OnDisplayMessage(fn func(args atl.Value))[client] Called for generic notification popups (engine-defined arguments).
func StartFadeToBlack(duration, timeout float64)[client] Fades the screen to black.
func StartFadeToBlackWaitForWorld(duration, timeout float64)[client] Fades out, waits for the world to load, fades back in.
func EndFadeToBlack(duration float64, force bool)[client] Fades back in from black.
func ExitToMenu()[client] Leaves to the main menu.
func OpenGarageImportGui()[client] Opens the garage creation import GUI.
func SetGarageImportGuiStorage(c sm.Container)[client] Sets the container the garage import GUI uses.
func OnGarageButton(fn func(args atl.Value))[client] Called when a garage import button is pressed (engine-defined arguments).
func OnGarageError(fn func(args atl.Value))[client] Called when a garage import fails (engine-defined arguments).
type Size struct { Width, Height float64}[client] A size in pixels or 720p GUI units.
func ScreenSize() Size[client] The screen size in pixels.
func ComputeTextSize(text, font, align string, maxWidth *float64, replaceTags bool) Size[client] The size (in 720p GUI units) needed to show text in font.
ItemIcon
Section titled "ItemIcon"type ItemIcon struct { Resource, Group, Name string}What sm.Gui.SetItemIcon needs to show an item.
func ItemIconOf(item sm.Uuid) ItemIconLooks up an item's icon.