From 950a9dee4c4d89a8c1e0f7074899c0d0c5ce2c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 13:13:38 +0300 Subject: [PATCH 01/63] Create 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 933 +++++++++++++++++++++ 1 file changed, 933 insertions(+) create mode 100644 extensions/RIHART/Window Settings/1.0.0.js diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js new file mode 100644 index 0000000000..94a65c1a69 --- /dev/null +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -0,0 +1,933 @@ +// Name: Window Settings +// ID: RIHART +// Description: Thanks to this extension, you can customize the project window (this works if you package the project in the ".exe" format). +// By: RIHART +// Version: 1.0.0 + + +(function (Scratch) { + "use strict"; + + Scratch.translate.setup({ + ru /*_РусскийЯзык_*/: { + ExtensionName: "Настройки Окна", + LabelA: "Window Settings:", + MoveWHXY: " | | | | окно [SC] [WHXY]: [WHXYA], [WHXYB] | | | | ", + // [SC]: + SCA: "задать", + SCB: "изменить", + // [WHXY]: + WHXYA: "ширину, высоту", + WHXYB: "позицию x, позицию y", + WindowSCWH: " | | | | окно [MenuSC] [MenuWH]: [WH] | | | | ", + // [MenuSC]: + MenuSCA: "задать", + MenuSCB: "изменить", + // [MenuWH]: + MenuWHA: "ширину", + MenuWHB: "высоту", + MenuWHC: "позицию x", + MenuWHD: "позицию y", + moveToPresets: " | | | | переместить окно [PRESETS] | | | | ", + // [PRESETS]: + PRESETSA: "по центру", + PRESETSB: "справа", + PRESETSC: "слева", + PRESETSD: "сверху", + PRESETSE: "снизу", + PRESETSF: "в верхнем правом углу", + PRESETSG: "в верхнем левом углу", + PRESETSH: "в нижнем правом углу", + PRESETSI: "в нижнем левом углу", + changeTitleTo: " | | | | задать окну имя [TITLE] | | | | ", + WindowWHXY: " | | | | окно [MenuWindowWHXY] | | | | ", + innerStageSize: " | | | | размер внутренней сцены [innerMenuSetChange] ширину: [innerWidth] высоту: [innerHeight] | | | | ", + // [innerMenuSetChange]: + innerMenuSetChangeA: "задать", + innerMenuSetChangeB: "изменить", + innerStageSizeWidthHeight: " | | | | размер внутренней сцены [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight] | | | | ", + // [innerMenuSetChangeWH]: + innerMenuSetChangeWHA: "задать", + innerMenuSetChangeWHB: "изменить", + // [innerMenuWidthHeight]: + innerMenuWidthHeightA: "ширину", + innerMenuWidthHeightB: "высоту", + setDimensions: " | | | | задать сцену по ширине: [width] по высоте: [height] | | | | ", + getDimension: " | | | | сцена [dimension] | | | | ", + greenFlag: " | | | | нажать на флаг [flag] | | | | ", + FullscreenEnterExit: " | | | | полноэкранный режим [MenuFEE] | | | | ", + // [MenuFEE]: + FullscreenEnter: "включить", + FullscreenExit: "выключить", + closeWindow: " | | | | закрыть окно | | | | ", + QuestionsWS: " | | | | [MenuQuestions] | | | | ", + // [MenuQuestions]: + MenuQuestionsA: "касается ли окно края экрана?", + MenuQuestionsB: "сфокусировано ли окно?", + MenuQuestionsC: "является ли окно полноэкранным?", + ScreenWHXY: " | | | | экран [MenuScreenWHXY] | | | | ", + setEnabled: " | | | | задать [thing] [enabled] | | | | ", + // [thing]: + thingA: "🗲 турбо режим", + thingB: "интерполяция", + thingC: "убрать рамку сцены", + thingD: "убрать разные ограничения", + thingE: "перо в высоком качестве", + // [enabled]: + setFramerate: " | | | | задать ограничение частоты кадров на: [fps] | | | | ", + showHideOption: " | | | | [SHOWHIDE] [OPTIONSH] | | | | ", + // [SHOWHIDE]: + show: "показать", + hide: "скрыть", + // [OPTIONSH]: + flag: "иконка флага", + pause: "иконка паузы", + stop: "иконка остановки", + fullscreen: "иконка полноэкранного режима", + optionShown: " | | | | [OPTION] показан? | | | | ", + }, + }); + + if (!Scratch.extensions.unsandboxed) {throw new Error("Error");} + + + // иконка меню: + const menuIconURI = "data:image/svg+xml,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2294%22%20height%3D%2294%22%20rx%3D%2217%22%20fill%3D%22%234B6095%22%20stroke%3D%22%232D3548%22%20stroke-width%3D%226%22%2F%3E%3Crect%20x%3D%2226%22%20y%3D%2226%22%20width%3D%2248%22%20height%3D%2248%22%20rx%3D%225%22%20stroke%3D%22white%22%20stroke-width%3D%226%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M23%2031C23%2026.5817%2026.5817%2023%2031%2023H69C73.4183%2023%2077%2026.5817%2077%2031V35C77%2039.4183%2073.4183%2043%2069%2043H31C26.5817%2043%2023%2039.4183%2023%2035V31ZM43%2037C45.2091%2037%2047%2035.2091%2047%2033C47%2030.7909%2045.2091%2029%2043%2029C40.7909%2029%2039%2030.7909%2039%2033C39%2035.2091%2040.7909%2037%2043%2037ZM57%2033C57%2035.2091%2055.2091%2037%2053%2037C50.7909%2037%2049%2035.2091%2049%2033C49%2030.7909%2050.7909%2029%2053%2029C55.2091%2029%2057%2030.7909%2057%2033ZM33%2037C35.2091%2037%2037%2035.2091%2037%2033C37%2030.7909%2035.2091%2029%2033%2029C30.7909%2029%2029%2030.7909%2029%2033C29%2035.2091%2030.7909%2037%2033%2037Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E"; + + // иконки блоков: + const MoveWHXY = "data:image/gif;base64,"; + const greenFlagURI="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAxNiAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zIDAuNUMzIDAuMjIzODU4IDIuNzc2MTQgMCAyLjUgMEgxLjVDMC42NzE1NzMgMCAwIDAuNjcxNTczIDAgMS41VjE4LjVDMCAxOS4zMjg0IDAuNjcxNTczIDIwIDEuNSAyMFYyMEMyLjMyODQzIDIwIDMgMTkuMzI4NCAzIDE4LjVWMTVDMyAxMy44OTU0IDMuODk1NDMgMTMgNSAxM0gxNEMxNS4xMDQ2IDEzIDE2IDEyLjEwNDYgMTYgMTFWM0MxNiAxLjg5NTQzIDE1LjEwNDYgMSAxNCAxSDMuNUMzLjIyMzg2IDEgMyAwLjc3NjE0MiAzIDAuNVYwLjVaIiBmaWxsPSIjMTgxRDBEIi8+Cjwvc3ZnPgo="; + + + const TURBO_MODE = "turbo mode"; + const INTERPOLATION = "interpolation"; + const REMOVE_FENCING = "remove fencing"; + const REMOVE_MISC_LIMITS = "remove misc limits"; + const HIGH_QUALITY_PEN = "high quality pen"; + + + var fullScreen; + var greenFlag; + var pauseButton; + var stopButton; + + const getButtons = () => { + fullScreen = undefined; + greenFlag = undefined; + pauseButton = undefined; + stopButton = undefined; + + const rightButtons = document.querySelectorAll( + '[class*="stage-header_stage-button_"]' + ); + fullScreen = rightButtons[rightButtons.length - 1]; + if (!fullScreen) { + fullScreen = + document.querySelector(".fullscreen-button") || + document.querySelector(".standalone-fullscreen-button"); + } + + greenFlag = + document.querySelector('[class*="green-flag_green-flag_"]') || + document.querySelector(".green-flag-button"); + pauseButton = + document.querySelector(".pause-btn") || + document.querySelector(".pause-button"); + stopButton = + document.querySelector('[class*="stop-all_stop-all_"]') || + document.querySelector(".stop-all-button"); + }; + + class controlcontrols { + constructor() { + Scratch.vm.runtime.on("RUNTIME_DISPOSED", () => { + getButtons(); + for (const button of [fullScreen, greenFlag, pauseButton, stopButton]) { + if (button) { + button.style.display = "block"; + } + } + }); + } + } + class lmsmcutils { + getInfo() { + return { + id: "WindowSettings", + name: Scratch.translate({ id: "ExtensionName", default: "Window Settings" }), + color1: "#5671B7", + color2: "#4B6095", + color3: "#2D3548", + menuIconURI: menuIconURI, + + blocks: [ + + { + opcode: "MoveWHXY", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "MoveWHXY", + default: " | | | | window [SC] [WHXY]: [WHXYA], [WHXYB] | | | | " + }), + arguments: { + SC: { + type: Scratch.ArgumentType.STRING, + menu: "SC", + }, + WHXY: { + type: Scratch.ArgumentType.STRING, + menu: "WHXY", + }, + WHXYA: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "480", + }, + WHXYB: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "360", + }, + }, + }, + + { + opcode: "WindowSCWH", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "WindowSCWH", + default: " | | | | window [MenuSC] [MenuWH]: [WH] | | | | " + }), + arguments: { + MenuSC: { + type: Scratch.ArgumentType.STRING, + menu: "MenuSC", + }, + MenuWH: { + type: Scratch.ArgumentType.STRING, + menu: "MenuWH", + }, + WH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "480", + }, + }, + }, + + { + opcode: "moveToPresets", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "moveToPresets", + default: " | | | | move window to the [PRESETS] | | | | " + }), + arguments: { + PRESETS: { + type: Scratch.ArgumentType.STRING, + menu: "MOVE", + }, + }, + }, + + { + opcode: "changeTitleTo", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "changeTitleTo", + default: " | | | | set window title to [TITLE] | | | | " + }), + arguments: { + TITLE: { + type: Scratch.ArgumentType.STRING, + defaultValue: "WAYLIVES", + }, + }, + }, + + { + opcode: "WindowWHXY", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate({ + id: "WindowWHXY", + default: " | | | | window [MenuWindowWHXY] | | | | " + }), + arguments: { + MenuWindowWHXY: { + type: Scratch.ArgumentType.STRING, + menu: "MenuWindowWHXY", + }, + }, + }, + + "---", + + { + opcode: "innerStageSize", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "innerStageSize", + default: " | | | | inner stage size [innerMenuSetChange] width: [innerWidth] height: [innerHeight] | | | | " + }), + arguments: { + innerMenuSetChange: { + type: Scratch.ArgumentType.STRING, + menu: "innerMenuSetChange", + }, + innerWidth: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "480", + }, + innerHeight: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "360", + }, + }, + }, + + { + opcode: "innerStageSizeWidthHeight", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "innerStageSizeWidthHeight", + default: " | | | | inner stage size [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight] | | | | " + }), + arguments: { + innerMenuSetChangeWH: { + type: Scratch.ArgumentType.STRING, + menu: "innerMenuSetChangeWH", + }, + innerMenuWidthHeight: { + type: Scratch.ArgumentType.STRING, + menu: "innerMenuWidthHeight", + }, + innerWidthHeight: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "480", + }, + }, + }, + + { + opcode: "setDimensions", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "setDimensions", + default: " | | | | set stage size width: [width] height: [height] | | | | " + }), + arguments: { + width: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "480", + }, + height: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "360", + }, + }, + }, + + { + opcode: "getDimension", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate({ + id: "getDimension", + default: " | | | | stage [dimension] | | | | " + }), + arguments: { + dimension: { + type: Scratch.ArgumentType.STRING, + defaultValue: "width", + menu: "dimension", + }, + }, + }, + + "---", + + { + opcode: "greenFlag", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "greenFlag", + default: " | | | | run flag [flag] | | | | " + }), + arguments: { + flag: { + type: Scratch.ArgumentType.IMAGE, + dataURI: greenFlagURI, + }, + }, + }, + + { + opcode: "FullscreenEnterExit", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "FullscreenEnterExit", + default: " | | | | fullscreen [MenuFEE] | | | | " + }), + arguments: { + MenuFEE: { + type: Scratch.ArgumentType.STRING, + menu: "MenuFEE", + }, + }, + }, + + { + opcode: "closeWindow", + blockType: Scratch.BlockType.COMMAND, + isTerminal: true, + text: Scratch.translate({ + id: "closeWindow", + default: " | | | | close window | | | | " + }), + }, + + { + opcode: "QuestionsWS", + blockType: Scratch.BlockType.BOOLEAN, + text: Scratch.translate({ + id: "QuestionsWS", + default: " | | | | [MenuQuestions] | | | | " + }), + disableMonitor: true, + arguments: { + MenuQuestions: { + type: Scratch.ArgumentType.STRING, + menu: "MenuQuestions", + }, + }, + }, + + { + opcode: "ScreenWHXY", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate({ + id: "ScreenWHXY", + default: " | | | | screen [MenuScreenWHXY] | | | | " + }), + arguments: { + MenuScreenWHXY: { + type: Scratch.ArgumentType.STRING, + menu: "MenuScreenWHXY", + }, + }, + }, + + "---", +/* + { + opcode: "setEnabled", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "setEnabled", + default: " | | | | set [thing] to [enabled] | | | | " + }), + arguments: { + thing: { + type: Scratch.ArgumentType.STRING, + menu: "thing", + defaultValue: "TURBO_MODE", + }, + enabled: { + type: Scratch.ArgumentType.STRING, + menu: "enabled", + defaultValue: "true", + }, + }, + }, +*/ + { + opcode: "setFramerate", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "setFramerate", + default: " | | | | set framerate limit to [fps] | | | | " + }), + arguments: { + fps: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "30", + }, + }, + }, + + + "---", + + + { + opcode: "showHideOption", + blockType: Scratch.BlockType.COMMAND, + text: Scratch.translate({ + id: "showHideOption", + default: " | | | | [SHOWHIDE] [OPTIONSH] | | | | " + }), + arguments: { + SHOWHIDE: { + type: Scratch.ArgumentType.STRING, + menu: "SHOWHIDE", + }, + OPTIONSH: { + type: Scratch.ArgumentType.STRING, + menu: "OPTIONSH", + }, + }, + }, + { + opcode: "optionShown", + blockType: Scratch.BlockType.BOOLEAN, + text: Scratch.translate({ + id: "optionShown", + default: " | | | | [OPTION] shown? | | | | " + }), + arguments: { + OPTION: { + type: Scratch.ArgumentType.STRING, + menu: "OPTION", + }, + }, + }, + "---", + + ], + + + menus: { + + SC: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "SCA", default: "set" }), value: "Set" }, + { text: Scratch.translate({ id: "SCB", default: "change" }), value: "Change" }, + ], + }, + WHXY: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "WHXYA", default: "width, height" }), value: "WidthHeight" }, + { text: Scratch.translate({ id: "WHXYB", default: "x position, y position" }), value: "PositionXY" }, + ], + }, + MenuSC: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "MenuSCA", default: "set" }), value: "Set" }, + { text: Scratch.translate({ id: "MenuSCB", default: "change" }), value: "Change" }, + ], + }, + MenuWH: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "MenuWHA", default: "width" }), value: "Width" }, + { text: Scratch.translate({ id: "MenuWHB", default: "height" }), value: "Height" }, + { text: Scratch.translate({ id: "MenuWHC", default: "x position" }), value: "PositionX" }, + { text: Scratch.translate({ id: "MenuWHD", default: "y position" }), value: "PositionY" }, + ], + }, + MOVE: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "PRESETSA", default: "center" }), value: "center" }, + { text: Scratch.translate({ id: "PRESETSB", default: "right" }), value: "right" }, + { text: Scratch.translate({ id: "PRESETSC", default: "left" }), value: "left" }, + { text: Scratch.translate({ id: "PRESETSD", default: "top" }), value: "top" }, + { text: Scratch.translate({ id: "PRESETSE", default: "bottom" }), value: "bottom" }, + { text: Scratch.translate({ id: "PRESETSF", default: "top right" }), value: "top right" }, + { text: Scratch.translate({ id: "PRESETSG", default: "top left" }), value: "top left" }, + { text: Scratch.translate({ id: "PRESETSH", default: "bottom right" }), value: "bottom right" }, + { text: Scratch.translate({ id: "PRESETSI", default: "bottom left" }), value: "bottom left" }, + ], + }, + MenuWindowWHXY: { + acceptReporters: true, + items: [ + { text: "width", value: "Width" }, + { text: "height", value: "Height" }, + { text: "x position", value: "PositionX" }, + { text: "y position", value: "PositionY" }, + { text: "title", value: "Title" }, + ], + }, + innerMenuSetChange: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "innerMenuSetChangeA", default: "set" }), value: "set" }, + { text: Scratch.translate({ id: "innerMenuSetChangeB", default: "change" }), value: "change" }, + ], + }, + innerMenuSetChangeWH: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "innerMenuSetChangeWHA", default: "set" }), value: "set" }, + { text: Scratch.translate({ id: "innerMenuSetChangeWHB", default: "change" }), value: "change" }, + ], + }, + innerMenuWidthHeight: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "innerMenuWidthHeightA", default: "width" }), value: "width" }, + { text: Scratch.translate({ id: "innerMenuWidthHeightB", default: "height" }), value: "height" }, + ], + }, + dimension: { + acceptReporters: true, + items: [ + { + text: Scratch.translate("width"), + value: "width", + }, + { + text: Scratch.translate("height"), + value: "height", + }, + ], + }, + MenuFEE: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "FullscreenEnter", default: "width" }), value: "Enter" }, + { text: Scratch.translate({ id: "FullscreenExit", default: "height" }), value: "Exit" }, + ], + }, + MenuQuestions: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "MenuQuestionsA", default: "is window touching screen edge" }), value: "A" }, + { text: Scratch.translate({ id: "MenuQuestionsB", default: "is window focused?" }), value: "B" }, + { text: Scratch.translate({ id: "MenuQuestionsC", default: "is window fullscreen?" }), value: "C" }, + ], + }, + MenuScreenWHXY: { + acceptReporters: true, + items: [ + { text: "width", value: "Width" }, + { text: "height", value: "Height" }, + ], + }, + + thing: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "thingA", default: "🗲 turbo mode" }), value: "TURBO_MODE" }, + { text: Scratch.translate({ id: "thingB", default: "interpolation" }), value: "INTERPOLATION" }, + { text: Scratch.translate({ id: "thingC", default: "remove fencing" }), value: "REMOVE_FENCING" }, + { text: Scratch.translate({ id: "thingD", default: "remove misc limits" }), value: "REMOVE_MISC_LIMITS" }, + { text: Scratch.translate({ id: "thingE", default: "high quality pen" }), value: "HIGH_QUALITY_PEN" }, + ], + }, + + enabled: { + acceptReporters: false, + items: [ + { + text: Scratch.translate("enabled"), + value: "true", + }, + { + text: Scratch.translate("disabled"), + value: "false", + }, + ], + }, + + OPTION: { + acceptReporters: true, + items: [ + { + text: Scratch.translate("flag"), + value: "flag", + }, + { + text: Scratch.translate("pause"), + value: "pause", + }, + { + text: Scratch.translate("stop"), + value: "stop", + }, + { + text: Scratch.translate("fullscreen"), + value: "fullscreen", + }, + ], + }, + SHOWHIDE: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "show", default: "show" }), value: "show" }, + { text: Scratch.translate({ id: "hide", default: "hide" }), value: "hide" }, + ], + }, + OPTIONSH: { + acceptReporters: false, + items: [ + { text: Scratch.translate({ id: "flag", default: "flag" }), value: "flag" }, + { text: Scratch.translate({ id: "pause", default: "pause" }), value: "pause" }, + { text: Scratch.translate({ id: "stop", default: "stop" }), value: "stop" }, + { text: Scratch.translate({ id: "fullscreen", default: "fullscreen" }), value: "fullscreen" }, + ], + }, + + }, + }; + } + + getDimension({ dimension }) { + if (dimension === "width") { + return Scratch.vm.runtime.stageWidth; + } else if (dimension === "height") { + return Scratch.vm.runtime.stageHeight; + } + return 0; + } + + setDimensions({ width, height }) { + width = Scratch.Cast.toNumber(width); + height = Scratch.Cast.toNumber(height); + Scratch.vm.setStageSize(width, height); + } + + + + MoveWHXY(args) { + if (args.SC == "Set") { + if (args.WHXY == "WidthHeight") { + window.resizeTo(args.WHXYA, args.WHXYB); + } else if (args.WHXY == "PositionXY") { + window.moveTo(args.WHXYA, args.WHXYB); + } + } else if (args.SC == "Change") { + if (args.WHXY == "WidthHeight") { + window.resizeBy(args.WHXYA, args.WHXYB); + } else if (args.WHXY == "PositionXY") { + window.moveBy(args.WHXYA, args.WHXYB); + } + } + Scratch.vm.runtime.requestRedraw(); + } + + innerStageSize(args) { + if (args.innerMenuSetChange == "set") { + window.resizeTo(args.innerWidth + (window.outerWidth - window.innerWidth), args.innerHeight + (window.outerHeight - window.innerHeight)); + } else if (args.innerMenuSetChange == "change") { + window.resizeBy(args.innerWidth, args.innerHeight); + } + Scratch.vm.runtime.requestRedraw(); + } + + innerStageSizeWidthHeight(args) { + if (args.innerMenuSetChangeWH == "set") { + if (args.innerMenuWidthHeight == "width") { + const innerHeight = window.outerHeight; + window.resizeTo(args.innerWidthHeight + (window.outerWidth - window.innerWidth), innerHeight); + } else if (args.innerMenuWidthHeight == "height") { + const innerWidth = window.outerWidth; + window.resizeTo(innerWidth, args.innerWidthHeight + (window.outerHeight - window.innerHeight)); + } + } else if (args.innerMenuSetChangeWH == "change") { + if (args.innerMenuWidthHeight == "width") { + window.resizeBy(args.innerWidthHeight, 0); + } else if (args.innerMenuWidthHeight == "height") { + window.resizeBy(0, args.innerWidthHeight); + } + } + Scratch.vm.runtime.requestRedraw(); + } + + moveToPresets(args) { + if (args.PRESETS == "center") { + const left = (screen.width - window.outerWidth) / 2; + const top = (screen.height - window.outerHeight) / 2; + window.moveTo(left, top); + } else if (args.PRESETS == "right") { + const right = screen.width - window.outerWidth; + const top = (screen.height - window.outerHeight) / 2; + window.moveTo(right, top); + } else if (args.PRESETS == "left") { + const top = (screen.height - window.outerHeight) / 2; + window.moveTo(0, top); + } else if (args.PRESETS == "top") { + const left = (screen.width - window.outerWidth) / 2; + window.moveTo(left, 0); + } else if (args.PRESETS == "bottom") { + const left = (screen.width - window.outerWidth) / 2; + const bottom = screen.height - window.outerHeight; + window.moveTo(left, bottom); + } else if (args.PRESETS == "top right") { + const right = screen.width - window.outerWidth; + window.moveTo(right, 0); + } else if (args.PRESETS == "top left") { + window.moveTo(0, 0); + } else if (args.PRESETS == "bottom right") { + const right = screen.width - window.outerWidth; + const bottom = screen.height - window.outerHeight; + window.moveTo(right, bottom); + } else if (args.PRESETS == "bottom left") { + const bottom = screen.height - window.outerHeight; + window.moveTo(0, bottom); + } + Scratch.vm.runtime.requestRedraw(); + } + + WindowWHXY(args) { + if (args.MenuWindowWHXY == "Width") { + return window.outerWidth; + } else if (args.MenuWindowWHXY == "Height") { + return window.outerHeight; + } else if (args.MenuWindowWHXY == "PositionX") { + return window.screenLeft; + } else if (args.MenuWindowWHXY == "PositionY") { + return window.screenTop; + } else if (args.MenuWindowWHXY == "Title") { + return document.title; + } + } + ScreenWHXY(args) { + if (args.MenuScreenWHXY == "Width") { + return screen.width; + } else if (args.MenuScreenWHXY == "Height") { + return screen.height; + } + } + QuestionsWS(args) { + if (args.MenuQuestions == "A") { + const edgeX = screen.width - window.outerWidth; + const edgeY = screen.height - window.outerHeight; + return ( + window.screenLeft <= 0 || + window.screenTop <= 0 || + window.screenLeft >= edgeX || + window.screenTop >= edgeY + ); + } else if (args.MenuQuestions == "B") { + return document.hasFocus(); + } else if (args.MenuQuestions == "C") { + return document.fullscreenElement !== null; + } + } + FullscreenEnterExit(args) { + if (args.MenuFEE == "Enter") { + if (document.fullscreenElement == null) { + document.documentElement.requestFullscreen(); + } + } else if (args.MenuFEE == "Exit") { + if (document.fullscreenElement !== null) { + document.exitFullscreen(); + } + } + } + + WindowSCWH(args) { + if (args.MenuSC == "Set") { + if (args.MenuWH == "Width") { + const currentH = window.outerHeight; + window.resizeTo(args.WH, currentH); + } else if (args.MenuWH == "Height") { + const currentW = window.outerWidth; + window.resizeTo(currentW, args.WH); + } else if (args.MenuWH == "PositionX") { + const currentY = window.screenY; + window.moveTo(args.WH, currentY); + } else if (args.MenuWH == "PositionY") { + const currentX = window.screenX; + window.moveTo(currentX, args.WH); + } + } else if (args.MenuSC == "Change") { + if (args.MenuWH == "Width") { + window.resizeBy(args.WH, 0); + } else if (args.MenuWH == "Height") { + window.resizeBy(0, args.WH); + } else if (args.MenuWH == "PositionX") { + window.moveBy(args.WH, 0); + } else if (args.MenuWH == "PositionY") { + window.moveBy(0, args.WH); + } + } + Scratch.vm.runtime.requestRedraw(); + } + + changeTitleTo(args) { + document.title = args.TITLE; + } + closeWindow() { + const editorConfirmation = Scratch.translate({ + id: "editorConfirmation", + default: + "Are you sure you want to close this window?\n\n(This message will not appear when the project is packaged)", + }); + // @ts-expect-error + if (typeof ScratchBlocks === "undefined" || confirm(editorConfirmation)) { + window.close(); + } + } + + greenFlag() { + Scratch.vm.runtime.greenFlag(); + } + + setEnabled({ thing, enabled }) { + enabled = Scratch.Cast.toBoolean(enabled); + + if (thing === TURBO_MODE) { + Scratch.vm.setTurboMode(enabled); + } else if (thing === INTERPOLATION) { + Scratch.vm.setInterpolation(enabled); + } else if (thing === REMOVE_FENCING) { + Scratch.vm.setRuntimeOptions({ + fencing: !enabled, + }); + } else if (thing === REMOVE_MISC_LIMITS) { + Scratch.vm.setRuntimeOptions({ + miscLimits: !enabled, + }); + } else if (thing === HIGH_QUALITY_PEN) { + Scratch.renderer.setUseHighQualityRender(enabled); + } + } + + setFramerate({ fps }) { + fps = Scratch.Cast.toNumber(fps); + Scratch.vm.setFramerate(fps); + } + + showHideOption(args) { + getButtons(); + if (args.SHOWHIDE === "show") { + if (args.OPTIONSH === "flag" && greenFlag) { + greenFlag.style.display = "block"; + } else if (args.OPTIONSH === "pause" && pauseButton) { + pauseButton.style.display = "block"; + } else if (args.OPTIONSH === "stop" && stopButton) { + stopButton.style.display = "block"; + } else if (args.OPTIONSH === "fullscreen" && fullScreen) { + fullScreen.style.display = "block"; + } + } else if (args.SHOWHIDE === "hide") { + if (args.OPTIONSH === "flag" && greenFlag) { + greenFlag.style.display = "none"; + } else if (args.OPTIONSH === "pause" && pauseButton) { + pauseButton.style.display = "none"; + } else if (args.OPTIONSH === "stop" && stopButton) { + stopButton.style.display = "none"; + } else if (args.OPTIONSH === "fullscreen" && fullScreen) { + fullScreen.style.display = "none"; + } + } + } + + optionShown(args) { + getButtons(); + if (args.OPTION === "flag" && greenFlag) { + return greenFlag.style.display !== "none"; + } else if (args.OPTION === "pause" && pauseButton) { + return pauseButton.style.display !== "none"; + } else if (args.OPTION === "stop" && stopButton) { + return stopButton.style.display !== "none"; + } else if (args.OPTION === "fullscreen" && fullScreen) { + return fullScreen.style.display !== "none"; + } + return false; + } + } + Scratch.extensions.register(new lmsmcutils()); +})(Scratch); From 3d09c9090c03bbe4908b7c0384db43dd2bbaf3e5 Mon Sep 17 00:00:00 2001 From: "DangoCat[bot]" Date: Fri, 28 Feb 2025 10:21:45 +0000 Subject: [PATCH 02/63] [Automated] Format code --- extensions/RIHART/Window Settings/1.0.0.js | 625 ++++++++++++++------- 1 file changed, 417 insertions(+), 208 deletions(-) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index 94a65c1a69..2618802026 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -4,108 +4,112 @@ // By: RIHART // Version: 1.0.0 - (function (Scratch) { - "use strict"; + "use strict"; - Scratch.translate.setup({ + Scratch.translate.setup({ ru /*_РусскийЯзык_*/: { ExtensionName: "Настройки Окна", LabelA: "Window Settings:", MoveWHXY: " | | | | окно [SC] [WHXY]: [WHXYA], [WHXYB] | | | | ", - // [SC]: - SCA: "задать", - SCB: "изменить", - // [WHXY]: - WHXYA: "ширину, высоту", - WHXYB: "позицию x, позицию y", + // [SC]: + SCA: "задать", + SCB: "изменить", + // [WHXY]: + WHXYA: "ширину, высоту", + WHXYB: "позицию x, позицию y", WindowSCWH: " | | | | окно [MenuSC] [MenuWH]: [WH] | | | | ", - // [MenuSC]: - MenuSCA: "задать", - MenuSCB: "изменить", - // [MenuWH]: - MenuWHA: "ширину", - MenuWHB: "высоту", - MenuWHC: "позицию x", - MenuWHD: "позицию y", + // [MenuSC]: + MenuSCA: "задать", + MenuSCB: "изменить", + // [MenuWH]: + MenuWHA: "ширину", + MenuWHB: "высоту", + MenuWHC: "позицию x", + MenuWHD: "позицию y", moveToPresets: " | | | | переместить окно [PRESETS] | | | | ", - // [PRESETS]: - PRESETSA: "по центру", - PRESETSB: "справа", - PRESETSC: "слева", - PRESETSD: "сверху", - PRESETSE: "снизу", - PRESETSF: "в верхнем правом углу", - PRESETSG: "в верхнем левом углу", - PRESETSH: "в нижнем правом углу", - PRESETSI: "в нижнем левом углу", + // [PRESETS]: + PRESETSA: "по центру", + PRESETSB: "справа", + PRESETSC: "слева", + PRESETSD: "сверху", + PRESETSE: "снизу", + PRESETSF: "в верхнем правом углу", + PRESETSG: "в верхнем левом углу", + PRESETSH: "в нижнем правом углу", + PRESETSI: "в нижнем левом углу", changeTitleTo: " | | | | задать окну имя [TITLE] | | | | ", WindowWHXY: " | | | | окно [MenuWindowWHXY] | | | | ", - innerStageSize: " | | | | размер внутренней сцены [innerMenuSetChange] ширину: [innerWidth] высоту: [innerHeight] | | | | ", - // [innerMenuSetChange]: - innerMenuSetChangeA: "задать", - innerMenuSetChangeB: "изменить", - innerStageSizeWidthHeight: " | | | | размер внутренней сцены [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight] | | | | ", - // [innerMenuSetChangeWH]: - innerMenuSetChangeWHA: "задать", - innerMenuSetChangeWHB: "изменить", - // [innerMenuWidthHeight]: - innerMenuWidthHeightA: "ширину", - innerMenuWidthHeightB: "высоту", - setDimensions: " | | | | задать сцену по ширине: [width] по высоте: [height] | | | | ", + innerStageSize: + " | | | | размер внутренней сцены [innerMenuSetChange] ширину: [innerWidth] высоту: [innerHeight] | | | | ", + // [innerMenuSetChange]: + innerMenuSetChangeA: "задать", + innerMenuSetChangeB: "изменить", + innerStageSizeWidthHeight: + " | | | | размер внутренней сцены [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight] | | | | ", + // [innerMenuSetChangeWH]: + innerMenuSetChangeWHA: "задать", + innerMenuSetChangeWHB: "изменить", + // [innerMenuWidthHeight]: + innerMenuWidthHeightA: "ширину", + innerMenuWidthHeightB: "высоту", + setDimensions: + " | | | | задать сцену по ширине: [width] по высоте: [height] | | | | ", getDimension: " | | | | сцена [dimension] | | | | ", greenFlag: " | | | | нажать на флаг [flag] | | | | ", FullscreenEnterExit: " | | | | полноэкранный режим [MenuFEE] | | | | ", - // [MenuFEE]: - FullscreenEnter: "включить", - FullscreenExit: "выключить", + // [MenuFEE]: + FullscreenEnter: "включить", + FullscreenExit: "выключить", closeWindow: " | | | | закрыть окно | | | | ", QuestionsWS: " | | | | [MenuQuestions] | | | | ", - // [MenuQuestions]: - MenuQuestionsA: "касается ли окно края экрана?", - MenuQuestionsB: "сфокусировано ли окно?", - MenuQuestionsC: "является ли окно полноэкранным?", + // [MenuQuestions]: + MenuQuestionsA: "касается ли окно края экрана?", + MenuQuestionsB: "сфокусировано ли окно?", + MenuQuestionsC: "является ли окно полноэкранным?", ScreenWHXY: " | | | | экран [MenuScreenWHXY] | | | | ", setEnabled: " | | | | задать [thing] [enabled] | | | | ", - // [thing]: - thingA: "🗲 турбо режим", - thingB: "интерполяция", - thingC: "убрать рамку сцены", - thingD: "убрать разные ограничения", - thingE: "перо в высоком качестве", - // [enabled]: - setFramerate: " | | | | задать ограничение частоты кадров на: [fps] | | | | ", + // [thing]: + thingA: "🗲 турбо режим", + thingB: "интерполяция", + thingC: "убрать рамку сцены", + thingD: "убрать разные ограничения", + thingE: "перо в высоком качестве", + // [enabled]: + setFramerate: + " | | | | задать ограничение частоты кадров на: [fps] | | | | ", showHideOption: " | | | | [SHOWHIDE] [OPTIONSH] | | | | ", - // [SHOWHIDE]: - show: "показать", - hide: "скрыть", - // [OPTIONSH]: - flag: "иконка флага", - pause: "иконка паузы", - stop: "иконка остановки", - fullscreen: "иконка полноэкранного режима", + // [SHOWHIDE]: + show: "показать", + hide: "скрыть", + // [OPTIONSH]: + flag: "иконка флага", + pause: "иконка паузы", + stop: "иконка остановки", + fullscreen: "иконка полноэкранного режима", optionShown: " | | | | [OPTION] показан? | | | | ", }, - }); - - if (!Scratch.extensions.unsandboxed) {throw new Error("Error");} - + }); + + if (!Scratch.extensions.unsandboxed) { + throw new Error("Error"); + } // иконка меню: - const menuIconURI = "data:image/svg+xml,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2294%22%20height%3D%2294%22%20rx%3D%2217%22%20fill%3D%22%234B6095%22%20stroke%3D%22%232D3548%22%20stroke-width%3D%226%22%2F%3E%3Crect%20x%3D%2226%22%20y%3D%2226%22%20width%3D%2248%22%20height%3D%2248%22%20rx%3D%225%22%20stroke%3D%22white%22%20stroke-width%3D%226%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M23%2031C23%2026.5817%2026.5817%2023%2031%2023H69C73.4183%2023%2077%2026.5817%2077%2031V35C77%2039.4183%2073.4183%2043%2069%2043H31C26.5817%2043%2023%2039.4183%2023%2035V31ZM43%2037C45.2091%2037%2047%2035.2091%2047%2033C47%2030.7909%2045.2091%2029%2043%2029C40.7909%2029%2039%2030.7909%2039%2033C39%2035.2091%2040.7909%2037%2043%2037ZM57%2033C57%2035.2091%2055.2091%2037%2053%2037C50.7909%2037%2049%2035.2091%2049%2033C49%2030.7909%2050.7909%2029%2053%2029C55.2091%2029%2057%2030.7909%2057%2033ZM33%2037C35.2091%2037%2037%2035.2091%2037%2033C37%2030.7909%2035.2091%2029%2033%2029C30.7909%2029%2029%2030.7909%2029%2033C29%2035.2091%2030.7909%2037%2033%2037Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E"; - + const menuIconURI = + "data:image/svg+xml,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2294%22%20height%3D%2294%22%20rx%3D%2217%22%20fill%3D%22%234B6095%22%20stroke%3D%22%232D3548%22%20stroke-width%3D%226%22%2F%3E%3Crect%20x%3D%2226%22%20y%3D%2226%22%20width%3D%2248%22%20height%3D%2248%22%20rx%3D%225%22%20stroke%3D%22white%22%20stroke-width%3D%226%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M23%2031C23%2026.5817%2026.5817%2023%2031%2023H69C73.4183%2023%2077%2026.5817%2077%2031V35C77%2039.4183%2073.4183%2043%2069%2043H31C26.5817%2043%2023%2039.4183%2023%2035V31ZM43%2037C45.2091%2037%2047%2035.2091%2047%2033C47%2030.7909%2045.2091%2029%2043%2029C40.7909%2029%2039%2030.7909%2039%2033C39%2035.2091%2040.7909%2037%2043%2037ZM57%2033C57%2035.2091%2055.2091%2037%2053%2037C50.7909%2037%2049%2035.2091%2049%2033C49%2030.7909%2050.7909%2029%2053%2029C55.2091%2029%2057%2030.7909%2057%2033ZM33%2037C35.2091%2037%2037%2035.2091%2037%2033C37%2030.7909%2035.2091%2029%2033%2029C30.7909%2029%2029%2030.7909%2029%2033C29%2035.2091%2030.7909%2037%2033%2037Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E"; + // иконки блоков: const MoveWHXY = "data:image/gif;base64,"; - const greenFlagURI="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAxNiAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zIDAuNUMzIDAuMjIzODU4IDIuNzc2MTQgMCAyLjUgMEgxLjVDMC42NzE1NzMgMCAwIDAuNjcxNTczIDAgMS41VjE4LjVDMCAxOS4zMjg0IDAuNjcxNTczIDIwIDEuNSAyMFYyMEMyLjMyODQzIDIwIDMgMTkuMzI4NCAzIDE4LjVWMTVDMyAxMy44OTU0IDMuODk1NDMgMTMgNSAxM0gxNEMxNS4xMDQ2IDEzIDE2IDEyLjEwNDYgMTYgMTFWM0MxNiAxLjg5NTQzIDE1LjEwNDYgMSAxNCAxSDMuNUMzLjIyMzg2IDEgMyAwLjc3NjE0MiAzIDAuNVYwLjVaIiBmaWxsPSIjMTgxRDBEIi8+Cjwvc3ZnPgo="; + const greenFlagURI = + "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAxNiAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zIDAuNUMzIDAuMjIzODU4IDIuNzc2MTQgMCAyLjUgMEgxLjVDMC42NzE1NzMgMCAwIDAuNjcxNTczIDAgMS41VjE4LjVDMCAxOS4zMjg0IDAuNjcxNTczIDIwIDEuNSAyMFYyMEMyLjMyODQzIDIwIDMgMTkuMzI4NCAzIDE4LjVWMTVDMyAxMy44OTU0IDMuODk1NDMgMTMgNSAxM0gxNEMxNS4xMDQ2IDEzIDE2IDEyLjEwNDYgMTYgMTFWM0MxNiAxLjg5NTQzIDE1LjEwNDYgMSAxNCAxSDMuNUMzLjIyMzg2IDEgMyAwLjc3NjE0MiAzIDAuNVYwLjVaIiBmaWxsPSIjMTgxRDBEIi8+Cjwvc3ZnPgo="; - const TURBO_MODE = "turbo mode"; const INTERPOLATION = "interpolation"; const REMOVE_FENCING = "remove fencing"; const REMOVE_MISC_LIMITS = "remove misc limits"; const HIGH_QUALITY_PEN = "high quality pen"; - var fullScreen; var greenFlag; var pauseButton; @@ -149,25 +153,28 @@ } }); } - } + } class lmsmcutils { getInfo() { - return { + return { id: "WindowSettings", - name: Scratch.translate({ id: "ExtensionName", default: "Window Settings" }), + name: Scratch.translate({ + id: "ExtensionName", + default: "Window Settings", + }), color1: "#5671B7", color2: "#4B6095", color3: "#2D3548", menuIconURI: menuIconURI, - - blocks: [ + blocks: [ { opcode: "MoveWHXY", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "MoveWHXY", - default: " | | | | window [SC] [WHXY]: [WHXYA], [WHXYB] | | | | " + text: Scratch.translate({ + id: "MoveWHXY", + default: + " | | | | window [SC] [WHXY]: [WHXYA], [WHXYB] | | | | ", }), arguments: { SC: { @@ -188,13 +195,13 @@ }, }, }, - + { opcode: "WindowSCWH", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "WindowSCWH", - default: " | | | | window [MenuSC] [MenuWH]: [WH] | | | | " + text: Scratch.translate({ + id: "WindowSCWH", + default: " | | | | window [MenuSC] [MenuWH]: [WH] | | | | ", }), arguments: { MenuSC: { @@ -211,13 +218,13 @@ }, }, }, - + { opcode: "moveToPresets", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "moveToPresets", - default: " | | | | move window to the [PRESETS] | | | | " + text: Scratch.translate({ + id: "moveToPresets", + default: " | | | | move window to the [PRESETS] | | | | ", }), arguments: { PRESETS: { @@ -226,13 +233,13 @@ }, }, }, - + { opcode: "changeTitleTo", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "changeTitleTo", - default: " | | | | set window title to [TITLE] | | | | " + text: Scratch.translate({ + id: "changeTitleTo", + default: " | | | | set window title to [TITLE] | | | | ", }), arguments: { TITLE: { @@ -240,14 +247,14 @@ defaultValue: "WAYLIVES", }, }, - }, - + }, + { opcode: "WindowWHXY", blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate({ - id: "WindowWHXY", - default: " | | | | window [MenuWindowWHXY] | | | | " + text: Scratch.translate({ + id: "WindowWHXY", + default: " | | | | window [MenuWindowWHXY] | | | | ", }), arguments: { MenuWindowWHXY: { @@ -255,16 +262,17 @@ menu: "MenuWindowWHXY", }, }, - }, + }, - "---", + "---", { opcode: "innerStageSize", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "innerStageSize", - default: " | | | | inner stage size [innerMenuSetChange] width: [innerWidth] height: [innerHeight] | | | | " + text: Scratch.translate({ + id: "innerStageSize", + default: + " | | | | inner stage size [innerMenuSetChange] width: [innerWidth] height: [innerHeight] | | | | ", }), arguments: { innerMenuSetChange: { @@ -281,13 +289,14 @@ }, }, }, - + { opcode: "innerStageSizeWidthHeight", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "innerStageSizeWidthHeight", - default: " | | | | inner stage size [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight] | | | | " + text: Scratch.translate({ + id: "innerStageSizeWidthHeight", + default: + " | | | | inner stage size [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight] | | | | ", }), arguments: { innerMenuSetChangeWH: { @@ -308,9 +317,10 @@ { opcode: "setDimensions", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "setDimensions", - default: " | | | | set stage size width: [width] height: [height] | | | | " + text: Scratch.translate({ + id: "setDimensions", + default: + " | | | | set stage size width: [width] height: [height] | | | | ", }), arguments: { width: { @@ -323,13 +333,13 @@ }, }, }, - + { opcode: "getDimension", blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate({ - id: "getDimension", - default: " | | | | stage [dimension] | | | | " + text: Scratch.translate({ + id: "getDimension", + default: " | | | | stage [dimension] | | | | ", }), arguments: { dimension: { @@ -338,16 +348,16 @@ menu: "dimension", }, }, - }, + }, "---", - + { opcode: "greenFlag", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "greenFlag", - default: " | | | | run flag [flag] | | | | " + text: Scratch.translate({ + id: "greenFlag", + default: " | | | | run flag [flag] | | | | ", }), arguments: { flag: { @@ -360,9 +370,9 @@ { opcode: "FullscreenEnterExit", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "FullscreenEnterExit", - default: " | | | | fullscreen [MenuFEE] | | | | " + text: Scratch.translate({ + id: "FullscreenEnterExit", + default: " | | | | fullscreen [MenuFEE] | | | | ", }), arguments: { MenuFEE: { @@ -371,23 +381,23 @@ }, }, }, - + { opcode: "closeWindow", blockType: Scratch.BlockType.COMMAND, isTerminal: true, - text: Scratch.translate({ - id: "closeWindow", - default: " | | | | close window | | | | " + text: Scratch.translate({ + id: "closeWindow", + default: " | | | | close window | | | | ", }), - }, - + }, + { opcode: "QuestionsWS", blockType: Scratch.BlockType.BOOLEAN, - text: Scratch.translate({ - id: "QuestionsWS", - default: " | | | | [MenuQuestions] | | | | " + text: Scratch.translate({ + id: "QuestionsWS", + default: " | | | | [MenuQuestions] | | | | ", }), disableMonitor: true, arguments: { @@ -397,13 +407,13 @@ }, }, }, - + { opcode: "ScreenWHXY", blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate({ - id: "ScreenWHXY", - default: " | | | | screen [MenuScreenWHXY] | | | | " + text: Scratch.translate({ + id: "ScreenWHXY", + default: " | | | | screen [MenuScreenWHXY] | | | | ", }), arguments: { MenuScreenWHXY: { @@ -414,7 +424,7 @@ }, "---", -/* + /* { opcode: "setEnabled", blockType: Scratch.BlockType.COMMAND, @@ -439,9 +449,9 @@ { opcode: "setFramerate", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "setFramerate", - default: " | | | | set framerate limit to [fps] | | | | " + text: Scratch.translate({ + id: "setFramerate", + default: " | | | | set framerate limit to [fps] | | | | ", }), arguments: { fps: { @@ -450,17 +460,15 @@ }, }, }, - - "---", + "---", - { opcode: "showHideOption", blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "showHideOption", - default: " | | | | [SHOWHIDE] [OPTIONSH] | | | | " + text: Scratch.translate({ + id: "showHideOption", + default: " | | | | [SHOWHIDE] [OPTIONSH] | | | | ", }), arguments: { SHOWHIDE: { @@ -476,9 +484,9 @@ { opcode: "optionShown", blockType: Scratch.BlockType.BOOLEAN, - text: Scratch.translate({ - id: "optionShown", - default: " | | | | [OPTION] shown? | | | | " + text: Scratch.translate({ + id: "optionShown", + default: " | | | | [OPTION] shown? | | | | ", }), arguments: { OPTION: { @@ -487,57 +495,135 @@ }, }, }, - "---", - + "---", ], - menus: { - SC: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "SCA", default: "set" }), value: "Set" }, - { text: Scratch.translate({ id: "SCB", default: "change" }), value: "Change" }, + { + text: Scratch.translate({ id: "SCA", default: "set" }), + value: "Set", + }, + { + text: Scratch.translate({ id: "SCB", default: "change" }), + value: "Change", + }, ], }, WHXY: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "WHXYA", default: "width, height" }), value: "WidthHeight" }, - { text: Scratch.translate({ id: "WHXYB", default: "x position, y position" }), value: "PositionXY" }, + { + text: Scratch.translate({ + id: "WHXYA", + default: "width, height", + }), + value: "WidthHeight", + }, + { + text: Scratch.translate({ + id: "WHXYB", + default: "x position, y position", + }), + value: "PositionXY", + }, ], - }, + }, MenuSC: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "MenuSCA", default: "set" }), value: "Set" }, - { text: Scratch.translate({ id: "MenuSCB", default: "change" }), value: "Change" }, + { + text: Scratch.translate({ id: "MenuSCA", default: "set" }), + value: "Set", + }, + { + text: Scratch.translate({ id: "MenuSCB", default: "change" }), + value: "Change", + }, ], }, MenuWH: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "MenuWHA", default: "width" }), value: "Width" }, - { text: Scratch.translate({ id: "MenuWHB", default: "height" }), value: "Height" }, - { text: Scratch.translate({ id: "MenuWHC", default: "x position" }), value: "PositionX" }, - { text: Scratch.translate({ id: "MenuWHD", default: "y position" }), value: "PositionY" }, + { + text: Scratch.translate({ id: "MenuWHA", default: "width" }), + value: "Width", + }, + { + text: Scratch.translate({ id: "MenuWHB", default: "height" }), + value: "Height", + }, + { + text: Scratch.translate({ + id: "MenuWHC", + default: "x position", + }), + value: "PositionX", + }, + { + text: Scratch.translate({ + id: "MenuWHD", + default: "y position", + }), + value: "PositionY", + }, ], }, MOVE: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "PRESETSA", default: "center" }), value: "center" }, - { text: Scratch.translate({ id: "PRESETSB", default: "right" }), value: "right" }, - { text: Scratch.translate({ id: "PRESETSC", default: "left" }), value: "left" }, - { text: Scratch.translate({ id: "PRESETSD", default: "top" }), value: "top" }, - { text: Scratch.translate({ id: "PRESETSE", default: "bottom" }), value: "bottom" }, - { text: Scratch.translate({ id: "PRESETSF", default: "top right" }), value: "top right" }, - { text: Scratch.translate({ id: "PRESETSG", default: "top left" }), value: "top left" }, - { text: Scratch.translate({ id: "PRESETSH", default: "bottom right" }), value: "bottom right" }, - { text: Scratch.translate({ id: "PRESETSI", default: "bottom left" }), value: "bottom left" }, + { + text: Scratch.translate({ id: "PRESETSA", default: "center" }), + value: "center", + }, + { + text: Scratch.translate({ id: "PRESETSB", default: "right" }), + value: "right", + }, + { + text: Scratch.translate({ id: "PRESETSC", default: "left" }), + value: "left", + }, + { + text: Scratch.translate({ id: "PRESETSD", default: "top" }), + value: "top", + }, + { + text: Scratch.translate({ id: "PRESETSE", default: "bottom" }), + value: "bottom", + }, + { + text: Scratch.translate({ + id: "PRESETSF", + default: "top right", + }), + value: "top right", + }, + { + text: Scratch.translate({ + id: "PRESETSG", + default: "top left", + }), + value: "top left", + }, + { + text: Scratch.translate({ + id: "PRESETSH", + default: "bottom right", + }), + value: "bottom right", + }, + { + text: Scratch.translate({ + id: "PRESETSI", + default: "bottom left", + }), + value: "bottom left", + }, ], - }, + }, MenuWindowWHXY: { acceptReporters: true, items: [ @@ -551,22 +637,58 @@ innerMenuSetChange: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "innerMenuSetChangeA", default: "set" }), value: "set" }, - { text: Scratch.translate({ id: "innerMenuSetChangeB", default: "change" }), value: "change" }, + { + text: Scratch.translate({ + id: "innerMenuSetChangeA", + default: "set", + }), + value: "set", + }, + { + text: Scratch.translate({ + id: "innerMenuSetChangeB", + default: "change", + }), + value: "change", + }, ], }, innerMenuSetChangeWH: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "innerMenuSetChangeWHA", default: "set" }), value: "set" }, - { text: Scratch.translate({ id: "innerMenuSetChangeWHB", default: "change" }), value: "change" }, + { + text: Scratch.translate({ + id: "innerMenuSetChangeWHA", + default: "set", + }), + value: "set", + }, + { + text: Scratch.translate({ + id: "innerMenuSetChangeWHB", + default: "change", + }), + value: "change", + }, ], }, innerMenuWidthHeight: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "innerMenuWidthHeightA", default: "width" }), value: "width" }, - { text: Scratch.translate({ id: "innerMenuWidthHeightB", default: "height" }), value: "height" }, + { + text: Scratch.translate({ + id: "innerMenuWidthHeightA", + default: "width", + }), + value: "width", + }, + { + text: Scratch.translate({ + id: "innerMenuWidthHeightB", + default: "height", + }), + value: "height", + }, ], }, dimension: { @@ -585,16 +707,46 @@ MenuFEE: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "FullscreenEnter", default: "width" }), value: "Enter" }, - { text: Scratch.translate({ id: "FullscreenExit", default: "height" }), value: "Exit" }, + { + text: Scratch.translate({ + id: "FullscreenEnter", + default: "width", + }), + value: "Enter", + }, + { + text: Scratch.translate({ + id: "FullscreenExit", + default: "height", + }), + value: "Exit", + }, ], }, MenuQuestions: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "MenuQuestionsA", default: "is window touching screen edge" }), value: "A" }, - { text: Scratch.translate({ id: "MenuQuestionsB", default: "is window focused?" }), value: "B" }, - { text: Scratch.translate({ id: "MenuQuestionsC", default: "is window fullscreen?" }), value: "C" }, + { + text: Scratch.translate({ + id: "MenuQuestionsA", + default: "is window touching screen edge", + }), + value: "A", + }, + { + text: Scratch.translate({ + id: "MenuQuestionsB", + default: "is window focused?", + }), + value: "B", + }, + { + text: Scratch.translate({ + id: "MenuQuestionsC", + default: "is window fullscreen?", + }), + value: "C", + }, ], }, MenuScreenWHXY: { @@ -608,11 +760,41 @@ thing: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "thingA", default: "🗲 turbo mode" }), value: "TURBO_MODE" }, - { text: Scratch.translate({ id: "thingB", default: "interpolation" }), value: "INTERPOLATION" }, - { text: Scratch.translate({ id: "thingC", default: "remove fencing" }), value: "REMOVE_FENCING" }, - { text: Scratch.translate({ id: "thingD", default: "remove misc limits" }), value: "REMOVE_MISC_LIMITS" }, - { text: Scratch.translate({ id: "thingE", default: "high quality pen" }), value: "HIGH_QUALITY_PEN" }, + { + text: Scratch.translate({ + id: "thingA", + default: "🗲 turbo mode", + }), + value: "TURBO_MODE", + }, + { + text: Scratch.translate({ + id: "thingB", + default: "interpolation", + }), + value: "INTERPOLATION", + }, + { + text: Scratch.translate({ + id: "thingC", + default: "remove fencing", + }), + value: "REMOVE_FENCING", + }, + { + text: Scratch.translate({ + id: "thingD", + default: "remove misc limits", + }), + value: "REMOVE_MISC_LIMITS", + }, + { + text: Scratch.translate({ + id: "thingE", + default: "high quality pen", + }), + value: "HIGH_QUALITY_PEN", + }, ], }, @@ -654,24 +836,44 @@ SHOWHIDE: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "show", default: "show" }), value: "show" }, - { text: Scratch.translate({ id: "hide", default: "hide" }), value: "hide" }, + { + text: Scratch.translate({ id: "show", default: "show" }), + value: "show", + }, + { + text: Scratch.translate({ id: "hide", default: "hide" }), + value: "hide", + }, ], }, OPTIONSH: { acceptReporters: false, items: [ - { text: Scratch.translate({ id: "flag", default: "flag" }), value: "flag" }, - { text: Scratch.translate({ id: "pause", default: "pause" }), value: "pause" }, - { text: Scratch.translate({ id: "stop", default: "stop" }), value: "stop" }, - { text: Scratch.translate({ id: "fullscreen", default: "fullscreen" }), value: "fullscreen" }, + { + text: Scratch.translate({ id: "flag", default: "flag" }), + value: "flag", + }, + { + text: Scratch.translate({ id: "pause", default: "pause" }), + value: "pause", + }, + { + text: Scratch.translate({ id: "stop", default: "stop" }), + value: "stop", + }, + { + text: Scratch.translate({ + id: "fullscreen", + default: "fullscreen", + }), + value: "fullscreen", + }, ], }, - }, }; } - + getDimension({ dimension }) { if (dimension === "width") { return Scratch.vm.runtime.stageWidth; @@ -687,8 +889,6 @@ Scratch.vm.setStageSize(width, height); } - - MoveWHXY(args) { if (args.SC == "Set") { if (args.WHXY == "WidthHeight") { @@ -708,23 +908,32 @@ innerStageSize(args) { if (args.innerMenuSetChange == "set") { - window.resizeTo(args.innerWidth + (window.outerWidth - window.innerWidth), args.innerHeight + (window.outerHeight - window.innerHeight)); + window.resizeTo( + args.innerWidth + (window.outerWidth - window.innerWidth), + args.innerHeight + (window.outerHeight - window.innerHeight) + ); } else if (args.innerMenuSetChange == "change") { window.resizeBy(args.innerWidth, args.innerHeight); } Scratch.vm.runtime.requestRedraw(); } - + innerStageSizeWidthHeight(args) { if (args.innerMenuSetChangeWH == "set") { if (args.innerMenuWidthHeight == "width") { const innerHeight = window.outerHeight; - window.resizeTo(args.innerWidthHeight + (window.outerWidth - window.innerWidth), innerHeight); + window.resizeTo( + args.innerWidthHeight + (window.outerWidth - window.innerWidth), + innerHeight + ); } else if (args.innerMenuWidthHeight == "height") { const innerWidth = window.outerWidth; - window.resizeTo(innerWidth, args.innerWidthHeight + (window.outerHeight - window.innerHeight)); + window.resizeTo( + innerWidth, + args.innerWidthHeight + (window.outerHeight - window.innerHeight) + ); } - } else if (args.innerMenuSetChangeWH == "change") { + } else if (args.innerMenuSetChangeWH == "change") { if (args.innerMenuWidthHeight == "width") { window.resizeBy(args.innerWidthHeight, 0); } else if (args.innerMenuWidthHeight == "height") { @@ -733,7 +942,7 @@ } Scratch.vm.runtime.requestRedraw(); } - + moveToPresets(args) { if (args.PRESETS == "center") { const left = (screen.width - window.outerWidth) / 2; @@ -882,14 +1091,14 @@ }); } else if (thing === HIGH_QUALITY_PEN) { Scratch.renderer.setUseHighQualityRender(enabled); - } + } } setFramerate({ fps }) { fps = Scratch.Cast.toNumber(fps); Scratch.vm.setFramerate(fps); - } - + } + showHideOption(args) { getButtons(); if (args.SHOWHIDE === "show") { @@ -913,7 +1122,7 @@ fullScreen.style.display = "none"; } } - } + } optionShown(args) { getButtons(); @@ -927,7 +1136,7 @@ return fullScreen.style.display !== "none"; } return false; - } + } } Scratch.extensions.register(new lmsmcutils()); })(Scratch); From a1a73590424aabaaa931508a732c626a4caa29db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 13:44:59 +0300 Subject: [PATCH 03/63] Update 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index 2618802026..d8315f20df 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -2,6 +2,8 @@ // ID: RIHART // Description: Thanks to this extension, you can customize the project window (this works if you package the project in the ".exe" format). // By: RIHART +// License: MIT + // Version: 1.0.0 (function (Scratch) { From e7b08679134fbeee79a2b8b4a0c0994033f37b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 13:53:51 +0300 Subject: [PATCH 04/63] Update 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 93 +++++++++------------- 1 file changed, 36 insertions(+), 57 deletions(-) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index d8315f20df..c87696c62e 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -13,14 +13,14 @@ ru /*_РусскийЯзык_*/: { ExtensionName: "Настройки Окна", LabelA: "Window Settings:", - MoveWHXY: " | | | | окно [SC] [WHXY]: [WHXYA], [WHXYB] | | | | ", + MoveWHXY: "окно [SC] [WHXY]: [WHXYA], [WHXYB]", // [SC]: SCA: "задать", SCB: "изменить", // [WHXY]: WHXYA: "ширину, высоту", WHXYB: "позицию x, позицию y", - WindowSCWH: " | | | | окно [MenuSC] [MenuWH]: [WH] | | | | ", + WindowSCWH: "окно [MenuSC] [MenuWH]: [WH]", // [MenuSC]: MenuSCA: "задать", MenuSCB: "изменить", @@ -29,7 +29,7 @@ MenuWHB: "высоту", MenuWHC: "позицию x", MenuWHD: "позицию y", - moveToPresets: " | | | | переместить окно [PRESETS] | | | | ", + moveToPresets: "переместить окно [PRESETS]", // [PRESETS]: PRESETSA: "по центру", PRESETSB: "справа", @@ -40,15 +40,15 @@ PRESETSG: "в верхнем левом углу", PRESETSH: "в нижнем правом углу", PRESETSI: "в нижнем левом углу", - changeTitleTo: " | | | | задать окну имя [TITLE] | | | | ", - WindowWHXY: " | | | | окно [MenuWindowWHXY] | | | | ", + changeTitleTo: "задать окну имя [TITLE]", + WindowWHXY: "окно [MenuWindowWHXY]", innerStageSize: - " | | | | размер внутренней сцены [innerMenuSetChange] ширину: [innerWidth] высоту: [innerHeight] | | | | ", + "размер внутренней сцены [innerMenuSetChange] ширину: [innerWidth] высоту: [innerHeight]", // [innerMenuSetChange]: innerMenuSetChangeA: "задать", innerMenuSetChangeB: "изменить", innerStageSizeWidthHeight: - " | | | | размер внутренней сцены [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight] | | | | ", + "размер внутренней сцены [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight]", // [innerMenuSetChangeWH]: innerMenuSetChangeWHA: "задать", innerMenuSetChangeWHB: "изменить", @@ -56,21 +56,21 @@ innerMenuWidthHeightA: "ширину", innerMenuWidthHeightB: "высоту", setDimensions: - " | | | | задать сцену по ширине: [width] по высоте: [height] | | | | ", - getDimension: " | | | | сцена [dimension] | | | | ", - greenFlag: " | | | | нажать на флаг [flag] | | | | ", - FullscreenEnterExit: " | | | | полноэкранный режим [MenuFEE] | | | | ", + "задать сцену по ширине: [width] по высоте: [height]", + getDimension: "сцена [dimension]", + greenFlag: "нажать на флаг [flag]", + FullscreenEnterExit: "полноэкранный режим [MenuFEE]", // [MenuFEE]: FullscreenEnter: "включить", FullscreenExit: "выключить", - closeWindow: " | | | | закрыть окно | | | | ", - QuestionsWS: " | | | | [MenuQuestions] | | | | ", + closeWindow: "закрыть окно", + QuestionsWS: "[MenuQuestions]", // [MenuQuestions]: MenuQuestionsA: "касается ли окно края экрана?", MenuQuestionsB: "сфокусировано ли окно?", MenuQuestionsC: "является ли окно полноэкранным?", - ScreenWHXY: " | | | | экран [MenuScreenWHXY] | | | | ", - setEnabled: " | | | | задать [thing] [enabled] | | | | ", + ScreenWHXY: "экран [MenuScreenWHXY]", + setEnabled: "задать [thing] [enabled]", // [thing]: thingA: "🗲 турбо режим", thingB: "интерполяция", @@ -79,8 +79,8 @@ thingE: "перо в высоком качестве", // [enabled]: setFramerate: - " | | | | задать ограничение частоты кадров на: [fps] | | | | ", - showHideOption: " | | | | [SHOWHIDE] [OPTIONSH] | | | | ", + "задать ограничение частоты кадров на: [fps]", + showHideOption: "[SHOWHIDE] [OPTIONSH]", // [SHOWHIDE]: show: "показать", hide: "скрыть", @@ -89,7 +89,7 @@ pause: "иконка паузы", stop: "иконка остановки", fullscreen: "иконка полноэкранного режима", - optionShown: " | | | | [OPTION] показан? | | | | ", + optionShown: "[OPTION] показан?", }, }); @@ -176,7 +176,7 @@ text: Scratch.translate({ id: "MoveWHXY", default: - " | | | | window [SC] [WHXY]: [WHXYA], [WHXYB] | | | | ", + "window [SC] [WHXY]: [WHXYA], [WHXYB]", }), arguments: { SC: { @@ -203,7 +203,7 @@ blockType: Scratch.BlockType.COMMAND, text: Scratch.translate({ id: "WindowSCWH", - default: " | | | | window [MenuSC] [MenuWH]: [WH] | | | | ", + default: "window [MenuSC] [MenuWH]: [WH]", }), arguments: { MenuSC: { @@ -226,7 +226,7 @@ blockType: Scratch.BlockType.COMMAND, text: Scratch.translate({ id: "moveToPresets", - default: " | | | | move window to the [PRESETS] | | | | ", + default: "move window to the [PRESETS]", }), arguments: { PRESETS: { @@ -241,7 +241,7 @@ blockType: Scratch.BlockType.COMMAND, text: Scratch.translate({ id: "changeTitleTo", - default: " | | | | set window title to [TITLE] | | | | ", + default: "set window title to [TITLE]", }), arguments: { TITLE: { @@ -256,7 +256,7 @@ blockType: Scratch.BlockType.REPORTER, text: Scratch.translate({ id: "WindowWHXY", - default: " | | | | window [MenuWindowWHXY] | | | | ", + default: "window [MenuWindowWHXY]", }), arguments: { MenuWindowWHXY: { @@ -274,7 +274,7 @@ text: Scratch.translate({ id: "innerStageSize", default: - " | | | | inner stage size [innerMenuSetChange] width: [innerWidth] height: [innerHeight] | | | | ", + "inner stage size [innerMenuSetChange] width: [innerWidth] height: [innerHeight]", }), arguments: { innerMenuSetChange: { @@ -298,7 +298,7 @@ text: Scratch.translate({ id: "innerStageSizeWidthHeight", default: - " | | | | inner stage size [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight] | | | | ", + "inner stage size [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight]", }), arguments: { innerMenuSetChangeWH: { @@ -322,7 +322,7 @@ text: Scratch.translate({ id: "setDimensions", default: - " | | | | set stage size width: [width] height: [height] | | | | ", + "set stage size width: [width] height: [height]", }), arguments: { width: { @@ -341,7 +341,7 @@ blockType: Scratch.BlockType.REPORTER, text: Scratch.translate({ id: "getDimension", - default: " | | | | stage [dimension] | | | | ", + default: "stage [dimension]", }), arguments: { dimension: { @@ -359,7 +359,7 @@ blockType: Scratch.BlockType.COMMAND, text: Scratch.translate({ id: "greenFlag", - default: " | | | | run flag [flag] | | | | ", + default: "run flag [flag]", }), arguments: { flag: { @@ -374,7 +374,7 @@ blockType: Scratch.BlockType.COMMAND, text: Scratch.translate({ id: "FullscreenEnterExit", - default: " | | | | fullscreen [MenuFEE] | | | | ", + default: "fullscreen [MenuFEE]", }), arguments: { MenuFEE: { @@ -390,7 +390,7 @@ isTerminal: true, text: Scratch.translate({ id: "closeWindow", - default: " | | | | close window | | | | ", + default: "close window", }), }, @@ -399,7 +399,7 @@ blockType: Scratch.BlockType.BOOLEAN, text: Scratch.translate({ id: "QuestionsWS", - default: " | | | | [MenuQuestions] | | | | ", + default: "[MenuQuestions]", }), disableMonitor: true, arguments: { @@ -415,7 +415,7 @@ blockType: Scratch.BlockType.REPORTER, text: Scratch.translate({ id: "ScreenWHXY", - default: " | | | | screen [MenuScreenWHXY] | | | | ", + default: "screen [MenuScreenWHXY]", }), arguments: { MenuScreenWHXY: { @@ -426,34 +426,13 @@ }, "---", - /* - { - opcode: "setEnabled", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "setEnabled", - default: " | | | | set [thing] to [enabled] | | | | " - }), - arguments: { - thing: { - type: Scratch.ArgumentType.STRING, - menu: "thing", - defaultValue: "TURBO_MODE", - }, - enabled: { - type: Scratch.ArgumentType.STRING, - menu: "enabled", - defaultValue: "true", - }, - }, - }, -*/ + { opcode: "setFramerate", blockType: Scratch.BlockType.COMMAND, text: Scratch.translate({ id: "setFramerate", - default: " | | | | set framerate limit to [fps] | | | | ", + default: "set framerate limit to [fps]", }), arguments: { fps: { @@ -470,7 +449,7 @@ blockType: Scratch.BlockType.COMMAND, text: Scratch.translate({ id: "showHideOption", - default: " | | | | [SHOWHIDE] [OPTIONSH] | | | | ", + default: "[SHOWHIDE] [OPTIONSH]", }), arguments: { SHOWHIDE: { @@ -488,7 +467,7 @@ blockType: Scratch.BlockType.BOOLEAN, text: Scratch.translate({ id: "optionShown", - default: " | | | | [OPTION] shown? | | | | ", + default: "[OPTION] shown?", }), arguments: { OPTION: { From a33d0b2d0770e0565c41fa2293d5fc2b4a6c6c72 Mon Sep 17 00:00:00 2001 From: "DangoCat[bot]" Date: Fri, 28 Feb 2025 10:56:02 +0000 Subject: [PATCH 05/63] [Automated] Format code --- extensions/RIHART/Window Settings/1.0.0.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index c87696c62e..cf7be36f4b 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -55,8 +55,7 @@ // [innerMenuWidthHeight]: innerMenuWidthHeightA: "ширину", innerMenuWidthHeightB: "высоту", - setDimensions: - "задать сцену по ширине: [width] по высоте: [height]", + setDimensions: "задать сцену по ширине: [width] по высоте: [height]", getDimension: "сцена [dimension]", greenFlag: "нажать на флаг [flag]", FullscreenEnterExit: "полноэкранный режим [MenuFEE]", @@ -78,8 +77,7 @@ thingD: "убрать разные ограничения", thingE: "перо в высоком качестве", // [enabled]: - setFramerate: - "задать ограничение частоты кадров на: [fps]", + setFramerate: "задать ограничение частоты кадров на: [fps]", showHideOption: "[SHOWHIDE] [OPTIONSH]", // [SHOWHIDE]: show: "показать", @@ -175,8 +173,7 @@ blockType: Scratch.BlockType.COMMAND, text: Scratch.translate({ id: "MoveWHXY", - default: - "window [SC] [WHXY]: [WHXYA], [WHXYB]", + default: "window [SC] [WHXY]: [WHXYA], [WHXYB]", }), arguments: { SC: { @@ -321,8 +318,7 @@ blockType: Scratch.BlockType.COMMAND, text: Scratch.translate({ id: "setDimensions", - default: - "set stage size width: [width] height: [height]", + default: "set stage size width: [width] height: [height]", }), arguments: { width: { @@ -426,7 +422,7 @@ }, "---", - + { opcode: "setFramerate", blockType: Scratch.BlockType.COMMAND, From ea8e1e53bd1e6d4f7c0bff19a5cd1f0554c12c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:03:34 +0300 Subject: [PATCH 06/63] Update 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index cf7be36f4b..967e21af8e 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -9,7 +9,6 @@ (function (Scratch) { "use strict"; - Scratch.translate.setup({ ru /*_РусскийЯзык_*/: { ExtensionName: "Настройки Окна", LabelA: "Window Settings:", @@ -88,8 +87,7 @@ stop: "иконка остановки", fullscreen: "иконка полноэкранного режима", optionShown: "[OPTION] показан?", - }, - }); + },); if (!Scratch.extensions.unsandboxed) { throw new Error("Error"); From e01604f2386170997c763b70750e90538b6350db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:11:26 +0300 Subject: [PATCH 07/63] Update 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index 967e21af8e..3fe1ed2c4f 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -87,7 +87,7 @@ stop: "иконка остановки", fullscreen: "иконка полноэкранного режима", optionShown: "[OPTION] показан?", - },); + }, if (!Scratch.extensions.unsandboxed) { throw new Error("Error"); From 1188bb528be7d86787b26a77e4b95125b4534e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:15:20 +0300 Subject: [PATCH 08/63] Update 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index 3fe1ed2c4f..cf7be36f4b 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -9,6 +9,7 @@ (function (Scratch) { "use strict"; + Scratch.translate.setup({ ru /*_РусскийЯзык_*/: { ExtensionName: "Настройки Окна", LabelA: "Window Settings:", @@ -88,6 +89,7 @@ fullscreen: "иконка полноэкранного режима", optionShown: "[OPTION] показан?", }, + }); if (!Scratch.extensions.unsandboxed) { throw new Error("Error"); From a2c43fb73d19fa52b9d106cf0ec2c53326e31d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:17:09 +0300 Subject: [PATCH 09/63] Update 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index cf7be36f4b..af9ffd1306 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -9,7 +9,7 @@ (function (Scratch) { "use strict"; - Scratch.translate.setup({ + Scratch.translate({ ru /*_РусскийЯзык_*/: { ExtensionName: "Настройки Окна", LabelA: "Window Settings:", From 537c8c76ab5b00458aeb1e1a7c0aa8da84dcff02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:21:50 +0300 Subject: [PATCH 10/63] Update 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index af9ffd1306..c512897c10 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -142,18 +142,6 @@ document.querySelector(".stop-all-button"); }; - class controlcontrols { - constructor() { - Scratch.vm.runtime.on("RUNTIME_DISPOSED", () => { - getButtons(); - for (const button of [fullScreen, greenFlag, pauseButton, stopButton]) { - if (button) { - button.style.display = "block"; - } - } - }); - } - } class lmsmcutils { getInfo() { return { From 5f6b77d6632c302511630c8bf2390108e355e8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:25:58 +0300 Subject: [PATCH 11/63] Update 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index c512897c10..b2bcedca28 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -100,7 +100,6 @@ "data:image/svg+xml,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2294%22%20height%3D%2294%22%20rx%3D%2217%22%20fill%3D%22%234B6095%22%20stroke%3D%22%232D3548%22%20stroke-width%3D%226%22%2F%3E%3Crect%20x%3D%2226%22%20y%3D%2226%22%20width%3D%2248%22%20height%3D%2248%22%20rx%3D%225%22%20stroke%3D%22white%22%20stroke-width%3D%226%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M23%2031C23%2026.5817%2026.5817%2023%2031%2023H69C73.4183%2023%2077%2026.5817%2077%2031V35C77%2039.4183%2073.4183%2043%2069%2043H31C26.5817%2043%2023%2039.4183%2023%2035V31ZM43%2037C45.2091%2037%2047%2035.2091%2047%2033C47%2030.7909%2045.2091%2029%2043%2029C40.7909%2029%2039%2030.7909%2039%2033C39%2035.2091%2040.7909%2037%2043%2037ZM57%2033C57%2035.2091%2055.2091%2037%2053%2037C50.7909%2037%2049%2035.2091%2049%2033C49%2030.7909%2050.7909%2029%2053%2029C55.2091%2029%2057%2030.7909%2057%2033ZM33%2037C35.2091%2037%2037%2035.2091%2037%2033C37%2030.7909%2035.2091%2029%2033%2029C30.7909%2029%2029%2030.7909%2029%2033C29%2035.2091%2030.7909%2037%2033%2037Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E"; // иконки блоков: - const MoveWHXY = "data:image/gif;base64,"; const greenFlagURI = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAxNiAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zIDAuNUMzIDAuMjIzODU4IDIuNzc2MTQgMCAyLjUgMEgxLjVDMC42NzE1NzMgMCAwIDAuNjcxNTczIDAgMS41VjE4LjVDMCAxOS4zMjg0IDAuNjcxNTczIDIwIDEuNSAyMFYyMEMyLjMyODQzIDIwIDMgMTkuMzI4NCAzIDE4LjVWMTVDMyAxMy44OTU0IDMuODk1NDMgMTMgNSAxM0gxNEMxNS4xMDQ2IDEzIDE2IDEyLjEwNDYgMTYgMTFWM0MxNiAxLjg5NTQzIDE1LjEwNDYgMSAxNCAxSDMuNUMzLjIyMzg2IDEgMyAwLjc3NjE0MiAzIDAuNVYwLjVaIiBmaWxsPSIjMTgxRDBEIi8+Cjwvc3ZnPgo="; From 77c34217c4dd8d915420590710e49e544fb62c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:32:25 +0300 Subject: [PATCH 12/63] Create Window Settings.svg --- images/RIHART/Window Settings.svg | 194 ++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 images/RIHART/Window Settings.svg diff --git a/images/RIHART/Window Settings.svg b/images/RIHART/Window Settings.svg new file mode 100644 index 0000000000..f83fe092d7 --- /dev/null +++ b/images/RIHART/Window Settings.svg @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 4e77dc8bf31929edfdc7558e9ab49999574597dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:44:02 +0300 Subject: [PATCH 13/63] Update 1.0.0.js --- extensions/RIHART/Window Settings/1.0.0.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/RIHART/Window Settings/1.0.0.js index b2bcedca28..556709944b 100644 --- a/extensions/RIHART/Window Settings/1.0.0.js +++ b/extensions/RIHART/Window Settings/1.0.0.js @@ -674,14 +674,14 @@ { text: Scratch.translate({ id: "FullscreenEnter", - default: "width", + default: "on", }), value: "Enter", }, { text: Scratch.translate({ id: "FullscreenExit", - default: "height", + default: "off", }), value: "Exit", }, From 02ebdfdd1760b38a757103d26b7cce7021f011f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:57:04 +0300 Subject: [PATCH 14/63] Rename 1.0.0.js to 1.0.0.js --- extensions/{RIHART => WAYLIVES}/Window Settings/1.0.0.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename extensions/{RIHART => WAYLIVES}/Window Settings/1.0.0.js (100%) diff --git a/extensions/RIHART/Window Settings/1.0.0.js b/extensions/WAYLIVES/Window Settings/1.0.0.js similarity index 100% rename from extensions/RIHART/Window Settings/1.0.0.js rename to extensions/WAYLIVES/Window Settings/1.0.0.js From e4e2c9fbf41f7679f5fd4e50980ec897e8b8a2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Fri, 28 Feb 2025 14:57:47 +0300 Subject: [PATCH 15/63] Rename Window Settings.svg to Window Settings.svg --- images/{RIHART => WAYLIVES}/Window Settings.svg | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename images/{RIHART => WAYLIVES}/Window Settings.svg (100%) diff --git a/images/RIHART/Window Settings.svg b/images/WAYLIVES/Window Settings.svg similarity index 100% rename from images/RIHART/Window Settings.svg rename to images/WAYLIVES/Window Settings.svg From db656c4fbdc9405bda3c8cd574b1adff8a77538f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Sat, 1 Mar 2025 15:24:27 +0300 Subject: [PATCH 16/63] Update and rename 1.0.0.js to 2.0.0.js --- extensions/WAYLIVES/Window Settings/{1.0.0.js => 2.0.0.js} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename extensions/WAYLIVES/Window Settings/{1.0.0.js => 2.0.0.js} (99%) diff --git a/extensions/WAYLIVES/Window Settings/1.0.0.js b/extensions/WAYLIVES/Window Settings/2.0.0.js similarity index 99% rename from extensions/WAYLIVES/Window Settings/1.0.0.js rename to extensions/WAYLIVES/Window Settings/2.0.0.js index 556709944b..a641205de5 100644 --- a/extensions/WAYLIVES/Window Settings/1.0.0.js +++ b/extensions/WAYLIVES/Window Settings/2.0.0.js @@ -1,10 +1,10 @@ -// Name: Window Settings +// Name: Window Settings V2 // ID: RIHART // Description: Thanks to this extension, you can customize the project window (this works if you package the project in the ".exe" format). // By: RIHART // License: MIT -// Version: 1.0.0 +// Version: 2.0.0 (function (Scratch) { "use strict"; From 2411fe311d805e943fca77317bec4d9ac40f4275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Sat, 1 Mar 2025 15:27:29 +0300 Subject: [PATCH 17/63] Update 2.0.0.js --- extensions/WAYLIVES/Window Settings/2.0.0.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/WAYLIVES/Window Settings/2.0.0.js b/extensions/WAYLIVES/Window Settings/2.0.0.js index a641205de5..e6b52f6aa3 100644 --- a/extensions/WAYLIVES/Window Settings/2.0.0.js +++ b/extensions/WAYLIVES/Window Settings/2.0.0.js @@ -1,5 +1,5 @@ // Name: Window Settings V2 -// ID: RIHART +// ID: WRWindowSettings // Description: Thanks to this extension, you can customize the project window (this works if you package the project in the ".exe" format). // By: RIHART // License: MIT From 46abee791792865ba4240a257f81689975545db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Sun, 2 Mar 2025 16:39:06 +0300 Subject: [PATCH 18/63] Create 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 391 +++++++++++++++++++++++++++++++ 1 file changed, 391 insertions(+) create mode 100644 extensions/WAYLIVES/SVG/1.0.1.js diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js new file mode 100644 index 0000000000..223600a86d --- /dev/null +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -0,0 +1,391 @@ +// Name: SVG +// ID: WRsvg +// Description: Create SVG elements. +// By: WAYLIVES +// License: MIT + +// Version: 1.0.1 + +(async function(Scratch) { + const variables = {}; + const blocks = []; + const menus = {}; + + + if (!Scratch.extensions.unsandboxed) { + alert("This extension needs to be unsandboxed to run!") + return + } + + function doSound(ab, cd, runtime) { + const audioEngine = runtime.audioEngine; + + const fetchAsArrayBufferWithTimeout = (url) => + new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + let timeout = setTimeout(() => { + xhr.abort(); + reject(new Error("Timed out")); + }, 5000); + xhr.onload = () => { + clearTimeout(timeout); + if (xhr.status === 200) { + resolve(xhr.response); + } else { + reject(new Error(`HTTP error ${xhr.status} while fetching ${url}`)); + } + }; + xhr.onerror = () => { + clearTimeout(timeout); + reject(new Error(`Failed to request ${url}`)); + }; + xhr.responseType = "arraybuffer"; + xhr.open("GET", url); + xhr.send(); + }); + + const soundPlayerCache = new Map(); + + const decodeSoundPlayer = async (url) => { + const cached = soundPlayerCache.get(url); + if (cached) { + if (cached.sound) { + return cached.sound; + } + throw cached.error; + } + + try { + const arrayBuffer = await fetchAsArrayBufferWithTimeout(url); + const soundPlayer = await audioEngine.decodeSoundPlayer({ + data: { + buffer: arrayBuffer, + }, + }); + soundPlayerCache.set(url, { + sound: soundPlayer, + error: null, + }); + return soundPlayer; + } catch (e) { + soundPlayerCache.set(url, { + sound: null, + error: e, + }); + throw e; + } + }; + + const playWithAudioEngine = async (url, target) => { + const soundBank = target.sprite.soundBank; + + let soundPlayer; + try { + const originalSoundPlayer = await decodeSoundPlayer(url); + soundPlayer = originalSoundPlayer.take(); + } catch (e) { + console.warn( + "Could not fetch audio; falling back to primitive approach", + e + ); + return false; + } + + soundBank.addSoundPlayer(soundPlayer); + await soundBank.playSound(target, soundPlayer.id); + + delete soundBank.soundPlayers[soundPlayer.id]; + soundBank.playerTargets.delete(soundPlayer.id); + soundBank.soundEffects.delete(soundPlayer.id); + + return true; + }; + + const playWithAudioElement = (url, target) => + new Promise((resolve, reject) => { + const mediaElement = new Audio(url); + + mediaElement.volume = target.volume / 100; + + mediaElement.onended = () => { + resolve(); + }; + mediaElement + .play() + .then(() => { + // Wait for onended + }) + .catch((err) => { + reject(err); + }); + }); + + const playSound = async (url, target) => { + try { + if (!(await Scratch.canFetch(url))) { + throw new Error(`Permission to fetch ${url} denied`); + } + + const success = await playWithAudioEngine(url, target); + if (!success) { + return await playWithAudioElement(url, target); + } + } catch (e) { + console.warn(`All attempts to play ${url} failed`, e); + } + }; + + playSound(ab, cd) + } + class Extension { + getInfo() { + return { + "id": "extensionID", + "name": "SVG", + "color1": "#9823FF", + "color2": "#7C2DC1", + "tbShow": true, + "blocks": blocks, + "menus": menus + } + } + } + blocks.push({ + opcode: "svg", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]"), + arguments: { + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "ELEMENTS": { + type: Scratch.ArgumentType.STRING, + defaultValue: '', + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["svg"] = async (args, util) => { + variables['svgWidth'] = args["WIDTH"] + variables['svgHeight'] = args["HEIGHT"] + return (('' + args["ELEMENTS"])))))))))))))) + '') + }; + + blocks.push({ + opcode: "line", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]"), + arguments: { + "XA": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "YA": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "XB": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '96', + }, + "YB": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '96', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "COLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "OPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["line"] = async (args, util) => { + return (('') + }; + + blocks.push({ + opcode: "rect", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + arguments: { + "X": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "Y": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "RADIUS": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '20', + }, + "FILLCOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "FILLOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "STROKEWIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "STROKECOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#000000', + }, + "STROKEOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["rect"] = async (args, util) => { + return (('') + }; + + blocks.push({ + opcode: "ellipse", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + arguments: { + "CX": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '50', + }, + "CY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '50', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "FILLCOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "FILLOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "STROKEWIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "STROKECOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#000000', + }, + "STROKEOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["ellipse"] = async (args, util) => { + return (('') + }; + + (0 + 0); + + blocks.push({ + opcode: "svgWidth", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg width"), + arguments: {}, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["svgWidth"] = async (args, util) => { + return variables['svgWidth'] + }; + + blocks.push({ + opcode: "svgHeight", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg height"), + arguments: {}, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["svgHeight"] = async (args, util) => { + return variables['svgHeight'] + }; + + menus["LINECAPmenu"] = { + acceptReporters: true, + items: ["round", "butt", "square"] + } + + Scratch.extensions.register(new Extension()); +})(Scratch); From 1ff413f28dbf47c4091926b1810460615113c724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Sun, 2 Mar 2025 16:43:50 +0300 Subject: [PATCH 19/63] Delete extensions/WAYLIVES/SVG directory --- extensions/WAYLIVES/SVG/1.0.1.js | 391 ------------------------------- 1 file changed, 391 deletions(-) delete mode 100644 extensions/WAYLIVES/SVG/1.0.1.js diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js deleted file mode 100644 index 223600a86d..0000000000 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ /dev/null @@ -1,391 +0,0 @@ -// Name: SVG -// ID: WRsvg -// Description: Create SVG elements. -// By: WAYLIVES -// License: MIT - -// Version: 1.0.1 - -(async function(Scratch) { - const variables = {}; - const blocks = []; - const menus = {}; - - - if (!Scratch.extensions.unsandboxed) { - alert("This extension needs to be unsandboxed to run!") - return - } - - function doSound(ab, cd, runtime) { - const audioEngine = runtime.audioEngine; - - const fetchAsArrayBufferWithTimeout = (url) => - new Promise((resolve, reject) => { - const xhr = new XMLHttpRequest(); - let timeout = setTimeout(() => { - xhr.abort(); - reject(new Error("Timed out")); - }, 5000); - xhr.onload = () => { - clearTimeout(timeout); - if (xhr.status === 200) { - resolve(xhr.response); - } else { - reject(new Error(`HTTP error ${xhr.status} while fetching ${url}`)); - } - }; - xhr.onerror = () => { - clearTimeout(timeout); - reject(new Error(`Failed to request ${url}`)); - }; - xhr.responseType = "arraybuffer"; - xhr.open("GET", url); - xhr.send(); - }); - - const soundPlayerCache = new Map(); - - const decodeSoundPlayer = async (url) => { - const cached = soundPlayerCache.get(url); - if (cached) { - if (cached.sound) { - return cached.sound; - } - throw cached.error; - } - - try { - const arrayBuffer = await fetchAsArrayBufferWithTimeout(url); - const soundPlayer = await audioEngine.decodeSoundPlayer({ - data: { - buffer: arrayBuffer, - }, - }); - soundPlayerCache.set(url, { - sound: soundPlayer, - error: null, - }); - return soundPlayer; - } catch (e) { - soundPlayerCache.set(url, { - sound: null, - error: e, - }); - throw e; - } - }; - - const playWithAudioEngine = async (url, target) => { - const soundBank = target.sprite.soundBank; - - let soundPlayer; - try { - const originalSoundPlayer = await decodeSoundPlayer(url); - soundPlayer = originalSoundPlayer.take(); - } catch (e) { - console.warn( - "Could not fetch audio; falling back to primitive approach", - e - ); - return false; - } - - soundBank.addSoundPlayer(soundPlayer); - await soundBank.playSound(target, soundPlayer.id); - - delete soundBank.soundPlayers[soundPlayer.id]; - soundBank.playerTargets.delete(soundPlayer.id); - soundBank.soundEffects.delete(soundPlayer.id); - - return true; - }; - - const playWithAudioElement = (url, target) => - new Promise((resolve, reject) => { - const mediaElement = new Audio(url); - - mediaElement.volume = target.volume / 100; - - mediaElement.onended = () => { - resolve(); - }; - mediaElement - .play() - .then(() => { - // Wait for onended - }) - .catch((err) => { - reject(err); - }); - }); - - const playSound = async (url, target) => { - try { - if (!(await Scratch.canFetch(url))) { - throw new Error(`Permission to fetch ${url} denied`); - } - - const success = await playWithAudioEngine(url, target); - if (!success) { - return await playWithAudioElement(url, target); - } - } catch (e) { - console.warn(`All attempts to play ${url} failed`, e); - } - }; - - playSound(ab, cd) - } - class Extension { - getInfo() { - return { - "id": "extensionID", - "name": "SVG", - "color1": "#9823FF", - "color2": "#7C2DC1", - "tbShow": true, - "blocks": blocks, - "menus": menus - } - } - } - blocks.push({ - opcode: "svg", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]"), - arguments: { - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "HEIGHT": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "ELEMENTS": { - type: Scratch.ArgumentType.STRING, - defaultValue: '', - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["svg"] = async (args, util) => { - variables['svgWidth'] = args["WIDTH"] - variables['svgHeight'] = args["HEIGHT"] - return (('' + args["ELEMENTS"])))))))))))))) + '') - }; - - blocks.push({ - opcode: "line", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]"), - arguments: { - "XA": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "YA": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "XB": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '96', - }, - "YB": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '96', - }, - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', - }, - "COLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', - }, - "OPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "DASH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "GAP": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "LINECAP": { - type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["line"] = async (args, util) => { - return (('') - }; - - blocks.push({ - opcode: "rect", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), - arguments: { - "X": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "Y": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "HEIGHT": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "RADIUS": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '20', - }, - "FILLCOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', - }, - "FILLOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "STROKEWIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', - }, - "STROKECOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#000000', - }, - "STROKEOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "DASH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "GAP": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "LINECAP": { - type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["rect"] = async (args, util) => { - return (('') - }; - - blocks.push({ - opcode: "ellipse", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), - arguments: { - "CX": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '50', - }, - "CY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '50', - }, - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "HEIGHT": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "FILLCOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', - }, - "FILLOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "STROKEWIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', - }, - "STROKECOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#000000', - }, - "STROKEOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "DASH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "GAP": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "LINECAP": { - type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["ellipse"] = async (args, util) => { - return (('') - }; - - (0 + 0); - - blocks.push({ - opcode: "svgWidth", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg width"), - arguments: {}, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["svgWidth"] = async (args, util) => { - return variables['svgWidth'] - }; - - blocks.push({ - opcode: "svgHeight", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg height"), - arguments: {}, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["svgHeight"] = async (args, util) => { - return variables['svgHeight'] - }; - - menus["LINECAPmenu"] = { - acceptReporters: true, - items: ["round", "butt", "square"] - } - - Scratch.extensions.register(new Extension()); -})(Scratch); From 568253c80f766f55bdfbfb7fbe99c75c40d7ca19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Sun, 2 Mar 2025 18:09:21 +0300 Subject: [PATCH 20/63] Create 1.0.1.js --- .../WAYLIVES/Window Settings/SVG/1.0.1.js | 391 ++++++++++++++++++ 1 file changed, 391 insertions(+) create mode 100644 extensions/WAYLIVES/Window Settings/SVG/1.0.1.js diff --git a/extensions/WAYLIVES/Window Settings/SVG/1.0.1.js b/extensions/WAYLIVES/Window Settings/SVG/1.0.1.js new file mode 100644 index 0000000000..223600a86d --- /dev/null +++ b/extensions/WAYLIVES/Window Settings/SVG/1.0.1.js @@ -0,0 +1,391 @@ +// Name: SVG +// ID: WRsvg +// Description: Create SVG elements. +// By: WAYLIVES +// License: MIT + +// Version: 1.0.1 + +(async function(Scratch) { + const variables = {}; + const blocks = []; + const menus = {}; + + + if (!Scratch.extensions.unsandboxed) { + alert("This extension needs to be unsandboxed to run!") + return + } + + function doSound(ab, cd, runtime) { + const audioEngine = runtime.audioEngine; + + const fetchAsArrayBufferWithTimeout = (url) => + new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + let timeout = setTimeout(() => { + xhr.abort(); + reject(new Error("Timed out")); + }, 5000); + xhr.onload = () => { + clearTimeout(timeout); + if (xhr.status === 200) { + resolve(xhr.response); + } else { + reject(new Error(`HTTP error ${xhr.status} while fetching ${url}`)); + } + }; + xhr.onerror = () => { + clearTimeout(timeout); + reject(new Error(`Failed to request ${url}`)); + }; + xhr.responseType = "arraybuffer"; + xhr.open("GET", url); + xhr.send(); + }); + + const soundPlayerCache = new Map(); + + const decodeSoundPlayer = async (url) => { + const cached = soundPlayerCache.get(url); + if (cached) { + if (cached.sound) { + return cached.sound; + } + throw cached.error; + } + + try { + const arrayBuffer = await fetchAsArrayBufferWithTimeout(url); + const soundPlayer = await audioEngine.decodeSoundPlayer({ + data: { + buffer: arrayBuffer, + }, + }); + soundPlayerCache.set(url, { + sound: soundPlayer, + error: null, + }); + return soundPlayer; + } catch (e) { + soundPlayerCache.set(url, { + sound: null, + error: e, + }); + throw e; + } + }; + + const playWithAudioEngine = async (url, target) => { + const soundBank = target.sprite.soundBank; + + let soundPlayer; + try { + const originalSoundPlayer = await decodeSoundPlayer(url); + soundPlayer = originalSoundPlayer.take(); + } catch (e) { + console.warn( + "Could not fetch audio; falling back to primitive approach", + e + ); + return false; + } + + soundBank.addSoundPlayer(soundPlayer); + await soundBank.playSound(target, soundPlayer.id); + + delete soundBank.soundPlayers[soundPlayer.id]; + soundBank.playerTargets.delete(soundPlayer.id); + soundBank.soundEffects.delete(soundPlayer.id); + + return true; + }; + + const playWithAudioElement = (url, target) => + new Promise((resolve, reject) => { + const mediaElement = new Audio(url); + + mediaElement.volume = target.volume / 100; + + mediaElement.onended = () => { + resolve(); + }; + mediaElement + .play() + .then(() => { + // Wait for onended + }) + .catch((err) => { + reject(err); + }); + }); + + const playSound = async (url, target) => { + try { + if (!(await Scratch.canFetch(url))) { + throw new Error(`Permission to fetch ${url} denied`); + } + + const success = await playWithAudioEngine(url, target); + if (!success) { + return await playWithAudioElement(url, target); + } + } catch (e) { + console.warn(`All attempts to play ${url} failed`, e); + } + }; + + playSound(ab, cd) + } + class Extension { + getInfo() { + return { + "id": "extensionID", + "name": "SVG", + "color1": "#9823FF", + "color2": "#7C2DC1", + "tbShow": true, + "blocks": blocks, + "menus": menus + } + } + } + blocks.push({ + opcode: "svg", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]"), + arguments: { + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "ELEMENTS": { + type: Scratch.ArgumentType.STRING, + defaultValue: '', + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["svg"] = async (args, util) => { + variables['svgWidth'] = args["WIDTH"] + variables['svgHeight'] = args["HEIGHT"] + return (('' + args["ELEMENTS"])))))))))))))) + '') + }; + + blocks.push({ + opcode: "line", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]"), + arguments: { + "XA": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "YA": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "XB": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '96', + }, + "YB": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '96', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "COLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "OPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["line"] = async (args, util) => { + return (('') + }; + + blocks.push({ + opcode: "rect", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + arguments: { + "X": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "Y": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "RADIUS": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '20', + }, + "FILLCOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "FILLOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "STROKEWIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "STROKECOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#000000', + }, + "STROKEOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["rect"] = async (args, util) => { + return (('') + }; + + blocks.push({ + opcode: "ellipse", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + arguments: { + "CX": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '50', + }, + "CY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '50', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "FILLCOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "FILLOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "STROKEWIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "STROKECOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#000000', + }, + "STROKEOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["ellipse"] = async (args, util) => { + return (('') + }; + + (0 + 0); + + blocks.push({ + opcode: "svgWidth", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg width"), + arguments: {}, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["svgWidth"] = async (args, util) => { + return variables['svgWidth'] + }; + + blocks.push({ + opcode: "svgHeight", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg height"), + arguments: {}, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["svgHeight"] = async (args, util) => { + return variables['svgHeight'] + }; + + menus["LINECAPmenu"] = { + acceptReporters: true, + items: ["round", "butt", "square"] + } + + Scratch.extensions.register(new Extension()); +})(Scratch); From 8331ebdc3ebcf12610e2308587b0f2329b658f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Sun, 2 Mar 2025 18:10:57 +0300 Subject: [PATCH 21/63] Delete extensions/WAYLIVES/Window Settings/SVG directory --- .../WAYLIVES/Window Settings/SVG/1.0.1.js | 391 ------------------ 1 file changed, 391 deletions(-) delete mode 100644 extensions/WAYLIVES/Window Settings/SVG/1.0.1.js diff --git a/extensions/WAYLIVES/Window Settings/SVG/1.0.1.js b/extensions/WAYLIVES/Window Settings/SVG/1.0.1.js deleted file mode 100644 index 223600a86d..0000000000 --- a/extensions/WAYLIVES/Window Settings/SVG/1.0.1.js +++ /dev/null @@ -1,391 +0,0 @@ -// Name: SVG -// ID: WRsvg -// Description: Create SVG elements. -// By: WAYLIVES -// License: MIT - -// Version: 1.0.1 - -(async function(Scratch) { - const variables = {}; - const blocks = []; - const menus = {}; - - - if (!Scratch.extensions.unsandboxed) { - alert("This extension needs to be unsandboxed to run!") - return - } - - function doSound(ab, cd, runtime) { - const audioEngine = runtime.audioEngine; - - const fetchAsArrayBufferWithTimeout = (url) => - new Promise((resolve, reject) => { - const xhr = new XMLHttpRequest(); - let timeout = setTimeout(() => { - xhr.abort(); - reject(new Error("Timed out")); - }, 5000); - xhr.onload = () => { - clearTimeout(timeout); - if (xhr.status === 200) { - resolve(xhr.response); - } else { - reject(new Error(`HTTP error ${xhr.status} while fetching ${url}`)); - } - }; - xhr.onerror = () => { - clearTimeout(timeout); - reject(new Error(`Failed to request ${url}`)); - }; - xhr.responseType = "arraybuffer"; - xhr.open("GET", url); - xhr.send(); - }); - - const soundPlayerCache = new Map(); - - const decodeSoundPlayer = async (url) => { - const cached = soundPlayerCache.get(url); - if (cached) { - if (cached.sound) { - return cached.sound; - } - throw cached.error; - } - - try { - const arrayBuffer = await fetchAsArrayBufferWithTimeout(url); - const soundPlayer = await audioEngine.decodeSoundPlayer({ - data: { - buffer: arrayBuffer, - }, - }); - soundPlayerCache.set(url, { - sound: soundPlayer, - error: null, - }); - return soundPlayer; - } catch (e) { - soundPlayerCache.set(url, { - sound: null, - error: e, - }); - throw e; - } - }; - - const playWithAudioEngine = async (url, target) => { - const soundBank = target.sprite.soundBank; - - let soundPlayer; - try { - const originalSoundPlayer = await decodeSoundPlayer(url); - soundPlayer = originalSoundPlayer.take(); - } catch (e) { - console.warn( - "Could not fetch audio; falling back to primitive approach", - e - ); - return false; - } - - soundBank.addSoundPlayer(soundPlayer); - await soundBank.playSound(target, soundPlayer.id); - - delete soundBank.soundPlayers[soundPlayer.id]; - soundBank.playerTargets.delete(soundPlayer.id); - soundBank.soundEffects.delete(soundPlayer.id); - - return true; - }; - - const playWithAudioElement = (url, target) => - new Promise((resolve, reject) => { - const mediaElement = new Audio(url); - - mediaElement.volume = target.volume / 100; - - mediaElement.onended = () => { - resolve(); - }; - mediaElement - .play() - .then(() => { - // Wait for onended - }) - .catch((err) => { - reject(err); - }); - }); - - const playSound = async (url, target) => { - try { - if (!(await Scratch.canFetch(url))) { - throw new Error(`Permission to fetch ${url} denied`); - } - - const success = await playWithAudioEngine(url, target); - if (!success) { - return await playWithAudioElement(url, target); - } - } catch (e) { - console.warn(`All attempts to play ${url} failed`, e); - } - }; - - playSound(ab, cd) - } - class Extension { - getInfo() { - return { - "id": "extensionID", - "name": "SVG", - "color1": "#9823FF", - "color2": "#7C2DC1", - "tbShow": true, - "blocks": blocks, - "menus": menus - } - } - } - blocks.push({ - opcode: "svg", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]"), - arguments: { - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "HEIGHT": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "ELEMENTS": { - type: Scratch.ArgumentType.STRING, - defaultValue: '', - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["svg"] = async (args, util) => { - variables['svgWidth'] = args["WIDTH"] - variables['svgHeight'] = args["HEIGHT"] - return (('' + args["ELEMENTS"])))))))))))))) + '') - }; - - blocks.push({ - opcode: "line", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]"), - arguments: { - "XA": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "YA": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "XB": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '96', - }, - "YB": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '96', - }, - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', - }, - "COLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', - }, - "OPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "DASH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "GAP": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "LINECAP": { - type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["line"] = async (args, util) => { - return (('') - }; - - blocks.push({ - opcode: "rect", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), - arguments: { - "X": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "Y": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "HEIGHT": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "RADIUS": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '20', - }, - "FILLCOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', - }, - "FILLOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "STROKEWIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', - }, - "STROKECOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#000000', - }, - "STROKEOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "DASH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "GAP": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "LINECAP": { - type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["rect"] = async (args, util) => { - return (('') - }; - - blocks.push({ - opcode: "ellipse", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), - arguments: { - "CX": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '50', - }, - "CY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '50', - }, - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "HEIGHT": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "FILLCOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', - }, - "FILLOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "STROKEWIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', - }, - "STROKECOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#000000', - }, - "STROKEOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "DASH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "GAP": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "LINECAP": { - type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["ellipse"] = async (args, util) => { - return (('') - }; - - (0 + 0); - - blocks.push({ - opcode: "svgWidth", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg width"), - arguments: {}, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["svgWidth"] = async (args, util) => { - return variables['svgWidth'] - }; - - blocks.push({ - opcode: "svgHeight", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg height"), - arguments: {}, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["svgHeight"] = async (args, util) => { - return variables['svgHeight'] - }; - - menus["LINECAPmenu"] = { - acceptReporters: true, - items: ["round", "butt", "square"] - } - - Scratch.extensions.register(new Extension()); -})(Scratch); From bf6a38fdd09d6201c60428ff6a0b14f3892f4cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Sun, 2 Mar 2025 18:11:23 +0300 Subject: [PATCH 22/63] Create 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 391 +++++++++++++++++++++++++++++++ 1 file changed, 391 insertions(+) create mode 100644 extensions/WAYLIVES/SVG/1.0.1.js diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js new file mode 100644 index 0000000000..223600a86d --- /dev/null +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -0,0 +1,391 @@ +// Name: SVG +// ID: WRsvg +// Description: Create SVG elements. +// By: WAYLIVES +// License: MIT + +// Version: 1.0.1 + +(async function(Scratch) { + const variables = {}; + const blocks = []; + const menus = {}; + + + if (!Scratch.extensions.unsandboxed) { + alert("This extension needs to be unsandboxed to run!") + return + } + + function doSound(ab, cd, runtime) { + const audioEngine = runtime.audioEngine; + + const fetchAsArrayBufferWithTimeout = (url) => + new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + let timeout = setTimeout(() => { + xhr.abort(); + reject(new Error("Timed out")); + }, 5000); + xhr.onload = () => { + clearTimeout(timeout); + if (xhr.status === 200) { + resolve(xhr.response); + } else { + reject(new Error(`HTTP error ${xhr.status} while fetching ${url}`)); + } + }; + xhr.onerror = () => { + clearTimeout(timeout); + reject(new Error(`Failed to request ${url}`)); + }; + xhr.responseType = "arraybuffer"; + xhr.open("GET", url); + xhr.send(); + }); + + const soundPlayerCache = new Map(); + + const decodeSoundPlayer = async (url) => { + const cached = soundPlayerCache.get(url); + if (cached) { + if (cached.sound) { + return cached.sound; + } + throw cached.error; + } + + try { + const arrayBuffer = await fetchAsArrayBufferWithTimeout(url); + const soundPlayer = await audioEngine.decodeSoundPlayer({ + data: { + buffer: arrayBuffer, + }, + }); + soundPlayerCache.set(url, { + sound: soundPlayer, + error: null, + }); + return soundPlayer; + } catch (e) { + soundPlayerCache.set(url, { + sound: null, + error: e, + }); + throw e; + } + }; + + const playWithAudioEngine = async (url, target) => { + const soundBank = target.sprite.soundBank; + + let soundPlayer; + try { + const originalSoundPlayer = await decodeSoundPlayer(url); + soundPlayer = originalSoundPlayer.take(); + } catch (e) { + console.warn( + "Could not fetch audio; falling back to primitive approach", + e + ); + return false; + } + + soundBank.addSoundPlayer(soundPlayer); + await soundBank.playSound(target, soundPlayer.id); + + delete soundBank.soundPlayers[soundPlayer.id]; + soundBank.playerTargets.delete(soundPlayer.id); + soundBank.soundEffects.delete(soundPlayer.id); + + return true; + }; + + const playWithAudioElement = (url, target) => + new Promise((resolve, reject) => { + const mediaElement = new Audio(url); + + mediaElement.volume = target.volume / 100; + + mediaElement.onended = () => { + resolve(); + }; + mediaElement + .play() + .then(() => { + // Wait for onended + }) + .catch((err) => { + reject(err); + }); + }); + + const playSound = async (url, target) => { + try { + if (!(await Scratch.canFetch(url))) { + throw new Error(`Permission to fetch ${url} denied`); + } + + const success = await playWithAudioEngine(url, target); + if (!success) { + return await playWithAudioElement(url, target); + } + } catch (e) { + console.warn(`All attempts to play ${url} failed`, e); + } + }; + + playSound(ab, cd) + } + class Extension { + getInfo() { + return { + "id": "extensionID", + "name": "SVG", + "color1": "#9823FF", + "color2": "#7C2DC1", + "tbShow": true, + "blocks": blocks, + "menus": menus + } + } + } + blocks.push({ + opcode: "svg", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]"), + arguments: { + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "ELEMENTS": { + type: Scratch.ArgumentType.STRING, + defaultValue: '', + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["svg"] = async (args, util) => { + variables['svgWidth'] = args["WIDTH"] + variables['svgHeight'] = args["HEIGHT"] + return (('' + args["ELEMENTS"])))))))))))))) + '') + }; + + blocks.push({ + opcode: "line", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]"), + arguments: { + "XA": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "YA": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "XB": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '96', + }, + "YB": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '96', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "COLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "OPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["line"] = async (args, util) => { + return (('') + }; + + blocks.push({ + opcode: "rect", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + arguments: { + "X": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "Y": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "RADIUS": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '20', + }, + "FILLCOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "FILLOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "STROKEWIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "STROKECOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#000000', + }, + "STROKEOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["rect"] = async (args, util) => { + return (('') + }; + + blocks.push({ + opcode: "ellipse", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + arguments: { + "CX": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '50', + }, + "CY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '50', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "FILLCOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "FILLOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "STROKEWIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "STROKECOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#000000', + }, + "STROKEOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["ellipse"] = async (args, util) => { + return (('') + }; + + (0 + 0); + + blocks.push({ + opcode: "svgWidth", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg width"), + arguments: {}, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["svgWidth"] = async (args, util) => { + return variables['svgWidth'] + }; + + blocks.push({ + opcode: "svgHeight", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg height"), + arguments: {}, + disableMonitor: true, + isEdgeActivated: false + }); + Extension.prototype["svgHeight"] = async (args, util) => { + return variables['svgHeight'] + }; + + menus["LINECAPmenu"] = { + acceptReporters: true, + items: ["round", "butt", "square"] + } + + Scratch.extensions.register(new Extension()); +})(Scratch); From e19854544bf334375c56ccd7e989ea600a42cc00 Mon Sep 17 00:00:00 2001 From: "DangoCat[bot]" Date: Sun, 2 Mar 2025 15:18:36 +0000 Subject: [PATCH 23/63] [Automated] Format code --- extensions/WAYLIVES/SVG/1.0.1.js | 812 +++++++++++++++++-------------- 1 file changed, 456 insertions(+), 356 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 223600a86d..7e82b972d2 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -6,386 +6,486 @@ // Version: 1.0.1 -(async function(Scratch) { - const variables = {}; - const blocks = []; - const menus = {}; +(async function (Scratch) { + const variables = {}; + const blocks = []; + const menus = {}; + if (!Scratch.extensions.unsandboxed) { + alert("This extension needs to be unsandboxed to run!"); + return; + } - if (!Scratch.extensions.unsandboxed) { - alert("This extension needs to be unsandboxed to run!") - return - } - - function doSound(ab, cd, runtime) { - const audioEngine = runtime.audioEngine; - - const fetchAsArrayBufferWithTimeout = (url) => - new Promise((resolve, reject) => { - const xhr = new XMLHttpRequest(); - let timeout = setTimeout(() => { - xhr.abort(); - reject(new Error("Timed out")); - }, 5000); - xhr.onload = () => { - clearTimeout(timeout); - if (xhr.status === 200) { - resolve(xhr.response); - } else { - reject(new Error(`HTTP error ${xhr.status} while fetching ${url}`)); - } - }; - xhr.onerror = () => { - clearTimeout(timeout); - reject(new Error(`Failed to request ${url}`)); - }; - xhr.responseType = "arraybuffer"; - xhr.open("GET", url); - xhr.send(); - }); + function doSound(ab, cd, runtime) { + const audioEngine = runtime.audioEngine; - const soundPlayerCache = new Map(); - - const decodeSoundPlayer = async (url) => { - const cached = soundPlayerCache.get(url); - if (cached) { - if (cached.sound) { - return cached.sound; - } - throw cached.error; - } - - try { - const arrayBuffer = await fetchAsArrayBufferWithTimeout(url); - const soundPlayer = await audioEngine.decodeSoundPlayer({ - data: { - buffer: arrayBuffer, - }, - }); - soundPlayerCache.set(url, { - sound: soundPlayer, - error: null, - }); - return soundPlayer; - } catch (e) { - soundPlayerCache.set(url, { - sound: null, - error: e, - }); - throw e; - } + const fetchAsArrayBufferWithTimeout = (url) => + new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + let timeout = setTimeout(() => { + xhr.abort(); + reject(new Error("Timed out")); + }, 5000); + xhr.onload = () => { + clearTimeout(timeout); + if (xhr.status === 200) { + resolve(xhr.response); + } else { + reject(new Error(`HTTP error ${xhr.status} while fetching ${url}`)); + } + }; + xhr.onerror = () => { + clearTimeout(timeout); + reject(new Error(`Failed to request ${url}`)); }; + xhr.responseType = "arraybuffer"; + xhr.open("GET", url); + xhr.send(); + }); - const playWithAudioEngine = async (url, target) => { - const soundBank = target.sprite.soundBank; + const soundPlayerCache = new Map(); - let soundPlayer; - try { - const originalSoundPlayer = await decodeSoundPlayer(url); - soundPlayer = originalSoundPlayer.take(); - } catch (e) { - console.warn( - "Could not fetch audio; falling back to primitive approach", - e - ); - return false; - } + const decodeSoundPlayer = async (url) => { + const cached = soundPlayerCache.get(url); + if (cached) { + if (cached.sound) { + return cached.sound; + } + throw cached.error; + } - soundBank.addSoundPlayer(soundPlayer); - await soundBank.playSound(target, soundPlayer.id); + try { + const arrayBuffer = await fetchAsArrayBufferWithTimeout(url); + const soundPlayer = await audioEngine.decodeSoundPlayer({ + data: { + buffer: arrayBuffer, + }, + }); + soundPlayerCache.set(url, { + sound: soundPlayer, + error: null, + }); + return soundPlayer; + } catch (e) { + soundPlayerCache.set(url, { + sound: null, + error: e, + }); + throw e; + } + }; - delete soundBank.soundPlayers[soundPlayer.id]; - soundBank.playerTargets.delete(soundPlayer.id); - soundBank.soundEffects.delete(soundPlayer.id); + const playWithAudioEngine = async (url, target) => { + const soundBank = target.sprite.soundBank; - return true; - }; + let soundPlayer; + try { + const originalSoundPlayer = await decodeSoundPlayer(url); + soundPlayer = originalSoundPlayer.take(); + } catch (e) { + console.warn( + "Could not fetch audio; falling back to primitive approach", + e + ); + return false; + } - const playWithAudioElement = (url, target) => - new Promise((resolve, reject) => { - const mediaElement = new Audio(url); + soundBank.addSoundPlayer(soundPlayer); + await soundBank.playSound(target, soundPlayer.id); - mediaElement.volume = target.volume / 100; + delete soundBank.soundPlayers[soundPlayer.id]; + soundBank.playerTargets.delete(soundPlayer.id); + soundBank.soundEffects.delete(soundPlayer.id); - mediaElement.onended = () => { - resolve(); - }; - mediaElement - .play() - .then(() => { - // Wait for onended - }) - .catch((err) => { - reject(err); - }); - }); + return true; + }; + + const playWithAudioElement = (url, target) => + new Promise((resolve, reject) => { + const mediaElement = new Audio(url); - const playSound = async (url, target) => { - try { - if (!(await Scratch.canFetch(url))) { - throw new Error(`Permission to fetch ${url} denied`); - } + mediaElement.volume = target.volume / 100; - const success = await playWithAudioEngine(url, target); - if (!success) { - return await playWithAudioElement(url, target); - } - } catch (e) { - console.warn(`All attempts to play ${url} failed`, e); - } + mediaElement.onended = () => { + resolve(); }; + mediaElement + .play() + .then(() => { + // Wait for onended + }) + .catch((err) => { + reject(err); + }); + }); - playSound(ab, cd) - } - class Extension { - getInfo() { - return { - "id": "extensionID", - "name": "SVG", - "color1": "#9823FF", - "color2": "#7C2DC1", - "tbShow": true, - "blocks": blocks, - "menus": menus - } + const playSound = async (url, target) => { + try { + if (!(await Scratch.canFetch(url))) { + throw new Error(`Permission to fetch ${url} denied`); } - } - blocks.push({ - opcode: "svg", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]"), - arguments: { - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "HEIGHT": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "ELEMENTS": { - type: Scratch.ArgumentType.STRING, - defaultValue: '', - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["svg"] = async (args, util) => { - variables['svgWidth'] = args["WIDTH"] - variables['svgHeight'] = args["HEIGHT"] - return (('' + args["ELEMENTS"])))))))))))))) + '') - }; - blocks.push({ - opcode: "line", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]"), - arguments: { - "XA": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "YA": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "XB": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '96', - }, - "YB": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '96', - }, - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', - }, - "COLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', - }, - "OPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "DASH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "GAP": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "LINECAP": { - type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["line"] = async (args, util) => { - return (('') + const success = await playWithAudioEngine(url, target); + if (!success) { + return await playWithAudioElement(url, target); + } + } catch (e) { + console.warn(`All attempts to play ${url} failed`, e); + } }; - blocks.push({ - opcode: "rect", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), - arguments: { - "X": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "Y": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', - }, - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "HEIGHT": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "RADIUS": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '20', - }, - "FILLCOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', - }, - "FILLOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "STROKEWIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', - }, - "STROKECOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#000000', - }, - "STROKEOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "DASH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "GAP": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "LINECAP": { - type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["rect"] = async (args, util) => { - return (('') - }; + playSound(ab, cd); + } + class Extension { + getInfo() { + return { + id: "extensionID", + name: "SVG", + color1: "#9823FF", + color2: "#7C2DC1", + tbShow: true, + blocks: blocks, + menus: menus, + }; + } + } + blocks.push({ + opcode: "svg", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate( + "SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]" + ), + arguments: { + WIDTH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "100", + }, + HEIGHT: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "100", + }, + ELEMENTS: { + type: Scratch.ArgumentType.STRING, + defaultValue: "", + }, + }, + disableMonitor: true, + isEdgeActivated: false, + }); + Extension.prototype["svg"] = async (args, util) => { + variables["svgWidth"] = args["WIDTH"]; + variables["svgHeight"] = args["HEIGHT"]; + return ( + '' + args["ELEMENTS"]))))))))))))) + + "" + ); + }; - blocks.push({ - opcode: "ellipse", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), - arguments: { - "CX": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '50', - }, - "CY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '50', - }, - "WIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "HEIGHT": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', - }, - "FILLCOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', - }, - "FILLOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "STROKEWIDTH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', - }, - "STROKECOLOR": { - type: Scratch.ArgumentType.COLOR, - defaultValue: '#000000', - }, - "STROKEOPACITY": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', - }, - "DASH": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "GAP": { - type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', - }, - "LINECAP": { - type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - }, - }, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["ellipse"] = async (args, util) => { - return (('') - }; + blocks.push({ + opcode: "line", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate( + "LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]" + ), + arguments: { + XA: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "4", + }, + YA: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "4", + }, + XB: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "96", + }, + YB: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "96", + }, + WIDTH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "8", + }, + COLOR: { + type: Scratch.ArgumentType.COLOR, + defaultValue: "#ff0000", + }, + OPACITY: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "100", + }, + DASH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "0", + }, + GAP: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "0", + }, + LINECAP: { + type: Scratch.ArgumentType.STRING, + menu: "LINECAPmenu", + }, + }, + disableMonitor: true, + isEdgeActivated: false, + }); + Extension.prototype["line"] = async (args, util) => { + return ( + '" + ); + }; - (0 + 0); + blocks.push({ + opcode: "rect", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate( + "RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" + ), + arguments: { + X: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "4", + }, + Y: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "4", + }, + WIDTH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "92", + }, + HEIGHT: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "92", + }, + RADIUS: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "20", + }, + FILLCOLOR: { + type: Scratch.ArgumentType.COLOR, + defaultValue: "#ff0000", + }, + FILLOPACITY: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "100", + }, + STROKEWIDTH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "8", + }, + STROKECOLOR: { + type: Scratch.ArgumentType.COLOR, + defaultValue: "#000000", + }, + STROKEOPACITY: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "100", + }, + DASH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "0", + }, + GAP: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "0", + }, + LINECAP: { + type: Scratch.ArgumentType.STRING, + menu: "LINECAPmenu", + }, + }, + disableMonitor: true, + isEdgeActivated: false, + }); + Extension.prototype["rect"] = async (args, util) => { + return ( + '" + ); + }; - blocks.push({ - opcode: "svgWidth", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg width"), - arguments: {}, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["svgWidth"] = async (args, util) => { - return variables['svgWidth'] - }; + blocks.push({ + opcode: "ellipse", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate( + "ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" + ), + arguments: { + CX: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "50", + }, + CY: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "50", + }, + WIDTH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "92", + }, + HEIGHT: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "92", + }, + FILLCOLOR: { + type: Scratch.ArgumentType.COLOR, + defaultValue: "#ff0000", + }, + FILLOPACITY: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "100", + }, + STROKEWIDTH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "8", + }, + STROKECOLOR: { + type: Scratch.ArgumentType.COLOR, + defaultValue: "#000000", + }, + STROKEOPACITY: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "100", + }, + DASH: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "0", + }, + GAP: { + type: Scratch.ArgumentType.NUMBER, + defaultValue: "0", + }, + LINECAP: { + type: Scratch.ArgumentType.STRING, + menu: "LINECAPmenu", + }, + }, + disableMonitor: true, + isEdgeActivated: false, + }); + Extension.prototype["ellipse"] = async (args, util) => { + return ( + '" + ); + }; - blocks.push({ - opcode: "svgHeight", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg height"), - arguments: {}, - disableMonitor: true, - isEdgeActivated: false - }); - Extension.prototype["svgHeight"] = async (args, util) => { - return variables['svgHeight'] - }; + 0 + 0; - menus["LINECAPmenu"] = { - acceptReporters: true, - items: ["round", "butt", "square"] - } + blocks.push({ + opcode: "svgWidth", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg width"), + arguments: {}, + disableMonitor: true, + isEdgeActivated: false, + }); + Extension.prototype["svgWidth"] = async (args, util) => { + return variables["svgWidth"]; + }; + + blocks.push({ + opcode: "svgHeight", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg height"), + arguments: {}, + disableMonitor: true, + isEdgeActivated: false, + }); + Extension.prototype["svgHeight"] = async (args, util) => { + return variables["svgHeight"]; + }; + + menus["LINECAPmenu"] = { + acceptReporters: true, + items: ["round", "butt", "square"], + }; - Scratch.extensions.register(new Extension()); + Scratch.extensions.register(new Extension()); })(Scratch); From 90d23ab2fbd923286550e7fe470bf43620cdf004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Mon, 3 Mar 2025 11:44:03 +0300 Subject: [PATCH 24/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 717 +++++++++++-------------------- 1 file changed, 244 insertions(+), 473 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 7e82b972d2..c6843ddc70 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -6,486 +6,257 @@ // Version: 1.0.1 -(async function (Scratch) { - const variables = {}; - const blocks = []; - const menus = {}; +(function(Scratch) { + 'use strict'; if (!Scratch.extensions.unsandboxed) { - alert("This extension needs to be unsandboxed to run!"); - return; + throw new Error('This example must run unsandboxed'); } - function doSound(ab, cd, runtime) { - const audioEngine = runtime.audioEngine; - - const fetchAsArrayBufferWithTimeout = (url) => - new Promise((resolve, reject) => { - const xhr = new XMLHttpRequest(); - let timeout = setTimeout(() => { - xhr.abort(); - reject(new Error("Timed out")); - }, 5000); - xhr.onload = () => { - clearTimeout(timeout); - if (xhr.status === 200) { - resolve(xhr.response); - } else { - reject(new Error(`HTTP error ${xhr.status} while fetching ${url}`)); - } - }; - xhr.onerror = () => { - clearTimeout(timeout); - reject(new Error(`Failed to request ${url}`)); - }; - xhr.responseType = "arraybuffer"; - xhr.open("GET", url); - xhr.send(); - }); - - const soundPlayerCache = new Map(); - - const decodeSoundPlayer = async (url) => { - const cached = soundPlayerCache.get(url); - if (cached) { - if (cached.sound) { - return cached.sound; - } - throw cached.error; - } - - try { - const arrayBuffer = await fetchAsArrayBufferWithTimeout(url); - const soundPlayer = await audioEngine.decodeSoundPlayer({ - data: { - buffer: arrayBuffer, - }, - }); - soundPlayerCache.set(url, { - sound: soundPlayer, - error: null, - }); - return soundPlayer; - } catch (e) { - soundPlayerCache.set(url, { - sound: null, - error: e, - }); - throw e; - } - }; - - const playWithAudioEngine = async (url, target) => { - const soundBank = target.sprite.soundBank; - - let soundPlayer; - try { - const originalSoundPlayer = await decodeSoundPlayer(url); - soundPlayer = originalSoundPlayer.take(); - } catch (e) { - console.warn( - "Could not fetch audio; falling back to primitive approach", - e - ); - return false; - } - - soundBank.addSoundPlayer(soundPlayer); - await soundBank.playSound(target, soundPlayer.id); - - delete soundBank.soundPlayers[soundPlayer.id]; - soundBank.playerTargets.delete(soundPlayer.id); - soundBank.soundEffects.delete(soundPlayer.id); - - return true; - }; - - const playWithAudioElement = (url, target) => - new Promise((resolve, reject) => { - const mediaElement = new Audio(url); - - mediaElement.volume = target.volume / 100; - - mediaElement.onended = () => { - resolve(); - }; - mediaElement - .play() - .then(() => { - // Wait for onended - }) - .catch((err) => { - reject(err); - }); - }); - - const playSound = async (url, target) => { - try { - if (!(await Scratch.canFetch(url))) { - throw new Error(`Permission to fetch ${url} denied`); - } - - const success = await playWithAudioEngine(url, target); - if (!success) { - return await playWithAudioElement(url, target); - } - } catch (e) { - console.warn(`All attempts to play ${url} failed`, e); - } - }; - - playSound(ab, cd); - } - class Extension { + class svg { getInfo() { return { - id: "extensionID", - name: "SVG", - color1: "#9823FF", - color2: "#7C2DC1", - tbShow: true, - blocks: blocks, - menus: menus, + id: 'svg', + name: 'SVG', + color1: '#9823FF', + color2: '#7C2DC1', + color3: '#2D3548', + blocks: [ + { + opcode: "svg", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]"), + arguments: { + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "ELEMENTS": { + type: Scratch.ArgumentType.STRING, + defaultValue: '', + } + } + }, + + "---", + + { + opcode: "line", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]"), + arguments: { + "XA": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "YA": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "XB": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '96', + }, + "YB": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '96', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "COLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "OPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + }, + }, + }, + + { + opcode: "rect", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + arguments: { + "X": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "Y": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '4', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "RADIUS": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '20', + }, + "FILLCOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "FILLOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "STROKEWIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "STROKECOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#000000', + }, + "STROKEOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + } + } + }, + + { + opcode: "ellipse", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + arguments: { + "CX": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '50', + }, + "CY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '50', + }, + "WIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "HEIGHT": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '92', + }, + "FILLCOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#ff0000', + }, + "FILLOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "STROKEWIDTH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '8', + }, + "STROKECOLOR": { + type: Scratch.ArgumentType.COLOR, + defaultValue: '#000000', + }, + "STROKEOPACITY": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '100', + }, + "DASH": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "GAP": { + type: Scratch.ArgumentType.NUMBER, + defaultValue: '0', + }, + "LINECAP": { + type: Scratch.ArgumentType.STRING, + menu: 'LINECAPmenu' + } + } + }, + + "---", + + /*{ + opcode: "svgWidth", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg width"), + }, + + { + opcode: "svgHeight", + blockType: Scratch.BlockType.REPORTER, + text: Scratch.translate("svg height"), + },*/ + + ], + menus: { + LINECAPmenu: { + acceptReporters: true, + items: ['round', 'butt', 'square'] + }, + } }; } + + svg(args) { + return (('' + args["ELEMENTS"])))))))))))))) + '') + } + + line(args) { + return (('') + } + + rect(args){ + return (('') + } + + ellipse(args) { + return (('') + } + + svgWidth(args) { + return variables['svgWidth'] + } + + svgHeight(args) { + return variables['svgHeight'] + } + } - blocks.push({ - opcode: "svg", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate( - "SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]" - ), - arguments: { - WIDTH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "100", - }, - HEIGHT: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "100", - }, - ELEMENTS: { - type: Scratch.ArgumentType.STRING, - defaultValue: "", - }, - }, - disableMonitor: true, - isEdgeActivated: false, - }); - Extension.prototype["svg"] = async (args, util) => { - variables["svgWidth"] = args["WIDTH"]; - variables["svgHeight"] = args["HEIGHT"]; - return ( - '' + args["ELEMENTS"]))))))))))))) + - "" - ); - }; - - blocks.push({ - opcode: "line", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate( - "LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]" - ), - arguments: { - XA: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "4", - }, - YA: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "4", - }, - XB: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "96", - }, - YB: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "96", - }, - WIDTH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "8", - }, - COLOR: { - type: Scratch.ArgumentType.COLOR, - defaultValue: "#ff0000", - }, - OPACITY: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "100", - }, - DASH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "0", - }, - GAP: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "0", - }, - LINECAP: { - type: Scratch.ArgumentType.STRING, - menu: "LINECAPmenu", - }, - }, - disableMonitor: true, - isEdgeActivated: false, - }); - Extension.prototype["line"] = async (args, util) => { - return ( - '" - ); - }; - - blocks.push({ - opcode: "rect", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate( - "RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" - ), - arguments: { - X: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "4", - }, - Y: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "4", - }, - WIDTH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "92", - }, - HEIGHT: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "92", - }, - RADIUS: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "20", - }, - FILLCOLOR: { - type: Scratch.ArgumentType.COLOR, - defaultValue: "#ff0000", - }, - FILLOPACITY: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "100", - }, - STROKEWIDTH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "8", - }, - STROKECOLOR: { - type: Scratch.ArgumentType.COLOR, - defaultValue: "#000000", - }, - STROKEOPACITY: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "100", - }, - DASH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "0", - }, - GAP: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "0", - }, - LINECAP: { - type: Scratch.ArgumentType.STRING, - menu: "LINECAPmenu", - }, - }, - disableMonitor: true, - isEdgeActivated: false, - }); - Extension.prototype["rect"] = async (args, util) => { - return ( - '" - ); - }; - - blocks.push({ - opcode: "ellipse", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate( - "ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" - ), - arguments: { - CX: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "50", - }, - CY: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "50", - }, - WIDTH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "92", - }, - HEIGHT: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "92", - }, - FILLCOLOR: { - type: Scratch.ArgumentType.COLOR, - defaultValue: "#ff0000", - }, - FILLOPACITY: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "100", - }, - STROKEWIDTH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "8", - }, - STROKECOLOR: { - type: Scratch.ArgumentType.COLOR, - defaultValue: "#000000", - }, - STROKEOPACITY: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "100", - }, - DASH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "0", - }, - GAP: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "0", - }, - LINECAP: { - type: Scratch.ArgumentType.STRING, - menu: "LINECAPmenu", - }, - }, - disableMonitor: true, - isEdgeActivated: false, - }); - Extension.prototype["ellipse"] = async (args, util) => { - return ( - '" - ); - }; - - 0 + 0; - - blocks.push({ - opcode: "svgWidth", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg width"), - arguments: {}, - disableMonitor: true, - isEdgeActivated: false, - }); - Extension.prototype["svgWidth"] = async (args, util) => { - return variables["svgWidth"]; - }; - - blocks.push({ - opcode: "svgHeight", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg height"), - arguments: {}, - disableMonitor: true, - isEdgeActivated: false, - }); - Extension.prototype["svgHeight"] = async (args, util) => { - return variables["svgHeight"]; - }; - - menus["LINECAPmenu"] = { - acceptReporters: true, - items: ["round", "butt", "square"], - }; - - Scratch.extensions.register(new Extension()); + + Scratch.extensions.register(new svg()); })(Scratch); From 36f60c665529460f6c3757edc16578b6e5652d49 Mon Sep 17 00:00:00 2001 From: "DangoCat[bot]" Date: Mon, 3 Mar 2025 08:54:04 +0000 Subject: [PATCH 25/63] [Automated] Format code --- extensions/WAYLIVES/SVG/1.0.1.js | 337 ++++++++++++++++++++----------- 1 file changed, 218 insertions(+), 119 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index c6843ddc70..2938a38793 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -6,210 +6,218 @@ // Version: 1.0.1 -(function(Scratch) { - 'use strict'; +(function (Scratch) { + "use strict"; if (!Scratch.extensions.unsandboxed) { - throw new Error('This example must run unsandboxed'); + throw new Error("This example must run unsandboxed"); } class svg { getInfo() { return { - id: 'svg', - name: 'SVG', - color1: '#9823FF', - color2: '#7C2DC1', - color3: '#2D3548', + id: "svg", + name: "SVG", + color1: "#9823FF", + color2: "#7C2DC1", + color3: "#2D3548", blocks: [ { opcode: "svg", blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]"), + text: Scratch.translate( + "SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]" + ), arguments: { - "WIDTH": { + WIDTH: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', + defaultValue: "100", }, - "HEIGHT": { + HEIGHT: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', + defaultValue: "100", }, - "ELEMENTS": { + ELEMENTS: { type: Scratch.ArgumentType.STRING, - defaultValue: '', - } - } + defaultValue: "", + }, + }, }, - + "---", - + { opcode: "line", blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]"), + text: Scratch.translate( + "LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]" + ), arguments: { - "XA": { + XA: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', + defaultValue: "4", }, - "YA": { + YA: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', + defaultValue: "4", }, - "XB": { + XB: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '96', + defaultValue: "96", }, - "YB": { + YB: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '96', + defaultValue: "96", }, - "WIDTH": { + WIDTH: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', + defaultValue: "8", }, - "COLOR": { + COLOR: { type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', + defaultValue: "#ff0000", }, - "OPACITY": { + OPACITY: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', + defaultValue: "100", }, - "DASH": { + DASH: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', + defaultValue: "0", }, - "GAP": { + GAP: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', + defaultValue: "0", }, - "LINECAP": { + LINECAP: { type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' + menu: "LINECAPmenu", }, }, }, - + { opcode: "rect", blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + text: Scratch.translate( + "RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" + ), arguments: { - "X": { + X: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', + defaultValue: "4", }, - "Y": { + Y: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '4', + defaultValue: "4", }, - "WIDTH": { + WIDTH: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', + defaultValue: "92", }, - "HEIGHT": { + HEIGHT: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', + defaultValue: "92", }, - "RADIUS": { + RADIUS: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '20', + defaultValue: "20", }, - "FILLCOLOR": { + FILLCOLOR: { type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', + defaultValue: "#ff0000", }, - "FILLOPACITY": { + FILLOPACITY: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', + defaultValue: "100", }, - "STROKEWIDTH": { + STROKEWIDTH: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', + defaultValue: "8", }, - "STROKECOLOR": { + STROKECOLOR: { type: Scratch.ArgumentType.COLOR, - defaultValue: '#000000', + defaultValue: "#000000", }, - "STROKEOPACITY": { + STROKEOPACITY: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', + defaultValue: "100", }, - "DASH": { + DASH: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', + defaultValue: "0", }, - "GAP": { + GAP: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', + defaultValue: "0", }, - "LINECAP": { + LINECAP: { type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - } - } + menu: "LINECAPmenu", + }, + }, }, - + { opcode: "ellipse", blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]"), + text: Scratch.translate( + "ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" + ), arguments: { - "CX": { + CX: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '50', + defaultValue: "50", }, - "CY": { + CY: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '50', + defaultValue: "50", }, - "WIDTH": { + WIDTH: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', + defaultValue: "92", }, - "HEIGHT": { + HEIGHT: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '92', + defaultValue: "92", }, - "FILLCOLOR": { + FILLCOLOR: { type: Scratch.ArgumentType.COLOR, - defaultValue: '#ff0000', + defaultValue: "#ff0000", }, - "FILLOPACITY": { + FILLOPACITY: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', + defaultValue: "100", }, - "STROKEWIDTH": { + STROKEWIDTH: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '8', + defaultValue: "8", }, - "STROKECOLOR": { + STROKECOLOR: { type: Scratch.ArgumentType.COLOR, - defaultValue: '#000000', + defaultValue: "#000000", }, - "STROKEOPACITY": { + STROKEOPACITY: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '100', + defaultValue: "100", }, - "DASH": { + DASH: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', + defaultValue: "0", }, - "GAP": { + GAP: { type: Scratch.ArgumentType.NUMBER, - defaultValue: '0', + defaultValue: "0", }, - "LINECAP": { + LINECAP: { type: Scratch.ArgumentType.STRING, - menu: 'LINECAPmenu' - } - } + menu: "LINECAPmenu", + }, + }, }, - + "---", - + /*{ opcode: "svgWidth", blockType: Scratch.BlockType.REPORTER, @@ -221,42 +229,133 @@ blockType: Scratch.BlockType.REPORTER, text: Scratch.translate("svg height"), },*/ - ], menus: { LINECAPmenu: { acceptReporters: true, - items: ['round', 'butt', 'square'] + items: ["round", "butt", "square"], }, - } + }, }; } - + svg(args) { - return (('' + args["ELEMENTS"])))))))))))))) + '') + return ( + '' + args["ELEMENTS"]))))))))))))) + + "" + ); } - + line(args) { - return (('') + return ( + '" + ); } - - rect(args){ - return (('') + + rect(args) { + return ( + '" + ); } - + ellipse(args) { - return (('') + return ( + '" + ); } - + svgWidth(args) { - return variables['svgWidth'] + return variables["svgWidth"]; } - + svgHeight(args) { - return variables['svgHeight'] + return variables["svgHeight"]; } - } - - Scratch.extensions.register(new svg()); + + Scratch.extensions.register(new svg()); })(Scratch); From 0831d51df7f45bb6e6191aa5e3a97f4ca7dd23fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Mon, 3 Mar 2025 11:57:04 +0300 Subject: [PATCH 26/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 2938a38793..2974396007 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -215,20 +215,7 @@ }, }, }, - - "---", - - /*{ - opcode: "svgWidth", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg width"), - }, - - { - opcode: "svgHeight", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate("svg height"), - },*/ + ], menus: { LINECAPmenu: { @@ -347,14 +334,6 @@ "/>" ); } - - svgWidth(args) { - return variables["svgWidth"]; - } - - svgHeight(args) { - return variables["svgHeight"]; - } } Scratch.extensions.register(new svg()); From 4bfba541fc531a0bd57c690d335d2ccb30dbf753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Mon, 3 Mar 2025 12:04:09 +0300 Subject: [PATCH 27/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 2974396007..cfe130b33b 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -228,27 +228,27 @@ svg(args) { return ( - '' + args["ELEMENTS"]))))))))))))) + + ('">' + args["ELEMENTS"]))))))))))))) + "" ); } line(args) { return ( - ' Date: Mon, 3 Mar 2025 12:24:03 +0300 Subject: [PATCH 28/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 39 ++------------------------------ 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index cfe130b33b..088304c3d5 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -228,48 +228,13 @@ svg(args) { return ( - '' + args["ELEMENTS"]))))))))))))) + - "" + '' + args["ELEMENTS"]))))))))))))) + "" ); } line(args) { return ( - '" + '" ); } From c66d90c4b819b2bf3b6e56a6ae56a12e85dfeb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Mon, 3 Mar 2025 12:31:07 +0300 Subject: [PATCH 29/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 55 ++------------------------------ 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 088304c3d5..d679078f6b 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -240,65 +240,16 @@ rect(args) { return ( - '" + '" ); } ellipse(args) { return ( - '" + '" ); } + } Scratch.extensions.register(new svg()); From 926a0b31336f77c2d68847b3a9304ed859b376eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Mon, 3 Mar 2025 12:33:52 +0300 Subject: [PATCH 30/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index d679078f6b..7df46cbf78 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -17,7 +17,7 @@ getInfo() { return { id: "svg", - name: "SVG", + name: Scratch.translate("SVG"), color1: "#9823FF", color2: "#7C2DC1", color3: "#2D3548", From 70d66d4ad0afb4ee2d3bb9aa7589eb3002807f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Mon, 3 Mar 2025 12:36:26 +0300 Subject: [PATCH 31/63] Update 1.0.1.js From 487e7adfa9da4886eb45b7ac7bef69b7cc510c98 Mon Sep 17 00:00:00 2001 From: "DangoCat[bot]" Date: Mon, 3 Mar 2025 09:37:49 +0000 Subject: [PATCH 32/63] [Automated] Format code --- extensions/WAYLIVES/SVG/1.0.1.js | 95 ++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 6 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 7df46cbf78..a688258e6a 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -215,7 +215,6 @@ }, }, }, - ], menus: { LINECAPmenu: { @@ -228,28 +227,112 @@ svg(args) { return ( - '' + args["ELEMENTS"]))))))))))))) + "" + '' + args["ELEMENTS"]))))))))))))) + + "" ); } line(args) { return ( - '" + '" ); } rect(args) { return ( - '" + '" ); } ellipse(args) { return ( - '" + '" ); } - } Scratch.extensions.register(new svg()); From e3e9b8856b8c79710e67a620b331455f71a7994c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Mon, 3 Mar 2025 18:05:10 +0300 Subject: [PATCH 33/63] Create SVG.svg --- images/WAYLIVES/SVG.svg | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 images/WAYLIVES/SVG.svg diff --git a/images/WAYLIVES/SVG.svg b/images/WAYLIVES/SVG.svg new file mode 100644 index 0000000000..d10ab7c44d --- /dev/null +++ b/images/WAYLIVES/SVG.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From a803ef627ee4a899c120f5a537502a005dbaac14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Mon, 3 Mar 2025 18:06:19 +0300 Subject: [PATCH 34/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 95 ++------------------------------ 1 file changed, 6 insertions(+), 89 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index a688258e6a..7df46cbf78 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -215,6 +215,7 @@ }, }, }, + ], menus: { LINECAPmenu: { @@ -227,112 +228,28 @@ svg(args) { return ( - '' + args["ELEMENTS"]))))))))))))) + - "" + '' + args["ELEMENTS"]))))))))))))) + "" ); } line(args) { return ( - '" + '" ); } rect(args) { return ( - '" + '" ); } ellipse(args) { return ( - '" + '" ); } + } Scratch.extensions.register(new svg()); From 38c8a1fa819d0ca2cca2693c0da6750ecd8a8fa7 Mon Sep 17 00:00:00 2001 From: "DangoCat[bot]" Date: Mon, 3 Mar 2025 15:07:45 +0000 Subject: [PATCH 35/63] [Automated] Format code --- extensions/WAYLIVES/SVG/1.0.1.js | 95 ++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 6 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 7df46cbf78..a688258e6a 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -215,7 +215,6 @@ }, }, }, - ], menus: { LINECAPmenu: { @@ -228,28 +227,112 @@ svg(args) { return ( - '' + args["ELEMENTS"]))))))))))))) + "" + '' + args["ELEMENTS"]))))))))))))) + + "" ); } line(args) { return ( - '" + '" ); } rect(args) { return ( - '" + '" ); } ellipse(args) { return ( - '" + '" ); } - } Scratch.extensions.register(new svg()); From acecb61ba7bfe2fd98d100f7dee2d4a9b4ba71a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Tue, 4 Mar 2025 16:33:33 +0300 Subject: [PATCH 36/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index a688258e6a..6505370a27 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -1,7 +1,7 @@ // Name: SVG // ID: WRsvg // Description: Create SVG elements. -// By: WAYLIVES +// By: WAYLIVES // License: MIT // Version: 1.0.1 From 669d9bd1cf3d127b5ffc5ca7c77504a1efd9dacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Tue, 4 Mar 2025 19:26:39 +0300 Subject: [PATCH 37/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 6505370a27..3032746cb6 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -1,7 +1,7 @@ // Name: SVG // ID: WRsvg // Description: Create SVG elements. -// By: WAYLIVES +// By: WAYLIVES // License: MIT // Version: 1.0.1 From b178019c61522949178345a254922ed0c89bd6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Tue, 4 Mar 2025 19:30:12 +0300 Subject: [PATCH 38/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 3032746cb6..a688258e6a 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -1,7 +1,7 @@ // Name: SVG // ID: WRsvg // Description: Create SVG elements. -// By: WAYLIVES +// By: WAYLIVES // License: MIT // Version: 1.0.1 From ea6a2b257240b351ab70991c45ef3848d9a70bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Tue, 4 Mar 2025 19:51:16 +0300 Subject: [PATCH 39/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index a688258e6a..cfd8e44fbd 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -225,7 +225,7 @@ }; } - svg(args) { + svg(args) { // prettier-ignore return ( ' Date: Tue, 4 Mar 2025 16:53:01 +0000 Subject: [PATCH 40/63] [Automated] Format code --- extensions/WAYLIVES/SVG/1.0.1.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index cfd8e44fbd..fa4eeda29f 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -225,7 +225,8 @@ }; } - svg(args) { // prettier-ignore + svg(args) { + // prettier-ignore return ( ' Date: Tue, 4 Mar 2025 19:56:44 +0300 Subject: [PATCH 41/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 93 ++------------------------------ 1 file changed, 4 insertions(+), 89 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index fa4eeda29f..f8882223ec 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -228,113 +228,28 @@ svg(args) { // prettier-ignore return ( - '' + args["ELEMENTS"]))))))))))))) + - "" + '' + args["ELEMENTS"]))))))))))))) + "" ); } line(args) { // prettier-ignore return ( - '" + '" ); } rect(args) { // prettier-ignore return ( - '" + '" ); } ellipse(args) { // prettier-ignore return ( - '" + '" ); } } From ae3eed2f6a66d0acb477464993b9c197357c5495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Tue, 4 Mar 2025 19:59:43 +0300 Subject: [PATCH 42/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index f8882223ec..0ee976b510 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -1,7 +1,7 @@ // Name: SVG // ID: WRsvg // Description: Create SVG elements. -// By: WAYLIVES +// By: WAYLIVES // License: MIT // Version: 1.0.1 From 618e2a0e5d81a3ce99ca693b78a4388d28dc677f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Tue, 4 Mar 2025 20:04:39 +0300 Subject: [PATCH 43/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 0ee976b510..8b0f545c88 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -219,7 +219,19 @@ menus: { LINECAPmenu: { acceptReporters: true, - items: ["round", "butt", "square"], + items: [ + { + text: Scratch.translate('round'), + value: 'round' + }, + { + text: Scratch.translate('butt'), + value: 'butt' + }, + { + text: Scratch.translate('square'), + value: 'square' + }, }, }, }; From 4a4f4f3609fe3c72d8abe8607e0de0ac5442b6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Tue, 4 Mar 2025 20:07:19 +0300 Subject: [PATCH 44/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 8b0f545c88..0a8e56f01a 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -232,6 +232,7 @@ text: Scratch.translate('square'), value: 'square' }, + ] }, }, }; From f2f0f5aee3957364b8702cfbaf0ca417781edf66 Mon Sep 17 00:00:00 2001 From: "DangoCat[bot]" Date: Tue, 4 Mar 2025 17:08:41 +0000 Subject: [PATCH 45/63] [Automated] Format code --- extensions/WAYLIVES/SVG/1.0.1.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 0a8e56f01a..aa4dff27ab 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -221,18 +221,18 @@ acceptReporters: true, items: [ { - text: Scratch.translate('round'), - value: 'round' + text: Scratch.translate("round"), + value: "round", }, { - text: Scratch.translate('butt'), - value: 'butt' + text: Scratch.translate("butt"), + value: "butt", }, { - text: Scratch.translate('square'), - value: 'square' + text: Scratch.translate("square"), + value: "square", }, - ] + ], }, }, }; From 147f3402faca3c30114bfb4085d441818d04d656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Tue, 4 Mar 2025 20:10:46 +0300 Subject: [PATCH 46/63] Delete extensions/WAYLIVES/Window Settings directory --- extensions/WAYLIVES/Window Settings/2.0.0.js | 1106 ------------------ 1 file changed, 1106 deletions(-) delete mode 100644 extensions/WAYLIVES/Window Settings/2.0.0.js diff --git a/extensions/WAYLIVES/Window Settings/2.0.0.js b/extensions/WAYLIVES/Window Settings/2.0.0.js deleted file mode 100644 index e6b52f6aa3..0000000000 --- a/extensions/WAYLIVES/Window Settings/2.0.0.js +++ /dev/null @@ -1,1106 +0,0 @@ -// Name: Window Settings V2 -// ID: WRWindowSettings -// Description: Thanks to this extension, you can customize the project window (this works if you package the project in the ".exe" format). -// By: RIHART -// License: MIT - -// Version: 2.0.0 - -(function (Scratch) { - "use strict"; - - Scratch.translate({ - ru /*_РусскийЯзык_*/: { - ExtensionName: "Настройки Окна", - LabelA: "Window Settings:", - MoveWHXY: "окно [SC] [WHXY]: [WHXYA], [WHXYB]", - // [SC]: - SCA: "задать", - SCB: "изменить", - // [WHXY]: - WHXYA: "ширину, высоту", - WHXYB: "позицию x, позицию y", - WindowSCWH: "окно [MenuSC] [MenuWH]: [WH]", - // [MenuSC]: - MenuSCA: "задать", - MenuSCB: "изменить", - // [MenuWH]: - MenuWHA: "ширину", - MenuWHB: "высоту", - MenuWHC: "позицию x", - MenuWHD: "позицию y", - moveToPresets: "переместить окно [PRESETS]", - // [PRESETS]: - PRESETSA: "по центру", - PRESETSB: "справа", - PRESETSC: "слева", - PRESETSD: "сверху", - PRESETSE: "снизу", - PRESETSF: "в верхнем правом углу", - PRESETSG: "в верхнем левом углу", - PRESETSH: "в нижнем правом углу", - PRESETSI: "в нижнем левом углу", - changeTitleTo: "задать окну имя [TITLE]", - WindowWHXY: "окно [MenuWindowWHXY]", - innerStageSize: - "размер внутренней сцены [innerMenuSetChange] ширину: [innerWidth] высоту: [innerHeight]", - // [innerMenuSetChange]: - innerMenuSetChangeA: "задать", - innerMenuSetChangeB: "изменить", - innerStageSizeWidthHeight: - "размер внутренней сцены [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight]", - // [innerMenuSetChangeWH]: - innerMenuSetChangeWHA: "задать", - innerMenuSetChangeWHB: "изменить", - // [innerMenuWidthHeight]: - innerMenuWidthHeightA: "ширину", - innerMenuWidthHeightB: "высоту", - setDimensions: "задать сцену по ширине: [width] по высоте: [height]", - getDimension: "сцена [dimension]", - greenFlag: "нажать на флаг [flag]", - FullscreenEnterExit: "полноэкранный режим [MenuFEE]", - // [MenuFEE]: - FullscreenEnter: "включить", - FullscreenExit: "выключить", - closeWindow: "закрыть окно", - QuestionsWS: "[MenuQuestions]", - // [MenuQuestions]: - MenuQuestionsA: "касается ли окно края экрана?", - MenuQuestionsB: "сфокусировано ли окно?", - MenuQuestionsC: "является ли окно полноэкранным?", - ScreenWHXY: "экран [MenuScreenWHXY]", - setEnabled: "задать [thing] [enabled]", - // [thing]: - thingA: "🗲 турбо режим", - thingB: "интерполяция", - thingC: "убрать рамку сцены", - thingD: "убрать разные ограничения", - thingE: "перо в высоком качестве", - // [enabled]: - setFramerate: "задать ограничение частоты кадров на: [fps]", - showHideOption: "[SHOWHIDE] [OPTIONSH]", - // [SHOWHIDE]: - show: "показать", - hide: "скрыть", - // [OPTIONSH]: - flag: "иконка флага", - pause: "иконка паузы", - stop: "иконка остановки", - fullscreen: "иконка полноэкранного режима", - optionShown: "[OPTION] показан?", - }, - }); - - if (!Scratch.extensions.unsandboxed) { - throw new Error("Error"); - } - - // иконка меню: - const menuIconURI = - "data:image/svg+xml,%3Csvg%20width%3D%22100%22%20height%3D%22100%22%20viewBox%3D%220%200%20100%20100%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2294%22%20height%3D%2294%22%20rx%3D%2217%22%20fill%3D%22%234B6095%22%20stroke%3D%22%232D3548%22%20stroke-width%3D%226%22%2F%3E%3Crect%20x%3D%2226%22%20y%3D%2226%22%20width%3D%2248%22%20height%3D%2248%22%20rx%3D%225%22%20stroke%3D%22white%22%20stroke-width%3D%226%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M23%2031C23%2026.5817%2026.5817%2023%2031%2023H69C73.4183%2023%2077%2026.5817%2077%2031V35C77%2039.4183%2073.4183%2043%2069%2043H31C26.5817%2043%2023%2039.4183%2023%2035V31ZM43%2037C45.2091%2037%2047%2035.2091%2047%2033C47%2030.7909%2045.2091%2029%2043%2029C40.7909%2029%2039%2030.7909%2039%2033C39%2035.2091%2040.7909%2037%2043%2037ZM57%2033C57%2035.2091%2055.2091%2037%2053%2037C50.7909%2037%2049%2035.2091%2049%2033C49%2030.7909%2050.7909%2029%2053%2029C55.2091%2029%2057%2030.7909%2057%2033ZM33%2037C35.2091%2037%2037%2035.2091%2037%2033C37%2030.7909%2035.2091%2029%2033%2029C30.7909%2029%2029%2030.7909%2029%2033C29%2035.2091%2030.7909%2037%2033%2037Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E"; - - // иконки блоков: - const greenFlagURI = - "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAxNiAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zIDAuNUMzIDAuMjIzODU4IDIuNzc2MTQgMCAyLjUgMEgxLjVDMC42NzE1NzMgMCAwIDAuNjcxNTczIDAgMS41VjE4LjVDMCAxOS4zMjg0IDAuNjcxNTczIDIwIDEuNSAyMFYyMEMyLjMyODQzIDIwIDMgMTkuMzI4NCAzIDE4LjVWMTVDMyAxMy44OTU0IDMuODk1NDMgMTMgNSAxM0gxNEMxNS4xMDQ2IDEzIDE2IDEyLjEwNDYgMTYgMTFWM0MxNiAxLjg5NTQzIDE1LjEwNDYgMSAxNCAxSDMuNUMzLjIyMzg2IDEgMyAwLjc3NjE0MiAzIDAuNVYwLjVaIiBmaWxsPSIjMTgxRDBEIi8+Cjwvc3ZnPgo="; - - const TURBO_MODE = "turbo mode"; - const INTERPOLATION = "interpolation"; - const REMOVE_FENCING = "remove fencing"; - const REMOVE_MISC_LIMITS = "remove misc limits"; - const HIGH_QUALITY_PEN = "high quality pen"; - - var fullScreen; - var greenFlag; - var pauseButton; - var stopButton; - - const getButtons = () => { - fullScreen = undefined; - greenFlag = undefined; - pauseButton = undefined; - stopButton = undefined; - - const rightButtons = document.querySelectorAll( - '[class*="stage-header_stage-button_"]' - ); - fullScreen = rightButtons[rightButtons.length - 1]; - if (!fullScreen) { - fullScreen = - document.querySelector(".fullscreen-button") || - document.querySelector(".standalone-fullscreen-button"); - } - - greenFlag = - document.querySelector('[class*="green-flag_green-flag_"]') || - document.querySelector(".green-flag-button"); - pauseButton = - document.querySelector(".pause-btn") || - document.querySelector(".pause-button"); - stopButton = - document.querySelector('[class*="stop-all_stop-all_"]') || - document.querySelector(".stop-all-button"); - }; - - class lmsmcutils { - getInfo() { - return { - id: "WindowSettings", - name: Scratch.translate({ - id: "ExtensionName", - default: "Window Settings", - }), - color1: "#5671B7", - color2: "#4B6095", - color3: "#2D3548", - menuIconURI: menuIconURI, - - blocks: [ - { - opcode: "MoveWHXY", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "MoveWHXY", - default: "window [SC] [WHXY]: [WHXYA], [WHXYB]", - }), - arguments: { - SC: { - type: Scratch.ArgumentType.STRING, - menu: "SC", - }, - WHXY: { - type: Scratch.ArgumentType.STRING, - menu: "WHXY", - }, - WHXYA: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "480", - }, - WHXYB: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "360", - }, - }, - }, - - { - opcode: "WindowSCWH", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "WindowSCWH", - default: "window [MenuSC] [MenuWH]: [WH]", - }), - arguments: { - MenuSC: { - type: Scratch.ArgumentType.STRING, - menu: "MenuSC", - }, - MenuWH: { - type: Scratch.ArgumentType.STRING, - menu: "MenuWH", - }, - WH: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "480", - }, - }, - }, - - { - opcode: "moveToPresets", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "moveToPresets", - default: "move window to the [PRESETS]", - }), - arguments: { - PRESETS: { - type: Scratch.ArgumentType.STRING, - menu: "MOVE", - }, - }, - }, - - { - opcode: "changeTitleTo", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "changeTitleTo", - default: "set window title to [TITLE]", - }), - arguments: { - TITLE: { - type: Scratch.ArgumentType.STRING, - defaultValue: "WAYLIVES", - }, - }, - }, - - { - opcode: "WindowWHXY", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate({ - id: "WindowWHXY", - default: "window [MenuWindowWHXY]", - }), - arguments: { - MenuWindowWHXY: { - type: Scratch.ArgumentType.STRING, - menu: "MenuWindowWHXY", - }, - }, - }, - - "---", - - { - opcode: "innerStageSize", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "innerStageSize", - default: - "inner stage size [innerMenuSetChange] width: [innerWidth] height: [innerHeight]", - }), - arguments: { - innerMenuSetChange: { - type: Scratch.ArgumentType.STRING, - menu: "innerMenuSetChange", - }, - innerWidth: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "480", - }, - innerHeight: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "360", - }, - }, - }, - - { - opcode: "innerStageSizeWidthHeight", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "innerStageSizeWidthHeight", - default: - "inner stage size [innerMenuSetChangeWH] [innerMenuWidthHeight]: [innerWidthHeight]", - }), - arguments: { - innerMenuSetChangeWH: { - type: Scratch.ArgumentType.STRING, - menu: "innerMenuSetChangeWH", - }, - innerMenuWidthHeight: { - type: Scratch.ArgumentType.STRING, - menu: "innerMenuWidthHeight", - }, - innerWidthHeight: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "480", - }, - }, - }, - - { - opcode: "setDimensions", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "setDimensions", - default: "set stage size width: [width] height: [height]", - }), - arguments: { - width: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "480", - }, - height: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "360", - }, - }, - }, - - { - opcode: "getDimension", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate({ - id: "getDimension", - default: "stage [dimension]", - }), - arguments: { - dimension: { - type: Scratch.ArgumentType.STRING, - defaultValue: "width", - menu: "dimension", - }, - }, - }, - - "---", - - { - opcode: "greenFlag", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "greenFlag", - default: "run flag [flag]", - }), - arguments: { - flag: { - type: Scratch.ArgumentType.IMAGE, - dataURI: greenFlagURI, - }, - }, - }, - - { - opcode: "FullscreenEnterExit", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "FullscreenEnterExit", - default: "fullscreen [MenuFEE]", - }), - arguments: { - MenuFEE: { - type: Scratch.ArgumentType.STRING, - menu: "MenuFEE", - }, - }, - }, - - { - opcode: "closeWindow", - blockType: Scratch.BlockType.COMMAND, - isTerminal: true, - text: Scratch.translate({ - id: "closeWindow", - default: "close window", - }), - }, - - { - opcode: "QuestionsWS", - blockType: Scratch.BlockType.BOOLEAN, - text: Scratch.translate({ - id: "QuestionsWS", - default: "[MenuQuestions]", - }), - disableMonitor: true, - arguments: { - MenuQuestions: { - type: Scratch.ArgumentType.STRING, - menu: "MenuQuestions", - }, - }, - }, - - { - opcode: "ScreenWHXY", - blockType: Scratch.BlockType.REPORTER, - text: Scratch.translate({ - id: "ScreenWHXY", - default: "screen [MenuScreenWHXY]", - }), - arguments: { - MenuScreenWHXY: { - type: Scratch.ArgumentType.STRING, - menu: "MenuScreenWHXY", - }, - }, - }, - - "---", - - { - opcode: "setFramerate", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "setFramerate", - default: "set framerate limit to [fps]", - }), - arguments: { - fps: { - type: Scratch.ArgumentType.NUMBER, - defaultValue: "30", - }, - }, - }, - - "---", - - { - opcode: "showHideOption", - blockType: Scratch.BlockType.COMMAND, - text: Scratch.translate({ - id: "showHideOption", - default: "[SHOWHIDE] [OPTIONSH]", - }), - arguments: { - SHOWHIDE: { - type: Scratch.ArgumentType.STRING, - menu: "SHOWHIDE", - }, - OPTIONSH: { - type: Scratch.ArgumentType.STRING, - menu: "OPTIONSH", - }, - }, - }, - { - opcode: "optionShown", - blockType: Scratch.BlockType.BOOLEAN, - text: Scratch.translate({ - id: "optionShown", - default: "[OPTION] shown?", - }), - arguments: { - OPTION: { - type: Scratch.ArgumentType.STRING, - menu: "OPTION", - }, - }, - }, - "---", - ], - - menus: { - SC: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ id: "SCA", default: "set" }), - value: "Set", - }, - { - text: Scratch.translate({ id: "SCB", default: "change" }), - value: "Change", - }, - ], - }, - WHXY: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ - id: "WHXYA", - default: "width, height", - }), - value: "WidthHeight", - }, - { - text: Scratch.translate({ - id: "WHXYB", - default: "x position, y position", - }), - value: "PositionXY", - }, - ], - }, - MenuSC: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ id: "MenuSCA", default: "set" }), - value: "Set", - }, - { - text: Scratch.translate({ id: "MenuSCB", default: "change" }), - value: "Change", - }, - ], - }, - MenuWH: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ id: "MenuWHA", default: "width" }), - value: "Width", - }, - { - text: Scratch.translate({ id: "MenuWHB", default: "height" }), - value: "Height", - }, - { - text: Scratch.translate({ - id: "MenuWHC", - default: "x position", - }), - value: "PositionX", - }, - { - text: Scratch.translate({ - id: "MenuWHD", - default: "y position", - }), - value: "PositionY", - }, - ], - }, - MOVE: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ id: "PRESETSA", default: "center" }), - value: "center", - }, - { - text: Scratch.translate({ id: "PRESETSB", default: "right" }), - value: "right", - }, - { - text: Scratch.translate({ id: "PRESETSC", default: "left" }), - value: "left", - }, - { - text: Scratch.translate({ id: "PRESETSD", default: "top" }), - value: "top", - }, - { - text: Scratch.translate({ id: "PRESETSE", default: "bottom" }), - value: "bottom", - }, - { - text: Scratch.translate({ - id: "PRESETSF", - default: "top right", - }), - value: "top right", - }, - { - text: Scratch.translate({ - id: "PRESETSG", - default: "top left", - }), - value: "top left", - }, - { - text: Scratch.translate({ - id: "PRESETSH", - default: "bottom right", - }), - value: "bottom right", - }, - { - text: Scratch.translate({ - id: "PRESETSI", - default: "bottom left", - }), - value: "bottom left", - }, - ], - }, - MenuWindowWHXY: { - acceptReporters: true, - items: [ - { text: "width", value: "Width" }, - { text: "height", value: "Height" }, - { text: "x position", value: "PositionX" }, - { text: "y position", value: "PositionY" }, - { text: "title", value: "Title" }, - ], - }, - innerMenuSetChange: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ - id: "innerMenuSetChangeA", - default: "set", - }), - value: "set", - }, - { - text: Scratch.translate({ - id: "innerMenuSetChangeB", - default: "change", - }), - value: "change", - }, - ], - }, - innerMenuSetChangeWH: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ - id: "innerMenuSetChangeWHA", - default: "set", - }), - value: "set", - }, - { - text: Scratch.translate({ - id: "innerMenuSetChangeWHB", - default: "change", - }), - value: "change", - }, - ], - }, - innerMenuWidthHeight: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ - id: "innerMenuWidthHeightA", - default: "width", - }), - value: "width", - }, - { - text: Scratch.translate({ - id: "innerMenuWidthHeightB", - default: "height", - }), - value: "height", - }, - ], - }, - dimension: { - acceptReporters: true, - items: [ - { - text: Scratch.translate("width"), - value: "width", - }, - { - text: Scratch.translate("height"), - value: "height", - }, - ], - }, - MenuFEE: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ - id: "FullscreenEnter", - default: "on", - }), - value: "Enter", - }, - { - text: Scratch.translate({ - id: "FullscreenExit", - default: "off", - }), - value: "Exit", - }, - ], - }, - MenuQuestions: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ - id: "MenuQuestionsA", - default: "is window touching screen edge", - }), - value: "A", - }, - { - text: Scratch.translate({ - id: "MenuQuestionsB", - default: "is window focused?", - }), - value: "B", - }, - { - text: Scratch.translate({ - id: "MenuQuestionsC", - default: "is window fullscreen?", - }), - value: "C", - }, - ], - }, - MenuScreenWHXY: { - acceptReporters: true, - items: [ - { text: "width", value: "Width" }, - { text: "height", value: "Height" }, - ], - }, - - thing: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ - id: "thingA", - default: "🗲 turbo mode", - }), - value: "TURBO_MODE", - }, - { - text: Scratch.translate({ - id: "thingB", - default: "interpolation", - }), - value: "INTERPOLATION", - }, - { - text: Scratch.translate({ - id: "thingC", - default: "remove fencing", - }), - value: "REMOVE_FENCING", - }, - { - text: Scratch.translate({ - id: "thingD", - default: "remove misc limits", - }), - value: "REMOVE_MISC_LIMITS", - }, - { - text: Scratch.translate({ - id: "thingE", - default: "high quality pen", - }), - value: "HIGH_QUALITY_PEN", - }, - ], - }, - - enabled: { - acceptReporters: false, - items: [ - { - text: Scratch.translate("enabled"), - value: "true", - }, - { - text: Scratch.translate("disabled"), - value: "false", - }, - ], - }, - - OPTION: { - acceptReporters: true, - items: [ - { - text: Scratch.translate("flag"), - value: "flag", - }, - { - text: Scratch.translate("pause"), - value: "pause", - }, - { - text: Scratch.translate("stop"), - value: "stop", - }, - { - text: Scratch.translate("fullscreen"), - value: "fullscreen", - }, - ], - }, - SHOWHIDE: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ id: "show", default: "show" }), - value: "show", - }, - { - text: Scratch.translate({ id: "hide", default: "hide" }), - value: "hide", - }, - ], - }, - OPTIONSH: { - acceptReporters: false, - items: [ - { - text: Scratch.translate({ id: "flag", default: "flag" }), - value: "flag", - }, - { - text: Scratch.translate({ id: "pause", default: "pause" }), - value: "pause", - }, - { - text: Scratch.translate({ id: "stop", default: "stop" }), - value: "stop", - }, - { - text: Scratch.translate({ - id: "fullscreen", - default: "fullscreen", - }), - value: "fullscreen", - }, - ], - }, - }, - }; - } - - getDimension({ dimension }) { - if (dimension === "width") { - return Scratch.vm.runtime.stageWidth; - } else if (dimension === "height") { - return Scratch.vm.runtime.stageHeight; - } - return 0; - } - - setDimensions({ width, height }) { - width = Scratch.Cast.toNumber(width); - height = Scratch.Cast.toNumber(height); - Scratch.vm.setStageSize(width, height); - } - - MoveWHXY(args) { - if (args.SC == "Set") { - if (args.WHXY == "WidthHeight") { - window.resizeTo(args.WHXYA, args.WHXYB); - } else if (args.WHXY == "PositionXY") { - window.moveTo(args.WHXYA, args.WHXYB); - } - } else if (args.SC == "Change") { - if (args.WHXY == "WidthHeight") { - window.resizeBy(args.WHXYA, args.WHXYB); - } else if (args.WHXY == "PositionXY") { - window.moveBy(args.WHXYA, args.WHXYB); - } - } - Scratch.vm.runtime.requestRedraw(); - } - - innerStageSize(args) { - if (args.innerMenuSetChange == "set") { - window.resizeTo( - args.innerWidth + (window.outerWidth - window.innerWidth), - args.innerHeight + (window.outerHeight - window.innerHeight) - ); - } else if (args.innerMenuSetChange == "change") { - window.resizeBy(args.innerWidth, args.innerHeight); - } - Scratch.vm.runtime.requestRedraw(); - } - - innerStageSizeWidthHeight(args) { - if (args.innerMenuSetChangeWH == "set") { - if (args.innerMenuWidthHeight == "width") { - const innerHeight = window.outerHeight; - window.resizeTo( - args.innerWidthHeight + (window.outerWidth - window.innerWidth), - innerHeight - ); - } else if (args.innerMenuWidthHeight == "height") { - const innerWidth = window.outerWidth; - window.resizeTo( - innerWidth, - args.innerWidthHeight + (window.outerHeight - window.innerHeight) - ); - } - } else if (args.innerMenuSetChangeWH == "change") { - if (args.innerMenuWidthHeight == "width") { - window.resizeBy(args.innerWidthHeight, 0); - } else if (args.innerMenuWidthHeight == "height") { - window.resizeBy(0, args.innerWidthHeight); - } - } - Scratch.vm.runtime.requestRedraw(); - } - - moveToPresets(args) { - if (args.PRESETS == "center") { - const left = (screen.width - window.outerWidth) / 2; - const top = (screen.height - window.outerHeight) / 2; - window.moveTo(left, top); - } else if (args.PRESETS == "right") { - const right = screen.width - window.outerWidth; - const top = (screen.height - window.outerHeight) / 2; - window.moveTo(right, top); - } else if (args.PRESETS == "left") { - const top = (screen.height - window.outerHeight) / 2; - window.moveTo(0, top); - } else if (args.PRESETS == "top") { - const left = (screen.width - window.outerWidth) / 2; - window.moveTo(left, 0); - } else if (args.PRESETS == "bottom") { - const left = (screen.width - window.outerWidth) / 2; - const bottom = screen.height - window.outerHeight; - window.moveTo(left, bottom); - } else if (args.PRESETS == "top right") { - const right = screen.width - window.outerWidth; - window.moveTo(right, 0); - } else if (args.PRESETS == "top left") { - window.moveTo(0, 0); - } else if (args.PRESETS == "bottom right") { - const right = screen.width - window.outerWidth; - const bottom = screen.height - window.outerHeight; - window.moveTo(right, bottom); - } else if (args.PRESETS == "bottom left") { - const bottom = screen.height - window.outerHeight; - window.moveTo(0, bottom); - } - Scratch.vm.runtime.requestRedraw(); - } - - WindowWHXY(args) { - if (args.MenuWindowWHXY == "Width") { - return window.outerWidth; - } else if (args.MenuWindowWHXY == "Height") { - return window.outerHeight; - } else if (args.MenuWindowWHXY == "PositionX") { - return window.screenLeft; - } else if (args.MenuWindowWHXY == "PositionY") { - return window.screenTop; - } else if (args.MenuWindowWHXY == "Title") { - return document.title; - } - } - ScreenWHXY(args) { - if (args.MenuScreenWHXY == "Width") { - return screen.width; - } else if (args.MenuScreenWHXY == "Height") { - return screen.height; - } - } - QuestionsWS(args) { - if (args.MenuQuestions == "A") { - const edgeX = screen.width - window.outerWidth; - const edgeY = screen.height - window.outerHeight; - return ( - window.screenLeft <= 0 || - window.screenTop <= 0 || - window.screenLeft >= edgeX || - window.screenTop >= edgeY - ); - } else if (args.MenuQuestions == "B") { - return document.hasFocus(); - } else if (args.MenuQuestions == "C") { - return document.fullscreenElement !== null; - } - } - FullscreenEnterExit(args) { - if (args.MenuFEE == "Enter") { - if (document.fullscreenElement == null) { - document.documentElement.requestFullscreen(); - } - } else if (args.MenuFEE == "Exit") { - if (document.fullscreenElement !== null) { - document.exitFullscreen(); - } - } - } - - WindowSCWH(args) { - if (args.MenuSC == "Set") { - if (args.MenuWH == "Width") { - const currentH = window.outerHeight; - window.resizeTo(args.WH, currentH); - } else if (args.MenuWH == "Height") { - const currentW = window.outerWidth; - window.resizeTo(currentW, args.WH); - } else if (args.MenuWH == "PositionX") { - const currentY = window.screenY; - window.moveTo(args.WH, currentY); - } else if (args.MenuWH == "PositionY") { - const currentX = window.screenX; - window.moveTo(currentX, args.WH); - } - } else if (args.MenuSC == "Change") { - if (args.MenuWH == "Width") { - window.resizeBy(args.WH, 0); - } else if (args.MenuWH == "Height") { - window.resizeBy(0, args.WH); - } else if (args.MenuWH == "PositionX") { - window.moveBy(args.WH, 0); - } else if (args.MenuWH == "PositionY") { - window.moveBy(0, args.WH); - } - } - Scratch.vm.runtime.requestRedraw(); - } - - changeTitleTo(args) { - document.title = args.TITLE; - } - closeWindow() { - const editorConfirmation = Scratch.translate({ - id: "editorConfirmation", - default: - "Are you sure you want to close this window?\n\n(This message will not appear when the project is packaged)", - }); - // @ts-expect-error - if (typeof ScratchBlocks === "undefined" || confirm(editorConfirmation)) { - window.close(); - } - } - - greenFlag() { - Scratch.vm.runtime.greenFlag(); - } - - setEnabled({ thing, enabled }) { - enabled = Scratch.Cast.toBoolean(enabled); - - if (thing === TURBO_MODE) { - Scratch.vm.setTurboMode(enabled); - } else if (thing === INTERPOLATION) { - Scratch.vm.setInterpolation(enabled); - } else if (thing === REMOVE_FENCING) { - Scratch.vm.setRuntimeOptions({ - fencing: !enabled, - }); - } else if (thing === REMOVE_MISC_LIMITS) { - Scratch.vm.setRuntimeOptions({ - miscLimits: !enabled, - }); - } else if (thing === HIGH_QUALITY_PEN) { - Scratch.renderer.setUseHighQualityRender(enabled); - } - } - - setFramerate({ fps }) { - fps = Scratch.Cast.toNumber(fps); - Scratch.vm.setFramerate(fps); - } - - showHideOption(args) { - getButtons(); - if (args.SHOWHIDE === "show") { - if (args.OPTIONSH === "flag" && greenFlag) { - greenFlag.style.display = "block"; - } else if (args.OPTIONSH === "pause" && pauseButton) { - pauseButton.style.display = "block"; - } else if (args.OPTIONSH === "stop" && stopButton) { - stopButton.style.display = "block"; - } else if (args.OPTIONSH === "fullscreen" && fullScreen) { - fullScreen.style.display = "block"; - } - } else if (args.SHOWHIDE === "hide") { - if (args.OPTIONSH === "flag" && greenFlag) { - greenFlag.style.display = "none"; - } else if (args.OPTIONSH === "pause" && pauseButton) { - pauseButton.style.display = "none"; - } else if (args.OPTIONSH === "stop" && stopButton) { - stopButton.style.display = "none"; - } else if (args.OPTIONSH === "fullscreen" && fullScreen) { - fullScreen.style.display = "none"; - } - } - } - - optionShown(args) { - getButtons(); - if (args.OPTION === "flag" && greenFlag) { - return greenFlag.style.display !== "none"; - } else if (args.OPTION === "pause" && pauseButton) { - return pauseButton.style.display !== "none"; - } else if (args.OPTION === "stop" && stopButton) { - return stopButton.style.display !== "none"; - } else if (args.OPTION === "fullscreen" && fullScreen) { - return fullScreen.style.display !== "none"; - } - return false; - } - } - Scratch.extensions.register(new lmsmcutils()); -})(Scratch); From fdd49ac0d2a8b2267bccaf271869746b98204862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Tue, 4 Mar 2025 23:05:00 +0300 Subject: [PATCH 47/63] Update extensions.json --- extensions/extensions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/extensions.json b/extensions/extensions.json index d8ed71e33d..a8370cf4fb 100644 --- a/extensions/extensions.json +++ b/extensions/extensions.json @@ -68,6 +68,7 @@ "DNin/wake-lock", "Skyhigh173/json", "mbw/xml", + "WAYLIVES/SVG", "numerical-encoding-2", "cs2627883/numericalencoding", "SharkPool/Camera", From eaa65e7e5c09e0e2b83cd6a6499db5618e43f3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 10:38:29 +0300 Subject: [PATCH 48/63] Create SVG.md --- docs/WAYLIVES/SVG.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/WAYLIVES/SVG.md diff --git a/docs/WAYLIVES/SVG.md b/docs/WAYLIVES/SVG.md new file mode 100644 index 0000000000..941fc48d7d --- /dev/null +++ b/docs/WAYLIVES/SVG.md @@ -0,0 +1 @@ +# SVG From 9fb195b7ebacc59b4081bc2d4576a7b91f7c11a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 12:51:53 +0300 Subject: [PATCH 49/63] Update SVG.md --- docs/WAYLIVES/SVG.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/WAYLIVES/SVG.md b/docs/WAYLIVES/SVG.md index 941fc48d7d..cf9dd3b309 100644 --- a/docs/WAYLIVES/SVG.md +++ b/docs/WAYLIVES/SVG.md @@ -1 +1,26 @@ # SVG + +SVG - это XML язык, который преднозначен для рисования векторых изображений. Изображения бывают двух видов: растровыми и векторными, так вот с помощью SVG можно рисовать именно векторную графику. + +Пример векторного и растрового изображения: + +Italian Trulli + - Данное изображение принадлежит @WAYLIVES + +## + +С помощью расширения "SVG" Вы сможете создавать код простых SVG изображений, где будут доступны такие элементы: +- линия +- прямоугольник +- круг + +## Блоки +### SVG-frame: +```scratch +(SVG-frame // width:(100) height:(100) elements in svg:(...)) +``` +Без этого блока ничего не будет работать, он задаёт начала и конец векторным изображениям. + +(width) - здесь вы задаёте ширину формата SVG + +(height) - здесь вы задаёте высоту формата SVG From 808a8b5b050f14e31fdcd5d2c41b80543988f1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 13:26:56 +0300 Subject: [PATCH 50/63] Update SVG.md --- docs/WAYLIVES/SVG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/WAYLIVES/SVG.md b/docs/WAYLIVES/SVG.md index cf9dd3b309..bba7cd25de 100644 --- a/docs/WAYLIVES/SVG.md +++ b/docs/WAYLIVES/SVG.md @@ -19,8 +19,16 @@ SVG - это XML язык, который преднозначен для рис ```scratch (SVG-frame // width:(100) height:(100) elements in svg:(...)) ``` -Без этого блока ничего не будет работать, он задаёт начала и конец векторным изображениям. +Без этого блока ничего не будет работать, он задаёт начало и конец векторным изображениям. (width) - здесь вы задаёте ширину формата SVG (height) - здесь вы задаёте высоту формата SVG + +(elements in svg) - сюда вы можете вставлять SVG элементы, с помощью которых будете рисовать изображения + +### Line: + +```scratch +(SVG-frame // width:(100) height:(100) elements in svg:(...)) +``` From d06fcd9323f13ab66143d9889304c354eaeb14ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 15:40:33 +0300 Subject: [PATCH 51/63] Update SVG.md --- docs/WAYLIVES/SVG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/WAYLIVES/SVG.md b/docs/WAYLIVES/SVG.md index bba7cd25de..f1edaf46a2 100644 --- a/docs/WAYLIVES/SVG.md +++ b/docs/WAYLIVES/SVG.md @@ -4,7 +4,7 @@ SVG - это XML язык, который преднозначен для рис Пример векторного и растрового изображения: -Italian Trulli +Italian Trulli- Данное изображение принадлежит @WAYLIVES ## @@ -32,3 +32,4 @@ SVG - это XML язык, который преднозначен для рис ```scratch (SVG-frame // width:(100) height:(100) elements in svg:(...)) ``` +## П From 7afe800e15eaebb598252a8f7fe8b8df63085b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 16:20:22 +0300 Subject: [PATCH 52/63] Update SVG.md --- docs/WAYLIVES/SVG.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/WAYLIVES/SVG.md b/docs/WAYLIVES/SVG.md index f1edaf46a2..e46fa57ed2 100644 --- a/docs/WAYLIVES/SVG.md +++ b/docs/WAYLIVES/SVG.md @@ -4,7 +4,7 @@ SVG - это XML язык, который преднозначен для рис Пример векторного и растрового изображения: -Italian Trulli +- Данное изображение принадлежит @WAYLIVES ## @@ -17,8 +17,10 @@ SVG - это XML язык, который преднозначен для рис ## Блоки ### SVG-frame: ```scratch -(SVG-frame // width:(100) height:(100) elements in svg:(...)) +(SVG-frame // width:[100] height:[100] elements in svg:[...] :: #9823FF) ``` + + Без этого блока ничего не будет работать, он задаёт начало и конец векторным изображениям. (width) - здесь вы задаёте ширину формата SVG @@ -29,7 +31,30 @@ SVG - это XML язык, который преднозначен для рис ### Line: +```scratch +(LINE // x1, y1:[4][4] x2, y2:[96][96] width:[8] color:[#FF0000] opacity:[100]% dash, gap:[0][0] linecap:[round v] :: #9823FF) +``` + + +### Rect: + +```scratch +(RECT // x, y:[4][4] width:[92] height:[92] radius:[20] fill color:[#FF0000] fill opacity:[100]% stroke width:[8] stroke color[#000000] stroke opacity:[100]% dash, gap:[0][0] stroke linecap:[round v] :: #9823FF) +``` + + +### Ellipse: + +```scratch +(ELLIPSE // cx, cy:[50][50] width:[92] height:[92] fill color:[#FF0000] fill opacity:[100]% stroke width:[8] stroke color[#000000] stroke opacity:[100]% dash, gap:[0][0] stroke linecap:[round v] :: #9823FF) +``` + + +## Пример-проект + ```scratch (SVG-frame // width:(100) height:(100) elements in svg:(...)) ``` -## П + + + From 385cc0fc11a58cf64a42db48235ef6aad325d3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 17:35:36 +0300 Subject: [PATCH 53/63] Update SVG.md --- docs/WAYLIVES/SVG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/WAYLIVES/SVG.md b/docs/WAYLIVES/SVG.md index e46fa57ed2..b2d63e4553 100644 --- a/docs/WAYLIVES/SVG.md +++ b/docs/WAYLIVES/SVG.md @@ -36,6 +36,22 @@ SVG - это XML язык, который преднозначен для рис ``` +С помощью этого блока можно рисовать линии. + +(x1), (y2) - это положение первой точки линии по каардинату X, Y (координаты SVG: https://developer.mozilla.org/ru/docs/Web/SVG/Tutorial/Positions). + +(x2), (y2) - это положение конечной (второй) точки линии по координату X, Y. + +(width) - здесь вы можете задать толщину линии. + +(color) - здесь вы задаёте цвет линии. + +(opacity) - здесь вы задаёте прозрачность линии. + +(dash), (gap) - с помощью этих параметров вы можете задать тип линии. Dash - это длина пунктирных линий. Gap - это отступ, т.е. расстояние между пунктирными линиями. + +(linecap) - здесь вы можете задать форму концов линии (подробнее здесь: https://developer.mozilla.org/ru/docs/Web/SVG/Attribute/stroke-linecap). + ### Rect: ```scratch @@ -43,6 +59,8 @@ SVG - это XML язык, который преднозначен для рис ``` +С помощью этого блока можно рисовать прямоугольники, квадраты. + ### Ellipse: ```scratch @@ -50,6 +68,8 @@ SVG - это XML язык, который преднозначен для рис ``` +С помощью этого блока можно рисовать круги и овалы. + ## Пример-проект ```scratch From 4fdd1341b478f1b63773075c59462b9a3bff2fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 18:10:07 +0300 Subject: [PATCH 54/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index aa4dff27ab..180abb992b 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -10,7 +10,7 @@ "use strict"; if (!Scratch.extensions.unsandboxed) { - throw new Error("This example must run unsandboxed"); + throw new Error("svg"); } class svg { From 41ea5799b4c9e3e23919aa5ff68814cfd7a3d6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 18:14:04 +0300 Subject: [PATCH 55/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index 180abb992b..d94412cc0e 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -26,7 +26,7 @@ opcode: "svg", blockType: Scratch.BlockType.REPORTER, text: Scratch.translate( - "SVG-frame // width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]" + "SVG-frame / width: [WIDTH] height: [HEIGHT] elements in svg: [ELEMENTS]" ), arguments: { WIDTH: { @@ -50,7 +50,7 @@ opcode: "line", blockType: Scratch.BlockType.REPORTER, text: Scratch.translate( - "LINE // x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]" + "LINE / x1, y1: [XA][YA] x2, y2: [XB][YB] width: [WIDTH] color: [COLOR] opacity: [OPACITY]% dash, gap: [DASH][GAP] linecap: [LINECAP]" ), arguments: { XA: { @@ -100,7 +100,7 @@ opcode: "rect", blockType: Scratch.BlockType.REPORTER, text: Scratch.translate( - "RECT // x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" + "RECT / x, y: [X][Y] width: [WIDTH] height: [HEIGHT] radius: [RADIUS] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" ), arguments: { X: { @@ -162,7 +162,7 @@ opcode: "ellipse", blockType: Scratch.BlockType.REPORTER, text: Scratch.translate( - "ELLIPSE // cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" + "ELLIPSE / cx, cy: [CX][CY] width: [WIDTH] height: [HEIGHT] fill color: [FILLCOLOR] fill opacity: [FILLOPACITY]% stroke width: [STROKEWIDTH] stroke color: [STROKECOLOR] stroke opacity: [STROKEOPACITY]% dash, gap: [DASH][GAP] stroke linecap: [LINECAP]" ), arguments: { CX: { From d9f1c7a7ea7a0343db583b9d6b36df28943b9946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 19:20:28 +0300 Subject: [PATCH 56/63] Delete images/WAYLIVES/Window Settings.svg --- images/WAYLIVES/Window Settings.svg | 194 ---------------------------- 1 file changed, 194 deletions(-) delete mode 100644 images/WAYLIVES/Window Settings.svg diff --git a/images/WAYLIVES/Window Settings.svg b/images/WAYLIVES/Window Settings.svg deleted file mode 100644 index f83fe092d7..0000000000 --- a/images/WAYLIVES/Window Settings.svg +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 50a33246522a90859aea718c5201113b4622b549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 22:04:37 +0300 Subject: [PATCH 57/63] Update SVG.md --- docs/WAYLIVES/SVG.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/docs/WAYLIVES/SVG.md b/docs/WAYLIVES/SVG.md index b2d63e4553..172f3829d9 100644 --- a/docs/WAYLIVES/SVG.md +++ b/docs/WAYLIVES/SVG.md @@ -46,12 +46,16 @@ SVG - это XML язык, который преднозначен для рис (color) - здесь вы задаёте цвет линии. -(opacity) - здесь вы задаёте прозрачность линии. +(opacity) - здесь вы задаёте прозрачность линии в процентах (%). (dash), (gap) - с помощью этих параметров вы можете задать тип линии. Dash - это длина пунктирных линий. Gap - это отступ, т.е. расстояние между пунктирными линиями. (linecap) - здесь вы можете задать форму концов линии (подробнее здесь: https://developer.mozilla.org/ru/docs/Web/SVG/Attribute/stroke-linecap). +Linecap: + + + ### Rect: ```scratch @@ -61,6 +65,26 @@ SVG - это XML язык, который преднозначен для рис С помощью этого блока можно рисовать прямоугольники, квадраты. +(x), (y) - это положение начальной точки прямоугольника по каардинату X, Y. + +(width), (height) - это ширина и высота прямоугольника. + +(radius) - здесь вы задаёте скругление углов прямоугольника. + +(fill color) - здесь вы задаёте цвет заливки прямоугольника. + +(fill opacity) - здесь вы задаёте прозрачность заливки прямоугольника в процентах (%). + +(stroke width) - здесь вы задаёте толщина обводки прямоугольника. + +(stroke color) - здесь вы задаёте цвет обводки. + +(stroke opacity) - здесь вы задаёте прозрачность обводки. + +(dash), (gap) - с помощью этих параметров вы можете задать тип линии. Dash - это длина пунктирных линий. Gap - это отступ, т.е. расстояние между пунктирными линиями. + +(linecap) - здесь вы можете задать форму концов линии. + ### Ellipse: ```scratch @@ -70,6 +94,24 @@ SVG - это XML язык, который преднозначен для рис С помощью этого блока можно рисовать круги и овалы. +(cx), (cy) - это положение центральной точки окружности по каардинату X, Y. + +(width), (height) - это ширина и высота окружности. + +(fill color) - здесь вы задаёте цвет заливки. + +(fill opacity) - здесь вы задаёте прозрачность заливки в процентах (%). + +(stroke width) - здесь вы задаёте толщина обводки окружности. + +(stroke color) - здесь вы задаёте цвет обводки. + +(stroke opacity) - здесь вы задаёте прозрачность обводки. + +(dash), (gap) - с помощью этих параметров вы можете задать тип линии. Dash - это длина пунктирных линий. Gap - это отступ, т.е. расстояние между пунктирными линиями. + +(linecap) - здесь вы можете задать форму концов линии. + ## Пример-проект ```scratch From 2645267845119cf89e1e6cc61f10dbee624a0ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 22:49:16 +0300 Subject: [PATCH 58/63] Update SVG.md --- docs/WAYLIVES/SVG.md | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/docs/WAYLIVES/SVG.md b/docs/WAYLIVES/SVG.md index 172f3829d9..5a61ae6c52 100644 --- a/docs/WAYLIVES/SVG.md +++ b/docs/WAYLIVES/SVG.md @@ -1,18 +1,18 @@ # SVG -SVG - это XML язык, который преднозначен для рисования векторых изображений. Изображения бывают двух видов: растровыми и векторными, так вот с помощью SVG можно рисовать именно векторную графику. +SVG is an XML language that is designed for drawing vector images. There are two types of images: raster and vector, so using SVG you can draw vector graphics. -Пример векторного и растрового изображения: +Example: - - Данное изображение принадлежит @WAYLIVES + - This image belongs to @WAYLIVES ## -С помощью расширения "SVG" Вы сможете создавать код простых SVG изображений, где будут доступны такие элементы: -- линия -- прямоугольник -- круг +Using the "SVG" extension, you can create code for simple SVG images, where the following elements will be available: +- line +- rectangle +- circle ## Блоки ### SVG-frame: @@ -21,13 +21,13 @@ SVG - это XML язык, который преднозначен для рис ``` -Без этого блока ничего не будет работать, он задаёт начало и конец векторным изображениям. +Nothing will work without this block, it sets the beginning and end of vector images. -(width) - здесь вы задаёте ширину формата SVG +(width) - here you set the width of the SVG format -(height) - здесь вы задаёте высоту формата SVG +(height) - here you set the height of the SVG format -(elements in svg) - сюда вы можете вставлять SVG элементы, с помощью которых будете рисовать изображения +(elements in svg) - here you can insert SVG elements with which you will draw images. ### Line: @@ -36,21 +36,21 @@ SVG - это XML язык, который преднозначен для рис ``` -С помощью этого блока можно рисовать линии. +You can use this block to draw lines. -(x1), (y2) - это положение первой точки линии по каардинату X, Y (координаты SVG: https://developer.mozilla.org/ru/docs/Web/SVG/Tutorial/Positions). +(x1), (y2) - is the position of the first point of the line along the X, Y coordinate (SVG coordinates: https://developer.mozilla.org/en/docs/Web/SVG/Tutorial/Positions ). -(x2), (y2) - это положение конечной (второй) точки линии по координату X, Y. +(x2), (y2) - is the position of the end (second) point of the line along the X, Y coordinate. -(width) - здесь вы можете задать толщину линии. +(width) - here you can set the line thickness. -(color) - здесь вы задаёте цвет линии. +(color) - here you set the color of the line. -(opacity) - здесь вы задаёте прозрачность линии в процентах (%). +(opacity) - here you set the transparency of the line as a percentage (%). -(dash), (gap) - с помощью этих параметров вы можете задать тип линии. Dash - это длина пунктирных линий. Gap - это отступ, т.е. расстояние между пунктирными линиями. +(dash), (gap) - you can use these parameters to set the line type. Dash is the length of the dotted lines. Gap is the indentation, i.e. the distance between the dotted lines. -(linecap) - здесь вы можете задать форму концов линии (подробнее здесь: https://developer.mozilla.org/ru/docs/Web/SVG/Attribute/stroke-linecap). +(linecap) - here you can set the shape of the line ends (more details here: https://developer.mozilla.org/en/docs/Web/SVG/Attribute/stroke-linecap ). Linecap: @@ -63,27 +63,27 @@ Linecap: ``` -С помощью этого блока можно рисовать прямоугольники, квадраты. +You can use this block to draw rectangles and squares. -(x), (y) - это положение начальной точки прямоугольника по каардинату X, Y. +(x), (y) - is the position of the rectangle's starting point along the X, Y coordinate. -(width), (height) - это ширина и высота прямоугольника. +(width), (height) - are the width and height of the rectangle. -(radius) - здесь вы задаёте скругление углов прямоугольника. +(radius) - here you set the rounded corners of the rectangle. -(fill color) - здесь вы задаёте цвет заливки прямоугольника. +(fill color) - here you set the fill color of the rectangle. -(fill opacity) - здесь вы задаёте прозрачность заливки прямоугольника в процентах (%). +(fill opacity) - here you set the transparency of the rectangle fill as a percentage (%). -(stroke width) - здесь вы задаёте толщина обводки прямоугольника. +(stroke width) - here you set the stroke thickness of the rectangle. -(stroke color) - здесь вы задаёте цвет обводки. +(stroke color) - here you set the stroke color. -(stroke opacity) - здесь вы задаёте прозрачность обводки. +(stroke opacity) - here you set the transparency of the stroke. -(dash), (gap) - с помощью этих параметров вы можете задать тип линии. Dash - это длина пунктирных линий. Gap - это отступ, т.е. расстояние между пунктирными линиями. +(dash), (gap) - you can use these parameters to set the line type. Dash is the length of the dotted lines. Gap is the indentation, i.e. the distance between the dotted lines. -(linecap) - здесь вы можете задать форму концов линии. +(linecap) - here you can set the shape of the line ends. ### Ellipse: @@ -92,25 +92,25 @@ Linecap: ``` -С помощью этого блока можно рисовать круги и овалы. +You can use this block to draw circles and ovals. -(cx), (cy) - это положение центральной точки окружности по каардинату X, Y. +(cx), (cy) - is the position of the center point of the circle along the X, Y coordinate. -(width), (height) - это ширина и высота окружности. +(width), (height) - are the width and height of the circle. -(fill color) - здесь вы задаёте цвет заливки. +(fill color) - here you set the fill color. -(fill opacity) - здесь вы задаёте прозрачность заливки в процентах (%). +(fill opacity) - here you set the transparency of the fill as a percentage (%). -(stroke width) - здесь вы задаёте толщина обводки окружности. +(stroke width) - here you set the thickness of the circle outline. -(stroke color) - здесь вы задаёте цвет обводки. +(stroke color) - here you set the stroke color. -(stroke opacity) - здесь вы задаёте прозрачность обводки. +(stroke opacity) - here you set the transparency of the stroke. -(dash), (gap) - с помощью этих параметров вы можете задать тип линии. Dash - это длина пунктирных линий. Gap - это отступ, т.е. расстояние между пунктирными линиями. +(dash), (gap) - you can use these parameters to set the line type. Dash is the length of the dotted lines. Gap is the indentation, i.e. the distance between the dotted lines. -(linecap) - здесь вы можете задать форму концов линии. +(linecap) - here you can set the shape of the line ends. ## Пример-проект From 0955787aaa2995979aab1a1748df8163b7123112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 22:52:27 +0300 Subject: [PATCH 59/63] Add files via upload --- samples/SVG.sb3 | Bin 0 -> 5555 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 samples/SVG.sb3 diff --git a/samples/SVG.sb3 b/samples/SVG.sb3 new file mode 100644 index 0000000000000000000000000000000000000000..1fc10db7261369c6c60002000a3456d027c2dd16 GIT binary patch literal 5555 zcma)Abx;&;w_X~SZX}j<1?gHA7Nn6{8l+vqrMuGwTtZShq#FdJTaZqXP=uvbK;TC= z62kSH`^R_hH*;t1d)_l=&Y5}6%=6bX=h4-`!v_KY0Ahf3psiWY%WGQ%1pokw1OUkX zPCdNboouar1f9Iy-S*8%-IpY2?)W4H!dzbsrf>V#`@gb8eDqDJ-S?yQd5Piw(#mYA z&m-CJe4~fmGH4-%U$XVtB`a}^5=GR&&yk1rO1yITsw$7R=lid=*u(5DSp)GSy@|Ab zR$7hHqJ`?4pZ(NR$(EjeSpMf2&AXkg75j$@lvZBmTgM`|Lm63gYy49DrY>@U1b9^F8d$ z8jB?(QX^7bh_Wb;KHHj{q^K#-8$_jXR>bmGeY!AFQ7a!?OQtKtisA7#Mv4+X8@W;q zxM6=EEmv6UoI##Q2dOaNIQz8RS@zX9hSlL<^@?0iSx<8|N&Vf!dKi<9Q*;2`0-23A zxv#C1x`mWU+~z^vQi7tg<`RX-HwwKC0{8+2<%^VUlqN3&9(QU#H=ZYWKu%60r$6`^ z!0kJLy1idRxy`-QLu&3Y2WZ&KAYyc-yx4$gfC#pgGzKG+H%hWLC>h3_2g#;GiYj|G zCOA+)$F~pPxXkoB)V7Cr0K=?1sF=sg6wgewUG4p4GcfQB&hJ#1t~j=!OH@vC_*F6T zN^FsOfjtFF!81=m36gtQ3%Oa}av#YQ3J{T$FMrPqeXf^czhVIT{Sl@8c-q4|jYsi! z<%`A1G=3drMft-8<_sY-qQ;X#$V^IozQIDWkR~jdEmy&~EX-wT+Ohh#sUF544OnIJ zS>vg%1Sm}DTK$YXzq&(7x-SQWeN@A_ zPO^bDo|@Ho>_wBb(MjXQV^uqEUlgSk>U!yN7p=IPzfd@-2#b+niShYlBC0~xpOe`} zpTfBHVDirl6Z2DZ5YLBlY57^kCE{qUClV@Ih;wM2`{P_=U&M!?L%jn+2&62~M)Gl7v1N)7tSQWV`Xfg0OZ`b>wkh zUp=V`tWM%~qTD&-xa{NhfxjYXr*`?{at>vSN+;`n9=7T7leosM@njn# z$F6fhvQIO7OmFIwzB*dAF-sdd*uy#Y%MuFfw_LbL+Tpa15k10$vgVd$svmQmoLKS6 zv#CYJip@3OI3U6Yo#SWB0vLMCwqMG3{FV<{CP-p$!VSDd#gRcUWGKvMlvfU+*Q?!f3_6`{)YuvC%2Pu= zzZ}O4B97*e+s7T#F-?{ZZb01qN=E0gjbWW1T{&u~8R=))Xhpvv`z@cpk2~7*Uf!s2 zP((f1Gu}Z+7x>B-$7iqR5TtPRSSrnZ?)8a_hVET9@Y4V|jU81e{hc5!s&XSzA+Tq7 z^d^|`BxH)tpQQ8aU41n_p+$g%$BWPOkP&2MlE_h`pY*Zs@Xx5d^`n8s^`o1N;i3#6 z_5+o3X)qG&huJlIjC2-h_mh%gq8BPJ(30OwT4T7y3P5h^_D1iVU2U+f5qnVvqj$_o z7aW8O=jPzfeBXw%qf>#5xu9Q7%3%K{ypB%sq}}JZCujtuQHo1D_NZ#TwbkX+N#k96 z4Ur~GMO9rdg+IS_rQ|));n30gh5C^25+zxIfN@oe@}P&3?Ab zWbvLSNzRVwWTXYNybMe#z%JK(ni$82iaRFk?sD@fTd?(b+u5joSR&FVieP@v8r zn%${KCZGI5>+u)>)hmIosOI}V#EQESIa_>AC!Ixi=;QnXjxttL-a^Cx5<9QWF&+pAezWB-+Ji7B7E1wF-h^T!(<0p?iMZ;?gPJFZLudg6}SBrXFo+ ze(6Q0B&Umh*>+W(*>dOcJ*XZ}&1&^tX!Ox4^6LJ>EBC223^pz)L&$hWQzycka4Lqz z-uMLa&vnK7rE=b{3@wK}&>9V}N{BDU6z<7S;za94(WQ4-6kv=A?EOXZ38Z2bV!n1iL4k>4#GjobvLk;@=%0GPh!pQBIH?8zTU45d1F?ym|I=m z;dv9z+SYD(4UeMxL&?=b+NhvkSda>#?-!K9MFUa)lWwQP{$|t7;5H1G7mQ{ zlc|?)2aM8;c}^)C%JmN{FlDWG|-(WfH5v?W3e97H+rip_Hfa(-yBfW%3NU%V{==1wW zM7y_5sdY+xL_Co$Yg~Ss0TpwYz({(Cf(Sm5byEWd}0h@t2N}rE7J>UUH2c>Ez@jx}nYP7=gcU480m; z^kPRl%cVxc)QID3^XjRuo;Ez478 zwn%M2VHVSV;YQxM*sv6BF^_JN`6ztHf-J^J$DJLh$Q`lP0Q zY|V`U9nO;lGb|kLa?)?`SEKg|cH3(CR98iB)oYP$v)i4NIK~N`j@_BVdCl~)W{OD4 zu`2QNfoc~x%Q%ERN7BOQsLMF>VYafR&=GLv^m1O+He-;i>x&J)%m}vW_;Plwn7XN%Dde*R?b=41KdG?a+w(Hm&h6~6k1s%d-Dcl@x z>5=z)$svAp-$`n(FPx$qw5B@^zP?BrvWzm(+3<}%S2B+>nbL@EW8eMxvMsdCL#KMi zF?3tGtIIfGRP}g(g&cI|*ahD4Cf?tB=1|dK+>lq?USb^jvgO-Cy3xgCvP6Wx#dFap zunI3d+imslU8+Honmid+)ZYnEhAoUK3Oqbjk^YowopX?HES8U0%^Di;Qi0xPPsCKO z@Rv`KEhLKdymV-+a{0{c3#-JKSHECsWlK^z-4mQwAb>@1w8%ja*&BG~0>$vMQJR9R zNF$HAhs8}5@Mg(C#pBthqjpzgwrYN5vwRYK3BI1vgCkEnzlFpSIFxw-5tZ?AyCkx3 z-GM64@zKCwY%JtLTY^hjI#g~FJ}=?~0&ys`es{FUqvNEZ?!*IlgFOPvu0;rDdo zrJect`CdAKClB#%0o&Ps`emkAQE%O^km#6?0|^G3sXr1`Cng!ay7vrT7-SZdMnGbE zyJ;8}8sxkL1woo^EpP8~xY9qw@rmIfd}r5p)Omdwjd_1l;$T^wrL{qpZ*Q^@=P&OK zg)!vk4vl02jdMEhXG!-)=Kc|kr(Fm*WJ4{qCsa+n{$a3|QL0_^Ixe68K0+nUU-6RD zI>sd=q^x1^!aQ#LwHV+~!iNhZRsMNb3(Q>^gAPX$#vNv!m((2(J^LZTR1`mAqryT> zwp-)K6V_12NYUXD!R`A9ZXXTVn?@jOcA1MMsvFqG`z*_PQjU)-Hd3+6B&k}t1bQhS znyKxd(x{$5<`6lVjJDjBYn-Aq6YEwC6m~CY|9+K+pX8O$spEgJmG1NKwrF_Z8dLzT zb6fZ7*DmgrI)~4;9B=c_h+8by`(XjCcd-YrwDwW>Tf8#`P=n5Ga-uRyHPiue?Tfgp z{3v^+w)7nexli)}a(7{er90x3dE~+zFTPD``-9pV;;4?n{fu6@lM?XOG zYzbJ#zL%jm_d~xD;w@QhQlZJ#g$dJ2$=(#2mUEE+nW_SG3Dh7?gkseSep8 z-h6O4=fB?2Hg0&cbs4(MUS7~z@qKRTPxFf9edC=p$bS8oPZ#^WQ%?218j*j5T@o~P1oG&N;3wSUoYU(a%xb9YhyKqyB>rD3&bw)5O)#>HsA4ilEj zq<-K+MdPn zWb{)vwSKyTI*XYhT#nCja3<<_@3@lZ>1`(}3<@SGdTaekqcKq_FXD z>Jr{$vlUy>NQwvhWQ8l0 z)bPpLvUSl4ZH8xv(YeJ&+O!Jq$-n`R8--@6IJus}`2yFwPeGy54?WID1T7_nH!R0te$GN=paLk4R=vIJ3RM!lT!SV*GrJM_9g; z=jX_d6mgUVPDW{IUjX@>?LX7pfOtQZUgFm{pwe?qDx=m1qA+oj^<;unLq_Q+n<(8^ zIshO(*d0xgApf$zGCK@^I$8-YqW)_!2bd0)1JuOkwo^Zn$5kYImj+4TFeC=WkH$!+ z{R2#YFZu`_Z>0o@#*!(kf5G7mX_u$k#?XX)0@wsKsoNA zNtctuWN;z5?$YTJ_~T;Qt$^BtQ*s_KeU2Rpx3rg(d%n2$j(T8(!JIIRewo9H&8|dW zl}dANOz9Qqge)oJtt+2CV8)Z!nl4A3f&8((6q^`@yrh9^;F5v8!F`u5!*}~NiLlQ@s;xg;CEIO^xV^9+jYM7C0p-Qkk8NJ(;13LRa9kc4Te*u zGWw#&Wt~=n8lb8*YylraXfs`K*4 z+v2lYY7mU2$tG!QurxbBziH+wEBSZ2H&d0p(#C1()o9b!!WaK0=O!Cjxj?->RKSc& z_w}ZUT{!1m(3AdvJdfdBV}jCS$@|2GZbe0~7=O3Eclx`s$ycdS3G#2K`fmdtn&gPn zzklYPPadAkHKMD~L{8WDqlyx3@)o|z3w8dSxg&u4!G9~xF3`X-jKGrTXXKF2I_-p- z9R0?_XV5r$D;6l-uUi`?25fALyorkm?bVr&+ Date: Wed, 5 Mar 2025 22:53:10 +0300 Subject: [PATCH 60/63] Update SVG.md --- docs/WAYLIVES/SVG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/WAYLIVES/SVG.md b/docs/WAYLIVES/SVG.md index 5a61ae6c52..e36108545b 100644 --- a/docs/WAYLIVES/SVG.md +++ b/docs/WAYLIVES/SVG.md @@ -114,9 +114,5 @@ You can use this block to draw circles and ovals. ## Пример-проект -```scratch -(SVG-frame // width:(100) height:(100) elements in svg:(...)) -``` - From a9fa4e14db1fd47ee30ece199a58069e19dcf778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Melentyev=20=E2=98=9D=F0=9F=98=8C=20=28RIHART=29?= <130656326+WAYLIVES@users.noreply.github.com> Date: Wed, 5 Mar 2025 22:55:14 +0300 Subject: [PATCH 61/63] Delete samples/SVG.sb3 --- samples/SVG.sb3 | Bin 5555 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 samples/SVG.sb3 diff --git a/samples/SVG.sb3 b/samples/SVG.sb3 deleted file mode 100644 index 1fc10db7261369c6c60002000a3456d027c2dd16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5555 zcma)Abx;&;w_X~SZX}j<1?gHA7Nn6{8l+vqrMuGwTtZShq#FdJTaZqXP=uvbK;TC= z62kSH`^R_hH*;t1d)_l=&Y5}6%=6bX=h4-`!v_KY0Ahf3psiWY%WGQ%1pokw1OUkX zPCdNboouar1f9Iy-S*8%-IpY2?)W4H!dzbsrf>V#`@gb8eDqDJ-S?yQd5Piw(#mYA z&m-CJe4~fmGH4-%U$XVtB`a}^5=GR&&yk1rO1yITsw$7R=lid=*u(5DSp)GSy@|Ab zR$7hHqJ`?4pZ(NR$(EjeSpMf2&AXkg75j$@lvZBmTgM`|Lm63gYy49DrY>@U1b9^F8d$ z8jB?(QX^7bh_Wb;KHHj{q^K#-8$_jXR>bmGeY!AFQ7a!?OQtKtisA7#Mv4+X8@W;q zxM6=EEmv6UoI##Q2dOaNIQz8RS@zX9hSlL<^@?0iSx<8|N&Vf!dKi<9Q*;2`0-23A zxv#C1x`mWU+~z^vQi7tg<`RX-HwwKC0{8+2<%^VUlqN3&9(QU#H=ZYWKu%60r$6`^ z!0kJLy1idRxy`-QLu&3Y2WZ&KAYyc-yx4$gfC#pgGzKG+H%hWLC>h3_2g#;GiYj|G zCOA+)$F~pPxXkoB)V7Cr0K=?1sF=sg6wgewUG4p4GcfQB&hJ#1t~j=!OH@vC_*F6T zN^FsOfjtFF!81=m36gtQ3%Oa}av#YQ3J{T$FMrPqeXf^czhVIT{Sl@8c-q4|jYsi! z<%`A1G=3drMft-8<_sY-qQ;X#$V^IozQIDWkR~jdEmy&~EX-wT+Ohh#sUF544OnIJ zS>vg%1Sm}DTK$YXzq&(7x-SQWeN@A_ zPO^bDo|@Ho>_wBb(MjXQV^uqEUlgSk>U!yN7p=IPzfd@-2#b+niShYlBC0~xpOe`} zpTfBHVDirl6Z2DZ5YLBlY57^kCE{qUClV@Ih;wM2`{P_=U&M!?L%jn+2&62~M)Gl7v1N)7tSQWV`Xfg0OZ`b>wkh zUp=V`tWM%~qTD&-xa{NhfxjYXr*`?{at>vSN+;`n9=7T7leosM@njn# z$F6fhvQIO7OmFIwzB*dAF-sdd*uy#Y%MuFfw_LbL+Tpa15k10$vgVd$svmQmoLKS6 zv#CYJip@3OI3U6Yo#SWB0vLMCwqMG3{FV<{CP-p$!VSDd#gRcUWGKvMlvfU+*Q?!f3_6`{)YuvC%2Pu= zzZ}O4B97*e+s7T#F-?{ZZb01qN=E0gjbWW1T{&u~8R=))Xhpvv`z@cpk2~7*Uf!s2 zP((f1Gu}Z+7x>B-$7iqR5TtPRSSrnZ?)8a_hVET9@Y4V|jU81e{hc5!s&XSzA+Tq7 z^d^|`BxH)tpQQ8aU41n_p+$g%$BWPOkP&2MlE_h`pY*Zs@Xx5d^`n8s^`o1N;i3#6 z_5+o3X)qG&huJlIjC2-h_mh%gq8BPJ(30OwT4T7y3P5h^_D1iVU2U+f5qnVvqj$_o z7aW8O=jPzfeBXw%qf>#5xu9Q7%3%K{ypB%sq}}JZCujtuQHo1D_NZ#TwbkX+N#k96 z4Ur~GMO9rdg+IS_rQ|));n30gh5C^25+zxIfN@oe@}P&3?Ab zWbvLSNzRVwWTXYNybMe#z%JK(ni$82iaRFk?sD@fTd?(b+u5joSR&FVieP@v8r zn%${KCZGI5>+u)>)hmIosOI}V#EQESIa_>AC!Ixi=;QnXjxttL-a^Cx5<9QWF&+pAezWB-+Ji7B7E1wF-h^T!(<0p?iMZ;?gPJFZLudg6}SBrXFo+ ze(6Q0B&Umh*>+W(*>dOcJ*XZ}&1&^tX!Ox4^6LJ>EBC223^pz)L&$hWQzycka4Lqz z-uMLa&vnK7rE=b{3@wK}&>9V}N{BDU6z<7S;za94(WQ4-6kv=A?EOXZ38Z2bV!n1iL4k>4#GjobvLk;@=%0GPh!pQBIH?8zTU45d1F?ym|I=m z;dv9z+SYD(4UeMxL&?=b+NhvkSda>#?-!K9MFUa)lWwQP{$|t7;5H1G7mQ{ zlc|?)2aM8;c}^)C%JmN{FlDWG|-(WfH5v?W3e97H+rip_Hfa(-yBfW%3NU%V{==1wW zM7y_5sdY+xL_Co$Yg~Ss0TpwYz({(Cf(Sm5byEWd}0h@t2N}rE7J>UUH2c>Ez@jx}nYP7=gcU480m; z^kPRl%cVxc)QID3^XjRuo;Ez478 zwn%M2VHVSV;YQxM*sv6BF^_JN`6ztHf-J^J$DJLh$Q`lP0Q zY|V`U9nO;lGb|kLa?)?`SEKg|cH3(CR98iB)oYP$v)i4NIK~N`j@_BVdCl~)W{OD4 zu`2QNfoc~x%Q%ERN7BOQsLMF>VYafR&=GLv^m1O+He-;i>x&J)%m}vW_;Plwn7XN%Dde*R?b=41KdG?a+w(Hm&h6~6k1s%d-Dcl@x z>5=z)$svAp-$`n(FPx$qw5B@^zP?BrvWzm(+3<}%S2B+>nbL@EW8eMxvMsdCL#KMi zF?3tGtIIfGRP}g(g&cI|*ahD4Cf?tB=1|dK+>lq?USb^jvgO-Cy3xgCvP6Wx#dFap zunI3d+imslU8+Honmid+)ZYnEhAoUK3Oqbjk^YowopX?HES8U0%^Di;Qi0xPPsCKO z@Rv`KEhLKdymV-+a{0{c3#-JKSHECsWlK^z-4mQwAb>@1w8%ja*&BG~0>$vMQJR9R zNF$HAhs8}5@Mg(C#pBthqjpzgwrYN5vwRYK3BI1vgCkEnzlFpSIFxw-5tZ?AyCkx3 z-GM64@zKCwY%JtLTY^hjI#g~FJ}=?~0&ys`es{FUqvNEZ?!*IlgFOPvu0;rDdo zrJect`CdAKClB#%0o&Ps`emkAQE%O^km#6?0|^G3sXr1`Cng!ay7vrT7-SZdMnGbE zyJ;8}8sxkL1woo^EpP8~xY9qw@rmIfd}r5p)Omdwjd_1l;$T^wrL{qpZ*Q^@=P&OK zg)!vk4vl02jdMEhXG!-)=Kc|kr(Fm*WJ4{qCsa+n{$a3|QL0_^Ixe68K0+nUU-6RD zI>sd=q^x1^!aQ#LwHV+~!iNhZRsMNb3(Q>^gAPX$#vNv!m((2(J^LZTR1`mAqryT> zwp-)K6V_12NYUXD!R`A9ZXXTVn?@jOcA1MMsvFqG`z*_PQjU)-Hd3+6B&k}t1bQhS znyKxd(x{$5<`6lVjJDjBYn-Aq6YEwC6m~CY|9+K+pX8O$spEgJmG1NKwrF_Z8dLzT zb6fZ7*DmgrI)~4;9B=c_h+8by`(XjCcd-YrwDwW>Tf8#`P=n5Ga-uRyHPiue?Tfgp z{3v^+w)7nexli)}a(7{er90x3dE~+zFTPD``-9pV;;4?n{fu6@lM?XOG zYzbJ#zL%jm_d~xD;w@QhQlZJ#g$dJ2$=(#2mUEE+nW_SG3Dh7?gkseSep8 z-h6O4=fB?2Hg0&cbs4(MUS7~z@qKRTPxFf9edC=p$bS8oPZ#^WQ%?218j*j5T@o~P1oG&N;3wSUoYU(a%xb9YhyKqyB>rD3&bw)5O)#>HsA4ilEj zq<-K+MdPn zWb{)vwSKyTI*XYhT#nCja3<<_@3@lZ>1`(}3<@SGdTaekqcKq_FXD z>Jr{$vlUy>NQwvhWQ8l0 z)bPpLvUSl4ZH8xv(YeJ&+O!Jq$-n`R8--@6IJus}`2yFwPeGy54?WID1T7_nH!R0te$GN=paLk4R=vIJ3RM!lT!SV*GrJM_9g; z=jX_d6mgUVPDW{IUjX@>?LX7pfOtQZUgFm{pwe?qDx=m1qA+oj^<;unLq_Q+n<(8^ zIshO(*d0xgApf$zGCK@^I$8-YqW)_!2bd0)1JuOkwo^Zn$5kYImj+4TFeC=WkH$!+ z{R2#YFZu`_Z>0o@#*!(kf5G7mX_u$k#?XX)0@wsKsoNA zNtctuWN;z5?$YTJ_~T;Qt$^BtQ*s_KeU2Rpx3rg(d%n2$j(T8(!JIIRewo9H&8|dW zl}dANOz9Qqge)oJtt+2CV8)Z!nl4A3f&8((6q^`@yrh9^;F5v8!F`u5!*}~NiLlQ@s;xg;CEIO^xV^9+jYM7C0p-Qkk8NJ(;13LRa9kc4Te*u zGWw#&Wt~=n8lb8*YylraXfs`K*4 z+v2lYY7mU2$tG!QurxbBziH+wEBSZ2H&d0p(#C1()o9b!!WaK0=O!Cjxj?->RKSc& z_w}ZUT{!1m(3AdvJdfdBV}jCS$@|2GZbe0~7=O3Eclx`s$ycdS3G#2K`fmdtn&gPn zzklYPPadAkHKMD~L{8WDqlyx3@)o|z3w8dSxg&u4!G9~xF3`X-jKGrTXXKF2I_-p- z9R0?_XV5r$D;6l-uUi`?25fALyorkm?bVr&+ Date: Fri, 7 Mar 2025 09:01:28 +0300 Subject: [PATCH 62/63] Update 1.0.1.js --- extensions/WAYLIVES/SVG/1.0.1.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index d94412cc0e..e6ac8bbacf 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -21,7 +21,15 @@ color1: "#9823FF", color2: "#7C2DC1", color3: "#2D3548", + docsURI: "https://extensions.turbowarp.org/WAYLIVES/SVG", blocks: [ + + "---", + + { + blockType: Scratch.BlockType.LABEL, + text: Scratch.translate("The basis of SVG:"), + }, { opcode: "svg", blockType: Scratch.BlockType.REPORTER, @@ -46,6 +54,10 @@ "---", + { + blockType: Scratch.BlockType.LABEL, + text: Scratch.translate("SVG elements:"), + }, { opcode: "line", blockType: Scratch.BlockType.REPORTER, From 5b3ee0a6cca42bac18f29af1795716650a6c7372 Mon Sep 17 00:00:00 2001 From: "DangoCat[bot]" Date: Fri, 7 Mar 2025 08:09:05 +0000 Subject: [PATCH 63/63] [Automated] Format code --- extensions/WAYLIVES/SVG/1.0.1.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions/WAYLIVES/SVG/1.0.1.js b/extensions/WAYLIVES/SVG/1.0.1.js index e6ac8bbacf..ac852e215c 100644 --- a/extensions/WAYLIVES/SVG/1.0.1.js +++ b/extensions/WAYLIVES/SVG/1.0.1.js @@ -23,9 +23,8 @@ color3: "#2D3548", docsURI: "https://extensions.turbowarp.org/WAYLIVES/SVG", blocks: [ - "---", - + { blockType: Scratch.BlockType.LABEL, text: Scratch.translate("The basis of SVG:"),