Fix broken palette when swithcing tiles
This commit is contained in:
parent
1cd0e89207
commit
324c2b464e
3 changed files with 4 additions and 1 deletions
|
@ -29,6 +29,8 @@ Events = {
|
|||
|
||||
GRID_DISPLAY_STATE_CHANGED: "GRID_DISPLAY_STATE_CHANGED",
|
||||
|
||||
FRAMESHEET_RELOADED: "FRAMESHEET_RELOADED",
|
||||
|
||||
/**
|
||||
* The framesheet was reseted and is now probably drastically different.
|
||||
* Number of frames, content of frames, color used for the palette may have changed.
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
// Initialize palette:
|
||||
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));
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
var frameCfg = frameConfigurations[i];
|
||||
this.addFrame(new ns.Frame(frameCfg));
|
||||
}
|
||||
$.publish(Events.FRAMESHEET_RELOADED);
|
||||
$.publish(Events.FRAMESHEET_RESET);
|
||||
} catch (e) {
|
||||
throw "Could not load serialized framesheet : " + e.message
|
||||
|
|
Loading…
Reference in a new issue