mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix broken palette when swithcing tiles
This commit is contained in:
@ -29,6 +29,8 @@ Events = {
|
|||||||
|
|
||||||
GRID_DISPLAY_STATE_CHANGED: "GRID_DISPLAY_STATE_CHANGED",
|
GRID_DISPLAY_STATE_CHANGED: "GRID_DISPLAY_STATE_CHANGED",
|
||||||
|
|
||||||
|
FRAMESHEET_RELOADED: "FRAMESHEET_RELOADED",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The framesheet was reseted and is now probably drastically different.
|
* The framesheet was reseted and is now probably drastically different.
|
||||||
* Number of frames, content of frames, color used for the palette may have changed.
|
* Number of frames, content of frames, color used for the palette may have changed.
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
// Initialize palette:
|
// Initialize palette:
|
||||||
this.createPalette_(this.framesheet.getUsedColors());
|
this.createPalette_(this.framesheet.getUsedColors());
|
||||||
|
|
||||||
$.subscribe(Events.FRAMESHEET_RESET, $.proxy(function(evt) {
|
$.subscribe(Events.FRAMESHEET_RELOADED, $.proxy(function(evt) {
|
||||||
this.createPalette_(this.framesheet.getUsedColors());
|
this.createPalette_(this.framesheet.getUsedColors());
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@
|
|||||||
var frameCfg = frameConfigurations[i];
|
var frameCfg = frameConfigurations[i];
|
||||||
this.addFrame(new ns.Frame(frameCfg));
|
this.addFrame(new ns.Frame(frameCfg));
|
||||||
}
|
}
|
||||||
|
$.publish(Events.FRAMESHEET_RELOADED);
|
||||||
$.publish(Events.FRAMESHEET_RESET);
|
$.publish(Events.FRAMESHEET_RESET);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw "Could not load serialized framesheet : " + e.message
|
throw "Could not load serialized framesheet : " + e.message
|
||||||
|
Reference in New Issue
Block a user