Crossfire Server, Trunk
CREResourcesWindow.cpp
Go to the documentation of this file.
1 #include <Qt>
2 #include <QtWidgets>
3 #include <QScriptValue>
4 #include <stdexcept>
5 
6 #include "CREResourcesWindow.h"
7 #include "CREUtils.h"
8 #include "CREPixmap.h"
9 
10 #include "CREFilter.h"
11 #include "CREFilterDialog.h"
12 #include "CREFilterDefinition.h"
13 
14 #include "CRESettings.h"
15 
16 #include "CREReportDialog.h"
17 #include "CREReportDisplay.h"
18 #include "CREReportDefinition.h"
19 
20 #include "CRETreeItemEmpty.h"
21 #include "CRETreeItemQuest.h"
22 
23 #include "CREAnimationPanel.h"
24 #include "CREArchetypePanel.h"
25 #include "CRETreasurePanel.h"
26 #include "CREArtifactPanel.h"
27 #include "CREFormulaePanel.h"
28 #include "CREFacePanel.h"
29 #include "CREMapPanel.h"
30 #include "CRERegionPanel.h"
31 #include "CREQuestPanel.h"
32 #include "CREMessagePanel.h"
33 #include "CREScriptPanel.h"
34 #include "CREGeneralMessagePanel.h"
35 #include "CREFacesetsPanel.h"
36 
37 #include "CREWrapperObject.h"
38 #include "CREWrapperArtifact.h"
39 #include "CREWrapperFormulae.h"
40 #include "CREWrapperTreasure.h"
41 
43 #include "MessageFile.h"
44 #include "ScriptFileManager.h"
45 
46 #include "CREScriptEngine.h"
47 
48 #include "CRERandomMap.h"
49 #include "CRERandomMapPanel.h"
50 
51 extern "C" {
52 #include "global.h"
53 #include "recipe.h"
54 }
55 #include "assets.h"
56 #include "AssetsManager.h"
57 
58 #include "MessageManager.h"
59 #include "ResourcesManager.h"
60 #include "ScriptFile.h"
61 
63 {
64  QApplication::setOverrideCursor(Qt::WaitCursor);
65 
66  myDisplay = mode;
67 
68  Q_ASSERT(store);
69  myStore = store;
70  Q_ASSERT(messages);
72  Q_ASSERT(resources);
73  myResources = resources;
74  Q_ASSERT(scripts);
76 
77  setAttribute(Qt::WA_DeleteOnClose);
78 
79  QVBoxLayout* layout = new QVBoxLayout(this);
80 
81  myFiltersMenu = new QMenu(this);
82  QHBoxLayout* buttons = new QHBoxLayout();
83  myFilterButton = new QPushButton(tr("Filter..."), this);
84  myFilterButton->setMenu(myFiltersMenu);
85  buttons->addWidget(myFilterButton);
86 
87  myReportsMenu = new QMenu(this);
88  QPushButton* report = new QPushButton(tr("Report"), this);
89  report->setMenu(myReportsMenu);
90  buttons->addWidget(report);
91 
92  layout->addLayout(buttons);
93 
94  mySplitter = new QSplitter(this);
95  layout->addWidget(mySplitter);
96  myTree = new QTreeWidget(this);
97  mySplitter->addWidget(myTree);
98  myTree->setIconSize(QSize(32, 32));
99  myTree->setHeaderLabel(tr("All resources"));
100 // myTree->sortByColumn(0, Qt::AscendingOrder);
101 
102 // myTree->setSortingEnabled(true);
103  myTree->setContextMenuPolicy(Qt::CustomContextMenu);
104  connect(myTree, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(treeCustomMenu(const QPoint&)));
105  connect(myTree, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(tree_currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
106 
107  /* dummy panel to display for empty items */
108  CREPanel* dummy = new CREPanel(this);
109  QVBoxLayout* dl = new QVBoxLayout(dummy);
110  dl->addWidget(new QLabel(tr("No details available."), dummy));
111  addPanel("(dummy)", dummy);
112  dummy->setVisible(true);
113  myCurrentPanel = dummy;
114 
115  fillData();
116 
117  connect(&myFiltersMapper, SIGNAL(mapped(QObject*)), this, SLOT(onFilterChange(QObject*)));
118  updateFilters();
119  connect(&myReportsMapper, SIGNAL(mapped(QObject*)), this, SLOT(onReportChange(QObject*)));
120  updateReports();
121 
122  QApplication::restoreOverrideCursor();
123 }
124 
126 {
127  qDeleteAll(myTreeItems);
128  myTreeItems.clear();
129  qDeleteAll(myDisplayedItems);
130  myDisplayedItems.clear();
131  qDeleteAll(myPanels);
132 }
133 
135 {
136  QApplication::setOverrideCursor(Qt::WaitCursor);
137 
138  myTree->clear();
139  qDeleteAll(myTreeItems);
140  myTreeItems.clear();
141  qDeleteAll(myDisplayedItems);
142  myDisplayedItems.clear();
143 
144  QString title;
146  {
147  title = tr("Archetypes");
148  fillArchetypes();
149  }
151  {
152  title = tr("Animations");
153  fillAnimations();
154  }
156  {
157  title = tr("Treasures");
158  fillTreasures();
159  }
161  {
162  title = tr("Formulae");
163  fillFormulae();
164  }
166  {
167  title = tr("Artifacts");
168  fillArtifacts();
169  }
170  if (myDisplay & DisplayFaces)
171  {
172  title = tr("Faces");
173  fillFaces();
174  }
175  if (myDisplay & DisplayMaps)
176  {
177  title = tr("Maps");
178  fillMaps();
179  }
180  if (myDisplay & DisplayQuests)
181  {
182  title = tr("Quests");
183  fillQuests();
184  }
186  {
187  title = tr("NPC dialogs");
188  fillMessages();
189  }
191  {
192  title = tr("Scripts");
193  fillScripts();
194  }
196  {
197  title = tr("Random maps");
198  fillRandomMaps();
199  }
201  {
202  title = tr("General messages");
204  }
206  {
207  title = tr("Facesets");
208  fillFacesets();
209  }
210 
211  if (myDisplay == DisplayAll)
212  title = tr("All resources");
213 
214  if (myTree->topLevelItemCount() == 1)
215  myTree->topLevelItem(0)->setExpanded(true);
216 
217  setWindowTitle(title);
218 
219  myTree->resizeColumnToContents(0);
220 
221  QApplication::restoreOverrideCursor();
222 }
223 
225 {
226  if (myCurrentPanel != NULL)
228 }
229 
230 void CREResourcesWindow::tree_currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem*)
231 {
232  if (!current || current->data(0, Qt::UserRole).value<void*>() == NULL)
233  return;
234  CRETreeItem* item = reinterpret_cast<CRETreeItem*>(current->data(0, Qt::UserRole).value<void*>());
235  if (!item)
236  return;
237 
238  commitData();
239 
240  CREPanel* newPanel = myPanels[item->getPanelName()];
241  if (!newPanel)
242  {
243 // printf("no panel for %s\n", qPrintable(item->getPanelName()));
244  return;
245  }
246 
247  item->fillPanel(newPanel);
248 
249  if (myCurrentPanel != newPanel)
250  {
251  if (myCurrentPanel)
252  myCurrentPanel->setVisible(false);
253  newPanel->setVisible(true);
254  myCurrentPanel = newPanel;
255  }
256 }
257 
259 {
260  QTreeWidgetItem* animationsNode = CREUtils::animationNode(NULL);
261  myTreeItems.append(new CRETreeItemEmpty());
262  animationsNode->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
263  myTree->addTopLevelItem(animationsNode);
264 
265  getManager()->animations()->each([this, &animationsNode] (const auto anim)
266  {
267  auto item = CREUtils::animationNode(anim, animationsNode);
268  myTreeItems.append(new CRETTreeItem<const animations_struct>(anim, "Animation"));
269  item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
270  });
271 
272  addPanel("Animation", new CREAnimationPanel(this, myStore));
273 }
274 
276 {
277  QTreeWidgetItem* treasures = CREUtils::treasureNode(NULL);
278  myTreeItems.append(new CRETreeItemEmpty());
279  treasures->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
280  myTree->addTopLevelItem(treasures);
281 
282  getManager()->treasures()->each([this, &treasures] (const auto list)
283  {
284  auto wrapper = new CREWrapperTreasureList(list);
285  if (!myFilter.showItem(wrapper)) {
286  delete wrapper;
287  return;
288  }
289  auto item = CREUtils::treasureNode(list, treasures);
290 
291  myTreeItems.append(new CRETTreeItem<const treasurelist>(list, "Treasure"));
292  item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
293  //item->setData(0, Qt::UserRole, allTreasures[t]);
294  if (list->total_chance != 0)
295  item->setText(1, QString::number(list->total_chance));
296 
297  for (auto treasure = list->items; treasure; treasure = treasure->next)
298  {
300  if (treasure->chance)
301  sub->setText(1, QString::number(treasure->chance));
302  myTreeItems.append(new CRETTreeItem<const treasurelist>(list, "Treasure"));
303  sub->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
304  }
305  myDisplayedItems.append(wrapper);
306  });
307 
308  addPanel("Treasure", new CRETreasurePanel(this));
309  treasures->setText(0, tr("%1 [%2 items]").arg(treasures->text(0)).arg((getManager()->treasures()->count())));
310 }
311 
313 {
314  QTreeWidgetItem* root;
315  int added = 0, count = 0;
316 
318  myTreeItems.append(new CRETreeItemEmpty());
319  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
320  myTree->addTopLevelItem(root);
321 
322  CREWrapperObject* wrapper = NULL;
323 
324  getManager()->archetypes()->each([this, &wrapper, &root, &added, &count] (const auto arch)
325  {
326  if (arch->head) {
327  return;
328  }
329  count++;
330  if (!wrapper)
331  wrapper = new CREWrapperObject();
332  wrapper->setObject(&arch->clone);
333  if (!myFilter.showItem(wrapper))
334  return;
335 
337  myTreeItems.append(new CRETTreeItem<archt>(arch, "Archetype"));
338  item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
339 
340  if (arch->more)
341  {
342  int min_x = 0, max_x = 0, min_y = 0, max_y = 0;
343 
344  for (archt* more = arch->more; more; more = more->more)
345  {
346  min_x = MIN(min_x, more->clone.x);
347  max_x = MAX(max_x, more->clone.x);
348  min_y = MIN(min_y, more->clone.y);
349  max_y = MAX(max_y, more->clone.y);
350  auto sub = CREUtils::archetypeNode(more, item);
351  myTreeItems.append(new CRETTreeItem<const archt>(more, "Archetype"));
352  sub->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
353  }
354 
355  item->setText(0, tr("%1 (%2x%3)").arg(item->text(0)).arg(max_x - min_x + 1).arg(max_y - min_y + 1));
356  }
357 
358  myDisplayedItems.append(wrapper);
359  wrapper = NULL;
360  added++;
361  });
362 
363  delete wrapper;
364  addPanel("Archetype", new CREArchetypePanel(myStore, myResources, this));
365  if (added == count)
366  root->setText(0, tr("%1 [%2 items]").arg(root->text(0)).arg(count));
367  else
368  root->setText(0, tr("%1 [%2 items out of %3]").arg(root->text(0)).arg(added).arg(count));
369 }
370 
372 {
373  const recipe* r;
374  QTreeWidgetItem* root, *form, *sub;
375  CREWrapperFormulae* wrapper = NULL;
376  int count = 0, added = 0, subCount, subAdded;
377 
378  form = new QTreeWidgetItem(myTree, QStringList(tr("Formulae")));
379  myTreeItems.append(new CRETreeItemEmpty());
380  form->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
381 // myTree->addTopLevelItem(form);
382 
383  for (int ing = 1; ing <= myResources->recipeMaxIngredients() ; ing++)
384  {
385  root = new QTreeWidgetItem(form, QStringList(tr("%1 ingredients").arg(ing)));
386  subCount = 0;
387  subAdded = 0;
388 
389  QStringList recipes = myResources->recipes(ing);
390 
391  foreach(QString name, recipes)
392  {
393  r = myResources->recipe(ing, name);
394  subCount++;
395  count++;
396  if (!wrapper)
397  wrapper = new CREWrapperFormulae();
398  wrapper->setFormulae(r);
399  if (!myFilter.showItem(wrapper))
400  continue;
401 
402  sub = CREUtils::formulaeNode(r, root);
403  myTreeItems.append(new CRETTreeItem<const recipe>(r, "Formulae"));
404  sub->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
405  myDisplayedItems.append(wrapper);
406  wrapper = NULL;
407  subAdded++;
408  added++;
409  }
410  if (subCount == subAdded)
411  root->setText(0, tr("%1 [%2 items]").arg(root->text(0)).arg(subCount));
412  else
413  root->setText(0, tr("%1 [%2 items out of %3]").arg(root->text(0)).arg(subAdded).arg(subCount));
414  }
415 
416  delete wrapper;
417  addPanel("Formulae", new CREFormulaePanel(this));
418  if (added == count)
419  form->setText(0, tr("%1 [%2 items]").arg(form->text(0)).arg(count));
420  else
421  form->setText(0, tr("%1 [%2 items out of %3]").arg(form->text(0)).arg(added).arg(count));
422 }
423 
425 {
426  QTreeWidgetItem* item, *root, *sub;
428  const typedata* data;
429  int count = 0, added = 0;
430 
431  root = new QTreeWidgetItem(myTree, QStringList(tr("Artifacts")));
432  myTreeItems.append(new CRETreeItemEmpty());
433  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
434 
435  CREWrapperArtifact wrapper;
436 
437  for (list = first_artifactlist; list; list = list->next)
438  {
439  int subCount = 0, subAdded = 0;
440  data = get_typedata(list->type);
441 
442  item = new QTreeWidgetItem(root, QStringList(data ? data->name : tr("type %1").arg(list->type)));
443 
444  for (artifact* art = list->items; art; art = art->next)
445  {
446  count++;
447  subCount++;
448  wrapper.setArtifact(art);
449  if (!myFilter.showItem(&wrapper))
450  continue;
451 
452  sub = CREUtils::artifactNode(art, item);
453  myTreeItems.append(new CRETTreeItem<artifact>(art, "Artifact"));
454  sub->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
455  added++;
456  subAdded++;
457  }
458 
459  if (subCount == subAdded)
460  item->setText(0, tr("%1 [%2 items]").arg(item->text(0)).arg(subCount));
461  else
462  item->setText(0, tr("%1 [%2 items out of %3]").arg(item->text(0)).arg(subAdded).arg(subCount));
463  }
464 
465  addPanel("Artifact", new CREArtifactPanel(this));
466  if (added == count)
467  root->setText(0, tr("%1 [%2 items]").arg(root->text(0)).arg(count));
468  else
469  root->setText(0, tr("%1 [%2 items out of %3]").arg(root->text(0)).arg(added).arg(count));
470 }
471 
473 {
474  QTreeWidgetItem* root;
475 
476  root = CREUtils::faceNode(NULL);
477  myTreeItems.append(new CRETreeItemEmpty());
478  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
479  myTree->addTopLevelItem(root);
480 
481  getManager()->faces()->each([this, &root] (const auto face)
482  {
483  auto item = CREUtils::faceNode(face, root);
484  myTreeItems.append(new CRETTreeItem<const Face>(face, "Face"));
485  item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
486  });
487 
488  addPanel("Face", new CREFacePanel(this, myStore));
489 }
490 
492 {
493  return left->displayName().compare(right->displayName(), Qt::CaseInsensitive) < 0;
494 }
495 
497 {
498  bool full = false;
499  if (myDisplay == DisplayMaps)
500  {
501  QStringList headers;
502  headers << tr("Maps") << tr("Experience") << tr("Difficulty") << tr("Computed difficulty");
503  myTree->setHeaderLabels(headers);
504  myTree->sortByColumn(0, Qt::AscendingOrder);
505  full = true;
506  }
507 
508  QTreeWidgetItem* regionNode, *root, *leaf;
509 
510  root = CREUtils::mapNode(NULL);
511  myTreeItems.append(new CRETreeItemEmpty());
512  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
513  myTree->addTopLevelItem(root);
514 
515  QHash<QString, region*> regions;
516  for (region* reg = first_region; reg; reg = reg->next)
517  {
518  regions[reg->name] = reg;
519  }
520 
521  QStringList names = regions.keys();
522  names.sort();
523 
524  int totalMaps = 0, totalAdded = 0;
525 
526  foreach(QString name, names)
527  {
528  int added = 0;
529  QList<CREMapInformation*> maps = myStore->getMapsForRegion(name);
530  qSort(maps.begin(), maps.end(), sortMapInformation);
531  regionNode = CREUtils::regionNode(name, maps.size(), root);
532  myTreeItems.append(new CRETTreeItem<region>(regions[name], "Region"));
533  regionNode->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
534  foreach(CREMapInformation* map, maps)
535  {
536  if (!myFilter.showItem(map)) {
537  continue;
538  }
539  added++;
540 
541  leaf = CREUtils::mapNode(map, regionNode);
542  myTreeItems.append(new CRETTreeItem<CREMapInformation>(map, "Map"));
543  leaf->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
544  if (full)
545  {
546  leaf->setText(1, tr("%1").arg(QString::number(map->experience()), 20));
547  leaf->setText(2, tr("%1").arg(QString::number(map->difficulty()), 20));
548  leaf->setText(3, tr("%1").arg(QString::number(map->computedDifficulty()), 20));
549  }
550 
552  myDisplayedItems.append(map->clone());
553 
554  }
555 
556  totalMaps += maps.size();
557  totalAdded += added;
558  if (added != maps.size())
559  {
560  regionNode->setText(0, tr("%1 - %2 maps out of %3").arg(name).arg(added).arg(maps.size()));
561  }
562  }
563 
564  if (full)
565  {
566  root->setExpanded(true);
567  myTree->resizeColumnToContents(0);
568  myTree->resizeColumnToContents(1);
569  }
570  if (totalMaps == totalAdded)
571  root->setText(0, tr("Maps [%1 items]").arg(totalMaps));
572  else
573  root->setText(0, tr("Maps - [%1 out of %2]").arg(totalAdded).arg(totalMaps));
574 
575  addPanel("Region", new CRERegionPanel(this));
576  addPanel("Map", new CREMapPanel(myScripts, this));
577 }
578 
580 {
581  QTreeWidgetItem* item, *root;
582 
584  myTreeItems.append(new CRETreeItemQuest(NULL, root, this));
585  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
586  myTree->addTopLevelItem(root);
587 
588  getManager()->quests()->each([&] (auto quest) {
590  myTreeItems.append(new CRETreeItemQuest(quest, item, this));
591  item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
592  });
593 
594  addPanel("Quest", new CREQuestPanel(myStore, myMessages, myResources, this));
595  root->setText(0, tr("%1 [%2 items]").arg(root->text(0)).arg(getManager()->quests()->count()));
596 }
597 
599 {
600  QTreeWidgetItem* item, *root;
601 
603  myTreeItems.append(new CRETreeItemEmpty());
604  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
605  myTree->addTopLevelItem(root);
606 
607  foreach(MessageFile* message, myMessages->messages())
608  {
610  myTreeItems.append(new CRETTreeItem<MessageFile>(message, "Message"));
611  item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
612  }
613 
614  addPanel("Message", new CREMessagePanel(myMessages, this));
615 }
616 
617 static bool scriptLessThan(const ScriptFile* left, const ScriptFile* right)
618 {
619  return left->path().compare(right->path()) < 0;
620 }
621 
623 {
624  QTreeWidgetItem* item, *root;
625 
627  myTreeItems.append(new CRETreeItemEmpty());
628  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
629  myTree->addTopLevelItem(root);
630 
631  QList<ScriptFile*> scripts = myScripts->scripts();
632  qSort(scripts.begin(), scripts.end(), scriptLessThan);
633 
634  foreach(ScriptFile* script, scripts)
635  {
636  item = CREUtils::scriptNode(script, root);
637  myTreeItems.append(new CRETTreeItem<ScriptFile>(script, "Script"));
638  item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
639  }
640 
641  addPanel("Script", new CREScriptPanel(this));
642 }
643 
645 {
646  QTreeWidgetItem* root;
647 
649  myTreeItems.append(new CRETreeItemEmpty());
650  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
651  myTree->addTopLevelItem(root);
652 
653  getManager()->messages()->each([this, &root] (const GeneralMessage* message)
654  {
656  myTreeItems.append(new CRETTreeItem<const GeneralMessage>(message, "GeneralMessage"));
657  item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
658  });
659 
660  addPanel("GeneralMessage", new CREGeneralMessagePanel(this));
661 }
662 
664 {
665  QTreeWidgetItem* root;
666 
668  myTreeItems.append(new CRETreeItemEmpty());
669  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
670  myTree->addTopLevelItem(root);
671 
672  getManager()->facesets()->each([this, &root] (const face_sets* faceset)
673  {
674  auto item = CREUtils::facesetsNode(faceset, root);
675  myTreeItems.append(new CRETTreeItem<const face_sets>(faceset, "Faceset"));
676  item->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
677  });
678 
679  addPanel("Faceset", new CREFacesetsPanel(this));
680 }
681 
683 {
684  panel->setVisible(false);
685  myPanels[name] = panel;
686  mySplitter->addWidget(panel);
687 }
688 
690 {
691  CREFilterDialog dlg;
692  if (dlg.exec() != QDialog::Accepted)
693  return;
694 
695  /* sending this signal will ultimately call our own updateFilters() */
696  emit filtersModified();
697 }
698 
700 {
701  CREReportDialog dlg;
702  if (dlg.exec() != QDialog::Accepted)
703  return;
704 
705  /* sending this signal will ultimately call our own updateReports() */
706  emit reportsModified();
707 }
708 
710 {
712  settings.loadFilters(myFilters);
713 
714  myFiltersMenu->clear();
715 
716  if (myFilters.filters().size() > 0)
717  {
718  QAction* clear = new QAction(tr("(none)"), this);
719  connect(clear, SIGNAL(triggered()), this, SLOT(clearFilter()));
720  myFiltersMenu->addAction(clear);
721 
723  {
724  QAction* a = new QAction(filter->name(), this);
725  myFiltersMenu->addAction(a);
726  myFiltersMapper.setMapping(a, filter);
727  connect(a, SIGNAL(triggered()), &myFiltersMapper, SLOT(map()));
728  }
729 
730  myFiltersMenu->addSeparator();
731  }
732 
733  QAction* quick = new QAction(tr("Quick filter..."), this);
734  connect(quick, SIGNAL(triggered()), this, SLOT(onQuickFilter()));
735  myFiltersMenu->addAction(quick);
736  QAction* dialog = new QAction(tr("Filters definition..."), this);
737  connect(dialog, SIGNAL(triggered()), this, SLOT(onFilter()));
738  myFiltersMenu->addAction(dialog);
739 
740  clearFilter();
741 }
742 
744 {
745  CREFilterDefinition* filter = qobject_cast<CREFilterDefinition*>(object);
746  if (filter == NULL)
747  return;
748  myFilter.setFilter(filter->filter());
749  fillData();
750  myFilterButton->setText(tr("Filter: %1").arg(filter->name()));
751 }
752 
754 {
755  bool ok;
756  QString filter = QInputDialog::getText(this, tr("Quick filter"), tr("Filter:"), QLineEdit::Normal, myFilter.filter(), &ok);
757  if (!ok)
758  return;
759  if (filter.isEmpty())
760  {
761  clearFilter();
762  return;
763  }
765  fillData();
766  myFilterButton->setText(tr("Filter: %1").arg(filter));
767 }
768 
770 {
771  myFilter.setFilter(QString());
772  fillData();
773  myFilterButton->setText(tr("Filter..."));
774 }
775 
777 {
779  settings.loadReports(myReports);
780 
781  myReportsMenu->clear();
782 
783  if (myReports.reports().size() > 0)
784  {
786  {
787  QAction* a = new QAction(report->name(), this);
788  myReportsMenu->addAction(a);
789  myReportsMapper.setMapping(a, report);
790  connect(a, SIGNAL(triggered()), &myReportsMapper, SLOT(map()));
791  }
792 
793  myReportsMenu->addSeparator();
794  }
795 
796  QAction* dialog = new QAction(tr("Reports definition..."), this);
797  connect(dialog, SIGNAL(triggered()), this, SLOT(onReport()));
798  myReportsMenu->addAction(dialog);
799 }
800 
802 {
803  CREReportDefinition* report = qobject_cast<CREReportDefinition*>(object);
804  if (report == NULL)
805  return;
806 
807  QProgressDialog progress(tr("Generating report..."), tr("Abort report"), 0, myDisplayedItems.size() - 1, this);
808  progress.setWindowTitle(tr("Report: '%1'").arg(report->name()));
809  progress.setWindowModality(Qt::WindowModal);
810 
811  QStringList headers = report->header().split("\n");
812  QStringList fields = report->itemDisplay().split("\n");
813  QString sort = report->itemSort();
814 
815  QString text("<table><thead><tr>");
816 
817  foreach(QString header, headers)
818  {
819  text += "<th>" + header + "</th>";
820  }
821  text += "</tr></thead><tbody>";
822 
823  CREScriptEngine engine;
824  std::vector<QScriptValue> items;
825  std::for_each(myDisplayedItems.begin(), myDisplayedItems.end(),
826  [&items, &engine] (QObject* item) { items.push_back(engine.newQObject(item)); });
827 
828  if (!sort.isEmpty())
829  {
830  try
831  {
832  progress.setLabelText(tr("Sorting items..."));
833 
834  engine.pushContext();
835 
836  sort = "(function(left, right) { return " + sort + "; })";
837  QScriptValue sortFun = engine.evaluate(sort);
838  if (!sortFun.isValid() || engine.hasUncaughtException())
839  throw std::runtime_error("A script error happened while compiling the sort criteria:\n" + engine.uncaughtException().toString().toStdString());
840 
841  std::sort(items.begin(), items.end(), [&sortFun, &engine](QScriptValue left, QScriptValue right) {
842  QScriptValueList args;
843  args.push_back(left);
844  args.push_back(right);
845  auto ret = sortFun.call(QScriptValue(), args);
846  if (!ret.isValid() || engine.hasUncaughtException())
847  {
848  throw std::runtime_error("A script error happened while sorting items:\n" + engine.uncaughtException().toString().toStdString());
849  return false;
850  }
851  return ret.isValid() ? ret.toBoolean() : true;
852  });
853  printf("complete");
854  engine.popContext();
855  }
856  catch (std::runtime_error& ex)
857  {
858  QMessageBox::critical(this, "Script error", ex.what(), QMessageBox::Ok);
859  return;
860  }
861  }
862 
863  progress.setLabelText(tr("Generating items text..."));
864  foreach(QScriptValue item, items)
865  {
866  if (progress.wasCanceled())
867  return;
868 
869  text += "<tr>";
870 
871  engine.pushContext();
872  engine.globalObject().setProperty("item", item);
873 
874  foreach(QString field, fields)
875  {
876  text += "<td>";
877  QString data = engine.evaluate(field).toString();
878  if (engine.hasUncaughtException())
879  {
880  QMessageBox::critical(this, "Script error", "A script error happened while display items:\n" + engine.uncaughtException().toString(), QMessageBox::Ok);
881  return;
882  }
883  text += data;
884  text += "</td>\n";
885  }
886  engine.popContext();
887  text += "</tr>\n";
888 
889  progress.setValue(progress.value() + 1);
890  }
891  text += "</tbody>";
892 
893  QStringList footers = report->footer().split("\n");
894  text += "<tfoot>";
895 
896  foreach(QString footer, footers)
897  {
898  text += "<th>" + footer + "</th>";
899  }
900  text += "</tfoot>";
901 
902  text += "</table>";
903  qDebug() << "report finished";
904 
905  CREReportDisplay display(text, tr("Report: '%1'").arg(report->name()));
906  display.exec();
907  progress.hide();
908 }
909 
910 void CREResourcesWindow::fillItem(const QPoint& pos, QMenu* menu)
911 {
912  QTreeWidgetItem* node = myTree->itemAt(pos);
913  if (!node || node->data(0, Qt::UserRole).value<void*>() == NULL)
914  return;
915  CRETreeItem* item = reinterpret_cast<CRETreeItem*>(node->data(0, Qt::UserRole).value<void*>());
916  if (!item)
917  return;
918 
919  item->fillContextMenu(menu);
920 }
921 
922 void CREResourcesWindow::treeCustomMenu(const QPoint & pos)
923 {
924  QMenu menu;
925 
927  {
928  QAction* addMessage = new QAction("add message", &menu);
929  connect(addMessage, SIGNAL(triggered(bool)), this, SLOT(addMessage(bool)));
930  menu.addAction(addMessage);
931  }
932 
933  if (myDisplay & DisplayQuests)
934  {
935  QAction* addQuest = new QAction("add quest", &menu);
936  connect(addQuest, SIGNAL(triggered(bool)), this, SLOT(addQuest(bool)));
937  menu.addAction(addQuest);
938  }
939 
940  fillItem(pos, &menu);
941 
942  if (menu.actions().size() == 0)
943  return;
944  menu.exec(myTree->mapToGlobal(pos));
945 }
946 
948 {
949  auto name = QInputDialog::getText(this, "Create new quest", "New quest code").toStdString();
950  if (name.empty()) {
951  return;
952  }
953  if (getManager()->quests()->find(name)) {
954  QMessageBox::critical(this, "Quest already exists", tr("Quest %1 already exists!").arg(name.data()));
955  return;
956  }
957 
958  auto quest = quest_create(name.data());
959  quest->face = getManager()->faces()->get("quest_generic.111");
961  fillData();
962 }
963 
965 {
966  MessageFile* file = new MessageFile("<new file>");
967  file->setModified();
968  myMessages->messages().append(file);
969  fillData();
970 }
971 
973 {
974  return myResources;
975 }
976 
977 static bool sortRandomMap(const CRERandomMap* left, const CRERandomMap* right)
978 {
979  int name = left->map()->displayName().compare(right->map()->displayName(), Qt::CaseInsensitive);
980  if (name == 0)
981  {
982  if (left->x() < right->x())
983  return true;
984  if (left->x() == right->x() && left->y() < right->y())
985  return true;
986  return false;
987  }
988  return name < 0;
989 }
990 
992 {
993  bool full = false;
995  {
996  QStringList headers;
997  headers << tr("Random maps") << tr("Final map") << tr("Depth");
998  myTree->setHeaderLabels(headers);
999  myTree->sortByColumn(0, Qt::AscendingOrder);
1000  full = true;
1001  }
1002 
1003  QTreeWidgetItem* root = CREUtils::mapNode(NULL);
1004  myTreeItems.append(new CRETreeItemEmpty());
1005  root->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
1006  myTree->addTopLevelItem(root);
1007 
1008  QList<CRERandomMap*> maps = myStore->randomMaps();
1009  qSort(maps.begin(), maps.end(), sortRandomMap);
1010  foreach(CRERandomMap* map, maps)
1011  {
1012  QString source(tr("from %1 [%2, %3]").arg(map->map()->name()).arg(map->x()).arg(map->y()));
1013  QStringList data(source);
1014  if (full)
1015  {
1016  data << map->parameters()->final_map << QString::number(map->parameters()->dungeon_depth);
1017  }
1018  QTreeWidgetItem* leaf = new QTreeWidgetItem(root, QStringList(data));
1019  myTreeItems.append(new CRETTreeItem<CRERandomMap>(map, "Random map"));
1020  leaf->setData(0, Qt::UserRole, QVariant::fromValue<void*>(myTreeItems.last()));
1021  }
1022 
1023  root->setText(0, tr("Random maps [%1]").arg(maps.size()));
1024 
1025  if (full)
1026  {
1027  root->setExpanded(true);
1028  myTree->resizeColumnToContents(0);
1029  }
1030 
1031  addPanel("Random map", new CRERandomMapPanel(this));
1032 }
DisplayMaps
@ DisplayMaps
Definition: CREResourcesWindow.h:26
ScriptFileManager
Definition: ScriptFileManager.h:10
CREResourcesWindow::onReport
void onReport()
Definition: CREResourcesWindow.cpp:699
treasurestruct::chance
uint8_t chance
Definition: treasure.h:70
CREFormulaePanel.h
CREResourcesWindow::myDisplay
DisplayMode myDisplay
Definition: CREResourcesWindow.h:63
CREResourcesWindow::myCurrentPanel
CREPanel * myCurrentPanel
Definition: CREResourcesWindow.h:56
global.h
CREMessagePanel.h
CREResourcesWindow::addMessage
void addMessage(bool)
Definition: CREResourcesWindow.cpp:964
DisplayQuests
@ DisplayQuests
Definition: CREResourcesWindow.h:27
GeneralMessage
Definition: book.h:44
CREFilter::showItem
bool showItem(QObject *item)
Definition: CREFilter.cpp:8
layout
Definition: main.c:85
maps
static std::unordered_map< std::string, mapzone * > maps
Definition: citylife.cpp:93
CREResourcesWindow::onQuickFilter
void onQuickFilter()
Definition: CREResourcesWindow.cpp:753
CREResourcesWindow::fillItem
void fillItem(const QPoint &pos, QMenu *menu)
Definition: CREResourcesWindow.cpp:910
CREGeneralMessagePanel.h
AssetsManager::messages
Messages * messages()
Definition: AssetsManager.h:59
CRETreeItemEmpty
Definition: CRETreeItemEmpty.h:7
CREFacesetsPanel.h
ScriptFileManager.h
CREUtils::generalMessageNode
static QTreeWidgetItem * generalMessageNode()
Definition: CREUtils.cpp:262
MessageManager.h
ResourcesManager
Definition: ResourcesManager.h:28
archininventory.arch
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
Definition: archininventory.py:16
AssetsManager.h
filter
Definition: filter.py:1
DisplayAll
@ DisplayAll
Definition: CREResourcesWindow.h:19
disinfect.a
a
Definition: disinfect.py:13
CREUtils::facesetsNode
static QTreeWidgetItem * facesetsNode()
Definition: CREUtils.cpp:280
CREArtifactPanel.h
CREResourcesWindow::fillScripts
void fillScripts()
Definition: CREResourcesWindow.cpp:622
CREUtils::faceNode
static QTreeWidgetItem * faceNode(QTreeWidgetItem *parent)
Definition: CREUtils.cpp:187
CREFilterDialog
Definition: CREFilterDialog.h:12
CREUtils::archetypeNode
static QTreeWidgetItem * archetypeNode(QTreeWidgetItem *parent)
Definition: CREUtils.cpp:14
CREUtils.h
CREScriptPanel.h
guildoracle.list
list
Definition: guildoracle.py:87
CREFilterDialog.h
CREWrapperObject::setObject
void setObject(object *obj)
Definition: CREWrapperObject.cpp:16
recipe.h
CREUtils::scriptsNode
static QTreeWidgetItem * scriptsNode()
Definition: CREUtils.cpp:253
AssetsManager::animations
AllAnimations * animations()
Definition: AssetsManager.h:49
CREUtils::artifactNode
static QTreeWidgetItem * artifactNode(QTreeWidgetItem *parent)
Definition: CREUtils.cpp:40
CREResourcesWindow::myReportsMenu
QMenu * myReportsMenu
Definition: CREResourcesWindow.h:70
CRERegionPanel
Definition: CRERegionPanel.h:14
DisplayAnimations
@ DisplayAnimations
Definition: CREResourcesWindow.h:21
root
static char root[500]
Definition: mapper.cpp:305
CRERandomMap.h
mad_mage_user.file
file
Definition: mad_mage_user.py:15
CREResourcesWindow::reportsModified
void reportsModified()
first_artifactlist
EXTERN artifactlist * first_artifactlist
Definition: global.h:118
CREResourcesWindow::myFilters
CREFilterDefinitionManager myFilters
Definition: CREResourcesWindow.h:69
CREResourcesWindow::onReportChange
void onReportChange(QObject *object)
Definition: CREResourcesWindow.cpp:801
MessageManager::messages
QList< MessageFile * > & messages()
Definition: MessageManager.cpp:40
CREResourcesWindow::myTree
QTreeWidget * myTree
Definition: CREResourcesWindow.h:55
DisplayScripts
@ DisplayScripts
Definition: CREResourcesWindow.h:29
CREWrapperObject
Definition: CREWrapperObject.h:12
CREResourcesWindow::myMessages
MessageManager * myMessages
Definition: CREResourcesWindow.h:60
CREResourcesWindow::myPanels
QHash< QString, QPointer< CREPanel > > myPanels
Definition: CREResourcesWindow.h:57
ResourcesManager::recipeMaxIngredients
int recipeMaxIngredients() const
Definition: ResourcesManager.cpp:70
ResourcesManager::recipe
const recipestruct * recipe(int ingredients, const QString &name) const
Definition: ResourcesManager.cpp:85
CREResourcesWindow::myTreeItems
QList< CRETreeItem * > myTreeItems
Definition: CREResourcesWindow.h:73
CREResourcesWindow::fillFormulae
void fillFormulae()
Definition: CREResourcesWindow.cpp:371
CRERandomMapPanel
Definition: CRERandomMapPanel.h:10
CREUtils::mapNode
static QTreeWidgetItem * mapNode(QTreeWidgetItem *parent)
Definition: CREUtils.cpp:220
CREUtils::questsNode
static QTreeWidgetItem * questsNode()
Definition: CREUtils.cpp:230
CREQuestPanel
Definition: CREQuestPanel.h:24
CREFilter::filter
const QString & filter() const
Definition: CREFilter.cpp:28
CREResourcesWindow::myStore
CREMapInformationManager * myStore
Definition: CREResourcesWindow.h:59
MessageFile
Definition: MessageFile.h:55
CRERegionPanel.h
CREReportDefinition
Definition: CREReportDefinition.h:7
DisplayTreasures
@ DisplayTreasures
Definition: CREResourcesWindow.h:22
DisplayGeneralMessages
@ DisplayGeneralMessages
Definition: CREResourcesWindow.h:31
getManager
AssetsManager * getManager()
Definition: assets.cpp:329
CRETreasurePanel
Definition: CRETreasurePanel.h:12
treasurestruct
Definition: treasure.h:63
DisplayArtifacts
@ DisplayArtifacts
Definition: CREResourcesWindow.h:24
CREResourcesWindow::onFilter
void onFilter()
Definition: CREResourcesWindow.cpp:689
settings
struct Settings settings
Definition: init.c:39
CREUtils::scriptNode
static QTreeWidgetItem * scriptNode(const ScriptFile *script, QTreeWidgetItem *parent)
Definition: CREUtils.cpp:257
typedata
Definition: define.h:89
regiondef::next
struct regiondef * next
Definition: map.h:276
CREResourcesWindow::onFilterChange
void onFilterChange(QObject *object)
Definition: CREResourcesWindow.cpp:743
quest
Definition: quest.py:1
CREMapInformation
Definition: CREMapInformation.h:13
recipestruct
Definition: recipe.h:10
CREResourcesWindow::fillMessages
void fillMessages()
Definition: CREResourcesWindow.cpp:598
CREResourcesWindow::tree_currentItemChanged
void tree_currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)
Definition: CREResourcesWindow.cpp:230
disinfect.map
map
Definition: disinfect.py:4
CREFilterDefinition.h
titlestruct
Definition: readable.c:107
CREUtils::questNode
static QTreeWidgetItem * questNode(const quest_definition *quest, QTreeWidgetItem *parent)
Definition: CREUtils.cpp:235
CREResourcesWindow::addPanel
void addPanel(QString name, CREPanel *panel)
Definition: CREResourcesWindow.cpp:682
ScriptFile::path
const QString & path() const
Definition: ScriptFile.cpp:36
CREScriptEngine.h
sortRandomMap
static bool sortRandomMap(const CRERandomMap *left, const CRERandomMap *right)
Definition: CREResourcesWindow.cpp:977
AssetsManager::treasures
Treasures * treasures()
Definition: AssetsManager.h:54
ScriptFile.h
CREScriptEngine
Definition: CREScriptEngine.h:6
CREResourcesWindow::myFiltersMenu
QMenu * myFiltersMenu
Definition: CREResourcesWindow.h:67
scriptLessThan
static bool scriptLessThan(const ScriptFile *left, const ScriptFile *right)
Definition: CREResourcesWindow.cpp:617
DisplayMessage
@ DisplayMessage
Definition: CREResourcesWindow.h:28
CREPanel
Definition: CREPanel.h:7
CRETreeItem
Definition: CRETreeItem.h:9
DisplayMode
DisplayMode
Definition: CREResourcesWindow.h:18
AssetsCollection::define
T * define(const Key &name, T *asset)
Definition: AssetsCollection.h:97
CRETreeItemQuest
Definition: CRETreeItemQuest.h:14
CREResourcesWindow::fillData
void fillData()
Definition: CREResourcesWindow.cpp:134
CREResourcesWindow::myFilter
CREFilter myFilter
Definition: CREResourcesWindow.h:64
CREResourcesWindow::myReportsMapper
QSignalMapper myReportsMapper
Definition: CREResourcesWindow.h:71
CREReportDefinition.h
CREResourcesWindow::myFiltersMapper
QSignalMapper myFiltersMapper
Definition: CREResourcesWindow.h:68
CRESettings.h
CREArchetypePanel.h
CREResourcesWindow::clearFilter
void clearFilter()
Definition: CREResourcesWindow.cpp:769
CREResourcesWindow::fillRandomMaps
void fillRandomMaps()
Definition: CREResourcesWindow.cpp:991
CREResourcesWindow::fillQuests
void fillQuests()
Definition: CREResourcesWindow.cpp:579
DisplayArchetypes
@ DisplayArchetypes
Definition: CREResourcesWindow.h:20
CREReportDialog.h
CREWrapperFormulae::setFormulae
void setFormulae(const recipe *rec)
Definition: CREWrapperFormulae.cpp:8
AssetsManager::quests
Quests * quests()
Definition: AssetsManager.h:71
AssetsManager::faces
Faces * faces()
Definition: AssetsManager.h:39
CREArchetypePanel
Definition: CREArchetypePanel.h:15
navar-midane_time.data
data
Definition: navar-midane_time.py:11
python_event.scripts
scripts
Definition: python_event.py:14
CREReportDisplay.h
artifactliststruct
Definition: artifact.h:26
CRERandomMap::y
int y() const
Definition: CRERandomMap.cpp:22
ResourcesManager::recipes
QStringList recipes(int count) const
Definition: ResourcesManager.cpp:75
CREReportDefinitionManager::reports
QList< CREReportDefinition * > & reports()
Definition: CREReportDefinitionManager.cpp:30
CREMapInformationManager::randomMaps
QList< CRERandomMap * > randomMaps()
Definition: CREMapInformationManager.cpp:784
CREResourcesWindow::fillGeneralMessages
void fillGeneralMessages()
Definition: CREResourcesWindow.cpp:644
CRETreeItemEmpty.h
disinfect.count
int count
Definition: disinfect.py:7
CREQuestPanel.h
MessageManager
Definition: MessageManager.h:12
AssetsCollection::get
T * get(const Key &name)
Definition: AssetsCollection.h:66
AssetsCollection::each
void each(std::function< void(T *)> op)
Definition: AssetsCollection.h:135
CREResourcesWindow::filtersModified
void filtersModified()
animate.anim
string anim
Definition: animate.py:20
CREResourcesWindow::treeCustomMenu
void treeCustomMenu(const QPoint &pos)
Definition: CREResourcesWindow.cpp:922
CREResourcesWindow::myFilterButton
QPushButton * myFilterButton
Definition: CREResourcesWindow.h:66
CREWrapperTreasure.h
AssetsManager::facesets
Facesets * facesets()
Definition: AssetsManager.h:65
CREAnimationPanel.h
CREResourcesWindow::fillArchetypes
void fillArchetypes()
Definition: CREResourcesWindow.cpp:312
CREResourcesWindow::addQuest
void addQuest(bool)
Definition: CREResourcesWindow.cpp:947
CREWrapperFormulae
Definition: CREWrapperFormulae.h:13
ScriptFileManager::scripts
QList< ScriptFile * > scripts() const
Definition: ScriptFileManager.cpp:53
CREGeneralMessagePanel
Definition: CREGeneralMessagePanel.h:10
guild_entry.text
text
Definition: guild_entry.py:44
CREResourcesWindow::fillTreasures
void fillTreasures()
Definition: CREResourcesWindow.cpp:275
AssetsManager::archetypes
Archetypes * archetypes()
Definition: AssetsManager.h:44
CREUtils::messageNode
static QTreeWidgetItem * messageNode(const MessageFile *message, QTreeWidgetItem *parent)
Definition: CREUtils.cpp:248
artifactstruct
Definition: artifact.h:14
CREMapInformationManager.h
ResourcesManager.h
CREWrapperFormulae.h
CREMapInformationManager::getMapsForRegion
QList< CREMapInformation * > getMapsForRegion(const QString &region)
Definition: CREMapInformationManager.cpp:764
sortMapInformation
bool sortMapInformation(const CREMapInformation *left, const CREMapInformation *right)
Definition: CREResourcesWindow.cpp:491
title
struct titlestruct title
navar-midane_apply.messages
list messages
Definition: navar-midane_apply.py:8
ScriptFile
Definition: ScriptFile.h:31
CREUtils::formulaeNode
static QTreeWidgetItem * formulaeNode(const recipe *recipe, QTreeWidgetItem *parent)
Definition: CREUtils.cpp:147
CREResourcesWindow::myScripts
ScriptFileManager * myScripts
Definition: CREResourcesWindow.h:62
diamondslots.message
string message
Definition: diamondslots.py:57
CREResourcesWindow::myResources
ResourcesManager * myResources
Definition: CREResourcesWindow.h:61
CREMapInformation::displayName
const QString & displayName() const
Definition: CREMapInformation.cpp:57
MessageFile.h
CREResourcesWindow::myReports
CREReportDefinitionManager myReports
Definition: CREResourcesWindow.h:72
DisplayFacesets
@ DisplayFacesets
Definition: CREResourcesWindow.h:32
CREResourcesWindow::resourcesManager
const ResourcesManager * resourcesManager() const
Definition: CREResourcesWindow.cpp:972
CRERandomMap::x
int x() const
Definition: CRERandomMap.cpp:17
CREResourcesWindow::CREResourcesWindow
CREResourcesWindow(CREMapInformationManager *store, MessageManager *messages, ResourcesManager *resources, ScriptFileManager *scripts, QWidget *parent, DisplayMode mode=DisplayAll)
Definition: CREResourcesWindow.cpp:62
CREFilter.h
CREWrapperArtifact.h
report
Definition: report.py:1
DisplayFormulae
@ DisplayFormulae
Definition: CREResourcesWindow.h:23
item
Definition: item.py:1
DisplayRandomMaps
@ DisplayRandomMaps
Definition: CREResourcesWindow.h:30
CREFacesetsPanel
Definition: CREFacesetsPanel.h:14
CRETreeItemQuest.h
CREResourcesWindow::mySplitter
QSplitter * mySplitter
Definition: CREResourcesWindow.h:58
guildbuy.names
list names
Definition: guildbuy.py:18
CRESettings
Definition: CRESettings.h:9
CREResourcesWindow::fillFaces
void fillFaces()
Definition: CREResourcesWindow.cpp:472
assets.h
CRETTreeItem
Definition: CRETreeItem.h:20
CRERandomMap::map
const CREMapInformation * map() const
Definition: CRERandomMap.cpp:12
CREResourcesWindow::fillArtifacts
void fillArtifacts()
Definition: CREResourcesWindow.cpp:424
CREFilter::setFilter
void setFilter(const QString &filter)
Definition: CREFilter.cpp:33
regions
static std::unordered_map< std::string, Region * > regions
Definition: cfcitybell.cpp:45
get_typedata
const typedata * get_typedata(int itemtype)
Definition: item.c:319
CREReportDialog
Definition: CREReportDialog.h:12
CRERandomMap
Definition: CRERandomMap.h:14
CREUtils::treasureNode
static QTreeWidgetItem * treasureNode(QTreeWidgetItem *parent)
Definition: CREUtils.cpp:81
CRETreasurePanel.h
treasurestruct::next
struct treasurestruct * next
Definition: treasure.h:66
CREUtils::animationNode
static QTreeWidgetItem * animationNode(QTreeWidgetItem *parent)
Definition: CREUtils.cpp:200
CREFilterDefinition
Definition: CREFilterDefinition.h:7
CREWrapperArtifact::setArtifact
void setArtifact(const artifact *art)
Definition: CREWrapperArtifact.cpp:8
CREWrapperArtifact
Definition: CREWrapperArtifact.h:13
CREMessagePanel
Definition: CREMessagePanel.h:20
say.item
dictionary item
Definition: say.py:149
CREFormulaePanel
Definition: CREFormulaePanel.h:13
CREMapPanel
Definition: CREMapPanel.h:11
connect
Definition: connect.py:1
CREResourcesWindow::myDisplayedItems
QList< QObject * > myDisplayedItems
Definition: CREResourcesWindow.h:65
CREResourcesWindow::fillMaps
void fillMaps()
Definition: CREResourcesWindow.cpp:496
hall_of_fame.header
list header
Definition: hall_of_fame.py:38
CREResourcesWindow::updateReports
void updateReports()
Definition: CREResourcesWindow.cpp:776
CREMapInformationManager
Definition: CREMapInformationManager.h:16
face_sets
Definition: image.h:17
CREResourcesWindow.h
replace.current
current
Definition: replace.py:64
quests
static struct_quest ** quests
Definition: mapper.cpp:915
CREMapPanel.h
CRERandomMapPanel.h
first_region
EXTERN region * first_region
Definition: global.h:117
CREUtils::regionNode
static QTreeWidgetItem * regionNode(const QString &name, int count, QTreeWidgetItem *parent)
Definition: CREUtils.cpp:215
CREAnimationPanel
Definition: CREAnimationPanel.h:16
CREPixmap.h
quest_create
quest_definition * quest_create(const char *name)
Definition: Quests.cpp:61
CREFacePanel.h
CREFacePanel
Definition: CREFacePanel.h:14
CREScriptPanel
Definition: CREScriptPanel.h:9
DisplayFaces
@ DisplayFaces
Definition: CREResourcesWindow.h:25
CREReportDisplay
Definition: CREReportDisplay.h:7
CREArtifactPanel
Definition: CREArtifactPanel.h:14
if
if(!(yy_init))
Definition: loader.c:2589
CREResourcesWindow::fillAnimations
void fillAnimations()
Definition: CREResourcesWindow.cpp:258
CREUtils::messagesNode
static QTreeWidgetItem * messagesNode()
Definition: CREUtils.cpp:243
CREResourcesWindow::updateFilters
void updateFilters()
Definition: CREResourcesWindow.cpp:709
CREResourcesWindow::fillFacesets
void fillFacesets()
Definition: CREResourcesWindow.cpp:663
ring_occidental_mages.r
r
Definition: ring_occidental_mages.py:6
CREWrapperObject.h
give.name
name
Definition: give.py:27
CREFilterDefinitionManager::filters
QList< CREFilterDefinition * > & filters()
Definition: CREFilterDefinitionManager.cpp:29
CREResourcesWindow::commitData
void commitData()
Definition: CREResourcesWindow.cpp:224
CREPanel::commitData
virtual void commitData()
Definition: CREPanel.h:15
CREResourcesWindow::~CREResourcesWindow
virtual ~CREResourcesWindow()
Definition: CREResourcesWindow.cpp:125
CREWrapperTreasureList
Definition: CREWrapperTreasure.h:11
regiondef
Definition: map.h:275