Change "dont show again" in dialogs to checkbox

This commit is contained in:
JannisX11 2023-03-12 12:03:25 +01:00
parent 23b0ef330e
commit 71333cbc27
2 changed files with 19 additions and 17 deletions

View File

@ -742,7 +742,7 @@ function rotateOnAxis(modify, axis, slider) {
}
*/
//Warning
if (Format.rotation_limit && settings.dialog_rotation_limit.value) {
if (Format.rotation_limit && settings.dialog_rotation_limit.value && !Dialog.open) {
var i = 0;
while (i < Cube.selected.length) {
if (Cube.selected[i].rotation[(axis+1)%3] ||
@ -754,11 +754,12 @@ function rotateOnAxis(modify, axis, slider) {
title: tl('message.rotation_limit.title'),
icon: 'rotate_right',
message: tl('message.rotation_limit.message'),
buttons: [tl('dialog.ok'), tl('dialog.dontshowagain')]
}, function(r) {
if (r === 1) {
settings.dialog_rotation_limit.value = false
Settings.save()
checkboxes: {
dont_show_again: {value: false, text: 'dialog.dontshowagain'}
}
}, (button, {dont_show_again}) => {
if (dont_show_again) {
settings.dialog_rotation_limit.set(false);
}
})
return;

View File

@ -420,11 +420,11 @@ class Texture {
translateKey: 'invalid_characters',
message: tl('message.invalid_characters.message', ['a-z0-9._-']),
icon: 'folder_open',
buttons: [tl('dialog.ok'), tl('dialog.dontshowagain')],
confirm: 0,
cancel: 0
}, result => {
if (result === 1) {
checkboxes: {
dont_show_again: {value: false, text: 'dialog.dontshowagain'}
}
}, (button, {dont_show_again}) => {
if (dont_show_again) {
settings.dialog_invalid_characters.set(false);
}
})
@ -734,14 +734,15 @@ class Texture {
Blockbench.showMessageBox({
translateKey: 'loose_texture',
icon: 'folder_open',
buttons: [tl('message.loose_texture.change'), tl('dialog.ok'), tl('dialog.dontshowagain')],
confirm: 0,
cancel: 1
}, result => {
if (result === 0) {
buttons: [tl('dialog.ok'), tl('message.loose_texture.change')],
checkboxes: {
dont_show_again: {value: false, text: 'dialog.dontshowagain'}
}
}, (result, {dont_show_again}) => {
if (result === 1) {
this.reopen()
}
if (result === 2) {
if (dont_show_again) {
settings.dialog_loose_texture.set(false);
}
})