mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 12:01:23 +01:00
generic confirmationDialog
This commit is contained in:
parent
5477e5ca1e
commit
556e651d52
3 changed files with 73 additions and 63 deletions
|
|
@ -73,7 +73,7 @@ function editResources() {
|
|||
if (cl.contains('resourceModel')) return changeModel(resource, line, el);
|
||||
if (cl.contains('resourceBonus')) return changeBonus(resource, line, el);
|
||||
if (cl.contains('icon-pin')) return pinResource(resource, el);
|
||||
if (cl.contains('icon-trash-empty')) return removeResourcePrompt(resource, line);
|
||||
if (cl.contains('icon-trash-empty')) return removeResource(resource, line);
|
||||
});
|
||||
|
||||
body.addEventListener('change', function (ev) {
|
||||
|
|
@ -694,9 +694,19 @@ function editResources() {
|
|||
openPicker(resource.color, callback, {allowHatching: false});
|
||||
}
|
||||
|
||||
function regenerateCurrentResources() {
|
||||
const message = 'Are you sure you want to regenerate resources? <br>This action cannot be reverted';
|
||||
const onConfirm = () => regenerateResources();
|
||||
confirmationDialog({title: 'Regenerate resources', message, confirm: 'Regenerate', onConfirm});
|
||||
}
|
||||
|
||||
function resourcesRestoreDefaults() {
|
||||
delete pack.resources;
|
||||
regenerateResources();
|
||||
const message = 'Are you sure you want to restore default resources? <br>This action cannot be reverted';
|
||||
const onConfirm = () => {
|
||||
delete pack.resources;
|
||||
regenerateResources();
|
||||
};
|
||||
confirmationDialog({title: 'Restore default resources', message, confirm: 'Restore', onConfirm});
|
||||
}
|
||||
|
||||
function toggleLegend() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue