Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
James committed Mar 1, 2024
1 parent 637a6ea commit 98c2581
Show file tree
Hide file tree
Showing 24 changed files with 247 additions and 340 deletions.
16 changes: 9 additions & 7 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export default defineConfig({
{
text: 'Engine Recaps',
items: [
{ text: 'December 2023', link: '/recaps/' },
{ text: 'February 2024', link: '/recaps/' },
{ text: 'December 2023', link: '/recaps/december2023' },
{ text: 'November 2023', link: '/recaps/november2023' },
{ text: 'October 2023', link: '/recaps/october2023' },
{ text: 'September 2023', link: '/recaps/september2023' },
Expand All @@ -63,17 +64,19 @@ export default defineConfig({
collapsed: false,
items: [
{ text: 'FrameworkServer', link: '/api/server' },
{ text: 'FrameworkClient', link: '/api/client' },
{ text: 'FrameworkShared', link: '/api/shared' }
{ text: 'FrameworkClient', link: '/api/client' }
]
},

{
text: 'Network',
collapsed: true,
items: [
{ text: 'Server', link: '/api/network/server' },
{ text: 'Client', link: '/api/network/client' }
{ text: 'Network', link: '/api/network'},
{ text: 'ClientEvent', link: '/api/network/client/event' },
{ text: 'ServerEvent', link: '/api/network/server/event' },
{ text: 'ClientFunction', link: '/api/network/client/function' },
{ text: 'ServerFunction', link: '/api/network/server/function' }
]
},

Expand All @@ -82,14 +85,13 @@ export default defineConfig({
collapsed: true,
items: [
{ text: 'Runtime', link: '/api/runtime' },
{ text: 'RuntimeContext', link: '/api/runtime/context' },
{ text: 'RuntimeSettings', link: '/api/runtime/settings' },
{ text: 'RuntimeObjects', link: '/api/runtime/objects' }
]
},

{ text: 'Debugger', link: '/api/debugger' },
{ text: 'Signal', link: '/api/signal' }
{ text: 'Event', link: '/api/event' }
]
},
],
Expand Down
28 changes: 9 additions & 19 deletions docs/api/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,38 @@ CanaryEngine's client-sided interface.

A simple reference to the [Players.LocalPlayer](https://create.roblox.com/docs/reference/engine/classes/Players#LocalPlayer)

* **[Player](https://create.roblox.com/docs/reference/engine/classes/Player)**
* [**Player**](https://create.roblox.com/docs/reference/engine/classes/Player)

---

### PlayerGui <Badge type="tip" text="read only" />

A simple reference to the [Player.PlayerGui](https://create.roblox.com/docs/reference/engine/classes/Player#PlayerGui)

* **[PlayerGui](https://create.roblox.com/docs/reference/engine/classes/PlayerGui)**
* [**PlayerGui**](https://create.roblox.com/docs/reference/engine/classes/PlayerGui)

---

### PlayerBackpack <Badge type="tip" text="read only" />

A simple reference to the [Player.Backpack](https://create.roblox.com/docs/reference/engine/classes/Player#Backpack)

* **[Backpack](https://create.roblox.com/docs/reference/engine/classes/Backpack)**
* [**Backpack**](https://create.roblox.com/docs/reference/engine/classes/Backpack)

## Functions

### NetworkController

Creates/references a network controller on the client, with the name of `controllerName`

**Parameters**

* **controllerName:** `string`\
The name of the controller
---

* **isUnreliable:** `boolean?`\
Whether or not the network controller is unreliable, defaults to false
### Network <Badge type="tip" text="read only" />

**Returns**
A simple reference to the network contstructor.

* **[NetworkControllerClient](/api/network/client)**
* [**Network**](/api/network/)

---
## Functions

### GetPlayerCharacter <Badge type="warning" text="yields" />

Gets the players current character model; if it doesn't exist the thread will yield until it does.

**Returns**

* **[Character](/api/#character)**
* [**Character**](/api/#character)
39 changes: 0 additions & 39 deletions docs/api/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,6 @@ A list of cached logs/events for the current environment.

## Functions

### Debug <Badge type="warning" text="deprecated" />

The main debug handler, adds a prefix to logs sent out and respects logging settings.

**Parameters**

* **debugHandler:** `(prefix: string, T...) -> ()`\
The function to run on debug, for example `Debugger.Debug(print, "Hello, world!")`

* **arguments:** `T...`\
The contents to be passed to the function

**Returns**

* **void**

---

### DebugPrefix <Badge type="warning" text="deprecated" />

Sames as [`Debug`](#debug), but allows a custom prefix.

**Parameters**

* **debugHandler:** `(prefix: string, T...) -> ()`\
The function to run on debug, for example `Debugger.Debug(print, "Hello, world!")`

* **prefix:** `string`\
The prefix to be put in front of the message

* **arguments:** `T...`\
The contents to be passed to the function

**Returns**

* **void**

---

### GetCallStack

Gets the call stack of any script within CanaryEngine.
Expand Down
File renamed without changes.
46 changes: 6 additions & 40 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

The main class of CanaryEngine.

## Types

### Character <Badge type="tip" text="public" />

A simple R6 character type used when using [`CanaryEngineClient:GetPlayerCharacter`](/api/client#getplayercharacter)

## Properties

### Runtime <Badge type="tip" text="read only" />
Expand All @@ -26,14 +20,6 @@ The internal engine debugger, has useful functions to abide by debug settings.

---

### Future <Badge type="tip" text="read only" />

A reference to the Future package, which is a optimized version of a Promise.

* [**Future**](https://util.redblox.dev/future.html)

---

### LoadTime <Badge type="tip" text="read only" />

The number in seconds of which the framework took to completely finish loading; is rounded by the nearest hundreth.
Expand Down Expand Up @@ -62,17 +48,7 @@ Gets the client-sided interface of CanaryEngine.

---

### GetFrameworkShared

Gets the shared interface of CanaryEngine. Currently has no unique function, but will in the future.

**Returns**

* [**FrameworkShared**](/api/shared)

---

### ImportPackagesInOrder
### ImportPackagesOrdered

Imports the provided packages in chronological order, also allowing for you to import descendants aswell.

Expand All @@ -90,25 +66,15 @@ Whether or not to import the package's descendants, defaults to `false`

---

### Signal
### Event

Creates/reference a signal of the given name, create a new anonymous signal by leaving the name blank.
Creates/reference a event of the given name, create a new anonymous event by leaving the name blank.

**Parameters**

* **signalName:** `string?`\
The name of the signal

**Returns**

* [**Signal**](/api/signal)

---

### CreateAnonymousSignal

Creates a new anonymous signal, this does not have a reference outside of the variable it was created in. This is essentially an alias for an empty [`CreateSignal`](#signal).
* **name:** `string?`\
The name of the event

**Returns**

* [**Signal**](/api/signal)
* [**Event**](/api/event)
29 changes: 3 additions & 26 deletions docs/api/network/client.md → docs/api/network/client/event.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
# NetworkControllerClient <Badge type="danger" text="client" />
# ClientEvent <Badge type="danger" text="client" />

A client-sided network controller.
A client-sided network event.

## Properties

### IsListening <Badge type="tip" text="read only" />

Whether or not the network controller is subscribed to an event.

* **boolean**

---

### IsReliable <Badge type="tip" text="read only" />

Whether or not the network controller uses a reliable remote event.
Whether or not the network event uses a reliable remote event.

* **boolean**

Expand All @@ -35,21 +27,6 @@ The data that should be sent to the server

---

### InvokeAsync

Invokes the server, equivalent to [RemoteFunction:InvokeServer](https://create.roblox.com/docs/reference/engine/classes/RemoteFunction#InvokeServer). Returns a promise.

**Parameters**

* **data:** `...any`\
The data to invoke the server with

**Returns**

* **[Future](https://util.redblox.dev/future.html#methods)**

---

### Listen

Listens for the network controller to be fired by the server, then runs the provided function. Note that this can only be run once, it will error if run more than once.
Expand Down
26 changes: 26 additions & 0 deletions docs/api/network/client/function.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ClientFunction <Badge type="danger" text="client" />

A client-sided network function.

## Properties

### IsReliable <Badge type="tip" text="read only" />

Whether or not the network function uses a reliable remote event.

* **boolean**

## Methods

### InvokeAsync

Invokes the server, equivalent to [RemoteFunction:InvokeServer](https://create.roblox.com/docs/reference/engine/classes/RemoteFunction#InvokeServer). Returns a future (promise).

**Parameters**

* **data:** `...any`\
The data to invoke the server with

**Returns**

* **[Future](https://util.redblox.dev/future.html#methods)**
39 changes: 39 additions & 0 deletions docs/api/network/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Network

The library to create network events and functions.

## Functions

### Event

The contstructor for creating new network events.

**Parameters**

* **name:** `string`\
The name of the new object

* **reliable:** `boolean?`\
Whether or not the object created is reliable. Defaults to true

**Returns**

* **[**EventClient | EventServer**](/api/network/server)**

---

### Function

The contstructor for creating new network functions.

**Parameters**

* **name:** `string`\
The name of the new object

* **reliable:** `boolean?`\
Whether or not the object created is reliable. Defaults to true

**Returns**

* **[**FunctionClient | FunctionServer**](/api/network/server)**
Loading

0 comments on commit 98c2581

Please sign in to comment.