35 #include "gui/viewport.h"
49 #include "resources/map/map.h"
59 ListBox(widget, model,
"avatarlistbox.xml"),
60 mImagePadding(mSkin !=
nullptr ? mSkin->getOption(
"imagePadding") : 0),
61 mShowGender(
config.getBoolValue(
"showgender")),
62 mShowLevel(
config.getBoolValue(
"showlevel"))
113 if (parent ==
nullptr)
121 const int fontHeight = font->
getHeight();
122 const int parentWidth = parent->
getWidth();
128 for (
int i = 0,
y = 0;
130 ++i,
y += fontHeight)
154 for (
int i = 0,
y = 0;
156 ++i,
y += fontHeight)
185 themeColor,
static_cast<float>(a->
getHp())
186 /
static_cast<float>(a->
getMaxHp()));
219 int minHp = 40 + ((a->
getLevel() - 1) * 5);
223 graphics->
drawLine(parentWidth * minHp / 1024
225 parentWidth * minHp / 1024,
y + fontHeight);
261 text.append(
" \u2640 ");
264 text.append(
" \u2642 ");
356 if (parent ==
nullptr)
364 const int fontHeight = font->
getHeight();
365 const int parentWidth = parent->
getWidth();
370 for (
int i = 0,
y = 0;
372 ++i,
y += fontHeight)
390 for (
int i = 0,
y = 0;
392 ++i,
y += fontHeight)
421 themeColor,
static_cast<float>(a->
getHp())
422 /
static_cast<float>(a->
getMaxHp()));
455 int minHp = 40 + ((a->
getLevel() - 1) * 5);
459 graphics->
drawLine(parentWidth * minHp / 1024
461 parentWidth * minHp / 1024,
y + fontHeight);
497 text.append(
" \u2640 ");
500 text.append(
" \u2642 ");
595 const int y = (
event.getY() -
mPadding) / height;
604 if (model ==
nullptr)
622 if (being !=
nullptr)
638 if (avatar !=
nullptr)
642 if (being !=
nullptr)
702 if ((map !=
nullptr) && (ava !=
nullptr))
733 if (value ==
"showgender")
735 else if (value ==
"showlevel")
ActorManager * actorManager
void heal(const Being *const target) const
Being * findBeingByName(const std::string &name, const ActorTypeT type) const
AvatarListBox(const Widget2 *const widget, AvatarListModel *const model)
static Image * offlineIcon
void mousePressed(MouseEvent &event)
void draw(Graphics *gcnGraphics)
void safeDraw(Graphics *gcnGraphics)
static Image * onlineIcon
void mouseReleased(MouseEvent &event)
void optionChanged(const std::string &value)
virtual Avatar * getAvatarAt(const int i)=0
std::string getMap() const
virtual std::string getAdditionString() const
std::string getComplexName() const
bool getDisplayBold() const
GenderT getGender() const
std::string getName() const
const std::string & getName() const
WhisperTab * addWhisperTab(const std::string &caption, const std::string &nick, const bool switchTo)
bool getBoolValue(const std::string &key) const
void addListener(const std::string &key, ConfigListener *const listener)
void removeListeners(ConfigListener *const listener)
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
virtual void drawTileCollection(const ImageCollection *const vertCol)=0
virtual void fillRectangle(const Rect &rectangle)=0
virtual void calcTileCollection(ImageCollection *const vertCol, const Image *const image, int x, int y)=0
virtual void setColor(const Color &color)
virtual void finalize(ImageCollection *const col)
virtual void drawLine(int x1, int y1, int x2, int y2)=0
void setSelected(const int selected)
virtual int getNumberOfElements()=0
bool navigateTo(const int x, const int y)
MapItem * findPortalXY(const int x, const int y) const
static Image * getImageFromThemeXml(const std::string &name, const std::string &name2)
static Color getProgressColor(const ProgressColorIdT type, const float progress)
LocalPlayer * localPlayer
#define BLOCK_START(name)
ProgressColorId ::T ProgressColorIdT
std::string strprintf(const char *const format,...)