Class GuiElementItemSlotGridBase
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
A base class for the slot grid. For all your slot grid needs.
public abstract class GuiElementItemSlotGridBase : GuiElement, IDisposable
- Inheritance
-
GuiElementItemSlotGridBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
GuiElementItemSlotGridBase(ICoreClientAPI, IInventory, Action<object>, int, ElementBounds)
Creates a new instance of this class.
public GuiElementItemSlotGridBase(ICoreClientAPI capi, IInventory inventory, Action<object> sendPacket, int columns, ElementBounds bounds)
Parameters
capi
ICoreClientAPIThe client API
inventory
IInventoryThe attached inventory
sendPacket
Action<object>A handler that should send supplied network packet to the server, if the inventory modifications should be synced
columns
intThe number of columns in the GUI.
bounds
ElementBoundsThe bounds of the slot grid.
Fields
CanClickSlot
public CanClickSlotDelegate CanClickSlot
Field Value
DrawIconHandler
public DrawIconDelegate DrawIconHandler
Field Value
KeyboardControlEnabled
public bool KeyboardControlEnabled
Field Value
SendPacketHandler
protected Action<object> SendPacketHandler
Field Value
SlotBounds
public ElementBounds[] SlotBounds
Field Value
cols
protected int cols
Field Value
crossedOutTexture
protected LoadedTexture crossedOutTexture
Field Value
highlightSlotId
protected int highlightSlotId
Field Value
highlightSlotTexture
protected LoadedTexture highlightSlotTexture
Field Value
hoverSlotId
protected int hoverSlotId
Field Value
inventory
protected IInventory inventory
Field Value
prevSlotQuantity
protected int prevSlotQuantity
Field Value
rows
protected int rows
Field Value
scissorBounds
protected ElementBounds[] scissorBounds
Field Value
searchText
protected string searchText
Field Value
slotQuantityTextures
protected LoadedTexture[] slotQuantityTextures
Field Value
slotTexture
protected LoadedTexture slotTexture
Field Value
textComposer
protected GuiElementStaticText textComposer
Field Value
unscaledSlotPadding
public static double unscaledSlotPadding
Field Value
Properties
AlwaysRenderIcon
public bool AlwaysRenderIcon { get; set; }
Property Value
Focusable
Whether or not the element can be focused.
public override bool Focusable { get; }
Property Value
HighlightSlotTexture
public LoadedTexture HighlightSlotTexture { get; }
Property Value
Methods
ComposeElements(Context, ImageSurface)
Composes the elements.
public override void ComposeElements(Context unusedCtx, ImageSurface unusedSurface)
Parameters
unusedCtx
ContextunusedSurface
ImageSurface
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
FilterItemsBySearchText(string, Dictionary<int, string>, Dictionary<int, string>)
Renders only a subset of all available slots filtered by searching given text on the item name/description
public void FilterItemsBySearchText(string text, Dictionary<int, string> searchCache = null, Dictionary<int, string> searchCacheNames = null)
Parameters
text
stringsearchCache
Dictionary<int, string>Can be set to increase search performance, otherwise a slow search is performed
searchCacheNames
Dictionary<int, string>
HighlightSlot(int)
Highlights a specific slot.
public void HighlightSlot(int slotId)
Parameters
slotId
intThe slot to highlight.
OnGuiClosed(ICoreClientAPI)
public void OnGuiClosed(ICoreClientAPI api)
Parameters
api
ICoreClientAPI
OnKeyDown(ICoreClientAPI, KeyEvent)
The event fired when a key is held down.
public override void OnKeyDown(ICoreClientAPI api, KeyEvent args)
Parameters
api
ICoreClientAPIThe client API
args
KeyEventThe key event arguments.
OnMouseDown(ICoreClientAPI, MouseEvent)
The event fired when the mouse is down the element is around. Fires before OnMouseDownOnElement, however OnMouseDownOnElement is called within the base function.
public override void OnMouseDown(ICoreClientAPI api, MouseEvent mouse)
Parameters
api
ICoreClientAPIThe Client API
mouse
MouseEventThe mouse event args.
OnMouseDownOnElement(ICoreClientAPI, MouseEvent)
The event fired when the mouse is pressed while on the element. Called after OnMouseDown and tells the engine that the event is handled.
public override void OnMouseDownOnElement(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API
args
MouseEventThe mouse event args.
OnMouseLeaveSlot(ICoreClientAPI, ItemSlot)
public override bool OnMouseLeaveSlot(ICoreClientAPI api, ItemSlot slot)
Parameters
api
ICoreClientAPIslot
ItemSlot
Returns
OnMouseMove(ICoreClientAPI, MouseEvent)
The event fired when the mouse is moved.
public override void OnMouseMove(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API.
args
MouseEventThe mouse event arguments.
OnMouseUp(ICoreClientAPI, MouseEvent)
The event fired when the mouse is released.
public override void OnMouseUp(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API.
args
MouseEventThe arguments for the mouse event.
OnMouseWheel(ICoreClientAPI, MouseWheelEventArgs)
The event fired when the mouse wheel is scrolled.
public override void OnMouseWheel(ICoreClientAPI api, MouseWheelEventArgs args)
Parameters
api
ICoreClientAPIThe Client API
args
MouseWheelEventArgsThe mouse wheel arguments.
OutlineColor()
The compressed version of the debug outline color as a single int value.
public override int OutlineColor()
Returns
PostRenderInteractiveElements(float)
The post render of the interactive element.
public override void PostRenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.
RemoveSlotHighlight()
Removes the active slot highlight.
public void RemoveSlotHighlight()
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.
SlotClick(ICoreClientAPI, int, EnumMouseButton, bool, bool, bool)
public virtual void SlotClick(ICoreClientAPI api, int slotId, EnumMouseButton mouseButton, bool shiftPressed, bool ctrlPressed, bool altPressed)
Parameters
api
ICoreClientAPIslotId
intmouseButton
EnumMouseButtonshiftPressed
boolctrlPressed
boolaltPressed
bool