Crossfire Server, Trunk  R20513
CREExperienceWindow.cpp
Go to the documentation of this file.
1 #include <qboxlayout.h>
2 #include <qtreewidget.h>
3 
4 #include "CREExperienceWindow.h"
5 #include "CREFilterDialog.h"
6 
7 extern "C" {
8 #include "global.h"
9 }
10 
12 {
13  QVBoxLayout* layout = new QVBoxLayout(this);
14 
15  QTreeWidget* tree = new QTreeWidget(this);
16  tree->setColumnCount(3);
17  QStringList headers;
18  headers << tr("Level") << tr("Experience") << tr("Difference");
19  tree->setHeaderLabels(headers);
20 
21  layout->addWidget(tree);
22 
23  extern int64_t *levels;
24  int64_t previous = 0;
25 
26  for (int level = 0; level < settings.max_level + 1; level++)
27  {
28  QTreeWidgetItem* item = new QTreeWidgetItem(tree);
29  item->setText(0, QString::number(level));
30  item->setText(1, QString::number(levels[level]));
31  item->setText(2, QString::number(levels[level] - previous));
32  previous = levels[level];
33  }
34 
35  setWindowTitle(tr("Experience"));
36 }
37 
39 {
40 }
int16_t max_level
This is read out of exp_table.
Definition: global.h:300
Global type definitions and header inclusions.
signed __int64 int64_t
Definition: win32.h:168
struct Settings settings
Server settings.
Definition: init.c:40
int64_t * levels
Number of levels for which we have experience.
Definition: exp.c:26
Definition: main.c:88