User:Anaminus/CmdUtl/doc

From Legacy Roblox Wiki
Jump to navigationJump to search

Utility Panel

The Utility Panel is a GUI that is located in the upper-left corner of the screen. It holds all the various tools and buttons included in CmdUtl. Here are the elements you might see in the panel:

  • Button: An object that is used for display or can be interacted with. There are 5 types of Buttons:
    • Tool: A selectable tool that performs an action.
    • Field: Allows text to be entered by the user.
    • Label: A display of text.
    • Toggle: A clickable switch that can be turned on and off.
    • Container: A frame that holds more Buttons in the space of one.
  • Control Button: A button that appears on the right edge of the Utility Panel.
  • Menu: A frame that groups Buttons together.
  • Menu Button: A button that can be clicked to expand/collapse a Menu.
  • Separator: A line that separates Built-in menus from plugin menus.

Built-in Menus

The Built-in Menus hold the primary tools and buttons included with CmdUtl.

Each tool manipulates the objects you currently have selected in some way. To use a tool, first select all the objects you want to manipulate, then press the button associated with the tool you want to use. When objects are moved, they will not collide with other parts, allowing you to, for example, move one brick inside another. Note that deselecting objects will have no effect until the tool is deselected. Also note that all parts are recursively searched for in a selection. For example, if you select a Model, any descendants that are parts will be affected.

For help with each specific tool, click the Help (?) button. This will turn on Help Mode, which displays a description for each tool when you hover over it.

Command Line Functions

Command Line Functions provide shortcuts when you're performing an action in the command bar. While most commands are used for manipulating selected objects, they can really be used to speed up or shorten any repetitive task.

To use a command that involves the selection, first select all the objects you want to be affected, type the command into the command bar, and press enter. If the command manipulates parts, they will be recursively searched for in the selection. If the command moves parts in some way, they will not collide with other parts when moved.

The following example rotates each selected part on its y-axis by 90 degrees:

r(0,90,0)

As you can see, the commands are designed to be typed in quickly.


Commands can be activated by running any of the following functions in the command bar:

  • _G.CmdUtl()</syntaxhighlight>
  • _G.cu()</syntaxhighlight>

For help with specific commands, type help()</syntaxhighlight> to display a list of possible commands, or help(command)</syntaxhighlight> to display detailed help for a command.

config Table

config is a table of values located at the top of the source code. This table is used to configure the behavior and appearance of CmdUtl.

The following variables can be used to configure CmdUtl:

Variable Type Description
button_font Enum.Font The font that will be used on buttons and descriptions.
button_font_size Enum.FontSize The size of the font.
button_size_x number The width of buttons, in pixels.
button_size_y number The height of buttons, in pixels.
control_size number The size of the control buttons.
desc_padding number How many pixels to offset description boxes from the edge of the panel.
desc_width_max number The maximum width description boxes, in pixels.
menu_auto_collapse bool Indicates whether menus will automatically collapse when a tool is deselected via shortcut key.
menu_indent number The length of indentation of menus, in pixels.
plugin_safe_mode bool Indicates whether Safe Mode is on or off. If Safe Mode is on, only plugins that are considered safe will be accepted.
shortcut_keys_enabled bool Indicates whether keys can be used to select/deselect tools.
tool_menu_height number In the "Other" and "Plugins" menus, indicates how many tools there will be per column.
tool_sounds_enabled bool Indicates whether tools can play sounds.
tween_panel_enabled bool Indicates whether tweening effects will be applied to the panel.
tween_speed number The length of time a tweening effect should take, in seconds.

plugins Table

plugins is a table of values located at the top of the source code. This table is used to specify the location of plugins. Entries can be either an integer or an object in the game. An integer would represent the AssetId of the Model that contains the source for the plugin.

To add a plugin:

  1. Get the AssetId of the Model that contains the plugin
    1. Go to the webpage of the Model
    2. The URL should look something like "http://www.roblox.com/CmdUtl-Plugin-Name-item?id=1234567890"
    3. The numbers at the end (after "?id=") is the AssetId
  2. Add the AssetId to the plugins table (don't forget a comma!)
  3. Save the file

The next time you run CmdUtl, the plugin should be added (assuming the plugin is valid).

shortcuts Table

shortcuts is a table of values located at the top of the source code. This table is used to map shortcuts keys to tools in the Utility Panel. Each value is a string, which represents the key that is to be mapped. It must have a length of 1 character in order to be valid. Which characters are valid for key pressing is up to Roblox.

If a plugin wants to make a key bindable, you may be asked to add a new table key to the table. This table key will be referenced by the plugin to get the key you've mapped to it. Keys are first come, first serve. Plugins aren't allowed to bind to keys already bound to.

Plugin API

Go to the Plugin API Documentation

Plugins are additions to CmdUtl that have been written by users. Using the Plugin API, tools, commands, or entire menus can be added.

Plugins can be published by uploading them as a model to Roblox.

Since CmdUtl runs from Execute Script, it has a greater security context, allowing access to more things. For this reason, plugins have two modes: Safe and Unsafe Mode. Safe Mode limits the access of the plugin, preventing a user from doing malicious things. Unsafe Mode gives access to not only the API, but everything else, including potentially hazardous Roblox functions. Luckily, CmdUtl users can prevent Unsafe plugins from running by adjusting their config table.