Skip to main content

KSPMenu

The KSPMenu class allows you to connect to a ui_menu in KSP.

class KSPMenu

Example

import { KSPMenu, KSPMenuEntry } from kontakt

var menu = KSPMenu(id: "my_menu")

Constructor

constructor(id: String)

Connects to a ui_menu in KSP with the given control ID.

Properties

connected

connected: Bool { get }

Whether the control is connected. A control might not be connected if no corresponding control was found for the given id.


custom_id

custom_id: Int { get }

The value of $CONTROL_PAR_CUSTOM_ID set on this control.


entries (8.8)

entries: [KSPMenuEntry] { get }

An array of all of the menu's entries.


entry_count

entry_count: Int { get }

The number of entries.


id

id: String { get }

The id is the name of the variable in KSP that corresponds to this control.


selected_entry

selected_entry: KSPMenuEntry { get }

The currently selected menu entry.


selected_index

selected_index: Int { get set }

The currently selected menu entry index.


visible_entries

visible_entries: [KSPMenuEntry] { get }

An array of all visible entries.