The imgui
library is used to allow addons to easily interact with the ImGui implementation within daochook. This library forwards the needed enumerations and flag definitions that are passed to the various ImGui function calls. This library also contains a few helper functions to do a few things with ImGui easier.
This library also forwards the implemented global table gui
to imgui
to make easier usage of things and to better align to the C++ style code.
1local imgui = require 'imgui';
col32
Converts the given ARGB color values into a 32bit color.
1number imgui.col32(a, r, g, b);
Parameter Name | Type | Description |
---|---|---|
a | number | The alpha color value. |
r | number | The red color value. |
g | number | The green color value. |
b | number | The blue color value. |
Returns |
---|
(number) The converted 32bit color value. |
ShowHelp
Displays a helper tag (?)
that displays the given text as a tooltip when hovered.
1imgui.ShowHelp(text, same_line);
Parameter Name | Type | Description |
---|---|---|
text | string | The tooltip text to display when hovering. |
same_line | boolean | [Optional] Flag that states if the helper tag is displayed on the same line as the previous drawn element. (Default is true.) |
Returns |
---|
None. |
DisplayPopup
Displays a modal popup (similar to a message box) with configurable buttons and results.
1number imgui.DisplayPopup(title, name, cb, buttons);
Parameter Name | Type | Description |
---|---|---|
title | string | The title to display on the popup. |
name | string | The internal ImGui hashtag name of the popup. |
callback | function | The contents callback invoked to allow custom popup content rendering. |
buttons | number | The button flag value used to determine which popup type to display. |
Returns |
---|
number The PopupResult value. |
Valid button flags are:
PopupButtonsOk
- 0PopupButtonsOkCancel
- 1PopupButtonsYesNo
- 2PopupButtonsYesNoCancel
- 3Valid popup return values are:
PopupResultNone
- 0PopupResultOk
- 1PopupResultCancel
- 2PopupResultYes
- 3PopupResultNo
- 4