From 7bc18d302a3e122ae7931cd340404ba82f48e008 Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 15 Oct 2016 01:35:12 +0200 Subject: [PATCH] rework of the gitter frames --- img/gitter.tga | Bin 119 -> 0 bytes modules/group.lua | 5 ++-- modules/gui.lua | 63 ++++++++++++++++++++++++++++++++++++++++------ modules/raid.lua | 3 +-- pfUI.lua | 4 --- 5 files changed, 58 insertions(+), 17 deletions(-) delete mode 100644 img/gitter.tga diff --git a/img/gitter.tga b/img/gitter.tga deleted file mode 100644 index 7cae280c79582c1f2307071363c78dc30ed548e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 119 zcmZQz;9`IQ4h9Ye1rCP)K+p!n_LQ*NL8ibA4haf%4f724^!L+^aP#zW)nfnv--|!v diff --git a/modules/group.lua b/modules/group.lua index c2e39b8b..6a203b77 100644 --- a/modules/group.lua +++ b/modules/group.lua @@ -30,7 +30,7 @@ pfUI:RegisterModule("group", function () for i=1, 5 do if GetNumPartyMembers() >= i then pfUI.uf.group[i]:Show() - if UnitIsConnected("party"..i) then + if UnitIsConnected("party"..i) or not UnitName("raid" .. this.id) then pfUI.uf.group[i]:SetAlpha(1) else pfUI.uf.group[i]:SetAlpha(.25) @@ -110,7 +110,6 @@ pfUI:RegisterModule("group", function () pfUI.uf.group[i].caption:SetPoint("LEFT",pfUI.uf.group[i].hp.bar, "LEFT", 10, 0) pfUI.uf.group[i].caption:SetJustifyH("LEFT") pfUI.uf.group[i].caption:SetFontObject(GameFontWhite) - pfUI.uf.group[i].caption:SetText("Group"..i) pfUI.uf.group[i].hp.leaderIcon = CreateFrame("Frame",nil,pfUI.uf.group[i].hp) pfUI.uf.group[i].hp.leaderIcon:SetWidth(10) @@ -172,7 +171,7 @@ pfUI:RegisterModule("group", function () end) pfUI.uf.group[i]:SetScript("OnUpdate", function () - if CheckInteractDistance("party" .. this.id, 4) then + if CheckInteractDistance("party" .. this.id, 4) or not UnitName("raid" .. this.id) then this:SetAlpha(1) else this:SetAlpha(.5) diff --git a/modules/gui.lua b/modules/gui.lua index fd32cd69..b73a78ec 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -99,11 +99,51 @@ pfUI:RegisterModule("gui", function () if not pfUI.gitter then pfUI.gitter = CreateFrame("Frame", nil, UIParent) + pfUI.gitter:SetAllPoints(WorldFrame) pfUI.gitter:SetFrameStrata("BACKGROUND") - pfUI.gitter:SetPoint("TOPLEFT", 0, 0, "TOPLEFT") - pfUI.gitter:SetPoint("BOTTOMRIGHT", 0, 0, "BOTTOMRIGHT") - pfUI.gitter:SetBackdrop(pfUI.backdrop_gitter) - pfUI.gitter:SetBackdropColor(0,0,0,1) + + local size = 1 + local width = GetScreenWidth() + local ratio = width / GetScreenHeight() + local height = GetScreenHeight() * ratio + + local wStep = width / 128 + local hStep = height / 128 + + for i = 0, 128 do + local tx = pfUI.gitter:CreateTexture(nil, 'BACKGROUND') + if i == 128 / 2 then + tx:SetTexture(.2, 1, .8) + else + tx:SetTexture(0, 0, 0) + end + tx:SetPoint("TOPLEFT", pfUI.gitter, "TOPLEFT", i*wStep - (size/2), 0) + tx:SetPoint('BOTTOMRIGHT', pfUI.gitter, 'BOTTOMLEFT', i*wStep + (size/2), 0) + end + + local height = GetScreenHeight() + + for i = 0, 128 do + local tx = pfUI.gitter:CreateTexture(nil, 'BACKGROUND') + tx:SetTexture(.2, 1, .8) + tx:SetPoint("TOPLEFT", pfUI.gitter, "TOPLEFT", 0, -(height/2) + (size/2)) + tx:SetPoint('BOTTOMRIGHT', pfUI.gitter, 'TOPRIGHT', 0, -(height/2 + size/2)) + end + + for i = 1, floor((height/2)/hStep) do + local tx = pfUI.gitter:CreateTexture(nil, 'BACKGROUND') + tx:SetTexture(0, 0, 0) + + tx:SetPoint("TOPLEFT", pfUI.gitter, "TOPLEFT", 0, -(height/2+i*hStep) + (size/2)) + tx:SetPoint('BOTTOMRIGHT', pfUI.gitter, 'TOPRIGHT', 0, -(height/2+i*hStep + size/2)) + + tx = pfUI.gitter:CreateTexture(nil, 'BACKGROUND') + tx:SetTexture(0, 0, 0) + + tx:SetPoint("TOPLEFT", pfUI.gitter, "TOPLEFT", 0, -(height/2-i*hStep) + (size/2)) + tx:SetPoint('BOTTOMRIGHT', pfUI.gitter, 'TOPRIGHT', 0, -(height/2-i*hStep + size/2)) + end + pfUI.gitter:Hide() end @@ -123,10 +163,17 @@ pfUI:RegisterModule("gui", function () frame.drag = CreateFrame("Frame", nil, frame) frame.drag:SetAllPoints(frame) frame.drag:SetFrameStrata("DIALOG") - frame.drag.bg = frame.drag:CreateTexture() - frame.drag.bg:SetAllPoints(frame.drag) - frame.drag.bg:SetTexture(.2,1,.8,1) - frame.drag:SetAlpha(.25) + frame.drag:SetBackdrop(pfUI.backdrop_col) + frame.drag:SetBackdropBorderColor(.2, 1, .8) + frame.drag:SetBackdropColor(1,1,1,.75) + frame.drag.text = frame.drag:CreateFontString("Status", "LOW", "GameFontNormal") + frame.drag.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", pfUI_config.global.font_size, "OUTLINE") + frame.drag.text:ClearAllPoints() + frame.drag.text:SetAllPoints(frame.drag) + frame.drag.text:SetPoint("CENTER", 0, 0) + frame.drag.text:SetFontObject(GameFontWhite) + frame.drag.text:SetText(strsub(frame:GetName(),3)) + frame.drag:SetAlpha(1) end frame.drag:SetScript("OnMouseDown",function() diff --git a/modules/raid.lua b/modules/raid.lua index 644a85bc..9913506b 100644 --- a/modules/raid.lua +++ b/modules/raid.lua @@ -78,7 +78,6 @@ pfUI:RegisterModule("raid", function () pfUI.uf.raid[i].caption:SetPoint("CENTER",pfUI.uf.raid[i].hp.bar, "CENTER", 0, 0) pfUI.uf.raid[i].caption:SetJustifyH("CENTER") pfUI.uf.raid[i].caption:SetFontObject(GameFontWhite) - pfUI.uf.raid[i].caption:SetText("Raid"..i) pfUI.uf.raid[i].hp.leaderIcon = CreateFrame("Frame",nil,pfUI.uf.raid[i].hp) pfUI.uf.raid[i].hp.leaderIcon:SetWidth(10) @@ -178,7 +177,7 @@ pfUI:RegisterModule("raid", function () end) pfUI.uf.raid[i]:SetScript("OnUpdate", function () - if CheckInteractDistance("raid" .. this.id, 4) then + if CheckInteractDistance("raid" .. this.id, 4) or not UnitName("raid" .. this.id) then this:SetAlpha(1) else this:SetAlpha(.5) diff --git a/pfUI.lua b/pfUI.lua index 08cb52d3..e02167a2 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -70,10 +70,6 @@ pfUI.backdrop = { insets = {left = 0, right = 0, top = 0, bottom = 0}, } -pfUI.backdrop_gitter = { - bgFile = "Interface\\AddOns\\pfUI\\img\\gitter", tile = true, tileSize = 8, -} - pfUI.backdrop_col = { bgFile = "Interface\\AddOns\\pfUI\\img\\bg", tile = true, tileSize = 8, edgeFile = "Interface\\AddOns\\pfUI\\img\\border_col", edgeSize = 8,