Skip to content

QuickMenuAPI

DDAkebono edited this page Dec 24, 2022 · 1 revision

This class contains core utilities and some static pages that are used in the QuickMenu

MiscTabPage

Creates or returns a basic Misc tab page for use by mods not requiring a full tab

OnBackAction

Called when back is used, passes the target page and the previous page

OnMenuRegenerate

Called when the Cohtml menu is regenerated

OnOpenedPage

Called when a page change occurs, passes the new target page and the previous page

OnPlayerSelected

Called when a user is selected in the quick menu, passes the username and user ID

OnWorldLeave

Called when the user is disconnected from a CVR instance

OpenKeyboard(currentValue, callback)

Opens the CVR keyboard

Name Description
currentValue System.String
Current text in the keyboard
callback System.Action{System.String}
Action to be called when keyboard text is submitted

OpenMultiSelect(multiSelection)

Opens the multiselection page

Name Description
multiSelection BTKUILib.UIObjects.Objects.MultiSelection
Generated and populated MultiSelection object to populate the multiselection page

OpenNumberInput(name, input, onCompleted)

Opens the number input page, currently limited to 0-9999

Name Description
name System.String
Sets the text displayed at the top of the page
input System.Single
Initial number input
onCompleted System.Action{System.Single}
Action to be fired when saving the input

PlayerSelectPage

Player select page for setting up functions that should be used in the context of a user

PrepareIcon(modName, iconName, resourceStream)

Prepares icons for usage by dropping them in the correct folder Icons should be 256x256 in size to avoid issues with CSS, they also need to be PNGs

Name Description
modName System.String
Your mod name, this should be the same as your pages
iconName System.String
Name of the icon to be saved
resourceStream System.IO.Stream
Stream containing your image data

SelectedPlayerID

Last selected player's user ID from the User Select menu

SelectedPlayerName

Last selected player's username from the User Select menu

ShowAlertToast(message, delay)

Shows an toast alert on the quick menu, stays up for set delay

Name Description
message System.String
Message to be displayed on the toast
delay System.Int32
Delay in seconds before toast is hidden

ShowConfirm(title, content, onNo, onYes, yesText, noText)

Shows a yes/no confirmation dialog with actions

Name Description
title System.String
Sets the top title of the dialog window
content System.String
Sets the main content of the dialog window
onNo System.Action
No/Cancel button action
onYes System.Action
Yes/Confirm button action (Optional)
yesText System.String
Yes/Confirm button text (Optional, defaults to Yes)
noText System.String
No/Cancel button text (Optional, defaults to No)

ShowNotice(title, content, onOK, okText)

Shows a basic notice dialog with an OK button

Name Description
title System.String
Sets the top title of the dialog window
content System.String
Sets the main content of the dialog window
onOK System.Action
Action to be fired upon clicking the OK/Close button
okText System.String
OK/Close button text

UserJoin

Called when a user leaves the instance, passes the complete CVRPlayerEntity object. Some data may be nulled as the player is leaving

UserLeave

Called when a user joins the instance, passes the complete CVRPlayerEntity object

Clone this wiki locally