Added what's new window

This commit is contained in:
unsettledgames
2021-01-08 16:20:39 +01:00
parent cd5918c656
commit 9b3df20533
8 changed files with 106 additions and 14 deletions

View File

@@ -40,11 +40,14 @@ function closeDialogue () {
popups[i].style.display = 'none';
}
dialogueOpen = false;
if (currentOpenDialogue == "palette-block") {
pbAddToSimplePalette();
}
dialogueOpen = false;
else if (currentOpenDialogue == "features-log") {
showDialogue("new-pixel");
}
}
/** Closes a dialogue window if the user clicks everywhere but in the current window

4
js/_featuresLog.js Normal file
View File

@@ -0,0 +1,4 @@
if (settings.showLog || settings.showLog == undefined) {
console.log("Ok");
showDialogue("features-log", false);
}

View File

@@ -8,5 +8,6 @@ window.onload = function(){
newPixel(getValue('size-width'),getValue('size-height'), getValue('editor-mode'));
else
//otherwise show the new pixel dialog
showDialogue('new-pixel', false);
};
if (settings.showLog != undefined && !settings.showLog)
showDialogue('new-pixel', false);
};

View File

@@ -9,6 +9,7 @@ var settingsFromCookie = Cookies.get('pixelEditorSettings');
if(!settingsFromCookie) {
console.log('settings cookie not found');
settings = {
showLog: true,
switchToChangedColor: true,
enableDynamicCursorOutline: true, //unused - performance
enableBrushPreview: true, //unused - performance
@@ -26,8 +27,9 @@ else{
console.log(settings);
//on clicking the save button in the settings dialog
on('click', 'save-settings', function (){
on('click', 'save-settings', saveSettings);
function saveSettings() {
//check if values are valid
if (isNaN(getValue('setting-numberOfHistoryStates'))) {
alert('Invalid value for numberOfHistoryStates');
@@ -37,6 +39,7 @@ on('click', 'save-settings', function (){
//save new settings to settings object
settings.numberOfHistoryStates = getValue('setting-numberOfHistoryStates');
settings.pixelGridColour = getValue('setting-pixelGridColour');
settings.showLog = false;
// Filling pixel grid again if colour changed
fillPixelGrid();
@@ -46,4 +49,4 @@ on('click', 'save-settings', function (){
//close window
closeDialogue();
});
}

View File

@@ -36,6 +36,7 @@
//=include _colorChanged.js
//=include _initColor.js
//=include _dialogue.js
//=include _featuresLog.js
//=include _updateCursor.js
//=include _drawLine.js
//=include _getCursorPosition.js