Add new feature: Transparent background when moving
This commit is contained in:
parent
b81af2c2ec
commit
f00edc16fc
8 changed files with 90 additions and 37 deletions
|
@ -14,17 +14,19 @@ function CzechQuestsAddon:InitializeOptions()
|
|||
)
|
||||
Settings.CreateCheckbox(CzechQuestsAddon.optionsFrame, debugCheckbox)
|
||||
|
||||
-- Add DARK mode checkbox
|
||||
local darkModeCheckbox = Settings.RegisterAddOnSetting(
|
||||
CzechQuestsAddon.optionsFrame,
|
||||
"CzechQuestsAddon__DARK_MODE",
|
||||
"DARK_MODE",
|
||||
CzechQuestsAddon_Store.config,
|
||||
type(CzechQuestsAddon_Store.config.DARK_MODE),
|
||||
"Use dark mode",
|
||||
CzechQuestsAddon_Store.config.DARK_MODE
|
||||
)
|
||||
Settings.CreateCheckbox(CzechQuestsAddon.optionsFrame, darkModeCheckbox)
|
||||
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
|
||||
-- Add DARK mode checkbox
|
||||
local darkModeCheckbox = Settings.RegisterAddOnSetting(
|
||||
CzechQuestsAddon.optionsFrame,
|
||||
"CzechQuestsAddon__DARK_MODE",
|
||||
"DARK_MODE",
|
||||
CzechQuestsAddon_Store.config,
|
||||
type(CzechQuestsAddon_Store.config.DARK_MODE),
|
||||
"Use dark mode",
|
||||
CzechQuestsAddon_Store.config.DARK_MODE
|
||||
)
|
||||
Settings.CreateCheckbox(CzechQuestsAddon.optionsFrame, darkModeCheckbox)
|
||||
end
|
||||
|
||||
-- define FontOptions
|
||||
local function GetFontOptions()
|
||||
|
@ -132,6 +134,24 @@ function CzechQuestsAddon:InitializeOptions()
|
|||
textFontSizeSliderOptions:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right);
|
||||
Settings.CreateSlider(CzechQuestsAddon.optionsFrame, textFontSizeSlider, textFontSizeSliderOptions)
|
||||
|
||||
-- Add slider for change secondary header font size
|
||||
local textureAlphaSlider = Settings.RegisterProxySetting(
|
||||
CzechQuestsAddon.optionsFrame,
|
||||
"CzechQuestsAddon__TRANSLATION_FRAME_TEXTURE_ALPHA",
|
||||
type(CzechQuestsAddon_Store.config.TRANSLATION_FRAME_TEXTURE_ALPHA),
|
||||
"Texture transparency",
|
||||
CzechQuestsAddon_Store.config.TRANSLATION_FRAME_TEXTURE_ALPHA,
|
||||
function()
|
||||
return CzechQuestsAddon_Store.config.TRANSLATION_FRAME_TEXTURE_ALPHA
|
||||
end,
|
||||
function(value)
|
||||
CzechQuestsAddon_Store.config.TRANSLATION_FRAME_TEXTURE_ALPHA = value
|
||||
end
|
||||
)
|
||||
local textureAlphaSliderOptions = Settings.CreateSliderOptions(10, 100, 10)
|
||||
textureAlphaSliderOptions:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right);
|
||||
Settings.CreateSlider(CzechQuestsAddon.optionsFrame, textureAlphaSlider, textureAlphaSliderOptions)
|
||||
|
||||
-- Store it into Addon options
|
||||
Settings.RegisterAddOnCategory(CzechQuestsAddon.optionsFrame)
|
||||
end
|
||||
|
|
|
@ -9,18 +9,9 @@ function CzechQuestsAddon:CreateTranslationFrame()
|
|||
|
||||
-- Background Parchment texture
|
||||
frame.texture = frame:CreateTexture(nil, "BACKGROUND", nil, -1);
|
||||
frame.texture:SetAllPoints(true);
|
||||
frame.texture:SetAllPoints(true)
|
||||
frame.texture:SetHorizTile(true)
|
||||
|
||||
-- Apply correct texture for wow version
|
||||
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
|
||||
frame.texture:SetTexture("Interface/QUESTFRAME/QuestBG");
|
||||
frame.texture:SetTexCoord(0, .58, 0.005, 0.66)
|
||||
else
|
||||
frame.texture:SetTexture("Interface/QUESTFRAME/QuestBackgroundParchment");
|
||||
CzechQuestsAddon:SetTextureFromSettings(frame)
|
||||
end
|
||||
|
||||
frame.primaryHeader = CzechQuestsAddon:CreateTranslationFont(
|
||||
frame,
|
||||
"CzechQuestTranslationPrimaryHeader",
|
||||
|
@ -46,6 +37,9 @@ function CzechQuestsAddon:CreateTranslationFrame()
|
|||
CzechQuestsAddon_Store.config.TRANSLATION_FRAME_TEXT_FONT_SIZE
|
||||
)
|
||||
|
||||
-- Apply correct texture for wow version
|
||||
CzechQuestsAddon:SetTextureFromSettings(frame)
|
||||
|
||||
return frame;
|
||||
end
|
||||
|
||||
|
@ -67,6 +61,14 @@ end
|
|||
|
||||
function CzechQuestsAddon:SetTextureFromSettings(frame)
|
||||
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
|
||||
-- setup default
|
||||
frame.texture:SetTexture("Interface/QUESTFRAME/QuestBG");
|
||||
frame.texture:SetTexCoord(0, .58, 0.005, 0.66)
|
||||
frame.primaryHeader:SetTextColor(0, 0, 0, 1)
|
||||
frame.secondaryHeader:SetTextColor(0, 0, 0, 1)
|
||||
frame.primaryText:SetTextColor(0, 0, 0, 1)
|
||||
frame.secondaryText:SetTextColor(0, 0, 0, 1)
|
||||
|
||||
if CzechQuestsAddon_Store.config.DARK_MODE then
|
||||
frame:SetBackdropColor(0, 0, 0, 1)
|
||||
frame.texture:SetColorTexture(0, 0, 0, 1)
|
||||
|
@ -76,12 +78,26 @@ function CzechQuestsAddon:SetTextureFromSettings(frame)
|
|||
frame.secondaryText:SetTextColor(255, 255, 255, 1)
|
||||
end
|
||||
else
|
||||
-- TODO add DARK MODE support for retail
|
||||
-- setup default
|
||||
frame.texture:SetTexture("Interface/QUESTFRAME/QuestBackgroundParchment");
|
||||
frame.texture:SetTexCoord(0, .01, 0, 0.4)
|
||||
frame.primaryHeader:SetTextColor(0, 0, 0, 1)
|
||||
frame.secondaryHeader:SetTextColor(0, 0, 0, 1)
|
||||
frame.primaryText:SetTextColor(0, 0, 0, 1)
|
||||
frame.secondaryText:SetTextColor(0, 0, 0, 1)
|
||||
|
||||
-- Read CVar from settings to setup same parchment as Quest frame
|
||||
if C_CVar.GetCVar("questTextContrast") == "0" then
|
||||
frame.texture:SetTexCoord(0, .01, 0, 0.4) -- Parchment (brown)
|
||||
else
|
||||
frame.texture:SetTexCoord(0, .01, .4, .8) -- Parchment (white)
|
||||
if C_CVar.GetCVar("questTextContrast") == "1" then -- Brown
|
||||
frame.texture:SetTexCoord(0, .01, .4, .8)
|
||||
elseif C_CVar.GetCVar("questTextContrast") == "2"
|
||||
or C_CVar.GetCVar("questTextContrast") == "3" then -- Gray
|
||||
frame.texture:SetColorTexture(255, 255, 255, 1)
|
||||
elseif C_CVar.GetCVar("questTextContrast") == "4" then -- Black
|
||||
frame.texture:SetColorTexture(0, 0, 0, 1)
|
||||
frame.primaryHeader:SetTextColor(255, 255, 255, 1)
|
||||
frame.secondaryHeader:SetTextColor(255, 255, 255, 1)
|
||||
frame.primaryText:SetTextColor(255, 255, 255, 1)
|
||||
frame.secondaryText:SetTextColor(255, 255, 255, 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -107,4 +123,7 @@ function CzechQuestsAddon:UpdateTranslationFrameFontSettings()
|
|||
CzechQuestsAddon_Store.config.TRANSLATION_FRAME_TEXT_FONT_SIZE,
|
||||
nil
|
||||
)
|
||||
CzechQuestsAddon.translationFrame.texture:SetAlpha(
|
||||
CzechQuestsAddon_Store.config.TRANSLATION_FRAME_TEXTURE_ALPHA / 100
|
||||
)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue