Skip to content

Commit 06b3a18

Browse files
committed
dialog active shade opacity is now a setting
1 parent 01ac666 commit 06b3a18

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

scripts/EmuDialog/EmuDialog.gml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function EmuDialog(w, h, title) : EmuCallback(0, 0, w, h, 0, 0) constructor {
1313

1414
self.text = title;
1515

16-
self.active_shade = true;
16+
self.active_shade = EMU_DIALOG_SHADE_ALPHA;
1717
self.close_button = true;
1818

1919
self.changed = false;
@@ -103,8 +103,8 @@ function EmuDialog(w, h, title) : EmuCallback(0, 0, w, h, 0, 0) constructor {
103103
var cby2 = y1 + sprite_get_height(sprite_close);
104104

105105
// tint the screen behind the active dialog (but only once per frame)
106-
if (active && !!active_shade && (drawn_dialog_shade_time != current_time)) {
107-
draw_set_alpha(EMU_DIALOG_SHADE_ALPHA);
106+
if (active && (drawn_dialog_shade_time != current_time)) {
107+
draw_set_alpha(self.active_shade);
108108
draw_rectangle_colour(0, 0, window_get_width(), window_get_height(), EMU_DIALOG_SHADE_COLOR, EMU_DIALOG_SHADE_COLOR, EMU_DIALOG_SHADE_COLOR, EMU_DIALOG_SHADE_COLOR, false);
109109
draw_set_alpha(1);
110110
drawn_dialog_shade_time = current_time;

scripts/dialog_create_preferences/dialog_create_preferences.gml

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ function dialog_create_preferences() {
8080

8181
element = new EmuProgressBar(col1_x, EMU_AUTO, ew, eh, 8, 0, 1, true, Settings.config.focus_alpha, function() {
8282
Settings.config.focus_alpha = self.value;
83+
self.root.active_shade = self.value;
8384
});
8485
element.tooltip = "The opacity behind the active dialog box. Not all dialog boxes may show the opacity, although most will.";
8586
dg.AddContent(element);

scripts/emu_init_customized/emu_init_customized.gml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
// !
1919
#macro EMU_COLOR_WINDOWSKIN Settings.config.color
2020

21-
#macro EMU_DIALOG_SHADE_ALPHA 0.5
21+
// !
22+
#macro EMU_DIALOG_SHADE_ALPHA Settings.config.focus_alpha
2223
#macro EMU_DIALOG_SHADE_COLOR 0x000000
2324

2425
#macro EMU_FONT_DEFAULT FDefault12

0 commit comments

Comments
 (0)