Skip to content

Shiva-Shadowsong/otc-ui-color-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Color Picker extends UIColorPicker, which extends UIWindow.

Use this widget when you need to spawn a window that will allow the user to change the color of something with full control over the resulting HEX value.

The widget is closed via the 'Done' button, or pressing Esc, at which point it will call its onClose field and destroy itself. Connect to the onClose field and capture the data from the window before it is destroyed as you wish.

Example

Installation

Make sure to load UIColorPicker during client setup (with dofile in core .otmod).

In the .otui file, there is a line:

image-source: /images/ui/window/windowContent

Swap this out for the location of a window content background that your client uses.

Usage:

local picker = g_ui.createWidget('ColorPicker', rootWidget)
connect(picker, {
  onClose = function(self, selectedColor)
    print("The color picked in the window before it was closed was: " .. selectedColor)
  end
})

Keep in mind UIColorPicker is an extension of UIWindow, so it inherits all UIWindow behaviors as well.

About

Color picker widget for OTClient.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages