Highlight the most interesting button in a dialog

This commit is contained in:
Eevee (Evelyn Woods) committed 2024-04-16 23:58:47 -06:00
1 parent 7e0c1b0337
commit ba11e48c7d
2 files changed
+12 -9

No files matched your search

+7 -4
View File
@@ -234,8 +234,11 @@ export class DialogOverlay extends Overlay {
this.header.append(mk('h1', {}, title));
}
add_button(label, onclick) {
add_button(label, onclick, is_default) {
let button = mk('button', {type: 'button'}, label);
if (is_default) {
button.classList.add('button-bright');
}
button.addEventListener('click', onclick);
this.footer.append(button);
return button;
@@ -252,9 +255,9 @@ export class AlertOverlay extends DialogOverlay {
super(conductor);
this.set_title(title);
this.main.append(mk('p', {}, message));
this.add_button("a'ight", ev => {
this.add_button("a'ight", () => {
this.close();
});
}, true);
}
}
@@ -267,7 +270,7 @@ export class ConfirmOverlay extends DialogOverlay {
this.add_button("yep", ev => {
this.close();
what();
});
}, true);
this.add_button("nope", ev => {
this.close();
});
+5 -5
View File
@@ -2965,7 +2965,7 @@ class LevelErrorOverlay extends DialogOverlay {
);
this.add_button("welp, you get what you pay for", ev => {
this.close();
});
}, true);
}
}
@@ -3197,7 +3197,7 @@ class OptionsOverlay extends DialogOverlay {
this.conductor.reload_all_options();
this.close();
});
}, true);
this.add_button("forget it", () => {
// Restore the player's music volume just in case
if (this.original_music_volume !== undefined) {
@@ -3412,7 +3412,7 @@ class CompatOverlay extends DialogOverlay {
this.save();
this.remember();
this.close();
});
}, true);
this.add_button("save for this session only", () => {
this.save();
this.close();
@@ -3528,7 +3528,7 @@ class PackTestDialog extends DialogOverlay {
this.add_button("close", () => {
this.close();
});
}, true);
this.renderer = new CanvasRenderer(this.conductor.tilesets['ll'], 16);
}
@@ -3868,7 +3868,7 @@ class LevelBrowserOverlay extends DialogOverlay {
this.add_button("nevermind", ev => {
this.close();
});
}, true);
}
open() {