don't change palette on game data update if not necessary
This commit is contained in:
parent
7d31e398c6
commit
fdd869653a
|
@ -97,6 +97,8 @@ $(document).ready(function() {
|
|||
|
||||
bitsyData.palettes = {};
|
||||
|
||||
// do palettes always go 0..n?
|
||||
// will this cause problems if not?
|
||||
_.each(palettes, function(palette, n) {
|
||||
var thisPalette = {};
|
||||
var name = "";
|
||||
|
@ -156,8 +158,16 @@ $(document).ready(function() {
|
|||
bitsyData.tiles[name] = newTile;
|
||||
});
|
||||
|
||||
// set palette to first imported palette and redraw
|
||||
palette = _.first(_.sortBy(bitsyData.palettes, 'id'));
|
||||
if (_.find(bitsyData.palettes, {'id': palette.id})) {
|
||||
// user has already selected a palette, leave it be
|
||||
|
||||
// if we just set the palette to the newly imported palette with the same ID,
|
||||
// we will lose any changes the user has made to the palettes
|
||||
// is this a big issue considering that the palettes cannot be currently saved anyway?
|
||||
} else {
|
||||
// set palette to first imported palette and redraw
|
||||
palette = _.first(_.sortBy(bitsyData.palettes, 'id'));
|
||||
}
|
||||
|
||||
renderResult();
|
||||
|
||||
|
@ -179,7 +189,7 @@ $(document).ready(function() {
|
|||
);
|
||||
});
|
||||
|
||||
$('tr.palette input[type="radio"]').eq(0).trigger('click');
|
||||
$('input[name="id"][value="' + palette.id + '"]').siblings(':radio').trigger('click');
|
||||
}
|
||||
|
||||
function readFile(input) {
|
||||
|
|
|
@ -40,10 +40,6 @@ croppie.js:182 (mine)
|
|||
if (src.match(/^(file|https)?:\/\/|^\/\//)) {
|
||||
```
|
||||
|
||||
## known bugs
|
||||
|
||||
* keyup on game data input sets palette to pal 0 even if game data has not changed
|
||||
|
||||
## to do
|
||||
|
||||
* allow user to save output as image, or tweet it :) *user can currently right-click -> Save As but the 128x128 size is not great*
|
||||
|
|
Loading…
Reference in New Issue