mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
update checker
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <util/error.hpp>
|
||||
#include <util/file_utils.hpp>
|
||||
#include <data/game.hpp>
|
||||
#include <data/updater.hpp>
|
||||
#include <data/stylesheet.hpp>
|
||||
#include <data/symbol_font.hpp>
|
||||
#include <data/locale.hpp>
|
||||
@@ -60,13 +61,16 @@ PackagedP PackageManager::openAny(const String& name_, bool just_header) {
|
||||
PackagedP& p = loaded_packages[filename];
|
||||
if (!p) {
|
||||
// load with the right type, based on extension
|
||||
wxFileName fn(filename);
|
||||
if (fn.GetExt() == _("mse-game")) p = make_intrusive<Game>();
|
||||
else if (fn.GetExt() == _("mse-style")) p = make_intrusive<StyleSheet>();
|
||||
else if (fn.GetExt() == _("mse-locale")) p = make_intrusive<Locale>();
|
||||
else if (fn.GetExt() == _("mse-include")) p = make_intrusive<IncludePackage>();
|
||||
else if (fn.GetExt() == _("mse-symbol-font")) p = make_intrusive<SymbolFont>();
|
||||
else if (fn.GetExt() == _("mse-export-template")) p = make_intrusive<ExportTemplate>();
|
||||
wxFileName fn(filename);
|
||||
String ext = fn.GetExt();
|
||||
if (ext == _("mse-style")) p = make_intrusive<StyleSheet>();
|
||||
else if (ext == _("mse-symbol-font")) p = make_intrusive<SymbolFont>();
|
||||
else if (ext == _("mse-include")) p = make_intrusive<IncludePackage>();
|
||||
else if (ext == _("mse-game")) p = make_intrusive<Game>();
|
||||
else if (ext == _("mse-locale")) p = make_intrusive<Locale>();
|
||||
else if (ext == _("mse-export-template")) p = make_intrusive<ExportTemplate>();
|
||||
//else if (ext == _("mse-import-template")) p = make_intrusive<ImportTemplate>();
|
||||
else if (ext == _("mse-updater")) p = make_intrusive<Updater>();
|
||||
else {
|
||||
throw PackageError(_("Unrecognized package type: '") + fn.GetExt() + _("'\nwhile trying to open: ") + name);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
template <typename T> class Defaultable;
|
||||
template <typename T> class Scriptable;
|
||||
DECLARE_POINTER_TYPE(Game);
|
||||
DECLARE_POINTER_TYPE(Updater);
|
||||
DECLARE_POINTER_TYPE(StyleSheet);
|
||||
class Packaged;
|
||||
pair<unique_ptr<wxInputStream>, Packaged*> openFileFromPackage(Packaged* package, const String& name);
|
||||
@@ -109,6 +110,7 @@ public:
|
||||
template <typename T> void handle(Scriptable<T>&);
|
||||
// special behaviour
|
||||
void handle(GameP&);
|
||||
void handle(UpdaterP&);
|
||||
void handle(StyleSheetP&);
|
||||
|
||||
/// Indicate that the last value from getValue() was not handled, allowing it to be handled again
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
template <typename T> class Defaultable;
|
||||
template <typename T> class Scriptable;
|
||||
DECLARE_POINTER_TYPE(Game);
|
||||
DECLARE_POINTER_TYPE(Updater);
|
||||
DECLARE_POINTER_TYPE(StyleSheet);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Writer
|
||||
@@ -72,6 +73,7 @@ public:
|
||||
template <typename T> void handle(const Scriptable<T>&);
|
||||
// special behaviour
|
||||
void handle(const GameP&);
|
||||
void handle(const UpdaterP&);
|
||||
void handle(const StyleSheetP&);
|
||||
|
||||
/// Indentation of the current block
|
||||
|
||||
Reference in New Issue
Block a user