mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Added ScriptableImage plus the beginnings of dependency stuff
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@58 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -179,7 +179,7 @@ IMPLEMENT_REFLECTION(ChoiceStyle) {
|
||||
REFLECT(alignment);
|
||||
REFLECT(colors_card_list);
|
||||
// REFLECT(font);
|
||||
// REFLECT(choice_images);
|
||||
REFLECT(choice_images);
|
||||
// if (tag.reading() && choice_colors.empty())
|
||||
REFLECT(choice_colors);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <data/field.hpp>
|
||||
#include <gfx/gfx.hpp> // for ImageCombine
|
||||
#include <script/scriptable.hpp>
|
||||
#include <script/image.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : ChoiceField
|
||||
|
||||
@@ -115,7 +116,7 @@ class ChoiceStyle : public Style {
|
||||
ChoicePopupStyle popup_style; ///< Style of popups/menus
|
||||
ChoiceRenderStyle render_style; ///< Style of rendering
|
||||
// FontInfo font; ///< Font for drawing text (when RENDER_TEXT)
|
||||
// map<String,ScriptableImage> choice_images; ///< Images for the various choices (when RENDER_IMAGE)
|
||||
map<String,ScriptableImage> choice_images; ///< Images for the various choices (when RENDER_IMAGE)
|
||||
map<String,Color> choice_colors; ///< Colors for the various choices (when color_cardlist)
|
||||
bool colors_card_list;///< Does this field determine colors of the rows in the card list?
|
||||
String mask_filename; ///< Filename of an additional mask over the images
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <data/card.hpp>
|
||||
#include <data/field.hpp>
|
||||
#include <script/value.hpp>
|
||||
#include <script/script_manager.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Set
|
||||
|
||||
@@ -26,8 +27,18 @@ Set::Set(const StyleSheetP& stylesheet)
|
||||
, game(stylesheet->game)
|
||||
{}
|
||||
|
||||
Set::~Set() {}
|
||||
|
||||
|
||||
Context& Set::getContext() {
|
||||
throw "TODO";
|
||||
}
|
||||
|
||||
String Set::typeName() const { return _("set"); }
|
||||
|
||||
void Set::validate() {
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(Set) {
|
||||
tag.addAlias(300, _("style"), _("stylesheet")); // < 0.3.0 used style instead of stylesheet
|
||||
REFLECT(game);
|
||||
|
||||
+14
-2
@@ -13,6 +13,7 @@
|
||||
#include <util/reflect.hpp>
|
||||
#include <util/action_stack.hpp>
|
||||
#include <util/io/package.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
DECLARE_POINTER_TYPE(Card);
|
||||
DECLARE_POINTER_TYPE(Set);
|
||||
@@ -20,6 +21,8 @@ DECLARE_POINTER_TYPE(Game);
|
||||
DECLARE_POINTER_TYPE(StyleSheet);
|
||||
DECLARE_POINTER_TYPE(Field);
|
||||
DECLARE_POINTER_TYPE(Value);
|
||||
class ScriptManager;
|
||||
class Context;
|
||||
|
||||
// ----------------------------------------------------------------------------- : Set
|
||||
|
||||
@@ -32,6 +35,7 @@ class Set : public Packaged {
|
||||
Set(const GameP& game);
|
||||
/// Create a set using the given stylesheet, and its game
|
||||
Set(const StyleSheetP& stylesheet);
|
||||
~Set();
|
||||
|
||||
/// The game this set uses
|
||||
GameP game;
|
||||
@@ -47,10 +51,18 @@ class Set : public Packaged {
|
||||
/// Actions performed on this set and the cards in it
|
||||
ActionStack actions;
|
||||
|
||||
/// A context for performing scripts
|
||||
/** Should only be used from the main thread! */
|
||||
Context& getContext();
|
||||
|
||||
protected:
|
||||
String typeName() const;
|
||||
|
||||
virtual String typeName() const;
|
||||
virtual void validate();
|
||||
|
||||
DECLARE_REFLECTION();
|
||||
private:
|
||||
/// Object for managing and executing scripts
|
||||
scoped_ptr<ScriptManager> script_manager;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user