72 "hpprogressbar.xml",
"hpprogressbar_fill.xml",
74 "hp bar",
_(
"health bar"))),
80 ?
"mpprogressbar.xml" :
"nompprogressbar.xml",
82 ?
"mpprogressbar_fill.xml" :
"nompprogressbar_fill.xml",
84 "mp bar",
_(
"mana bar"))),
85 mXpBar(createBar(0, 100, 0,
87 "xpprogressbar.xml",
"xpprogressbar_fill.xml",
89 "xp bar",
_(
"experience bar"))),
91 mWeightBar(createBar(0, 140, 0,
ThemeColorId::WEIGHT_BAR,
93 "weightprogressbar.xml",
"weightprogressbar_fill.xml",
95 "weight bar",
_(
"weight bar"))),
96 mInvSlotsBar(createBar(0, 45, 0,
98 "slotsprogressbar.xml",
"slotsprogressbar_fill.xml",
99 "inventory slots bar",
101 _(
"inventory slots bar"))),
104 "moneyprogressbar.xml",
"moneyprogressbar_fill.xml",
106 "money bar",
_(
"money bar"))),
107 mArrowsBar(createBar(0, 50, 0,
ThemeColorId::ARROWS_BAR,
109 "arrowsprogressbar.xml",
"arrowsprogressbar_fill.xml",
111 "arrows bar",
_(
"arrows bar"))),
112 mStatusBar(createBar(100, (
config.getIntValue(
"fontSize") > 16
115 "statusprogressbar.xml",
"statusprogressbar_fill.xml",
117 "status bar",
_(
"status bar"))),
119 mSpacing(mSkin !=
nullptr ? mSkin->getOption(
"spacing", 3) : 3),
120 mIconPadding(mSkin !=
nullptr ? mSkin->getOption(
"iconPadding", 3) : 3),
121 mIconSpacing(mSkin !=
nullptr ? mSkin->getOption(
"iconSpacing", 2) : 2),
141 ThemeColorId::JOB_BAR,
143 "jobprogressbar.xml",
"jobprogressbar_fill.xml",
145 "job bar",
_(
"job bar"));
191 const std::string &
restrict skinFill,
197 progress, width, height, backColor, skin, skinFill);
199 bar->
setId(description);
202 mBars.push_back(bar);
228 if (lastBar !=
nullptr)
239 mIcons.resize(index + 1,
nullptr);
258 for (
size_t i = 0, sz =
mIcons.size(); i < sz; i ++)
287 PRAGMA45(GCC diagnostic ignored
"-Wswitch-enum")
334 for (
size_t i = 0, sz =
mIcons.size(); i < sz; i++)
361 const int x =
event.getX();
362 const int y =
event.getY();
408 strprintf(
"%s: %s",
_(
"Need"), str2.c_str()));
438 const std::string level =
strprintf(
_(
"Job level: %d"),
446 strprintf(
"%s/%s", expStr.c_str(), expNeedStr.c_str()));
454 strprintf(
"%s/%s", expStr.c_str(), expNeedStr.c_str()),
456 strprintf(
"%s: %s",
_(
"Need"), expLeftStr.c_str()));
474 const int maxSlots = inv->
getSize();
477 strprintf(
"%d/%d", usedSlots, maxSlots));
506 getY() +
event.getY(), bar);
549 for (
int f = 0; f < 10; f ++)
575 for (
int f = i; f < 10; f ++)
583 if (inventory ==
nullptr)
593 const int padding2 = padding * 2;
595 return Rect(padding, padding,
596 rect.
width - padding2,
Attributes ::T AttributesT
void draw(Graphics *const graphics, const int posX, const int posY) const
bool update(const int time)
virtual void add(Widget *const widget)
virtual void safeDrawChildren(Graphics *const graphics)
virtual void logicChildren()
virtual void remove(Widget *const widget)
virtual void drawChildren(Graphics *const graphics)
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)
int getIntValue(const std::string &key) const
Widget * getSource() const
InventoryTypeT getType() const
void removeInventoyListener(InventoryListener *const listener)
void addInventoyListener(InventoryListener *const listener)
int getNumberOfSlotsUsed() const
void mouseMoved(MouseEvent &event)
std::vector< AnimatedSprite * > mIcons
std::map< std::string, ProgressBar * > mBarNames
void mouseExited(MouseEvent &event)
void setIcon(const int index, AnimatedSprite *const sprite)
ProgressBar * mInvSlotsBar
std::vector< ProgressBar * > mBars
void eraseIcon(const int index)
void safeDraw(Graphics *const graphics)
void draw(Graphics *const graphics)
ProgressBar * createBar(const float progress, const int width, const int height, const ThemeColorIdT textColor, const ProgressColorIdT backColor, const std::string &skin, const std::string &skinFill, const std::string &name, const std::string &description)
void drawIcons(Graphics *const graphics)
void statChanged(const AttributesT id, const int oldVal1, const int oldVal2)
void attributeChanged(const AttributesT id, const int64_t oldVal, const int64_t newVal)
StatusPopup * mStatusPopup
void slotsChanged(const Inventory *const inventory)
void showBar(const std::string &name, const Visible visible)
void mousePressed(MouseEvent &event)
MouseButtonT getButton() const
void setColor(const Color &color1, const Color &color2)
static void updateArrowsBar(ProgressBar *const bar)
static void updateXPBar(ProgressBar *const bar, const bool percent)
static void updateMoneyBar(ProgressBar *const bar)
void updateMPBar(ProgressBar *bar, const bool showMax) const
void updateStatusBar(ProgressBar *const bar, const bool percent) const
static void updateHPBar(ProgressBar *const bar, const bool showMax)
static void updateJobBar(ProgressBar *const bar, const bool percent)
static void updateWeightBar(ProgressBar *const bar)
static void updateInvSlotsBar(ProgressBar *const bar)
virtual void setVisible(Visible visible)
void setContentSize(int width, int height)
void mouseExited(MouseEvent &event)
void mouseMoved(MouseEvent &event)
Configuration serverConfig
void delete_all(Container &c)
#define FOR_EACH(type, iter, array)
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wredundant-decls") PRAGMA45(GCC diagnostic pop) class TestMain
LocalPlayer * localPlayer
MiniStatusWindow * miniStatusWindow
std::vector< ProgressBar * >::const_iterator ProgressBarVectorCIter
std::string toString(T const &value)
converts any type to a string
int64_t getAttribute64(const AttributesT id)
Inventory * getInventory()
int32_t getAttribute(const AttributesT id)
std::map< int, std::string > mIcons
Net::PlayerHandler * playerHandler
#define BLOCK_START(name)
ProgressColorId ::T ProgressColorIdT
StatusWindow * statusWindow
std::string strprintf(const char *const format,...)
ThemeColorId ::T ThemeColorIdT