OneConfig V1
  • Welcome
  • Documentation license
  • Introduction
    • Getting started
  • Configuration
    • Creating your config
      • Option dependencies & hiding options
      • Listening for option changes
    • Available options
      • Boolean options
        • Switch option
        • Checkbox option
      • Number options
        • Slider option
        • Number option
      • Selector options
        • Dropdown option
        • Radio button option
      • Text option
      • Color option
      • Keybind option
      • Buttons
      • Accordions
      • Decorations
    • Creating your own options
  • Commands
    • Annotation-based commands
    • Tree-based commands
  • Events
    • Using the events system
      • Callback events
      • Subscriber events
  • Utilities Module
    • Hypixel utilities
    • IO utilities
    • Networking utilities
    • JSON utilities
    • Multithreading
    • Platform-specific utilities
  • Migration
    • Temporary V0 -> V1 migration guide
    • Migrating your configs from Vigilance
Powered by GitBook
On this page
Export as PDF
  1. Configuration
  2. Available options

Buttons

Example

It's preferable to make your button callback methods to private so that they can't be called elsewhere (unless you want to call them elsewhere yourself manually).

@Button(
    title = "My Button",
    description = "This is my button", // Recommended, default = ""
    icon = "/my_button.svg", // Optional, default = ""
    category = "Buttons", // Recommended, default = "General"
    subcategory = "General", // Recommended, default = "General"
    text = "Say hi!" // Recommended, default = "Click"
)
private void sayHi() {
    System.out.println("Hello, OneConfig!");
}
@Button(
    title = "My Button",
    description = "This is my button", // Recommended, default = ""
    icon = "/my_button.svg", // Optional, default = ""
    category = "Buttons", // Recommended, default = "General"
    subcategory = "General", // Recommended, default = "General"
    text = "Say hi!" // Recommended, default = "Click"
)
private fun sayHi() {
    println("Hello, OneConfig!");
}
PreviousKeybind optionNextAccordions

Last updated 5 months ago