diff --git a/SCRIPTS.md b/SCRIPTS.md index af934641a..6a55fa8a8 100644 --- a/SCRIPTS.md +++ b/SCRIPTS.md @@ -27,7 +27,9 @@ They are relatively self-explanatory, but there are also some helpful general-pu - `EditGMS2TileData.csx`: A temporary script to help edit tile data in GMS2 games. - `ExternalizeAllOGGs.csx`: Script to externalize all OGG sound effects from a game. - `FancyRoomSelect.csx`: Script to make selecting and teleporting to different rooms in a game very user-friendly. +- `FixAlphysLabCrashAndroid.csx`: Script that fixes a crash at Alphys's lab on Android devices. - `ReloadDeltaruneJSON.csx`: Script to add a hotkey to Deltarune, which reloads the language JSON. +- `TouchControlsEnabler.csx`: Adds mobile touch controls to an Undertale or Deltarune data.win. - `TTFFonts (Deltarune).csx`: Marks all fonts in Deltarune to be externally loaded. Does not handle Japanese text. - `UndertaleWithJSONs.csx`: This script JSONifies all Undertale versions with Japanese support, 1.05+. Switch languages using F11. Reload text for curent language from JSON on command using F12. Reloading from JSON may take about 10 seconds. @@ -77,14 +79,15 @@ For individual script credits, look at the source for any given script. Often, c Here is the list of contributors as of writing: - Agentalex9 -- BenjaminUrquhart -- colinator27 -- Grossley -- Kneesnap -- krzys_h +- [BenjaminUrquhart](https://github.com/BenjaminUrquhart) +- [colinator27](https://github.com/colinator27) +- [GitMuslim](https://github.com/GitMuslim) +- [Grossley](https://github.com/Grossley) +- [Kneesnap](https://github.com/Kneesnap) +- [krzys_h](https://github.com/krzys-h) - Lassebq - mono21400 -- nik (the cat) +- [nik (the cat)](https://github.com/nkrapivin) - samuelroy21 (among others from the DSG team) - Yokim (Jockeholm) diff --git a/UndertaleModTool/Scripts/Community Scripts/FixAlphysLabCrashAndroid.csx b/UndertaleModTool/Scripts/Community Scripts/FixAlphysLabCrashAndroid.csx new file mode 100644 index 000000000..7ce378a00 --- /dev/null +++ b/UndertaleModTool/Scripts/Community Scripts/FixAlphysLabCrashAndroid.csx @@ -0,0 +1,18 @@ +// Made by GitMuslim + +using System; +using System.IO; +using System.Threading.Tasks; +using System.Linq; +using UndertaleModLib.Util; + +EnsureDataLoaded(); + +if (Data.GeneralInfo?.DisplayName?.Content.ToLower() != "undertale") +{ + ScriptError("Error 0: Compatible with Undertale only"); + return; +} +ReplaceTextInGML("gml_Object_obj_labdarkness_Create_0", "glowamt = 0.5\nif (global.plot > 125)\n instance_destroy()\nif (scr_murderlv() >= 12)\n instance_destroy()", ""); +ReplaceTextInGML("gml_Object_obj_labdarkness_Draw_0", "x1 = (obj_mainchara.x - 10)\nx2 = (obj_mainchara.x + 30)\ny1 = (obj_mainchara.y - 5)\ny2 = (obj_mainchara.y + 35)\ndraw_sprite_ext(spr_darkhalo_big, 0, x1, y1, 1, 1, 0, c_white, glowamt)\ndraw_set_alpha(1)", ""); +ReplaceTextInGML("gml_Object_obj_labcamera_Create_0", "if (global.osflavor == 2)", "if (global.osflavor == 4)"); diff --git a/UndertaleModTool/Scripts/Community Scripts/TouchControlsEnabler.csx b/UndertaleModTool/Scripts/Community Scripts/TouchControlsEnabler.csx new file mode 100644 index 000000000..5f40bc01c --- /dev/null +++ b/UndertaleModTool/Scripts/Community Scripts/TouchControlsEnabler.csx @@ -0,0 +1,110 @@ +// Made by GitMuslim + +using System; +using System.IO; +using System.Threading.Tasks; +using System.Linq; +using UndertaleModLib.Util; + +EnsureDataLoaded(); + +string displayName = Data.GeneralInfo?.DisplayName?.Content.ToLower(); + +if (displayName != "deltarune chapter 1 & 2" && displayName != "deltarune chapter 1&2" && displayName != "undertale") +{ + ScriptError("Error 0: Only compatible with Undertale & Deltarune"); + return; +} + +string dataPath = Path.Combine(Path.GetDirectoryName(ScriptPath), "TouchControls_data"); + +Dictionary textures = new Dictionary(); + +UndertaleEmbeddedTexture controlsTexturePage = new UndertaleEmbeddedTexture(); +controlsTexturePage.TextureData.TextureBlob = File.ReadAllBytes(Path.Combine(dataPath, "controls.png")); +Data.EmbeddedTextures.Add(controlsTexturePage); +textures.Add(Path.GetFileName(Path.Combine(dataPath, "controls.png")), controlsTexturePage); + +UndertaleTexturePageItem AddNewTexturePageItem(ushort sourceX, ushort sourceY, ushort sourceWidth, ushort sourceHeight) +{ + ushort targetX = 0; + ushort targetY = 0; + ushort targetWidth = sourceWidth; + ushort targetHeight = sourceHeight; + ushort boundingWidth = sourceWidth; + ushort boundingHeight = sourceHeight; + var texturePage = textures["controls.png"]; + + UndertaleTexturePageItem tpItem = new UndertaleTexturePageItem { SourceX = sourceX, SourceY = sourceY, SourceWidth = sourceWidth, SourceHeight = sourceHeight, TargetX = targetX, TargetY = targetY, TargetWidth = targetWidth, TargetHeight = targetHeight, BoundingWidth = boundingWidth, BoundingHeight = boundingHeight, TexturePage = texturePage }; + Data.TexturePageItems.Add(tpItem); + return tpItem; +} + +UndertaleTexturePageItem pg_joybase1 = AddNewTexturePageItem(0, 0, 59, 59); +UndertaleTexturePageItem pg_joybase2 = AddNewTexturePageItem(0, 61, 59, 59); +UndertaleTexturePageItem pg_joystick = AddNewTexturePageItem(61, 0, 41, 41); +UndertaleTexturePageItem pg_joystick2 = AddNewTexturePageItem(0, 122, 41, 41); +UndertaleTexturePageItem pg_settings_n = AddNewTexturePageItem(61, 43, 19, 24); +UndertaleTexturePageItem pg_settings_p = AddNewTexturePageItem(83, 43, 19, 24); +UndertaleTexturePageItem pg_zbutton = AddNewTexturePageItem(104, 0, 27, 29); +UndertaleTexturePageItem pg_zbutton_p = AddNewTexturePageItem(104, 31, 27, 29); +UndertaleTexturePageItem pg_xbutton = AddNewTexturePageItem(133, 0, 27, 29); +UndertaleTexturePageItem pg_xbutton_p = AddNewTexturePageItem(133, 31, 27, 29); +UndertaleTexturePageItem pg_cbutton = AddNewTexturePageItem(162, 0, 27, 29); +UndertaleTexturePageItem pg_cbutton_p = AddNewTexturePageItem(162, 31, 27, 29); +UndertaleTexturePageItem pg_controls_config = AddNewTexturePageItem(61, 68, 100, 13); +UndertaleTexturePageItem pg_button_scale = AddNewTexturePageItem(61, 83, 79, 9); +UndertaleTexturePageItem pg_analog_scale = AddNewTexturePageItem(61, 94, 79, 12); +UndertaleTexturePageItem pg_analog_type = AddNewTexturePageItem(61, 108, 72, 12); +UndertaleTexturePageItem pg_reset_config = AddNewTexturePageItem(61, 122, 79, 12); +UndertaleTexturePageItem pg_controls_opacity = AddNewTexturePageItem(61, 136, 107, 13); +UndertaleTexturePageItem pg_arrow_leftright = AddNewTexturePageItem(142, 83, 41, 9); +UndertaleTexturePageItem pg_black = AddNewTexturePageItem(189, 0, 640, 480); + +void AddNewUndertaleSprite(string spriteName, ushort width, ushort height, UndertaleTexturePageItem[] spriteTextures) +{ + var name = Data.Strings.MakeString(spriteName); + ushort marginLeft = 0; + int marginRight = width - 1; + ushort marginTop = 0; + int marginBottom = height - 1; + + var sItem = new UndertaleSprite { Name = name, Width = width, Height = height, MarginLeft = marginLeft, MarginRight = marginRight, MarginTop = marginTop, MarginBottom = marginBottom }; + foreach (var spriteTexture in spriteTextures) { + sItem.Textures.Add(new UndertaleSprite.TextureEntry() { Texture = spriteTexture }); + }; + Data.Sprites.Add(sItem); +} + +AddNewUndertaleSprite("spr_joybase", 59, 59, new UndertaleTexturePageItem[] {pg_joybase1, pg_joybase2}); +AddNewUndertaleSprite("spr_joystick", 42, 42, new UndertaleTexturePageItem[] {pg_joystick, pg_joystick2}); +AddNewUndertaleSprite("spr_z_button", 27, 29, new UndertaleTexturePageItem[] {pg_zbutton, pg_zbutton_p}); +AddNewUndertaleSprite("spr_x_button", 27, 29, new UndertaleTexturePageItem[] {pg_xbutton, pg_xbutton_p}); +AddNewUndertaleSprite("spr_c_button", 27, 29, new UndertaleTexturePageItem[] {pg_cbutton, pg_cbutton_p}); +AddNewUndertaleSprite("spr_settings", 19, 24, new UndertaleTexturePageItem[] {pg_settings_n, pg_settings_p}); +AddNewUndertaleSprite("spr_controls_config", 100, 13, new UndertaleTexturePageItem[] {pg_controls_config}); +AddNewUndertaleSprite("spr_button_scale", 79, 9, new UndertaleTexturePageItem[] {pg_button_scale}); +AddNewUndertaleSprite("spr_analog_scale", 79, 12, new UndertaleTexturePageItem[] {pg_analog_scale}); +AddNewUndertaleSprite("spr_analog_type", 72, 12, new UndertaleTexturePageItem[] {pg_analog_type}); +AddNewUndertaleSprite("spr_reset_config", 79, 12, new UndertaleTexturePageItem[] {pg_reset_config}); +AddNewUndertaleSprite("spr_controls_opacity", 107, 13, new UndertaleTexturePageItem[] {pg_controls_opacity}); +AddNewUndertaleSprite("spr_arrow_leftright", 41, 9, new UndertaleTexturePageItem[] {pg_arrow_leftright}); +AddNewUndertaleSprite("spr_black", 640, 480, new UndertaleTexturePageItem[] {pg_black}); + +ImportGMLFile(Path.Combine(dataPath, "gml_Object_obj_mobilecontrols_Create_0.gml"), true, false, true); +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") }); +ImportGMLFile(Path.Combine(dataPath, "gml_Object_obj_mobilecontrols_Step_0.gml"), true, false, true); + +var mobileControls = Data.GameObjects.ByName("obj_mobilecontrols"); +mobileControls.Persistent = true; + +if (displayName == "deltarune chapter 1 & 2" || displayName == "deltarune chapter 1&2") +{ + Data.Code.ByName("gml_Object_obj_gamecontroller_Create_0").AppendGML("instance_create(0, 0, obj_mobilecontrols);", Data); +} +else if (displayName == "undertale") +{ + Data.Code.ByName("gml_Object_obj_time_Create_0").AppendGML("instance_create(0, 0, obj_mobilecontrols);", Data); +} diff --git a/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/controls.png b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/controls.png new file mode 100644 index 000000000..6e34bf9e9 Binary files /dev/null and b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/controls.png differ diff --git a/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Create_0.gml b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Create_0.gml new file mode 100644 index 000000000..dde56abd4 --- /dev/null +++ b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Create_0.gml @@ -0,0 +1,50 @@ +if (string_lower(game_display_name) == "undertale") +{ + settings_font = fnt_main + settings_num_x = 477 +} +else +{ + settings_font = fnt_mainbig + settings_num_x = 502 +} +zx = 510 +zy = 340 +xx = 560 +xy = 280 +cx = 610 +cy = 220 +button_scale = 2.5 +analog_scale = 3.3 +analog_posx = -42 +analog_posy = 232.5 +analog_edit_selected = 0 +analog_center_x = (analog_posx + (((59 * analog_scale) / 2) - ((41 * analog_scale) / 2))) +analog_center_y = (analog_posy + (((59 * analog_scale) / 2) - ((41 * analog_scale) / 2))) +arrowkeys_area_size = 19.675 +arrowkeys_back_area_size = 45 +joystick_type = 0 +settingsx = 5 +settingsy = 5 +edit = 0 +black_fade = 0 +text_black_fade = 0 +controls_opacity = 0.5 +if file_exists("touchconfig.ini") +{ + ini_open("touchconfig.ini") + zx = ini_read_real("CONFIG", "zx", zx) + zy = ini_read_real("CONFIG", "zy", zy) + xx = ini_read_real("CONFIG", "xx", xx) + xy = ini_read_real("CONFIG", "xy", xy) + cx = ini_read_real("CONFIG", "cx", cx) + cy = ini_read_real("CONFIG", "cy", cy) + analog_posx = ini_read_real("CONFIG", "analog_posx", analog_posx) + analog_posy = ini_read_real("CONFIG", "analog_posy", analog_posy) + button_scale = ini_read_real("CONFIG", "button_scale", button_scale) + analog_scale = ini_read_real("CONFIG", "analog_scale", analog_scale) + joystick_type = ini_read_real("CONFIG", "joystick_type", joystick_type) + controls_opacity = ini_read_real("CONFIG", "controls_opacity", controls_opacity) + ini_close() +} + diff --git a/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Draw_64.gml b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Draw_64.gml new file mode 100644 index 000000000..984d118f5 --- /dev/null +++ b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Draw_64.gml @@ -0,0 +1,22 @@ +draw_sprite_ext(spr_black, 0, 0, 0, 1, 1, 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) diff --git a/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Other_4.gml b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Other_4.gml new file mode 100644 index 000000000..a34e3f872 --- /dev/null +++ b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Other_4.gml @@ -0,0 +1,16 @@ +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) diff --git a/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Step_0.gml b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Step_0.gml new file mode 100644 index 000000000..b652eabbd --- /dev/null +++ b/UndertaleModTool/Scripts/Community Scripts/TouchControls_data/gml_Object_obj_mobilecontrols_Step_0.gml @@ -0,0 +1,146 @@ +if keyboard_check(ord("~")) +{ + if (device_mouse_x_to_gui(0) >= analog_posx && device_mouse_x_to_gui(0) <= (analog_posx + (59 * analog_scale))) + analog_center_x = (device_mouse_x_to_gui(0) - (21 * analog_scale)) + if (device_mouse_y_to_gui(0) >= analog_posy && device_mouse_y_to_gui(0) <= (analog_posy + (59 * analog_scale))) + analog_center_y = (device_mouse_y_to_gui(0) - (21 * analog_scale)) +} +else +{ + analog_center_x = (analog_posx + (((59 * analog_scale) / 2) - ((41 * analog_scale) / 2))) + analog_center_y = (analog_posy + (((59 * analog_scale) / 2) - ((41 * analog_scale) / 2))) +} +if keyboard_check_pressed(92) +{ + edit += 1 + if (edit == 1) + { + black_fade = 0.4 + text_black_fade = 0.9 + } + else if (edit == 3) + { + virtual_key_delete(virtual_key_up) + virtual_key_delete(virtual_key_down) + virtual_key_delete(virtual_key_left) + virtual_key_delete(virtual_key_right) + virtual_key_delete(virtual_key_z) + virtual_key_delete(virtual_key_x) + virtual_key_delete(virtual_key_c) + virtual_key_delete(virtual_key_zp) + virtual_key_delete(virtual_key_xp) + virtual_key_delete(virtual_key_cp) + virtual_key_delete(virtual_key_analog) + virtual_key_delete(virtual_key_analogp) + ini_open("touchconfig.ini") + ini_write_real("CONFIG", "zx", zx) + ini_write_real("CONFIG", "zy", zy) + ini_write_real("CONFIG", "xx", xx) + ini_write_real("CONFIG", "xy", xy) + ini_write_real("CONFIG", "cx", cx) + ini_write_real("CONFIG", "cy", cy) + ini_write_real("CONFIG", "analog_posx", analog_posx) + ini_write_real("CONFIG", "analog_posy", analog_posy) + ini_write_real("CONFIG", "button_scale", button_scale) + ini_write_real("CONFIG", "analog_scale", analog_scale) + ini_write_real("CONFIG", "joystick_type", joystick_type) + ini_write_real("CONFIG", "controls_opacity", controls_opacity) + ini_close() + black_fade = 0 + text_black_fade = 0 + edit = 0 + scr_add_keys() + } +} + +if (edit == 0) return; + +virtual_key_delete(virtual_key_up) +virtual_key_delete(virtual_key_down) +virtual_key_delete(virtual_key_left) +virtual_key_delete(virtual_key_right) +virtual_key_delete(virtual_key_z) +virtual_key_delete(virtual_key_x) +virtual_key_delete(virtual_key_c) +virtual_key_delete(virtual_key_zp) +virtual_key_delete(virtual_key_xp) +virtual_key_delete(virtual_key_cp) +virtual_key_delete(virtual_key_analog) +virtual_key_delete(virtual_key_analogp) +scr_add_keys() +if keyboard_check(ord("}")) +{ + zx = (device_mouse_x_to_gui(0) - (19.5 * button_scale)) + zy = (device_mouse_y_to_gui(0) - (18 * button_scale)) +} +if keyboard_check(ord("|")) +{ + xx = (device_mouse_x_to_gui(0) - (19.5 * button_scale)) + xy = (device_mouse_y_to_gui(0) - (18 * button_scale)) +} +if keyboard_check(ord("^")) +{ + cx = (device_mouse_x_to_gui(0) - (19.5 * button_scale)) + cy = (device_mouse_y_to_gui(0) - (18 * button_scale)) +} +if keyboard_check(ord("]")) +{ + analog_posx = (device_mouse_x_to_gui(0) - (29.5 * analog_scale)) + analog_posy = (device_mouse_y_to_gui(0) - (29.5 * analog_scale)) +} +if (device_mouse_x_to_gui(0) >= 459.5 && device_mouse_y_to_gui(0) >= 75 && device_mouse_x_to_gui(0) <= 469.5 && device_mouse_y_to_gui(0) <= 93 && mouse_check_button_pressed(mb_left)) +{ + if (button_scale > 1) + button_scale -= 0.1 +} +if (device_mouse_x_to_gui(0) >= 531.5 && device_mouse_y_to_gui(0) >= 75 && device_mouse_x_to_gui(0) <= 541.5 && device_mouse_y_to_gui(0) <= 93 && mouse_check_button_pressed(mb_left)) +{ + if (button_scale < 3) + button_scale += 0.1 +} +if (device_mouse_x_to_gui(0) >= 459.5 && device_mouse_y_to_gui(0) >= 121 && device_mouse_x_to_gui(0) <= 469.5 && device_mouse_y_to_gui(0) <= 139 && mouse_check_button_pressed(mb_left)) +{ + if (analog_scale > 1) + analog_scale -= 0.1 +} +if (device_mouse_x_to_gui(0) >= 531.5 && device_mouse_y_to_gui(0) >= 121 && device_mouse_x_to_gui(0) <= 541.5 && device_mouse_y_to_gui(0) <= 139 && mouse_check_button_pressed(mb_left)) +{ + if (analog_scale < 4) + analog_scale += 0.1 +} + if (device_mouse_x_to_gui(0) >= 459.5 && device_mouse_y_to_gui(0) >= 167 && device_mouse_x_to_gui(0) <= 469.5 && device_mouse_y_to_gui(0) <= 185 && mouse_check_button_pressed(mb_left)) +{ + if (joystick_type == 1) + joystick_type -= 1 +} +if (device_mouse_x_to_gui(0) >= 531.5 && device_mouse_y_to_gui(0) >= 167 && device_mouse_x_to_gui(0) <= 541.5 && device_mouse_y_to_gui(0) <= 185 && mouse_check_button_pressed(mb_left)) +{ + if (joystick_type == 0) + joystick_type += 1 +} +if (device_mouse_x_to_gui(0) >= 459.5 && device_mouse_y_to_gui(0) >= 167 && device_mouse_x_to_gui(0) <= 469.5 && device_mouse_y_to_gui(0) <= 231 && mouse_check_button_pressed(mb_left)) +{ + if (controls_opacity > 0.10) + controls_opacity -= 0.05 +} +if (device_mouse_x_to_gui(0) >= 531.5 && device_mouse_y_to_gui(0) >= 167 && device_mouse_x_to_gui(0) <= 541.5 && device_mouse_y_to_gui(0) <= 231 && mouse_check_button_pressed(mb_left)) +{ + if (controls_opacity < 1.00) + controls_opacity += 0.05 +} +if (device_mouse_x_to_gui(0) >= 241 && device_mouse_y_to_gui(0) >= 412.25 && device_mouse_x_to_gui(0) <= 399 && device_mouse_y_to_gui(0) <= 436.25 && mouse_check_button_pressed(mb_left)) +{ + zx = 510 + zy = 340 + xx = 560 + xy = 280 + cx = 610 + cy = 220 + button_scale = 2.5 + analog_scale = 3.3 + analog_posx = -42 + analog_posy = 232.5 + joystick_type = 0 + controls_opacity = 0.5 +} +