Skip to content
wutname1 edited this page May 12, 2019 · 2 revisions

What is StdUi

StdUi stands for StandardUi. Which means this library is a provides a factory for default blizzard UI objects such as Button, FontString, EditBox.

StdUi does not create proxy objects except for complex widgets such as ScrollTable.

Mission

Library aims to be alternative to AceGUI that does not have a fixed layout nor forces you to do layout functions. In addition, it produces widgets similar to the looks of ElvUI.

Quick Start

Bootstrap LibStub and StdUi in your addon TOC file:

Libs\LibStub\LibStub.lua
Libs\StdUi\StdUi.xml

Then you can use StdUi in your lua files:

local StdUi = LibStub('StdUi');

You do not need to include all widgets if you plan to use only some of them.

Customization

You might want to use different color/fonts configuration but to do so, create new instance instead of using global functions:

local StdUi = LibStub('StdUi'):NewInstance();
StdUi.config = {
    -- your config
};

Full config object should look like this:

{
	font      = {
		familly       = 'Fonts\\ARIALN.ttf', -- Font used across your addon
		size          = 12, -- Font size
		effect        = 'OUTLINE', -- Font effects
		strata        = 'OVERLAY', -- Font strata
		color         = { r = 1, g = 1, b = 1, a = 1 }, -- Font text color
		colorDisabled = { r = 0.55, g = 0.55, b = 0.55, a = 1 }, -- Font color when widget is disabled
	},

	backdrop  = {
		texture        = [[Interface\Buttons\WHITE8X8]], -- Backdrop texture
		panel          = { r = 0.10, g = 0.10, b = 0.10, a = 1 }, -- Color of panels
		slider         = { r = 0.15, g = 0.15, b = 0.15, a = 1 }, -- Color of sliders

		button         = { r = 0.25, g = 0.25, b = 0.25, a = 1 }, -- Button color
		buttonDisabled = { r = 0.15, g = 0.15, b = 0.15, a = 1 }, -- Button color when disabled

		border         = { r = 0.80, g = 0.80, b = 0.80, a = 1 }, -- Border color
		borderDisabled = { r = 0.40, g = 0.40, b = 0.40, a = 1 } -- Border color when disabled
	},

	highlight = {
		color = { r = 1, g = 0.9, b = 0, a = 0.4 }, -- Highlight color
		blank = { r = 0, g = 0, b = 0, a = 0 } -- Highlight 'off' color
	},

	dialog    = { -- Dialog settings
		width  = 400, -- Dialogs default width
		height = 100, -- Dialogs default height
		button = {
			width  = 100, -- Dialog button width
			height = 20, -- Dialog button height
			margin = 5 -- Dialog margin between buttons
		}
	},

	tooltip   = {
		padding = 10 -- Frame tooltip padding
	}
};