summaryrefslogtreecommitdiff
path: root/src/commands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands.cpp')
-rw-r--r--src/commands.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index c83001cc1..e0bb195d0 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -33,6 +33,7 @@
#include "nullopenglgraphics.h"
#include "party.h"
+#include "gui/buydialog.h"
#include "gui/chatwindow.h"
#include "gui/helpwindow.h"
#include "gui/gui.h"
@@ -64,6 +65,8 @@
#include "resources/subimage.h"
#endif
+#include "resources/itemdb.h"
+#include "resources/iteminfo.h"
#include "resources/resourcemanager.h"
#include "utils/gettext.h"
@@ -1198,6 +1201,33 @@ impHandler1(testParticle)
player_node->setTestParticle(args);
}
+impHandler0(createItems)
+{
+ BuyDialog *const dialog = new BuyDialog();
+ const ItemDB::ItemInfos &items = ItemDB::getItemInfos();
+ FOR_EACH (ItemDB::ItemInfos::const_iterator, it, items)
+ {
+ const ItemInfo *const info = (*it).second;
+ const int id = info->getId();
+ if (id <= 0)
+ continue;
+
+ const int colors = info->getColorsSize();
+ if (!colors || serverVersion < 1)
+ {
+ dialog->addItem(id, 1, 100, 0);
+ }
+ else
+ {
+ for (int f = 0; f < colors; f ++)
+ {
+ if (!info->getColor(f).empty())
+ dialog->addItem(id, f, 100, 0);
+ }
+ }
+ }
+}
+
impHandler0(testsdlfont)
{
#if defined USE_OPENGL && defined DEBUG_SDLFONT