Skip to content

Commit

Permalink
Moonwave groundwork (evaera#299)
Browse files Browse the repository at this point in the history
Co-authored-by: Eleanor <[email protected]>
  • Loading branch information
autonordev and autonordev authored Aug 26, 2023
1 parent 9a8939d commit 641e039
Show file tree
Hide file tree
Showing 45 changed files with 2,440 additions and 14,476 deletions.
31 changes: 31 additions & 0 deletions .moonwave/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap");

:root {
--ifm-font-family-base: Inter, -apple-system, "Helvetica Neue", Roboto,
Helvetica, system-ui, "Nimbus Sans", "Arial Nova", Arial, Segoe UI;

--ifm-font-family-monospace: ui-monospace, "Cascadia Code", "Source Code Pro",
Menlo, Consolas, "DejaVu Sans Mono", monospace;

--ifm-navbar-link-hover-color: #9b59b6;
--ifm-link-color: #9b59b6;
--ifm-color-primary: #9b59b6;
}

.navbar__logo img {
transition: opacity var(--ifm-transition-fast)
var(--ifm-transition-timing-default);
}

.navbar__logo img:hover {
opacity: 75%;
}

.footer__copyright a {
color: var(--ifm-footer-color) !important;
text-decoration: underline;
}

.footer__copyright a:hover {
text-decoration: none !important;
}
File renamed without changes
133 changes: 78 additions & 55 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# v1.12.0
# Changelog

## v1.12.0

- Add `convertTimestamp` default command, outputs a human-readable timestamp from epoch seconds
- Add `positiveInteger`, `nonNegativeInteger`, `byte` (0-255), `digit` (0-9) built-in types (including respective plural types)
Expand All @@ -11,12 +13,13 @@
- Fix window not resizing on clear
- Remove global initialization scripts feature

# v1.11.0
## v1.11.0

- Add support for new Roblox CoreGui Chat
- Add ArgumentOperatorAliases option to types which allows specifying short hands like "me", "others", "all", etc for any type

# v1.10.0
## v1.10.0

- Improve help command
- Alias command now supports optional arguments
- Legacy RoStrap support has been removed
Expand All @@ -27,7 +30,8 @@
- Fix bug causing var and varSet to yield on require which could make clients fetch server modules too late
- The `run-lines` command now runs on the client

# v1.9.0
## v1.9.0

- Significantly improved the performance of Util.EmulateTabstops for long strings by using a string builder table (~250-350x) (#190)
- Allows for long strings to be displayed in the output without a freeze
- Added column logic to properly align text containing newlines
Expand All @@ -41,21 +45,26 @@
- Replace TeleportPartyAsync with TeleportAsync in teleport command
- Scroll to bottom on typing began

# v1.8.4
## v1.8.4

- Fix an error when using function arguments.

# v1.8.3
## v1.8.3

- "% teamPlayers" prefix was accidentally removed from `players` type, so this adds it back.

# v1.8.2
## v1.8.2

- Fix pressing tab doesn't insert space (#149)

# v1.8.1
## v1.8.1

- Fixes issue with autocomplete in lists
- Fixes init-run command in unpublished games
- Fix boolean type erroring given the empty string

# v1.8.0
## v1.8.0

- Add `var` and `var=` default commands, which act as a persistent key-value store.
- Keys can begin with a dot to be per-session only.
- Keys can begin with a $ to be game-wide, shared among all players.
Expand Down Expand Up @@ -83,18 +92,20 @@
- Cmdr no longer removes preceding skipped arguments (`""`) when using AutoComplete on a later argument (#104)
- `GetCommandsAsStrings` has been renamed to `GetCommandNames`; old name still works for backwards compatibility

# v1.7.1
## v1.7.1

- Handle non-string error values correctly

# v1.7.0
## v1.7.0

- Cmdr now calls tostring on error objects emitted from commands (#144)
- Cmdr now includes the full trace back in error messages.
- [Aliases can now include type checking and name information in arguments](https://eryn.io/Cmdr/guide/MetaCommands.html#alias) (#56)
- New default command: "me". Displays the current player's name.
- Make `bring` and `to` commands built-in aliases for `teleport`. `to` has effectively moved from the `DefaultDebug` group to the `DefaultAdmin` group. (#115)
- The default activation key is now <kbd>F2</kbd>

# v1.6.0
## v1.6.0

- Add random selector for player type (#122)
- Fixed so TextBox is not selectable using controller (#124)
Expand All @@ -105,7 +116,7 @@
- Add CommandContext:HasImplementation (#138)
- Commands will no longer run in-game if no BeforeRun hook is configured (#132)

# v1.5.0
## v1.5.0

- Adds AutoComplete IsPartial (#103)
- Added dynamic argument types (#93)
Expand All @@ -114,70 +125,78 @@
- Fix a bug where sparse values in value list caused dropped arguments
- Added default command: respawn (#113)

# v1.4.0
## v1.4.0

- Add support for `ClientRun` (#97).

# v1.3.0
## v1.3.0

- Add `Prefixes` to Types
- Add `Registry:RegisterTypePrefix`
- Add `Registry:RegisterTypeAlias`
- Add `override` parameter to `Util.MakeListableType`

# v1.2.2
## v1.2.2

- Make new lines work in command window. (#84)

# v1.2.1
## v1.2.1

- Fix bug where Data did not get sent correctly (#85)

# v1.2.0
## v1.2.0

- Added `others` shorthand for players type
- Added APIs for showing and hiding the Cmdr window explicitly
- Added `CmdrClient:SetActivationUnlocksMouse` for freeing mouse upon activation

# v1.1.5
## v1.1.5

- Empty quoted sequences (`""`) can now be used to skip arguments which have default values

# v1.1.4
## v1.1.4

- Fix an issue where the `filter` argument of `RegisterDefaultCommands` was nonfunctional.

# v1.1.3

- Fix an issue where the arrow keys could be used to open auto complete when the menu is closed (#62)
- Make AutoExec commands only run on the client (#61)

# v1.1.2
## Command history
- Up/down arrow now traverses command history when you haven't entered any text.
- New `history` utility command which dynamically returns your previously-entered commands based on a number index.
- New alias `! <number>` to re-run previous commands.
- `! -1` re-reruns your last command.
- `! 2` re-runs your second command.
- New alias `!!` to re-run your last command.
- New alias `^ <search> <replace>` to re-run your last command with string substitution, replacing `search` with `replace`.

## New utility commands
- `history` (see above)
- `position [player]`: Returns the Vector3 position of a player (or yourself if omitted) as a string `X,Y,Z`.
- `replace <haystack> <needle> <replacement>`: Substitutes text inside `haystack` matching Lua pattern `needle` with `replacement`.
- `discard <command string>`: Identical to `run`, except the return value is discarded (always returns `""`).
- `clear`: Clears the console

## New default types
- Plural primitives (strings, numbers, integers, booleans)
- *Plural* types simply resolve into an array of the named type.
- brickColor(s)
- teamColor(s): Resolve into a BrickColor based on the color of a Team
- color3(s)
- hexColor3(s): Resolve into a Color3 from a hexadecimal color
- brickColor3(s): Resolve into a Color3 from a BrickColor
- vector3(s), vector(2)s
- duration(s): Resolve human-readable times like 20Minutes, 2Hours, 1Year into a number of seconds.

## Usage improvements
## v1.1.2

**Command history**

- Up/down arrow now traverses command history when you haven't entered any text.
- New `history` utility command which dynamically returns your previously-entered commands based on a number index.
- New alias `! <number>` to re-run previous commands.
- `! -1` re-reruns your last command.
- `! 2` re-runs your second command.
- New alias `!!` to re-run your last command.
- New alias `^ <search> <replace>` to re-run your last command with string substitution, replacing `search` with `replace`.

**New utility commands**

- `history` (see above)
- `position [player]`: Returns the Vector3 position of a player (or yourself if omitted) as a string `X,Y,Z`.
- `replace <haystack> <needle> <replacement>`: Substitutes text inside `haystack` matching Lua pattern `needle` with `replacement`.
- `discard <command string>`: Identical to `run`, except the return value is discarded (always returns `""`).
- `clear`: Clears the console

**New default types**

- Plural primitives (strings, numbers, integers, booleans)
- _Plural_ types simply resolve into an array of the named type.
- brickColor(s)
- teamColor(s): Resolve into a BrickColor based on the color of a Team
- color3(s)
- hexColor3(s): Resolve into a Color3 from a hexadecimal color
- brickColor3(s): Resolve into a Color3 from a BrickColor
- vector3(s), vector(2)s
- duration(s): Resolve human-readable times like 20Minutes, 2Hours, 1Year into a number of seconds.

**Usage improvements**

- Cmdr now supports escape sequences
- `\\` for escaping a literal backslash
- `\"` and `\'` for escaping quotes inside of strings
Expand All @@ -186,36 +205,40 @@
- `\n`
- New lines are not displayed in the console as of right now and are displayed as a space. However, `\n` literals may still be useful for custom commands.
- `\xA9` (2-digit) and `\u2661` (4-digit) hexadecimal unicode escapes
- `\$` for escaping argument replacements and embedded commands in command strings *only*.
- `\$` for escaping argument replacements and embedded commands in command strings _only_.
- Invalid escape sequences are left in-place.
- `help` command now lists command aliases
- `teleport` and `to` now accept a Vector3 with the `@` prefix

## API Improvements and Changes
**API Improvements and Changes**

- Cmdr now enforces that types begin with a lowercase letter or digit for consistency.
- `Dispatcher:RegisterHooksIn`, `RegisterTypesIn`, and `RegisterCommandsIn` now allow nesting via folders.
- `Dispatcher:AddHook` has been renamed to `Dispatcher:RegisterHook`. The old name still exists as a fallback, but is undocumented and may be removed in the future.
- Cmdr now throws an error if a command has both `Data` and `Run` (not a bug, but if someone is doing this then they are confused)
- Hooks now have an optional third parameter `priority`. Hooks run in order of priority; lower numbers run first. The default priority is `0`.
- CommandContexts now have an empty `State` table. This is intended to be used in combination with the `BeforeRun` hook to allow you to add custom information to this command that you can consume inside of your command logic or other hooks.
- For example, if you want many commands to have different behavior based on someone's rank, you can add their rank in the `State` table for your commands to consume and branch off of.
- New function `CmdrClient:SetMashToEnable(true)` to enable *Mash to Enable* mode, which requires the player to press the activation key 7 times in quick succession to open the Cmdr menu for the first time. This is not meant as a security feature, but rather as a way to ensure that the console is not accidentally obtrusive to regular players of your game.
- New function `CmdrClient:SetMashToEnable(true)` to enable _Mash to Enable_ mode, which requires the player to press the activation key 7 times in quick succession to open the Cmdr menu for the first time. This is not meant as a security feature, but rather as a way to ensure that the console is not accidentally obtrusive to regular players of your game.
- New client-only function `Dispatcher:GetHistory()` to get an array of the local user's command history. This only includes commands actually typed by the user, no embedded or programmatically run commands.
- `Dispatcher:EvaluateAndRun` now accepts an options table in the third parameter rather than Data.
- Automatic Execution: Commands can now contain an `AutoExec` table which contains commands to execute immediately as the command is registered.
- This is useful for registering aliases associated with your command or initializing state.
- Commands listed in AutoExec are deferred until the end of the Lua cycle, which eliminates any possibility of ordering issues caused by commands being registered out of order.

## Utility methods
**Utility methods**

- `Util.MakeEnumType` and `Util.MakeFuzzyFinder` now accept `Enum`s and arrays of tables with a `Name` key. (These functions can already accept: array of strings, array of Instances, array of EnumItems, or a single Instance whose children are used).
- New functions `Util.Map` and `Util.Each` for mapping values of an array and tuple respectively.
- New function `Util.MakeSequenceType` for quickly creating a type that contains a value sequence, like Vector3 or Color3. The delimeter can be either `,` or whitespace, checking `,` first.
- New functions `Util.SplitPrioritizedDelimeter`, `Util.ParseEscapeSequences`, and `Util.EmulateTabstops`.

## Bug fixes
**Bug fixes**

- `announce` command text is now filtered through chat filter
- Added an additional check that RoStrap is being used to help prevent false positives
- Fixed a bug preventing command data from being accessible

## roblox-ts npm package
**roblox-ts npm package**

Cmdr is now available as an [npm package](https://www.npmjs.com/package/rbx-cmdr) for usage in [roblox-ts](https://roblox-ts.github.io/).
10 changes: 5 additions & 5 deletions Cmdr/CmdrClient/CmdrInterface/AutoComplete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ return function(Cmdr)
Gui.ScrollBarThickness = defaultBarThickness
end

--- Shows the auto complete menu with the given list and possible options
-- Shows the auto complete menu with the given list and possible options
-- item = {typedText, suggestedText, options?=options}
-- The options table is optional. `at` should only be passed into AutoComplete::Show
-- name, type, and description may be passed in an options dictionary inside the items as well
Expand Down Expand Up @@ -161,7 +161,7 @@ return function(Cmdr)
UpdateInfoDisplay(self.Items[1] and self.Items[1].options or options)
end

--- Returns the selected item in the auto complete
-- Returns the selected item in the auto complete
function AutoComplete:GetSelectedItem()
if Gui.Visible == false then
return nil
Expand All @@ -170,17 +170,17 @@ return function(Cmdr)
return AutoComplete.Items[AutoComplete.SelectedItem]
end

--- Hides the auto complete
-- Hides the auto complete
function AutoComplete:Hide()
Gui.Visible = false
end

--- Returns if the menu is visible
-- Returns if the menu is visible
function AutoComplete:IsVisible()
return Gui.Visible
end

--- Changes the user's item selection by the given delta
-- Changes the user's item selection by the given delta
function AutoComplete:Select(delta)
if not Gui.Visible then
return
Expand Down
Loading

0 comments on commit 641e039

Please sign in to comment.