s&box docs
API ReferenceSandbox.Engine

public class Sandbox.Engine.BindCollection

A collection of action binds. BindCollection - Action: attack1 - Slot0: mouse1 - Action: selectall - Slot0: ctrl + a The bind collection can be saved and loaded from disk via the BindSaveConfig class. The bind collection can have a base collection which it will fall back to if it contains the same binds. This allows us to have a "common" collection which can be shared between all games, but can also let the games + users to override those binds if they choose.

Constructors

Showing 1 constructors

public BindCollection(string name)

Creates a collection and tries to load it from disk.

Methods

Showing 4 methods

public string Get(string actionName, int slot)

Get the bind value at this slot

public Sandbox.Engine.BindCollection.ActionBind GetBind(string actionName, bool create = True)

Get the bind, create if it doesn't exist

Parameters

  • create: Default: True

public void SaveToDisk()

Save the collection to disk

public Sandbox.Engine.BindCollection.ActionBind Set(string actionName, int slot, string buttonName)

Set the bind value for this action. This will overwrite what's in this slot.

Properties

Showing 3 properties

public Sandbox.Engine.BindCollection Sandbox.Engine.BindCollection.Base { get; set; }

The base collection. Game binds have this set to the common binds.

public string Sandbox.Engine.BindCollection.CollectionName { get; set; }

Will be either "common" or the ident of the current game.

public string Sandbox.Engine.BindCollection.ConfigPath { get; set; }

The location of the config file to load from in EngineFileSystem.Config

Metadata

FieldValue
NamespaceSandbox.Engine
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Engine.BindCollection

On this page