mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
add dependency checks for card.linked_card_x
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ endif()
|
|||||||
|
|
||||||
# You will most likely get a message about being unable to open hunspell-1.7.lib because pkgconf forgets to add the actual path to
|
# You will most likely get a message about being unable to open hunspell-1.7.lib because pkgconf forgets to add the actual path to
|
||||||
# HUNSPELL_LIBRARIES. If so, uncomment the below line and point it to the correct vcpkg root folder/library.
|
# HUNSPELL_LIBRARIES. If so, uncomment the below line and point it to the correct vcpkg root folder/library.
|
||||||
set(HUNSPELL_LIBRARIES "C:\\src\\vcpkg\\installed\\${VCPKG_TARGET_TRIPLET}\\lib\\hunspell-1.7.lib")
|
#set(HUNSPELL_LIBRARIES "C:\\PATH\\TO\\ROOT\\vcpkg\\installed\\${VCPKG_TARGET_TRIPLET}\\lib\\hunspell-1.7.lib")
|
||||||
message("-- Does this have a full path? If not, and it's just a file name, it's broken: Found Hunspell at ${HUNSPELL_LIBRARIES}")
|
message("-- Does this have a full path? If not, and it's just a file name, it's broken: Found Hunspell at ${HUNSPELL_LIBRARIES}")
|
||||||
|
|
||||||
include_directories("${PROJECT_BINARY_DIR}/src")
|
include_directories("${PROJECT_BINARY_DIR}/src")
|
||||||
|
|||||||
@@ -1143,6 +1143,10 @@ error:
|
|||||||
# error from files
|
# error from files
|
||||||
#TODO: Localize
|
#TODO: Localize
|
||||||
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
||||||
|
#TODO: Localize
|
||||||
|
reserved field name: '%s' is a reserved card field name. Use another name.
|
||||||
|
#TODO: Localize
|
||||||
|
duplicate field name: Duplicate alt card field name '%s' is both an alt for '%s' and '%s'.
|
||||||
no game specified: 没有为 %s 指定游戏类型
|
no game specified: 没有为 %s 指定游戏类型
|
||||||
no stylesheet specified for the set: 没有为套牌制定样式表
|
no stylesheet specified for the set: 没有为套牌制定样式表
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1141,6 +1141,10 @@ error:
|
|||||||
# error from files
|
# error from files
|
||||||
#TODO: Localize
|
#TODO: Localize
|
||||||
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
||||||
|
#TODO: Localize
|
||||||
|
reserved field name: '%s' is a reserved card field name. Use another name.
|
||||||
|
#TODO: Localize
|
||||||
|
duplicate field name: Duplicate alt card field name '%s' is both an alt for '%s' and '%s'.
|
||||||
no game specified: 沒有為 %s 指定游戲類型
|
no game specified: 沒有為 %s 指定游戲類型
|
||||||
no stylesheet specified for the set: 沒有為套牌制定樣式表
|
no stylesheet specified for the set: 沒有為套牌制定樣式表
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1167,6 +1167,10 @@ error:
|
|||||||
# error from files
|
# error from files
|
||||||
#TODO: Localize Section
|
#TODO: Localize Section
|
||||||
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
||||||
|
#TODO: Localize
|
||||||
|
reserved field name: '%s' is a reserved card field name. Use another name.
|
||||||
|
#TODO: Localize
|
||||||
|
duplicate field name: Duplicate alt card field name '%s' is both an alt for '%s' and '%s'.
|
||||||
no game specified: No game specified for the %s
|
no game specified: No game specified for the %s
|
||||||
no stylesheet specified for the set: No stylesheet specified for the set
|
no stylesheet specified for the set: No stylesheet specified for the set
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1055,6 +1055,8 @@ error:
|
|||||||
|
|
||||||
# error from files
|
# error from files
|
||||||
no card fields: Das Spiel '%s' hat keine Kartenfelder. Definieren Sie mindestens ein Kartenfeld.
|
no card fields: Das Spiel '%s' hat keine Kartenfelder. Definieren Sie mindestens ein Kartenfeld.
|
||||||
|
reserved field name: '%s' ist ein reservierter Kartenfeldname. Verwenden Sie einen anderen Namen.
|
||||||
|
duplicate field name: Der alternative Kartenfeldname '%s' ist sowohl eine Alternative zu '%s' als auch zu '%s'.
|
||||||
no game specified: Kein Spiel für %s gewählt
|
no game specified: Kein Spiel für %s gewählt
|
||||||
no stylesheet specified for the set: Kein Stylesheet für diese Edition gewählt
|
no stylesheet specified for the set: Kein Stylesheet für diese Edition gewählt
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1056,6 +1056,8 @@ error:
|
|||||||
|
|
||||||
# error from files
|
# error from files
|
||||||
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
||||||
|
reserved field name: '%s' is a reserved card field name. Use another name.
|
||||||
|
duplicate field name: Duplicate alt card field name '%s' is both an alt for '%s' and '%s'.
|
||||||
no game specified: No game specified for the %s
|
no game specified: No game specified for the %s
|
||||||
no stylesheet specified for the set: No stylesheet specified for the set
|
no stylesheet specified for the set: No stylesheet specified for the set
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1144,6 +1144,10 @@ error:
|
|||||||
# error from files
|
# error from files
|
||||||
#TODO: Localize
|
#TODO: Localize
|
||||||
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
||||||
|
#TODO: Localize
|
||||||
|
reserved field name: '%s' is a reserved card field name. Use another name.
|
||||||
|
#TODO: Localize
|
||||||
|
duplicate field name: Duplicate alt card field name '%s' is both an alt for '%s' and '%s'.
|
||||||
no game specified: Ningún juego especificado para el %s
|
no game specified: Ningún juego especificado para el %s
|
||||||
no stylesheet specified for the set: Ho hay hojas de estilo (stylesheet) especificadas para el Set
|
no stylesheet specified for the set: Ho hay hojas de estilo (stylesheet) especificadas para el Set
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1055,6 +1055,8 @@ error:
|
|||||||
|
|
||||||
# error from files
|
# error from files
|
||||||
no card fields: Le jeu '%s' ne contient aucun champ de carte. Définissez au moins un champ de carte.
|
no card fields: Le jeu '%s' ne contient aucun champ de carte. Définissez au moins un champ de carte.
|
||||||
|
reserved field name: '%s' est un nom de champ réservé. Veuillez utiliser un autre nom.
|
||||||
|
duplicate field name: Le nom de champ alternatif '%s' est un doublon : il s’agit à la fois d’un nom alternatif pour '%s' et '%s'.
|
||||||
no game specified: Pas de jeu spécifié pour le %s
|
no game specified: Pas de jeu spécifié pour le %s
|
||||||
no stylesheet specified for the set: Pas de Style spécifié pour le Set
|
no stylesheet specified for the set: Pas de Style spécifié pour le Set
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1055,6 +1055,8 @@ error:
|
|||||||
|
|
||||||
# error from files
|
# error from files
|
||||||
no card fields: Il gioco '%s' non ha campi carta. Definisci almeno un campo carta.
|
no card fields: Il gioco '%s' non ha campi carta. Definisci almeno un campo carta.
|
||||||
|
reserved field name: '%s' è un nome di campo riservato per la scheda. Utilizzare un altro nome.
|
||||||
|
duplicate field name: Il nome di campo alternativo '%s' è sia un'alternativa per '%s' che per '%s'.
|
||||||
no game specified: Nessun gioco specificato per il %s
|
no game specified: Nessun gioco specificato per il %s
|
||||||
no stylesheet specified for the set: Nessuno stile specificato per il set
|
no stylesheet specified for the set: Nessuno stile specificato per il set
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1144,6 +1144,10 @@ error:
|
|||||||
# error from files
|
# error from files
|
||||||
#TODO: Localize
|
#TODO: Localize
|
||||||
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
||||||
|
#TODO: Localize
|
||||||
|
reserved field name: '%s' is a reserved card field name. Use another name.
|
||||||
|
#TODO: Localize
|
||||||
|
duplicate field name: Duplicate alt card field name '%s' is both an alt for '%s' and '%s'.
|
||||||
no game specified: のゲームに指定された %s
|
no game specified: のゲームに指定された %s
|
||||||
no stylesheet specified for the set: セットのために指定されたスタイルシートはありません
|
no stylesheet specified for the set: セットのために指定されたスタイルシートはありません
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1150,6 +1150,10 @@ error:
|
|||||||
# error from files
|
# error from files
|
||||||
#TODO: Localize
|
#TODO: Localize
|
||||||
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
||||||
|
#TODO: Localize
|
||||||
|
reserved field name: '%s' is a reserved card field name. Use another name.
|
||||||
|
#TODO: Localize
|
||||||
|
duplicate field name: Duplicate alt card field name '%s' is both an alt for '%s' and '%s'.
|
||||||
no game specified: 에 지정된 게임이 없습니다 %s
|
no game specified: 에 지정된 게임이 없습니다 %s
|
||||||
no stylesheet specified for the set: 세트에 지정된 스타일시트가 없습니다
|
no stylesheet specified for the set: 세트에 지정된 스타일시트가 없습니다
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1200,6 +1200,10 @@ error:
|
|||||||
# error from files
|
# error from files
|
||||||
#TODO: Localize
|
#TODO: Localize
|
||||||
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
||||||
|
#TODO: Localize
|
||||||
|
reserved field name: '%s' is a reserved card field name. Use another name.
|
||||||
|
#TODO: Localize
|
||||||
|
duplicate field name: Duplicate alt card field name '%s' is both an alt for '%s' and '%s'.
|
||||||
no game specified: Nie podano gry dla %s
|
no game specified: Nie podano gry dla %s
|
||||||
no stylesheet specified for the set: Nie podano arkusza stylu dla zestawu
|
no stylesheet specified for the set: Nie podano arkusza stylu dla zestawu
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1056,6 +1056,8 @@ error:
|
|||||||
|
|
||||||
# error from files
|
# error from files
|
||||||
no card fields: O jogo '%s' não possui campos de Card. Defina pelo menos um campo de Card.
|
no card fields: O jogo '%s' não possui campos de Card. Defina pelo menos um campo de Card.
|
||||||
|
reserved field name: '%s' é um nome de campo de Card reservado. Use outro nome.
|
||||||
|
duplicate field name: Nome de campo de Card alternativo '%s' é um nome alternativo tanto para '%s' quanto para '%s'.
|
||||||
no game specified: Não há jogo especificado para o %s
|
no game specified: Não há jogo especificado para o %s
|
||||||
no stylesheet specified for the set: Não estilo especificado para a Edição
|
no stylesheet specified for the set: Não estilo especificado para a Edição
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -1195,6 +1195,10 @@ error:
|
|||||||
# error from files
|
# error from files
|
||||||
#TODO: Localize Section
|
#TODO: Localize Section
|
||||||
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
no card fields: Game '%s' does not have any card fields. Define at least one card field.
|
||||||
|
#TODO: Localize
|
||||||
|
reserved field name: '%s' is a reserved card field name. Use another name.
|
||||||
|
#TODO: Localize
|
||||||
|
duplicate field name: Duplicate alt card field name '%s' is both an alt for '%s' and '%s'.
|
||||||
no game specified: No game specified for the %s
|
no game specified: No game specified for the %s
|
||||||
no stylesheet specified for the set: No stylesheet specified for the set
|
no stylesheet specified for the set: No stylesheet specified for the set
|
||||||
stylesheet and set refer to different game:
|
stylesheet and set refer to different game:
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ AddCardAction::AddCardAction(AddingOrRemoving ar, Set& set, const vector<CardP>&
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
String relation(linked_card->getLinkedRelation(linked_index));
|
String relation(linked_card->getLinkedRelation(linked_index));
|
||||||
card_link_actions.push_back(make_intrusive<OneWayLinkCardsAction>(set, linked_card, new_uid, relation, linked_index));
|
card_link_actions.push_back(make_intrusive<OneWayLinkCardsAction>(linked_card, new_uid, relation, linked_index));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,8 +115,8 @@ void ReorderCardsAction::perform(bool to_undo) {
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Link cards
|
// ----------------------------------------------------------------------------- : Link cards
|
||||||
|
|
||||||
OneWayLinkCardsAction::OneWayLinkCardsAction(Set& set, CardP& card, const String& uid, const String& relation, int index)
|
OneWayLinkCardsAction::OneWayLinkCardsAction(CardP& card, const String& uid, const String& relation, int index)
|
||||||
: CardListAction(set), card(card), uid(uid), relation(relation)
|
: card(card), uid(uid), relation(relation)
|
||||||
{
|
{
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0: {
|
case 0: {
|
||||||
|
|||||||
@@ -67,9 +67,9 @@ public:
|
|||||||
// ----------------------------------------------------------------------------- : Link cards
|
// ----------------------------------------------------------------------------- : Link cards
|
||||||
|
|
||||||
/// Add a link between two or more cards
|
/// Add a link between two or more cards
|
||||||
class OneWayLinkCardsAction : public CardListAction {
|
class OneWayLinkCardsAction : public Action {
|
||||||
public:
|
public:
|
||||||
OneWayLinkCardsAction(Set& set, CardP& card, const String& uid, const String& relation, int index);
|
OneWayLinkCardsAction(CardP& card, const String& uid, const String& relation, int index);
|
||||||
|
|
||||||
String getName(bool to_undo) const override;
|
String getName(bool to_undo) const override;
|
||||||
void perform(bool to_undo) override;
|
void perform(bool to_undo) override;
|
||||||
|
|||||||
+37
-5
@@ -22,19 +22,21 @@
|
|||||||
|
|
||||||
Card::Card()
|
Card::Card()
|
||||||
// for files made before we saved these, set the time to 'yesterday', generate a uid
|
// for files made before we saved these, set the time to 'yesterday', generate a uid
|
||||||
: time_created (wxDateTime::Now().Subtract(wxDateSpan::Day()).ResetTime())
|
: game(game_for_reading())
|
||||||
|
, time_created (wxDateTime::Now().Subtract(wxDateSpan::Day()).ResetTime())
|
||||||
, time_modified(wxDateTime::Now().Subtract(wxDateSpan::Day()).ResetTime())
|
, time_modified(wxDateTime::Now().Subtract(wxDateSpan::Day()).ResetTime())
|
||||||
, uid(generate_uid())
|
, uid(generate_uid())
|
||||||
, has_styling(false)
|
, has_styling(false)
|
||||||
{
|
{
|
||||||
if (!game_for_reading()) {
|
if (!game) {
|
||||||
throw InternalError(_("game_for_reading not set"));
|
throw InternalError(_("game_for_reading not set"));
|
||||||
}
|
}
|
||||||
data.init(game_for_reading()->card_fields);
|
data.init(game->card_fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
Card::Card(const Game& game)
|
Card::Card(Game& game)
|
||||||
: time_created (wxDateTime::Now())
|
: game(&game)
|
||||||
|
, time_created (wxDateTime::Now())
|
||||||
, time_modified(wxDateTime::Now())
|
, time_modified(wxDateTime::Now())
|
||||||
, uid(generate_uid())
|
, uid(generate_uid())
|
||||||
, has_styling(false)
|
, has_styling(false)
|
||||||
@@ -259,6 +261,36 @@ IndexMap<FieldP, ValueP>& Card::extraDataFor(const StyleSheet& stylesheet) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void mark_dependency_member(const Card& card, const String& name, const Dependency& dep) {
|
void mark_dependency_member(const Card& card, const String& name, const Dependency& dep) {
|
||||||
|
// is it the uid?
|
||||||
|
if (name == _("uid")) {
|
||||||
|
if (card.game) {
|
||||||
|
card.game->dependent_scripts_uid.add(dep);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// is it the notes?
|
||||||
|
if (name == _("notes")) {
|
||||||
|
if (card.game) {
|
||||||
|
card.game->dependent_scripts_notes.add(dep);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// is it a link?
|
||||||
|
if (
|
||||||
|
name == _("linked_card_1") ||
|
||||||
|
name == _("linked_card_2") ||
|
||||||
|
name == _("linked_card_3") ||
|
||||||
|
name == _("linked_card_4") ||
|
||||||
|
name == _("linked_relation_1") ||
|
||||||
|
name == _("linked_relation_2") ||
|
||||||
|
name == _("linked_relation_3") ||
|
||||||
|
name == _("linked_relation_4")
|
||||||
|
) {
|
||||||
|
if (card.game) {
|
||||||
|
card.game->dependent_scripts_links.add(dep);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
mark_dependency_member(card.data, name, dep);
|
mark_dependency_member(card.data, name, dep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -34,7 +34,10 @@ public:
|
|||||||
/// Default constructor, uses game_for_new_cards to make the game
|
/// Default constructor, uses game_for_new_cards to make the game
|
||||||
Card();
|
Card();
|
||||||
/// Creates a card using the given game
|
/// Creates a card using the given game
|
||||||
Card(const Game& game);
|
Card(Game& game);
|
||||||
|
|
||||||
|
/// The game this card is made for
|
||||||
|
Game* game;
|
||||||
|
|
||||||
/// The values on the fields of the card.
|
/// The values on the fields of the card.
|
||||||
/** The indices should correspond to the card_fields in the Game */
|
/** The indices should correspond to the card_fields in the Game */
|
||||||
|
|||||||
+27
-1
@@ -72,7 +72,7 @@ void Game::add_alt_name_or_warn(const String& alt_name, const String& field_name
|
|||||||
String unified_name = unified_form(alt_name);
|
String unified_name = unified_form(alt_name);
|
||||||
if (card_fields_alt_names.count(unified_name)) {
|
if (card_fields_alt_names.count(unified_name)) {
|
||||||
if (card_fields_alt_names[unified_name] != field_name) {
|
if (card_fields_alt_names[unified_name] != field_name) {
|
||||||
queue_message(MESSAGE_WARNING, _("Duplicate alt card field name ' ") + unified_name + _(" ' is both an alt for: ' ") + field_name + _(" ' and ' ") + card_fields_alt_names[unified_name] + _(" '."));
|
queue_message(MESSAGE_WARNING, _ERROR_3_("duplicate field name", unified_name, field_name, card_fields_alt_names[unified_name]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -115,6 +115,32 @@ void Game::validate(Version v) {
|
|||||||
pack->select = SELECT_NO_REPLACE;
|
pack->select = SELECT_NO_REPLACE;
|
||||||
pack_types.push_back(pack);
|
pack_types.push_back(pack);
|
||||||
}
|
}
|
||||||
|
// check for reserved names
|
||||||
|
for (auto it = card_fields.begin(); it != card_fields.end(); ++it) {
|
||||||
|
FieldP field = *it;
|
||||||
|
String& field_name = field->name;
|
||||||
|
if (
|
||||||
|
field_name == _("data") ||
|
||||||
|
field_name == _("extra_data") ||
|
||||||
|
field_name == _("styling_data") ||
|
||||||
|
field_name == _("has_styling") ||
|
||||||
|
field_name == _("stylesheet") ||
|
||||||
|
field_name == _("time_created") ||
|
||||||
|
field_name == _("time_modified") ||
|
||||||
|
field_name == _("notes") ||
|
||||||
|
field_name == _("uid") ||
|
||||||
|
field_name == _("linked_card_1") ||
|
||||||
|
field_name == _("linked_card_2") ||
|
||||||
|
field_name == _("linked_card_3") ||
|
||||||
|
field_name == _("linked_card_4") ||
|
||||||
|
field_name == _("linked_relation_1") ||
|
||||||
|
field_name == _("linked_relation_2") ||
|
||||||
|
field_name == _("linked_relation_3") ||
|
||||||
|
field_name == _("linked_relation_4")
|
||||||
|
) {
|
||||||
|
queue_message(MESSAGE_ERROR, _ERROR_1_("reserved field name", field_name));
|
||||||
|
}
|
||||||
|
}
|
||||||
// alternate card field names map
|
// alternate card field names map
|
||||||
for (auto it = card_fields.begin(); it != card_fields.end(); ++it) {
|
for (auto it = card_fields.begin(); it != card_fields.end(); ++it) {
|
||||||
FieldP field = *it;
|
FieldP field = *it;
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ public:
|
|||||||
|
|
||||||
Dependencies dependent_scripts_cards; ///< scripts that depend on the card list
|
Dependencies dependent_scripts_cards; ///< scripts that depend on the card list
|
||||||
Dependencies dependent_scripts_keywords; ///< scripts that depend on the keywords
|
Dependencies dependent_scripts_keywords; ///< scripts that depend on the keywords
|
||||||
|
Dependencies dependent_scripts_uid; ///< scripts that depend on the card's uid
|
||||||
|
Dependencies dependent_scripts_notes; ///< scripts that depend on the card's notes
|
||||||
|
Dependencies dependent_scripts_links; ///< scripts that depend on the card's links
|
||||||
Dependencies dependent_scripts_stylesheet; ///< scripts that depend on the card's stylesheet
|
Dependencies dependent_scripts_stylesheet; ///< scripts that depend on the card's stylesheet
|
||||||
bool dependencies_initialized; ///< are the script dependencies comming from this game all initialized?
|
bool dependencies_initialized; ///< are the script dependencies comming from this game all initialized?
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ void StyleSheet::validate(Version ver) {
|
|||||||
if (!game) {
|
if (!game) {
|
||||||
throw Error(_ERROR_1_("no game specified",_TYPE_("stylesheet")));
|
throw Error(_ERROR_1_("no game specified",_TYPE_("stylesheet")));
|
||||||
}
|
}
|
||||||
// a stylsheet depends on the game it is made for
|
// a stylesheet depends on the game it is made for
|
||||||
requireDependency(game.get());
|
requireDependency(game.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -379,6 +379,7 @@ void BulkModificationWindow::onOk(wxCommandEvent&) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
set->actions.addAction(make_unique<BulkAction>(actions, set, card_list_window, actions.size() > 1), false);
|
set->actions.addAction(make_unique<BulkAction>(actions, set, card_list_window, actions.size() > 1), false);
|
||||||
|
set->actions.tellListeners(DisplayChangeAction(),true);
|
||||||
wxMessageDialog dial = wxMessageDialog(this, _ERROR_1_("bulk modify success", String() << actions.size()));
|
wxMessageDialog dial = wxMessageDialog(this, _ERROR_1_("bulk modify success", String() << actions.size()));
|
||||||
dial.ShowModal();
|
dial.ShowModal();
|
||||||
EndModal(wxID_OK);
|
EndModal(wxID_OK);
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ void CardLinkWindow::onOk(wxCommandEvent&) {
|
|||||||
vector<ActionP> actions;
|
vector<ActionP> actions;
|
||||||
for (size_t i = 0; i < free_link_indexes.size(); ++i) {
|
for (size_t i = 0; i < free_link_indexes.size(); ++i) {
|
||||||
if (free_link_indexes[i] >= 0) {
|
if (free_link_indexes[i] >= 0) {
|
||||||
actions.push_back(make_intrusive<OneWayLinkCardsAction>(*set, selected_card, linked_uids[i], linked_relation_string, free_link_indexes[i]));
|
actions.push_back(make_intrusive<OneWayLinkCardsAction>(selected_card, linked_uids[i], linked_relation_string, free_link_indexes[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Find reciprocal free slots and make actions
|
// Find reciprocal free slots and make actions
|
||||||
@@ -165,11 +165,12 @@ void CardLinkWindow::onOk(wxCommandEvent&) {
|
|||||||
for (size_t i = 0; i < linked_cards.size(); ++i) {
|
for (size_t i = 0; i < linked_cards.size(); ++i) {
|
||||||
int free_link_index = linked_cards[i]->findFreeLink(selected_uid, all_existing_uids);
|
int free_link_index = linked_cards[i]->findFreeLink(selected_uid, all_existing_uids);
|
||||||
if (free_link_index >= 0) {
|
if (free_link_index >= 0) {
|
||||||
actions.push_back(make_intrusive<OneWayLinkCardsAction>(*set, linked_cards[i], selected_uid, selected_relation_string, free_link_index));
|
actions.push_back(make_intrusive<OneWayLinkCardsAction>(linked_cards[i], selected_uid, selected_relation_string, free_link_index));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add action to set
|
// Add action to set
|
||||||
set->actions.addAction(make_unique<BulkAction>(actions, set, card_list_window, false), false);
|
set->actions.addAction(make_unique<BulkAction>(actions, set, card_list_window, false), false);
|
||||||
|
set->actions.tellListeners(DisplayChangeAction(),true);
|
||||||
// Done
|
// Done
|
||||||
EndModal(wxID_OK);
|
EndModal(wxID_OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -459,8 +459,8 @@ bool CardListBase::doLink() {
|
|||||||
bool CardListBase::doUnlink(CardP linked_card) {
|
bool CardListBase::doUnlink(CardP linked_card) {
|
||||||
CardP selected_card = getCard();
|
CardP selected_card = getCard();
|
||||||
vector<ActionP> actions;
|
vector<ActionP> actions;
|
||||||
actions.emplace_back(make_intrusive<OneWayLinkCardsAction>(*set, selected_card, _(""), _(""), selected_card->findUIDLink(linked_card->uid)));
|
actions.emplace_back(make_intrusive<OneWayLinkCardsAction>(selected_card, _(""), _(""), selected_card->findUIDLink(linked_card->uid)));
|
||||||
actions.emplace_back(make_intrusive<OneWayLinkCardsAction>(*set, linked_card, _(""), _(""), linked_card->findUIDLink(selected_card->uid)));
|
actions.emplace_back(make_intrusive<OneWayLinkCardsAction>(linked_card, _(""), _(""), linked_card->findUIDLink(selected_card->uid)));
|
||||||
set->actions.addAction(make_unique<BulkAction>(actions, set, this, false), false);
|
set->actions.addAction(make_unique<BulkAction>(actions, set, this, false), false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -556,7 +556,7 @@ bool CardsPanel::canCopy() const { CUT_COPY_PASTE(canCopy, return) }
|
|||||||
void CardsPanel::doCut() { CUT_COPY_PASTE(doCut, return (void)) }
|
void CardsPanel::doCut() { CUT_COPY_PASTE(doCut, return (void)) }
|
||||||
void CardsPanel::doCopy() { CUT_COPY_PASTE(doCopy, return (void)) }
|
void CardsPanel::doCopy() { CUT_COPY_PASTE(doCopy, return (void)) }
|
||||||
|
|
||||||
// always alow pasting cards, even if something else is selected
|
// always allow pasting cards, even if something else is selected
|
||||||
bool CardsPanel::canPaste() const {
|
bool CardsPanel::canPaste() const {
|
||||||
if (card_list->canPaste()) return true;
|
if (card_list->canPaste()) return true;
|
||||||
int id = focused_control(this);
|
int id = focused_control(this);
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
|
|||||||
// - member operator; and it signals a dependency.
|
// - member operator; and it signals a dependency.
|
||||||
// - looper construction
|
// - looper construction
|
||||||
// - + for function composition
|
// - + for function composition
|
||||||
// Variable assignments are performed as normall.
|
// Variable assignments are performed as normal.
|
||||||
// Jumps are tricky:
|
// Jumps are tricky:
|
||||||
// - I_LOOP: We want to prevent infinite loops, the solution is that after the first
|
// - I_LOOP: We want to prevent infinite loops, the solution is that after the first
|
||||||
// iteration we set the looper to a dummy value, so the loop is only executed once.
|
// iteration we set the looper to a dummy value, so the loop is only executed once.
|
||||||
|
|||||||
@@ -203,10 +203,20 @@ void SetScriptManager::onAction(const Action& action, bool undone) {
|
|||||||
updateAllDependend(set.game->dependent_scripts_keywords);
|
updateAllDependend(set.game->dependent_scripts_keywords);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
TYPE_CASE(action, OneWayLinkCardsAction) {
|
||||||
|
updateAllDependend(set.game->dependent_scripts_links, action.card);
|
||||||
|
return;
|
||||||
|
}
|
||||||
TYPE_CASE_(action, ChangeKeywordModeAction) {
|
TYPE_CASE_(action, ChangeKeywordModeAction) {
|
||||||
updateAllDependend(set.game->dependent_scripts_keywords);
|
updateAllDependend(set.game->dependent_scripts_keywords);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
TYPE_CASE(action, ChangeCardNotesAction) {
|
||||||
|
updateAllDependend(set.game->dependent_scripts_notes, action.card);
|
||||||
|
}
|
||||||
|
TYPE_CASE(action, ChangeCardUIDAction) {
|
||||||
|
updateAllDependend(set.game->dependent_scripts_uid, action.card);
|
||||||
|
}
|
||||||
TYPE_CASE(action, ChangeCardStyleAction) {
|
TYPE_CASE(action, ChangeCardStyleAction) {
|
||||||
updateAllDependend(set.game->dependent_scripts_stylesheet, action.card);
|
updateAllDependend(set.game->dependent_scripts_stylesheet, action.card);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user