ManaPlus
statuswindow.cpp
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
25 
26 #include "configuration.h"
27 #include "gamemodifiers.h"
28 #include "settings.h"
29 
30 #include "being/localplayer.h"
31 #include "being/playerinfo.h"
32 
33 #include "enums/gui/layouttype.h"
34 
35 #include "gui/windows/chatwindow.h"
36 
39 
40 #include "gui/widgets/button.h"
42 #include "gui/widgets/layout.h"
44 #include "gui/widgets/statspage.h"
46 #include "gui/widgets/tabbedarea.h"
48 
49 #include "net/inventoryhandler.h"
50 #include "net/playerhandler.h"
51 
52 #include "resources/db/groupdb.h"
53 #include "resources/db/unitsdb.h"
54 #include "resources/db/statdb.h"
55 
56 #include "resources/item/item.h"
57 
58 #include "utils/delete2.h"
59 #include "utils/dtor.h"
60 #include "utils/foreach.h"
61 #include "utils/gettext.h"
62 
63 #include "debug.h"
64 
66 
69  "?", Modal_false, nullptr, "status.xml"),
72  mPages(),
73  mTabs(CREATEWIDGETR(TabbedArea, this)),
74  // TRANSLATORS: status window label
75  mLvlLabel(new Label(this, strprintf(_("Level: %d"), 0))),
76  // TRANSLATORS: status window label
77  mMoneyLabel(new Label(this, strprintf(_("Money: %s"), ""))),
78  // TRANSLATORS: status window label
79  mHpLabel(new Label(this, _("HP:"))),
80  mMpLabel(nullptr),
81  // TRANSLATORS: status window label
82  mXpLabel(new Label(this, _("Exp:"))),
83  mHpBar(nullptr),
84  mMpBar(nullptr),
85  mXpBar(nullptr),
86  mJobLvlLabel(nullptr),
87  mJobLabel(nullptr),
88  mJobBar(nullptr),
89  mBasicStatsPage(new StatsPageBasic(this)),
90  // TRANSLATORS: status window button
91  mCopyButton(new Button(this, _("Copy to chat"), "copy", BUTTON_SKIN, this))
92 {
93  setWindowName("Status");
94  if (setupWindow != nullptr)
96  setResizable(true);
97  setCloseButton(true);
98  setSaveVisible(true);
99  setStickyButtonLock(true);
100  setDefaultSize((windowContainer->getWidth() - 480) / 2,
101  (windowContainer->getHeight() - 500) / 2,
102  480,
103  500);
104 
105  mTabs->setSelectable(false);
108 
109  if ((localPlayer != nullptr) && !localPlayer->getRaceName().empty())
110  {
111  setCaption(strprintf("%s (%s)", localPlayer->getName().c_str(),
112  localPlayer->getRaceName().c_str()));
113  }
114 
116  if (max == 0)
117  max = 1;
118 
119  mHpBar = new ProgressBar(this,
121  / static_cast<float>(max),
122  80,
123  0,
125  "hpprogressbar.xml", "hpprogressbar_fill.xml");
126  mHpBar->setColor(getThemeColor(ThemeColorId::HP_BAR, 255U),
127  getThemeColor(ThemeColorId::HP_BAR_OUTLINE, 255U));
128  mHpBar->setSelectable(false);
129 
130  const int64_t maxExp = PlayerInfo::getAttribute64(
132  mXpBar = new ProgressBar(this,
133  maxExp != 0 ?
134  static_cast<float>(PlayerInfo::getAttribute64(
136  static_cast<float>(maxExp) : static_cast<float>(0),
137  80,
138  0,
140  "xpprogressbar.xml", "xpprogressbar_fill.xml");
141  mXpBar->setColor(getThemeColor(ThemeColorId::XP_BAR, 255U),
142  getThemeColor(ThemeColorId::XP_BAR_OUTLINE, 255U));
143  mXpBar->setSelectable(false);
144 
145  const bool job = serverConfig.getValueBool("showJob", true);
146 
148  // TRANSLATORS: status window label
149  mMpLabel = new Label(this, _("MP:"));
150  const bool useMagic = playerHandler->canUseMagic();
151  mMpBar = new ProgressBar(this,
152  max != 0 ? static_cast<float>(PlayerInfo::getAttribute(
153  Attributes::PLAYER_MAX_MP)) / static_cast<float>(max)
154  : static_cast<float>(0),
155  80,
156  0,
158  useMagic ? "mpprogressbar.xml" : "nompprogressbar.xml",
159  useMagic ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml");
160  mMpBar->setSelectable(false);
161  if (useMagic)
162  {
163  mMpBar->setColor(getThemeColor(ThemeColorId::MP_BAR, 255U),
164  getThemeColor(ThemeColorId::MP_BAR_OUTLINE, 255U));
165  }
166  else
167  {
168  mMpBar->setColor(getThemeColor(ThemeColorId::NO_MP_BAR, 255U),
169  getThemeColor(ThemeColorId::NO_MP_BAR_OUTLINE, 255U));
170  }
171 
172  place(0, 0, mLvlLabel, 3, 1);
173  place(0, 1, mHpLabel, 1, 1).setPadding(3);
174  place(1, 1, mHpBar, 4, 1);
175  place(5, 1, mXpLabel, 1, 1).setPadding(3);
176  place(6, 1, mXpBar, 5, 1);
177  place(0, 2, mMpLabel, 1, 1).setPadding(3);
178  // 5, 2 and 6, 2 Job Progress Bar
179  if (job)
180  place(1, 2, mMpBar, 4, 1);
181  else
182  place(1, 2, mMpBar, 10, 1);
183 
184  if (job)
185  {
186  // TRANSLATORS: status window label
187  mJobLvlLabel = new Label(this, strprintf(_("Job: %d"), 0));
188  // TRANSLATORS: status window label
189  mJobLabel = new Label(this, _("Job:"));
190  mJobBar = new ProgressBar(this, 0.0F, 80, 0, ProgressColorId::PROG_JOB,
191  "jobprogressbar.xml", "jobprogressbar_fill.xml");
192  mJobBar->setColor(getThemeColor(ThemeColorId::JOB_BAR, 255U),
193  getThemeColor(ThemeColorId::JOB_BAR_OUTLINE, 255U));
194  mJobBar->setSelectable(false);
195 
196  place(3, 0, mJobLvlLabel, 3, 1);
197  place(5, 2, mJobLabel, 1, 1).setPadding(3);
198  place(6, 2, mJobBar, 5, 1);
199  place(6, 0, mMoneyLabel, 3, 1);
200  }
201  else
202  {
203  mJobLvlLabel = nullptr;
204  mJobLabel = nullptr;
205  mJobBar = nullptr;
206  place(3, 0, mMoneyLabel, 3, 1);
207  }
208 
209  place(0, 3, mTabs, 11, 3);
210 
212 
213  place(0, 5, mCopyButton, 1, 1);
214 
215  loadWindowState();
216  enableVisibleSound(true);
217 
218  // Update bars
219  updateHPBar(mHpBar, true);
220  updateMPBar(mMpBar, true);
221  updateXPBar(mXpBar, false);
222 
223  // TRANSLATORS: status window label
224  mMoneyLabel->setCaption(strprintf(_("Money: %s"),
226  Attributes::MONEY)).c_str()));
228 
230  addTabs();
231 }
232 
234 {
237 }
238 
240 {
241  // TRANSLATORS: status window tab name
242  addTabBasic(_("Basic"));
243  const STD_VECTOR<std::string> &pages = StatDb::getPages();
244  FOR_EACH(STD_VECTOR<std::string>::const_iterator, it, pages)
245  {
246  addTab(*it);
247  }
248  mTabs->adjustSize();
249 }
250 
251 void StatusWindow::addTab(const std::string &name)
252 {
253  StatsPage *const page = new StatsPage(this, name);
254  mTabs->addTab(name,
255  page);
256  mPages.push_back(page);
257 }
258 
259 void StatusWindow::addTabBasic(const std::string &name)
260 {
261  mTabs->addTab(name,
263 }
264 
266 {
267  if (localPlayer == nullptr)
268  return;
269 
270  const int groupId = localPlayer->getGroupId();
271  const std::string &name = GroupDb::getName(groupId);
272  if (!name.empty())
273  {
274  // TRANSLATORS: status window label
275  mLvlLabel->setCaption(strprintf(_("Level: %d (%s %d)"),
277  name.c_str(),
278  groupId));
279  }
280  else
281  {
282  // TRANSLATORS: status window label
283  mLvlLabel->setCaption(strprintf(_("Level: %d"),
285  }
287 }
288 
290  const int64_t oldVal,
291  const int64_t newVal)
292 {
293  static bool blocked = false;
294 
295  PRAGMA45(GCC diagnostic push)
296  PRAGMA45(GCC diagnostic ignored "-Wswitch-enum")
297  switch (id)
298  {
301  updateHPBar(mHpBar, true);
302  break;
303 
306  updateMPBar(mMpBar, true);
307  break;
308 
311  updateXPBar(mXpBar, false);
312  break;
313 
314  case Attributes::MONEY:
315  // TRANSLATORS: status window label
316  mMoneyLabel->setCaption(strprintf(_("Money: %s"),
317  UnitsDb::formatCurrency64(newVal).c_str()));
319  break;
320 
322  // TRANSLATORS: status window label
323  mLvlLabel->setCaption(strprintf(_("Level: %d"),
324  CAST_S32(newVal)));
326  break;
327 
328  // +++ probable need use only some attributes here
332  if (blocked)
333  return;
334  if (mJobLvlLabel != nullptr)
335  {
336  int lvl = PlayerInfo::getAttribute(
338  const int64_t exp = PlayerInfo::getAttribute(
340  const int64_t expNeed = PlayerInfo::getAttribute(
342 
343  if (lvl == 0)
344  {
345  // possible server broken and don't send job level,
346  // then we fixing it.
347  if (expNeed < 20000)
348  {
349  lvl = 0;
350  }
351  else
352  {
353  lvl = CAST_S32((expNeed - 20000) / 150);
354  blocked = true;
356  lvl,
357  Notify_true);
358  blocked = false;
359  }
360  }
361 
362  if (id == Attributes::PLAYER_JOB_EXP &&
363  exp < oldVal &&
364  expNeed >= 20000)
365  { // possible job level up. but server broken and don't send
366  // new job exp limit, we fixing it
367  lvl ++;
368  blocked = true;
370  20000 + lvl * 150,
371  Notify_true);
373  lvl,
374  Notify_true);
375  blocked = false;
376  }
377 
378  // TRANSLATORS: status window label
379  mJobLvlLabel->setCaption(strprintf(_("Job: %d"), lvl));
381 
382  updateJobBar(mJobBar, false);
383  }
384  break;
385 
386  default:
387  break;
388  }
389  PRAGMA45(GCC diagnostic pop)
390 }
391 
393  const int needed)
394 {
395  mBasicStatsPage->setPointsNeeded(id, needed);
396 }
397 
398 void StatusWindow::updateHPBar(ProgressBar *const bar, const bool showMax)
399 {
400  if (bar == nullptr)
401  return;
402 
405  if (showMax)
406  bar->setText(toString(hp).append("/").append(toString(maxHp)));
407  else
408  bar->setText(toString(hp));
409 
410  float prog = 1.0;
411  if (maxHp > 0)
412  prog = static_cast<float>(hp) / static_cast<float>(maxHp);
413  bar->setProgress(prog);
414 }
415 
417  const bool showMax) const
418 {
419  if (bar == nullptr)
420  return;
421 
424  if (showMax)
425  bar->setText(toString(mp).append("/").append(toString(maxMp)));
426  else
427  bar->setText(toString(mp));
428 
429  float prog = 1.0F;
430  if (maxMp > 0)
431  prog = static_cast<float>(mp) / static_cast<float>(maxMp);
432 
433  if (playerHandler->canUseMagic())
434  {
435  bar->setColor(getThemeColor(ThemeColorId::MP_BAR, 255U),
436  getThemeColor(ThemeColorId::MP_BAR_OUTLINE, 255U));
438  }
439  else
440  {
441  bar->setColor(getThemeColor(ThemeColorId::NO_MP_BAR, 255U),
442  getThemeColor(ThemeColorId::NO_MP_BAR_OUTLINE, 255U));
444  }
445 
446  bar->setProgress(prog);
447 }
448 
450  const int64_t value,
451  const int64_t max,
452  const bool percent)
453 {
454  if (bar == nullptr)
455  return;
456 
457  if (max == 0)
458  {
459  // TRANSLATORS: status bar label
460  bar->setText(_("Max"));
461  bar->setProgress(1);
462  bar->setText(toString(CAST_U64(value)));
463  }
464  else
465  {
466  const float progress = static_cast<float>(value)
467  / static_cast<float>(max);
468  if (percent)
469  {
470  bar->setText(strprintf("%2.5f%%",
471  static_cast<double>(100 * progress)));
472  }
473  else
474  {
475  bar->setText(toString(
476  CAST_U64(value)).append(
477  "/").append(toString(
478  CAST_U64(max))));
479  }
480  bar->setProgress(progress);
481  }
482 }
483 
484 void StatusWindow::updateXPBar(ProgressBar *const bar, const bool percent)
485 {
486  if (bar == nullptr)
487  return;
488 
489  updateProgressBar(bar,
492  percent);
493 }
494 
496  const bool percent)
497 {
498  if (bar == nullptr)
499  return;
500 
501  updateProgressBar(bar,
504  percent);
505 }
506 
508  const AttributesT id,
509  const bool percent)
510 {
511  const std::pair<int, int> exp = PlayerInfo::getStatExperience(id);
512  updateProgressBar(bar, exp.first, exp.second, percent);
513 }
514 
516 {
517  if (bar == nullptr)
518  return;
519 
521  {
522  // TRANSLATORS: status bar label
523  bar->setText(_("Max"));
524  bar->setProgress(1.0);
525  }
526  else
527  {
528  const int totalWeight = PlayerInfo::getAttribute(
530  const int maxWeight = PlayerInfo::getAttribute(Attributes::MAX_WEIGHT);
531  float progress = 1.0F;
532  if (maxWeight != 0)
533  {
534  progress = static_cast<float>(totalWeight)
535  / static_cast<float>(maxWeight);
536  }
537  bar->setText(strprintf("%s/%s",
538  UnitsDb::formatWeight(totalWeight).c_str(),
539  UnitsDb::formatWeight(maxWeight).c_str()));
540  bar->setProgress(progress);
541  }
542 }
543 
545 {
546  if (bar == nullptr)
547  return;
548 
549  const int money = PlayerInfo::getAttribute(Attributes::MONEY);
550  bar->setText(UnitsDb::formatCurrency(money));
551  if (money > 0)
552  {
553  const float progress = static_cast<float>(money)
554  / static_cast<float>(1000000000);
555  bar->setProgress(progress);
556  }
557  else
558  {
559  bar->setProgress(1.0);
560  }
561 }
562 
564 {
565  if ((bar == nullptr) || (equipmentWindow == nullptr))
566  return;
567 
568  const Item *const item = equipmentWindow->getEquipment(
570 
571  if ((item != nullptr) && item->getQuantity() > 0)
572  bar->setText(toString(item->getQuantity()));
573  else
574  bar->setText("0");
575 }
576 
578 {
579  if (bar == nullptr)
580  return;
581 
582  const Inventory *const inv = PlayerInfo::getInventory();
583  if (inv == nullptr)
584  return;
585 
586  const int usedSlots = inv->getNumberOfSlotsUsed();
587  const int maxSlots = inv->getSize();
588 
589  if (maxSlots != 0)
590  {
591  bar->setProgress(static_cast<float>(usedSlots)
592  / static_cast<float>(maxSlots));
593  }
594 
595  bar->setText(strprintf("%d", usedSlots));
596 }
597 
598 std::string StatusWindow::translateLetter(const char *const letters)
599 {
600  char buf[2];
601  char *const str = gettext(letters);
602  if ((str == nullptr) || strlen(str) != 3)
603  return letters;
604 
605  buf[0] = str[1];
606  buf[1] = 0;
607  return std::string(buf);
608 }
609 
610 std::string StatusWindow::translateLetter2(const std::string &letters)
611 {
612  if (letters.size() < 5)
613  return "";
614 
615  return std::string(gettext(letters.substr(1, 1).c_str()));
616 }
617 
619  const bool percent A_UNUSED) const
620 {
621  if (bar == nullptr)
622  return;
627  .append(" ").append(translateLetter2(
632  .append(" ").append(translateLetter2(
635  .append(" ").append(translateLetter2(
637  .append(" ").append(translateLetter2(
642 
643  bar->setProgress(50);
645  {
646  bar->setBackgroundColor(getThemeColor(ThemeColorId::STATUSBAR_ON,
647  255U));
648  }
649  else
650  {
651  bar->setBackgroundColor(getThemeColor(ThemeColorId::STATUSBAR_OFF,
652  255U));
653  }
654 }
655 
657 {
658  if (chatWindow == nullptr)
659  return;
660 
661  if (event.getId() == "copy")
662  {
664  true);
665  }
666 }
Attributes ::T AttributesT
Definition: attributes.h:118
const std::string BUTTON_SKIN
Definition: button.h:89
#define CAST_S32
Definition: cast.h:30
#define CAST_U64
Definition: cast.h:33
ChatWindow * chatWindow
Definition: chatwindow.cpp:94
const std::string & getId() const
Definition: actionevent.h:122
std::string getRaceName() const
Definition: being.h:861
int getGroupId() const
Definition: being.h:1087
const std::string & getName() const
Definition: being.h:232
Definition: button.h:102
void addInputText(const std::string &text, const bool space)
bool getValueBool(const std::string &key, const bool deflt) const
const Item * getEquipment(const int i) const
static std::string getPickUpTypeString()
static std::string getMoveToTargetTypeString()
static std::string getQuickDropCounterString()
static std::string getAttackTypeString()
static std::string getMagicAttackTypeString()
static std::string getMoveTypeString()
static std::string getCrazyMoveTypeString()
static std::string getTargetingTypeString()
static std::string getAwayModeString()
static std::string getCameraModeString()
static std::string getFollowModeString()
static std::string getAttackWeaponTypeString()
static std::string getPvpAttackTypeString()
static std::string getMapDrawTypeString()
static std::string getImitationModeString()
unsigned getSize() const
Definition: inventory.h:76
int getNumberOfSlotsUsed() const
Definition: inventory.h:164
Definition: item.h:50
int getQuantity() const
Definition: item.h:105
Definition: label.h:91
void adjustSize()
Definition: label.cpp:200
void setCaption(const std::string &caption)
Definition: label.cpp:264
LayoutCell & setPadding(int p)
Definition: layoutcell.h:60
void setRowHeight(const int n, const int h)
Definition: layoutcell.cpp:128
virtual int getProjectileSlot() const =0
virtual bool canUseMagic() const =0
void setProgress(const float progress)
void setColor(const Color &color1, const Color &color2)
void setBackgroundColor(const Color &color)
void setProgressPalette(const ProgressColorIdT progressPalette)
void setText(const std::string &str)
bool disableGameModifiers
Definition: settings.h:157
void registerWindowForReset(Window *const window)
void setPointsNeeded(const AttributesT id, const int needed)
std::string getStatsStr() const
static void updateArrowsBar(ProgressBar *const bar)
static void updateXPBar(ProgressBar *const bar, const bool percent)
Label * mMpLabel
Definition: statuswindow.h:105
static void updateMoneyBar(ProgressBar *const bar)
void addTab(const std::string &name)
Label * mMoneyLabel
Definition: statuswindow.h:103
void updateMPBar(ProgressBar *bar, const bool showMax) const
static void updateProgressBar(ProgressBar *const bar, const int64_t value, const int64_t max, const bool percent)
void updateStatusBar(ProgressBar *const bar, const bool percent) const
static std::string translateLetter(const char *const letters)
void action(const ActionEvent &event)
StatsPageBasic * mBasicStatsPage
Definition: statuswindow.h:115
static std::string translateLetter2(const std::string &letters)
Button * mCopyButton
Definition: statuswindow.h:116
ProgressBar * mXpBar
Definition: statuswindow.h:109
Label * mJobLvlLabel
Definition: statuswindow.h:111
static void updateHPBar(ProgressBar *const bar, const bool showMax)
Label * mJobLabel
Definition: statuswindow.h:112
Label * mHpLabel
Definition: statuswindow.h:104
Label * mLvlLabel
Definition: statuswindow.h:102
ProgressBar * mJobBar
Definition: statuswindow.h:113
TabbedArea * mTabs
Definition: statuswindow.h:101
static void updateJobBar(ProgressBar *const bar, const bool percent)
Label * mXpLabel
Definition: statuswindow.h:106
void updateLevelLabel()
static void updateWeightBar(ProgressBar *const bar)
std::vector< StatsPage * > mPages
Definition: statuswindow.h:99
static void updateInvSlotsBar(ProgressBar *const bar)
void addTabBasic(const std::string &name)
ProgressBar * mHpBar
Definition: statuswindow.h:107
void setPointsNeeded(const AttributesT id, const int needed)
ProgressBar * mMpBar
Definition: statuswindow.h:108
void attributeChanged(const AttributesT id, const int64_t oldVal, const int64_t newVal)
void adjustSize()
Definition: tabbedarea.cpp:569
Widget * getTabContainer() const
Definition: tabbedarea.h:241
Widget * getWidgetContainer() const
Definition: tabbedarea.h:244
void addTab(Tab *const tab, Widget *const widget)
Definition: tabbedarea.cpp:238
const Color & getThemeColor(const ThemeColorIdT type, const unsigned int alpha) const A_INLINE
Definition: widget2.h:45
void setSelectable(const bool selectable)
Definition: widget.h:948
int getHeight() const
Definition: widget.h:240
int getWidth() const
Definition: widget.h:221
Definition: window.h:102
void setSaveVisible(const bool save)
Definition: window.h:300
void setResizable(const bool resize)
Definition: window.cpp:627
Layout & getLayout()
Definition: window.cpp:1365
void setWindowName(const std::string &name)
Definition: window.h:355
void setCaption(const std::string &caption)
Definition: window.h:531
void enableVisibleSound(bool b)
Definition: window.h:481
void setCloseButton(const bool flag)
Definition: window.cpp:749
void setStickyButtonLock(const bool sticky)
Definition: window.cpp:772
LayoutCell & place(const int x, const int y, Widget *const wg, const int w, const int h)
Definition: window.cpp:1384
void setDefaultSize()
Definition: window.cpp:1198
void loadWindowState()
Definition: window.cpp:1087
Configuration serverConfig
#define CREATEWIDGETR(type,...)
Definition: createwidget.h:36
#define new
Definition: debug_new.h:147
#define delete2(var)
Definition: delete2.h:25
void delete_all(Container &c)
Definition: dtor.h:56
EquipmentWindow * equipmentWindow
#define FOR_EACH(type, iter, array)
Definition: foreach.h:25
#define _(s)
Definition: gettext.h:35
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wredundant-decls") PRAGMA45(GCC diagnostic pop) class TestMain
Net::InventoryHandler * inventoryHandler
Definition: net.cpp:89
#define nullptr
Definition: localconsts.h:45
#define A_UNUSED
Definition: localconsts.h:160
LocalPlayer * localPlayer
const bool Modal_false
Definition: modal.h:30
@ PLAYER_EXP_NEEDED
Definition: attributes.h:37
@ TOTAL_WEIGHT
Definition: attributes.h:39
@ PLAYER_MAX_MP
Definition: attributes.h:35
@ PLAYER_BASE_LEVEL
Definition: attributes.h:31
@ PLAYER_JOB_EXP
Definition: attributes.h:66
@ PLAYER_JOB_LEVEL
Definition: attributes.h:41
@ PLAYER_MAX_HP
Definition: attributes.h:33
@ PLAYER_JOB_EXP_NEEDED
Definition: attributes.h:67
std::string toString(T const &value)
converts any type to a string
Definition: catch.hpp:1774
const std::string & getName(const int id)
Definition: groupdb.cpp:344
int64_t getAttribute64(const AttributesT id)
Definition: playerinfo.cpp:94
Inventory * getInventory()
Definition: playerinfo.cpp:195
int32_t getAttribute(const AttributesT id)
Definition: playerinfo.cpp:102
void setAttribute(const AttributesT id, const int64_t value, const Notify notify)
Definition: playerinfo.cpp:110
const std::pair< int, int > getStatExperience(const AttributesT id)
Definition: playerinfo.cpp:175
const std::vector< std::string > & getPages()
Definition: statdb.cpp:82
std::string formatCurrency64(const int64_t value)
Definition: unitsdb.cpp:329
std::string formatCurrency(const int value)
Definition: unitsdb.cpp:324
std::string formatWeight(const int value)
Definition: unitsdb.cpp:352
std::vector< std::string > mPages
Definition: statdb.cpp:41
Net::PlayerHandler * playerHandler
Definition: net.cpp:96
const bool Notify_true
Definition: notify.h:30
Settings settings
Definition: settings.cpp:32
const char *const pages[SETUP_PAGES+1]
SetupWindow * setupWindow
Definition: setupwindow.cpp:64
StatusWindow * statusWindow
std::string strprintf(const char *const format,...)
WindowContainer * windowContainer