35 #include "gui/viewport.h"
59 const unsigned number) :
61 mEquipedColor(getThemeColor(
ThemeColorId::ITEM_EQUIPPED, 255U)),
62 mEquipedColor2(getThemeColor(
ThemeColorId::ITEM_EQUIPPED_OUTLINE, 255U)),
63 mUnEquipedColor(getThemeColor(
ThemeColorId::ITEM_NOT_EQUIPPED, 255U)),
64 mUnEquipedColor2(getThemeColor(
ThemeColorId::ITEM_NOT_EQUIPPED_OUTLINE,
100 if (selShortcut ==
nullptr)
139 const int itemId = selShortcut->
getItem(i);
148 const Item *
const item = inv->
findItem(itemId, itemColor);
153 if (image !=
nullptr)
161 image->setAlpha(1.0F);
190 if (spell !=
nullptr)
196 if (image !=
nullptr)
198 image->setAlpha(1.0F);
217 if (
skill !=
nullptr)
221 if (image !=
nullptr)
223 image->setAlpha(1.0F);
228 if (!
skill->data->haveIcon)
233 skill->data->shortName,
247 if (selShortcut ==
nullptr)
286 const int itemId = selShortcut->
getItem(i);
295 const Item *
const item = inv->
findItem(itemId, itemColor);
300 if (image !=
nullptr)
308 image->setAlpha(1.0F);
337 if (spell !=
nullptr)
343 if (image !=
nullptr)
345 image->setAlpha(1.0F);
364 if (
skill !=
nullptr)
368 if (image !=
nullptr)
370 image->setAlpha(1.0F);
375 if (!
skill->data->haveIcon)
380 skill->data->shortName,
395 if (selShortcut ==
nullptr)
408 const int itemId = selShortcut->
getItem(index);
443 if (spell !=
nullptr)
464 if (
skill !=
nullptr)
466 const std::string itemData = selShortcut->
getItemData(
488 if (selShortcut ==
nullptr)
510 else if (selShortcut->
getItem(index) != 0)
532 if (selShortcut ==
nullptr)
556 selShortcut->
swap(oldIndex, index);
576 if (selShortcut ==
nullptr)
584 const int itemId = selShortcut->
getItem(index);
599 const Item *
const item = inv->
findItem(itemId, itemColor);
600 if ((item !=
nullptr) && (
viewport !=
nullptr))
615 if ((spell !=
nullptr) && (
viewport !=
nullptr))
631 if (
skill ==
nullptr)
640 STD_VECTOR<int> vect;
642 const size_t sz = vect.size();
644 castType =
static_cast<CastTypeT>(vect[0]);
652 toInt(itemColor,
int),
void dragItem(const Item *const item, const DragDropSourceT source, const int tag)
DragDropSourceT getSource() const
void setItem(const int item)
void dragCommand(const TextCommand *const command, const DragDropSourceT source, const int tag)
std::string getItemData()
void dragSkill(const SkillInfo *const info, const DragDropSourceT source, const int tag)
void setItemColor(const ItemColor color)
ItemColor getItemColor() const
void setItemData(const std::string &data)
int getWidth(const std::string &text) const
void drawString(Graphics *const graphics, Color col, const Color &col2, const std::string &text, const int x, const int y)
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
Item * findItem(const int itemId, const ItemColor color) const
void mouseDragged(MouseEvent &event)
void draw(Graphics *const graphics)
void setSkin(const Widget2 *const widget, Skin *const skin)
void mouseExited(MouseEvent &event)
void safeDraw(Graphics *const graphics)
ItemShortcutContainer(Widget2 *const widget, const unsigned number)
void mousePressed(MouseEvent &event)
void mouseReleased(MouseEvent &event)
void mouseMoved(MouseEvent &event)
void widgetHidden(const Event &event)
int getSelectedItem() const
ItemColor getItemColor(const size_t index) const
void setItemSelected(const int itemId)
void setItemData(const size_t index, const std::string &data)
int getItem(const size_t index) const
static int getItemCount()
bool isItemSelected() const
void removeItem(const size_t index)
void swap(const size_t index1, const size_t index2)
void setItem(const size_t index)
void useItem(const size_t index) const
std::string getItemData(const size_t index) const
Equipped isEquipped() const
MouseButtonT getButton() const
virtual void setSkin(const Widget2 *const widget, Skin *const skin)
void drawBackground(Graphics *const g)
void safeDrawBackground(Graphics *const g)
int getIndexFromGrid(const int pointX, const int pointY) const
SkillInfo * getSkill(const int id) const
SkillInfo * getSkillByItem(const int itemId) const
int getOption(const std::string &name) const
const TextCommand * getSpellByItem(const int itemId) const
void setItemSelected(const int itemId)
std::string getSymbol() const
bool isWindowVisible() const
const size_t SHORTCUT_AUTO_TAB
InventoryWindow * inventoryWindow
ItemShortcut * itemShortcut[SHORTCUT_TABS]
bool skill(InputEvent &event)
std::string toString(T const &value)
converts any type to a string
Inventory * getInventory()
#define BLOCK_START(name)
SkillDialog * skillDialog
SpellManager * spellManager
SpellShortcut * spellShortcut
void splitToIntVector(std::vector< int > &tokens, const std::string &text, const char separator)