mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
events on script update; fix in cycle_sort; card list updated on value action
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@136 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -141,3 +141,12 @@ TextValueAction* typing_action(const TextValueP& value, size_t start, size_t end
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Event
|
||||
|
||||
String ScriptValueEvent::getName(bool) const {
|
||||
assert(false); // this action is just an event, getName shouldn't be called
|
||||
throw InternalError(_("ScriptValueEvent::getName"));
|
||||
}
|
||||
void ScriptValueEvent::perform(bool) {
|
||||
assert(false); // this action is just an event, it should not be performed
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <util/action_stack.hpp>
|
||||
#include <util/defaultable.hpp>
|
||||
|
||||
class Card;
|
||||
DECLARE_POINTER_TYPE(Value);
|
||||
DECLARE_POINTER_TYPE(TextValue);
|
||||
DECLARE_POINTER_TYPE(ChoiceValue);
|
||||
@@ -72,5 +73,19 @@ TextValueAction* toggle_format_action(const TextValueP& value, const String& tag
|
||||
/// Typing in a TextValue, replace the selection [start...end) with replacement
|
||||
TextValueAction* typing_action(const TextValueP& value, size_t start, size_t end, const String& replacement, const String& action_name);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Event
|
||||
|
||||
/// Notification that a script caused a value to change
|
||||
class ScriptValueEvent : public Action {
|
||||
public:
|
||||
inline ScriptValueEvent(const Card* card, const Value* value) : card(card), value(value) {}
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
|
||||
const Card* card; ///< Card the value is on
|
||||
const Value* value; ///< The modified value
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
#endif
|
||||
|
||||
@@ -99,6 +99,8 @@ void Set::validate(Version file_app_version) {
|
||||
FOR_EACH(v, s.second->data) fix_value_207(v);
|
||||
}
|
||||
*/ }
|
||||
// update scripts
|
||||
script_manager->updateAll();
|
||||
}
|
||||
|
||||
IMPLEMENT_REFLECTION(Set) {
|
||||
|
||||
Reference in New Issue
Block a user