mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Fixed: choice images were generated with the wrong context from invalidate()
Choice thumbnails are now checked to not be 'local' before reading from cache, fixes issue with wrong rarity symbol in the drop down list; Disabled unimplemented menu items; Multiple choice items for RENDER_LIST are now zoomed, and positioning is on rotated cards is fixed. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@650 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+1
-1
@@ -135,7 +135,7 @@ class Style : public IntrusivePtrVirtualBase {
|
||||
/** In particular, if dep == DEP_DUMMY and name is a content property, set dep.index=true */
|
||||
virtual void markDependencyMember(const String& name, const Dependency&) const;
|
||||
/// Invalidate scripted images for this style
|
||||
virtual void invalidate(Context&) {}
|
||||
virtual void invalidate() {}
|
||||
|
||||
/// Add a StyleListener
|
||||
void addListener(StyleListener*);
|
||||
|
||||
@@ -239,21 +239,15 @@ void ChoiceStyle::initDependencies(Context& ctx, const Dependency& dep) const {
|
||||
ci.second.initDependencies(ctx, dep);
|
||||
}
|
||||
}
|
||||
void ChoiceStyle::invalidate(Context& ctx) {
|
||||
void ChoiceStyle::invalidate() {
|
||||
// TODO : this is also done in update(), once should be enough
|
||||
// Update choice images and thumbnails
|
||||
bool change = false;
|
||||
int end = field().choices->lastId();
|
||||
thumbnails_status.resize(end, THUMB_NOT_MADE);
|
||||
for (int i = 0 ; i < end ; ++i) {
|
||||
String name = cannocial_name_form(field().choices->choiceName(i));
|
||||
ScriptableImage& img = choice_images[name];
|
||||
if (img.update(ctx)) {
|
||||
change = true;
|
||||
thumbnails_status[i] = THUMB_CHANGED;
|
||||
}
|
||||
if (thumbnails_status[i] == THUMB_OK) thumbnails_status[i] = THUMB_CHANGED;
|
||||
}
|
||||
if (change) tellListeners(CHANGE_OTHER);
|
||||
tellListeners(CHANGE_OTHER);
|
||||
}
|
||||
|
||||
void ChoiceStyle::loadMask(Package& pkg) {
|
||||
|
||||
@@ -130,9 +130,9 @@ enum ChoiceRenderStyle
|
||||
};
|
||||
|
||||
enum ThumbnailStatus
|
||||
{ THUMB_NOT_MADE
|
||||
, THUMB_OK
|
||||
, THUMB_CHANGED
|
||||
{ THUMB_NOT_MADE // there is no image
|
||||
, THUMB_OK // image is ok
|
||||
, THUMB_CHANGED // there is an image, but it may need to be updated
|
||||
};
|
||||
|
||||
/// The Style for a ChoiceField
|
||||
@@ -165,7 +165,7 @@ class ChoiceStyle : public Style {
|
||||
|
||||
virtual int update(Context&);
|
||||
virtual void initDependencies(Context&, const Dependency&) const;
|
||||
virtual void invalidate(Context&);
|
||||
virtual void invalidate();
|
||||
|
||||
private:
|
||||
DECLARE_REFLECTION();
|
||||
|
||||
Reference in New Issue
Block a user