| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <map> |
| 4 |
#include <vector> |
| 5 |
#include <string> |
| 6 |
|
| 7 |
#include "LogicEditor.h" |
| 8 |
|
| 9 |
#include "wxutil/dialog/DialogBase.h" |
| 10 |
|
| 11 |
namespace objectives |
| 12 |
{ |
| 13 |
|
| 14 |
/* FORWARD DECLS */ |
| 15 |
class ObjectiveEntity; |
| 16 |
|
| 17 |
/** |
| 18 |
* Dialog for displaying and editing the mission success/failure logic |
| 19 |
* which can optionally be different for each difficulty setting. |
| 20 |
*/ |
| 21 |
class MissionLogicDialog : |
| 22 |
public wxutil::DialogBase |
| 23 |
{ |
| 24 |
private: |
| 25 |
// A container for the logic editors of the various difficulty levels |
| 26 |
typedef std::map<int, LogicEditor*> LogicEditorMap; |
| 27 |
LogicEditorMap _logicEditors; |
| 28 |
|
| 29 |
// The objective entity we're working on |
| 30 |
ObjectiveEntity& _objectiveEnt; |
| 31 |
|
| 32 |
public: |
| 33 |
/** |
| 34 |
* Constructor creates widgets. |
| 35 |
* |
| 36 |
* @param parent |
| 37 |
* The parent window for which this dialog should be a transient. |
| 38 |
* |
| 39 |
* @param objectiveEnt |
| 40 |
* The Objective Entity object for which the logic should be edited. |
| 41 |
*/ |
| 42 |
MissionLogicDialog(wxWindow* parent, ObjectiveEntity& objectiveEnt); |
| 43 |
|
| 44 |
// Overrides DialogBase |
| 45 |
int ShowModal(); |
| 46 |
|
| 47 |
private: |
| 48 |
|
| 49 |
// Creates one logic editor for each difficulty level plus the default one |
| 50 |
void createLogicEditors(); |
| 51 |
|
| 52 |
// Populate the logic editors from the objective entity object |
| 53 |
void populateLogicEditors(); |
| 54 |
|
| 55 |
// Writes the contents of the widgets to the objective entity |
| 56 |
void save(); |
| 57 |
}; |
| 58 |
|
| 59 |
} // namespace objectives |