39 #include "gui/viewport.h"
82 keyName(0).c_str()))),
152 std::stringstream ss(
outfit);
154 STD_VECTOR<int> tokens;
157 tokens.push_back(atoi(buf.c_str()));
159 for (
size_t i = 0, sz = tokens.size();
166 std::stringstream ss2(
outfit);
170 STD_VECTOR<unsigned char> tokens2;
172 tokens2.push_back(
CAST_U8(atoi(buf.c_str())));
174 for (
size_t i = 0, sz = tokens2.size();
193 std::string outfitStr;
194 std::string outfitColorsStr;
200 const int val =
mItems[o][i];
201 const int res = val != 0 ? val : -1;
206 outfitStr.append(
" ");
210 outfitColorsStr.append(
" ");
234 outfitColorsStr.clear();
241 const std::string &eventId =
event.getId();
242 if (eventId ==
"next")
246 else if (eventId ==
"previous")
250 else if (eventId ==
"unequip")
258 else if (eventId ==
"equip")
266 else if (eventId ==
"away")
275 const bool unwearEmpty,
288 if ((item !=
nullptr)
355 bool foundItem =
false;
365 if (image !=
nullptr)
367 graphics->
drawImage(image, itemX, itemY);
376 if (image !=
nullptr)
378 graphics->
drawImage(image, itemX, itemY);
411 bool foundItem =
false;
421 if (image !=
nullptr)
423 graphics->
drawImage(image, itemX, itemY);
432 if (image !=
nullptr)
434 graphics->
drawImage(image, itemX, itemY);
495 else if (index == -1)
574 if (inventory ==
nullptr)
577 const unsigned int invSize = inventory->
getSize();
578 for (
unsigned i = 0; i < invSize; i++)
643 bool fromStart =
false;
667 bool fromStart =
false;
693 if (inventory ==
nullptr)
697 for (
unsigned i = 0, sz = inventory->
getSize(); i < sz; i++)
void setSelected(const bool selected)
std::string getValue(const std::string &key, const std::string &deflt) const
bool getValueBool(const std::string &key, const bool deflt) const
void deleteKey(const std::string &key)
void setValue(const std::string &key, const std::string &value)
void dragItem(const Item *const item, const DragDropSourceT source, const int tag)
ItemColor getSelectedColor() const
bool isSourceItemContainer() const
ItemColor getItemColor() const
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
virtual void fillRectangle(const Rect &rectangle)=0
virtual void setColor(const Color &color)
virtual void drawRectangle(const Rect &rectangle)=0
Item * getItem(const int index) const
Item * findItem(const int itemId, const ItemColor color) const
Equipm isEquipment() const
Equipped isEquipped() const
ItemColor getColor() const
void setAlignment(Graphics::Alignment alignment)
void setCaption(const std::string &caption)
void setRowHeight(const int n, const int h)
void setColWidth(const int n, const int w)
MouseButtonT getButton() const
void wearNextOutfit(const bool all)
static std::string keyName(const int number)
ItemColor mItemColors[OUTFITS_COUNT+1][OUTFIT_ITEM_COUNT]
CheckBox * mAwayOutfitCheck
void action(const ActionEvent &event)
void clearCurrentOutfit()
int mItems[OUTFITS_COUNT+1][OUTFIT_ITEM_COUNT]
void mouseDragged(MouseEvent &event)
void safeDraw(Graphics *const graphics)
void unequipNotInOutfit(const int outfit) const
void wearPreviousOutfit(const bool all)
void wearOutfit(const int outfit, const bool unwearEmpty, const bool select)
void mousePressed(MouseEvent &event)
void mouseReleased(MouseEvent &event)
int getIndexFromGrid(const int pointX, const int pointY) const
std::string getOutfitString() const
void draw(Graphics *const graphics)
bool mItemsUnequip[OUTFITS_COUNT]
void copyOutfit(const int outfit)
bool isPointInRect(const int x_, const int y_) const
void registerWindowForReset(Window *const window)
void safeDraw(Graphics *const graphics)
void mouseReleased(MouseEvent &event)
void setResizable(const bool resize)
void setWindowName(const std::string &name)
void mouseDragged(MouseEvent &event)
unsigned int mTitleBarHeight
void setMinHeight(const int height)
void setMinWidth(const int width)
void mousePressed(MouseEvent &event)
void enableVisibleSound(bool b)
void draw(Graphics *const graphics)
void setCloseButton(const bool flag)
void setStickyButtonLock(const bool sticky)
LayoutCell & place(const int x, const int y, Widget *const wg, const int w, const int h)
Configuration serverConfig
static const int SHORTCUT_EMOTES
const bool Equipped_false
#define fromInt(val, name)
const ItemColor ItemColor_one
bool outfit(InputEvent &event)
std::string toString(T const &value)
converts any type to a string
std::string getNamesStr(const std::vector< int > &parts)
Inventory * getInventory()
void equipItem(const Item *const item, const Sfx sfx)
void unequipItem(const Item *const item, const Sfx sfx)
OutfitWindow * outfitWindow
const unsigned int OUTFITS_COUNT
const unsigned int OUTFIT_ITEM_COUNT
#define BLOCK_START(name)
SetupWindow * setupWindow
std::string strprintf(const char *const format,...)