From 6a624dbc9c65c44862540376fc6d21cbcda99ac6 Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Sun, 4 Jun 2023 18:28:29 +0200 Subject: [PATCH] String extract --- PixelComposer.resource_order | 2 +- PixelComposer.yyp | 2 +- datafiles/data/locale/en.json | 196 ++++++++++++------ objects/o_dialog_add_node/Draw_64.gml | 6 +- objects/o_dialog_assetbox/Draw_64.gml | 2 +- objects/o_dialog_color_selector/Create_0.gml | 2 +- objects/o_dialog_color_selector/Draw_64.gml | 6 +- objects/o_dialog_crashed/Draw_64.gml | 10 +- .../Create_0.gml | 2 +- .../o_dialog_file_name_collection/Draw_64.gml | 22 +- objects/o_dialog_gradient/Create_0.gml | 2 +- objects/o_dialog_gradient/Draw_64.gml | 18 +- .../o_dialog_group_input_order/Draw_64.gml | 2 +- objects/o_dialog_history/Draw_64.gml | 4 +- objects/o_dialog_image_array_edit/Draw_64.gml | 6 +- objects/o_dialog_migration/Draw_64.gml | 10 +- objects/o_dialog_notifications/Create_0.gml | 12 +- objects/o_dialog_notifications/Draw_64.gml | 10 +- .../o_dialog_output_visibility/Draw_64.gml | 2 +- objects/o_dialog_palette/Create_0.gml | 2 +- objects/o_dialog_palette/Draw_64.gml | 24 +-- objects/o_dialog_panel/Draw_64.gml | 2 +- objects/o_dialog_preference/Create_0.gml | 83 +++++--- objects/o_dialog_preference/Draw_64.gml | 4 +- objects/o_dialog_preset/Draw_64.gml | 2 +- objects/o_dialog_preview_window/Create_0.gml | 6 +- objects/o_dialog_splash/Draw_64.gml | 15 +- objects/o_dialog_tunnels/Draw_64.gml | 2 +- objects/o_main/Draw_75.gml | 22 +- objects/o_main/Step_0.gml | 4 +- scripts/__panel_empty/__panel_empty.gml | 2 +- scripts/areaBox/areaBox.gml | 10 +- scripts/button/button.gml | 3 +- scripts/fontScrollBox/fontScrollBox.gml | 2 +- scripts/locale_data/locale_data.gml | 46 ++-- scripts/matrixGrid/matrixGrid.gml | 2 +- scripts/meta_data/meta_data.gml | 12 +- scripts/nodeValue_drawer/nodeValue_drawer.gml | 12 +- scripts/node_array/node_array.gml | 2 +- .../node_ase_file_read/node_ase_file_read.gml | 2 +- scripts/node_collection/node_collection.gml | 2 +- .../node_color_adjustment.gml | 102 +++++++-- .../node_csv_file_read/node_csv_file_read.gml | 2 +- scripts/node_data/node_data.gml | 14 +- scripts/node_image/node_image.gml | 2 +- .../node_image_animated.gml | 2 +- scripts/node_image_gif/node_image_gif.gml | 2 +- .../node_image_sequence.gml | 2 +- .../node_json_file_read.gml | 2 +- .../node_text_file_read.gml | 2 +- scripts/node_trigger/node_trigger.gml | 12 +- .../node_wav_file_read/node_wav_file_read.gml | 4 +- .../node_websocket_receiver.gml | 2 +- .../node_websocket_sender.gml | 2 +- scripts/paddingBox/paddingBox.gml | 2 +- scripts/panel_addon/panel_addon.gml | 14 +- scripts/panel_animation/panel_animation.gml | 152 +++++++------- scripts/panel_collection/panel_collection.gml | 28 +-- scripts/panel_color/panel_color.gml | 2 +- scripts/panel_console/panel_console.gml | 2 +- scripts/panel_data/panel_data.gml | 4 +- scripts/panel_globalvar/panel_globalvar.gml | 6 +- scripts/panel_gradient/panel_gradient.gml | 2 +- scripts/panel_graph/panel_graph.gml | 78 +++---- .../panel_graph_export_image_dialog.gml | 6 +- scripts/panel_history/panel_history.gml | 4 +- scripts/panel_inspector/panel_inspector.gml | 38 ++-- scripts/panel_menu/panel_menu.gml | 152 +++++++------- scripts/panel_node_align/panel_node_align.gml | 6 +- scripts/panel_nodes/panel_nodes.gml | 4 +- .../panel_notification/panel_notification.gml | 20 +- scripts/panel_palette/panel_palette.gml | 6 +- scripts/panel_preview/panel_preview.gml | 58 +++--- .../panel_preview_window.gml | 6 +- scripts/panel_tunnels/panel_tunnels.gml | 8 +- scripts/preferences/preferences.gml | 1 + scripts/printer/printer.gml | 2 +- scripts/rangeBox/rangeBox.gml | 2 +- scripts/vectorBox/vectorBox.gml | 2 +- scripts/vectorRangeBox/vectorRangeBox.gml | 4 +- 80 files changed, 769 insertions(+), 567 deletions(-) diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 439ae7dce..493ebf5d7 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -99,6 +99,7 @@ {"name":"atlas","order":9,"path":"folders/nodes/data/value/atlas.yy",}, {"name":"mesh","order":7,"path":"folders/nodes/data/value/mesh.yy",}, {"name":"struct","order":6,"path":"folders/nodes/data/value/struct.yy",}, + {"name":"surface","order":10,"path":"folders/nodes/data/value/surface.yy",}, {"name":"trigger","order":8,"path":"folders/nodes/data/value/trigger.yy",}, {"name":"VFX","order":13,"path":"folders/nodes/data/VFX.yy",}, {"name":"icons","order":6,"path":"folders/nodes/icons.yy",}, @@ -157,7 +158,6 @@ {"name":"gameframe","order":2,"path":"folders/sprites/gameframe.yy",}, {"name":"misc","order":3,"path":"folders/sprites/misc.yy",}, {"name":"widgets","order":5,"path":"folders/widgets.yy",}, - {"name":"surface","order":10,"path":"folders/nodes/data/value/surface.yy",}, ], "ResourceOrderSettings": [ {"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 25fcdafba..fcfe9488c 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -130,6 +130,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"number","folderPath":"folders/nodes/data/value/number.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"path","folderPath":"folders/nodes/data/value/path.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"struct","folderPath":"folders/nodes/data/value/struct.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"surface","folderPath":"folders/nodes/data/value/surface.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"texts","folderPath":"folders/nodes/data/value/texts.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"trigger","folderPath":"folders/nodes/data/value/trigger.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"VFX","folderPath":"folders/nodes/data/VFX.yy",}, @@ -193,7 +194,6 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Steamworks","folderPath":"folders/Steamworks.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"UGC","folderPath":"folders/Steamworks/UGC.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"surface","folderPath":"folders/nodes/data/value/surface.yy",}, ], "IncludedFiles": [ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",}, diff --git a/datafiles/data/locale/en.json b/datafiles/data/locale/en.json index 0be754451..d6c84f437 100644 --- a/datafiles/data/locale/en.json +++ b/datafiles/data/locale/en.json @@ -1,64 +1,100 @@ { - "version": 1132, + "version": 114500, + + "addon": "Addons", + "accept": "Accept", + "actions": "Actions", + "animation": "Animation", + "add_preset": "Add to preset", + "add": "Add", + "alias": "Alias", + "align": "Align", + "apply": "Apply", + "assets": "Assets", + "author": "Author", + "cancel": "Cancel", + "collections": "Collections", + "color": "Color", + "contact_info": "Contact info", + "copy": "Copy", + "delete": "Delete", + "description": "Description", + "duplicate": "Duplicate", + "edit": "Edit", + "enable": "Enabled", + "errors": "Errors", + "false": "False", + "filter": "Filter", + "frame": "Frame", + "graidents": "Gradients", + "graph": "Graph", + "ignore": "Ignore", + "import": "Import", + "name": "Name", + "palettes": "Palettes", + "paste": "Paste", + "pause": "Pause", + "pin": "Pin", + "play": "Play", + "position": "Position", + "preset_new": "New preset", + "presets": "Presets", + "recursive": "Recursive", + "redo": "Redo", + "refresh": "Refresh", + "reset_all": "Reset all", + "reset": "Reset", + "stop": "Stop", + "theme": "Theme", + "true": "True", + "undo": "Undo", + "unpin": "Unpin", + "view_grid": "Grid view", + "view_list": "List view", + "visibility": "Visibility", + "warning": "Warning", + "new": "New", + "open": "Open", + "save": "Save", + "save_as": "Save as", + "help": "Help", + "unsubscribe": "Unsubscribe", + "move": "Move", + "notifications":"Notifications", + "horizontal": "Horizontal", + "vertical": "Vertical", + "distribute": "Distribute", + "group": "Group", + "ungroup": "Ungroup", + "global": "Global", + "export": "Export", + "nodes": "Nodes", + "tunnels": "Tunnels", + "menu": "Menu", + "history": "History", + "inspector": "Inspector", + "preview": "Preview", + "workspace": "Workspace", + "outputs": "Outputs", + "lock": "Lock", + "active": "Active", + "fps": "fps", + "link_values": "Link values", + "unlink_values":"Unlink values", + "max": "Max", + "min": "Min", + "preferences": "Preferences", "show_on_startup": "Show on startup", "recent_files": "Recent files", "sample_projects": "Sample projects", + "contests": "Contests", "art_by": "Art by ", "Getting started": "Getting started", "Sample Projects": "Sample Projects", - "presets": "Presets", - "preset_new": "New preset", - "palettes": "Palettes", - "position": "Position", - "refresh": "Refresh", - "add_preset": "Add to preset", - "import": "Import", - "recursive": "Recursive", - "filter": "Filter", - "enable": "Enabled", - "name": "Name", - "description": "Description", - "author": "Author", - "contact_info": "Contact info", - "alias": "Alias", - "cancel": "Cancel", - "add": "Add", - "theme": "Theme", - "reset": "Reset", - "reset_all": "Reset all", - "true": "True", - "false": "False", - "undo": "Undo", - "redo": "Redo", - "actions": "Actions", - "warning": "Warning", - "errors": "Errors", - "duplicate": "Duplicate", - "align": "Align", - "delete": "Delete", - "stop": "Stop", - "pause": "Pause", - "play": "Play", - "frame": "Frame", - "assets": "Assets", - "collections": "Collection", - "view_grid": "Grid view", - "view_list": "List view", - "visibility": "Visibility", - "copy": "Copy", - "paste": "Paste", - "edit": "Edit", - "accept": "Accept", - "apply": "Apply", - "ignore": "Ignore", - "pin": "Pin", - "unpin": "Unpin", - "safe_mode": "SAFE MODE", - "anim_title": "Animation", "anim_length": "Animation length", "anim_frame_rate": "Preview frame rate", "anim_on_end": "On end", @@ -130,7 +166,6 @@ "array_edit_title": "Image array edit", "array_edit_sort_name": "Sort by name", - "noti_title": "Notification", "noti_clear_log": "Clear log messages", "noti_clear_warn": "Clear warning messages", "noti_clear_all": "Clear all notifications", @@ -147,7 +182,6 @@ "pref_pages_general": "General", "pref_pages_nodes": "Node settings", "pref_pages_appearance": "Appearances", - "pref_pages_theme": "Theme", "pref_pages_hotkeys": "Hotkeys", "pref_reset_colors": "Reset colors", @@ -185,19 +219,12 @@ "tooltip_path_object": "Path Object", "tooltip_fluid_object": "Fluid Domain Object", - "history_title": "Action history", - - "panel_menu_new": "New", - "panel_menu_open": "Open", - "panel_menu_save": "Save", - "panel_menu_save_as": "Save as", + "panel_pop_out": "Pop out", "panel_menu_recent_files": "Recent files", "panel_menu_splash_screen": "Splash screen", - "panel_menu_addons": "Addons", "panel_menu_addons_key": "Key displayer", "panel_menu_file": "File", "panel_menu_edit": "Edit", - "panel_menu_preview": "Preview", "panel_menu_center_preview": "Center preview", "panel_menu_save_current_preview_as": "Save current preview as", "panel_menu_preview_background": "Preview background", @@ -210,8 +237,6 @@ "panel_menu_render_all_nodes": "Render all nodes", "panel_menu_execute_exports": "Execute all export nodes", "panel_menu_panels": "Panels", - "panel_menu_workspace": "Workspace", - "panel_menu_collections": "Collections", "panel_menu_test": "Test", "panel_menu_test_load_all": "Load all current collections", "panel_menu_test_update_all": "Update all current collections", @@ -221,11 +246,21 @@ "panel_menu_test_crash": "Force crash", "panel_menu_test_load_nodes": "Load all nodes", "panel_menu_newer": "Newer version available", - "panel_menu_help": "Help", "panel_menu_help_video": "Tutorial videos", "panel_menu_help_wiki": "Community Wiki", + "panel_menu_local_directory": "Open local directory", + "panel_menu_autosave_directory":"Open autosave directory", + "panel_menu_reset_default": "Reset default collection, assets", "panel_menu_itch": "itch.io page", "panel_menu_steam": "Steam page", + "panel_menu_auto_save_folder": "Open autosave folder", + "panel_menu_fullscreen": "Toggle fullscreen", + "panel_menu_exit": "Close program", + "panel_menu_save_layout": "Save layout", + + "panel_globalvar": "Global Variables", + "panel_export_graph": "Export Graph", + "panel_debug_console": "Debug Console", "panel_graph_center_to_nodes": "Center to nodes", "panel_graph_minimap_enabled": "Minimap enabled", @@ -277,7 +312,6 @@ "panel_animation_ease_overshoot": "Overshoot", "panel_animation_ease_sharp": "Sharp", "panel_animation_ease_hold": "Hold", - "panel_animation_align": "Align", "panel_animation_stagger": "Stagger", "panel_animation_goto": "Go to node", "panel_animation_show_graph": "Show graph", @@ -299,6 +333,7 @@ "panel_collection_add_node": "Add selecting node as collection", "panel_collection_add_folder": "Add folder", "panel_collection_open_file": "Open in file explorer", + "panel_collection_you_created": "You created this item", "panel_inspector_toggle_anim": "Toggle animation", "panel_inspector_remove_link": "Remove link", @@ -316,11 +351,44 @@ "panel_inspector_workshop_save": "Save file before upload", "panel_inspector_workshop_upload": "Upload to Steam Workshop", "panel_inspector_workshop_update": "Update Steam Workshop", + "panel_inspector_use_expression": "Use expression", + + "panel_addon_not_activated" : "Not activated", + "panel_addon_activated": "Activated", + "panel_addon_run_on_start": "Run on start", + + "panel_history_more_actions": " more actions...", "dialog_migration_title": "Program directory changed in 1.13", "dialog_migration_content": "This means all custom collections, assets, palettes, gradients, fonts, presets have to be move manually.", "migrate_files": "Migrate files", "migrate_open_directory": "Open directory", + "palette_change_preview_size": "Change preview size", + + "graph_export_scale": "Scale", + "graph_export_padding": "Padding", + "graph_export_solid_background": "Solid Background", + "graph_export_background_color": "Background Color", + "graph_export_render_grid": "Render Grid", + "graph_export_grid_color": "Grid Color", + "graph_export_grid_opacity": "Grid Opacity", + "graph_export_border": "Border", + "graph_export_border_color": "Border Color", + "graph_export_border_opacity": "Border Opacity", + + "panel_node_goto": "Go to node", + "panel_tunnel_create_tunnel": "Create tunnel out", + "panel_tunnel_no_key": "No key", + + "panel_globalvar_add": "Add variable", + + "widget_area_center_Span": "Center + Span", + "widget_area_padding": "Padding", + "widget_area_two_points": "Two points", + "widget_area_fill_surface": "Full surface", + + "widget_font_open_folder": "Open font folder", + "" : "" } \ No newline at end of file diff --git a/objects/o_dialog_add_node/Draw_64.gml b/objects/o_dialog_add_node/Draw_64.gml index bd355820a..3b55d7dcb 100644 --- a/objects/o_dialog_add_node/Draw_64.gml +++ b/objects/o_dialog_add_node/Draw_64.gml @@ -37,20 +37,20 @@ if !ready exit; var bx = dialog_x + dialog_w - ui(44); var by = dialog_y + ui(16); var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, - PREF_MAP[? "dialog_add_node_view"]? get_text("view_list", "List view") : get_text("view_grid", "Grid view"), + PREF_MAP[? "dialog_add_node_view"]? __txtx("view_list", "List view") : __txtx("view_grid", "Grid view"), THEME.view_mode, PREF_MAP[? "dialog_add_node_view"], COLORS._main_icon); if(b == 2) PREF_MAP[? "dialog_add_node_view"] = !PREF_MAP[? "dialog_add_node_view"]; bx -= ui(32); var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, - PREF_MAP[? "dialog_add_node_grouping"]? get_text("add_node_group_enabled", "Group enabled") : get_text("add_node_group_disabled", "Group disabled"), + PREF_MAP[? "dialog_add_node_grouping"]? __txtx("add_node_group_enabled", "Group enabled") : __txtx("add_node_group_disabled", "Group disabled"), THEME.view_group, PREF_MAP[? "dialog_add_node_grouping"], COLORS._main_icon); if(b == 2) PREF_MAP[? "dialog_add_node_grouping"] = !PREF_MAP[? "dialog_add_node_grouping"]; if(node_called != noone || junction_hovering != noone) { - var txt = node_show_connectable? get_text("add_node_show_connect", "Showing connectable") : get_text("add_node_show_all", "Showing all"); + var txt = node_show_connectable? __txtx("add_node_show_connect", "Showing connectable") : __txtx("add_node_show_all", "Showing all"); var cc = node_show_connectable? COLORS._main_accent : COLORS._main_icon; bx -= ui(32); var b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, txt, THEME.filter_type, node_show_connectable, cc); diff --git a/objects/o_dialog_assetbox/Draw_64.gml b/objects/o_dialog_assetbox/Draw_64.gml index b086e48f0..f16a49ab2 100644 --- a/objects/o_dialog_assetbox/Draw_64.gml +++ b/objects/o_dialog_assetbox/Draw_64.gml @@ -18,7 +18,7 @@ } draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(16), dialog_y + ui(16), get_text("assets", "Assets")); + draw_text(dialog_x + ui(16), dialog_y + ui(16), __txtx("assets", "Assets")); draw_sprite_stretched(THEME.ui_panel_bg, 0, dialog_x + ui(16), dialog_y + ui(48), folderW - ui(8), dialog_h - ui(64)); draw_sprite_stretched(THEME.ui_panel_bg, 0, dialog_x + ui(16) + folderW, dialog_y + ui(16), dialog_w - ui(32) - folderW, dialog_h - ui(32)); diff --git a/objects/o_dialog_color_selector/Create_0.gml b/objects/o_dialog_color_selector/Create_0.gml index f9e63bf2b..c8eeef1fd 100644 --- a/objects/o_dialog_color_selector/Create_0.gml +++ b/objects/o_dialog_color_selector/Create_0.gml @@ -8,7 +8,7 @@ event_inherited(); destroy_on_click_out = true; interactable = true; - name = get_text("color_selector_title", "Color selector"); + name = __txtx("color_selector_title", "Color selector"); previous_color = c_black; selector = new colorSelector(); diff --git a/objects/o_dialog_color_selector/Draw_64.gml b/objects/o_dialog_color_selector/Draw_64.gml index b04446a82..ce39f6979 100644 --- a/objects/o_dialog_color_selector/Draw_64.gml +++ b/objects/o_dialog_color_selector/Draw_64.gml @@ -24,7 +24,7 @@ if !ready exit; draw_sprite_stretched_ext(THEME.dialog_active, 0, content_x, dialog_y, content_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(presets_x + ui(24), dialog_y + ui(16), get_text("palette", "Palettes")); + draw_text(presets_x + ui(24), dialog_y + ui(16), __txtx("palette", "Palettes")); draw_text(content_x + (!interactable * ui(32)) + ui(24), dialog_y + ui(16), name); if(!interactable) draw_sprite_ui(THEME.lock, 0, content_x + ui(24 + 12), dialog_y + ui(16 + 12),,,, COLORS._main_icon); @@ -39,11 +39,11 @@ if !ready exit; var bx = presets_x + presets_w - ui(44); var by = dialog_y + ui(12); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, get_text("refresh", "Refresh"), THEME.refresh) == 2) + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("refresh", "Refresh"), THEME.refresh) == 2) presetCollect(); bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, get_text("color_selector_open_palette", "Open palette folder"), THEME.folder) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("color_selector_open_palette", "Open palette folder"), THEME.folder) == 2) { var _realpath = environment_get_variable("LOCALAPPDATA") + "/Pixels_Composer/Palettes"; var _windir = environment_get_variable("WINDIR") + "/explorer.exe"; execute_shell(_windir, _realpath); diff --git a/objects/o_dialog_crashed/Draw_64.gml b/objects/o_dialog_crashed/Draw_64.gml index 6088bb914..5e24be229 100644 --- a/objects/o_dialog_crashed/Draw_64.gml +++ b/objects/o_dialog_crashed/Draw_64.gml @@ -14,11 +14,11 @@ draw_set_alpha(1); #region text var py = dialog_y + ui(16); draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(24), py, get_text("crashed_title", "Restore project")); + draw_text(dialog_x + ui(24), py, __txtx("crashed_title", "Restore project")); py += line_get_height(, 4); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text(dialog_x + ui(24), py, get_text("crashed_content", "Restore previous project before crash?")); + draw_text(dialog_x + ui(24), py, __txtx("crashed_content", "Restore previous project before crash?")); var bw = ui(96), bh = TEXTBOX_HEIGHT; var bx1 = dialog_x + dialog_w - ui(16); @@ -28,13 +28,13 @@ draw_set_alpha(1); draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text); var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); - draw_text(bx0 + bw / 2, by0 + bh / 2, get_text("crashed_ignore", "Ignore")); + draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("crashed_ignore", "Ignore")); if(b == 2) instance_destroy(); bx0 -= bw + ui(12); var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); - draw_text(bx0 + bw / 2, by0 + bh / 2, get_text("crashed_restore", "Restore")); + draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("crashed_restore", "Restore")); if(b == 2) { var path = string(DIRECTORY) + "prev_crash.pxc"; LOAD_PATH(path, true, true); @@ -43,7 +43,7 @@ draw_set_alpha(1); bx0 = dialog_x + ui(16); var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); - draw_text(bx0 + bw / 2, by0 + bh / 2, get_text("crashed_log", "Log file") + "..."); + draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("crashed_log", "Log file") + "..."); if(b == 2) { var path = string(DIRECTORY) + "crash_log.txt"; if(file_exists(path)) shellOpenExplorer(path); diff --git a/objects/o_dialog_file_name_collection/Create_0.gml b/objects/o_dialog_file_name_collection/Create_0.gml index 80cf582f1..be8d93b49 100644 --- a/objects/o_dialog_file_name_collection/Create_0.gml +++ b/objects/o_dialog_file_name_collection/Create_0.gml @@ -21,7 +21,7 @@ event_inherited(); ugc = 0; ugc_loading = false; - //name = get_text("new_collection_placeholder", "New collection"); + //name = __txtx("new_collection_placeholder", "New collection"); t_desc = new textArea(TEXTBOX_INPUT.text, function(str) { meta.description = str; }); t_auth = new textArea(TEXTBOX_INPUT.text, function(str) { meta.author = str; }); diff --git a/objects/o_dialog_file_name_collection/Draw_64.gml b/objects/o_dialog_file_name_collection/Draw_64.gml index d1ccc8168..554deed44 100644 --- a/objects/o_dialog_file_name_collection/Draw_64.gml +++ b/objects/o_dialog_file_name_collection/Draw_64.gml @@ -7,7 +7,7 @@ #region draw TB draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_title); - draw_text(dialog_x + ui(16), dialog_y + ui(32), get_text("name", "Name")); + draw_text(dialog_x + ui(16), dialog_y + ui(32), __txtx("name", "Name")); //var is_author = !meta.steam || meta.author_steam_id == 0 || meta.author_steam_id == STEAM_USER_ID; @@ -27,19 +27,19 @@ var bw = ui(32); var bh = ui(32); - var txt = get_text("new_collection_create", "Create collection"); + var txt = __txtx("new_collection_create", "Create collection"); var icon = THEME.accept; var clr = COLORS._main_value_positive; if(updating != noone) { - txt = get_text("collection_update", "Update collection"); + txt = __txtx("collection_update", "Update collection"); } if(ugc == 1) { - txt = get_text("workshop_upload", "Upload to Steam Workshop"); + txt = __txtx("workshop_upload", "Upload to Steam Workshop"); icon = THEME.workshop_upload; clr = c_white; } else if(ugc == 2) { - txt = get_text("workshop_update", "Update Steam Workshop"); + txt = __txtx("workshop_update", "Update Steam Workshop"); icon = THEME.workshop_update; clr = c_white; } @@ -86,7 +86,7 @@ } bx += bw + ui(4); - var txt = get_text("new_collection_meta_edit", "Edit metadata"); + var txt = __txtx("new_collection_meta_edit", "Edit metadata"); if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, txt, THEME.hamburger) == 2) doExpand(); #endregion @@ -98,7 +98,7 @@ var yy = dialog_y + ui(56); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(16), yy, get_text("description", "Description")); + draw_text(dialog_x + ui(16), yy, __txtx("description", "Description")); yy += line_get_height() + ui(4); dialog_h += line_get_height() + ui(4); @@ -109,7 +109,7 @@ dialog_h += ui(200) + ui(8); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(16), yy, get_text("author", "Author")); + draw_text(dialog_x + ui(16), yy, __txtx("author", "Author")); yy += line_get_height() + ui(4); dialog_h += line_get_height() + ui(4); @@ -120,7 +120,7 @@ dialog_h += TEXTBOX_HEIGHT + ui(8); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(16), yy, get_text("contact_info", "Contact info")); + draw_text(dialog_x + ui(16), yy, __txtx("contact_info", "Contact info")); yy += line_get_height() + ui(4); dialog_h += line_get_height() + ui(4); @@ -131,7 +131,7 @@ dialog_h += TEXTBOX_HEIGHT + ui(8); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(16), yy, get_text("alias", "Alias")); + draw_text(dialog_x + ui(16), yy, __txtx("alias", "Alias")); yy += line_get_height() + ui(4); dialog_h += line_get_height() + ui(4); @@ -142,7 +142,7 @@ dialog_h += TEXTBOX_HEIGHT + ui(8); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(16), yy, get_text("tags", "Tags")); + draw_text(dialog_x + ui(16), yy, __txtx("tags", "Tags")); yy += line_get_height() + ui(4); dialog_h += line_get_height() + ui(4); diff --git a/objects/o_dialog_gradient/Create_0.gml b/objects/o_dialog_gradient/Create_0.gml index 4ef75be9a..ed26a26cb 100644 --- a/objects/o_dialog_gradient/Create_0.gml +++ b/objects/o_dialog_gradient/Create_0.gml @@ -6,7 +6,7 @@ event_inherited(); dialog_h = ui(476); title_height = 52; - name = get_text("gradient_editor_title", "Gradient editor"); + name = __txtx("gradient_editor_title", "Gradient editor"); gradient = noone; interactable = true; diff --git a/objects/o_dialog_gradient/Draw_64.gml b/objects/o_dialog_gradient/Draw_64.gml index a44201683..85790652b 100644 --- a/objects/o_dialog_gradient/Draw_64.gml +++ b/objects/o_dialog_gradient/Draw_64.gml @@ -28,11 +28,11 @@ if !ready exit; if(sFOCUS) draw_sprite_stretched_ext(THEME.dialog_active, 0, palette_x, dialog_y, presets_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(presets_x + ui(24), dialog_y + ui(16), get_text("presets", "Presets")); + draw_text(presets_x + ui(24), dialog_y + ui(16), __txtx("presets", "Presets")); draw_text(content_x + (!interactable * ui(32)) + ui(24), dialog_y + ui(16), name); if(!interactable) draw_sprite_ui(THEME.lock, 0, content_x + ui(24 + 12), dialog_y + ui(16 + 12),,,, COLORS._main_icon); - draw_text(palette_x + ui(24), dialog_y + ui(16), get_text("palette", "Palettes")); + draw_text(palette_x + ui(24), dialog_y + ui(16), __txtx("palette", "Palettes")); #endregion #region presets @@ -44,7 +44,7 @@ if !ready exit; var bx = presets_x + presets_w - ui(44); var by = dialog_y + ui(12); - var _b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, get_text("add_preset", "Add to preset")); + var _b = buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("add_preset", "Add to preset")); if(_b == 2) { var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8)); @@ -68,7 +68,7 @@ if !ready exit; draw_sprite_ui_uniform(THEME.add, 0, bx + ui(14), by + ui(14), 1, COLORS._main_icon); bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, get_text("refresh", "Refresh"), THEME.refresh) == 2) + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("refresh", "Refresh"), THEME.refresh) == 2) presetCollect(); bx -= ui(32); @@ -96,11 +96,11 @@ if !ready exit; var bx = content_x + content_w - ui(50); var by = dialog_y + ui(16); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, get_text("gradient_editor_key_blend", "Key blending"), THEME.grad_blend) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("gradient_editor_key_blend", "Key blending"), THEME.grad_blend) == 2) { menuCall("gradient_window_blend_menu", bx + ui(32), by, [ - menuItem(get_text("gradient_editor_blend_RGB", "RGB blend"), function() { gradient.type = 0; onApply(gradient); }), - menuItem(get_text("gradient_editor_blend_HSV", "HSV blend"), function() { gradient.type = 2; onApply(gradient); }), - menuItem(get_text("gradient_editor_blend_hard", "Hard blend"), function() { gradient.type = 1; onApply(gradient); }), + menuItem(__txtx("gradient_editor_blend_RGB", "RGB blend"), function() { gradient.type = 0; onApply(gradient); }), + menuItem(__txtx("gradient_editor_blend_HSV", "HSV blend"), function() { gradient.type = 2; onApply(gradient); }), + menuItem(__txtx("gradient_editor_blend_hard", "Hard blend"), function() { gradient.type = 1; onApply(gradient); }), ],, gradient); } bx -= ui(32); @@ -185,7 +185,7 @@ if !ready exit; var op_y = gr_y + gr_h + ui(12); draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); - draw_text(op_x, op_y + TEXTBOX_HEIGHT / 2, get_text("position", "Position")) + draw_text(op_x, op_y + TEXTBOX_HEIGHT / 2, __txtx("position", "Position")) var txt = key_selecting? key_selecting.time * 100 : 0; sl_position.setActiveFocus(sFOCUS, sHOVER); diff --git a/objects/o_dialog_group_input_order/Draw_64.gml b/objects/o_dialog_group_input_order/Draw_64.gml index bc5e17bcc..1ce1fb4ef 100644 --- a/objects/o_dialog_group_input_order/Draw_64.gml +++ b/objects/o_dialog_group_input_order/Draw_64.gml @@ -7,7 +7,7 @@ if !ready exit; draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(24), dialog_y + ui(20), get_text("input_order", "Input order")); + draw_text(dialog_x + ui(24), dialog_y + ui(20), __txtx("input_order", "Input order")); #endregion #region preset diff --git a/objects/o_dialog_history/Draw_64.gml b/objects/o_dialog_history/Draw_64.gml index 847c8bd9e..e2ac76d67 100644 --- a/objects/o_dialog_history/Draw_64.gml +++ b/objects/o_dialog_history/Draw_64.gml @@ -7,11 +7,11 @@ if !ready exit; draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(56), dialog_y + ui(20), get_text("history_title", "Action history")); + draw_text(dialog_x + ui(56), dialog_y + ui(20), __txt("History")); var bx = dialog_x + ui(24); var by = dialog_y + ui(18); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, destroy_on_click_out? get_text("pin", "Pin") : get_text("unpin", "Unpin"), + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, destroy_on_click_out? __txtx("pin", "Pin") : __txtx("unpin", "Unpin"), THEME.pin, !destroy_on_click_out, destroy_on_click_out? COLORS._main_icon : COLORS._main_icon_light) == 2) destroy_on_click_out = !destroy_on_click_out; #endregion diff --git a/objects/o_dialog_image_array_edit/Draw_64.gml b/objects/o_dialog_image_array_edit/Draw_64.gml index cb3d00f0d..f74fb4d3e 100644 --- a/objects/o_dialog_image_array_edit/Draw_64.gml +++ b/objects/o_dialog_image_array_edit/Draw_64.gml @@ -8,7 +8,7 @@ if !target exit; draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(padding), dialog_y + ui(20), get_text("array_edit_title", "Image array edit")); + draw_text(dialog_x + ui(padding), dialog_y + ui(20), __txtx("array_edit_title", "Image array edit")); #endregion #region content @@ -28,7 +28,7 @@ if !target exit; var bx = dialog_x + dialog_w - ui(padding - 8) - bw; var by = dialog_y + ui(18); - if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, get_text("add", "Add") + "...", THEME.add,, COLORS._main_value_positive) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, __txtx("add", "Add") + "...", THEME.add,, COLORS._main_value_positive) == 2) { var path = get_open_filenames(".png", ""); key_release(); if(path != "") { @@ -44,6 +44,6 @@ if !target exit; bx -= ui(36); - if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, get_text("array_edit_sort_name", "Sort by name"), THEME.text) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, __txtx("array_edit_sort_name", "Sort by name"), THEME.text) == 2) sortByName(); #endregion \ No newline at end of file diff --git a/objects/o_dialog_migration/Draw_64.gml b/objects/o_dialog_migration/Draw_64.gml index 1fa4b07ac..471e351d0 100644 --- a/objects/o_dialog_migration/Draw_64.gml +++ b/objects/o_dialog_migration/Draw_64.gml @@ -14,11 +14,11 @@ draw_set_alpha(1); #region text var py = dialog_y + ui(16); draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(24), py, get_text("dialog_migration_title", "Program directory changed in 1.13")); + draw_text(dialog_x + ui(24), py, __txtx("dialog_migration_title", "Program directory changed in 1.13")); py += line_get_height(, 4); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text); - draw_text_ext(dialog_x + ui(24), py, get_text("dialog_migration_content", + draw_text_ext(dialog_x + ui(24), py, __txtx("dialog_migration_content", "You can press migrate files or manually move all custom collections, assets, palettes, gradients, fonts and presets."), -1, dialog_w - ui(48)); var bw = ui(112), bh = TEXTBOX_HEIGHT; @@ -29,13 +29,13 @@ draw_set_alpha(1); draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text); var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); - draw_text(bx0 + bw / 2, by0 + bh / 2, get_text("ignore", "Ignore")); + draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("ignore", "Ignore")); if(b == 2) instance_destroy(); bx0 -= bw + ui(12); var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); - draw_text(bx0 + bw / 2, by0 + bh / 2, get_text("migrate_files", "Migrate files")); + draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("migrate_files", "Migrate files")); if(b == 2) { var oldDir = environment_get_variable("userprofile") + "/AppData/Local/Pixels_Composer/"; var folders = [ "Assets", "Collections", "Fonts", "Gradients", "Palettes", "Presets", "Themes"]; @@ -54,7 +54,7 @@ draw_set_alpha(1); bx0 = dialog_x + ui(16); bw = ui(160); var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER); - draw_text(bx0 + bw / 2, by0 + bh / 2, get_text("migrate_open_directory", "Open directory") + "..."); + draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("migrate_open_directory", "Open directory") + "..."); if(b == 2) { if(directory_exists(DIRECTORY)) shellOpenExplorer(DIRECTORY); diff --git a/objects/o_dialog_notifications/Create_0.gml b/objects/o_dialog_notifications/Create_0.gml index f5f7b1365..bf0237da5 100644 --- a/objects/o_dialog_notifications/Create_0.gml +++ b/objects/o_dialog_notifications/Create_0.gml @@ -12,24 +12,24 @@ event_inherited(); filter = NOTI_TYPE.log | NOTI_TYPE.warning | NOTI_TYPE.error; rightClickMenu = [ - menuItem(get_text("noti_clear_log", "Clear log messages"), function() { + menuItem(__txtx("noti_clear_log", "Clear log messages"), function() { for( var i = ds_list_size(STATUSES) - 1; i >= 0; i-- ) { if(STATUSES[| i].type == NOTI_TYPE.log) ds_list_delete(STATUSES, i); } }), - menuItem(get_text("noti_clear_warn", "Clear warning messages"), function() { + menuItem(__txtx("noti_clear_warn", "Clear warning messages"), function() { for( var i = ds_list_size(STATUSES) - 1; i >= 0; i-- ) { if(STATUSES[| i].type == NOTI_TYPE.warning) ds_list_delete(STATUSES, i); } }), -1, - menuItem(get_text("noti_clear_all", "Clear all notifications"), function() { + menuItem(__txtx("noti_clear_all", "Clear all notifications"), function() { ds_list_clear(STATUSES); }), -1, - menuItem(get_text("noti_open_log", "Open log file"), function() { + menuItem(__txtx("noti_open_log", "Open log file"), function() { shellOpenExplorer(DIRECTORY + "log.txt"); }), ]; @@ -72,10 +72,10 @@ event_inherited(); if(mouse_press(mb_right, sFOCUS)) { var dia = menuCall("notification_menu",,, [ - menuItem(get_text("noti_copy_message", "Copy notification message"), function() { + menuItem(__txtx("noti_copy_message", "Copy notification message"), function() { clipboard_set_text(o_dialog_menubox.noti.txt); }), - menuItem(get_text("noti_delete_message", "Delete notification"), function() { + menuItem(__txtx("noti_delete_message", "Delete notification"), function() { ds_list_remove(STATUSES, o_dialog_menubox.noti); }), ],, noti); diff --git a/objects/o_dialog_notifications/Draw_64.gml b/objects/o_dialog_notifications/Draw_64.gml index 9b5184096..2ba1dfb78 100644 --- a/objects/o_dialog_notifications/Draw_64.gml +++ b/objects/o_dialog_notifications/Draw_64.gml @@ -7,11 +7,11 @@ if !ready exit; draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(56), dialog_y + ui(20), get_text("noti_title", "Notification")); + draw_text(dialog_x + ui(56), dialog_y + ui(20), __txt("Notifications")); var bx = dialog_x + ui(24); var by = dialog_y + ui(18); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, destroy_on_click_out? get_text("pin", "Pin") : get_text("unpin", "Unpin"), + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, destroy_on_click_out? __txtx("pin", "Pin") : __txtx("unpin", "Unpin"), THEME.pin, !destroy_on_click_out, destroy_on_click_out? COLORS._main_icon : COLORS._main_icon_light) == 2) destroy_on_click_out = !destroy_on_click_out; #endregion @@ -23,21 +23,21 @@ if !ready exit; var by = dialog_y + ui(18); var error = !!(filter & NOTI_TYPE.error); - var toolt = error? get_text("noti_hide_error", "Hide error") : get_text("noti_show_error", "Show error"); + var toolt = error? __txtx("noti_hide_error", "Hide error") : __txtx("noti_show_error", "Show error"); var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, mouse_ui, sFOCUS, sHOVER, toolt, THEME.noti_icon_error, error, c_white, 0.3 + error * 0.7); if(b == 2) filter = filter ^ NOTI_TYPE.error; if(b == 3) menuCall("notification_error_menu",,, rightClickMenu); bx -= ui(36); var warn = !!(filter & NOTI_TYPE.warning); - var toolt = warn? get_text("noti_hide_warning", "Hide warning") : get_text("noti_show_warning", "Show warning"); + var toolt = warn? __txtx("noti_hide_warning", "Hide warning") : __txtx("noti_show_warning", "Show warning"); var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, mouse_ui, sFOCUS, sHOVER, toolt, THEME.noti_icon_warning, warn, c_white, 0.3 + warn * 0.7); if(b == 2) filter = filter ^ NOTI_TYPE.warning; if(b == 3) menuCall("notification_warning_menu",,, rightClickMenu); bx -= ui(36); var log = !!(filter & NOTI_TYPE.log); - var toolt = log? get_text("noti_hide_log", "Hide log") : get_text("noti_show_log", "Show log"); + var toolt = log? __txtx("noti_hide_log", "Hide log") : __txtx("noti_show_log", "Show log"); var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, mouse_ui, sFOCUS, sHOVER, toolt, THEME.noti_icon_log, log, c_white, 0.3 + log * 0.7); if(b == 2) filter = filter ^ NOTI_TYPE.log; if(b == 3) menuCall("notification_log_menu",,, rightClickMenu); diff --git a/objects/o_dialog_output_visibility/Draw_64.gml b/objects/o_dialog_output_visibility/Draw_64.gml index 0542f95c2..1e250a006 100644 --- a/objects/o_dialog_output_visibility/Draw_64.gml +++ b/objects/o_dialog_output_visibility/Draw_64.gml @@ -7,7 +7,7 @@ if !ready exit; draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(24), dialog_y + ui(20), get_text("output_visibility_title", "Outputs visibility")); + draw_text(dialog_x + ui(24), dialog_y + ui(20), __txtx("output_visibility_title", "Outputs visibility")); #endregion #region preset diff --git a/objects/o_dialog_palette/Create_0.gml b/objects/o_dialog_palette/Create_0.gml index 025879f00..3710cb3e1 100644 --- a/objects/o_dialog_palette/Create_0.gml +++ b/objects/o_dialog_palette/Create_0.gml @@ -7,7 +7,7 @@ event_inherited(); title_height = 52; destroy_on_click_out = true; - name = get_text("palette_editor_title", "Palette editor"); + name = __txtx("palette_editor_title", "Palette editor"); palette = 0; index_selecting = 0; diff --git a/objects/o_dialog_palette/Draw_64.gml b/objects/o_dialog_palette/Draw_64.gml index ed9a7e5f8..f8a56d541 100644 --- a/objects/o_dialog_palette/Draw_64.gml +++ b/objects/o_dialog_palette/Draw_64.gml @@ -24,7 +24,7 @@ if palette == 0 exit; if(sFOCUS) draw_sprite_stretched_ext(THEME.dialog_active, 0, content_x, dialog_y, content_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(presets_x + ui(24), dialog_y + ui(16), get_text("presets", "Presets")); + draw_text(presets_x + ui(24), dialog_y + ui(16), __txtx("presets", "Presets")); draw_text(content_x + (!interactable * ui(32)) + ui(24), dialog_y + ui(16), name); if(!interactable) draw_sprite_ui(THEME.lock, 0, content_x + ui(24 + 12), dialog_y + ui(16 + 12),,,, COLORS._main_icon); @@ -39,7 +39,7 @@ if palette == 0 exit; var bx = presets_x + presets_w - ui(44); var by = dialog_y + ui(12); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, get_text("add_preset", "Add to preset"), THEME.add) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("add_preset", "Add to preset"), THEME.add) == 2) { var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8)); dia.onModify = function (txt) { var file = file_text_open_write(txt + ".hex"); @@ -59,13 +59,13 @@ if palette == 0 exit; } bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, get_text("refresh", "Refresh"), THEME.refresh) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("refresh", "Refresh"), THEME.refresh) == 2) { presetCollect(); } draw_sprite_ui_uniform(THEME.refresh, 0, bx + ui(14), by + ui(14), 1, COLORS._main_icon); bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, get_text("color_selector_open_palette", "Open palette folder"), THEME.folder) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, __txtx("color_selector_open_palette", "Open palette folder"), THEME.folder) == 2) { var _realpath = DIRECTORY + "Palettes"; shellOpenExplorer(_realpath) } @@ -93,19 +93,19 @@ if palette == 0 exit; var bx = content_x + content_w - ui(50); var by = dialog_y + ui(16); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, get_text("palette_editor_sort", "Sort color"), THEME.sort) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("palette_editor_sort", "Sort color"), THEME.sort) == 2) { menuCall("palette_window_sort_menu", bx + ui(32), by, [ - menuItem(get_text("palette_editor_sort_brighter", "Brighter"), function() { sortPalette(__sortBright); }), - menuItem(get_text("palette_editor_sort_darker", "Darker"), function() { sortPalette(__sortDark); }), + menuItem(__txtx("palette_editor_sort_brighter", "Brighter"), function() { sortPalette(__sortBright); }), + menuItem(__txtx("palette_editor_sort_darker", "Darker"), function() { sortPalette(__sortDark); }), -1, - menuItem(get_text("palette_editor_sort_hue", "Hue"), function() { sortPalette(__sortHue); }), - menuItem(get_text("palette_editor_sort_sat", "Saturation"), function() { sortPalette(__sortSat); }), - menuItem(get_text("palette_editor_sort_val", "Value"), function() { sortPalette(__sortVal); }), + menuItem(__txtx("palette_editor_sort_hue", "Hue"), function() { sortPalette(__sortHue); }), + menuItem(__txtx("palette_editor_sort_sat", "Saturation"), function() { sortPalette(__sortSat); }), + menuItem(__txtx("palette_editor_sort_val", "Value"), function() { sortPalette(__sortVal); }), ],, palette); } bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, get_text("palette_editor_reverse", "Reverse palette"), THEME.reverse) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("palette_editor_reverse", "Reverse palette"), THEME.reverse) == 2) { palette = array_reverse(palette); onApply(palette); } @@ -181,7 +181,7 @@ if palette == 0 exit; } bx = content_x + ui(18); - if(buttonInstant(THEME.button, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, get_text("palette_editor_load", "Load palette file") + " (.hex)", THEME.file) == 2) { + if(buttonInstant(THEME.button, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("palette_editor_load", "Load palette file") + " (.hex)", THEME.file) == 2) { var path = get_open_filename(".hex", ""); key_release(); if(path != "") { diff --git a/objects/o_dialog_panel/Draw_64.gml b/objects/o_dialog_panel/Draw_64.gml index 80a540cc0..e54763dc6 100644 --- a/objects/o_dialog_panel/Draw_64.gml +++ b/objects/o_dialog_panel/Draw_64.gml @@ -55,7 +55,7 @@ if !ready exit; var bx = content.showHeader? dialog_x + ui(8) : dialog_x + ui(24); var by = content.showHeader? dialog_y + ui(8) : dialog_y + ui(18); - var txt = destroy_on_click_out? get_text("pin", "Pin") : get_text("unpin", "Unpin"); + var txt = destroy_on_click_out? __txtx("pin", "Pin") : __txtx("unpin", "Unpin"); var cc = destroy_on_click_out? COLORS._main_icon : COLORS._main_icon_light; var ind = !destroy_on_click_out; var ss = content.showHeader? ui(20) : ui(28); diff --git a/objects/o_dialog_preference/Create_0.gml b/objects/o_dialog_preference/Create_0.gml index 1f6468354..4f23fcdb9 100644 --- a/objects/o_dialog_preference/Create_0.gml +++ b/objects/o_dialog_preference/Create_0.gml @@ -24,15 +24,15 @@ event_inherited(); #region pages page_current = 0; - page[0] = get_text("pref_pages_general", "General"); - page[1] = get_text("pref_pages_appearance", "Appearances"); - page[2] = get_text("pref_pages_theme", "Theme"); - page[3] = get_text("pref_pages_hotkeys", "Hotkeys"); + page[0] = __txtx("pref_pages_general", "General"); + page[1] = __txtx("pref_pages_appearance", "Appearances"); + page[2] = __txtx("theme", "Theme"); + page[3] = __txtx("pref_pages_hotkeys", "Hotkeys"); pref_global = ds_list_create(); ds_list_add(pref_global, [ - get_text("panel_directory", "Directory path (restart required)"), + __txtx("panel_directory", "Directory path (restart required)"), function() { return PRESIST_PREF.path; }, new textBox(TEXTBOX_INPUT.text, function(txt) { PRESIST_PREF.path = txt; @@ -47,7 +47,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_show_welcome_screen", "Show welcome screen"), + __txtx("pref_show_welcome_screen", "Show welcome screen"), "show_splash", new checkBox(function() { PREF_MAP[? "show_splash"] = !PREF_MAP[? "show_splash"]; @@ -57,7 +57,7 @@ event_inherited(); PREF_MAP[? "_display_scaling"] = PREF_MAP[? "display_scaling"]; ds_list_add(pref_global, [ - get_text("pref_gui_scaling", "GUI scaling"), + __txtx("pref_gui_scaling", "GUI scaling"), "_display_scaling", new slider(0.5, 2, 0.01, function(val) { PREF_MAP[? "_display_scaling"] = val; @@ -76,7 +76,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("auto_save_time", "Autosave delay (-1 to disable)"), + __txtx("auto_save_time", "Autosave delay (-1 to disable)"), "auto_save_time", new textBox(TEXTBOX_INPUT.number, function(val) { PREF_MAP[? "auto_save_time"] = val; @@ -85,7 +85,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_double_click_delay", "Double click delay"), + __txtx("pref_double_click_delay", "Double click delay"), "double_click_delay", new slider(0, 1, 0.01, function(val) { PREF_MAP[? "double_click_delay"] = val; @@ -94,7 +94,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_mouse_wheel_speed", "Scroll speed"), + __txtx("pref_mouse_wheel_speed", "Scroll speed"), "mouse_wheel_speed", new textBox(TEXTBOX_INPUT.number, function(val) { PREF_MAP[? "mouse_wheel_speed"] = val; @@ -103,7 +103,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_keyboard_hold_start", "Keyboard hold start"), + __txtx("pref_keyboard_hold_start", "Keyboard hold start"), "keyboard_repeat_start", new slider(0, 1, 0.01, function(val) { PREF_MAP[? "keyboard_repeat_start"] = val; @@ -112,7 +112,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_keyboard_repeat_delay", "Keyboard repeat delay"), + __txtx("pref_keyboard_repeat_delay", "Keyboard repeat delay"), "keyboard_repeat_speed", new slider(0, 1, 0.01, function(val) { PREF_MAP[? "keyboard_repeat_speed"] = val; @@ -121,7 +121,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_ui_frame_rate", "UI frame rate"), + __txtx("pref_ui_frame_rate", "UI frame rate"), "ui_framerate", new textBox(TEXTBOX_INPUT.number, function(str) { PREF_MAP[? "ui_framerate"] = max(15, round(real(str))); @@ -131,7 +131,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_default_surface_size", "Default surface size"), + __txtx("pref_default_surface_size", "Default surface size"), "default_surface_side", new textBox(TEXTBOX_INPUT.number, function(str) { PREF_MAP[? "default_surface_side"] = max(1, round(real(str))); @@ -140,7 +140,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_collection_preview_speed", "Collection preview speed"), + __txtx("pref_collection_preview_speed", "Collection preview speed"), "collection_preview_speed", new textBox(TEXTBOX_INPUT.number, function(str) { PREF_MAP[? "collection_preview_speed"] = max(1, round(real(str))); @@ -150,7 +150,7 @@ event_inherited(); ds_list_add(pref_global, [ - get_text("pref_inspector_line_break_width", "Inspector line break width"), + __txtx("pref_inspector_line_break_width", "Inspector line break width"), "inspector_line_break_width", new textBox(TEXTBOX_INPUT.number, function(str) { PREF_MAP[? "inspector_line_break_width"] = max(1, round(real(str))); @@ -159,7 +159,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_expand_hovering_panel", "Expand hovering panel"), + __txtx("pref_expand_hovering_panel", "Expand hovering panel"), "expand_hover", new checkBox(function() { PREF_MAP[? "expand_hover"] = !PREF_MAP[? "expand_hover"]; @@ -168,7 +168,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_graph_zoom_smoothing", "Graph zoom smoothing"), + __txtx("pref_graph_zoom_smoothing", "Graph zoom smoothing"), "graph_zoom_smoooth", new textBox(TEXTBOX_INPUT.number, function(str) { PREF_MAP[? "graph_zoom_smoooth"] = max(1, round(real(str))); @@ -177,7 +177,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_warning_notification_time", "Warning notification time"), + __txtx("pref_warning_notification_time", "Warning notification time"), "notification_time", new textBox(TEXTBOX_INPUT.number, function(str) { PREF_MAP[? "notification_time"] = max(0, round(real(str))); @@ -186,7 +186,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_save_file_minify", "Minify save file"), + __txtx("pref_save_file_minify", "Minify save file"), "save_file_minify", new checkBox(function() { PREF_MAP[? "save_file_minify"] = !PREF_MAP[? "save_file_minify"]; @@ -195,7 +195,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_enable_test_mode", "Enable developer mode (require restart)"), + __txtx("pref_enable_test_mode", "Enable developer mode (require restart)"), "test_mode", new checkBox(function() { PREF_MAP[? "test_mode"] = !PREF_MAP[? "test_mode"]; @@ -204,7 +204,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_legacy_exception", "Use legacy exception handler"), + __txtx("pref_legacy_exception", "Use legacy exception handler"), "use_legacy_exception", new checkBox(function() { PREF_MAP[? "use_legacy_exception"] = !PREF_MAP[? "use_legacy_exception"]; @@ -214,7 +214,7 @@ event_inherited(); ]); ds_list_add(pref_global, [ - get_text("pref_crash_dialog", "Show dialog after crash"), + __txtx("pref_crash_dialog", "Show dialog after crash"), "show_crash_dialog", new checkBox(function() { PREF_MAP[? "show_crash_dialog"] = !PREF_MAP[? "show_crash_dialog"]; @@ -228,9 +228,30 @@ event_inherited(); #region appearance pref_appr = ds_list_create(); + ds_list_add(pref_appr, "Interface"); + locals = []; + var f = file_find_first(DIRECTORY + "Locale/*", fa_none); + while(f != "") { + if(filename_ext(f) == ".json") + array_push(locals, filename_name_only(f)); + f = file_find_next(); + } + file_find_close(); + + ds_list_add(pref_appr, [ + __txtx("pref_interface_language", "Interface Language (restart required)"), + "local", + new scrollBox(locals, function(str) { + if(str < 0) return; + PREF_MAP[? "local"] = locals[str]; + loadLocale(); + PREF_SAVE(); + }) + ]); + ds_list_add(pref_appr, "Graph"); ds_list_add(pref_appr, [ - get_text("pref_connection_thickness", "Connection thickness"), + __txtx("pref_connection_thickness", "Connection thickness"), "connection_line_width", new textBox(TEXTBOX_INPUT.number, function(str) { PREF_MAP[? "connection_line_width"] = real(str); @@ -239,7 +260,7 @@ event_inherited(); ]); ds_list_add(pref_appr, [ - get_text("pref_connection_curve_smoothness", "Connection curve smoothness"), + __txtx("pref_connection_curve_smoothness", "Connection curve smoothness"), "connection_line_sample", new textBox(TEXTBOX_INPUT.number, function(str) { PREF_MAP[? "connection_line_sample"] = real(str); @@ -248,7 +269,7 @@ event_inherited(); ]); ds_list_add(pref_appr, [ - get_text("pref_connection_aa", "Connection anti aliasing"), + __txtx("pref_connection_aa", "Connection anti aliasing"), "connection_line_aa", new textBox(TEXTBOX_INPUT.number, function(str) { PREF_MAP[? "connection_line_aa"] = max(1, real(str)); @@ -257,7 +278,7 @@ event_inherited(); ]) ds_list_add(pref_appr, [ - get_text("pref_connection_anim", "Connection line animation"), + __txtx("pref_connection_anim", "Connection line animation"), "connection_line_transition", new checkBox(function() { PREF_MAP[? "connection_line_transition"] = @@ -267,7 +288,7 @@ event_inherited(); ]) ds_list_add(pref_appr, [ - get_text("panel_menu_right_control", "Use Windows style window control."), + __txtx("panel_menu_right_control", "Use Windows style window control."), "panel_menu_right_control", new checkBox(function() { PREF_MAP[? "panel_menu_right_control"] = !PREF_MAP[? "panel_menu_right_control"]; @@ -489,7 +510,7 @@ event_inherited(); for(var i = 0; i < ds_list_size(ll); i++) { var key = ll[| i]; var group = key.context; - var name = key.name; + var name = __txt(key.name); var pkey = key.key; var modi = key.modi; @@ -584,7 +605,7 @@ event_inherited(); modified = true; var bx = x1 - ui(32); var by = _y + hh; - if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, get_text("reset", "Reset"), THEME.refresh_s) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txtx("reset", "Reset"), THEME.refresh_s) == 2) { key.key = dkey; key.modi = dmod; } @@ -597,7 +618,7 @@ event_inherited(); if(modified) { var bx = x1 - ui(32); var by = _y + ui(2); - if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, get_text("reset_all", "Reset all"), THEME.refresh_s) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txtx("reset_all", "Reset all"), THEME.refresh_s) == 2) { for(var j = 0; j < ds_list_size(HOTKEY_CONTEXT); j++) { var ll = HOTKEYS[? HOTKEY_CONTEXT[| j]]; for(var i = 0; i < ds_list_size(ll); i++) { diff --git a/objects/o_dialog_preference/Draw_64.gml b/objects/o_dialog_preference/Draw_64.gml index 9551a80f2..f8712308e 100644 --- a/objects/o_dialog_preference/Draw_64.gml +++ b/objects/o_dialog_preference/Draw_64.gml @@ -7,11 +7,11 @@ if !ready exit; draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(56), dialog_y + ui(20), get_text("preferences", "Preferences")); + draw_text(dialog_x + ui(56), dialog_y + ui(20), __txtx("preferences", "Preferences")); var bx = dialog_x + ui(24); var by = dialog_y + ui(18); - if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, destroy_on_click_out? get_text("pin", "Pin") : get_text("unpin", "Unpin"), + if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, destroy_on_click_out? __txtx("pin", "Pin") : __txtx("unpin", "Unpin"), THEME.pin, !destroy_on_click_out, destroy_on_click_out? COLORS._main_icon : COLORS._main_icon_light) == 2) destroy_on_click_out = !destroy_on_click_out; #endregion diff --git a/objects/o_dialog_preset/Draw_64.gml b/objects/o_dialog_preset/Draw_64.gml index c7d9c7a09..b8fbdc2ed 100644 --- a/objects/o_dialog_preset/Draw_64.gml +++ b/objects/o_dialog_preset/Draw_64.gml @@ -7,7 +7,7 @@ if !ready exit; draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(24), dialog_y + ui(20), get_text("presets", "Presets")); + draw_text(dialog_x + ui(24), dialog_y + ui(20), __txtx("presets", "Presets")); #endregion #region preset diff --git a/objects/o_dialog_preview_window/Create_0.gml b/objects/o_dialog_preview_window/Create_0.gml index a782fbfb8..c68ca1214 100644 --- a/objects/o_dialog_preview_window/Create_0.gml +++ b/objects/o_dialog_preview_window/Create_0.gml @@ -56,10 +56,10 @@ event_inherited(); surfaceCheck(); menu = [ - menuItem(get_text("reset_view", "Reset view"), function() { reset(); }), + menuItem(__txtx("reset_view", "Reset view"), function() { reset(); }), -1, - menuItem(get_text("preview_win_inspect", "Inspect"), function() { PANEL_GRAPH.node_focus = node_target; }), - menuItem(get_text("panel_graph_send_to_preview", "Send to preview"), function() { PANEL_PREVIEW.setNodePreview(node_target); }), + menuItem(__txtx("preview_win_inspect", "Inspect"), function() { PANEL_GRAPH.node_focus = node_target; }), + menuItem(__txtx("panel_graph_send_to_preview", "Send to preview"), function() { PANEL_PREVIEW.setNodePreview(node_target); }), -1, ] #endregion \ No newline at end of file diff --git a/objects/o_dialog_splash/Draw_64.gml b/objects/o_dialog_splash/Draw_64.gml index 8298f903e..73a251ea6 100644 --- a/objects/o_dialog_splash/Draw_64.gml +++ b/objects/o_dialog_splash/Draw_64.gml @@ -41,7 +41,7 @@ if !ready exit; var y1 = dialog_y + dialog_h - ui(16); draw_set_text(f_p0, fa_left, fa_bottom, COLORS._main_text_sub); - draw_text(x0, y0 - ui(4), "Recent files"); + draw_text(x0, y0 - ui(4), __txt("Recent files")); draw_sprite_stretched(THEME.ui_panel_bg, 0, x0, y0, x1 - x0, y1 - y0); sp_recent.setActiveFocus(sFOCUS, sHOVER); sp_recent.draw(x0 + ui(6), y0); @@ -81,8 +81,9 @@ if !ready exit; for( var i = 0; i < array_length(pages); i++ ) { draw_set_text(f_p0, fa_left, fa_bottom, project_page == i? COLORS._main_text : COLORS._main_text_sub); - var txt = pages[i]; - var amo = noone; + var txt = pages[i]; + var dtxt = __txt(txt); + var amo = noone; switch(txt) { case "Sample projects" : amo = ds_list_size(SAMPLE_PROJECTS); break; @@ -90,7 +91,7 @@ if !ready exit; case "Contests" : amo = array_length(contests); break; } - var tw = ui(16) + string_width(pages[i]); + var tw = ui(16) + string_width(dtxt); if(amo) tw += ui(8) + string_width(amo) + ui(8); if(txt == "Contests") @@ -118,9 +119,9 @@ if !ready exit; } if(txt == "Contests") draw_set_color(project_page == i? CDEF.yellow : COLORS._main_text_sub ); - draw_text(_btx, y0 - ui(4), txt); + draw_text(_btx, y0 - ui(4), dtxt); - _btx += ui(8) + string_width(txt); + _btx += ui(8) + string_width(dtxt); if(amo) { draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _btx, y0 - ui(26), string_width(amo) + ui(8), ui(24), COLORS._main_icon, 0.5); @@ -144,7 +145,7 @@ if !ready exit; if(!expand) { draw_set_text(f_p1, fa_right, fa_bottom, COLORS._main_text_sub); - draw_text(x1 - ui(82), y0 - ui(4), "Art by "); + draw_text(x1 - ui(82), y0 - ui(4), __txtx("art_by", "Art by ")); draw_sprite_ui_uniform(s_kenney, 0, x1, y0 - ui(4), 2, c_white, 0.5); } break; diff --git a/objects/o_dialog_tunnels/Draw_64.gml b/objects/o_dialog_tunnels/Draw_64.gml index a97248f79..855bcd626 100644 --- a/objects/o_dialog_tunnels/Draw_64.gml +++ b/objects/o_dialog_tunnels/Draw_64.gml @@ -7,7 +7,7 @@ if !ready exit; draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text_title); - draw_text(dialog_x + ui(24), dialog_y + ui(20), get_text("tunnels", "Tunnels")); + draw_text(dialog_x + ui(24), dialog_y + ui(20), __txtx("tunnels", "Tunnels")); #endregion #region preset diff --git a/objects/o_main/Draw_75.gml b/objects/o_main/Draw_75.gml index 660264b83..bda7a14f0 100644 --- a/objects/o_main/Draw_75.gml +++ b/objects/o_main/Draw_75.gml @@ -23,7 +23,7 @@ if(OS == os_windows && gameframe_is_minimized()) exit; draw_tooltip_text(printBool(content)); break; case VALUE_TYPE.curve : - draw_tooltip_text("[" + get_text("tooltip_curve_object", "Curve Object") + "]"); + draw_tooltip_text("[" + __txtx("tooltip_curve_object", "Curve Object") + "]"); break; case VALUE_TYPE.color : draw_tooltip_color(content); @@ -32,44 +32,44 @@ if(OS == os_windows && gameframe_is_minimized()) exit; draw_tooltip_gradient(content); break; case VALUE_TYPE.d3object : - draw_tooltip_text("[" + get_text("tooltip_3d_object", "3D Object") + "]"); + draw_tooltip_text("[" + __txtx("tooltip_3d_object", "3D Object") + "]"); break; case VALUE_TYPE.object : - draw_tooltip_text("[" + get_text("tooltip_object", "Object") + "]"); + draw_tooltip_text("[" + __txtx("tooltip_object", "Object") + "]"); break; case VALUE_TYPE.surface : draw_tooltip_surface(content); break; case VALUE_TYPE.rigid : - draw_tooltip_text("[" + get_text("tooltip_rigid_object", "Rigidbody Object") + " (id: " + string(content[$ "object"]) + ")]"); + draw_tooltip_text("[" + __txtx("tooltip_rigid_object", "Rigidbody Object") + " (id: " + string(content[$ "object"]) + ")]"); break; case VALUE_TYPE.particle : var txt = "[" + - get_text("tooltip_particle_object", "Particle Object") + + __txtx("tooltip_particle_object", "Particle Object") + " (size: " + string(array_length(content)) + ") " + "]"; draw_tooltip_text(txt); break; case VALUE_TYPE.pathnode : - draw_tooltip_text("[" + get_text("tooltip_path_object", "Path Object") + "]"); + draw_tooltip_text("[" + __txtx("tooltip_path_object", "Path Object") + "]"); break; case VALUE_TYPE.fdomain : - draw_tooltip_text("[" + get_text("tooltip_fluid_object", "Fluid Domain Object") + " (id: " + string(content) + ")]"); + draw_tooltip_text("[" + __txtx("tooltip_fluid_object", "Fluid Domain Object") + " (id: " + string(content) + ")]"); break; case VALUE_TYPE.strands : - var txt = get_text("tooltip_strand_object", "Strands Object"); + var txt = __txtx("tooltip_strand_object", "Strands Object"); if(is_struct(content)) txt += " (strands: " + string(array_length(content.hairs)) + ")"; draw_tooltip_text("[" + txt + "]"); break; case VALUE_TYPE.mesh : - var txt = get_text("tooltip_mesh_object", "Mesh Object"); + var txt = __txtx("tooltip_mesh_object", "Mesh Object"); if(is_struct(content)) txt += " (triangles: " + string(array_length(content.triangles)) + ")"; draw_tooltip_text("[" + txt + "]"); break; case VALUE_TYPE.d3vertex : - var txt = get_text("tooltip_mesh_vertex", "3D Vertex"); + var txt = __txtx("tooltip_mesh_vertex", "3D Vertex"); txt += " (groups: " + string(array_length(content)) + ")"; draw_tooltip_text("[" + txt + "]"); break; @@ -130,7 +130,7 @@ if(OS == os_windows && gameframe_is_minimized()) exit; draw_sprite_stretched_ext(THEME.ui_panel_active, 0, 0, 0, WIN_W, WIN_H, COLORS._main_value_negative, 1); draw_set_text(f_h1, fa_right, fa_bottom, COLORS._main_value_negative); draw_set_alpha(0.1); - draw_text(WIN_W - ui(16), WIN_H - ui(8), get_text("safe_mode", "SAFE MODE")); + draw_text(WIN_W - ui(16), WIN_H - ui(8), __txtx("safe_mode", "SAFE MODE")); draw_set_alpha(1); } #endregion diff --git a/objects/o_main/Step_0.gml b/objects/o_main/Step_0.gml index 00607b976..9b3ba8a10 100644 --- a/objects/o_main/Step_0.gml +++ b/objects/o_main/Step_0.gml @@ -24,8 +24,10 @@ if(OS == os_windows && gameframe_is_minimized()) exit; if(PANEL_MAIN != 0) PANEL_MAIN.step(); - for(var i = 0; i < ds_list_size(NODES); i++) + for(var i = 0; i < ds_list_size(NODES); i++) { + NODES[| i].triggerCheck(); NODES[| i].step(); + } } catch(e) { noti_warning("Step error: " + exception_print(e)); } diff --git a/scripts/__panel_empty/__panel_empty.gml b/scripts/__panel_empty/__panel_empty.gml index f05d36cca..78a193583 100644 --- a/scripts/__panel_empty/__panel_empty.gml +++ b/scripts/__panel_empty/__panel_empty.gml @@ -1,5 +1,5 @@ function Panel_Empty() : PanelContent() constructor { - title = "Title"; + title = ""; w = ui(640); h = ui(320); diff --git a/scripts/areaBox/areaBox.gml b/scripts/areaBox/areaBox.gml index f5eb7e809..3d061ff9b 100644 --- a/scripts/areaBox/areaBox.gml +++ b/scripts/areaBox/areaBox.gml @@ -139,7 +139,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { } if(onSurfaceSize != -1) { - if(buttonInstant(THEME.button_hide, _x - ui(76), _y + ui(28 - 12), ui(24), ui(24), _m, active, hover, "Fill surface", THEME.fill, 0, c_white) == 2) { + if(buttonInstant(THEME.button_hide, _x - ui(76), _y + ui(28 - 12), ui(24), ui(24), _m, active, hover, __txtx("widget_area_fill_surface", "Full surface"), THEME.fill, 0, c_white) == 2) { switch(mode) { case AREA_MODE.area : var ss = onSurfaceSize(); @@ -167,9 +167,9 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { var txt = ""; switch(mode) { - case AREA_MODE.area : txt = "Center + Span"; break; - case AREA_MODE.padding : txt = "Padding"; break; - case AREA_MODE.two_point : txt = "Two points"; break; + case AREA_MODE.area : txt = __txtx("widget_area_center_Span", "Center + Span"); break; + case AREA_MODE.padding : txt = __txtx("widget_area_padding", "Padding"); break; + case AREA_MODE.two_point : txt = __txtx("widget_area_two_points", "Two points"); break; } if(buttonInstant(THEME.button_hide, _x + ui(76 - 24), _y + ui(28 - 12), ui(24), ui(24), _m, active, hover, txt, THEME.inspector_area_type, mode, c_white) == 2) { @@ -219,7 +219,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { if(mode == AREA_MODE.padding) { var cc = link_value? COLORS._main_accent : COLORS._main_icon; - if(buttonInstant(THEME.button_hide, _x - ui(76), _y + ui(88), ui(24), ui(24), _m, active, hover, "Link value", THEME.value_link, link_value, cc) == 2) + if(buttonInstant(THEME.button_hide, _x - ui(76), _y + ui(88), ui(24), ui(24), _m, active, hover, __txt("Link values"), THEME.value_link, link_value, cc) == 2) link_value = !link_value; } diff --git a/scripts/button/button.gml b/scripts/button/button.gml index 4ae3c7b52..17573a16e 100644 --- a/scripts/button/button.gml +++ b/scripts/button/button.gml @@ -103,8 +103,7 @@ function buttonInstant(spr, _x, _y, _w, _h, _m, _act, _hvr, _tip = "", _icon = n res = 1; if(spr) draw_sprite_stretched(spr, 1, _x, _y, _w, _h); - if(_tip != "") - TOOLTIP = _tip; + if(_tip != "") TOOLTIP = _tip; if(mouse_press(mb_left, _act)) res = 2; diff --git a/scripts/fontScrollBox/fontScrollBox.gml b/scripts/fontScrollBox/fontScrollBox.gml index 78d76ddb3..68996efc7 100644 --- a/scripts/fontScrollBox/fontScrollBox.gml +++ b/scripts/fontScrollBox/fontScrollBox.gml @@ -7,7 +7,7 @@ function fontScrollBox(_onModify) : widget() constructor { align = fa_center; extra_button = button(function() { shellOpenExplorer(DIRECTORY + "Fonts"); } ) - .setTooltip("Open font folder") + .setTooltip(__txtx("widget_font_open_folder", "Open font folder")) .setIcon(THEME.folder_content, 0, COLORS._main_icon); static trigger = function() { diff --git a/scripts/locale_data/locale_data.gml b/scripts/locale_data/locale_data.gml index 0fc96b32d..1535d0f63 100644 --- a/scripts/locale_data/locale_data.gml +++ b/scripts/locale_data/locale_data.gml @@ -3,28 +3,40 @@ LOCALE = {} function __initLocale() { - var lfile = "data/locale/en.json"; - var root = DIRECTORY + "Locale"; - var path = root + "/en.json"; + var lfile = $"data/locale/en.json"; + var root = $"{DIRECTORY}Locale"; + var path = $"{root}/en.json"; if(!directory_exists(root)) directory_create(root); + if(file_exists(path)) + file_delete(path); + file_copy(lfile, path); - var _l = root + "/version"; - if(file_exists(_l)) { - var res = json_load_struct(_l); - if(!is_struct(res) || !struct_has(res, "version") || res.version != BUILD_NUMBER) - file_copy(lfile, path); - } else - file_copy(lfile, path); - - LOCALE = json_load_struct(path); - - json_save_struct(_l, { version: BUILD_NUMBER }); + loadLocale(); } - function get_text(key, def = "") { - if(!struct_has(LOCALE, key)) return def; - return LOCALE[$ key]; + function loadLocale() { + var path = $"{DIRECTORY}Locale/{PREF_MAP[? "local"]}.json"; + if(!file_exists(path)) + path = $"{DIRECTORY}Locale/en.json"; + + LOCALE = json_load_struct(path); + } + + function __txtx(key, def = "") { + if(!struct_has(LOCALE, key)) { + print($"LOCAL \"{key}\": \"{def}\","); + return def; + } + + return ""//LOCALE[$ key]; + } + + function __txt(txt, prefix = "") { + var key = string_lower(txt); + key = string_replace_all(key, " ", "_"); + + return __txtx(prefix + key, txt); } #endregion \ No newline at end of file diff --git a/scripts/matrixGrid/matrixGrid.gml b/scripts/matrixGrid/matrixGrid.gml index 88e292a3a..7026b3852 100644 --- a/scripts/matrixGrid/matrixGrid.gml +++ b/scripts/matrixGrid/matrixGrid.gml @@ -90,7 +90,7 @@ function matrixGrid(_type, _onModify, _unit = noone) : widget() constructor { b_link.setActiveFocus(hover, active); b_link.icon_index = linked; b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon; - b_link.tooltip = linked? "Unlink values" : "Link values"; + b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values"); var hh = TEXTBOX_HEIGHT + ui(8); var th = hh * 3 - ui(8); diff --git a/scripts/meta_data/meta_data.gml b/scripts/meta_data/meta_data.gml index 57393cef0..82980a437 100644 --- a/scripts/meta_data/meta_data.gml +++ b/scripts/meta_data/meta_data.gml @@ -23,11 +23,11 @@ function MetaDataManager() constructor { steam = false; static displays = [ - [ get_text("description", "Description"), function(meta) { return meta.description; } , line_get_height() * 5], - [ get_text("author", "Author"), function(meta) { return meta.author; } , line_get_height() ], - [ get_text("contact_info", "Contact info"), function(meta) { return meta.contact; } , line_get_height() ], - [ get_text("alias", "Alias"), function(meta) { return meta.alias; } , line_get_height() ], - [ get_text("tags", "Tags"), function(meta) { return meta.tags; } , line_get_height() ], + [ __txtx("description", "Description"), function(meta) { return meta.description; } , line_get_height() * 5], + [ __txtx("author", "Author"), function(meta) { return meta.author; } , line_get_height() ], + [ __txtx("contact_info", "Contact info"), function(meta) { return meta.contact; } , line_get_height() ], + [ __txtx("alias", "Alias"), function(meta) { return meta.alias; } , line_get_height() ], + [ __txtx("tags", "Tags"), function(meta) { return meta.tags; } , line_get_height() ], ]; static serialize = function() { @@ -90,7 +90,7 @@ function MetaDataManager() constructor { } var _aut = "By " + author; - var _ver = version < SAVEFILE_VERSION? get_text("meta_old_version", "Created on an older version") : get_text("meta_new_version", "Created on a newer version"); + var _ver = version < SAVEFILE_VERSION? __txtx("meta_old_version", "Created on an older version") : __txtx("meta_new_version", "Created on a newer version"); draw_set_font(f_h5); _h += string_height_ext(name, -1, ww) - ui(4); diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index 220a2230a..9beaff6e5 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -23,7 +23,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc jun.setAnim(anim_hold); draw_sprite_ui_uniform(THEME.animate_clock, index, butx, lb_y, 1, index == 2? COLORS._main_accent : c_white, 1); - TOOLTIP = jun.value_from == noone? get_text("panel_inspector_toggle_anim", "Toggle animation") : get_text("panel_inspector_remove_link", "Remove link"); + TOOLTIP = jun.value_from == noone? __txtx("panel_inspector_toggle_anim", "Toggle animation") : __txtx("panel_inspector_remove_link", "Remove link"); if(mouse_press(mb_left, _focus)) { if(jun.value_from != noone) @@ -54,7 +54,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc jun.visible = visi_hold; draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 1); - TOOLTIP = get_text("visibility", "Visibility"); + TOOLTIP = __txt("Visibility"); if(mouse_press(mb_left, _focus)) { jun.visible = !jun.visible; @@ -123,8 +123,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc } } - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, kfFocus? get_text("panel_inspector_remove_key", "Remove keyframe") : - get_text("panel_inspector_add_key", "Add keyframe"), THEME.prop_keyframe, 1, cc) == 2) { + if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, kfFocus? __txtx("panel_inspector_remove_key", "Remove keyframe") : + __txtx("panel_inspector_add_key", "Add keyframe"), THEME.prop_keyframe, 1, cc) == 2) { var _add = false; for(var j = 0; j < ds_list_size(jun.animator.values); j++) { var _key = jun.animator.values[| j]; @@ -161,7 +161,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc draw_line(bx - ui(20), by - lhf, bx - ui(20), by + lhf); bx -= ui(26 + 12); - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, get_text("panel_animation_looping_mode", "Looping mode") + " " + ON_END_NAME[jun.on_end], THEME.prop_on_end, jun.on_end) == 2) + if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_animation_looping_mode", "Looping mode") + " " + ON_END_NAME[jun.on_end], THEME.prop_on_end, jun.on_end) == 2) jun.on_end = safe_mod(jun.on_end + 1, sprite_get_number(THEME.prop_on_end)); } #endregion @@ -171,7 +171,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc var bx = xx + ww - ui(12); var by = lb_y; var ic_b = jun.expUse? c_white : COLORS._main_icon; - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, "Use expression", THEME.node_use_expression, jun.expUse, ic_b) == 2) + if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_use_expression", "Use expression"), THEME.node_use_expression, jun.expUse, ic_b) == 2) jun.expUse = !jun.expUse; } #endregion diff --git a/scripts/node_array/node_array.gml b/scripts/node_array/node_array.gml index 9616128ff..574d1899d 100644 --- a/scripts/node_array/node_array.gml +++ b/scripts/node_array/node_array.gml @@ -34,7 +34,7 @@ function Node_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { var bxc = bx + bw / 2 - (string_width("Add") + ui(64)) / 2; var byc = by + bh / 2; draw_sprite_ui(THEME.add, 0, bxc + ui(24), byc,,,, COLORS._main_icon_light); - draw_text(bxc + ui(48), byc, get_text("add", "Add")); + draw_text(bxc + ui(48), byc, __txtx("add", "Add")); var bx = _x + bw + ui(8); var amo = attributes[? "size"]; diff --git a/scripts/node_ase_file_read/node_ase_file_read.gml b/scripts/node_ase_file_read/node_ase_file_read.gml index 501292244..51e719a92 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.gml +++ b/scripts/node_ase_file_read/node_ase_file_read.gml @@ -279,7 +279,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const return true; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index 08128a7ff..781737ee0 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -84,7 +84,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc dia.node = self; }) ]); - insp1UpdateTooltip = get_text("panel_inspector_execute", "Execute node contents"); + insp1UpdateTooltip = __txtx("panel_inspector_execute", "Execute node contents"); insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; static inspector1Update = function() { onInspector1Update(); } diff --git a/scripts/node_color_adjustment/node_color_adjustment.gml b/scripts/node_color_adjustment/node_color_adjustment.gml index a59795ec5..64bc0e56c 100644 --- a/scripts/node_color_adjustment/node_color_adjustment.gml +++ b/scripts/node_color_adjustment/node_color_adjustment.gml @@ -19,46 +19,69 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0); inputs[| 1] = nodeValue("Brightness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) - .setDisplay(VALUE_DISPLAY.slider, [ -1, 1, 0.01]); + .setDisplay(VALUE_DISPLAY.slider, [ -1, 1, 0.01 ]); inputs[| 2] = nodeValue("Contrast", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5) - .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01]); + .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]); inputs[| 3] = nodeValue("Hue", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) - .setDisplay(VALUE_DISPLAY.slider, [ -1, 1, 0.01]); + .setDisplay(VALUE_DISPLAY.slider, [ -1, 1, 0.01 ]); inputs[| 4] = nodeValue("Saturation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) - .setDisplay(VALUE_DISPLAY.slider, [ -1, 1, 0.01]); + .setDisplay(VALUE_DISPLAY.slider, [ -1, 1, 0.01 ]); inputs[| 5] = nodeValue("Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) - .setDisplay(VALUE_DISPLAY.slider, [ -1, 1, 0.01]); + .setDisplay(VALUE_DISPLAY.slider, [ -1, 1, 0.01 ]); inputs[| 6] = nodeValue("Blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white); inputs[| 7] = nodeValue("Blend alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) - .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01]); + .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]); inputs[| 8] = nodeValue("Mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0); inputs[| 9] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1) - .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01]); + .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]); inputs[| 10] = nodeValue("Exposure", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1) - .setDisplay(VALUE_DISPLAY.slider, [ 0, 4, 0.01]); + .setDisplay(VALUE_DISPLAY.slider, [ 0, 4, 0.01 ]); inputs[| 11] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true); active_index = 11; + + inputs[| 12] = nodeValue("Input Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .setDisplay(VALUE_DISPLAY.enum_button, [ "Surface", "Color" ]); + + inputs[| 13] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ c_white ]) + .setDisplay(VALUE_DISPLAY.palette) + .setVisible(true, true); outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); - input_display_list = [11, 0, 8, + outputs[| 1] = nodeValue("Color out", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, []) + .setDisplay(VALUE_DISPLAY.palette); + + input_display_list = [11, 12, 0, 8, 13, ["Brightness", false], 1, 10, 2, ["HSV", false], 3, 4, 5, ["Color blend", false], 6, 7, 9 ]; + temp_surface = [ surface_create(1, 1) ]; + attribute_surface_depth(); + static step = function() { + var type = inputs[| 12].getValue(); + + inputs[| 0].setVisible(type == 0, type == 0); + inputs[| 8].setVisible(type == 0, type == 0); + inputs[| 13].setVisible(type == 1, type == 1); + + outputs[| 0].setVisible(type == 0, type == 0); + outputs[| 1].setVisible(type == 1, type == 1); + } + static process_data = function(_outSurf, _data, _output_index, _array_index) { var _bri = _data[1]; var _con = _data[2]; @@ -72,7 +95,49 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro var _alp = _data[9]; var _exp = _data[10]; - surface_set_target(_outSurf); + var _type = _data[12]; + var _col = _data[13]; + + if(_type == 0 && _output_index != 0) return []; + if(_type == 1 && _output_index != 1) return noone; + + var _surf = _data[0]; + var _baseSurf = _outSurf; + + if(_type == 1) { + if(!is_array(_col)) _col = [ _col ]; + + for( var i = 0; i < array_length(_col); i++ ) { + var _c = _col[i]; + + var r = color_get_red(_c) / 255; + var g = color_get_green(_c) / 255; + var b = color_get_blue(_c) / 255; + + _c = make_color_rgb( + clamp((.5 + _con * 2 * (r - .5) + _bri) * _exp, 0, 1) * 255, + clamp((.5 + _con * 2 * (g - .5) + _bri) * _exp, 0, 1) * 255, + clamp((.5 + _con * 2 * (b - .5) + _bri) * _exp, 0, 1) * 255, + ); + + var h = color_get_hue(_c) / 255; + var s = color_get_saturation(_c) / 255; + var v = color_get_value(_c) / 255; + + h = clamp(frac(h + _hue), -1, 1); + if(h < 0) h = 1 + h; + v = clamp((v + _val) * (1 + _sat * s * 0.5), 0, 1); + s = clamp(s * (_sat + 1), 0, 1); + + _c = make_color_hsv(h * 255, s * 255, v * 255); + _c = merge_color(_c, _bl, _bla); + _col[i] = _c; + } + + return _col; + } + + surface_set_target(_baseSurf); DRAW_CLEAR BLEND_OVERRIDE; @@ -91,9 +156,9 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro shader_set_uniform_f(uniform_bla, _bla); gpu_set_colorwriteenable(1, 1, 1, 0); - if(is_surface(_data[0])) draw_surface_safe(_data[0], 0, 0); + draw_surface_safe(_surf, 0, 0); gpu_set_colorwriteenable(1, 1, 1, 1); - if(is_surface(_data[0])) draw_surface_ext_safe(_data[0], 0, 0, 1, 1, 0, c_white, _alp); + draw_surface_ext_safe(_surf, 0, 0, 1, 1, 0, c_white, _alp); shader_reset(); BLEND_NORMAL; @@ -101,4 +166,17 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro return _outSurf; } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + var type = inputs[| 12].getValue(); + if(type == 0) return; + + var bbox = drawGetBbox(xx, yy, _s); + if(bbox.h < 1) return; + + var pal = outputs[| 1].getValue(); + if(array_length(pal) && is_array(pal[0])) return; + + drawPalette(pal, bbox.x0, bbox.y0, bbox.w, bbox.h); + } } \ No newline at end of file diff --git a/scripts/node_csv_file_read/node_csv_file_read.gml b/scripts/node_csv_file_read/node_csv_file_read.gml index 4ff190caa..181b10491 100644 --- a/scripts/node_csv_file_read/node_csv_file_read.gml +++ b/scripts/node_csv_file_read/node_csv_file_read.gml @@ -90,7 +90,7 @@ function Node_CSV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const return true; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 843e5805d..c6895b5bf 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -245,7 +245,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if(!LOADING) MODIFIED = true; } - insp1UpdateTooltip = get_text("panel_inspector_execute", "Execute node"); + insp1UpdateTooltip = __txtx("panel_inspector_execute", "Execute node"); insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; static inspector1Update = function() { @@ -258,7 +258,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static onInspector1Update = noone; static hasInspector1Update = function() { return onInspector1Update != noone; } - insp2UpdateTooltip = get_text("panel_inspector_execute", "Execute node"); + insp2UpdateTooltip = __txtx("panel_inspector_execute", "Execute node"); insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; static inspector2Update = function() { onInspector2Update(); } @@ -289,6 +289,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x } static doStepBegin = function() {} + static triggerCheck = function() { + for( var i = 0; i < ds_list_size(inputs); i++ ) { + if(inputs[| i].type != VALUE_TYPE.trigger) continue; + if(!is_instanceof(inputs[| i].editWidget, buttonClass)) continue; + + var trig = inputs[| i].getValue(); + if(trig) inputs[| i].editWidget.onClick(); + } + } + static step = function() {} static focusStep = function() {} diff --git a/scripts/node_image/node_image.gml b/scripts/node_image/node_image.gml index f2631b58a..f2240b126 100644 --- a/scripts/node_image/node_image.gml +++ b/scripts/node_image/node_image.gml @@ -79,7 +79,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { return false; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/node_image_animated/node_image_animated.gml b/scripts/node_image_animated/node_image_animated.gml index 6a810d8d9..353287cd2 100644 --- a/scripts/node_image_animated/node_image_animated.gml +++ b/scripts/node_image_animated/node_image_animated.gml @@ -123,7 +123,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons return true; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/node_image_gif/node_image_gif.gml b/scripts/node_image_gif/node_image_gif.gml index 41c4e7362..801b4d8e0 100644 --- a/scripts/node_image_gif/node_image_gif.gml +++ b/scripts/node_image_gif/node_image_gif.gml @@ -61,7 +61,7 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct return false; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/node_image_sequence/node_image_sequence.gml b/scripts/node_image_sequence/node_image_sequence.gml index 81e5f15be..e0b756a1a 100644 --- a/scripts/node_image_sequence/node_image_sequence.gml +++ b/scripts/node_image_sequence/node_image_sequence.gml @@ -81,7 +81,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons return false; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/node_json_file_read/node_json_file_read.gml b/scripts/node_json_file_read/node_json_file_read.gml index 3b1434b11..60c56099c 100644 --- a/scripts/node_json_file_read/node_json_file_read.gml +++ b/scripts/node_json_file_read/node_json_file_read.gml @@ -69,7 +69,7 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons return false; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/node_text_file_read/node_text_file_read.gml b/scripts/node_text_file_read/node_text_file_read.gml index e0f4fa49e..dbed67367 100644 --- a/scripts/node_text_file_read/node_text_file_read.gml +++ b/scripts/node_text_file_read/node_text_file_read.gml @@ -52,7 +52,7 @@ function Node_Text_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons return false; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/node_trigger/node_trigger.gml b/scripts/node_trigger/node_trigger.gml index 3d411d379..d1f9f7620 100644 --- a/scripts/node_trigger/node_trigger.gml +++ b/scripts/node_trigger/node_trigger.gml @@ -18,14 +18,24 @@ function Node_Trigger(_x, _y, _group = noone) : Node(_x, _y, _group) constructor insp2UpdateTooltip = "Trigger"; insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; + doTrigger = false; + static onInspector2Update = function() { inputs[| 0].setAnim(true); inputs[| 0].setValue(true); } + function step() { + if(doTrigger) { + outputs[| 0].setValue(true); + doTrigger = false; + } else + outputs[| 0].setValue(false); + } + function update() { var trg = inputs[| 0].getValue(); - outputs[| 0].setValue(trg); + if(trg) doTrigger = true; } static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { diff --git a/scripts/node_wav_file_read/node_wav_file_read.gml b/scripts/node_wav_file_read/node_wav_file_read.gml index 5f305209f..bcfd0d814 100644 --- a/scripts/node_wav_file_read/node_wav_file_read.gml +++ b/scripts/node_wav_file_read/node_wav_file_read.gml @@ -179,10 +179,10 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const preview_audio = audio_create_buffer_sound(bufferId, buffer_s16, content.sample, 0, content.packet * 2, audio_mono); } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; - insp2UpdateTooltip = get_text("play_with_timeline", "Play with timeline"); + insp2UpdateTooltip = __txtx("play_with_timeline", "Play with timeline"); insp2UpdateIcon = [ THEME.play_sound, 1, COLORS._main_icon_light ]; attributes[? "play"] = true; diff --git a/scripts/node_websocket_receiver/node_websocket_receiver.gml b/scripts/node_websocket_receiver/node_websocket_receiver.gml index ebe58fdf9..34422c964 100644 --- a/scripts/node_websocket_receiver/node_websocket_receiver.gml +++ b/scripts/node_websocket_receiver/node_websocket_receiver.gml @@ -35,7 +35,7 @@ function Node_Websocket_Receiver(_x, _y, _group = noone) : Node(_x, _y, _group) if(s >= 0) NETWORK_SERVERS[? newPort] = s; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh Server"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Refresh Server"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/node_websocket_sender/node_websocket_sender.gml b/scripts/node_websocket_sender/node_websocket_sender.gml index d5646b523..c39b46bef 100644 --- a/scripts/node_websocket_sender/node_websocket_sender.gml +++ b/scripts/node_websocket_sender/node_websocket_sender.gml @@ -46,7 +46,7 @@ function Node_Websocket_Sender(_x, _y, _group = noone) : Node(_x, _y, _group) co if(s >= 0) NETWORK_CLIENTS[? newPort] = s; } - insp1UpdateTooltip = get_text("panel_inspector_refresh", "Reconnect"); + insp1UpdateTooltip = __txtx("panel_inspector_refresh", "Reconnect"); insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ]; static onInspector1Update = function() { diff --git a/scripts/paddingBox/paddingBox.gml b/scripts/paddingBox/paddingBox.gml index 210975685..14f3151dd 100644 --- a/scripts/paddingBox/paddingBox.gml +++ b/scripts/paddingBox/paddingBox.gml @@ -80,7 +80,7 @@ function paddingBox(_onModify, _unit = noone) : widget() constructor { b_link.setActiveFocus(hover, active); b_link.icon_index = linked; b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon; - b_link.tooltip = linked? "Unlink axis" : "Link axis"; + b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values"); var bx = _x - ui(80); var by = _y - ui(24); diff --git a/scripts/panel_addon/panel_addon.gml b/scripts/panel_addon/panel_addon.gml index 0731ebe64..e2e2adef3 100644 --- a/scripts/panel_addon/panel_addon.gml +++ b/scripts/panel_addon/panel_addon.gml @@ -1,5 +1,5 @@ function Panel_Addon() : PanelContent() constructor { - title = "Addons"; + title = __txt("Addons"); icon = THEME.addon; showHeader = false; @@ -86,9 +86,9 @@ function Panel_Addon() : PanelContent() constructor { var _onStart = array_exists(ADDONS_ON_START, _addon.name); if(pHOVER && point_in_rectangle(_m[0], _m[1], chx0, chy0, chx1, chy1)) { - if(!_act) TOOLTIP = "Not activated"; - else if(!_onStart) TOOLTIP = "Activated"; - else TOOLTIP = "Run on start"; + if(!_act) TOOLTIP = __txtx("panel_addon_not_activated", "Not activated"); + else if(!_onStart) TOOLTIP = __txtx("panel_addon_activated", "Activated"); + else TOOLTIP = __txtx("panel_addon_run_on_start", "Run on start"); draw_sprite_stretched_ext(THEME.checkbox, 1, chx0, chy0, ui(28), ui(28), c_white, 1); hover = false; @@ -116,12 +116,12 @@ function Panel_Addon() : PanelContent() constructor { var _bx = bx - ui(4); var _by = by + ui(4); - var b = buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pFOCUS, pHOVER, "Open in explorer", THEME.folder_content); + var b = buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pFOCUS, pHOVER, __txt("Open in explorer"), THEME.folder_content); if(b) hover = false; if(b == 2) shellOpenExplorer(DIRECTORY + "Addons\\" + _addon.name); _bx -= ui(36) - if(_act && buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pFOCUS, pHOVER, "Addon settings", THEME.addon_setting) == 2) { + if(_act && buttonInstant(THEME.button_hide, _bx, _by, ui(32), ui(32), _m, pFOCUS, pHOVER, __txt("Addon settings"), THEME.addon_setting) == 2) { var _addObj = noone; with(_addon_custom) if(name == _addon.name) _addObj = self; @@ -142,7 +142,7 @@ function Panel_Addon() : PanelContent() constructor { var _yy = by + hg + ui(8); draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub); - draw_text_add(ui(8), _yy, "Author"); + draw_text_add(ui(8), _yy, __txt("Author")); draw_set_text(f_p1, fa_right, fa_top, COLORS._main_text); draw_text_add(ww - ui(8), _yy, _addon.meta.author); diff --git a/scripts/panel_animation/panel_animation.gml b/scripts/panel_animation/panel_animation.gml index 3b9354b45..9d24a5bca 100644 --- a/scripts/panel_animation/panel_animation.gml +++ b/scripts/panel_animation/panel_animation.gml @@ -6,31 +6,31 @@ enum KEYFRAME_DRAG_TYPE { } function Panel_Animation() : PanelContent() constructor { - title = "Animation"; + title = __txt("Animation"); context_str = "Animation"; - icon = THEME.panel_animation; + icon = THEME.panel_animation; - timeline_h = ui(28); - min_w = ui(40); - min_h = ui(48); - tool_width = ui(280); + timeline_h = ui(28); + min_w = ui(40); + min_h = ui(48); + tool_width = ui(280); function initSize() { - timeline_w = w - tool_width - ui(12); + timeline_w = w - tool_width - ui(12); timeline_surface = surface_create_valid(timeline_w, timeline_h); - timeline_mask = surface_create_valid(timeline_w, timeline_h); + timeline_mask = surface_create_valid(timeline_w, timeline_h); - dope_sheet_w = w - tool_width; - dope_sheet_h = h - timeline_h - ui(20); - dope_sheet_surface = surface_create_valid(dope_sheet_w, 1); - dope_sheet_mask = surface_create_valid(dope_sheet_w, 1); + dope_sheet_w = w - tool_width; + dope_sheet_h = h - timeline_h - ui(20); + dope_sheet_surface = surface_create_valid(dope_sheet_w, 1); + dope_sheet_mask = surface_create_valid(dope_sheet_w, 1); } initSize(); - dope_sheet_y = 0; - dope_sheet_y_to = 0; + dope_sheet_y = 0; + dope_sheet_y_to = 0; dope_sheet_y_max = 0; - is_scrolling = false; + is_scrolling = false; dope_sheet_node_padding = ui(2); @@ -41,39 +41,39 @@ function Panel_Animation() : PanelContent() constructor { timeline_scale = 20; timeline_separate = 5; timeline_sep_line = 1; - _scrub_frame = -1; + _scrub_frame = -1; - timeline_shift = 0; + timeline_shift = 0; timeline_shift_to = 0; timeline_dragging = false; - timeline_drag_sx = 0; - timeline_drag_sy = 0; - timeline_drag_mx = 0; - timeline_drag_my = 0; + timeline_drag_sx = 0; + timeline_drag_sy = 0; + timeline_drag_mx = 0; + timeline_drag_my = 0; - timeline_stretch = 0; + timeline_stretch = 0; timeline_stretch_sx = 0; timeline_stretch_mx = 0; - timeline_show_time = -1; - timeline_preview = noone; + timeline_show_time = -1; + timeline_preview = noone; - keyframe_dragging = noone; - keyframe_drag_type = -1; - keyframe_dragout = false; - keyframe_drag_mx = 0; - keyframe_drag_my = 0; - keyframe_selecting = []; - keyframe_boxing = false; - keyframe_box_sx = -1; - keyframe_box_sy = -1; + keyframe_dragging = noone; + keyframe_drag_type = -1; + keyframe_dragout = false; + keyframe_drag_mx = 0; + keyframe_drag_my = 0; + keyframe_selecting = []; + keyframe_boxing = false; + keyframe_box_sx = -1; + keyframe_box_sy = -1; value_hovering = noone; value_focusing = noone; - node_ordering = noone; show_node_outside_context = true; - node_name_type = 0; + node_ordering = noone; + node_name_type = 0; stagger_mode = 0; stagger_index = 0; @@ -83,33 +83,33 @@ function Panel_Animation() : PanelContent() constructor { prev_cache = array_create(ANIMATOR.frames_total); control_buttons = [ - [ function() { return get_text("stop", "Stop"); }, + [ function() { return __txt("Stop"); }, function() { return 4; }, function() { return ANIMATOR.is_playing? COLORS._main_accent : COLORS._main_icon; }, function() { ANIMATOR.stop(); } ], - [ function() { return ANIMATOR.is_playing? get_text("pause", "Pause") : get_text("play", "Play"); }, + [ function() { return ANIMATOR.is_playing? __txt("Pause") : __txt("Play"); }, function() { return !ANIMATOR.is_playing; }, function() { return ANIMATOR.is_playing? COLORS._main_accent : COLORS._main_icon; }, function() { if(ANIMATOR.is_playing) ANIMATOR.pause(); else ANIMATOR.resume(); } ], - [ function() { return get_text("panel_animation_go_to_first_frame", "Go to first frame"); }, + [ function() { return __txtx("panel_animation_go_to_first_frame", "Go to first frame"); }, function() { return 3; }, function() { return COLORS._main_icon; }, function() { ANIMATOR.setFrame(0); } ], - [ function() { return get_text("panel_animation_go_to_last_frame", "Go to last frame"); }, + [ function() { return __txtx("panel_animation_go_to_last_frame", "Go to last frame"); }, function() { return 2; }, function() { return COLORS._main_icon; }, function() { ANIMATOR.setFrame(ANIMATOR.frames_total - 1); } ], - [ function() { return get_text("panel_animation_previous_frame", "Previous frame"); }, + [ function() { return __txtx("panel_animation_previous_frame", "Previous frame"); }, function() { return 5; }, function() { return COLORS._main_icon; }, function() { ANIMATOR.setFrame(ANIMATOR.real_frame - 1); } ], - [ function() { return get_text("panel_animation_next_frame", "Next frame"); }, + [ function() { return __txtx("panel_animation_next_frame", "Next frame"); }, function() { return 6; }, function() { return COLORS._main_icon; }, function() { ANIMATOR.setFrame(ANIMATOR.real_frame + 1); } @@ -225,89 +225,89 @@ function Panel_Animation() : PanelContent() constructor { } keyframe_menu = [ - menuItemGroup(get_text("panel_animation_ease_in", "Ease in"), [ + menuItemGroup(__txtx("panel_animation_ease_in", "Ease in"), [ [ [THEME.timeline_ease, 0], function() { for( var i = 0; i < array_length(keyframe_selecting); i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.none; k.ease_in = [0, 1]; } - }, get_text("panel_animation_ease_linear", "Linear") ], + }, __txtx("panel_animation_ease_linear", "Linear") ], [ [THEME.timeline_ease, 1], function() { for( var i = 0; i < array_length(keyframe_selecting); i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.bezier; k.ease_in = [1, 1]; } - }, get_text("panel_animation_ease_smooth", "Smooth") ], + }, __txtx("panel_animation_ease_smooth", "Smooth") ], [ [THEME.timeline_ease, 2], function() { for( var i = 0; i < array_length(keyframe_selecting); i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.bezier; k.ease_in = [1, 2]; } - }, get_text("panel_animation_ease_overshoot", "Overshoot") ], + }, __txtx("panel_animation_ease_overshoot", "Overshoot") ], [ [THEME.timeline_ease, 3], function() { for( var i = 0; i < array_length(keyframe_selecting); i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.bezier; k.ease_in = [0, 0]; } - }, get_text("panel_animation_ease_sharp", "Sharp") ], + }, __txtx("panel_animation_ease_sharp", "Sharp") ], [ [THEME.timeline_ease, 4], function() { for( var i = 0; i < array_length(keyframe_selecting); i++ ) { var k = keyframe_selecting[i]; k.ease_in_type = CURVE_TYPE.cut; k.ease_in = [0, 0]; } - }, get_text("panel_animation_ease_hold", "Hold") ], + }, __txtx("panel_animation_ease_hold", "Hold") ], ]), - menuItemGroup(get_text("panel_animation_ease_out", "Ease out"), [ + menuItemGroup(__txtx("panel_animation_ease_out", "Ease out"), [ [ [THEME.timeline_ease, 0], function() { for( var i = 0; i < array_length(keyframe_selecting); i++ ) { var k = keyframe_selecting[i]; k.ease_out_type = CURVE_TYPE.none; k.ease_out = [0, 0]; } - }, get_text("panel_animation_ease_linear", "Linear") ], + }, __txtx("panel_animation_ease_linear", "Linear") ], [ [THEME.timeline_ease, 1], function() { for( var i = 0; i < array_length(keyframe_selecting); i++ ) { var k = keyframe_selecting[i]; k.ease_out_type = CURVE_TYPE.bezier; k.ease_out = [1, 0]; } - }, get_text("panel_animation_ease_smooth", "Smooth") ], + }, __txtx("panel_animation_ease_smooth", "Smooth") ], [ [THEME.timeline_ease, 2], function() { for( var i = 0; i < array_length(keyframe_selecting); i++ ) { var k = keyframe_selecting[i]; k.ease_out_type = CURVE_TYPE.bezier; k.ease_out = [1, -1]; } - }, get_text("panel_animation_ease_overshoot", "Overshoot") ], + }, __txtx("panel_animation_ease_overshoot", "Overshoot") ], [ [THEME.timeline_ease, 3], function() { for( var i = 0; i < array_length(keyframe_selecting); i++ ) { var k = keyframe_selecting[i]; k.ease_out_type = CURVE_TYPE.bezier; k.ease_out = [0, 1]; } - }, get_text("panel_animation_ease_sharp", "Sharp") ], + }, __txtx("panel_animation_ease_sharp", "Sharp") ], ]), -1, - menuItemGroup(get_text("align", "Align"), [ + menuItemGroup(__txt("Align"), [ [ [THEME.timeline_key_halign, 0], function() { alignKeys(fa_left); } ], [ [THEME.timeline_key_halign, 1], function() { alignKeys(fa_center); } ], [ [THEME.timeline_key_halign, 2], function() { alignKeys(fa_right); } ], ]), - menuItem(get_text("panel_animation_stagger", "Stagger"), function() { stagger_mode = 1; }), + menuItem(__txtx("panel_animation_stagger", "Stagger"), function() { stagger_mode = 1; }), -1, - menuItem(get_text("delete", "Delete"), function() { deleteKeys(); }, noone, [ "Animation", "Delete keys" ]), - menuItem(get_text("duplicate", "Duplicate"), function() { doDuplicate(); }, THEME.duplicate, [ "Animation", "Duplicate" ]), - menuItem(get_text("copy", "Copy"), function() { doCopy(); }, THEME.copy, [ "Animation", "Copy" ]), - menuItem(get_text("paste", "Paste"), function() { doPaste(value_focusing); }, THEME.paste, [ "Animation", "Paste" ]), + menuItem(__txt("Delete"), function() { deleteKeys(); }, noone, [ "Animation", "Delete keys" ]), + menuItem(__txt("Duplicate"), function() { doDuplicate(); }, THEME.duplicate, [ "Animation", "Duplicate" ]), + menuItem(__txt("Copy"), function() { doCopy(); }, THEME.copy, [ "Animation", "Copy" ]), + menuItem(__txt("Paste"), function() { doPaste(value_focusing); }, THEME.paste, [ "Animation", "Paste" ]), ]; keyframe_menu_empty = [ - menuItem(get_text("paste", "Paste"), function() { doPaste(value_focusing); }, THEME.paste, [ "Animation", "Paste" ]), + menuItem(__txt("Paste"), function() { doPaste(value_focusing); }, THEME.paste, [ "Animation", "Paste" ]), ]; function onFocusBegin() { PANEL_ANIMATION = self; } @@ -854,7 +854,7 @@ function Panel_Animation() : PanelContent() constructor { var tx = tool_width - ui(68 + 16 * 0); if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(8))) { draw_sprite_ui_uniform(THEME.timeline_graph, 1, tx, ty, 1, COLORS._main_icon, animator.prop.show_graph? 1 : 0.75); - TOOLTIP = get_text("panel_animation_show_graph", "Show graph"); + TOOLTIP = __txtx("panel_animation_show_graph", "Show graph"); if(mouse_press(mb_left, pFOCUS)) animator.prop.show_graph = !animator.prop.show_graph; @@ -865,7 +865,7 @@ function Panel_Animation() : PanelContent() constructor { var tx = tool_width - ui(72 + 16 * 4.5); if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { draw_sprite_ui_uniform(THEME.prop_on_end, animator.prop.on_end, tx, ty, 1, COLORS._main_icon, 1); - TOOLTIP = get_text("panel_animation_looping_mode", "Looping mode") + ": " + ON_END_NAME[animator.prop.on_end]; + TOOLTIP = __txtx("panel_animation_looping_mode", "Looping mode") + ": " + ON_END_NAME[animator.prop.on_end]; if(mouse_press(mb_left, pFOCUS)) animator.prop.on_end = safe_mod(animator.prop.on_end + 1, sprite_get_number(THEME.prop_on_end)); @@ -940,7 +940,7 @@ function Panel_Animation() : PanelContent() constructor { var tx = tool_width - ui(76 + 16 * 0); if(pHOVER && point_in_circle(msx, msy, tx, _node_y - 1, ui(10))) { draw_sprite_ui_uniform(THEME.animate_node_go, 0, tx, _node_y - 1, 1, COLORS._main_icon_light, 1); - TOOLTIP = get_text("panel_animation_goto", "Go to node"); + TOOLTIP = __txtx("panel_animation_goto", "Go to node"); if(mouse_press(mb_left, pFOCUS)) graphFocusNode(_node); @@ -1266,7 +1266,7 @@ function Panel_Animation() : PanelContent() constructor { if(timeline_stretch == 1) { var len = round((mx - bar_x - timeline_shift) / ui(timeline_scale)) - 2; len = max(1, len); - TOOLTIP = get_text("panel_animation_length", "Animation length") + " " + string(len); + TOOLTIP = __txtx("panel_animation_length", "Animation length") + " " + string(len); ANIMATOR.frames_total = len; if(mouse_release(mb_left)) @@ -1276,7 +1276,7 @@ function Panel_Animation() : PanelContent() constructor { } else if(timeline_stretch == 2) { var len = round((mx - bar_x - timeline_shift) / ui(timeline_scale)) - 2; len = max(1, len); - TOOLTIP = get_text("panel_animation_length", "Animation length") + " " + string(len); + TOOLTIP = __txtx("panel_animation_length", "Animation length") + " " + string(len); var _len = ANIMATOR.frames_total; ANIMATOR.frames_total = len; @@ -1313,7 +1313,7 @@ function Panel_Animation() : PanelContent() constructor { if(pHOVER && point_in_circle(msx, msy, stx, sty, sty)) { if(key_mod_press(CTRL)) { draw_sprite_ui(THEME.animation_stretch, 1, stx, sty, 1, 1, 0, COLORS._main_icon, 1); - TOOLTIP = get_text("panel_animation_stretch", "Stretch animation"); + TOOLTIP = __txtx("panel_animation_stretch", "Stretch animation"); if(mouse_press(mb_left, pFOCUS)) { timeline_stretch = 2; timeline_stretch_mx = msx; @@ -1321,7 +1321,7 @@ function Panel_Animation() : PanelContent() constructor { } } else { draw_sprite_ui(THEME.animation_stretch, 0, stx, sty, 1, 1, 0, COLORS._main_icon, 1); - TOOLTIP = get_text("panel_animation_adjust_length", "Adjust animation length"); + TOOLTIP = __txtx("panel_animation_adjust_length", "Adjust animation length"); if(mouse_press(mb_left, pFOCUS)) { timeline_stretch = 1; timeline_stretch_mx = msx; @@ -1624,12 +1624,12 @@ function Panel_Animation() : PanelContent() constructor { if(y1 - y0 < ui(40)) { draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text_sub); - draw_text(ui(16), cy, "Frame"); + draw_text(ui(16), cy, __txt("Frame")); draw_set_text(f_p1, fa_right, fa_center, ANIMATOR.is_playing? COLORS._main_accent : COLORS._main_text_sub); draw_text(w - ui(16), cy, txt); } else { draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_sub); - draw_text(w / 2, cy - ui(12), "Frame"); + draw_text(w / 2, cy - ui(12), __txt("Frame")); draw_set_text(f_h5, fa_center, fa_center, ANIMATOR.is_playing? COLORS._main_accent : COLORS._main_text_sub); draw_text(w / 2, cy + ui(6), txt); @@ -1639,34 +1639,34 @@ function Panel_Animation() : PanelContent() constructor { by += ui(36); bx = w - ui(44); - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, get_text("panel_animation_animation_settings", "Animation settings"), THEME.animation_setting, 2) == 2) + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_animation_animation_settings", "Animation settings"), THEME.animation_setting, 2) == 2) dialogCall(o_dialog_animation, x + bx + 32, y + by - 8); by -= ui(40); if(by < 8) return; - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, get_text("panel_animation_scale_animation", "Scale animation"), THEME.animation_timing, 2) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_animation_scale_animation", "Scale animation"), THEME.animation_timing, 2) == 2) { var dia = dialogCall(o_dialog_anim_time_scaler, x + bx + ui(32), y + by - ui(8)); dia.anchor = ANCHOR.right | ANCHOR.bottom; } if(by < ui(28)) return; by = ui(8); - var txt = show_node_outside_context? get_text("panel_animation_hide_node", "Hide node outside context") : get_text("panel_animation_show_node", "Show node outside context"); + var txt = show_node_outside_context? __txtx("panel_animation_hide_node", "Hide node outside context") : __txtx("panel_animation_show_node", "Show node outside context"); if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.junc_visible, show_node_outside_context) == 2) show_node_outside_context = !show_node_outside_context; by += ui(28); var txt = ""; switch(node_name_type) { - case 0 : txt = get_text("panel_animation_name_full", "Show full name"); break; - case 1 : txt = get_text("panel_animation_name_type", "Show node type"); break; - case 2 : txt = get_text("panel_animation_name_only", "Show node name"); break; + case 0 : txt = __txtx("panel_animation_name_full", "Show full name"); break; + case 1 : txt = __txtx("panel_animation_name_type", "Show node type"); break; + case 2 : txt = __txtx("panel_animation_name_only", "Show node name"); break; } if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.node_name_type, node_name_type) == 2) node_name_type = (node_name_type + 1) % 3; by += ui(28); - txt = get_text("panel_animation_keyframe_override", "Override Keyframe"); + txt = __txtx("panel_animation_keyframe_override", "Override Keyframe"); if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.keyframe_override, global.FLAG.keyframe_override) == 2) global.FLAG.keyframe_override = !global.FLAG.keyframe_override; } @@ -1682,7 +1682,7 @@ function Panel_Animation() : PanelContent() constructor { drawAnimationControl(); if(timeline_show_time > -1) { - TOOLTIP = get_text("frame", "Frame") + " " + string(timeline_show_time + 1) + "/" + string(ANIMATOR.frames_total); + TOOLTIP = __txtx("frame", "Frame") + " " + string(timeline_show_time + 1) + "/" + string(ANIMATOR.frames_total); timeline_show_time = -1; } } diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index 056f8fe28..e5618a384 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -1,5 +1,5 @@ function Panel_Collection() : PanelContent() constructor { - title = "Collection" + title = __txt("Collections"); expandable = false; group_w = ui(180); @@ -38,10 +38,10 @@ function Panel_Collection() : PanelContent() constructor { if(meta == noone || !meta.steam) { contentMenu = [ - menuItem(get_text("panel_collection_replace", "Replace with selected"), function() { + menuItem(__txtx("panel_collection_replace", "Replace with selected"), function() { saveCollection(PANEL_INSPECTOR.inspecting, _menu_node.data_path, _menu_node.path, false, _menu_node.meta); }), - menuItem(get_text("panel_collection_edit_meta", "Edit metadata") + "...", function() { + menuItem(__txtx("panel_collection_edit_meta", "Edit metadata") + "...", function() { var dia = dialogCall(o_dialog_file_name_collection, mouse_mx + ui(8), mouse_my + ui(-320)); var meta = _menu_node.getMetadata(); if(meta != noone && meta != undefined) @@ -53,7 +53,7 @@ function Panel_Collection() : PanelContent() constructor { dia.doExpand(); }), -1, - menuItem(get_text("delete", "Delete"), function() { + menuItem(__txt("Delete"), function() { file_delete(_menu_node.path); refreshContext(); }) @@ -65,7 +65,7 @@ function Panel_Collection() : PanelContent() constructor { if(STEAM_ENABLED) { if(!meta.steam) { - array_push(contentMenu, menuItem(get_text("panel_collection_workshop_upload", "Upload to Steam Workshop") + "...", function() { + array_push(contentMenu, menuItem(__txtx("panel_collection_workshop_upload", "Upload to Steam Workshop") + "...", function() { var s = PANEL_PREVIEW.getNodePreviewSurface(); if(!is_surface(s)) { noti_warning("Please send any node to preview panel to use as a thumbnail.") @@ -85,7 +85,7 @@ function Panel_Collection() : PanelContent() constructor { })); } else { if(meta.author_steam_id == STEAM_USER_ID && meta.file_id != 0) { - array_push(contentMenu, menuItem(get_text("panel_collection_workshop_update", "Update Steam Workshop content") + "...", function() { + array_push(contentMenu, menuItem(__txtx("panel_collection_workshop_update", "Update Steam Workshop content") + "...", function() { var dia = dialogCall(o_dialog_file_name_collection, mouse_mx + ui(8), mouse_my + ui(-320)); var meta = _menu_node.getMetadata(); if(meta != noone && meta != undefined) @@ -99,7 +99,7 @@ function Panel_Collection() : PanelContent() constructor { })); } - array_push(contentMenu, menuItem("Unsubscribe", function() { + array_push(contentMenu, menuItem(__txt("Unsubscribe"), function() { var meta = _menu_node.getMetadata(); var del_id = meta.file_id; @@ -223,7 +223,7 @@ function Panel_Collection() : PanelContent() constructor { if(meta.author_steam_id == STEAM_USER_ID) { draw_sprite_ui_uniform(THEME.steam_creator, 0, _boxx + grid_size - ui(8), yy + ui(12), 1, COLORS._main_icon_dark, 1); if(point_in_rectangle(_m[0], _m[1], gr_x1 - ui(24), yy, gr_x1, yy + ui(24))) - TOOLTIP = "You created this item"; + TOOLTIP = __txtx("panel_collection_you_created", "You created this item"); } } @@ -388,7 +388,7 @@ function Panel_Collection() : PanelContent() constructor { draw_set_text(f_p0b, fa_left, fa_center, i == mode? COLORS._main_text : COLORS._main_text_sub); - draw_text(_x, _y, r[0]); + draw_text(_x, _y, __txt(r[0])); _x += string_width(r[0]) + ui(20); } @@ -400,7 +400,7 @@ function Panel_Collection() : PanelContent() constructor { if(search_string == "") { if(bx > rootx) { - var txt = contentView? get_text("view_grid", "Grid view") : get_text("view_list", "List view"); + var txt = contentView? __txtx("view_grid", "Grid view") : __txtx("view_list", "List view"); if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.view_mode, contentView) == 2) { contentView = !contentView; } @@ -410,7 +410,7 @@ function Panel_Collection() : PanelContent() constructor { if(mode == 0 && !DEMO) { if(bx > rootx) { if(context != root) { - var txt = get_text("panel_collection_add_node", "Add selecting node as collection"); + var txt = __txtx("panel_collection_add_node", "Add selecting node as collection"); if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.add, 0, COLORS._main_value_positive) == 2) { if(PANEL_INSPECTOR.inspecting != noone) { data_path = context.path; @@ -429,7 +429,7 @@ function Panel_Collection() : PanelContent() constructor { bx -= ui(32); if(bx > rootx) { - var txt = get_text("panel_collection_add_folder", "Add folder"); + var txt = __txtx("panel_collection_add_folder", "Add folder"); if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt) == 2) { var dia = dialogCall(o_dialog_file_name, mouse_mx + 8, mouse_my + 8); dia.onModify = function (txt) { @@ -445,14 +445,14 @@ function Panel_Collection() : PanelContent() constructor { } if(bx > rootx) { - var txt = get_text("panel_collection_open_file", "Open in file explorer"); + var txt = __txtx("panel_collection_open_file", "Open in file explorer"); if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.folder) == 2) shellOpenExplorer(context.path); } bx -= ui(32); if(bx > rootx) { - var txt = get_text("refresh", "Refresh"); + var txt = __txt("Refresh"); if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.refresh) == 2) refreshContext(); } diff --git a/scripts/panel_color/panel_color.gml b/scripts/panel_color/panel_color.gml index 17baef708..d0b6e79ed 100644 --- a/scripts/panel_color/panel_color.gml +++ b/scripts/panel_color/panel_color.gml @@ -4,7 +4,7 @@ enum COLOR_SELECTOR_MODE { } function Panel_Color() : PanelContent() constructor { - title = "Color"; + title = __txt("Color"); showHeader = false; title_height = 64; padding = 24; diff --git a/scripts/panel_console/panel_console.gml b/scripts/panel_console/panel_console.gml index 5dff86a32..4187bab7c 100644 --- a/scripts/panel_console/panel_console.gml +++ b/scripts/panel_console/panel_console.gml @@ -1,5 +1,5 @@ function Panel_Console() : PanelContent() constructor { - title = "Console"; + title = __txtx("panel_debug_console", "Debug Console"); w = ui(640); h = ui(320); diff --git a/scripts/panel_data/panel_data.gml b/scripts/panel_data/panel_data.gml index ac8277f90..55a37a67d 100644 --- a/scripts/panel_data/panel_data.gml +++ b/scripts/panel_data/panel_data.gml @@ -56,11 +56,11 @@ function Panel(_parent, _x, _y, _w, _h) constructor { }, THEME.cross); border_rb_menu = [ - menuItem("Move", function() { + menuItem(__txt("Move"), function() { extract(); panel_mouse = 1; }), - menuItem("Pop out", function() { popWindow(); }, THEME.node_goto), + menuItem(__txtx("panel_pop_out", "Pop out"), function() { popWindow(); }, THEME.node_goto), border_rb_close ]; diff --git a/scripts/panel_globalvar/panel_globalvar.gml b/scripts/panel_globalvar/panel_globalvar.gml index 2eac117d6..1e537a552 100644 --- a/scripts/panel_globalvar/panel_globalvar.gml +++ b/scripts/panel_globalvar/panel_globalvar.gml @@ -1,5 +1,5 @@ function Panel_Globalvar() : PanelContent() constructor { - title = "Global Variables"; + title = __txtx("panel_globalvar", "Global Variables"); context_str = "Globalvar"; showHeader = false; @@ -50,11 +50,11 @@ function Panel_Globalvar() : PanelContent() constructor { var bx = w - ui(32 + 16); var by = title_height / 2 - ui(16 + !in_dialog * 2); - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Add variable", THEME.add, 1, COLORS._main_value_positive) == 2) + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_globalvar_add", "Add variable"), THEME.add, 1, COLORS._main_value_positive) == 2) GLOBAL.createValue(); bx -= ui(32 + 4); - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Edit", var_editing? THEME.accept : THEME.gear,,,, 0.9) == 2) + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Edit"), var_editing? THEME.accept : THEME.gear,,,, 0.9) == 2) var_editing = !var_editing; } } \ No newline at end of file diff --git a/scripts/panel_gradient/panel_gradient.gml b/scripts/panel_gradient/panel_gradient.gml index b03baf7d9..a80c08b34 100644 --- a/scripts/panel_gradient/panel_gradient.gml +++ b/scripts/panel_gradient/panel_gradient.gml @@ -1,5 +1,5 @@ function Panel_Gradient() : PanelContent() constructor { - title = "Gradient"; + title = __txt("Gradients"); showHeader = false; title_height = 64; padding = 24; diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 7d130c36a..917893232 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -1,5 +1,5 @@ function Panel_Graph() : PanelContent() constructor { - title = "Graph"; + title = __txt("Graph"); context_str = "Graph"; icon = THEME.panel_graph; @@ -128,25 +128,25 @@ function Panel_Graph() : PanelContent() constructor { [ THEME.icon_preview_export, function() { return 0; }, - function() { return get_text("panel_graph_export_image", "Export graph as image"); }, + function() { return __txtx("panel_graph_export_image", "Export graph as image"); }, function() { dialogPanelCall(new Panel_Graph_Export_Image(self)); } ], [ THEME.icon_center_canvas, function() { return 0; }, - function() { return get_text("panel_graph_center_to_nodes", "Center to nodes"); }, + function() { return __txtx("panel_graph_center_to_nodes", "Center to nodes"); }, function() { toCenterNode(); } ], [ THEME.icon_minimap, function() { return minimap_show; }, - function() { return minimap_show? get_text("panel_graph_minimap_enabled", "Minimap enabled") : get_text("panel_graph_minimap_disabled", "Minimap disabled"); }, + function() { return minimap_show? __txtx("panel_graph_minimap_enabled", "Minimap enabled") : __txtx("panel_graph_minimap_disabled", "Minimap disabled"); }, function() { minimap_show = !minimap_show; } ], [ THEME.icon_curve_connection, function() { return PREF_MAP[? "curve_connection_line"]; }, - function() { return get_text("panel_graph_connection_line", "Connection render settings"); }, + function() { return __txtx("panel_graph_connection_line", "Connection render settings"); }, function(param) { var gs = dialogCall(o_dialog_graph_connection, param.x, param.y); gs.anchor = ANCHOR.bottom | ANCHOR.left; @@ -155,7 +155,7 @@ function Panel_Graph() : PanelContent() constructor { [ THEME.icon_grid_setting, function() { return 0; }, - function() { return get_text("grid_title", "Grid settings"); }, + function() { return __txtx("grid_title", "Grid settings"); }, function(param) { var gs = dialogCall(o_dialog_graph_grid, param.x, param.y); gs.anchor = ANCHOR.bottom | ANCHOR.left; @@ -164,7 +164,7 @@ function Panel_Graph() : PanelContent() constructor { [ THEME.icon_visibility, function() { return 0; }, - function() { return get_text("graph_visibility_title", "Visibility settings"); }, + function() { return __txtx("graph_visibility_title", "Visibility settings"); }, function(param) { var gs = dialogCall(o_dialog_graph_view, param.x, param.y); gs.anchor = ANCHOR.bottom | ANCHOR.left; @@ -488,15 +488,15 @@ function Panel_Graph() : PanelContent() constructor { if(node_hover) { var menu = []; array_push(menu, - menuItem(get_text("panel_graph_send_to_preview", "Send to preview"), function() { + menuItem(__txtx("panel_graph_send_to_preview", "Send to preview"), function() { setCurrentPreview(node_hover); })); array_push(menu, - menuItem(get_text("panel_graph_preview_window", "Send to preview window"), function() { + menuItem(__txtx("panel_graph_preview_window", "Send to preview window"), function() { previewWindow(node_hover); }, noone, ["Graph", "Preview window"])); array_push(menu, - menuItem(get_text("panel_graph_inspector_panel", "Send to new inspector"), function() { + menuItem(__txtx("panel_graph_inspector_panel", "Send to new inspector"), function() { var pan = panelAdd("Panel_Inspector", true); pan.destroy_on_click_out = false; pan.content.inspecting = node_hover; @@ -505,17 +505,17 @@ function Panel_Graph() : PanelContent() constructor { if(DEMO) { array_push(menu, - menuItem(get_text("panel_graph_send_to_export", "Send to export"), function() { + menuItem(__txtx("panel_graph_send_to_export", "Send to export"), function() { setCurrentExport(node_hover); }, noone, ["Graph", "Export"])); } array_push(menu, - menuItem(get_text("panel_graph_toggle_preview", "Toggle node preview"), function() { + menuItem(__txtx("panel_graph_toggle_preview", "Toggle node preview"), function() { setTriggerPreview(); }, noone, ["Graph", "Toggle preview"])); array_push(menu, - menuItem(get_text("panel_graph_toggle_render", "Toggle node render"), function() { + menuItem(__txtx("panel_graph_toggle_render", "Toggle node render"), function() { setTriggerRender(); }, noone, ["Graph", "Toggle render"])); @@ -523,11 +523,11 @@ function Panel_Graph() : PanelContent() constructor { array_push(menu, -1); array_push(menu, - menuItem(get_text("panel_graph_enter_group", "Open group"), function() { + menuItem(__txtx("panel_graph_enter_group", "Open group"), function() { PANEL_GRAPH.addContext(node_hover); }, THEME.group)); array_push(menu, - menuItem(get_text("panel_graph_enter_group_new_tab", "Open group in new tab"), function() { + menuItem(__txtx("panel_graph_enter_group_new_tab", "Open group in new tab"), function() { var graph = new Panel_Graph(); panel.setContent(graph, true); @@ -538,7 +538,7 @@ function Panel_Graph() : PanelContent() constructor { setFocus(panel); }, THEME.group)); array_push(menu, - menuItem(get_text("panel_graph_ungroup", "Ungroup"), function() { + menuItem(__txt("Ungroup"), function() { doUngroup(); }, THEME.group, ["Graph", "Ungroup"])); } @@ -546,31 +546,31 @@ function Panel_Graph() : PanelContent() constructor { array_push(menu, -1); array_push(menu, - menuItem(get_text("panel_graph_delete_and_merge_connection", "Delete and merge connection"), function() { + menuItem(__txtx("panel_graph_delete_and_merge_connection", "Delete and merge connection"), function() { doDelete(true); }, THEME.cross, ["Graph", "Delete (merge)"])); array_push(menu, - menuItem(get_text("panel_graph_delete_and_cut_connection", "Delete and cut connection"), function() { + menuItem(__txtx("panel_graph_delete_and_cut_connection", "Delete and cut connection"), function() { doDelete(false); }, THEME.cross, ["Graph", "Delete (break)"])); array_push(menu, - menuItem(get_text("duplicate", "Duplicate"), function() { + menuItem(__txt("Duplicate"), function() { doDuplicate(); }, THEME.duplicate, ["Graph", "Duplicate"])); array_push(menu, - menuItem(get_text("copy", "Copy"), function() { + menuItem(__txt("Copy"), function() { doCopy(); }, THEME.copy, ["Graph", "Copy"])); array_push(menu, -1); - array_push(menu, menuItem(get_text("panel_graph_add_transform", "Add transform"), addNodeTransform, noone, ["Graph", "Transform node"])); - array_push(menu, menuItem(get_text("panel_graph_canvas", "Canvas"), + array_push(menu, menuItem(__txtx("panel_graph_add_transform", "Add transform"), addNodeTransform, noone, ["Graph", "Transform node"])); + array_push(menu, menuItem(__txtx("panel_graph_canvas", "Canvas"), function(_dat) { return submenuCall(_dat, [ - menuItem(get_text("panel_graph_copy_to_canvas", "Copy to canvas"), function() { + menuItem(__txtx("panel_graph_copy_to_canvas", "Copy to canvas"), function() { setCurrentCanvas(node_hover); }, noone, ["Graph", "Canvas"]), - menuItem(get_text("panel_graph_overlay_canvas", "Overlay canvas"), function() { + menuItem(__txtx("panel_graph_overlay_canvas", "Overlay canvas"), function() { setCurrentCanvasBlend(node_hover); }, noone, ["Graph", "Canvas blend"]) ]); @@ -580,44 +580,44 @@ function Panel_Graph() : PanelContent() constructor { if(ds_list_size(nodes_select_list) >= 2) { array_push(menu, -1); array_push(menu, - menuItem(get_text("panel_graph_align_nodes", "Align nodes"), function(_dat) { + menuItem(__txtx("panel_graph_align_nodes", "Align nodes"), function(_dat) { return submenuCall(_dat, [ - menuItemGroup(get_text("horizontal", "Horizontal"), [ + menuItemGroup(__txtx("horizontal", "Horizontal"), [ [ [THEME.inspector_surface_halign, 0], function() { node_halign(nodes_select_list, fa_left); } ], [ [THEME.inspector_surface_halign, 1], function() { node_halign(nodes_select_list, fa_center); } ], [ [THEME.inspector_surface_halign, 2], function() { node_halign(nodes_select_list, fa_right); } ], ]), - menuItemGroup(get_text("vertical", "Vertical"), [ + menuItemGroup(__txtx("vertical", "Vertical"), [ [ [THEME.inspector_surface_valign, 0], function() { node_valign(nodes_select_list, fa_top); } ], [ [THEME.inspector_surface_valign, 1], function() { node_valign(nodes_select_list, fa_middle); } ], [ [THEME.inspector_surface_valign, 2], function() { node_valign(nodes_select_list, fa_bottom); } ], ]), - menuItemGroup(get_text("distribute", "Distribute"), [ + menuItemGroup(__txtx("distribute", "Distribute"), [ [ [THEME.obj_distribute_h, 0], function() { node_hdistribute(nodes_select_list); } ], [ [THEME.obj_distribute_v, 0], function() { node_vdistribute(nodes_select_list); } ], ]), ]); }).setIsShelf()); array_push(menu, - menuItem(get_text("panel_graph_blend_nodes", "Blend nodes"), function() { + menuItem(__txtx("panel_graph_blend_nodes", "Blend nodes"), function() { doBlend(); }, noone, ["Graph", "Blend"])); array_push(menu, - menuItem(get_text("panel_graph_compose_nodes", "Compose nodes"), function() { + menuItem(__txtx("panel_graph_compose_nodes", "Compose nodes"), function() { doCompose(); }, noone, ["Graph", "Compose"])); array_push(menu, - menuItem(get_text("panel_graph_array_from_nodes", "Array from nodes"), function() { + menuItem(__txtx("panel_graph_array_from_nodes", "Array from nodes"), function() { doArray(); }, noone, ["Graph", "Array"])); array_push(menu, - menuItem(get_text("panel_graph_group_nodes", "Group nodes"), function() { + menuItem(__txtx("panel_graph_group_nodes", "Group nodes"), function() { doGroup(); }, THEME.group, ["Graph", "Group"])); array_push(menu, - menuItem(get_text("panel_graph_frame_nodes", "Frame nodes"), function() { + menuItem(__txtx("panel_graph_frame_nodes", "Frame nodes"), function() { doFrame(); }, noone, ["Graph", "Frame"])); } @@ -627,13 +627,13 @@ function Panel_Graph() : PanelContent() constructor { var menu = []; array_push(menu, - menuItem(get_text("copy", "Copy"), function() { + menuItem(__txt("Copy"), function() { doCopy(); }, THEME.copy, ["Graph", "Copy"]).setActive(node_focus != noone || ds_list_size(nodes_select_list)) ); array_push(menu, - menuItem(get_text("paste", "Paste"), function() { + menuItem(__txt("Paste"), function() { doPaste(); }, THEME.paste, ["Graph", "Paste"]).setActive(clipboard_get_text() != "") ); @@ -1474,7 +1474,7 @@ function Panel_Graph() : PanelContent() constructor { for(var i = -1; i < ds_list_size(node_context); i++) { if(i == -1) { - tt = "Global"; + tt = __txt("Global"); } else { var _cnt = node_context[| i]; tt = _cnt.display_name == ""? _cnt.name : _cnt.display_name; @@ -1493,7 +1493,7 @@ function Panel_Graph() : PanelContent() constructor { if(i == -1) { ds_list_clear(node_context); - title = "Graph"; + title = __txt("Graph"); nodes_list = NODES; toCenterNode(); PANEL_ANIMATION.updatePropertyList(); @@ -1769,9 +1769,9 @@ function Panel_Graph() : PanelContent() constructor { if(pFOCUS && node_focus) node_focus.focusStep(); if(UPDATE == RENDER_TYPE.full) - draw_text(w - ui(8), ui(28), get_text("panel_graph_rendering", "Rendering") + "..."); + draw_text(w - ui(8), ui(28), __txtx("panel_graph_rendering", "Rendering") + "..."); else if(UPDATE == RENDER_TYPE.full) - draw_text(w - ui(8), ui(28), get_text("panel_graph_rendering_partial", "Rendering partial") + "..."); + draw_text(w - ui(8), ui(28), __txtx("panel_graph_rendering_partial", "Rendering partial") + "..."); if(DRAGGING && pHOVER) { if(node_hovering && node_hovering.droppable(DRAGGING)) { diff --git a/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml b/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml index c1431e352..5a930ef7a 100644 --- a/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml +++ b/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml @@ -1,5 +1,5 @@ function Panel_Graph_Export_Image(targetPanel) : PanelContent() constructor { - title = "Export Graph"; + title = __txtx("panel_export_graph", "Export Graph"); w = ui(360); h = ui(524); min_h = h; @@ -73,7 +73,7 @@ function Panel_Graph_Export_Image(targetPanel) : PanelContent() constructor { for( var i = 0; i < array_length(widgets); i++ ) { draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text); - draw_text_over(0, ty + wh * i, widgets[i][0]); + draw_text_over(0, ty + wh * i, __txt(widgets[i][0], "graph_export_")); var _wid = widgets[i][1]; var _dat = widgets[i][2](); @@ -140,7 +140,7 @@ function Panel_Graph_Export_Image(targetPanel) : PanelContent() constructor { sc_settings.draw(sx, sy, mx - sx, my - sy); if(is_surface(surface)) { - var txt = "Export..."; + var txt = __txt("Export") + "..."; draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text); var _bw = string_width(txt) + ui(32); var _bh = string_height(txt) + ui(12); diff --git a/scripts/panel_history/panel_history.gml b/scripts/panel_history/panel_history.gml index 8d21ea95d..d116a7e2f 100644 --- a/scripts/panel_history/panel_history.gml +++ b/scripts/panel_history/panel_history.gml @@ -1,5 +1,5 @@ function Panel_History() : PanelContent() constructor { - title = "Action history"; + title = __txt("History"); w = ui(400); h = ui(480); @@ -120,7 +120,7 @@ function Panel_History() : PanelContent() constructor { var _ty = yy + lh * (j + 0.5); if(j == 3) { draw_set_color(COLORS._main_text_sub); - draw_text_add(ui(32 + 12), _ty, string(array_length(item) - 3) + " more actions..."); + draw_text_add(ui(32 + 12), _ty, string(array_length(item) - 3) + __txtx("panel_history_more_actions", " more actions...")); } else { draw_set_color(COLORS._main_text); draw_text_add(ui(32 + 12), _ty, item[j].toString()); diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 4fa38eee2..3bc626d6f 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -4,7 +4,7 @@ function Inspector_Custom_Renderer(draw) : widget() constructor { } function Panel_Inspector() : PanelContent() constructor { - title = "Inspector"; + title = __txt("Inspector"); context_str = "Inspector"; icon = THEME.panel_inspector; @@ -203,7 +203,7 @@ function Panel_Inspector() : PanelContent() constructor { if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, pFOCUS, _hover) == 2) var_editing = !var_editing; - var txt = get_text("apply", "Apply"); + var txt = __txt("Apply"); var icon = THEME.accept; var colr = COLORS._main_value_positive; @@ -218,7 +218,7 @@ function Panel_Inspector() : PanelContent() constructor { if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, pFOCUS, _hover) == 2) GLOBAL.createValue(); - var txt = get_text("add", "Add"); + var txt = __txt("Add"); var icon = THEME.add; draw_set_text(f_p0b, fa_left, fa_center, COLORS._main_icon) @@ -232,7 +232,7 @@ function Panel_Inspector() : PanelContent() constructor { if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, pFOCUS, _hover) == 2) var_editing = !var_editing; - var txt = get_text("edit", "Edit"); + var txt = __txt("Edit"); var icon = THEME.gear; var colr = COLORS._main_icon; @@ -400,7 +400,7 @@ function Panel_Inspector() : PanelContent() constructor { draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(8), con_w, ui(32), COLORS._main_icon_dark, 0.85); draw_set_text(f_p0b, fa_center, fa_center, COLORS._main_text_sub); - draw_text(xc, yy + ui(8 + 16), "Outputs"); + draw_text(xc, yy + ui(8 + 16), __txt("Outputs")); continue; } else { var outInd = i - amoIn - 1; @@ -463,10 +463,10 @@ function Panel_Inspector() : PanelContent() constructor { if(i < amoIn) { array_push(_menuItem, - menuItem(get_text("panel_inspector_reset", "Reset value"), function() { + menuItem(__txtx("panel_inspector_reset", "Reset value"), function() { __dialog_junction.resetValue(); }), - menuItem(jun.is_anim? get_text("panel_inspector_remove", "Remove animation") : get_text("panel_inspector_add", "Add animation"), function() { + menuItem(jun.is_anim? __txtx("panel_inspector_remove", "Remove animation") : __txtx("panel_inspector_add", "Add animation"), function() { __dialog_junction.setAnim(!__dialog_junction.is_anim); PANEL_ANIMATION.updatePropertyList(); }), @@ -474,7 +474,7 @@ function Panel_Inspector() : PanelContent() constructor { if(jun.sepable) { array_push(_menuItem, - menuItem(jun.sep_axis? get_text("panel_inspector_axis_combine", "Combine axis") : get_text("panel_inspector_axis_separate", "Separate axis"), function() { + menuItem(jun.sep_axis? __txtx("panel_inspector_axis_combine", "Combine axis") : __txtx("panel_inspector_axis_separate", "Separate axis"), function() { __dialog_junction.sep_axis = !__dialog_junction.sep_axis; PANEL_ANIMATION.updatePropertyList(); }), @@ -485,20 +485,20 @@ function Panel_Inspector() : PanelContent() constructor { } array_push(_menuItem, - menuItem(get_text("use_global_var", "Use expression"), function() { + menuItem(__txtx("panel_inspector_use_expression", "Use expression"), function() { __dialog_junction.expUse = !__dialog_junction.expUse; }), -1, - menuItem(get_text("copy", "Copy"), function() { + menuItem(__txt("Copy"), function() { clipboard_set_text(__dialog_junction.getShowString()); }, THEME.copy, ["Inspector", "Copy property"]), - menuItem(get_text("paste", "Paste"), function() { + menuItem(__txt("Paste"), function() { __dialog_junction.setString(clipboard_get_text()); }, THEME.paste, ["Inspector", "Paste property"]), ); if(jun.extract_node != "") { - array_insert(_menuItem, 2, menuItem(get_text("panel_inspector_extract", "Extract to node"), function() { + array_insert(_menuItem, 2, menuItem(__txtx("panel_inspector_extract", "Extract to node"), function() { __dialog_junction.extractNode(); })); } @@ -550,13 +550,13 @@ function Panel_Inspector() : PanelContent() constructor { draw_set_font(f_p1); var lx = w / 2 - string_width(inspecting.name) / 2 - ui(10); var ly = ui(56 - 8); - if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, "Lock", THEME.lock, !locked, locked? COLORS._main_icon_light : COLORS._main_icon,, 0.5) == 2) + if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, __txt("Lock"), THEME.lock, !locked, locked? COLORS._main_icon_light : COLORS._main_icon,, 0.5) == 2) locked = !locked; var bx = ui(8); var by = ui(12); - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, get_text("presets", "Presets"), THEME.preset, 1) == 2) + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Presets"), THEME.preset, 1) == 2) dialogCall(o_dialog_preset, x + bx, y + by + ui(36), { "node": inspecting }); var bx = w - ui(44); @@ -588,7 +588,7 @@ function Panel_Inspector() : PanelContent() constructor { title = inspecting.display_name == ""? inspecting.name : inspecting.display_name; drawInspectingNode(); } else { - title = "Inspector"; + title = __txt("Inspector"); var txt = "Untitled"; var context = PANEL_GRAPH.getCurrentContext(); @@ -604,7 +604,7 @@ function Panel_Inspector() : PanelContent() constructor { var bx = w - ui(44); var by = ui(12); - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, get_text("panel_inspector_set_default", "Set as default"), THEME.save, 0, COLORS._main_icon) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_set_default", "Set as default"), THEME.save, 0, COLORS._main_icon) == 2) { var path = DIRECTORY + "meta.json"; var f = file_text_open_write(path); file_text_write_string(f, json_encode_minify(METADATA.serialize())); @@ -614,10 +614,10 @@ function Panel_Inspector() : PanelContent() constructor { by += ui(36); if(STEAM_ENABLED && !workshop_uploading) { if(CURRENT_PATH == "") { - buttonInstant(noone, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, get_text("panel_inspector_workshop_save", "Save file before upload"), THEME.workshop_upload, 0, COLORS._main_icon, 0.5); + buttonInstant(noone, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_workshop_save", "Save file before upload"), THEME.workshop_upload, 0, COLORS._main_icon, 0.5); } else { if(!METADATA.steam) { //project made locally - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, get_text("panel_inspector_workshop_upload", "Upload to Steam Workshop"), THEME.workshop_upload, 0, COLORS._main_icon) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_workshop_upload", "Upload to Steam Workshop"), THEME.workshop_upload, 0, COLORS._main_icon) == 2) { var s = PANEL_PREVIEW.getNodePreviewSurface(); if(is_surface(s)) { METADATA.author_steam_id = STEAM_USER_ID; @@ -630,7 +630,7 @@ function Panel_Inspector() : PanelContent() constructor { } if(METADATA.steam && METADATA.author_steam_id == STEAM_USER_ID && METADATA.file_id != 0) { - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, get_text("panel_inspector_workshop_update", "Update Steam Workshop"), THEME.workshop_update, 0, COLORS._main_icon) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_workshop_update", "Update Steam Workshop"), THEME.workshop_update, 0, COLORS._main_icon) == 2) { SAVE(); steam_ugc_update_project(); workshop_uploading = true; diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index 22afbfff1..bc356b7ba 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -1,5 +1,5 @@ function Panel_Menu() : PanelContent() constructor { - title = "Menu"; + title = __txt("Menu"); noti_flash = 0; noti_flash_color = COLORS._main_accent; @@ -13,11 +13,11 @@ function Panel_Menu() : PanelContent() constructor { action_buttons = ["exit", "minimize", "maximize", "fullscreen"]; menu_file = [ - menuItem(get_text("panel_menu_new", "New"), function() { NEW(); }, THEME.new_file, ["", "New file"]), - menuItem(get_text("panel_menu_open", "Open") + "...", function() { LOAD(); }, THEME.noti_icon_file_load, ["", "Open"]), - menuItem(get_text("panel_menu_save", "Save"), function() { SAVE(); }, THEME.save, ["", "Save"]), - menuItem(get_text("panel_menu_save_as", "Save as..."), function() { SAVE_AS(); }, THEME.save, ["", "Save as"]), - menuItem(get_text("panel_menu_recent_files", "Recent files"), function(_dat) { + menuItem(__txtx("new", "New"), function() { NEW(); }, THEME.new_file, ["", "New file"]), + menuItem(__txtx("open", "Open") + "...", function() { LOAD(); }, THEME.noti_icon_file_load, ["", "Open"]), + menuItem(__txtx("save", "Save"), function() { SAVE(); }, THEME.save, ["", "Save"]), + menuItem(__txtx("save_as", "Save as..."), function() { SAVE_AS(); }, THEME.save, ["", "Save as"]), + menuItem(__txtx("panel_menu_recent_files", "Recent files"), function(_dat) { var arr = []; for(var i = 0; i < min(10, ds_list_size(RECENT_FILES)); i++) { var _rec = RECENT_FILES[| i]; @@ -26,15 +26,15 @@ function Panel_Menu() : PanelContent() constructor { return submenuCall(_dat, arr); }).setIsShelf(), - menuItem(get_text("panel_menu_auto_save_folder", "Open autosave folder"), function() { shellOpenExplorer(DIRECTORY + "autosave"); }, THEME.save_auto), + menuItem(__txtx("panel_menu_auto_save_folder", "Open autosave folder"), function() { shellOpenExplorer(DIRECTORY + "autosave"); }, THEME.save_auto), -1, - menuItem(get_text("preferences", "Preferences") + "...", function() { dialogCall(o_dialog_preference); }, THEME.gear), - menuItem(get_text("panel_menu_splash_screen", "Splash screen"), function() { dialogCall(o_dialog_splash); }), + menuItem(__txtx("preferences", "Preferences") + "...", function() { dialogCall(o_dialog_preference); }, THEME.gear), + menuItem(__txtx("panel_menu_splash_screen", "Splash screen"), function() { dialogCall(o_dialog_splash); }), -1, - menuItem(get_text("panel_menu_addons", "Addons"), function(_dat) { + menuItem(__txt("Addons"), function(_dat) { var arr = [ - menuItem(get_text("panel_menu_addons_menu", "Addons..."), function() { dialogPanelCall(new Panel_Addon()); }), - menuItem(get_text("panel_menu_addons_key", "Key displayer"), function() { + menuItem(__txt("Addons") + "...", function() { dialogPanelCall(new Panel_Addon()); }), + menuItem(__txtx("panel_menu_addons_key", "Key displayer"), function() { if(instance_exists(addon_key_displayer)) { instance_destroy(addon_key_displayer); return; @@ -53,39 +53,39 @@ function Panel_Menu() : PanelContent() constructor { return submenuCall(_dat, arr); }, THEME.addon ).setIsShelf(), -1, - menuItem(get_text("fullscreen", "Toggle fullscreen"), function() { + menuItem(__txtx("panel_menu_fullscreen", "Toggle fullscreen"), function() { if(gameframe_is_fullscreen_window()) gameframe_set_fullscreen(0); else gameframe_set_fullscreen(2); },, ["", "Fullscreen"]), - menuItem(get_text("exit", "Close program"), function() { window_close(); }), + menuItem(__txtx("panel_menu_exit", "Close program"), function() { window_close(); }), ]; if(DEMO) array_delete(menu_file, 1, 5); menu_help = [ - menuItem(get_text("panel_menu_help_video", "Tutorial videos"), function() { + menuItem(__txtx("panel_menu_help_video", "Tutorial videos"), function() { url_open("https://www.youtube.com/@makhamdev"); }, THEME.youtube), - menuItem(get_text("panel_menu_help_wiki", "Community Wiki"), function() { + menuItem(__txtx("panel_menu_help_wiki", "Community Wiki"), function() { url_open("https://pixel-composer.fandom.com/wiki/Pixel_Composer_Wiki"); }, THEME.wiki), //-1, - //menuItem(get_text("panel_menu_itch", "itch.io page"), function() { + //menuItem(__txtx("panel_menu_itch", "itch.io page"), function() { // url_open("https://makham.itch.io/pixel-composer"); //}, THEME.itch), - //menuItem(get_text("panel_menu_steam", "Steam page"), function() { + //menuItem(__txtx("panel_menu_steam", "Steam page"), function() { // url_open("https://store.steampowered.com/app/2299510/Pixel_Composer"); //}, THEME.steam), -1, - menuItem(get_text("panel_menu_directory", "Open local directory"), function() { + menuItem(__txtx("panel_menu_local_directory", "Open local directory"), function() { shellOpenExplorer(DIRECTORY); }, THEME.folder), - menuItem(get_text("panel_menu_directory", "Open autosave directory"), function() { + menuItem(__txtx("panel_menu_autosave_directory", "Open autosave directory"), function() { shellOpenExplorer(DIRECTORY + "autosave/"); }, THEME.folder), - menuItem(get_text("panel_menu_reset_default", "Reset default collection, assets"), function() { + menuItem(__txtx("panel_menu_reset_default", "Reset default collection, assets"), function() { zip_unzip("data/Collections.zip", DIRECTORY + "Collections"); zip_unzip("data/Assets.zip", DIRECTORY + "Assets"); }), @@ -93,49 +93,49 @@ function Panel_Menu() : PanelContent() constructor { menu_help_steam = array_clone(menu_help); array_push(menu_help_steam, -1, - menuItem(get_text("panel_menu_steam_workshop", "Steam Workshop"), function() { + menuItem(__txtx("panel_menu_steam_workshop", "Steam Workshop"), function() { steam_activate_overlay_browser("https://steamcommunity.com/app/2299510/workshop/"); }, THEME.steam) ); menus = [ - [ get_text("panel_menu_file", "File"), menu_file ], - [ get_text("panel_menu_edit", "Edit"), [ - menuItem(get_text("undo", "Undo"), function() { UNDO(); }, THEME.undo, ["", "Undo"]), - menuItem(get_text("redo", "Redo"), function() { REDO(); }, THEME.redo, ["", "Redo"]), - menuItem(get_text("history_title", "Action history"), function() { dialogPanelCall(new Panel_History()); }), + [ __txtx("panel_menu_file", "File"), menu_file ], + [ __txtx("panel_menu_edit", "Edit"), [ + menuItem(__txtx("undo", "Undo"), function() { UNDO(); }, THEME.undo, ["", "Undo"]), + menuItem(__txtx("redo", "Redo"), function() { REDO(); }, THEME.redo, ["", "Redo"]), + menuItem(__txt("History"), function() { dialogPanelCall(new Panel_History()); }), ]], - [ get_text("panel_menu_preview", "Preview"), [ - menuItem(get_text("panel_menu_center_preview", "Center preview"), function() { PANEL_PREVIEW.do_fullView = true; }, THEME.icon_center_canvas, ["Preview", "Focus content"]), - menuItem(get_text("panel_menu_save_current_preview_as", "Save current preview as..."), function() { PANEL_PREVIEW.saveCurrentFrame(); }, noone, ["Preview", "Save current frame"]), - menuItemGroup(get_text("panel_menu_preview_background", "Preview background"), [ + [ __txt("Preview"), [ + menuItem(__txtx("panel_menu_center_preview", "Center preview"), function() { PANEL_PREVIEW.do_fullView = true; }, THEME.icon_center_canvas, ["Preview", "Focus content"]), + menuItem(__txtx("panel_menu_save_current_preview_as", "Save current preview as..."), function() { PANEL_PREVIEW.saveCurrentFrame(); }, noone, ["Preview", "Save current frame"]), + menuItemGroup(__txtx("panel_menu_preview_background", "Preview background"), [ [ s_menu_transparent, function() { PANEL_PREVIEW.canvas_bg = -1; } ], [ s_menu_white, function() { PANEL_PREVIEW.canvas_bg = c_white; } ], [ s_menu_black, function() { PANEL_PREVIEW.canvas_bg = c_black; } ], ]), -1, - menuItem(get_text("panel_menu_show_grid", "Show Grid"), function() { PANEL_PREVIEW.grid_show = !PANEL_PREVIEW.grid_show; }, [ THEME.icon_grid, 1 ], ["Preview", "Toggle grid"]), - menuItem(get_text("panel_menu_grid_setting", "Grid setting..."), function() { + menuItem(__txtx("panel_menu_show_grid", "Show Grid"), function() { PANEL_PREVIEW.grid_show = !PANEL_PREVIEW.grid_show; }, [ THEME.icon_grid, 1 ], ["Preview", "Toggle grid"]), + menuItem(__txtx("panel_menu_grid_setting", "Grid setting..."), function() { var dia = dialogCall(o_dialog_preview_grid); dia.anchor = ANCHOR.none; }, THEME.icon_grid_setting), ]], - [ get_text("panel_menu_animation", "Animation"), [ - menuItem(get_text("panel_menu_animation_setting", "Animation setting..."), function() { + [ __txtx("panel_menu_animation", "Animation"), [ + menuItem(__txtx("panel_menu_animation_setting", "Animation setting..."), function() { var dia = dialogCall(o_dialog_animation); dia.anchor = ANCHOR.none; }, THEME.animation_setting), -1, - menuItem(get_text("panel_menu_animation_scaler", "Animation scaler..."), function() { + menuItem(__txtx("panel_menu_animation_scaler", "Animation scaler..."), function() { dialogCall(o_dialog_anim_time_scaler); }, THEME.animation_timing), ]], - [ get_text("panel_menu_rendering", "Rendering"), [ - menuItem(get_text("panel_menu_render_all_nodes", "Render all nodes"), function() { + [ __txtx("panel_menu_rendering", "Rendering"), [ + menuItem(__txtx("panel_menu_render_all_nodes", "Render all nodes"), function() { for(var i = 0; i < ds_list_size(NODES); i++) NODES[| i].triggerRender(); UPDATE |= RENDER_TYPE.full; }, [ THEME.sequence_control, 1 ], ["", "Render all"]), - menuItem(get_text("panel_menu_execute_exports", "Execute all export nodes"), function() { + menuItem(__txtx("panel_menu_execute_exports", "Execute all export nodes"), function() { var key = ds_map_find_first(NODE_MAP); repeat(ds_map_size(NODE_MAP)) { var node = NODE_MAP[? key]; @@ -148,8 +148,8 @@ function Panel_Menu() : PanelContent() constructor { } }), ]], - [ get_text("panel_menu_panels", "Panels"), [ - menuItem(get_text("panel_menu_workspace", "Workspace"), function(_dat) { + [ __txtx("panel_menu_panels", "Panels"), [ + menuItem(__txt("Workspace"), function(_dat) { var arr = [], lays = []; var f = file_find_first(DIRECTORY + "layouts/*", 0); while(f != "") { @@ -157,7 +157,7 @@ function Panel_Menu() : PanelContent() constructor { f = file_find_next(); } - array_push(arr, menuItem("Save layout", function() { + array_push(arr, menuItem(__txtx("panel_menu_save_layout", "Save layout"), function() { var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8)); dia.name = PREF_MAP[? "panel_layout_file"]; dia.onModify = function(name) { @@ -179,62 +179,62 @@ function Panel_Menu() : PanelContent() constructor { return submenuCall(_dat, arr); }).setIsShelf(), -1, - menuItem(get_text("panel_menu_collections", "Collections"), function() { panelAdd("Panel_Collection", true) },,, function() { return findPanel("Panel_Collection") != noone; } ), - menuItem(get_text("panel_menu_graph", "Graph"), function() { panelAdd("Panel_Graph", true) },,, function() { return findPanel("Panel_Graph") != noone; } ), - menuItem(get_text("panel_menu_preview", "Preview"), function() { panelAdd("Panel_Preview", true) },,, function() { return findPanel("Panel_Preview") != noone; } ), - menuItem(get_text("panel_menu_inspector", "Inspector"), function() { panelAdd("Panel_Inspector", true) },,, function() { return findPanel("Panel_Inspector") != noone; } ), - menuItem(get_text("panel_menu_workspace", "Workspace"), function() { panelAdd("Panel_Workspace", true) },,, function() { return findPanel("Panel_Workspace") != noone; } ), - menuItem(get_text("panel_menu_animation", "Animation"), function() { panelAdd("Panel_Animation", true) },,, function() { return findPanel("Panel_Animation") != noone; } ), - menuItem(get_text("panel_menu_notification", "Notification"), function() { panelAdd("Panel_Notification", true) },,, function() { return findPanel("Panel_Notification") != noone; } ), - menuItem(get_text("panel_menu_globalvar", "Global Variables"), function() { panelAdd("Panel_Globalvar", true) },,, function() { return findPanel("Panel_Globalvar") != noone; } ), + menuItem(__txt("Collections"), function() { panelAdd("Panel_Collection", true) },,, function() { return findPanel("Panel_Collection") != noone; } ), + menuItem(__txt("Graph"), function() { panelAdd("Panel_Graph", true) },,, function() { return findPanel("Panel_Graph") != noone; } ), + menuItem(__txt("Preview"), function() { panelAdd("Panel_Preview", true) },,, function() { return findPanel("Panel_Preview") != noone; } ), + menuItem(__txt("Inspector"), function() { panelAdd("Panel_Inspector", true) },,, function() { return findPanel("Panel_Inspector") != noone; } ), + menuItem(__txt("Workspace"), function() { panelAdd("Panel_Workspace", true) },,, function() { return findPanel("Panel_Workspace") != noone; } ), + menuItem(__txt("Animation"), function() { panelAdd("Panel_Animation", true) },,, function() { return findPanel("Panel_Animation") != noone; } ), + menuItem(__txt("Notifications"), function() { panelAdd("Panel_Notification", true) },,, function() { return findPanel("Panel_Notification") != noone; } ), + menuItem(__txtx("panel_globalvar", "Global Variables"), function() { panelAdd("Panel_Globalvar", true) },,, function() { return findPanel("Panel_Globalvar") != noone; } ), - menuItem(get_text("panel_menu_nodes", "Nodes"), function(_dat) { + menuItem(__txt("Nodes"), function(_dat) { return submenuCall(_dat, [ - menuItem(get_text("panel_menu_node_align", "Align nodes"), function() { panelAdd("Panel_Node_Align", true) },,, function() { return findPanel("Panel_Node_Align") != noone; } ), - menuItem(get_text("panel_menu_nodes", "Nodes"), function() { panelAdd("Panel_Nodes", true) },,, function() { return findPanel("Panel_Nodes") != noone; } ), - menuItem(get_text("tunnels", "Tunnels"), function() { panelAdd("Panel_Tunnels", true) },,, function() { return findPanel("Panel_Tunnels") != noone; } ), + menuItem(__txt("Align"), function() { panelAdd("Panel_Node_Align", true) },,, function() { return findPanel("Panel_Node_Align") != noone; } ), + menuItem(__txt("Nodes"), function() { panelAdd("Panel_Nodes", true) },,, function() { return findPanel("Panel_Nodes") != noone; } ), + menuItem(__txt("Tunnels"), function() { panelAdd("Panel_Tunnels", true) },,, function() { return findPanel("Panel_Tunnels") != noone; } ), ]); } ).setIsShelf(), - menuItem(get_text("panel_menu_color", "Color"), function(_dat) { + menuItem(__txt("Color"), function(_dat) { return submenuCall(_dat, [ - menuItem(get_text("panel_menu_color", "Color"), function() { panelAdd("Panel_Color", true) },,, function() { return findPanel("Panel_Color") != noone; } ), - menuItem(get_text("panel_menu_palette", "Palette"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ), - menuItem(get_text("panel_menu_gradient", "Gradient"),function() { panelAdd("Panel_Gradient", true) },,, function() { return findPanel("Panel_Gradient") != noone; } ), + menuItem(__txt("Color"), function() { panelAdd("Panel_Color", true) },,, function() { return findPanel("Panel_Color") != noone; } ), + menuItem(__txt("Palettes"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ), + menuItem(__txt("Gradients"), function() { panelAdd("Panel_Gradient", true) },,, function() { return findPanel("Panel_Gradient") != noone; } ), ]); } ).setIsShelf(), ]], - [ get_text("panel_menu_help", "Help"), menu_help ], + [ __txtx("help", "Help"), menu_help ], ] if(TESTING) { - array_push(menus, [ get_text("panel_menu_test", "Test"), [ - menuItem(get_text("panel_menu_toggle_terminal", "Debug console"), function() { + array_push(menus, [ __txtx("panel_menu_test", "Test"), [ + menuItem(__txtx("panel_debug_console", "Debug console"), function() { panelAdd("Panel_Console", true) }), -1, - menuItem(get_text("panel_menu_test_load_all", "Load all current collections"), function() { + menuItem(__txtx("panel_menu_test_load_all", "Load all current collections"), function() { __test_load_current_collections(); }), - menuItem(get_text("panel_menu_test_update_all", "Update all current collections"), function() { + menuItem(__txtx("panel_menu_test_update_all", "Update all current collections"), function() { __test_update_current_collections(); }), - menuItem(get_text("panel_menu_test_add_meta", "Add metadata to current collections"), function() { + menuItem(__txtx("panel_menu_test_add_meta", "Add metadata to current collections"), function() { __test_metadata_current_collections(); }), - menuItem(get_text("panel_menu_test_update_sam", "Update sample projects"), function() { + menuItem(__txtx("panel_menu_test_update_sam", "Update sample projects"), function() { __test_update_sample_projects(); }), -1, - menuItem(get_text("panel_menu_test_load_nodes", "Load all nodes"), function() { + menuItem(__txtx("panel_menu_test_load_nodes", "Load all nodes"), function() { __test_load_all_nodes(); }), - menuItem(get_text("panel_menu_test_gen_guide", "Generate node guide"), function() { + menuItem(__txtx("panel_menu_test_gen_guide", "Generate node guide"), function() { __generate_node_data(); }), -1, - menuItem(get_text("panel_menu_test_crash", "Force crash"), function() { + menuItem(__txtx("panel_menu_test_crash", "Force crash"), function() { print(1 + "a"); }), ]]); @@ -251,26 +251,26 @@ function Panel_Menu() : PanelContent() constructor { var txt; if(ds_stack_empty(UNDO_STACK)) { - txt = get_text("undo", "Undo"); + txt = __txtx("undo", "Undo"); } else { var act = ds_stack_top(UNDO_STACK); if(array_length(act) > 1) - txt = get_text("undo", "Undo") + " " + string(array_length(act)) + " " + get_text("actions", "Actions"); + txt = __txtx("undo", "Undo") + " " + string(array_length(act)) + " " + __txtx("actions", "Actions"); else - txt = get_text("undo", "Undo") + " " + act[0].toString(); + txt = __txtx("undo", "Undo") + " " + act[0].toString(); } menus[1][1][0].active = !ds_stack_empty(UNDO_STACK); menus[1][1][0].name = txt; if(ds_stack_empty(REDO_STACK)) { - txt = get_text("redo", "Redo"); + txt = __txtx("redo", "Redo"); } else { var act = ds_stack_top(REDO_STACK); if(array_length(act) > 1) - txt = get_text("redo", "Redo") + " " + string(array_length(act)) + " " + get_text("actions", "Actions"); + txt = __txtx("redo", "Redo") + " " + string(array_length(act)) + " " + __txtx("actions", "Actions"); else - txt = get_text("redo", "Redo") + " " + act[0].toString(); + txt = __txtx("redo", "Redo") + " " + act[0].toString(); } menus[1][1][1].active = !ds_stack_empty(REDO_STACK); @@ -435,7 +435,7 @@ function Panel_Menu() : PanelContent() constructor { dia.anchor = ANCHOR.left | ANCHOR.top; } - TOOLTIP = string(warning_amo) + " " + get_text("warning", "Warnings") + " " + string(error_amo) + " " + get_text("errors", "Errors"); + TOOLTIP = $"{warning_amo} {__txtx("warning", "Warnings")} {error_amo} {__txtx("errors", "Errors")}"; } else draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, nx0, ny0 - nh / 2, nw, nh, cc, 1); @@ -469,7 +469,7 @@ function Panel_Menu() : PanelContent() constructor { var ww = hori? string_width(name) + ui(40) : w - ui(16); if(pHOVER && point_in_rectangle(mx, my, nx0, ny0 - wh / 2, nx0 + ww, ny0 + wh / 2)) { - TOOLTIP = get_text("addons", "Addons"); + TOOLTIP = __txt("Addons"); draw_sprite_stretched(THEME.menu_button, 1, nx0, ny0 - wh / 2, ww, wh); if(mouse_press(mb_left, pFOCUS)) dialogPanelCall(new Panel_Addon()); diff --git a/scripts/panel_node_align/panel_node_align.gml b/scripts/panel_node_align/panel_node_align.gml index ff32604cc..a841562b0 100644 --- a/scripts/panel_node_align/panel_node_align.gml +++ b/scripts/panel_node_align/panel_node_align.gml @@ -1,5 +1,5 @@ function Panel_Node_Align() : PanelContent() constructor { - title = "Align"; + title = __txt("Align"); w = ui(200); h = ui(200); @@ -10,7 +10,7 @@ function Panel_Node_Align() : PanelContent() constructor { var yy = 12; draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_sub); - draw_text(xc, yy, "Align"); + draw_text(xc, yy, __txt("Align")); yy += ui(24); if(buttonInstant(THEME.button_hide, xc - ui(16) - ui(40), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_halign, 0, c_white) == 2) @@ -30,7 +30,7 @@ function Panel_Node_Align() : PanelContent() constructor { yy += ui(44); draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_sub); - draw_text(xc, yy, "Distribute"); + draw_text(xc, yy, __txt("Distribute")); yy += ui(24); if(buttonInstant(THEME.button_hide, xc - ui(16) - ui(20), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.obj_distribute_h, 0, c_white) == 2) diff --git a/scripts/panel_nodes/panel_nodes.gml b/scripts/panel_nodes/panel_nodes.gml index 104016cd6..8caa2a693 100644 --- a/scripts/panel_nodes/panel_nodes.gml +++ b/scripts/panel_nodes/panel_nodes.gml @@ -1,6 +1,6 @@ function Panel_Nodes() : PanelContent() constructor { #region data - title = "Nodes"; + title = __txt("Nodes"); showHeader = false; w = ui(320); @@ -66,7 +66,7 @@ function Panel_Nodes() : PanelContent() constructor { var bx = _x1 - ui(4) - bw; var by = _y + (hg - bh) / 2; - if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_nodes.active, sc_nodes.hover, "Go to node", THEME.node_goto,, COLORS._main_icon, 0.75, 0.75) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_nodes.active, sc_nodes.hover, __txtx("panel_node_goto", "Go to node"), THEME.node_goto,, COLORS._main_icon, 0.75, 0.75) == 2) graphFocusNode(node); bx -= ui(32); diff --git a/scripts/panel_notification/panel_notification.gml b/scripts/panel_notification/panel_notification.gml index e382f8efb..5dbd117c4 100644 --- a/scripts/panel_notification/panel_notification.gml +++ b/scripts/panel_notification/panel_notification.gml @@ -1,5 +1,5 @@ function Panel_Notification() : PanelContent() constructor { - title = get_text("noti_title", "Notification"); + title = __txt("Notifications"); w = ui(720); h = ui(480); @@ -11,24 +11,24 @@ function Panel_Notification() : PanelContent() constructor { showHeader = false; rightClickMenu = [ - menuItem(get_text("noti_clear_log", "Clear log messages"), function() { + menuItem(__txtx("noti_clear_log", "Clear log messages"), function() { for( var i = ds_list_size(STATUSES) - 1; i >= 0; i-- ) { if(STATUSES[| i].type == NOTI_TYPE.log) ds_list_delete(STATUSES, i); } }), - menuItem(get_text("noti_clear_warn", "Clear warning messages"), function() { + menuItem(__txtx("noti_clear_warn", "Clear warning messages"), function() { for( var i = ds_list_size(STATUSES) - 1; i >= 0; i-- ) { if(STATUSES[| i].type == NOTI_TYPE.warning) ds_list_delete(STATUSES, i); } }), -1, - menuItem(get_text("noti_clear_all", "Clear all notifications"), function() { + menuItem(__txtx("noti_clear_all", "Clear all notifications"), function() { ds_list_clear(STATUSES); }), -1, - menuItem(get_text("noti_open_log", "Open log file"), function() { + menuItem(__txtx("noti_open_log", "Open log file"), function() { shellOpenExplorer(DIRECTORY + "log.txt"); }), ]; @@ -73,10 +73,10 @@ function Panel_Notification() : PanelContent() constructor { if(mouse_press(mb_right, pFOCUS)) { var dia = menuCall("notification_menu",,, [ - menuItem(get_text("noti_copy_message", "Copy notification message"), function() { + menuItem(__txtx("noti_copy_message", "Copy notification message"), function() { clipboard_set_text(o_dialog_menubox.noti.txt); }), - menuItem(get_text("noti_delete_message", "Delete notification"), function() { + menuItem(__txtx("noti_delete_message", "Delete notification"), function() { ds_list_remove(STATUSES, o_dialog_menubox.noti); }), ],, noti); @@ -147,21 +147,21 @@ function Panel_Notification() : PanelContent() constructor { var by = title_height / 2 - ui(16 + !in_dialog * 2); var error = !!(filter & NOTI_TYPE.error); - var toolt = error? get_text("noti_hide_error", "Hide error") : get_text("noti_show_error", "Show error"); + var toolt = error? __txtx("noti_hide_error", "Hide error") : __txtx("noti_show_error", "Show error"); var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, [mx, my], pFOCUS, pHOVER, toolt, THEME.noti_icon_error, error, c_white, 0.75 + error * 0.25); if(b == 2) filter = filter ^ NOTI_TYPE.error; if(b == 3) menuCall("notification_error_menu",,, rightClickMenu); bx -= ui(36); var warn = !!(filter & NOTI_TYPE.warning); - var toolt = warn? get_text("noti_hide_warning", "Hide warning") : get_text("noti_show_warning", "Show warning"); + var toolt = warn? __txtx("noti_hide_warning", "Hide warning") : __txtx("noti_show_warning", "Show warning"); var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, [mx, my], pFOCUS, pHOVER, toolt, THEME.noti_icon_warning, warn, c_white, 0.75 + warn * 0.25); if(b == 2) filter = filter ^ NOTI_TYPE.warning; if(b == 3) menuCall("notification_warning_menu",,, rightClickMenu); bx -= ui(36); var log = !!(filter & NOTI_TYPE.log); - var toolt = log? get_text("noti_hide_log", "Hide log") : get_text("noti_show_log", "Show log"); + var toolt = log? __txtx("noti_hide_log", "Hide log") : __txtx("noti_show_log", "Show log"); var b = buttonInstant(THEME.button_hide, bx, by, ww, hh, [mx, my], pFOCUS, pHOVER, toolt, THEME.noti_icon_log, log, c_white, 0.75 + log * 0.25); if(b == 2) filter = filter ^ NOTI_TYPE.log; if(b == 3) menuCall("notification_log_menu",,, rightClickMenu); diff --git a/scripts/panel_palette/panel_palette.gml b/scripts/panel_palette/panel_palette.gml index aa7796593..0580afc02 100644 --- a/scripts/panel_palette/panel_palette.gml +++ b/scripts/panel_palette/panel_palette.gml @@ -1,5 +1,5 @@ function Panel_Palette() : PanelContent() constructor { - title = "Palette"; + title = __txt("Palettes"); showHeader = false; title_height = 64; padding = 24; @@ -111,11 +111,11 @@ function Panel_Palette() : PanelContent() constructor { var bx = w - ui(32 + 16); var by = title_height / 2 - ui(16 + !in_dialog * 2); - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Refresh", THEME.refresh, 1, COLORS._main_icon) == 2) + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Refresh"), THEME.refresh, 1, COLORS._main_icon) == 2) presetCollect(); bx -= ui(32) - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Change preview size", THEME.icon_visibility, 1, COLORS._main_icon) == 2) + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("palette_change_preview_size", "Change preview size"), THEME.icon_visibility, 1, COLORS._main_icon) == 2) view_mode = (view_mode + 1) % 3; } } \ No newline at end of file diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index 7b410279d..ef8637e1b 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -1,5 +1,5 @@ function Panel_Preview() : PanelContent() constructor { - title = "Preview"; + title = __txt("Preview"); context_str = "Preview"; icon = THEME.panel_preview; @@ -78,8 +78,8 @@ function Panel_Preview() : PanelContent() constructor { [ THEME.icon_reset_when_preview, function() { return resetViewOnDoubleClick; }, - function() { return resetViewOnDoubleClick? get_text("panel_preview_center_canvas_on_preview", "Center canvas on preview") : - get_text("panel_preview_keep_canvas_on_preview", "Keep canvas on preview"); }, + function() { return resetViewOnDoubleClick? __txtx("panel_preview_center_canvas_on_preview", "Center canvas on preview") : + __txtx("panel_preview_keep_canvas_on_preview", "Keep canvas on preview"); }, function() { resetViewOnDoubleClick = !resetViewOnDoubleClick; } ], [ @@ -87,11 +87,11 @@ function Panel_Preview() : PanelContent() constructor { function() { return splitView; }, function() { switch(splitView) { - case 0 : return get_text("panel_preview_split_view_off", "Split view off"); - case 1 : return get_text("panel_preview_horizontal_split_view", "Horizontal split view"); - case 2 : return get_text("panel_preview_vertical_split_view", "Vertical split view"); + case 0 : return __txtx("panel_preview_split_view_off", "Split view off"); + case 1 : return __txtx("panel_preview_horizontal_split_view", "Horizontal split view"); + case 2 : return __txtx("panel_preview_vertical_split_view", "Vertical split view"); } - return get_text("panel_preview_split_view", "Split view"); + return __txtx("panel_preview_split_view", "Split view"); }, function() { splitView = (splitView + 1) % 3; } ], @@ -100,26 +100,26 @@ function Panel_Preview() : PanelContent() constructor { function() { var t = [3, 0, 1, 2]; return array_safe_get(t, tileMode); }, function() { switch(tileMode) { - case 0 : return get_text("panel_preview_tile_off", "Tile off"); - case 1 : return get_text("panel_preview_tile_horizontal", "Tile horizontal"); - case 2 : return get_text("panel_preview_tile_vertical", "Tile vertical"); - case 3 : return get_text("panel_preview_tile_both", "Tile both"); + case 0 : return __txtx("panel_preview_tile_off", "Tile off"); + case 1 : return __txtx("panel_preview_tile_horizontal", "Tile horizontal"); + case 2 : return __txtx("panel_preview_tile_vertical", "Tile vertical"); + case 3 : return __txtx("panel_preview_tile_both", "Tile both"); } - return get_text("panel_preview_tile_mode", "Tile mode"); + return __txtx("panel_preview_tile_mode", "Tile mode"); }, function(data) { menuCall("preview_tile_menu", data.x + ui(28), data.y + ui(28), [ - menuItem(get_text("panel_preview_tile_off", "Tile off"), function() { tileMode = 0; }), - menuItem(get_text("panel_preview_tile_horizontal", "Tile horizontal"), function() { tileMode = 1; }), - menuItem(get_text("panel_preview_tile_vertical", "Tile vertical"), function() { tileMode = 2; }), - menuItem(get_text("panel_preview_tile_both", "Tile both"), function() { tileMode = 3; }), + menuItem(__txtx("panel_preview_tile_off", "Tile off"), function() { tileMode = 0; }), + menuItem(__txtx("panel_preview_tile_horizontal", "Tile horizontal"), function() { tileMode = 1; }), + menuItem(__txtx("panel_preview_tile_vertical", "Tile vertical"), function() { tileMode = 2; }), + menuItem(__txtx("panel_preview_tile_both", "Tile both"), function() { tileMode = 3; }), ]); } ], [ THEME.icon_grid_setting, function() { return 0; }, - function() { return get_text("grid_title", "Grid setting") }, + function() { return __txtx("grid_title", "Grid setting") }, function(param) { var gs = dialogCall(o_dialog_preview_grid, param.x, param.y); gs.anchor = ANCHOR.bottom | ANCHOR.left; @@ -130,12 +130,12 @@ function Panel_Preview() : PanelContent() constructor { actions = [ [ THEME.icon_preview_export, - get_text("panel_preview_export_canvas", "Export canvas"), + __txtx("panel_preview_export_canvas", "Export canvas"), function() { saveCurrentFrame(); } ], [ THEME.icon_center_canvas, - get_text("panel_preview_center_canvas", "Center canvas"), + __txtx("panel_preview_center_canvas", "Center canvas"), function() { fullView(); } ], @@ -483,16 +483,16 @@ function Panel_Preview() : PanelContent() constructor { if(PANEL_PREVIEW == self) { draw_set_text(f_p0, fa_right, fa_top, COLORS._main_text_accent); - draw_text(w - ui(8), right_menu_y, "Active"); + draw_text(w - ui(8), right_menu_y, __txt("Active")); right_menu_y += string_height("l"); } draw_set_text(f_p0, fa_right, fa_top, fps >= ANIMATOR.framerate? COLORS._main_text_sub : COLORS._main_value_negative); - draw_text(w - ui(8), right_menu_y, "fps " + string(fps)); + draw_text(w - ui(8), right_menu_y, __txt("fps ") + string(fps)); right_menu_y += string_height("l"); draw_set_text(f_p0, fa_right, fa_top, COLORS._main_text_sub); - draw_text(w - ui(8), right_menu_y, get_text("frame", "Frame") + " " + string(ANIMATOR.current_frame) + "/" + string(ANIMATOR.frames_total)); + draw_text(w - ui(8), right_menu_y, __txt("Frame") + " " + string(ANIMATOR.current_frame) + "/" + string(ANIMATOR.frames_total)); var _node = getNodePreview(); if(_node == noone) return; @@ -855,7 +855,7 @@ function Panel_Preview() : PanelContent() constructor { else draw_clear(canvas_bg); - title = "Preview"; + title = __txt("Preview"); dragCanvas(); getPreviewData(); @@ -879,14 +879,14 @@ function Panel_Preview() : PanelContent() constructor { if(mouse_on_preview && mouse_press(mb_right, pFOCUS)) { menuCall("preview_context_menu",,, [ - menuItem(get_text("panel_graph_preview_window", "Send to preview window"), function() { previewWindow(getNodePreview()); }, noone, ["Preview", "Preview window"]), + menuItem(__txtx("panel_graph_preview_window", "Send to preview window"), function() { previewWindow(getNodePreview()); }, noone, ["Preview", "Preview window"]), -1, - menuItem(get_text("panel_preview_save", "Save current preview as") + "...", function() { saveCurrentFrame(); }), - menuItem(get_text("panel_preview_save_all", "Save all current previews as") + "...", function() { saveAllCurrentFrames(); }), + menuItem(__txtx("panel_preview_save", "Save current preview as") + "...", function() { saveCurrentFrame(); }), + menuItem(__txtx("panel_preview_save_all", "Save all current previews as") + "...", function() { saveAllCurrentFrames(); }), -1, - menuItem(get_text("panel_preview_copy_color", "Copy image"), function() { copyCurrentFrame(); }, THEME.copy), - menuItem(get_text("panel_preview_copy_color", "Copy color [") + string(sample_color) + "]", function() { clipboard_set_text(sample_color); }), - menuItem(get_text("panel_preview_copy_color", "Copy hex [") + string(color_get_hex(sample_color)) + "]", function() { clipboard_set_text(color_get_hex(sample_color)); }), + menuItem(__txtx("panel_preview_copy_color", "Copy image"), function() { copyCurrentFrame(); }, THEME.copy), + menuItem(__txtx("panel_preview_copy_color", "Copy color [") + string(sample_color) + "]", function() { clipboard_set_text(sample_color); }), + menuItem(__txtx("panel_preview_copy_color", "Copy hex [") + string(color_get_hex(sample_color)) + "]", function() { clipboard_set_text(color_get_hex(sample_color)); }), ],, getNodePreview()); } diff --git a/scripts/panel_preview_window/panel_preview_window.gml b/scripts/panel_preview_window/panel_preview_window.gml index 09a14150b..2f82fc5fa 100644 --- a/scripts/panel_preview_window/panel_preview_window.gml +++ b/scripts/panel_preview_window/panel_preview_window.gml @@ -49,10 +49,10 @@ function Panel_Preview_Window() : PanelContent() constructor { surfaceCheck(); menu = [ - menuItem(get_text("reset_view", "Reset view"), function() { reset(); }), + menuItem(__txtx("reset_view", "Reset view"), function() { reset(); }), -1, - menuItem(get_text("preview_win_inspect", "Inspect"), function() { PANEL_GRAPH.node_focus = node_target; }), - menuItem(get_text("panel_graph_send_to_preview", "Send to preview"), function() { PANEL_PREVIEW.setNodePreview(node_target); }), + menuItem(__txtx("preview_win_inspect", "Inspect"), function() { PANEL_GRAPH.node_focus = node_target; }), + menuItem(__txtx("panel_graph_send_to_preview", "Send to preview"), function() { PANEL_PREVIEW.setNodePreview(node_target); }), -1, ] diff --git a/scripts/panel_tunnels/panel_tunnels.gml b/scripts/panel_tunnels/panel_tunnels.gml index 2e14608b1..81bf8d5ff 100644 --- a/scripts/panel_tunnels/panel_tunnels.gml +++ b/scripts/panel_tunnels/panel_tunnels.gml @@ -1,5 +1,5 @@ function Panel_Tunnels() : PanelContent() constructor { - title = "Tunnels"; + title = __txt("Tunnels"); showHeader = false; title_height = 64; padding = 24; @@ -94,11 +94,11 @@ function Panel_Tunnels() : PanelContent() constructor { var bx = ww - ui(4) - bw; var by = _y + (hg - bh) / 2; - if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, "Go to node", THEME.node_goto) == 2) + if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, __txtx("panel_node_goto", "Go to node"), THEME.node_goto) == 2) graphFocusNode(node); bx -= ui(32); - if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, "Create tunnel out", THEME.tunnel) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, bw, bh, _m, sc_tunnel.active, sc_tunnel.hover, __txtx("panel_tunnel_create_tunnel", "Create tunnel out"), THEME.tunnel) == 2) { var n = nodeBuild("Node_Tunnel_Out", build_x, build_y); n.inputs[| 0].setValue(key); @@ -108,7 +108,7 @@ function Panel_Tunnels() : PanelContent() constructor { draw_sprite_ui(THEME.tunnel, 1, ui(4 + 16), _y + hg / 2); draw_set_text(f_p0, fa_left, fa_center, key == ""? COLORS._main_text_sub : COLORS._main_text); - draw_text(ui(4 + 32 + 4), _y + hg / 2, key == ""? "[no key]" : key); + draw_text(ui(4 + 32 + 4), _y + hg / 2, key == ""? $"[{__txtx("panel_tunnel_no_key", "No key")}]" : key); _y += hg + ui(4); _h += hg + ui(4); diff --git a/scripts/preferences/preferences.gml b/scripts/preferences/preferences.gml index 727226d6d..9d065b03f 100644 --- a/scripts/preferences/preferences.gml +++ b/scripts/preferences/preferences.gml @@ -47,6 +47,7 @@ PREF_MAP[? "graph_zoom_smoooth"] = 4; PREF_MAP[? "theme"] = "default"; + PREF_MAP[? "local"] = "en"; PREF_MAP[? "dialog_add_node_grouping"] = true; PREF_MAP[? "dialog_add_node_view"] = 0; diff --git a/scripts/printer/printer.gml b/scripts/printer/printer.gml index 588c244d2..142c84c02 100644 --- a/scripts/printer/printer.gml +++ b/scripts/printer/printer.gml @@ -1,5 +1,5 @@ function printBool(val) { - if(!is_array(val)) return val? get_text("true", "True") : get_text("false", "False"); + if(!is_array(val)) return val? __txtx("true", "True") : __txtx("false", "False"); var ss = "["; for( var i = 0; i < array_length(val); i++ ) { diff --git a/scripts/rangeBox/rangeBox.gml b/scripts/rangeBox/rangeBox.gml index 443cef829..3be22eb17 100644 --- a/scripts/rangeBox/rangeBox.gml +++ b/scripts/rangeBox/rangeBox.gml @@ -57,7 +57,7 @@ function rangeBox(_type, _onModify) : widget() constructor { b_link.setActiveFocus(hover, active); b_link.icon_index = linked; b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon; - b_link.tooltip = linked? "Unlink axis" : "Link axis"; + b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values"); var bx = _x; var by = _y + _h / 2 - ui(32 / 2); diff --git a/scripts/vectorBox/vectorBox.gml b/scripts/vectorBox/vectorBox.gml index 56dc2809c..a57e5b85d 100644 --- a/scripts/vectorBox/vectorBox.gml +++ b/scripts/vectorBox/vectorBox.gml @@ -100,7 +100,7 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { b_link.setActiveFocus(hover, active); b_link.icon_index = linked; b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon; - b_link.tooltip = linked? "Unlink axis" : "Link axis"; + b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values"); var bx = _x; var by = _y + _h / 2 - ui(32 / 2); diff --git a/scripts/vectorRangeBox/vectorRangeBox.gml b/scripts/vectorRangeBox/vectorRangeBox.gml index dbd00697f..9fe9d995a 100644 --- a/scripts/vectorRangeBox/vectorRangeBox.gml +++ b/scripts/vectorRangeBox/vectorRangeBox.gml @@ -31,7 +31,7 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const tb[i] = new textBox(_type, onModifySingle[i]); tb[i].slidable = true; - label[i] = (i % 2? "max " : "min ") + axis[floor(i / 2)]; + label[i] = (i % 2? __txt("Max") : __txt("Min")) + " " + axis[floor(i / 2)]; } static setSlideSpeed = function(speed) { @@ -66,7 +66,7 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const b_link.setActiveFocus(hover, active); b_link.icon_index = linked; b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon; - b_link.tooltip = linked? "Unlink axis" : "Link axis"; + b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values"); var bx = _x; var by = _y + _h / 2 - ui(32 / 2);