mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
feat: add card regions to declare image slice regions for DFCs
This commit is contained in:
@@ -891,6 +891,8 @@ type:
|
||||
keyword: 关键词
|
||||
keywords: 关键词
|
||||
#_ADD pack: pack type
|
||||
#_ADD card region: card region
|
||||
#_ADD card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: 图形
|
||||
|
||||
@@ -891,6 +891,8 @@ type:
|
||||
keyword: 關鍵詞
|
||||
keywords: 關鍵詞
|
||||
#_ADD pack: pack type
|
||||
#_ADD card region: card region
|
||||
#_ADD card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: 圖形
|
||||
|
||||
@@ -891,6 +891,8 @@ type:
|
||||
keyword: keyword
|
||||
keywords: keywords
|
||||
pack: pack type
|
||||
card region: card region
|
||||
card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: shape
|
||||
|
||||
@@ -891,6 +891,8 @@ type:
|
||||
keyword: keyword
|
||||
keywords: keywords
|
||||
pack: pack type
|
||||
card region: card region
|
||||
card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: shape
|
||||
|
||||
@@ -891,6 +891,8 @@ type:
|
||||
keyword: keyword
|
||||
keywords: keywords
|
||||
pack: pack type
|
||||
card region: card region
|
||||
card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: shape
|
||||
|
||||
@@ -891,6 +891,8 @@ type:
|
||||
keyword: palabra clave
|
||||
keywords: palabras clave
|
||||
pack: mazo
|
||||
#_ADD card region: card region
|
||||
#_ADD card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: forma
|
||||
|
||||
@@ -898,6 +898,8 @@ type:
|
||||
circle: cercle
|
||||
ellipse: ellipse
|
||||
pack: type de pack
|
||||
#_ADD card region: card region
|
||||
#_ADD card regions: card regions
|
||||
square: carré
|
||||
rectangle: rectangle
|
||||
triangle: triangle
|
||||
|
||||
@@ -891,6 +891,8 @@ type:
|
||||
keyword: parola-chiave
|
||||
keywords: parole chiave
|
||||
pack: tipo busta
|
||||
#_ADD card region: card region
|
||||
#_ADD card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: forma
|
||||
|
||||
@@ -889,6 +889,8 @@ type:
|
||||
keyword: キーワード
|
||||
keywords: キーワード
|
||||
#_ADD pack: pack type
|
||||
#_ADD card region: card region
|
||||
#_ADD card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: 形
|
||||
|
||||
@@ -924,6 +924,8 @@ type:
|
||||
keyword: słowo kluczowe (keyword)
|
||||
keywords: słowa kluczowe (keywords)
|
||||
pack: rodzaj paczki (pack type)
|
||||
#_ADD card region: card region
|
||||
#_ADD card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: kształt
|
||||
|
||||
@@ -891,6 +891,8 @@ type:
|
||||
keyword: palavra-chave
|
||||
keywords: palavras-chaves
|
||||
pack: tipo de pacote
|
||||
#_ADD card region: card region
|
||||
#_ADD card regions: card regions
|
||||
|
||||
# Symbol editor shapes
|
||||
shape: forma
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//+----------------------------------------------------------------------------+
|
||||
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
||||
//| Copyright: (C) Twan van Laarhoven and the other MSE developers |
|
||||
//| License: GNU General Public License 2 or later (see file COPYING) |
|
||||
//+----------------------------------------------------------------------------+
|
||||
|
||||
#include <util/prec.hpp>
|
||||
#include <data/card_region.hpp>
|
||||
|
||||
CardRegion::CardRegion()
|
||||
: name("")
|
||||
, x(0.0)
|
||||
, y(0.0)
|
||||
, width(0)
|
||||
, height(0)
|
||||
{}
|
||||
CardRegion::~CardRegion() {}
|
||||
|
||||
IMPLEMENT_REFLECTION(CardRegion) {
|
||||
REFLECT(name);
|
||||
REFLECT(x);
|
||||
REFLECT(y);
|
||||
REFLECT(width);
|
||||
REFLECT(height);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//+----------------------------------------------------------------------------+
|
||||
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
||||
//| Copyright: (C) Twan van Laarhoven and the other MSE developers |
|
||||
//| License: GNU General Public License 2 or later (see file COPYING) |
|
||||
//+----------------------------------------------------------------------------+
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <util/prec.hpp>
|
||||
#include <util/reflect.hpp>
|
||||
#include <script/scriptable.hpp>
|
||||
|
||||
DECLARE_POINTER_TYPE(CardRegion);
|
||||
|
||||
class CardRegion : public IntrusivePtrBase<CardRegion> {
|
||||
public:
|
||||
CardRegion();
|
||||
virtual ~CardRegion();
|
||||
|
||||
String name;
|
||||
double x, y;
|
||||
int width, height;
|
||||
|
||||
private:
|
||||
DECLARE_REFLECTION();
|
||||
};
|
||||
|
||||
inline String type_name(const CardRegion&) {
|
||||
return _TYPE_("card region");
|
||||
}
|
||||
|
||||
inline String type_name(const vector<CardRegionP>&) {
|
||||
return _TYPE_("card regions");
|
||||
}
|
||||
@@ -98,6 +98,7 @@ IMPLEMENT_REFLECTION(StyleSheet) {
|
||||
REFLECT(card_height);
|
||||
REFLECT(card_dpi);
|
||||
REFLECT(card_background);
|
||||
REFLECT(card_regions);
|
||||
REFLECT(init_script);
|
||||
// styling
|
||||
REFLECT(styling_fields);
|
||||
|
||||
@@ -12,11 +12,16 @@
|
||||
#include <util/io/package.hpp>
|
||||
#include <util/real_point.hpp>
|
||||
#include <script/scriptable.hpp>
|
||||
// This isn't strictly needed for this file,
|
||||
// but CardRegion needs to be referenced from _somewhere_ in the codebase for compilation reasons.
|
||||
// Eventually if somewhere else is using the type then this can be removed.
|
||||
#include <data/card_region.hpp>
|
||||
|
||||
DECLARE_POINTER_TYPE(Game);
|
||||
DECLARE_POINTER_TYPE(StyleSheet);
|
||||
DECLARE_POINTER_TYPE(Field);
|
||||
DECLARE_POINTER_TYPE(Style);
|
||||
DECLARE_POINTER_TYPE(CardRegion);
|
||||
|
||||
// ----------------------------------------------------------------------------- : StyleSheet
|
||||
|
||||
@@ -34,6 +39,7 @@ public:
|
||||
double card_height; ///< The height of a card in pixels
|
||||
double card_dpi; ///< The resolution of a card in dots per inch
|
||||
Color card_background; ///< The background color of cards
|
||||
vector<CardRegionP> card_regions;
|
||||
/// The styling for card fields
|
||||
/** The indices should correspond to the card_fields in the Game */
|
||||
IndexMap<FieldP, StyleP> card_style;
|
||||
|
||||
Reference in New Issue
Block a user