Roulette

版本 v1.1.0·更新於 2025-06-01

A UI Lib. Roulette Like Apex.

截圖 共 1 張

模組介紹 作者原文

///

/// 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.

How to use

  • Prepare a UI script

You need to have a script running on the UI VM.

  • (Optional) Set up title/desc/extra hud

The title appears above the roulette, and the description appears below.

void function SetupRoulette(string configName, string title = "", string description = "", var extraHud = null) {

file.title = title

file.description = description

file.extraHud = extraHud

}

  • Register Shards

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.

Function: RegisterShard

Purpose:

Registers and configures a single shard (sector) in the roulette UI, including its asset, name, display options, callback, color, position bias, and description.

Parameters:

  • string configName

The name of your roulette config.

  • 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: ``)

The color override for the text label.

  • vector shardNameBias (default: ``)

The positional bias for the text label.

  • string shardDescription (default: "")

The description text for this shard.

Behavior:

  • Stores all provided parameters in the file struct for later use.
  • Finds the corresponding UI elements for the shard and its text label.
  • Applies the text color and position bias to the text label.
  • Registers the confirmation callback if provided and not already registered.
  • Outputs a debug message indicating the shard has been registered.

void function RegisterShard(string configName, 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 =, string shardDescription = "")

// or below

void function RegisterShardOnlyCallback(string configName, int index, void functionref(int index, entity localPlayer, var roulette) confirmCallback)

  • Open It

OpenRouletteMenu(yourConfigName)

yourConfigName is a string which you need to set in your mod.

  • (Optional) With Concommand and key binding

Check the NS mod wiki and QuickTyping | - The Northstar Mod Database.

Example

From my mod QuickTyping | - The Northstar Mod Database:

const string ROULETTE_NAME = "QuickTyping"

// OpenRouletteMenu(string) is a UI func.

void function QuickTyping_OpenRoulette()

{

OpenRouletteMenu(ROULETTE_NAME)

}

// You should only register shards once if your shards are static. If the label/color/images changes dynamically, you should register everytime before the open.

void function QuickTyping_ModSettings_Init()

{

for (int i = 0; i )

}

SetupRoulette( ROULETTE_NAME, Localize("#QUICKTYPING_TITLE"))

}

Warning

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 be

安裝與使用 安裝:Northstar 用戶端模組

  1. 先安裝 Northstar 用戶端(Titanfall 2 的開源社群用戶端,官方發布頁提供安裝器),模組由它載入。
  2. 把本站下載的壓縮包解壓,內容放入 Titanfall2 目錄下的 Northstar/mods/ 資料夾。
  3. 透過 NorthstarLauncher.exe 啟動遊戲,控制台會列出已載入的模組。

Northstar 用於私人伺服器與自訂內容,請勿用它連線官方伺服器。

檔案與校驗

檔案名稱
Roulette-1.1.0.zip
檔案大小
115.7 KiB