Move frames to DUIParent for scaling unification.

main
jeffi 10 months ago
parent 264220973c
commit 00a3db31e9
  1. 53
      DiesalGUI-2.0/DiesalGUI-2.0.lua
  2. 2
      DiesalGUI-2.0/Objects/Accordian.lua
  3. 59
      DiesalGUI-2.0/Objects/AccordianSection.lua
  4. 2
      DiesalGUI-2.0/Objects/Bar.lua
  5. 2
      DiesalGUI-2.0/Objects/Branch.lua
  6. 2
      DiesalGUI-2.0/Objects/Button.lua
  7. 2
      DiesalGUI-2.0/Objects/CheckBox.lua
  8. 2
      DiesalGUI-2.0/Objects/ComboBox.lua
  9. 2
      DiesalGUI-2.0/Objects/ComboBoxItem.lua
  10. 2
      DiesalGUI-2.0/Objects/Container.lua
  11. 23
      DiesalGUI-2.0/Objects/DropDown.lua
  12. 13
      DiesalGUI-2.0/Objects/DropDownItem.lua
  13. 2
      DiesalGUI-2.0/Objects/IconToggle.lua
  14. 2
      DiesalGUI-2.0/Objects/Input.lua
  15. 2
      DiesalGUI-2.0/Objects/ScrollFrame.lua
  16. 2
      DiesalGUI-2.0/Objects/ScrollingEditBox.lua
  17. 2
      DiesalGUI-2.0/Objects/ScrollingMessageFrame.lua
  18. 2
      DiesalGUI-2.0/Objects/Spinner.lua
  19. 2
      DiesalGUI-2.0/Objects/Text.lua
  20. 2
      DiesalGUI-2.0/Objects/Toggle.lua
  21. 42
      DiesalGUI-2.0/Objects/Window.lua
  22. 2
      DiesalMenu-2.0/DiesalMenu-2.0.lua
  23. 2
      DiesalMenu-2.0/Objects/Menu.lua
  24. 2
      DiesalMenu-2.0/Objects/MenuItem.lua
  25. 2
      DiesalStyle-2.0/DiesalStyle-2.0.lua
  26. 4
      DiesalTools-2.0/DiesalTools-2.0.lua

@ -44,6 +44,57 @@ DiesalGUI.Debug = {
WhiteFont = DiesalGUIDebugWhiteFont,
}
local DUIParent = CreateFrame("Frame", "DUIParent", UIParent)
DUIParent:SetFrameLevel(UIParent:GetFrameLevel())
DUIParent:SetSize(GetScreenWidth(), GetScreenHeight())
DUIParent:SetPoint("BOTTOM")
DiesalGUI.UIParent = DUIParent
DiesalGUI.Scaling = {
physicalWidth = 0,
physicalHeight = 0,
screenWidth = 0,
screenHeight = 0,
originalHeight = DUIParent:GetHeight(),
resolution = "0x0",
perfect = 0
}
DiesalGUI.Scaling.physicalWidth, DiesalGUI.Scaling.physicalHeight = GetPhysicalScreenSize()
DiesalGUI.Scaling.screenWidth, DiesalGUI.Scaling.screenHeight = GetScreenWidth(), GetScreenHeight()
DiesalGUI.Scaling.resolution = format("%dx%d", DiesalGUI.Scaling.physicalWidth, DiesalGUI.Scaling.physicalHeight)
DiesalGUI.Scaling.perfect = 768 / DiesalGUI.Scaling.physicalWidth
function DiesalGUI:UIScale()
local D = self
D.Scaling.uiscale = UIParent:GetScale()
D.Scaling.screenWidth = D.Scaling.physicalWidth
D.Scaling.screenHeight = D.Scaling.physicalHeight
local width, height = D.Scaling.physicalWidth, D.Scaling.physicalHeight
D.UIParent:SetSize(width, height)
D.Scaling.originalHeight = D.UIParent:GetHeight()
end
function DiesalGUI:PixelScaleChanged(event)
if event == "UI_SCALE_CHANGED" then
local S = DiesalGUI.Scaling
S.physicalWidth, S.physicalHeight = GetPhysicalScreenSize()
S.resolution = format("%dx%d", S.physicalWidth, S.physicalHeight)
S.perfect = 768 / S.physicalHeight
end
end
DUIParent:SetScript("OnEvent", function(self, event, ...)
if event == "UI_SCALE_CHANGED" then
DiesalGUI:PixelScaleChanged(event)
end
end)
DUIParent:RegisterEvent("UI_SCALE_CHANGED")
local CallbackHandler = LibStub("CallbackHandler-1.0")
local DiesalTools = LibStub("DiesalTools-2.0")
@ -250,7 +301,7 @@ function DiesalGUI:CreateThrottle(duration, callback)
assert(duration and type(duration) == "number", "duration has to be a number ")
---@class Throttle : AnimationGroup, Object, FrameScriptObject
local throttle = CreateFrame("Frame", nil, UIParent):CreateAnimationGroup()
local throttle = CreateFrame("Frame", nil, DUIParent):CreateAnimationGroup()
throttle.anim = throttle:CreateAnimation("Animation")
throttle.args = {}

@ -59,7 +59,7 @@ local function Constructor()
self.isContainer = true
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
self.defaults = {}

@ -39,22 +39,6 @@ local Stylesheet = {
color = "ffffff",
alpha = 0.1,
},
["button-leftExpandIcon"] = {
type = "texture",
position = { 0, nil, -1, nil },
height = 16,
width = 16,
image = { "DiesalGUIcons", { 3, 6, 16, 256, 128 }, HSL(Colors.UI_Hue, Colors.UI_Saturation, 0.65) },
alpha = 1,
},
["button-leftCollapseIcon"] = {
type = "texture",
position = { 0, nil, -1, nil },
height = 16,
width = 16,
image = { "DiesalGUIcons", { 4, 6, 16, 256, 128 }, HSL(Colors.UI_Hue, Colors.UI_Saturation, 0.65) },
alpha = 1,
},
["content-background"] = {
type = "texture",
layer = "BACKGROUND",
@ -134,10 +118,6 @@ local methods = {
if self.settings.position == 1 then
self:SetPoint("TOPLEFT", subsectionXOffset, subsectionYOffset)
self:SetPoint("RIGHT", -subsectionXOffset, 0)
elseif self.settings.subsection then
local anchor = self.settings.parentObject.content
self:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", subsectionXOffset, subsectionYOffset)
self:SetPoint("RIGHT", -subsectionXOffset, 0)
else
local anchor = self.settings.parentObject.children[self.settings.position - 1].frame
self:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", subsectionXOffset, subsectionYOffset)
@ -159,12 +139,14 @@ local methods = {
end
self.settings.expanded = false
self:FireEvent("OnStateChange", self.settings.position, "Collapse")
self.textures["button-leftCollapseIcon"]:SetAlpha(self.textures["button-leftCollapseIcon"].style.alpha[1])
self.textures["button-leftExpandIcon"]:SetAlpha(0)
--self.icon:SetTexCoord(0, 0.4375, 0, 0.4375)
--self.icon:SetAtlas("campaign_headericon_closed", false)
--self.textures["button-leftCollapseIcon"]:SetAlpha(self.textures["button-leftCollapseIcon"].style.alpha[1])
--self.textures["button-leftExpandIcon"]:SetAlpha(0)
self.icon:SetAtlas("uitools-icon-plus")
self.content:Hide()
self:UpdateHeight()
if self.settings.subsection and self.settings.parentObject then
self.settings.parentObject:ApplySettings()
if self.settings.subsection and self.settings.parentObject and self.settings.parentObject.UpdateHeight then
self.settings.parentObject:UpdateHeight()
end
end,
@ -173,12 +155,14 @@ local methods = {
Expand = function(self)
self.settings.expanded = true
self:FireEvent("OnStateChange", self.settings.position, "Expand")
self.textures["button-leftExpandIcon"]:SetAlpha(self.textures["button-leftExpandIcon"].style.alpha[1])
self.textures["button-leftCollapseIcon"]:SetAlpha(0)
--self.icon:SetAtlas("campaign_headericon_open", false)
--self.icon:SetTexCoord(0.5625, 1, 0, 0.4375)
--self.textures["button-leftExpandIcon"]:SetAlpha(self.textures["button-leftExpandIcon"].style.alpha[1])
--self.textures["button-leftCollapseIcon"]:SetAlpha(0)
self.icon:SetAtlas("uitools-icon-minus")
self.content:Show()
self:UpdateHeight()
if self.settings.subsection and self.settings.parentObject then
self.settings.parentObject:ApplySettings()
if self.settings.subsection and self.settings.parentObject and self.settings.parentObject.UpdateHeight then
self.settings.parentObject:UpdateHeight()
end
end,
@ -239,7 +223,7 @@ local function Constructor()
self.isContainer = true
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
self.defaults = {
@ -259,8 +243,18 @@ local function Constructor()
self[self.settings.expanded and "Collapse" or "Expand"](self)
end)
-- 877-222-8387
local buttonIcon = self:CreateRegion("Texture", "icon", button)
buttonIcon:SetVertexColor(1, 1, 0)
buttonIcon:SetAtlas("uitools-icon-plus")
--buttonIcon:SetTexture("Interface\\Buttons\\UI-PlusMinus-Buttons")
--buttonIcon:SetTexCoord(0, 0.4375, 0, 0.4375)
buttonIcon:SetPoint("TOPLEFT", 1, -3)
buttonIcon:SetSize(10,10)
local text = self:CreateRegion("FontString", "text", button)
text:SetPoint("TOPLEFT", 15, -2)
text:SetPoint("TOPLEFT", 15, -1)
text:SetPoint("BOTTOMRIGHT", -15, 0)
text:SetHeight(0)
text:SetJustifyH("MIDDLE")
@ -271,12 +265,7 @@ local function Constructor()
content:SetPoint("TOPLEFT", frame, 0, 0)
content:SetPoint("TOPRIGHT", frame, 0, 0)
content:SetHeight(10)
-- ~~ Methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
self:SetMethods(methods)
--[[ for method, func in pairs(methods) do
self[method] = func
end ]]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
return self
end
DiesalGUI:RegisterObjectConstructor(Type, Constructor, Version)

@ -176,7 +176,7 @@ local function Constructor()
---@field bar Frame
---@field settings { height: number, width: number, padding: number[], value: number, min: number, max: number, barWidth: number }
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
self.defaults = {

@ -258,7 +258,7 @@ local function Constructor()
self.isContainer = true
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
self.defaults = {

@ -79,7 +79,7 @@ local function Constructor(name)
---@field text Diesal.GUI.Region.FontString
---@field settings { disabled: boolean, height: number, width: number }
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Button", name, UIParent)
local frame = CreateFrame("Button", name, DiesalGUI.UIParent)
self.frame = frame
self.frame.m = self
self.defaults = {

@ -134,7 +134,7 @@ local function Constructor()
---@field settings Diesal.GUI.CheckBox.Settings
---@field value boolean
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("CheckButton", nil, UIParent)
local frame = CreateFrame("CheckButton", nil, DiesalGUI.UIParent)
self.frame = frame
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@ -227,7 +227,7 @@ local function Constructor()
---@field settings { width: number, height: number, buttonWidth: number, dropdownPadding: table, dropdownButtonWidth: number, list: table, selectedKey: string, selectedValue: string, oldValue: string}
local self = DiesalGUI:Create(Type, true)
self.isContainer = true
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
self.defaults = {

@ -105,7 +105,7 @@ local function Constructor()
---@field settings Diesal.GUI.ComboBoxItem.Settings
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Button", nil, UIParent)
local frame = CreateFrame("Button", nil, DiesalGUI.UIParent)
self.frame = frame
self.defaults = {}

@ -48,7 +48,7 @@ local function Constructor()
---@field element? Diesal.GUI.ObjectBase
local self = DiesalGUI:Create(Type, true)
self.isContainer = true
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
self.defaults = {}

@ -41,15 +41,6 @@ local Stylesheet = {
color = "ffffff",
alpha = 0.05,
},
["frame-arrow"] = {
type = "texture",
layer = "BORDER",
image = { "DiesalGUIcons", { 2, 1, 16, 256, 128 } },
alpha = 0.5,
position = { nil, -5, -7, nil },
height = 3,
width = 5,
},
["text-color"] = {
type = "Font",
color = Colors.UI_TEXT,
@ -371,11 +362,10 @@ local methods = {
---@class DiesalDropDown : Diesal.GUI.Object.DropDown
local f = CreateFrame("Button", nil, UIParent)
-- ~~| Dropdown Constructor |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
local function Constructor()
---@class Diesal.GUI.Object.DropDown : Diesal.GUI.ObjectBase, Diesal.GUI.DropDown.Methods
---@field arrow Texture
---@field settings Diesal.GUI.Object.DropDown.Settings
---@field children Diesal.GUI.Object.DropDown.Item[]
---@field text FontString
@ -386,7 +376,7 @@ local function Constructor()
self:SetMethods(methods)
self.dropdownShown = true
local frame = CreateFrame("Button", nil, UIParent)
local frame = CreateFrame("Button", nil, DiesalGUI.UIParent)
frame:SetFrameStrata("TOOLTIP")
frame:SetClampedToScreen(true)
self.frame = frame
@ -409,9 +399,11 @@ local function Constructor()
frame:SetScript("OnClick", function(this, button, down)
if button == "LeftButton" then
if self.dropdown:IsVisible() then
self.arrow:SetRotation(0)
self.dropdown:SetParent(self.frame)
self.dropdown:Hide()
else
self.arrow:SetRotation(math.pi)
self.dropdown:SetParent(UIParent)
DiesalGUI:OnMouse(self.dropdown, button)
self:FixStrata("TOOLTIP", self.dropdown, {
@ -432,6 +424,13 @@ local function Constructor()
self:FireEvent("OnLeave", ...)
end)
local arrow = self:CreateRegion("Texture", "arrow", frame)
arrow:SetVertexColor(1, 1, 1, 0.5)
arrow:SetDrawLayer("BORDER")
arrow:SetAtlas("uitools-icon-chevron-down")
arrow:SetPoint("TOPRIGHT", -7, -3)
arrow:SetSize(10, 10)
local text = self:CreateRegion("FontString", "text", frame)
text:ClearAllPoints()
text:SetPoint("TOPLEFT", 4, -1)

@ -149,7 +149,7 @@ local function Constructor()
---@field text FontString
---@field settings Diesal.GUI.DropDownItem.Settings
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Button", nil, UIParent)
local frame = CreateFrame("Button", nil, DiesalGUI.UIParent)
frame:SetToplevel(true)
frame:SetFrameLevel(999)
frame:SetFrameStrata("TOOLTIP")
@ -171,13 +171,10 @@ local function Constructor()
text:SetWordWrap(false)
local check = self:CreateRegion("Texture", "check", frame)
DiesalStyle:StyleTexture(check, {
type = "texture",
position = { 2, nil, 0, nil },
height = 16,
width = 16,
image = { "DiesalGUIcons", { 10, 5, 16, 256, 128 }, "FFFF00" },
})
check:SetAtlas("uitools-icon-checkmark", false)
check:SetPoint("LEFT", -2, 0)
check:SetPoint("TOP", 0, -2)
check:SetSize(13,13)
check:Hide()
local icon2 = self:CreateRegion("Texture", "icon2", frame)
icon2:SetTexture(130775)

@ -168,7 +168,7 @@ local function Constructor()
---@field checkBoxStyle? Diesal.GUI.Object.IconToggle.CheckBox.Style
---@field label FontString
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("CheckButton", nil, UIParent)
local frame = CreateFrame("CheckButton", nil, DiesalGUI.UIParent)
local fontString = self:CreateRegion("FontString", "label", frame)
self.frame = frame

@ -84,7 +84,7 @@ local function Constructor()
---@class Diesal.GUI.Object.Input : Diesal.GUI.ObjectBase, Diesal.GUI.Input.Methods
---@field editBox EditBox
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
self.defaults = {
height = 16,

@ -195,7 +195,7 @@ local function Constructor()
---@field parent Diesal.GUI.Object.Window
local self = DiesalGUI:Create(Type, true)
self.isContainer = true
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
self.defaults = {

@ -156,7 +156,7 @@ local methods = {
local function Constructor()
---@class Diesal.GUI.Object.ScrollingEditBox : Diesal.GUI.ObjectBase, Diesal.GUI.ScrollingEditBox.Methods
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
self.defaults = {

@ -158,7 +158,7 @@ local methods = {
local function Constructor()
---@class Diesal.GUI.Object.ScrollingMessageFrame : Diesal.GUI.ObjectBase, Diesal.GUI.ScrollingMessageFrame.Methods
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@ -260,7 +260,7 @@ local function Constructor()
---@field buttonDown Button
---@field editBox EditBox
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
self.defaults = {

@ -27,7 +27,7 @@ local function Constructor()
---@field fontString FontString
local self = DiesalGUI:Create(Type, true)
self.defaults = {}
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
self:CreateRegion("FontString", "fontString", frame)
--local fontString = frame:CreateFontString(nil, "OVERLAY", "DiesalFontNormal")

@ -158,7 +158,7 @@ local function Constructor()
---@field checkBoxStyle? Diesal.Style.CheckBox.Style
---@field label FontString
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("CheckButton", nil, UIParent)
local frame = CreateFrame("CheckButton", nil, DiesalGUI.UIParent)
local fontString = self:CreateRegion("FontString", "label", frame)
self.frame = frame

@ -33,24 +33,6 @@ local Stylesheet = {
type = "font",
color = "d8d8d8",
},
["closeButton-icon"] = {
type = "texture",
layer = "ARTWORK",
image = { "DiesalGUIcons", { 9, 5, 16, 256, 128 } },
alpha = 0.3,
position = { -2, nil, -1, nil },
width = 16,
height = 16,
},
["closeButton-iconHover"] = {
type = "texture",
layer = "HIGHLIGHT",
image = { "DiesalGUIcons", { 9, 5, 16, 256, 128 }, "b30000" },
alpha = 1,
position = { -2, nil, -1, nil },
width = 16,
height = 16,
},
["header-background"] = {
type = "texture",
layer = "BACKGROUND",
@ -206,8 +188,8 @@ local methods = {
self:UpdateSizers()
titleBar:SetHeight(settings.titleBarHeight)
closeButton:SetHeight(settings.titleBarHeight)
closeButton:SetWidth(settings.titleBarHeight)
closeButton:SetHeight(settings.titleBarHeight - 6)
closeButton:SetWidth(settings.titleBarHeight - 6)
content:SetPoint("TOPLEFT", settings.padding[1], -(settings.titleBarHeight + headerHeight + settings.padding[3]))
content:SetPoint("BOTTOMRIGHT", -settings.padding[2], footerHeight + settings.padding[4])
@ -317,7 +299,7 @@ local function Constructor()
self.isContainer = true
---@type Diesal.GUI.Window.Frame
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
@ -397,7 +379,18 @@ local function Constructor()
end)
local closeButton = self:CreateRegion("Button", "closeButton", titleBar)
closeButton:SetPoint("TOPRIGHT", -1, 1)
closeButton:SetNormalAtlas("uitools-icon-close")
closeButton:SetHighlightAtlas("uitools-icon-close")
closeButton:GetHighlightTexture():SetVertexColor(1, 0, 0, 1)
--closeButton:SetPushedAtlas("simplecheckout-close-pressed-1x")
--closeButton:GetHighlightTexture():SetVertexColor(1, 0, 0, 1)
closeButton:SetScript("OnEnter",function()
closeButton:GetNormalTexture():Hide()
end)
closeButton:SetScript("OnLeave", function()
closeButton:GetNormalTexture():Show()
end)
closeButton:SetPoint("RIGHT", -5, -0)
closeButton:SetScript("OnClick", function(this, button)
DiesalGUI:OnMouse(this, button)
PlaySound(799)
@ -407,9 +400,8 @@ local function Constructor()
local titletext = self:CreateRegion("FontString", "titletext", titleBar)
titletext:SetWordWrap(false)
titletext:SetPoint("TOPLEFT", 4, -5)
titletext:SetPoint("TOPRIGHT", -20, -5)
titletext:SetJustifyH("TOP")
titletext:SetPoint("LEFT", 4, 0)
titletext:SetPoint("RIGHT", -20, 0)
titletext:SetJustifyH("LEFT")
self:CreateRegion("Frame", "header", frame)

@ -30,7 +30,7 @@ local CLOSEDELAY = 2
---@class Diesal.Menu.CloseTimer : Frame
---@field closeDelay number
local closeTimer = CreateFrame("Frame")
local closeTimer = CreateFrame("Frame", nil, DiesalGUI.UIParent)
closeTimer:Hide()
---@param this Diesal.Menu.CloseTimer

@ -125,7 +125,7 @@ local methods = {
local function Constructor()
---@class Diesal.Menu.Menu : Diesal.GUI.ObjectBase, Diesal.Menu.Menu.Methods
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Frame", nil, UIParent)
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent)
self.frame = frame
self.defaults = {
itemWidth = 0,

@ -128,7 +128,7 @@ local function Constructor()
---@field check Texture
---@field arrow Texture
local self = DiesalGUI:Create(Type, true)
local frame = CreateFrame("Button", nil, UIParent)
local frame = CreateFrame("Button", nil, DiesalGUI.UIParent)
self.frame = frame
-- ~~ Default Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
self.defaults = {

@ -594,7 +594,7 @@ do -- | Set Fonts |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
local font = getMedia("font", "calibrib")
if font then
DiesalFontNormal = CreateFont("DiesalFontNormal")
DiesalFontNormal:SetFont(font, 11, "")
DiesalFontNormal:SetFont("Fonts\\SourceCodePro-Regular.ttf", 11, "")
end
local font = getMedia("font", "calibrib")

@ -618,11 +618,11 @@ end
---@param xOffset? number
---@param yOffset? number
---@return number, number, number, number, number, number, number, number
function DiesalTools.GetTexCoord(zoomPercent, width, height, xOffset, yOffset)
function DiesalTools.GetTexCoords(zoomPercent, width, height, xOffset, yOffset)
xOffset = xOffset or 0
yOffset = yOffset or 0
local textureWidth = 1 - 0.5 * zoomPercent
local aspectRatio = width == 0 or height == 0 and 1 or width / height
local aspectRatio = (width == 0 or height == 0) and 1 or width / height
---@type table<number, number>
local currentCoord = {}
currentCoord[1], currentCoord[2], currentCoord[3], currentCoord[4], currentCoord[5], currentCoord[6], currentCoord[7], currentCoord[8] = 0, 0, 0, 1, 1, 0, 1, 1

Loading…
Cancel
Save