Fix broken palette when swithcing tiles

This commit is contained in:
Vince 2012-09-16 16:16:09 +02:00
parent 1cd0e89207
commit 324c2b464e
3 changed files with 4 additions and 1 deletions

View file

@ -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.

View file

@ -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));

View file

@ -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