diff --git a/includes/script.js b/includes/script.js index e254e28..70814a1 100644 --- a/includes/script.js +++ b/includes/script.js @@ -341,12 +341,19 @@ $(document).ready(function() { var newRoomId = parseInt(_.last(roomNames).replace(/[^\d]+/g, "")) + 1; + var newRoomName = $('#roomName').val(); + // remove invalid chars? what's invalid? newlines? are those possible? + var newRoom = "ROOM " + newRoomId + "\n"; _.each(room, function(row) { newRoom += _.toString(row) + "\n"; }); + if (newRoomName) { + newRoom += "NAME " + newRoomName + "\n"; + } + newRoom += "PAL " + palette.id + "\n"; // write diff --git a/readme.md b/readme.md index f7f04ba..352fd84 100644 --- a/readme.md +++ b/readme.md @@ -38,10 +38,6 @@ croppie.js:182 (mine) if (src.match(/^(file|https)?:\/\/|^\/\//)) { ``` -## known bugs - -* room name doesn't work oops - ## 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*