Table of Contents

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

Constructors

GuiDialogBlockEntity(string, InventoryBase, BlockPos, ICoreClientAPI)

public GuiDialogBlockEntity(string dialogTitle, InventoryBase inventory, BlockPos blockEntityPos, ICoreClientAPI capi)

Parameters

dialogTitle string

The title of this dialogue. Ex: "Chest"

inventory InventoryBase

The inventory associated with this block entity.

blockEntityPos BlockPos

The position of this block entity.

capi ICoreClientAPI

The Client API

GuiDialogBlockEntity(string, BlockPos, ICoreClientAPI)

public GuiDialogBlockEntity(string dialogTitle, BlockPos blockEntityPos, ICoreClientAPI capi)

Parameters

dialogTitle string

The title of this dialogue. Ex: "Chest"

blockEntityPos BlockPos

The position of this block entity.

capi ICoreClientAPI

The Client API

Properties

BlockEntityPosition

public BlockPos BlockEntityPosition { get; }

Property Value

BlockPos

CloseSound

Gets the opening sound for the dialog being opened, or null if none.

public virtual AssetLocation CloseSound { get; set; }

Property Value

AssetLocation

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

double

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

double

Inventory

public InventoryBase Inventory { get; }

Property Value

InventoryBase

IsDuplicate

public bool IsDuplicate { get; }

Property Value

bool

OpenSound

Gets the opening sound for the dialog being opened, or null if none.

public virtual AssetLocation OpenSound { get; set; }

Property Value

AssetLocation

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

bool

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

FreePos(string, EnumPosFlag)

public void FreePos(string code, GuiDialogBlockEntity.EnumPosFlag pos)

Parameters

code string
pos GuiDialogBlockEntity.EnumPosFlag

GetFreePos(string)

public GuiDialogBlockEntity.EnumPosFlag GetFreePos(string code)

Parameters

code string

Returns

GuiDialogBlockEntity.EnumPosFlag

IsRight(EnumPosFlag)

protected bool IsRight(GuiDialogBlockEntity.EnumPosFlag flag)

Parameters

flag GuiDialogBlockEntity.EnumPosFlag

Returns

bool

OccupyPos(string, EnumPosFlag)

public void OccupyPos(string code, GuiDialogBlockEntity.EnumPosFlag pos)

Parameters

code string
pos GuiDialogBlockEntity.EnumPosFlag

OnFinalizeFrame(float)

This occurs right before the frame is pushed to the screen.

public override void OnFinalizeFrame(float dt)

Parameters

dt float

The 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 float

The new value of the scrollbar.

OnRenderGUI(float)

Render's the object in Orthographic mode.

public override void OnRenderGUI(float deltaTime)

Parameters

deltaTime float

The 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.

YOffsetMul(EnumPosFlag)

protected float YOffsetMul(GuiDialogBlockEntity.EnumPosFlag flag)

Parameters

flag GuiDialogBlockEntity.EnumPosFlag

Returns

float