Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More fixes for TouchControlsEnabler. #1859

Merged
merged 6 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Made by GitMuslim
// Made by GitMuslim, Some fixes by NC-devC

using System;
using System.Text;
Expand Down Expand Up @@ -124,7 +124,7 @@ builder.Replace("{_font}", currentFont);
builder.Replace("{_settingsnumx}", Convert.ToString(settingsnumx));
mobileControlsCreate = builder.ToString();

ImportGMLString("gml_Object_obj_mobilecontrols_Create_0.gml", mobileControlsCreate);
ImportGMLString("gml_Object_obj_mobilecontrols_Create_0", mobileControlsCreate);
ImportGMLFile(Path.Combine(dataPath, "gml_Object_obj_mobilecontrols_Draw_64.gml"), true, false, true);
ImportGMLFile(Path.Combine(dataPath, "gml_Object_obj_mobilecontrols_Other_4.gml"), true, false, true);
Data.Scripts.Add(new UndertaleScript() { Name = Data.Strings.MakeString("scr_add_keys"), Code = Data.Code.ByName("gml_Object_obj_mobilecontrols_Other_4") });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
if (!((os_type == os_android || os_type == os_ios)))
instance_destroy()
settings_font = {_font}
settings_num_x = {_settingsnumx}
zx = 510
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
draw_sprite_ext(spr_black, 0, 0, 0, 1, 1, 0, c_white, black_fade)
var ratio = display_get_gui_width() / 640
var ratioVertical = display_get_gui_height() / 480
draw_sprite_ext(spr_black, 0, 0, 0, (1 * ratio), (1 * ratioVertical), 0, c_white, black_fade)
draw_set_font(settings_font)
draw_sprite_ext(spr_controls_config, 0, 220, 22.5, 2, 2, 0, c_white, text_black_fade)
draw_sprite_ext(spr_button_scale, 0, 120.5, 75, 2, 2, 0, c_white, text_black_fade)
draw_sprite_ext(spr_arrow_leftright, 0, 459.5, 75, 2, 2, 0, c_white, text_black_fade)
draw_sprite_ext(spr_analog_scale, 0, 120.5, 121, 2, 2, 0, c_white, text_black_fade)
draw_sprite_ext(spr_arrow_leftright, 0, 459.5, 121, 2, 2, 0, c_white, text_black_fade)
draw_sprite_ext(spr_analog_type, 0, 124, 167, 2, 2, 0, c_white, text_black_fade)
draw_sprite_ext(spr_arrow_leftright, 0, 459.5, 167, 2, 2, 0, c_white, text_black_fade)
draw_sprite_ext(spr_controls_opacity, 0, 106.5, 213, 2, 2, 0, c_white, text_black_fade)
draw_sprite_ext(spr_arrow_leftright, 0, 459.5, 213, 2, 2, 0, c_white, text_black_fade)
draw_sprite_ext(spr_reset_config, 0, 241, 412.25, 2, 2, 0, c_white, text_black_fade)
draw_text_colour(settings_num_x, 67, button_scale, c_white, c_white, c_white, c_white, text_black_fade)
draw_text_colour(settings_num_x, 113, analog_scale, c_white, c_white, c_white, c_white, text_black_fade)
draw_text_colour(settings_num_x, 159, joystick_type, c_white, c_white, c_white, c_white, text_black_fade)
draw_text_colour(settings_num_x, 205, controls_opacity, c_white, c_white, c_white, c_white, text_black_fade)
draw_sprite_ext(spr_z_button, keyboard_check(ord("Z")), zx, zy, button_scale, button_scale, 0, c_white, controls_opacity)
draw_sprite_ext(spr_x_button, keyboard_check(ord("X")), xx, xy, button_scale, button_scale, 0, c_white, controls_opacity)
draw_sprite_ext(spr_c_button, keyboard_check(ord("C")), cx, cy, button_scale, button_scale, 0, c_white, controls_opacity)
draw_sprite_ext(spr_joybase, joystick_type, analog_posx, analog_posy, analog_scale, analog_scale, 0, c_white, controls_opacity)
draw_sprite_ext(spr_joystick, joystick_type, analog_center_x, analog_center_y, analog_scale, analog_scale, 0, c_white, controls_opacity)
draw_sprite_ext(spr_settings, keyboard_check(92), settingsx, settingsy, button_scale, button_scale, 0, c_white, controls_opacity)
draw_sprite_ext(spr_controls_config, 0, (220 * ratio), (22.5 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_sprite_ext(spr_button_scale, 0, (120.5 * ratio), (75 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_sprite_ext(spr_arrow_leftright, 0, (459.5 * ratio), (75 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_sprite_ext(spr_analog_scale, 0, (120.5 * ratio), (121 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_sprite_ext(spr_arrow_leftright, 0, (459.5 * ratio), (121 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_sprite_ext(spr_analog_type, 0, (124 * ratio), (167 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_sprite_ext(spr_arrow_leftright, 0, (459.5 * ratio), (167 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_sprite_ext(spr_controls_opacity, 0, (106.5 * ratio), (213 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_sprite_ext(spr_arrow_leftright, 0, (459.5 * ratio), (213 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_sprite_ext(spr_reset_config, 0, (241 * ratio), (412.25 * ratioVertical), (2 * ratio), (2 * ratioVertical), 0, c_white, text_black_fade)
draw_text_transformed_colour((settings_num_x * ratio), (67 * ratioVertical), button_scale, (1 * ratio), (1 * ratioVertical), 0, c_white, c_white, c_white, c_white, text_black_fade)
draw_text_transformed_colour((settings_num_x * ratio), (113 * ratioVertical), analog_scale, (1 * ratio), (1 * ratioVertical), 0, c_white, c_white, c_white, c_white, text_black_fade)
draw_text_transformed_colour((settings_num_x * ratio), (159 * ratioVertical), joystick_type, (1 * ratio), (1 * ratioVertical), 0, c_white, c_white, c_white, c_white, text_black_fade)
draw_text_transformed_colour((settings_num_x * ratio), (205 * ratioVertical), controls_opacity, (1 * ratio), (1 * ratioVertical), 0, c_white, c_white, c_white, c_white, text_black_fade)
draw_sprite_ext(spr_z_button, keyboard_check(ord("Z")), (zx * ratio), (zy * ratioVertical), (button_scale * ratio), (button_scale * ratioVertical), 0, c_white, controls_opacity)
draw_sprite_ext(spr_x_button, keyboard_check(ord("X")), (xx * ratio), (xy * ratioVertical), (button_scale * ratio), (button_scale * ratioVertical), 0, c_white, controls_opacity)
draw_sprite_ext(spr_c_button, keyboard_check(ord("C")), (cx * ratio), (cy * ratioVertical), (button_scale * ratio), (button_scale * ratioVertical), 0, c_white, controls_opacity)
draw_sprite_ext(spr_joybase, joystick_type, (analog_posx * ratio), (analog_posy * ratioVertical), (analog_scale * ratio), (analog_scale * ratioVertical), 0, c_white, controls_opacity)
draw_sprite_ext(spr_joystick, joystick_type, (analog_center_x * ratio), (analog_center_y * ratioVertical), (analog_scale * ratio), (analog_scale * ratioVertical), 0, c_white, controls_opacity)
draw_sprite_ext(spr_settings, keyboard_check(ord("\")), (settingsx * ratio), (settingsy * ratioVertical), (button_scale * ratio), (button_scale * ratioVertical), 0, c_white, controls_opacity)
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
virtual_key_zp = virtual_key_add(zx, zy, (27 * button_scale), (29 * button_scale), 125)
virtual_key_xp = virtual_key_add(xx, xy, (27 * button_scale), (29 * button_scale), 124)
virtual_key_cp = virtual_key_add(cx, cy, (27 * button_scale), (29 * button_scale), 94)
virtual_key_analogp = virtual_key_add(analog_posx, analog_posy, (59 * analog_scale), (59 * analog_scale), 93)
virtual_key_settings = virtual_key_add(settingsx, settingsy, (19 * button_scale), (25 * button_scale), 92)

if (edit != 0) return;

virtual_key_z = virtual_key_add(zx, zy, (27 * button_scale), (29 * button_scale), 90)
virtual_key_x = virtual_key_add(xx, xy, (27 * button_scale), (29 * button_scale), 88)
virtual_key_c = virtual_key_add(cx, cy, (27 * button_scale), (29 * button_scale), 67)
virtual_key_up = virtual_key_add((analog_posx - (arrowkeys_back_area_size * analog_scale)), (analog_posy - (arrowkeys_back_area_size * analog_scale)), ((arrowkeys_back_area_size * analog_scale) + ((59 * analog_scale) + (arrowkeys_back_area_size * analog_scale))), ((arrowkeys_area_size * analog_scale) + (arrowkeys_back_area_size * analog_scale)), 38)
virtual_key_right = virtual_key_add(((analog_posx + (59 * analog_scale)) - (arrowkeys_area_size * analog_scale)), (analog_posy - (arrowkeys_back_area_size * analog_scale)), ((arrowkeys_area_size * analog_scale) + (arrowkeys_back_area_size * analog_scale)), (((arrowkeys_back_area_size * analog_scale) + (59 * analog_scale)) + (arrowkeys_back_area_size * analog_scale)), 39)
virtual_key_left = virtual_key_add((analog_posx - (arrowkeys_back_area_size * analog_scale)), (analog_posy - (arrowkeys_back_area_size * analog_scale)), ((arrowkeys_area_size * analog_scale) + (arrowkeys_back_area_size * analog_scale)), ((arrowkeys_back_area_size * analog_scale) + ((59 * analog_scale) + (arrowkeys_back_area_size * analog_scale))), 37)
virtual_key_down = virtual_key_add((analog_posx - (arrowkeys_back_area_size * analog_scale)), ((analog_posy + (59 * analog_scale)) - (arrowkeys_area_size * analog_scale)), (((arrowkeys_back_area_size * analog_scale) + (59 * analog_scale)) + (arrowkeys_back_area_size * analog_scale)), ((arrowkeys_area_size * analog_scale) + (arrowkeys_back_area_size * analog_scale)), 40)
virtual_key_analog = virtual_key_add((analog_posx - (arrowkeys_back_area_size * analog_scale)), (analog_posy - (arrowkeys_back_area_size * analog_scale)), (((59 + arrowkeys_back_area_size) * analog_scale) + (arrowkeys_back_area_size * analog_scale)), (((59 + arrowkeys_back_area_size) * analog_scale) + (arrowkeys_back_area_size * analog_scale)), 126)
var ratio = display_get_gui_width() / 640
var ratioVertical = display_get_gui_height() / 640
virtual_key_zp = virtual_key_add((zx * ratio), (zy * ratioVertical), (27 * button_scale * ratio), (29 * button_scale * ratioVertical), 125)
virtual_key_xp = virtual_key_add((xx * ratio), (xy * ratioVertical), (27 * button_scale * ratio), (29 * button_scale * ratioVertical), 124)
virtual_key_cp = virtual_key_add((cx * ratio), (cy * ratioVertical), (27 * button_scale * ratio), (29 * button_scale * ratioVertical), 94)
virtual_key_analogp = virtual_key_add((analog_posx * ratio), (analog_posy * ratioVertical), (59 * analog_scale * ratio), (59 * analog_scale * ratioVertical), 93)
virtual_key_settings = virtual_key_add((settingsx * ratio), (settingsy * ratioVertical), (19 * button_scale * ratio), (25 * button_scale * ratioVertical), 92)
if (edit != 0)
return;
virtual_key_z = virtual_key_add((zx * ratio), (zy * ratioVertical), (27 * button_scale * ratio), (29 * button_scale * ratioVertical), 90)
virtual_key_x = virtual_key_add((xx * ratio), (xy * ratioVertical), (27 * button_scale * ratio), (29 * button_scale * ratioVertical), 88)
virtual_key_c = virtual_key_add((cx * ratio), (cy * ratioVertical), (27 * button_scale * ratio), (29 * button_scale * ratioVertical), 67)
virtual_key_up = virtual_key_add((analog_posx - arrowkeys_back_area_size * analog_scale * ratio), (analog_posy - arrowkeys_back_area_size * analog_scale * ratioVertical), (arrowkeys_back_area_size * analog_scale * ratio + (59 * analog_scale * ratio + arrowkeys_back_area_size * analog_scale * ratio)), (arrowkeys_area_size * analog_scale * ratioVertical + arrowkeys_back_area_size * analog_scale * ratioVertical), 38)
virtual_key_right = virtual_key_add((analog_posx + 59 * analog_scale * ratio - arrowkeys_area_size * analog_scale * ratio), (analog_posy - arrowkeys_back_area_size * analog_scale * ratioVertical), (arrowkeys_area_size * analog_scale * ratio + arrowkeys_back_area_size * analog_scale * ratio), (arrowkeys_back_area_size * analog_scale * ratioVertical + 59 * analog_scale * ratioVertical + arrowkeys_back_area_size * analog_scale * ratioVertical), 39)
virtual_key_left = virtual_key_add((analog_posx - arrowkeys_back_area_size * analog_scale * ratio), (analog_posy - arrowkeys_back_area_size * analog_scale * ratioVertical), (arrowkeys_area_size * analog_scale * ratio + arrowkeys_back_area_size * analog_scale * ratio), (arrowkeys_back_area_size * analog_scale * ratioVertical + (59 * analog_scale * ratioVertical + arrowkeys_back_area_size * analog_scale * ratioVertical)), 37)
virtual_key_down = virtual_key_add((analog_posx - arrowkeys_back_area_size * analog_scale * ratio), (analog_posy + 59 * analog_scale * ratioVertical - arrowkeys_area_size * analog_scale * ratioVertical), (arrowkeys_back_area_size * analog_scale * ratio + 59 * analog_scale * ratio + arrowkeys_back_area_size * analog_scale * ratio), (arrowkeys_area_size * analog_scale * ratioVertical + arrowkeys_back_area_size * analog_scale * ratioVertical), 40)
virtual_key_analog = virtual_key_add((analog_posx - arrowkeys_back_area_size * analog_scale * ratio), (analog_posy - arrowkeys_back_area_size * analog_scale * ratioVertical), ((59 + arrowkeys_back_area_size) * analog_scale * ratio + arrowkeys_back_area_size * analog_scale * ratio), ((59 + arrowkeys_back_area_size) * analog_scale * ratioVertical + arrowkeys_back_area_size * analog_scale * ratioVertical), 126)
Loading