Minetest  5.4.0
GUIInventoryList Class Reference

#include <guiInventoryList.h>

+ Inheritance diagram for GUIInventoryList:
+ Collaboration diagram for GUIInventoryList:

Classes

struct  ItemSpec
 
struct  Options
 

Public Member Functions

 GUIInventoryList (gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle, InventoryManager *invmgr, const InventoryLocation &inventoryloc, const std::string &listname, const v2s32 &geom, const s32 start_item_i, const v2s32 &slot_size, const v2f32 &slot_spacing, GUIFormSpecMenu *fs_menu, const Options &options, gui::IGUIFont *font)
 
virtual void draw () override
 
virtual bool OnEvent (const SEvent &event) override
 
const InventoryLocationgetInventoryloc () const
 
const std::string & getListname () const
 
void setSlotBGColors (const video::SColor &slotbg_n, const video::SColor &slotbg_h)
 
void setSlotBorders (bool slotborder, const video::SColor &slotbordercolor)
 
s32 getItemIndexAtPos (v2s32 p) const
 

Private Attributes

InventoryManagerm_invmgr
 
const InventoryLocation m_inventoryloc
 
const std::string m_listname
 
const v2s32 m_geom
 
const s32 m_start_item_i
 
const v2s32 m_slot_size
 
const v2f32 m_slot_spacing
 
GUIFormSpecMenum_fs_menu
 
Options m_options
 
gui::IGUIFont * m_font
 
s32 m_hovered_i
 
bool m_already_warned
 

Constructor & Destructor Documentation

◆ GUIInventoryList()

GUIInventoryList::GUIInventoryList ( gui::IGUIEnvironment *  env,
gui::IGUIElement *  parent,
s32  id,
const core::rect< s32 > &  rectangle,
InventoryManager invmgr,
const InventoryLocation inventoryloc,
const std::string &  listname,
const v2s32 geom,
const s32  start_item_i,
const v2s32 slot_size,
const v2f32 slot_spacing,
GUIFormSpecMenu fs_menu,
const Options options,
gui::IGUIFont *  font 
)

Member Function Documentation

◆ draw()

◆ getInventoryloc()

const InventoryLocation& GUIInventoryList::getInventoryloc ( ) const
inline

References m_inventoryloc.

Referenced by GUIFormSpecMenu::parseListRing().

+ Here is the caller graph for this function:

◆ getItemIndexAtPos()

s32 GUIInventoryList::getItemIndexAtPos ( v2s32  p) const

References InventoryManager::getInventory(), Inventory::getList(), InventoryList::getSize(), m_geom, m_inventoryloc, m_invmgr, m_listname, m_slot_size, m_slot_spacing, m_start_item_i, and p().

Referenced by OnEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getListname()

const std::string& GUIInventoryList::getListname ( ) const
inline

References m_listname.

Referenced by GUIFormSpecMenu::parseListRing().

+ Here is the caller graph for this function:

◆ OnEvent()

bool GUIInventoryList::OnEvent ( const SEvent &  event)
overridevirtual

References getItemIndexAtPos(), m_fs_menu, m_hovered_i, and GUIFormSpecMenu::OnEvent().

+ Here is the call graph for this function:

◆ setSlotBGColors()

void GUIInventoryList::setSlotBGColors ( const video::SColor &  slotbg_n,
const video::SColor &  slotbg_h 
)
inline

◆ setSlotBorders()

void GUIInventoryList::setSlotBorders ( bool  slotborder,
const video::SColor &  slotbordercolor 
)
inline

Member Data Documentation

◆ m_already_warned

bool GUIInventoryList::m_already_warned
private

Referenced by draw().

◆ m_font

gui::IGUIFont* GUIInventoryList::m_font
private

Referenced by draw().

◆ m_fs_menu

GUIFormSpecMenu* GUIInventoryList::m_fs_menu
private

Referenced by draw(), and OnEvent().

◆ m_geom

const v2s32 GUIInventoryList::m_geom
private

Referenced by draw(), and getItemIndexAtPos().

◆ m_hovered_i

s32 GUIInventoryList::m_hovered_i
private

Referenced by draw(), and OnEvent().

◆ m_inventoryloc

const InventoryLocation GUIInventoryList::m_inventoryloc
private

◆ m_invmgr

InventoryManager* GUIInventoryList::m_invmgr
private

Referenced by draw(), and getItemIndexAtPos().

◆ m_listname

const std::string GUIInventoryList::m_listname
private

◆ m_options

Options GUIInventoryList::m_options
private

◆ m_slot_size

const v2s32 GUIInventoryList::m_slot_size
private

Referenced by draw(), and getItemIndexAtPos().

◆ m_slot_spacing

const v2f32 GUIInventoryList::m_slot_spacing
private

Referenced by draw(), and getItemIndexAtPos().

◆ m_start_item_i

const s32 GUIInventoryList::m_start_item_i
private

Referenced by draw(), and getItemIndexAtPos().


The documentation for this class was generated from the following files: