mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Reverted resource references for combine_something, you can't use tool_image here, because on MSW that only works for .bmps'
Added dependency stuff to invalidate Choice images; Fixed 'duplicate' in symbol editor git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@197 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -264,7 +264,9 @@ SCRIPT_FUNCTION(symbol_variation) {
|
||||
throw ScriptError(_("Variation of symbol not found ('") + variation + _("')"));
|
||||
} else {
|
||||
// SCRIPT_RETURN(last_update_age() >= value->filename.last_update_age);
|
||||
SCRIPT_RETURN(true);
|
||||
SCRIPT_RETURN(last_update_age() > 1); // the symbol was created/loaded after program start,
|
||||
// don't use cached images
|
||||
// SCRIPT_RETURN(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,10 @@ class ScriptableImage {
|
||||
inline void initDependencies(Context& ctx, const Dependency& dep) const {
|
||||
script.initDependencies(ctx, dep);
|
||||
}
|
||||
/// Invalidate the cached image
|
||||
inline void invalidate() {
|
||||
cache = ScriptImageP();
|
||||
}
|
||||
|
||||
private:
|
||||
OptionalScript script; ///< The script, not really optional
|
||||
|
||||
@@ -279,7 +279,14 @@ void SetScriptManager::alsoUpdate(deque<ToUpdate>& to_update, const vector<Depen
|
||||
}
|
||||
break;
|
||||
} case DEP_STYLE: {
|
||||
// TODO
|
||||
// a generated image has become invalid, there is not much we can do
|
||||
// because the index is not exact enough, it only gives the field
|
||||
StyleSheet* stylesheet = reinterpret_cast<StyleSheet*>(d.data);
|
||||
StyleP style = stylesheet->card_style.at(d.index);
|
||||
style->invalidate();
|
||||
// something changed, send event
|
||||
ScriptStyleEvent change(stylesheet, style.get());
|
||||
set.actions.tellListeners(change, false);
|
||||
break;
|
||||
} case DEP_CARD_COPY_DEP: {
|
||||
// propagate dependencies from another field
|
||||
|
||||
Reference in New Issue
Block a user