mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
implemented import formats
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@102 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -7,5 +7,30 @@
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <data/format/formats.hpp>
|
||||
#include <data/set.hpp>
|
||||
#include <data/settings.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- :
|
||||
// ----------------------------------------------------------------------------- : MSE2FileFormat
|
||||
|
||||
/// The file format of MSE2 files
|
||||
class MSE2FileFormat : public FileFormat {
|
||||
public:
|
||||
virtual String extension() { return _("mse-set"); }
|
||||
virtual String name() { return _("Magic Set Editor sets (*.mse-set)"); }
|
||||
virtual bool canImport() { return true; }
|
||||
virtual bool canExport(const Game&) { return true; }
|
||||
virtual SetP importSet(const String& filename) {
|
||||
settings.addRecentFile(filename);
|
||||
SetP set(new Set);
|
||||
set->open(filename);
|
||||
return set;
|
||||
}
|
||||
virtual void exportSet(Set& set, const String& filename) {
|
||||
set.saveAs(filename);
|
||||
set.actions.setSavePoint();;
|
||||
}
|
||||
};
|
||||
|
||||
FileFormatP mse2_file_format() {
|
||||
return new_shared<MSE2FileFormat>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user