2024-07-14 19:06:39 +02:00
|
|
|
/*
|
2024-07-22 21:09:57 +02:00
|
|
|
* towneventdialog.h, part of VCMI engine
|
2024-07-14 19:06:39 +02:00
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../StdInc.h"
|
|
|
|
#include <QDialog>
|
|
|
|
#include "../lib/mapObjects/CGTownInstance.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
2024-07-22 21:09:57 +02:00
|
|
|
class TownEventDialog;
|
2024-07-14 19:06:39 +02:00
|
|
|
}
|
|
|
|
|
2024-07-22 21:09:57 +02:00
|
|
|
class TownEventDialog : public QDialog
|
2024-07-14 19:06:39 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2024-07-22 21:09:57 +02:00
|
|
|
explicit TownEventDialog(CGTownInstance & town, QListWidgetItem * item, QWidget * parent);
|
|
|
|
~TownEventDialog();
|
2024-07-14 19:06:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onItemChanged(QStandardItem * item);
|
2024-07-22 21:09:57 +02:00
|
|
|
void on_TownEventDialog_finished(int result);
|
2024-07-14 19:06:39 +02:00
|
|
|
void on_okButton_clicked();
|
|
|
|
void setRowColumnCheckState(QStandardItem * item, int column, Qt::CheckState checkState);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void initPlayers();
|
|
|
|
void initResources();
|
|
|
|
void initBuildings();
|
|
|
|
void initCreatures();
|
|
|
|
|
|
|
|
QVariant playersToVariant();
|
|
|
|
QVariantMap resourcesToVariant();
|
|
|
|
QVariantList buildingsToVariant();
|
|
|
|
QVariantList creaturesToVariant();
|
|
|
|
|
|
|
|
QStandardItem * addBuilding(const CTown & ctown, BuildingID bId, std::set<si32> & remaining);
|
|
|
|
|
2024-07-22 21:09:57 +02:00
|
|
|
Ui::TownEventDialog * ui;
|
2024-07-14 19:06:39 +02:00
|
|
|
CGTownInstance & town;
|
2024-07-26 20:42:16 +02:00
|
|
|
QListWidgetItem * townEventListItem;
|
2024-07-14 19:06:39 +02:00
|
|
|
QMap<QString, QVariant> params;
|
2024-07-26 20:42:16 +02:00
|
|
|
QStandardItemModel buildingsModel;
|
|
|
|
};
|