54 mResetButton(
new Button(this,
_(
"Reset stats"),
"reset",
57 mTimerButton(
new Button(this,
_(
"Reset timer"),
"timer",
75 "Exp speed per %d min: %s",
"Exp speed per %d min: %s", 1), 1,
"?"))),
77 "Time for next level per %d min: %s",
78 "Time for next level per %d min: %s", 1), 1,
"?"))),
80 "Exp speed per %d min: %s",
"Exp speed per %d min: %s", 5), 5,
"?"))),
82 "Time for next level per %d min: %s",
83 "Time for next level per %d min: %s", 5), 5,
"?"))),
85 "Exp speed per %d min: %s",
"Exp speed per %d min: %s", 15),
88 "Time for next level per %d min: %s",
89 "Time for next level per %d min: %s", 15), 15,
"?"))),
120 if (xpNextLevel == 0)
126 /
static_cast<double>(xpNextLevel) * 100.0));
135 strXpNextLevel.c_str(),
140 strXpPercent.c_str(),
168 const std::string &eventId =
event.getId();
169 if (eventId ==
"reset")
176 strXpPercent.c_str(),
184 _(
"No. of avg mob to next level: %s"),
"?"));
188 else if (eventId ==
"timer")
195 _(
"Kills/Min: %s, Exp/Min: %s"),
"?",
"?"));
231 const float AvgExp =
static_cast<float>(
mExpCounter)
233 int64_t xpNextLevel(expNeed);
238 if (xpNextLevel == 0)
243 if (timeDiff <= 0.01)
250 /
static_cast<double>(xpNextLevel) * 100.0));
259 strXpNextLevel.c_str(),
262 if (AvgExp >= -0.001F && AvgExp <= 0.001F)
266 strXpPercent.c_str(),
275 _(
"No. of avg mob to next level: %s"),
"?"));
281 strXpPercent.c_str(),
toString((
static_cast<float>(
282 xpNextLevel) / 100) / AvgExp).c_str()));
290 toString(
static_cast<float>(xpNextLevel - exp) / AvgExp).c_str()));
370 "Exp speed per %d min: %s", 1),
387 _(
" Time for next level: %s"),
"?"));
392 "Exp speed per %d min: %s", 5),
409 _(
" Time for next level: %s"),
"?"));
415 "Exp speed per %d min: %s", 15), 15,
toString(
431 _(
" Time for next level: %s"),
"?"));
438 const int64_t oldVal,
439 const int64_t newVal)
442 PRAGMA45(GCC diagnostic ignored
"-Wswitch-enum")
459 strXpPercent.c_str(),
463 _(
"Kills: %s, total exp: %s"),
"?",
"?"));
468 _(
"No. of avg mob to next level: %s"),
"?"));
471 _(
"Kills/Min: %s, Exp/Min: %s"),
"?",
"?"));
Attributes ::T AttributesT
void attributeChanged(const AttributesT id, const int64_t oldVal, const int64_t newVal)
Label * mLastKillExpLabel
void action(const ActionEvent &event)
void setCaption(const std::string &caption)
LayoutCell & setPadding(int p)
void registerWindowForReset(Window *const window)
void setSaveVisible(const bool save)
void setResizable(const bool resize)
void setWindowName(const std::string &name)
void enableVisibleSound(bool b)
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)
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wredundant-decls") PRAGMA45(GCC diagnostic pop) class TestMain
LocalPlayer * localPlayer
std::string toString(T const &value)
converts any type to a string
int64_t getAttribute64(const AttributesT id)
int32_t getAttribute(const AttributesT id)
#define BLOCK_START(name)
SetupWindow * setupWindow
std::string strprintf(const char *const format,...)