separate short_name for packages, moved full_name,short_name and icon_filename to Packaged

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@173 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-25 14:19:36 +00:00
parent f7d12a4114
commit 031266c71b
12 changed files with 41 additions and 63 deletions
+3 -14
View File
@@ -36,18 +36,8 @@ bool Game::isMagic() const {
String Game::typeNameStatic() { return _("game"); }
String Game::typeName() const { return _("game"); }
String Game::fullName() const { return full_name; }
InputStreamP Game::openIconFile() {
if (!icon_filename.empty()) {
return openIn(icon_filename);
} else {
return InputStreamP();
}
}
IMPLEMENT_REFLECTION(Game) {
REFLECT(full_name);
REFLECT_N("icon", icon_filename);
REFLECT_BASE(Packaged);
REFLECT(init_script);
REFLECT(set_fields);
REFLECT(card_fields);
@@ -59,9 +49,8 @@ IMPLEMENT_REFLECTION(Game) {
// REFLECT(word_lists);
}
void Game::validate(Version) {
// a default for the full name
if (full_name.empty()) full_name = name();
void Game::validate(Version v) {
Packaged::validate(v);
// automatic statistics dimensions
{
vector<StatsDimensionP> dims;
-4
View File
@@ -33,8 +33,6 @@ class Game : public Packaged {
public:
Game();
String full_name; ///< Name of this game, for menus etc.
String icon_filename; ///< Filename of icon to use in NewWindow
OptionalScript init_script; ///< Script of variables available to other scripts in this game
vector<FieldP> set_fields; ///< Fields for set information
vector<FieldP> card_fields; ///< Fields on each card
@@ -57,8 +55,6 @@ class Game : public Packaged {
static String typeNameStatic();
virtual String typeName() const;
virtual String fullName() const;
virtual InputStreamP openIconFile();
protected:
virtual void validate(Version);
+1 -1
View File
@@ -21,7 +21,7 @@ LocaleP Locale::byName(const String& name) {
}
IMPLEMENT_REFLECTION(Locale) {
REFLECT(full_name);
REFLECT_BASE(Packaged);
REFLECT_N("menu", translations[LOCALE_CAT_MENU]);
REFLECT_N("help", translations[LOCALE_CAT_HELP]);
REFLECT_N("tool", translations[LOCALE_CAT_TOOL]);
-2
View File
@@ -29,8 +29,6 @@ class GameLocale {
/// A collection of translations of messages
class Locale : public Packaged {
public:
/// Name of this locale
String full_name;
/// Translations of UI strings in each category
map<String,String> translations[LOCALE_CAT_MAX];
/// Translations of game specific texts, by game name
+1 -16
View File
@@ -36,15 +36,6 @@ String StyleSheet::stylesheetName() const {
String StyleSheet::typeNameStatic() { return _("style"); }
String StyleSheet::typeName() const { return _("style"); }
String StyleSheet::fullName() const { return full_name; }
InputStreamP StyleSheet::openIconFile() {
if (!icon_filename.empty()) {
return openIn(icon_filename);
} else {
return game->openIconFile(); // use game icon by default
}
}
StyleP StyleSheet::styleFor(const FieldP& field) {
if (card_style.containsKey(field)) {
return card_style[field];
@@ -70,8 +61,7 @@ IMPLEMENT_REFLECTION(StyleSheet) {
tag.addAlias(300, _("extra style"),_("styling style"));
REFLECT(game);
REFLECT(full_name);
REFLECT_N("icon", icon_filename);
REFLECT_BASE(Packaged);
REFLECT(init_script);
REFLECT(card_width);
REFLECT(card_height);
@@ -90,11 +80,6 @@ IMPLEMENT_REFLECTION(StyleSheet) {
REFLECT(styling_style);
}
void StyleSheet::validate(Version) {
// a default for the full name
if (full_name.empty()) full_name = name();
}
// special behaviour of reading/writing StyleSheetPs: only read/write the name
-5
View File
@@ -27,8 +27,6 @@ class StyleSheet : public Packaged {
StyleSheet();
GameP game; ///< The game this stylesheet is made for
String full_name; ///< Name of this game, for menus etc.
String icon_filename; ///< Filename of icon to use in NewWindow
OptionalScript init_script; ///< Script of variables available to other scripts in this stylesheet
double card_width; ///< The width of a card in pixels
double card_height; ///< The height of a card in pixels
@@ -60,11 +58,8 @@ class StyleSheet : public Packaged {
static String typeNameStatic();
virtual String typeName() const;
virtual String fullName() const;
virtual InputStreamP openIconFile();
protected:
virtual void validate(Version);
DECLARE_REFLECTION();
};