DayZ Enforce
Script API
Private Member Functions | Private Attributes | Static Private Attributes | List of all members
InventoryGrid Class Reference

map: item x vector(index, width, height) More...

#include <WidgetScripts.h>

Inheritance diagram for InventoryGrid:
ScriptedWidgetEventHandler InventoryGridIcon

Private Member Functions

void  InventoryGrid ()
 
protected void  OnWidgetScriptInit (Widget w)
 
protected void  ShowBackground (int row, int col, int w, int h, bool visible)
 
protected void  UpdateLayout ()
 
protected void  ResetItemWidget (Widget item_w, int width, int height)
 
bool  OnUpdate (Widget w)
 
bool  OnChildAdd (Widget w, Widget child)
 
bool  OnChildRemove (Widget w, Widget child)
 
bool  OnMouseEnter (Widget w, int x, int y)
 
bool  OnMouseLeave (Widget w, Widget enterW, int x, int y)
 
bool  OnMouseButtonDown (Widget w, int x, int y, int button)
 
bool  OnDoubleClick (Widget w, int x, int y, int button)
 
bool  OnDrag (Widget w, int x, int y)
 
bool  OnDraggingOver (Widget w, int x, int y, Widget reciever)
 
bool  OnDrop (Widget w, int x, int y, Widget reciever)
 
bool  OnDropReceived (Widget w, int x, int y, Widget reciever)
 
int  GetCol (float x)
  Gets column from screen position. More...
 
int  GetRow (float y)
  Gets row from screen position. More...
 
int  GetIndex (int row, int col)
 
TItemsMap  GetItems ()
 
bool  IsIcon ()
 
bool  IsValidPos (int row, int col)
 
Widget  GetItem (int index)
 
Widget  GetItemAt (int row, int col)
 
Widget  GetItemBackground (int index)
 
Widget  GetItemBackgroundAt (int row, int col)
 
Widget  GetRoot ()
 
void  SetItemColor (InventoryItem item, int color)
 
void  SetItemSize (InventoryItem item, int pixels_w, int pixels_h)
  Set size in pixels. More...
 
void  SetController (InventoryGridController controller)
 
InventoryGridController  GetController ()
 
void  GenerateBackgroundTiles (int count)
 
void  GenerateQuickBarBackgroundTiles (int count)
 
void  UpdateItems (TItemsMap items, bool show_quantity, bool show_temperature)
 
void  UpdateQuickbarItems (TItemsMap items)
 
void  UpdateQuantityItems ()
 
void  RefreshItemVariables (InventoryItem item, vector data, bool show_quantity, bool show_temperature)
 
void  RefreshQuickbarItemVariables (InventoryItem item, vector data)
 
void  SetQuantityPanelSize (int size)
 
void  AddItem (InventoryItem item, vector data, vector rotation)
 
void  RemoveItem (InventoryItem item)
 
void  ResetItem (InventoryItem item)
 
bool  HasItem (InventoryItem item)
 
void  SetGridSize (int items_horizontal, int items_vertical)
 
void  SetGridItemsSize (int item_size_width, int item_size_height)
 
int  GetGridItemsHeight ()
 
void  SetGridGapSize (int gap_size)
 

Private Attributes

protected reference int  Border
 
protected reference int  Gap
 
protected reference int  ItemSizeWidth
 
protected reference int  ItemSizeHeight
 
protected reference int  ItemsHorizontal
 
protected reference int  ItemsVertical
 
reference bool  DebugOutput
 
protected float  m_screen_x
 
protected float  m_screen_y
 
protected autoptr TItemsMap  m_items
 
protected InventoryGridController  m_controller
 
protected Widget  m_root
 
protected int  m_count
 
protected int  m_quantity_panel_size
 

Static Private Attributes

static int  ITEM_COLOR_QUICKBAR_NORMAL = 0x7F858585
 
static int  ITEM_COLOR_QUICKBAR_GOOD = 0xFF6e980d
 
static int  ITEM_COLOR_NORMAL = 0xFF999999
 
static int  ITEM_COLOR_DRAG = 0xFFB7FFFC
 
static int  ITEM_COLOR_GOOD = 0xFF6DFFB3
 
static int  ITEM_COLOR_SWAP = 0xFF66C1FF
 
static int  ITEM_COLOR_MULTIPLE = 0xFFFF884C
 
static int  ITEM_COLOR_WRONG = 0xFFFF635B
 

Detailed Description

map: item x vector(index, width, height)

Constructor & Destructor Documentation

void InventoryGrid::InventoryGrid ( )
private

References m_items.

Member Function Documentation

void InventoryGrid::OnWidgetScriptInit ( Widget  w )
private
void InventoryGrid::ShowBackground ( int  row,
int  col,
int  w,
int  h,
bool  visible 
)
private

References GetItemAt(), and Widget::Show().

Referenced by AddItem(), and RemoveItem().

void InventoryGrid::UpdateLayout ( )
private
void InventoryGrid::ResetItemWidget ( Widget  item_w,
int  width,
int  height 
)
private
bool InventoryGrid::OnUpdate ( Widget  w )
private
bool InventoryGrid::OnChildAdd ( Widget  w,
Widget  child 
)
private
bool InventoryGrid::OnChildRemove ( Widget  w,
Widget  child 
)
private

References m_count, and m_root.

bool InventoryGrid::OnMouseEnter ( Widget  w,
int  x,
int  y 
)
private
bool InventoryGrid::OnMouseLeave ( Widget  w,
Widget  enterW,
int  x,
int  y 
)
private
bool InventoryGrid::OnMouseButtonDown ( Widget  w,
int  x,
int  y,
int  button 
)
private
bool InventoryGrid::OnDoubleClick ( Widget  w,
int  x,
int  y,
int  button 
)
private
bool InventoryGrid::OnDrag ( Widget  w,
int  x,
int  y 
)
private
bool InventoryGrid::OnDraggingOver ( Widget  w,
int  x,
int  y,
Widget  reciever 
)
private
bool InventoryGrid::OnDrop ( Widget  w,
int  x,
int  y,
Widget  reciever 
)
private
bool InventoryGrid::OnDropReceived ( Widget  w,
int  x,
int  y,
Widget  reciever 
)
private
int InventoryGrid::GetCol ( float  x )
private

Gets column from screen position.

References Border, Gap, ItemSizeWidth, and m_screen_x.

Referenced by OnDoubleClick(), OnDrag(), OnDraggingOver(), OnDropReceived(), OnMouseButtonDown(), and OnMouseEnter().

int InventoryGrid::GetRow ( float  y )
private

Gets row from screen position.

References Border, Gap, ItemSizeHeight, and m_screen_y.

Referenced by OnDoubleClick(), OnDrag(), OnDraggingOver(), OnDropReceived(), OnMouseButtonDown(), and OnMouseEnter().

int InventoryGrid::GetIndex ( int  row,
int  col 
)
private
TItemsMap InventoryGrid::GetItems ( )
private
bool InventoryGrid::IsIcon ( )
private
bool InventoryGrid::IsValidPos ( int  row,
int  col 
)
private
Widget InventoryGrid::GetItem ( int  index )
private
Widget InventoryGrid::GetItemAt ( int  row,
int  col 
)
private

References GetIndex(), and GetItem().

Referenced by ShowBackground().

Widget InventoryGrid::GetItemBackground ( int  index )
private
Widget InventoryGrid::GetItemBackgroundAt ( int  row,
int  col 
)
private

References GetIndex(), and GetItemBackground().

Widget InventoryGrid::GetRoot ( )
private
void InventoryGrid::SetItemColor ( InventoryItem  item,
int  color 
)
private
void InventoryGrid::SetItemSize ( InventoryItem  item,
int  pixels_w,
int  pixels_h 
)
private

Set size in pixels.

References GetItemBackground(), m_items, round(), and Widget::SetSize().

Referenced by InventoryManager::SetItemSize().

void InventoryGrid::SetController ( InventoryGridController  controller )
private
InventoryGridController InventoryGrid::GetController ( )
private
void InventoryGrid::GenerateBackgroundTiles ( int  count )
private
void InventoryGrid::GenerateQuickBarBackgroundTiles ( int  count )
private
void InventoryGrid::UpdateItems ( TItemsMap  items,
bool  show_quantity,
bool  show_temperature 
)
private
void InventoryGrid::UpdateQuickbarItems ( TItemsMap  items )
private
void InventoryGrid::UpdateQuantityItems ( )
private
void InventoryGrid::RefreshItemVariables ( InventoryItem  item,
vector  data,
bool  show_quantity,
bool  show_temperature 
)
private
void InventoryGrid::RefreshQuickbarItemVariables ( InventoryItem  item,
vector  data 
)
private
void InventoryGrid::SetQuantityPanelSize ( int  size )
private
void InventoryGrid::AddItem ( InventoryItem  item,
vector  data,
vector  rotation 
)
private
void InventoryGrid::RemoveItem ( InventoryItem  item )
private
void InventoryGrid::ResetItem ( InventoryItem  item )
private
bool InventoryGrid::HasItem ( InventoryItem  item )
private
void InventoryGrid::SetGridSize ( int  items_horizontal,
int  items_vertical 
)
private
void InventoryGrid::SetGridItemsSize ( int  item_size_width,
int  item_size_height 
)
private
int InventoryGrid::GetGridItemsHeight ( )
private

References ItemSizeHeight.

void InventoryGrid::SetGridGapSize ( int  gap_size )
private

Member Data Documentation

int InventoryGrid::ITEM_COLOR_QUICKBAR_NORMAL = 0x7F858585
staticprivate
int InventoryGrid::ITEM_COLOR_QUICKBAR_GOOD = 0xFF6e980d
staticprivate
int InventoryGrid::ITEM_COLOR_NORMAL = 0xFF999999
staticprivate
int InventoryGrid::ITEM_COLOR_DRAG = 0xFFB7FFFC
staticprivate
int InventoryGrid::ITEM_COLOR_GOOD = 0xFF6DFFB3
staticprivate
int InventoryGrid::ITEM_COLOR_SWAP = 0xFF66C1FF
staticprivate
int InventoryGrid::ITEM_COLOR_MULTIPLE = 0xFFFF884C
staticprivate
int InventoryGrid::ITEM_COLOR_WRONG = 0xFFFF635B
staticprivate
protected reference int InventoryGrid::Border
private

Referenced by GetCol(), GetRow(), and UpdateLayout().

protected reference int InventoryGrid::Gap
private
protected reference int InventoryGrid::ItemSizeWidth
private
protected reference int InventoryGrid::ItemSizeHeight
private
protected reference int InventoryGrid::ItemsHorizontal
private
protected reference int InventoryGrid::ItemsVertical
private
reference bool InventoryGrid::DebugOutput
private
protected float InventoryGrid::m_screen_x
private

Referenced by GetCol(), OnUpdate(), and UpdateLayout().

protected float InventoryGrid::m_screen_y
private

Referenced by GetRow(), OnUpdate(), and UpdateLayout().

protected autoptr TItemsMap InventoryGrid::m_items
private
protected InventoryGridController InventoryGrid::m_controller
private
protected Widget InventoryGrid::m_root
private
protected int InventoryGrid::m_count
private
protected int InventoryGrid::m_quantity_panel_size
private

Referenced by AddItem(), and SetQuantityPanelSize().


The documentation for this class was generated from the following files:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)