名前からブロックを追加

名前からブロックを追加
名前からブロックを追加
ID middle-click-popup
Description コードエリアにてマウスの中ボタンを押すか、Ctrl+スペースまたはShift+クリックで表示される入力欄にブロックの名前を入力してドラッグすると、ブロックを追加できる。Shiftキーを押しながらドラッグすると、画面を閉じずに複数のブロックを追加できる。
クレジット
タグ editor codeEditor recommended
Version added 1.30.0
Latest update 1.31.0 major
Informations
  • このアドオンは以前「開発者ツール」の一部でしたが、移動しました。
Feature flags Enabled by default
ソースコード · Scratch Addon settings

Insert blocks by name is an addon which allows users to code more quickly by typing the name of blocks and inserting them at their mouse position, rather than having to search for them in the flyout. The popup is opened by middle clicking in the workspace or pressing ctrl + space. You can then type to search for blocks and using the mouse to grab one out of the popup.

Background

The original version was made by Griffpatch for the Developer Tools extension. As part of a work to separate features from the Developer tools as individual addons, this addon has been made to its own addon.

機能

  • The searching supports any block in the workspace. This includes custom blocks, blocks from extensions and variable / lists.
  • You can use the arrow keys and enter to navigate the search results for even faster insertion.
  • When a result is highlighted, you can press tab to autocomplete your search to that block.
  • The popup can insert multiple nested blocks at the same time, by typing something like “move my variable + 10 steps”.
  • For mathematical blocks, the order of operations applies by default, but you can use brackets to change the order.
  • You can surround text in double quotes to force the searcher not to turn your text into blocks. This is useful for sitruations like trying to say the text “x position” instead of the variable x position, where you could type say “x position”.

設定

ポップアップのブロックの大きさ

Controls how big the blocks inside the menu appear. It is the height in pixels of a single block.

ポップアップの横幅

Controls how wide the popup is. This is a percentage of the width of the entire window.

ポップアップの最大の縦幅

Controls how tall the popup can be before a scrollbar appears. This is a percentage of the hight of the entire window.

今後の計画

  • The popup should be resizable by dragging one of the corners in the editor instead of having to change a setting.
  • Adding string interpolation for strings in quotes could really help out situatoins where a lot of join blocks would normally have to be tediously arranged.

既知の問題点

  • The blocks inside the popup of this addon will not respect the settings from the Customizable block shapes addon.
  • The alogithm for sorting the search results still needs a lot of work, and sometimes the result you are probably looking for is hidden below a mountain of worse results.

Credit

Tacodiva made most of the addon as it stands today. Additionally, Griffpatch helped a lot by providing feedback and finding bugs in the overhauled version.

更新履歴

This page needs to be updated. Please help updating it to reflect any newly available information.

  • v1.30.0 The insert blocks by name addon was created.
  • v1.31.0 The addon was completely overhauled, allowing for nesting blocks, adding autocomplete and changing how the blocks where shown in the popup.
  • v1.31.1 The algorithm for searching was altered and several bugs where fixed.

トリビア

  • This was the first addon page written for the Addon Docs!
  • Despite only recently becoming its own addon, the middle click popup is one of the oldest features of Scratch Addons being a part of dev tools sense the beginning.
  • The original code for the popup was created before Scratch Addons even existed by Griffpatch in 2019.
  • When Tacodiva overhauled the addon for v1.31.0, the code had almost 2,800 lines of code added and 149 commits!
  • The name of the Git branch for the overhaul was idk-what-im-doing.
  • Tacodiva was struggling to fix an issue so much, that despite only contributing two lines of CSS to fix the problem, CST1229 is in the addon’s credits!

This section needs expansion. You can help by adding to it.

This section needs expansion. You can help by adding to it.