Client API Tour
Intended scope
Section titled “Intended scope”One short section per subsystem, covering purpose + minimal usage snippet:
- Commands —
CommandRegistry.Register(modId, ICommand);modId.commandnameinvocation; aliases. - Input —
InputRegistry.Register(InputBindingDefinition); user rebinds viabindings.json; poll or subscribe. - Config —
ClientConfig.For(modId)JSON store at%APPDATA%/Anomaly/<modId>/config.json; hot-reload viaIConfigSource.KeyChanged. - Persistence —
ClientPersistence.For(modId)JSON store at%APPDATA%/Anomaly/<modId>/data.json; debounced writes;Flush()when you need sync-to-disk. - Scheduling —
Scheduler.In,Scheduler.Every,Scheduler.StartCooldown; unscaled delta time; auto-clear on disconnect. - Events — all 14 handler classes under
Anomaly.Client.Api.Events.Handlers:ClientEvents,PlayerEvents,RoleEvents,StatsEvents,EffectEvents,InventoryEvents,PickupEvents,ProjectileEvents,FirearmEvents,AdminToyEvents,RoundEvents,VoiceEvents,NetworkMessageEvents,FileTransferEvents,AssetEvents. No replay-on-subscribe — subscribe inOnInitializeMelon. - Features — read-only wrappers:
Client.Players,Client.LocalPlayer,Client.Rooms,Client.Doors, etc. - UI —
UiCanvas.GetLayer(UiLayer.HUD)etc., with Z-ordered layersBackground/World/HUD/Overlay/Modal/Debug. - Localization —
Tr.RegisterMod(ns, dir),Tr.Get(key, args...); link to chapter 7. - Assets —
AnomalyResources.TryGetTexture(hash),TryLoadFromBundle<T>.
Sources
Section titled “Sources”E:\Projects\AnomalyLabs\Anomaly\Anomaly.Client.Api\MODDING.md— “Subsystems” and “Events” tables.Anomaly.Client.Api\Commands\,Input\,Config\,Persistence\,Scheduling\,Events\Handlers\,Features\,UI\,Localization\,Assets\— directories to mine for per-section detail.