/
target:SetWidth(144) |
target:SetPoint("LEFT", channel, "RIGHT", 0, 2) |
target:SetScript("OnEscapePressed", target.ClearFocus) |
target:SetScript("OnEnterPressed", function(self) module:AnnounceRecords() end) |
target:SetScript("OnEnterPressed", function(self) module:AnnounceRecords(self:GetText():trim()) end) |
target:Hide() |
module.target = target |
end |
addon.RegisterCallback(module, "SpellsChanged", "Update") |
function module:AnnounceRecords() |
function module:AnnounceRecords(target) |
local channel = self.channel:GetSelectedValue() |
local tree = self.tree:GetSelectedValue() |
local spells = addon.percharDB.profile.spells[tree] |
local target = self.target:GetText():trim() |
if channel == "WHISPER" then |
if target == "" then |
local addonName, addon = ... |
local L = LibStub("AceLocale-3.0"):GetLocale(addonName) |
local LSM = LibStub("LibSharedMedia-3.0") |
local templates = addon.templates |
moveSplash:SetScript("OnClick", function() |
-- don't want to be interrupted by new records |
addon.UnregisterCallback(splash, "NewRecord") |
splash:SetFrameStrata("FULLSCREEN") |
splash:SetFrameStrata("DIALOG") |
splash:EnableMouse(true) |
splash:SetFading(false) |
splash:Clear() |
end) |
options.button = moveSplash |
local function onClick(self) |
self.owner:SetSelectedValue(self.value) |
local font = splash.profile.font |
font.name = self.value |
splash:SetFont(LSM:Fetch("font", font.name), font.size, font.flags) |
end |
local menu = { |
onClick = function(self) |
self.owner:SetSelectedValue(self.value) |
local font = splash.profile.font |
font.name = self.value |
splash:SetFont(format("Fonts\\%s.ttf", font.name), font.size, font.flags) |
end, |
{ |
text = "Arial Narrow", |
value = "ARIALN", |
}, |
{ |
text = "Friz Quadrata", |
value = "FRIZQT__", |
}, |
{ |
text = "Morpheus", |
value = "MORPHEUS", |
}, |
{ |
text = "Skurri", |
value = "skurri", |
}, |
} |
local function initialize(self) |
for _, v in ipairs(LSM:List("font")) do |
local info = UIDropDownMenu_CreateInfo() |
info.text = v |
info.func = onClick |
info.owner = self |
UIDropDownMenu_AddButton(info) |
end |
end |
local font = templates:CreateDropDownMenu("CritlineSplashFont", config, nil, initialize) |
local font = templates:CreateDropDownMenu("CritlineSplashFont", config, menu) |
font:SetFrameWidth(120) |
font:SetPoint("TOPLEFT", config.title, "BOTTOM", 0, -28) |
font.label:SetText(L["Font"]) |
self.owner:SetSelectedValue(self.value) |
local font = splash.profile.font |
font.flags = self.value |
splash:SetFont(LSM:Fetch("font", font.name), font.size, font.flags) |
splash:SetFont(format("Fonts\\%s.ttf", font.name), font.size, font.flags) |
end, |
{ |
text = L["None"], |
self.value:SetText(value) |
local font = splash.profile.font |
font.size = value |
splash:SetFont(LSM:Fetch("font", font.name), font.size, font.flags) |
splash:SetFont(format("Fonts\\%s.ttf", font.name), font.size, font.flags) |
end, |
}) |
fontSize:SetPoint("TOP", fontFlags, "BOTTOM", 0, -24) |
scale = 1, |
duration = 2, |
font = { |
name = "Skurri", |
name = "skurri", |
size = 30, |
flags = "OUTLINE", |
}, |
end |
local font = self.profile.font |
self:SetFont(LSM:Fetch("font", font.name), font.size, font.flags) |
self:SetFont(format("Fonts\\%s.ttf", font.name), font.size, font.flags) |
options.font:SetSelectedValue(font.name) |
options.fontFlags:SetSelectedValue(font.flags) |
## Author: L'ombra |
## SavedVariables: CritlineDB |
## SavedVariablesPerCharacter: CritlinePerCharDB |
## OptionalDeps: Ace3, LibSharedMedia-3.0 |
libs\LibStub.lua |
libs\CallbackHandler-1.0.lua |
libs\AceLocale-3.0.lua |
libs\LibDataBroker-1.1.lua |
libs\LibDualSpec-1.0.lua |
libs\LibSharedMedia-3.0.lua |
locales\enUS.lua |
locales\deDE.lua |
do -- dropdown menu frame |
local function setSelectedValue(self, value) |
UIDropDownMenu_SetSelectedValue(self, value) |
UIDropDownMenu_SetText(self, self.menu and self.menu[value] or value) |
UIDropDownMenu_SetText(self, self.menu[value] or value) |
end |
local function getSelectedValue(self) |
info.value = v.value |
info.func = onClick or v.func |
info.owner = self |
info.fontObject = v.fontObject |
UIDropDownMenu_AddButton(info) |
end |
end |