39 static int ITEM_COLOR_QUICKBAR_NORMAL = 0x0AFFFFFF;
40 static int ITEM_COLOR_QUICKBAR_H_GOOD = 0x2A6e980d;
41 static int ITEM_COLOR_QUICKBAR_H_BAD = 0x2A980d0d;
42 static int ITEM_COLOR_QUICKBAR_I_BAD = 0x2A986e0d;
43 static int ITEM_COLOR_NORMAL = 0x0AFFFFFF;
44 static int ITEM_COLOR_DRAG = 0x0AFFFFFF;
124 m_Controller.OnItemRightClick(
this,
w, 0,
col);
127 m_IsMouseLeftDown =
true;
140 if (m_IsMouseLeftDown)
142 m_Controller.OnItemLeftClick(
this,
w, 0, m_col);
143 m_IsMouseLeftDown =
false;
176 if (m_Controller) m_Controller.OnItemDoubleClick(
this,
w, 0,
col);
204 if (m_ItemWidgets.GetKeyByValueChecked(
w,
index))
206 else if (m_BackgroundWidgets.GetKeyByValueChecked(
w,
index))
214 return m_BackgroundWidgets.GetKeyByValue(
w);
225 for (
int i = 0;
i < m_BackgroundWidgets.Count();
i++)
228 m_BackgroundWidgets.Get(
i).Show(
true);
230 m_BackgroundWidgets.Get(
i).Show(
false);
255 if (m_Controller) m_Controller.
OnItemDrag(
this,
w, 0, m_col);
305 if (m_ItemWidgets.Contains(
index))
306 return m_ItemWidgets.Get(
index);
314 if (m_BackgroundWidgets.Contains(
index))
315 return m_BackgroundWidgets.Get(
index);
327 if (m_Items.Contains(
item))
379 for (
i = 0;
i <
c;
i++)
381 item = m_Items.GetKey(
i);
413 if (m_Items.Contains(
item) ==
false)
447 for (
i = 0;
i <
c;
i++)
449 item = m_Items.GetKey(
i);
479 if (m_Items.Contains(
item) ==
false)
500 for (
i = 0;
i < m_Items.Count();
i++)
502 item = m_Items.GetKey(
i);
516 for (
i = 0;
i < m_Items.Count();
i++)
518 item = m_Items.GetKey(
i);
593 int color = m_Controller.GetItemColor(
this,
item);
615 bck.FindAnyWidget(
"LabelTR").Show(
true);
616 bck.FindAnyWidget(
"LabelCC").Show(
false);
647 bck.FindAnyWidget(
"LabelTR").Show(
true);
648 bck.FindAnyWidget(
"LabelCC").Show(
false);
675 item_w.SetColor(ITEM_COLOR_NORMAL);
681 if (m_Items.Contains(
item))
697 return m_Items.Contains(
item);
714 itemW =
bck.FindAnyWidget(
"GridCell");
717 bck.FindAnyWidget(
"LabelTR").Show(
false);
718 bck.FindAnyWidget(
"LabelCC").Show(
true);
721 m_Items.Remove(
item);
722 m_ItemWidgets.Remove(
index);
override void OnItemDrag(InventoryGrid grid, Widget w, int row, int col)
override bool CanAddItemInHandToInventory()
override int GetItemQuantityMax(InventoryItem item)
override int GetItemCount(InventoryItem item)
override void OnItemDropReceived(InventoryGrid grid, Widget w, int row, int col)
override void OnItemLeave(InventoryGrid grid, Widget w)
override void OnItemEnter(InventoryGrid grid, Widget w, int row, int col)
override int HasItemQuantity(InventoryItem item)
override int GetQuickbarItemColor(InventoryGrid grid, InventoryItem item)
override void OnItemDraggingOver(InventoryGrid grid, Widget w, int row, int col)
override void OnItemDrop(InventoryGrid grid, Widget w, int row, int col)
override float GetItemQuantity(InventoryItem item)
override string GetItemQuantityText(InventoryItem item)
proto native CGame GetGame()
const int QUANTITY_PROGRESS
const int QUANTITY_HIDDEN
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Round(float f)
Returns mathematical round of value.