Skip to content

Commit

Permalink
Framework Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Jul 30, 2024
1 parent df77824 commit dc9d0e8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 12 deletions.
22 changes: 20 additions & 2 deletions Libs/DF/buildmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,16 @@ local onLeaveHighlight = function(self)
end
end

--control the highlight color, if true, use color one, if false, use color two
--color one: .2, .2, .2, 0.5
--color two: .3, .3, .3, 0.5
local bHighlightColorOne = true

---create a button and a texture to highlight the button when the mouse is over it
---the button has the dimentions of the label and the widget
---@param frame frame
---@param label fontstring
---@param widgetWidth nunmber
---@param widgetWidth number
---@return unknown
local createOptionHighlightFrame = function(frame, label, widgetWidth)
frame = frame.widget or frame
Expand All @@ -163,13 +168,22 @@ local createOptionHighlightFrame = function(frame, label, widgetWidth)

local highlightTexture = highlightFrame:CreateTexture(nil, "overlay")
highlightTexture:SetColorTexture(1, 1, 1, 0.1)

PixelUtil.SetPoint(highlightTexture, "topleft", highlightFrame, "topleft", 0, 0)
PixelUtil.SetPoint(highlightTexture, "bottomright", highlightFrame, "bottomright", 0, 0)
highlightTexture:Hide()

local backgroundTexture = highlightFrame:CreateTexture(nil, "artwork")
backgroundTexture:SetColorTexture(1, 1, 1)
backgroundTexture:SetColorTexture(1, 1, 1, 0.5)
backgroundTexture:SetVertexColor(.25, .25, .25, 0.5)

if (bHighlightColorOne) then
backgroundTexture:SetVertexColor(.2, .2, .2, 0.5)
else
backgroundTexture:SetVertexColor(.25, .25, .25, 0.5)
end
bHighlightColorOne = not bHighlightColorOne

PixelUtil.SetPoint(backgroundTexture, "topleft", highlightFrame, "topleft", 0, 0)
PixelUtil.SetPoint(backgroundTexture, "bottomright", highlightFrame, "bottomright", 0, 0)

Expand Down Expand Up @@ -1055,6 +1069,8 @@ function detailsFramework:BuildMenuVolatile(parent, menuOptions, xOffset, yOffse
end
detailsFramework:ClearOptionsPanel(parent)

bHighlightColorOne = true

local amountLineWidgetAdded = 0
local biggestColumnHeight = 0 --used to resize the scrollbox child when a scrollbox is passed
local latestInlineWidget
Expand Down Expand Up @@ -1323,6 +1339,8 @@ function detailsFramework:BuildMenu(parent, menuOptions, xOffset, yOffset, heigh
local maxColumnWidth = 0 --biggest width of widget + text size on the current column loop pass
local maxWidgetWidth = 0 --biggest widget width on the current column loop pass

bHighlightColorOne = true

--parse settings and the options table
parseOptionsTypes(menuOptions)

Expand Down
46 changes: 36 additions & 10 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 554
local dversion = 555
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down Expand Up @@ -2914,8 +2914,10 @@ end

--DF.font_templates ["ORANGE_FONT_TEMPLATE"] = {color = "orange", size = 11, font = "Accidental Presidency"}
--DF.font_templates ["OPTIONS_FONT_TEMPLATE"] = {color = "yellow", size = 12, font = "Accidental Presidency"}
DF.font_templates["ORANGE_FONT_TEMPLATE"] = {color = "orange", size = 10, font = DF:GetBestFontForLanguage()}
DF.font_templates["OPTIONS_FONT_TEMPLATE"] = {color = "yellow", size = 9.6, font = DF:GetBestFontForLanguage()}
--DF.font_templates["ORANGE_FONT_TEMPLATE"] = {color = "orange", size = 10, font = DF:GetBestFontForLanguage()}
DF.font_templates["ORANGE_FONT_TEMPLATE"] = {color = {1, 0.8235, 0, 1}, size = 12, font = DF:GetBestFontForLanguage()}
--DF.font_templates["OPTIONS_FONT_TEMPLATE"] = {color = "yellow", size = 9.6, font = DF:GetBestFontForLanguage()}
DF.font_templates["OPTIONS_FONT_TEMPLATE"] = {color = {1, 1, 1, 0.9}, size = 9.6, font = DF:GetBestFontForLanguage()}
DF.font_templates["SMALL_SILVER"] = {color = "silver", size = 9, font = DF:GetBestFontForLanguage()}

--dropdowns
Expand All @@ -2929,9 +2931,10 @@ DF.dropdown_templates["OPTIONS_DROPDOWN_TEMPLATE"] = {
tile = true
},

backdropcolor = {0.1, 0.1, 0.1, .7},
--backdropcolor = {0.1, 0.1, 0.1, .7},
backdropcolor = {0.2, 0.2, 0.2, .7},
onentercolor = {0.3, 0.3, 0.3, .7},
backdropbordercolor = {0, 0, 0, .7},
backdropbordercolor = {0, 0, 0, .4},
onenterbordercolor = {0.3, 0.3, 0.3, 0.8},

dropicon = "Interface\\BUTTONS\\arrow-Down-Down",
Expand Down Expand Up @@ -3054,14 +3057,37 @@ DF.button_templates["STANDARD_GRAY"] = {
DF.slider_templates = DF.slider_templates or {}
DF.slider_templates["OPTIONS_SLIDER_TEMPLATE"] = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {1, 1, 1, .5},
backdropbordercolor = {0, 0, 0, 1},
onentercolor = {1, 1, 1, .5},
onenterbordercolor = {1, 1, 1, 1},

--original color wow10:
--backdropcolor = {1, 1, 1, .5},
--backdropbordercolor = {0, 0, 0, 1},
--onentercolor = {1, 1, 1, .5},
--onenterbordercolor = {1, 1, 1, 1},

backdropcolor = {0.2, 0.2, 0.2, .7},
onentercolor = {0.3, 0.3, 0.3, .7},
backdropbordercolor = {0, 0, 0, .4}, --0.7 original alpha wow10
onenterbordercolor = {0.3, 0.3, 0.3, 0.8},

thumbtexture = [[Interface\Tooltips\UI-Tooltip-Background]],
thumbwidth = 16,
thumbheight = 14,
thumbcolor = {0, 0, 0, 0.5},
--thumbcolor = {0, 0, 0, 0.5},
thumbcolor = {.8, .8, .8, 0.5},
}

DF.slider_templates["OPTIONS_SLIDERDARK_TEMPLATE"] = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},

backdropcolor = {0.05, 0.05, 0.05, .7},
onentercolor = {0.3, 0.3, 0.3, .7},
backdropbordercolor = {0, 0, 0, 1},
onenterbordercolor = {0, 0, 0, 1},

thumbtexture = [[Interface\Tooltips\UI-Tooltip-Background]],
thumbwidth = 24,
thumbheight = 14,
thumbcolor = {.8, .8, .8, 0.5},
}

DF.slider_templates["MODERN_SLIDER_TEMPLATE"] = {
Expand Down
1 change: 1 addition & 0 deletions Libs/DF/slider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,7 @@ end
--DF:Mixin(DFSliderMetaFunctions, DF.TooltipHandlerMixin)

---@class df_slider : slider, df_scripthookmixin, df_widgets
---@field tooltip string?
---@field widget slider
---@field slider slider
---@field type string
Expand Down

0 comments on commit dc9d0e8

Please sign in to comment.