Update
This commit is contained in:
4
Globals.lua
Normal file
4
Globals.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
---@meta
|
||||||
|
|
||||||
|
---@type Frame
|
||||||
|
UIParent = {}
|
64
ui/Frame.lua
64
ui/Frame.lua
@@ -130,4 +130,68 @@ Frame = {
|
|||||||
---@example
|
---@example
|
||||||
--- Frame:SetBackdropBorderColor(1, 0, 0, 1); -- Sets the border color to opaque red
|
--- Frame:SetBackdropBorderColor(1, 0, 0, 1); -- Sets the border color to opaque red
|
||||||
SetBackdropBorderColor = function(self, red, green, blue, alpha) end,
|
SetBackdropBorderColor = function(self, red, green, blue, alpha) end,
|
||||||
|
|
||||||
|
--- Sets the color of the backdrop.
|
||||||
|
---@param self Frame
|
||||||
|
---@param red number The red component of the border color (0 to 1).
|
||||||
|
---@param green number The green component of the border color (0 to 1).
|
||||||
|
---@param blue number The blue component of the border color (0 to 1).
|
||||||
|
---@param alpha number Optional. The alpha (transparency) of the border color (0 to 1).
|
||||||
|
---@example
|
||||||
|
--- Frame:SetBackdropColor(1, 0, 0, 1); -- Sets the border color to opaque red
|
||||||
|
SetBackdropColor = function(self, red, green, blue, alpha) end,
|
||||||
|
|
||||||
|
--- Gets the height and width, respectively, of an object.
|
||||||
|
---@param self Frame
|
||||||
|
---@return number # width The width of the frame.
|
||||||
|
GetWidth = function(self) end,
|
||||||
|
|
||||||
|
--- Gets the height of the frame.
|
||||||
|
---@param self Frame
|
||||||
|
---@return number # height The height of the frame.
|
||||||
|
GetHeight = function(self) end,
|
||||||
|
|
||||||
|
--- Sets the parent of the region.
|
||||||
|
--- @param self Frame
|
||||||
|
--- @param parent Frame? Reference to the parent widget. Unsets the parent if omitted.
|
||||||
|
--- Children inherit alpha and scale unless disallowed with SetIgnoreParentAlpha and SetIgnoreParentScale.
|
||||||
|
--- @example
|
||||||
|
--- local f = CreateFrame("Frame")
|
||||||
|
--- f:SetScale(0.5)
|
||||||
|
--- f:SetParent(UIParent)
|
||||||
|
--- print(UIParent:GetScale()) -- 0.63999998569489
|
||||||
|
--- print(f:GetScale(), f:GetEffectiveScale()) -- 0.5, 0.31999999284744
|
||||||
|
SetParent = function(self, parent) end,
|
||||||
|
|
||||||
|
--- Sets the widget script handler.
|
||||||
|
--- @param self Frame
|
||||||
|
--- @param scriptTypeName string Name of the script type, for example "OnShow".
|
||||||
|
--- @param script function|nil The script handler to call or explicitly nil to remove any existing script.
|
||||||
|
--- Setting a script will remove any scripts that were previously hooked with HookScript.
|
||||||
|
--- @example
|
||||||
|
--- local function OnEvent(self, event)
|
||||||
|
--- print(event)
|
||||||
|
--- end
|
||||||
|
--- local f = CreateFrame("Frame")
|
||||||
|
--- f:RegisterEvent("PLAYER_STARTED_MOVING")
|
||||||
|
--- f:SetScript("OnEvent", OnEvent)
|
||||||
|
SetScript = function(self, scriptTypeName, script) end,
|
||||||
|
|
||||||
|
--- Sets the size scaling of the region.
|
||||||
|
--- @param self Frame
|
||||||
|
--- @param scale number The scale of the region. Must be greater than 0.
|
||||||
|
--- @example
|
||||||
|
--- MinimapCluster:SetScale(1.2); -- Scales MinimapCluster and its child regions to 120%
|
||||||
|
SetScale = function(self, scale) end,
|
||||||
|
|
||||||
|
--- Returns localized text depending on the specified gender.
|
||||||
|
--- @param self Frame
|
||||||
|
--- @param token string Reputation index.
|
||||||
|
--- @param gender number? Optional. Gender ID (1 for male, 2 for female, etc.).
|
||||||
|
--- @param ordinal unknown? Optional. Used for ordinal numbers.
|
||||||
|
--- @return string # The localized text.
|
||||||
|
--- @example
|
||||||
|
--- local text = GetText("FACTION_STANDING_LABEL1") -- Returns "Hated"
|
||||||
|
--- local femaleText = GetText("FACTION_STANDING_LABEL1", 3) -- Returns "Hated" for female
|
||||||
|
GetText = function(self, token, gender, ordinal) end,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user