|
1
|
if (!surface_exists(volume_surf))
|
|
2
|
volume_surf = surface_create(96, 250);
|
|
3
|
if (global.is_console || onSteamDeck())
|
|
4
|
{
|
|
5
|
var xx = x - 14;
|
|
6
|
var loc =
|
|
7
|
{
|
|
8
|
lx: xx - 10,
|
|
9
|
ly: y - 25,
|
|
10
|
rx: xx + 36,
|
|
11
|
ry: y - 25,
|
|
12
|
sx: xx + 20,
|
|
13
|
sy: y - 30,
|
|
14
|
l: "L",
|
|
15
|
r: "R"
|
|
16
|
};
|
|
17
|
var col = 8421504;
|
|
18
|
if (!onSteamDeck())
|
|
19
|
{
|
|
20
|
if (scr_shoulder_lb() || scr_shoulder_rb())
|
|
21
|
col = 16777215;
|
|
22
|
}
|
|
23
|
else
|
|
24
|
{
|
|
25
|
if (scr_shoulder_lb() || scr_shoulder_rb())
|
|
26
|
col = 16777215;
|
|
27
|
loc =
|
|
28
|
{
|
|
29
|
lx: ((xx - 10) + 4) - 4,
|
|
30
|
ly: ((y - 25) + 4) - 9,
|
|
31
|
rx: (xx + 36 + 4) - 4,
|
|
32
|
ry: ((y - 25) + 4) - 9,
|
|
33
|
sx: xx + 20 + 4,
|
|
34
|
sy: (y - 30) + 4,
|
|
35
|
l: "L",
|
|
36
|
r: "R"
|
|
37
|
};
|
|
38
|
}
|
|
39
|
if (os_type == os_ps4 || os_type == os_ps5)
|
|
40
|
{
|
|
41
|
loc =
|
|
42
|
{
|
|
43
|
lx: xx - 10 - 4,
|
|
44
|
ly: y - 25 - 12,
|
|
45
|
rx: (xx + 36) - 4,
|
|
46
|
ry: y - 25 - 12,
|
|
47
|
sx: xx + 20,
|
|
48
|
sy: y - 30,
|
|
49
|
l: "L",
|
|
50
|
r: "R"
|
|
51
|
};
|
|
52
|
}
|
|
53
|
col = merge_color(c_gray, c_white, clamp(obj_mike_controller.microphone_volume2 / 50, 0, 1));
|
|
54
|
if (global.input_g[4] != gp_shoulderrb)
|
|
55
|
{
|
|
56
|
draw_set_color(col);
|
|
57
|
draw_sprite_ext(scr_getbuttonspritescr_getbuttonsprite
function scr_getbuttonsprite(arg0, arg1)
{
var control = arg0;
var isString = arg1;
var button = noone;
var is_dualshock = os_type == os_ps4 || global.gamepad_type == "Sony DualShock 4";
var is_dualsense = os_type == os_ps5 || global.gamepad_type == "DualSense Wireless Controller";
var button_sprite = button_questionmark;
var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71);
if (isString)
{
if (control == "A")
{
button_sprite = button_xbox_left;
if (scr_is_switch_os())
{
button_sprite = button_switch_left_0;
}
else if (is_dualshock || is_dualsense)
{
button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left;
if (is_dualsense)
button_sprite = invert ? button_ps4_dpad_left_dark : button_ps5_dpad_left;
}
return button_sprite;
}
if (control == "D")
{
button_sprite = button_xbox_right;
if (scr_is_switch_os())
{
button_sprite = button_switch_right_0;
}
else if (is_dualshock || is_dualsense)
{
button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right;
if (is_dualsense)
button_sprite = invert ? button_ps4_dpad_right_dark : button_ps5_dpad_right;
}
return button_sprite;
}
if (control == "W")
{
button_sprite = button_xbox_up;
if (scr_is_switch_os())
{
button_sprite = button_switch_up_0;
}
else if (is_dualshock || is_dualsense)
{
button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up;
if (is_dualsense)
button_sprite = invert ? button_ps4_dpad_up_dark : button_ps5_dpad_up;
}
return button_sprite;
}
if (control == "S")
{
button_sprite = button_xbox_down;
if (scr_is_switch_os())
{
button_sprite = button_switch_down_0;
}
else if (is_dualshock || is_dualsense)
{
button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down;
if (is_dualsense)
button_sprite = invert ? button_ps4_dpad_down_dark : button_ps5_dpad_down;
}
return button_sprite;
}
if (control == "l")
{
button_sprite = button_xbox_left_bumper;
if (is_dualshock || is_dualsense)
{
button_sprite = button_ps4_l1;
if (is_dualsense)
button_sprite = button_ps5_l1;
}
if (scr_is_switch_os())
button_sprite = button_switch_l_0;
return button_sprite;
}
if (control == "L")
{
button_sprite = button_xbox_left_trigger;
if (is_dualshock || is_dualsense)
{
button_sprite = button_ps4_l2;
if (is_dualsense)
button_sprite = button_ps5_l2;
}
if (scr_is_switch_os())
button_sprite = button_switch_zl_0;
return button_sprite;
}
if (control == "r")
{
button_sprite = button_xbox_right_bumper;
if (is_dualshock || is_dualsense)
... (loc.r, true), 0, lerp(loc.lx, loc.rx, 0.5), loc.ly, 2, 2, 0, col, 1);
|
|
58
|
}
|
|
59
|
else if (obj_gamecontroller.gamepad_shoulderlb_reassign)
|
|
60
|
{
|
|
61
|
draw_set_color(col);
|
|
62
|
draw_sprite_ext(scr_getbuttonspritescr_getbuttonsprite
function scr_getbuttonsprite(arg0, arg1)
{
var control = arg0;
var isString = arg1;
var button = noone;
var is_dualshock = os_type == os_ps4 || global.gamepad_type == "Sony DualShock 4";
var is_dualsense = os_type == os_ps5 || global.gamepad_type == "DualSense Wireless Controller";
var button_sprite = button_questionmark;
var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71);
if (isString)
{
if (control == "A")
{
button_sprite = button_xbox_left;
if (scr_is_switch_os())
{
button_sprite = button_switch_left_0;
}
else if (is_dualshock || is_dualsense)
{
button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left;
if (is_dualsense)
button_sprite = invert ? button_ps4_dpad_left_dark : button_ps5_dpad_left;
}
return button_sprite;
}
if (control == "D")
{
button_sprite = button_xbox_right;
if (scr_is_switch_os())
{
button_sprite = button_switch_right_0;
}
else if (is_dualshock || is_dualsense)
{
button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right;
if (is_dualsense)
button_sprite = invert ? button_ps4_dpad_right_dark : button_ps5_dpad_right;
}
return button_sprite;
}
if (control == "W")
{
button_sprite = button_xbox_up;
if (scr_is_switch_os())
{
button_sprite = button_switch_up_0;
}
else if (is_dualshock || is_dualsense)
{
button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up;
if (is_dualsense)
button_sprite = invert ? button_ps4_dpad_up_dark : button_ps5_dpad_up;
}
return button_sprite;
}
if (control == "S")
{
button_sprite = button_xbox_down;
if (scr_is_switch_os())
{
button_sprite = button_switch_down_0;
}
else if (is_dualshock || is_dualsense)
{
button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down;
if (is_dualsense)
button_sprite = invert ? button_ps4_dpad_down_dark : button_ps5_dpad_down;
}
return button_sprite;
}
if (control == "l")
{
button_sprite = button_xbox_left_bumper;
if (is_dualshock || is_dualsense)
{
button_sprite = button_ps4_l1;
if (is_dualsense)
button_sprite = button_ps5_l1;
}
if (scr_is_switch_os())
button_sprite = button_switch_l_0;
return button_sprite;
}
if (control == "L")
{
button_sprite = button_xbox_left_trigger;
if (is_dualshock || is_dualsense)
{
button_sprite = button_ps4_l2;
if (is_dualsense)
button_sprite = button_ps5_l2;
}
if (scr_is_switch_os())
button_sprite = button_switch_zl_0;
return button_sprite;
}
if (control == "r")
{
button_sprite = button_xbox_right_bumper;
if (is_dualshock || is_dualsense)
... (loc.l, true), 0, lerp(loc.lx, loc.rx, 0.5), loc.ly, 2, 2, 0, col, 1);
|
|
63
|
}
|
|
64
|
draw_set_color(-1);
|
|
65
|
}
|
|
66
|
surface_set_target(volume_surf);
|
|
67
|
draw_clear_alpha(c_white, 0);
|
|
68
|
draw_set_halign(fa_left);
|
|
69
|
draw_sprite(spr_tensionbar, 1, 0, 0);
|
|
70
|
var vol_x = 3;
|
|
71
|
var vol_y = 0;
|
|
72
|
var vol_w = 18;
|
|
73
|
var vol_h = 195;
|
|
74
|
draw_set_colour(merge_colour(c_red, c_black, 0.75));
|
|
75
|
ossafe_fill_rectangle(vol_x, vol_y, vol_x + vol_w, vol_y + (vol_h * 0.1), 0);
|
|
76
|
draw_set_colour(merge_colour(c_yellow, c_black, 0.75));
|
|
77
|
ossafe_fill_rectangle(vol_x, vol_y + (vol_h * 0.1), vol_x + vol_w, vol_y + (vol_h * 0.4), 0);
|
|
78
|
draw_set_colour(merge_colour(c_green, c_black, 0.75));
|
|
79
|
ossafe_fill_rectangle(vol_x, vol_y + (vol_h * 0.4), vol_x + vol_w, vol_y + (vol_h * 0.9), 0);
|
|
80
|
draw_set_colour(merge_colour(c_aqua, c_black, 0.75));
|
|
81
|
ossafe_fill_rectangle(vol_x, vol_y + (vol_h * 0.9), vol_x + vol_w, vol_y + vol_h, 0);
|
|
82
|
with (obj_mike_controller)
|
|
83
|
microphone_volume2 += ((microphone_volume - microphone_volume2) * 0.25);
|
|
84
|
var vol_colour = 16776960;
|
|
85
|
if (obj_mike_controller.microphone_volume2 > 10)
|
|
86
|
vol_colour = 65280;
|
|
87
|
if (obj_mike_controller.microphone_volume2 > 60)
|
|
88
|
vol_colour = 65535;
|
|
89
|
if (obj_mike_controller.microphone_volume2 > 90)
|
|
90
|
vol_colour = 255;
|
|
91
|
draw_set_colour(vol_colour);
|
|
92
|
ossafe_fill_rectangle(vol_x, vol_y + 1 + vol_h, vol_x + vol_w, ((vol_y - 2) + vol_h) - min(vol_h, (obj_mike_controller.microphone_volume2 / 100) * vol_h), 0);
|
|
93
|
gpu_set_blendmode(bm_subtract);
|
|
94
|
draw_sprite_ext(spr_tensionbar_cutout, 0, 0, 0, 1, 1, 0, c_white, 1);
|
|
95
|
gpu_set_blendmode(bm_normal);
|
|
96
|
surface_reset_target();
|
|
97
|
draw_surface(volume_surf, x, y);
|
|
98
|
draw_sprite(spr_volume_logo, 0, x - 30, y + 30);
|
|
99
|
draw_set_color(c_white);
|
|
100
|
scr_84_set_draw_fontscr_84_set_draw_font
function scr_84_set_draw_font(arg0)
{
global.chemg_font = arg0;
draw_set_font(scr_84_get_font(arg0));
} ("mainbig");
|
|
101
|
temp = round(obj_mike_controller.microphone_volume2);
|
|
102
|
if (temp < 100)
|
|
103
|
{
|
|
104
|
draw_text(x - 30, y + 70, string(temp));
|
|
105
|
draw_text(x - 25, y + 95, "%");
|
|
106
|
}
|
|
107
|
else
|
|
108
|
{
|
|
109
|
draw_set_color(c_yellow);
|
|
110
|
draw_text(x - 28, y + 70, "M");
|
|
111
|
draw_text(x - 24, y + 90, "A");
|
|
112
|
draw_text(x - 20, y + 110, "X");
|
|
113
|
}
|