mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Addded script functions for exporting, ExportTemplate package type
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@220 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -54,9 +54,6 @@ String Package::name() const {
|
||||
else if ( ext == String::npos) return filename.substr(slash+1);
|
||||
else return filename.substr(slash+1, ext-slash-1);
|
||||
}
|
||||
String Package::fullName() const {
|
||||
return name();
|
||||
}
|
||||
const String& Package::absoluteFilename() const {
|
||||
return filename;
|
||||
}
|
||||
|
||||
@@ -59,8 +59,6 @@ class Package {
|
||||
bool needSaveAs() const;
|
||||
/// Determines the short name of this package: the filename without path or extension
|
||||
String name() const;
|
||||
/// Return the (user friendly) full name of this package, by default equal to name()
|
||||
virtual String fullName() const;
|
||||
/// Return the absolute filename of this file
|
||||
const String& absoluteFilename() const;
|
||||
/// The time this package was last modified
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <data/stylesheet.hpp>
|
||||
#include <data/symbol_font.hpp>
|
||||
#include <data/locale.hpp>
|
||||
#include <data/export_template.hpp>
|
||||
#include <wx/stdpaths.h>
|
||||
|
||||
// ----------------------------------------------------------------------------- : IncludePackage
|
||||
@@ -69,11 +70,12 @@ PackagedP PackageManager::openAny(const String& name) {
|
||||
return p;
|
||||
} else {
|
||||
// load with the right type, based on extension
|
||||
if (fn.GetExt() == _("mse-game")) p = new_shared<Game>();
|
||||
else if (fn.GetExt() == _("mse-style")) p = new_shared<StyleSheet>();
|
||||
else if (fn.GetExt() == _("mse-locale")) p = new_shared<Locale>();
|
||||
else if (fn.GetExt() == _("mse-include")) p = new_shared<IncludePackage>();
|
||||
else if (fn.GetExt() == _("mse-symbol-font")) p = new_shared<SymbolFont>();
|
||||
if (fn.GetExt() == _("mse-game")) p = new_shared<Game>();
|
||||
else if (fn.GetExt() == _("mse-style")) p = new_shared<StyleSheet>();
|
||||
else if (fn.GetExt() == _("mse-locale")) p = new_shared<Locale>();
|
||||
else if (fn.GetExt() == _("mse-include")) p = new_shared<IncludePackage>();
|
||||
else if (fn.GetExt() == _("mse-symbol-font")) p = new_shared<SymbolFont>();
|
||||
else if (fn.GetExt() == _("mse-export-template")) p = new_shared<ExportTemplate>();
|
||||
else {
|
||||
throw PackageError(_("Unrecognized package type: '") + fn.GetExt() + _("'\nwhile trying to open: ") + name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user