

///
/// This mod is still in development. You may encounter issues such as CTD/CTM. Use at your own risk.
///
/// If you have any problems (bugs, suggestions, screenshots, etc.), contact me via Discord @raintrap341. Or maybe a QQ group? Not sure…
///
/// If you like this mod, please give it a thumbs-up.
///
/// Special thanks to @justanormaluser and @uniboi
This mod is a UI library that provides modders with a roulette-style menu.
Please follow the guide below to use it.

You need to have a script running on the UI VM.
The title appears above the roulette, and the description appears below.
void function SetupRoulette(string title = "", string description = "", var extraHud = null) {
file.title = title
file.description = description
file.extraHud = extraHud
}
By default, the circle is divided into 8 shards. You can register only the shards you want. Note: Shard index 0 is at 225°, which is the first segment to the lower left of the x-axis.
RegisterShardPurpose: Registers and configures a single shard (sector) in the roulette UI, including its asset, name, display options, callback, color, position bias, and description.
Parameters:
int index
The index of the shard (0–7).asset shardAsset
The asset to display as the shard's image.string shardName
The display name for the shard.bool shouldShowImage (default: false)
Whether to show the image for this shard.bool shouldShowText (default: true)
Whether to show the text label for this shard.bool isAssetRui (default: false)
Whether the image is a RUI asset.void functionref(int index, entity localPlayer, var roulette) confirmCallback (default: null)
The callback function to execute when this shard is confirmed/selected.vector textColorOverride (default: <255, 255, 255>)
The color override for the text label.vector shardNameBias (default: <0, 0, 0>)
The positional bias for the text label.string shardDescription (default: "")
The description text for this shard.Behavior:
file struct for later use.void function RegisterShard(int index, asset shardAsset, string shardName, bool shouldShowImage = false, bool shouldShowText = true, bool isAssetRui = false, void functionref(int index, entity localPlayer, var roulette) confirmCallback = null, vector textColorOverride = DEFAULT_SHARD_TEXT_COLOR, vector shardNameBias = <0, 0, 0>, string shardDescription = "")
// or below
void function RegisterShardOnlyCallback(int index, void functionref(int index, entity localPlayer, var roulette) confirmCallback)
AdvanceMenu( GetMenu( ROULETTE_MENU_NAME ) )
ROULETTE_MENU_NAME is a globalized const string. You should not change it.
Check the NS mod wiki and QuickTyping | Thunderstore - The Northstar Mod Database .
From my mod QuickTyping | Thunderstore - The Northstar Mod Database :
void function QuickTyping_OpenRoulette()
{
// printt("QuickTyping UI: Opening Roulette Menu\n")
for (int i = 0; i < SHARD_MAX; i++) {
string content = GetTexts()[i]
RegisterShard(i, $"", content, false, true, false, void function (int index, entity localPlayer, var roulette) : (content) {
RunClientScript("CodeCallbackQuickTypingSay", content)
}, <0, 0, 0>)
}
SetupRoulette( Localize("#QUICKTYPING_TITLE"))
AdvanceMenu( GetMenu( ROULETTE_MENU_NAME ) )
}
This mod maintains only a single instance of the Roulette menu at any given time. Make sure to avoid opening the Roulette menu simultaneously to prevent interference between mods.