-
Notifications
You must be signed in to change notification settings - Fork 7
server.services.ToggleButton.ToggleButton
server/services/ToggleButton.ToggleButton
Hooks into ToolService's ToolAdded and ToolRemoved events and updates all of a player's tool to have updated buttons and fires a button event with informoration on the new buttons.
OnInit
• new ToggleButton()
▸ Private ConfigureToggleButtons(state, parent): void
Takes in a copy of a state from the tool store in toolservice and a parent which is the name of a player and re-configures all of the BUTTON_TOGGLE attributes of the player's tools.
| Name | Type | Description |
|---|---|---|
state |
State |
a copy of a state from toolservice |
parent |
string |
a string that will cause an error if it does not match up to a player's username in the game |
void
src/server/services/ToggleButton.ts:28
▸ Private GetPlayerFromUserName(playerName): undefined | Player
| Name | Type | Description |
|---|---|---|
playerName |
string |
a player's username |
undefined | Player
a Player if it found a player from the username provided or undefined.
src/server/services/ToggleButton.ts:82
▸ Private getOrder(tool): number
Gets a tool object and returns a number which indicates what priority in sorting tool buttons the tool should have (higher then number means the tool will be sorted closer to first)
| Name | Type |
|---|---|
tool |
ITool |
number
src/server/services/ToggleButton.ts:68
▸ onInit(): void
Connects to the ToolAdded and ToolRemoved and calls ConfigureToggleButtons with the arguments from the connections.
void
OnInit.onInit
- client/controllers/SpringCam
- client/controllers/Direction
- client/controllers/Rotation
- client/controllers/Shake
- client/controllers/Input
- server/modules/InputParser
- server/modules/Middleware
- server/modules/AnimPlayer
- server/modules/Action
- server/modules/Defer