diff --git a/img/underline.tga b/img/underline.tga new file mode 100644 index 00000000..497f8ed6 Binary files /dev/null and b/img/underline.tga differ diff --git a/modules/gui.lua b/modules/gui.lua index c8944a11..c55c9773 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -27,6 +27,43 @@ function pfUI.gui.SwitchTab(frame) frame:Show() end +function pfUI.gui.CreateConfig(parent, caption, category, config) + -- basic frame + local frame = CreateFrame("Frame", nil, parent) + frame:SetWidth(350) + frame:SetHeight(25) + frame:SetBackdrop(pfUI.backdrop_underline) + frame:SetBackdropBorderColor(1,1,1,.25) + + -- caption + frame.caption = frame:CreateFontString("Status", "LOW", "GameFontNormal") + frame.caption:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 12, "OUTLINE") + frame.caption:SetAllPoints(frame) + frame.caption:SetFontObject(GameFontWhite) + frame.caption:SetJustifyH("LEFT") + frame.caption:SetText(caption) + frame.configCategory = category + frame.configEntry = config + + -- input field + frame.input = CreateFrame("EditBox", nil, frame) + frame.input:SetTextColor(.2,1.1,1) + frame.input:SetJustifyH("RIGHT") + + frame.input:SetWidth(100) + frame.input:SetHeight(20) + frame.input:SetPoint("TOPRIGHT" , 0, 0) + frame.input:SetFontObject(GameFontNormal) + frame.input:SetAutoFocus(false) + frame.input:SetText(pfUI.config[category][config]) + frame.input:SetScript("OnEscapePressed", function(self) + pfUI.config[this:GetParent().configCategory][this:GetParent().configEntry] = this:GetText() + this:ClearFocus() + end) + + return frame +end + function pfUI.gui.UnlockFrames() -- don't call it "grid" to avoid confusion with grid (addon) module pfUI.gitter = CreateFrame("Frame", nil, UIParent) @@ -129,6 +166,9 @@ pfUI.gui.uf.title:SetPoint("TOP", 0, -10) pfUI.gui.uf.title:SetFontObject(GameFontWhite) pfUI.gui.uf.title:SetText("UnitFrame Settings") +pfUI.gui.uf.animation_speed = pfUI.gui.CreateConfig(pfUI.gui.uf, "Animation Speed", "unitframes", "animation_speed") +pfUI.gui.uf.animation_speed:SetPoint("TOPLEFT", 25,-25) + -- Unlock Frames pfUI.gui.unlockFrames = CreateFrame("Button", nil, pfUI.gui) pfUI.gui.unlockFrames:ClearAllPoints() diff --git a/pfUI.lua b/pfUI.lua index 9bc68200..64200347 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -29,6 +29,11 @@ pfUI.backdrop_col = { insets = {left = 0, right = 0, top = 0, bottom = 0}, } +pfUI.backdrop_underline = { + edgeFile = "Interface\\AddOns\\pfUI\\img\\underline", edgeSize = 8, + insets = {left = 0, right = 0, top = 0, bottom = 0}, +} + pfUI.playerDB = {} pfUI.config = {