Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/CampaignEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#include "CampaignEditor.h"
#include "MapEdit.h"
#include "Toolkit.h"
#include "StringTable.h"
#include "ChooseMapScreen.h"
Expand Down Expand Up @@ -173,6 +174,7 @@ CampaignMapEntryEditor::CampaignMapEntryEditor(Campaign& campaign, CampaignMapEn
descriptionEditor = new TextArea(420, 195, 180, 225, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "standard", false, entry.getDescription().c_str());
ok = new TextButton(260, 430, 180, 40, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "menu", table.getString("[ok]"), OK);
cancel = new TextButton(450, 430, 180, 40, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "menu", table.getString("[Cancel]"), CANCEL);
editMap = new TextButton(10, 430, 150, 40, ALIGN_SCREEN_CENTERED, ALIGN_SCREEN_CENTERED, "menu", table.getString("[edit map]"), EDITMAP);

std::set<std::string> unlockedBy;
for(unsigned n=0; n<entry.getUnlockedByMaps().size(); ++n)
Expand Down Expand Up @@ -204,6 +206,7 @@ CampaignMapEntryEditor::CampaignMapEntryEditor(Campaign& campaign, CampaignMapEn
addWidget(descriptionEditor);
addWidget(ok);
addWidget(cancel);
addWidget(editMap);
}


Expand Down Expand Up @@ -244,6 +247,13 @@ void CampaignMapEntryEditor::onAction(Widget *source, Action action, int par1, i
{
endExecute(CANCEL);
}
else if (source == editMap)
{
MapEdit mapEdit;
mapEdit.load(entry.getMapFileName());
if (mapEdit.run() == -1)
endExecute(-1);
}
}
else if(action == TEXT_ACTIVATED)
{
Expand Down
3 changes: 3 additions & 0 deletions src/CampaignEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class CampaignMapEntryEditor : public Glob2Screen
OK,
CANCEL,
ISLOCKED,
EDITMAP
};
private:
CampaignMapEntry& entry;
Expand All @@ -87,6 +88,8 @@ class CampaignMapEntryEditor : public Glob2Screen
Button *ok;
/// The cancel button
Button *cancel;
/// Actually edit the map for real
Button* editMap;
/// List of maps that unlock the map thats being edited
CheckList* mapsUnlockedBy;
/// The label for mapsUnlockedBy
Expand Down