Class GuiDialogBlockEntity
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
Base class for dialogs bound to block entities.
public abstract class GuiDialogBlockEntity : GuiDialogGeneric, IDisposable
- Inheritance
-
GuiDialogBlockEntity
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
GuiDialogBlockEntity(string, InventoryBase, BlockPos, ICoreClientAPI)
public GuiDialogBlockEntity(string dialogTitle, InventoryBase inventory, BlockPos blockEntityPos, ICoreClientAPI capi)
Parameters
dialogTitle
stringThe title of this dialogue. Ex: "Chest"
inventory
InventoryBaseThe inventory associated with this block entity.
blockEntityPos
BlockPosThe position of this block entity.
capi
ICoreClientAPIThe Client API
GuiDialogBlockEntity(string, BlockPos, ICoreClientAPI)
public GuiDialogBlockEntity(string dialogTitle, BlockPos blockEntityPos, ICoreClientAPI capi)
Parameters
dialogTitle
stringThe title of this dialogue. Ex: "Chest"
blockEntityPos
BlockPosThe position of this block entity.
capi
ICoreClientAPIThe Client API
Properties
BlockEntityPosition
public BlockPos BlockEntityPosition { get; }
Property Value
CloseSound
Gets the opening sound for the dialog being opened, or null if none.
public virtual AssetLocation CloseSound { get; set; }
Property Value
FloatyDialogAlign
Gets the Y align of the dialog if floaty GUIs is turned on. 0.5 means the dialog is centered on FloatyDialogPosition. 0 is top-aligned while 1 is bottom-aligned.
protected virtual double FloatyDialogAlign { get; }
Property Value
FloatyDialogPosition
Gets the Y offset of the dialog in-world if floaty GUIs is turned on. 0.5 is the center of the block and larger means it will float higher up.
protected virtual double FloatyDialogPosition { get; }
Property Value
Inventory
public InventoryBase Inventory { get; }
Property Value
IsDuplicate
public bool IsDuplicate { get; }
Property Value
OpenSound
Gets the opening sound for the dialog being opened, or null if none.
public virtual AssetLocation OpenSound { get; set; }
Property Value
PrefersUngrabbedMouse
Gets whether it is preferred for the mouse to be not grabbed while this dialog is opened. If true (default), the Alt button needs to be held to manually grab the mouse.
public override bool PrefersUngrabbedMouse { get; }
Property Value
Methods
CloseIconPressed()
Occurs whenever the X icon in the top right corner of the GUI (not the window) is pressed.
protected void CloseIconPressed()
DoSendPacket(object)
We tunnel our packet through a block entity packet so the block entity can handle all the network stuff
protected void DoSendPacket(object p)
Parameters
p
object
OnFinalizeFrame(float)
This occurs right before the frame is pushed to the screen.
public override void OnFinalizeFrame(float dt)
Parameters
dt
floatThe time elapsed.
OnGuiClosed()
Called when the GUI is closed.
public override void OnGuiClosed()
OnGuiOpened()
Called whenver the GUI is opened.
public override void OnGuiOpened()
OnNewScrollbarvalue(float)
Called whenever the scrollbar or mouse wheel is used.
protected void OnNewScrollbarvalue(float value)
Parameters
value
floatThe new value of the scrollbar.
OnRenderGUI(float)
Render's the object in Orthographic mode.
public override void OnRenderGUI(float deltaTime)
Parameters
deltaTime
floatThe time elapsed.
ReloadValues()
Reloads the values of the GUI.
public void ReloadValues()
TryOpen()
Attempts to open this gui.
public override bool TryOpen()
Returns
- bool
Whether the attempt was successful.