06-15-10, 05:06 PM | #21 | |
edit -- v6o -- if i do GrimUI.PartyNameTextEvents without (self) at the end it knows that function needs to work onitself right? so when i do the setscript there are no (self)'s in the mater? it knows to get the (self) on GrimUI.PartyNameTextEvents automatically? edit -- oh yea im not actually getting errors or even trying any of this in game right now... im working all based on theory. i want to understand whats going on so it becomes easier to write code without so much guess and check... i just figured there would be a self error there based on the theory of the mater... edit -- made it look like this based on that idea... lua Code:
Last edited by Grimsin : 06-15-10 at 05:16 PM. |
||
06-15-10, 05:11 PM | #22 |
You can register any event to any frame that supports it, even if it it not parented.
The thing you just have to remember is for a lot of events the first argument is usually the unit id and you will need to check if it the correct one for your frame. And again a lot of your SetScripts do not need the extra function call you're doing. Instead of doing Code:
frame.GUIHealthEvents:SetScript("OnEvent", function(self) GrimUI.HealthEventFunc(self) end) Code:
frame.GUIHealthEvents:SetScript("OnEvent", GrimUI.HealthEventFunc)
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning. This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so. This is your permission slip. If you need to contact me, do so on Twitter @v6ooo Best regards, v6. Last edited by v6o : 06-15-10 at 05:15 PM. |
|
06-15-10, 10:10 PM | #23 |
edit- okay i changed the code to the following and no longer get any errors how ever when i first load up the dropdownmenu is open i have to click cancel? and none of the event scripts are working
lua Code:
|
|
06-15-10, 10:11 PM | #24 |
event scripts look like this...
lua Code:
the setscript function looks like this... lua Code:
|
|
06-15-10, 10:37 PM | #25 |
welp ive been at this all day heading to bed. thanks for all the help from everyone today. this is what it looks like the two major problems are the dropdownmenu's and the events not registering. btw it is a WHOLE lot smaller thanks!!!!!
lua Code:
|
|
06-16-10, 05:01 AM | #26 |
Looking much better. I cleaned it up some but there is still more to do. Your separate frames for handling the events are going to be a pain because the frame they pass isn't the "main" frame that you coded the handlers around. I changed the .targetOf part to tie events directly to itself so that should help a little.
I also made it so that the frames (and their targets) should now auto show/hide and also register/unregister their events in the process. I commented out the other function you have for hiding/showing because it shouldn't be necessary and could actually make the current code break. All dry-coded and untested of course... Code:
local module = GrimUI:RegisterModule("PartyFrames") ----------------------------------- -- Party Frame Header ----------------------------------- local GrimPartyMain = CreateFrame('Frame', "GrimPartyMain", UIParent, 'SecureHandlerStateTemplate') GrimPartyMain:SetAttribute('_onstate-group', [[ self[newstate](self) ]]) --##########################################-- -- individual frame creations party 1,2,3,4 -- --##########################################-- local function showPartyMenu(self) ToggleDropDownMenu(1, nil, _G["PartyMemberFrame" .. self.id .. "DropDown"], "cursor", 0, 0) end local function showPartyTargetMenu(self) ToggleDropDownMenu(1, nil, TargetFrameDropDown, 'cursor', 0, 0) end local function CreateUnitButton(name, parent, unit, menufunc) local frame = CreateFrame('Button', name, parent, 'SecureUnitButtonTemplate') SecureUnitButton_OnLoad(frame, unit, menufunc) frame:RegisterForClicks('AnyUp') frame:SetScript('OnEnter', UnitFrame_OnEnter) frame:SetScript('OnLeave', UnitFrame_OnLeave) GrimPartyMain:WrapScript(frame, 'OnAttributeChanged', [[ if name ~= 'state-exists' then return end self[value](self) ]]) RegisterStateDriver(frame, 'exists', ("[@%s, exists] Show; Hide"):format(unit)) frame.unit = unit return frame end for id = 1, 4 do local unit = 'party' .. id local frame = CreateUnitButton("GrimUIPartyFrame" .. id, GrimPartyMain, unit, showPartyMenu) frame.id = id frame.unittarget = unit .. 'target' -- Pedestal Frame frame.PedestalFrame = CreateFrame("Frame", nil, frame) -- Health Bar frame.HealthBorder = CreateFrame("Button", nil, frame) frame.HealthBar = CreateFrame("StatusBar", nil, frame) frame.HealthNumTxtFrame = CreateFrame("Frame", nil, frame) -- Mana Bar frame.ManaBorder = CreateFrame("Button", nil, frame) frame.ManaBar = CreateFrame("StatusBar", nil, frame) frame.ManaNumTxtFrame = CreateFrame("Frame", nil, frame) -- Misc Frames frame.InfoTextFrame = CreateFrame("Button", nil, frame) frame.LetterFrame = CreateFrame("Frame", nil, frame) frame.LeaderFrame = CreateFrame("Frame", nil, frame) frame.pvpIconFrame = CreateFrame("Frame", nil, frame) frame.offDeadGhostTxtFrame = CreateFrame("Frame", nil, frame) -- Target Bar frame.targetOfFrame = CreateUnitButton(nil, frame, frame.unittarget, showPartyTargetMenu) RegisterUnitWatch(frame.targetOfFrame) -- texture creation frame.PedestalFrame.texture = frame.PedestalFrame:CreateTexture() frame.LeaderFrame.texture = frame.LeaderFrame:CreateTexture() frame.pvpIconFrame.texture = frame.pvpIconFrame:CreateTexture() frame.targetOfFrame.texture = frame.targetOfFrame:CreateTexture(nil, "BACKGROUND") -- texture SetAllPoints that remain the same for both party styles frame.PedestalFrame.texture:SetAllPoints() frame.targetOfFrame.texture:SetAllPoints() frame.LeaderFrame.texture:SetAllPoints() frame.pvpIconFrame.texture:SetAllPoints() -- font creation frame.HealthBorder.percentHText = frame.HealthBorder:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.ManaBorder.percentMText = frame.ManaBorder:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.InfoTextFrame.NameText = frame.InfoTextFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.LetterFrame.LetterHText = frame.LetterFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.LetterFrame.LetterMText = frame.LetterFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.HealthNumTxtFrame.chnumtxt = frame.HealthNumTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.HealthNumTxtFrame.mhnumtxt = frame.HealthNumTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.ManaNumTxtFrame.CMNumTxt = frame.ManaNumTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.ManaNumTxtFrame.MMNumTxt = frame.ManaNumTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.InfoTextFrame.LvlClassText = frame.InfoTextFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.offDeadGhostTxtFrame.DeadOfflineTxt = frame.offDeadGhostTxtFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") frame.targetOfFrame.targetOfText = frame.targetOfFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall") -- event frames frame.GUIHealthEvents = CreateFrame("Frame", nil, frame) frame.GUIManaEvents = CreateFrame("Frame", nil, frame) frame.GUINameTextEvents = CreateFrame("Frame", nil, frame) frame.GUILvlClassTextEvents = CreateFrame("frame", nil, frame) frame.GUIPartyLeaderEvent = CreateFrame("Frame", nil, frame) frame.GUIpvpIconEvent = CreateFrame("Frame", nil, frame) frame.GUIOffLineDeadEvents = CreateFrame("Frame", nil, frame) end --############################################### --## Event Frames for current Party Styles ## --############################################### local function RegisterEvents(frame, ...) local Register = frame.RegisterEvent for index = 1, select('#', ...) do Register(frame, select(index, ...)) end end local function OnHide(self) local Unregister = self.UnregisterAllEvents Unregister(self.GUIHealthEvents) Unregister(self.GUINameTextEvents) Unregister(self.GUILvlClassTextEvents) Unregister(self.GUIPartyLeaderEvent) Unregister(self.GUIpvpIconEvent) Unregister(self.GUIManaEvents) Unregister(self.GUIOffLineDeadEvents) end local function OnShow(self) RegisterEvents(self.GUIHealthEvents, 'PLAYER_ENTERING_WORLD', 'UNIT_HEALTH', 'UNIT_LEVEL', 'UNIT_AURA', 'UNIT_MAXHEALTH', 'PARTY_MEMBERS_CHANGED') RegisterEvents(self.GUINameTextEvents, 'PLAYER_ENTERING_WORLD', 'PARTY_MEMBERS_CHANGED', 'UNIT_NAME_UPDATE', 'UNIT_FLAGS', 'UNIT_THREAT_LIST_UPDATE', 'UNIT_THREAT_SITUATION_UPDATE', 'UNIT_COMBAT') RegisterEvents(self.GUILvlClassTextEvents, 'PLAYER_ENTERING_WORLD', 'PARTY_MEMBERS_CHANGED', 'UNIT_LEVEL') RegisterEvents(self.GUIPartyLeaderEvent, 'PLAYER_ENTERING_WORLD', 'PARTY_LEADER_CHANGED', 'PARTY_MEMBERS_CHANGED', 'ZONE_CHANGED_NEW_AREA') RegisterEvents(self.GUIpvpIconEvent, 'PLAYER_ENTERING_WORLD', 'UNIT_FACTION', 'PARTY_MEMBERS_CHANGED', 'UNIT_DYNAMIC_FLAGS') RegisterEvents(self.GUIManaEvents, 'PLAYER_ENTERING_WORLD', 'PARTY_MEMBERS_CHANGED', 'UNIT_HEALTH', 'UNIT_LEVEL', 'UNIT_MANA', 'UNIT_AURA','UNIT_DISPLAYPOWER', 'UNIT_ENERGY', 'UNIT_MAXENERGY', 'UNIT_MAXMANA', 'UNIT_MAXRUNICPOWER', 'UNIT_RUNIC_POWER', 'UNIT_RAGE') RegisterEvents(self.GUIOffLineDeadEvents, 'PLAYER_ENTERING_WORLD', 'PARTY_MEMBERS_CHANGED', 'PARTY_MEMBER_DISABLE', 'PARTY_MEMBER_ENABLE', 'UNIT_HEALTH') end local function OnShowTarget(self) RegisterEvents(self, 'PLAYER_ENTERING_WORLD', 'PARTY_MEMBERS_CHANGED', 'PARTY_LEADER_CHANGED', 'PLAYER_TARGET_CHANGED', 'UNIT_TARGET') end for id = 1, 4 do local frame = _G["GrimUIPartyFrame" .. id] frame:SetScript('OnHide', OnHide) frame:SetScript('OnShow', OnShow) frame.targetOf:SetScript('OnHide', frame.UnregisterAllEvents) frame.targetOf:SetScript('OnShow', OnShowTarget) end --################################-- DO NOT MESS WITH THIS ITS CRITICAL TO THE MOVEFRAMES.LUA -- PartyLayoutInitiate Function -- --################################-- local function loadDefaultPosition(id, ...) local frame = _G["GrimUIPartyFrame" .. id] for index = 1, select('#', ...) do frame[index] = select(index, ...) end end loadDefaultPosition(1, "LEFT", GrimUIcoreArtB1, "TOPRIGHT", -81, -22) loadDefaultPosition(2, "BOTTOMLEFT", GrimUIPartyFrame1, "BOTTOMRIGHT", -1, 0) loadDefaultPosition(3, "RIGHT", GrimUIcoreArtB4, "TOPLEFT", -139, -22) loadDefaultPosition(4, "BOTTOMLEFT", GrimUIPartyFrame3, "BOTTOMRIGHT", -1, 0) -- If these values are invalid then they should be purged, not allowed to persist: -- all: points[1] == "nil" -- party1: points[1] == "LEFT" and points[2] == "UIParent" and points[3] == "TOPRIGHT" then -- party2: points[1] == "BOTTOMLEFT" and points[2] == "UIParent" and points[3] == "BOTTOMRIGHT" then -- party3: points[1] == "RIGHT" and points[2] == "UIParent" and points[3] == "TOPLEFT" then -- party4: points[1] == "BOTTOMLEFT" and points[2] == "UIParent" and points[3] == "BOTTOMRIGHT" then function GrimUI.PartyLayoutInitiate() for id = 1, 4 do local name = "GrimUIPartyFrame" .. id local frame = _G[name] local points = not GrimLayout.disabled --[[and not GrimLayout.nosave]] and GrimLayout[name] frame:ClearAllPoints() if type(points) ~= 'table' or not pcall(frame.SetPoints, frame, unpack(points)) then frame:SetPoints(unpack(frame)) end end end local function PFClearAllPoints(id) local frame = _G["GrimUIPartyFrame" .. id] -- frames frame.PedestalFrame:ClearAllPoints() frame.HealthBorder:ClearAllPoints() frame.HealthBar:ClearAllPoints() frame.ManaBorder:ClearAllPoints() frame.ManaBar:ClearAllPoints() frame.InfoTextFrame:ClearAllPoints() frame.LetterFrame:ClearAllPoints() frame.HealthNumTxtFrame:ClearAllPoints() frame.ManaNumTxtFrame:ClearAllPoints() frame.LeaderFrame:ClearAllPoints() frame.pvpIconFrame:ClearAllPoints() frame.offDeadGhostTxtFrame:ClearAllPoints() frame.targetOfFrame:ClearAllPoints() -- Textblocks frame.HealthBorder.percentHText:ClearAllPoints() frame.ManaBorder.percentMText:ClearAllPoints() frame.InfoTextFrame.NameText:ClearAllPoints() frame.LetterFrame.LetterHText:ClearAllPoints() frame.LetterFrame.LetterMText:ClearAllPoints() frame.HealthNumTxtFrame.chnumtxt:ClearAllPoints() frame.HealthNumTxtFrame.mhnumtxt:ClearAllPoints() frame.ManaNumTxtFrame.CMNumTxt:ClearAllPoints() frame.ManaNumTxtFrame.MMNumTxt:ClearAllPoints() frame.InfoTextFrame.LvlClassText:ClearAllPoints() frame.offDeadGhostTxtFrame.DeadOfflineTxt:ClearAllPoints() frame.targetOfFrame.targetOfText:ClearAllPoints() -- Textures frame.targetOfFrame.texture:ClearAllPoints() end ------------------------- -- Grim Layout Style 1 -- ------------------------- function GrimUI.GrimStyle1(id) local frame = _G["GrimUIPartyFrame" .. id] -- ClearAllPoints for all frames in this style. PFClearAllPoints(id) -- Main frame set height/width frame:SetWidth(223) frame:SetHeight(135) -- Pedestal frame.PedestalFrame:SetPoint("BOTTOM", frame, "BOTTOM", -62, 0) frame.PedestalFrame:SetHeight(15) frame.PedestalFrame:SetWidth(49) frame.PedestalFrame.texture:SetTexture("Interface\\AddOns\\!GrimUI\\Art\\pedestal.tga") frame.PedestalFrame:SetFrameStrata("LOW") frame.PedestalFrame:SetFrameLevel("2") -- Hhealth bar frame.HealthBorder:SetHeight(100) frame.HealthBorder:SetWidth(31) frame.HealthBorder:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 0, 0) frame.HealthBorder:SetBackdrop{ bgFile = nil, edgeFile = "Interface/DialogFrame/UI-DialogBox-Border", tile = false, tileSize = 0, edgeSize = 5, insets = { left = 0, right = 0, top = 0, bottom = 0 } } frame.HealthBorder:SetBackdropBorderColor(0, 0, 0, 1) frame.HealthBorder:SetFrameStrata("HIGH") frame.HealthBorder:SetFrameLevel("2") frame.HealthBar:SetWidth(29) frame.HealthBar:SetHeight(98) frame.HealthBar:SetPoint("CENTER", frame.HealthBorder, "CENTER", 0, 0) frame.HealthBar:SetStatusBarTexture("Interface\\AddOns\\!GrimUI\\Art\\VBarTexture.tga") frame.HealthBar:SetStatusBarColor(.231, .682, .419, 1) frame.HealthBar:SetOrientation("VERTICAL") frame.HealthBar:SetFrameStrata("BACKGROUND") frame.HealthBar:SetFrameLevel("2") frame.HealthBorder.percentHText:SetPoint("TOP", frame.HealthBorder, "TOP", 0, -1) frame.HealthBorder.percentHText:SetTextColor(1, 1, 1, 1) frame.HealthBorder.percentHText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 10, "NORMAL") -- Mana bar frame.ManaBorder:SetHeight(100) frame.ManaBorder:SetWidth(31) frame.ManaBorder:SetPoint("BOTTOM", frame, "BOTTOM", -29, 0) frame.ManaBorder:SetBackdrop{ bgFile = nil, edgeFile = "Interface/DialogFrame/UI-DialogBox-Border", tile = false, tileSize = 0, edgeSize = 5, insets = { left = 0, right = 0, top = 0, bottom = 0 } } frame.ManaBorder:SetBackdropBorderColor(0, 0, 0, 1) frame.ManaBorder:SetFrameStrata("HIGH") frame.ManaBorder:SetFrameLevel("2") frame.ManaBar:SetWidth(29) frame.ManaBar:SetHeight(98) frame.ManaBar:SetPoint("CENTER", frame.ManaBorder, "CENTER", 0, 0) frame.ManaBar:SetStatusBarTexture("Interface\\AddOns\\!GrimUI\\Art\\VBarTexture.tga") frame.ManaBar:SetOrientation("VERTICAL") frame.ManaBar:SetFrameStrata("BACKGROUND") frame.ManaBar:SetFrameLevel("2") frame.ManaBorder.percentMText:SetPoint("TOP", frame.ManaBorder, "TOP", 0, -1) frame.ManaBorder.percentMText:SetTextColor(1, 1, 1, 1) frame.ManaBorder.percentMText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 10, "NORMAL") -- TextInfo frame.InfoTextFrame:SetPoint("RIGHT", frame, "RIGHT", 0, -7) frame.InfoTextFrame:SetWidth(125) frame.InfoTextFrame:SetHeight(79) frame.InfoTextFrame:SetFrameStrata("HIGH") frame.InfoTextFrame:SetFrameLevel("5") -- Name text frame.InfoTextFrame.NameText:SetPoint("TOPLEFT", frame.InfoTextFrame, "TOPLEFT", -1, 0) frame.InfoTextFrame.NameText:SetPoint("RIGHT", frame.InfoTextFrame, "RIGHT", 0, 0) frame.InfoTextFrame.NameText:SetJustifyH("LEFT") frame.InfoTextFrame.NameText:SetTextColor(1, 1, 1, 1) frame.InfoTextFrame.NameText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font3.ttf", 17, "OUTLINE") frame.LetterFrame:SetPoint("LEFT", frame.InfoTextFrame, "LEFT", 0, -20) frame.LetterFrame:SetWidth(1) frame.LetterFrame:SetHeight(1) frame.LetterFrame.LetterHText:SetPoint("LEFT", frame.LetterFrame, "LEFT", 2, 0) frame.LetterFrame.LetterHText:SetTextColor(0.937, 1, 0.345, 1) frame.LetterFrame.LetterHText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") frame.LetterFrame.LetterMText:SetPoint("LEFT", frame.LetterFrame, "LEFT", 60, 0) frame.LetterFrame.LetterMText:SetTextColor(0.937, 1, 0.345, 1) frame.LetterFrame.LetterMText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") frame.LetterFrame.LetterHText:SetText("H:") frame.LetterFrame.LetterMText:SetText("M:") frame.LetterFrame.LetterHText:Show() frame.LetterFrame.LetterMText:Show() -- health numbered text start frame.HealthNumTxtFrame:SetPoint("LEFT", frame.InfoTextFrame, "LEFT", 0, -16) frame.HealthNumTxtFrame:SetWidth(1) frame.HealthNumTxtFrame:SetHeight(1) frame.HealthNumTxtFrame.chnumtxt:SetPoint("LEFT", frame.HealthNumTxtFrame , "LEFT", 16, 0) frame.HealthNumTxtFrame.chnumtxt:SetTextColor(1, 1, 1, 1) frame.HealthNumTxtFrame.chnumtxt:SetJustifyH("RIGHT") frame.HealthNumTxtFrame.chnumtxt:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") frame.HealthNumTxtFrame.mhnumtxt:Show() frame.HealthNumTxtFrame.mhnumtxt:SetPoint("TOP", frame.chnumtxtFrame , "BOTTOM", 0, 0) frame.HealthNumTxtFrame.mhnumtxt:SetTextColor(1, 1, 1, 1) frame.HealthNumTxtFrame.mhnumtxt:SetJustifyH("RIGHT") frame.HealthNumTxtFrame.mhnumtxt:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") -- Mana numbered text start frame.ManaNumTxtFrame:SetPoint("RIGHT", frame.InfoTextFrame, "RIGHT", -8, -16) frame.ManaNumTxtFrame:SetWidth(1) frame.ManaNumTxtFrame:SetHeight(1) frame.ManaNumTxtFrame.CMNumTxt:SetPoint("RIGHT", frame.ManaNumTxtFrame, "RIGHT", 0, 0) frame.ManaNumTxtFrame.CMNumTxt:SetTextColor(1, 1, 1, 1) frame.ManaNumTxtFrame.CMNumTxt:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") frame.ManaNumTxtFrame.MMNumTxt:Show() frame.ManaNumTxtFrame.MMNumTxt:SetPoint("TOP", frame.CMNumTxtFrame, "BOTTOM", 0, 0) frame.ManaNumTxtFrame.MMNumTxt:SetTextColor(1, 1, 1, 1) frame.ManaNumTxtFrame.MMNumTxt:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") frame.InfoTextFrame.LvlClassText:SetPoint("TOP", frame.InfoTextFrame, "TOP", 0, -34) frame.InfoTextFrame.LvlClassText:SetPoint("LEFT", frame.InfoTextFrame, "LEFT", 2, 0) frame.InfoTextFrame.LvlClassText:SetPoint("RIGHT", frame.InfoTextFrame, "RIGHT", 0, 0) frame.InfoTextFrame.LvlClassText:SetJustifyH("LEFT") frame.InfoTextFrame.LvlClassText:SetTextColor(0.937, 1, 0.345, 1) frame.InfoTextFrame.LvlClassText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") -- Leader icon frame.LeaderFrame:SetPoint("TOPLEFT", frame.InfoTextFrame, "TOPLEFT", 3, -17) frame.LeaderFrame:SetHeight(20) frame.LeaderFrame:SetWidth(20) frame.LeaderFrame.texture:SetTexture("Interface\\GroupFrame\\UI-Group-LeaderIcon.blp") frame.LeaderFrame:Hide() -- PVP icon frame.pvpIconFrame:SetPoint("TOPLEFT", frame.InfoTextFrame, "TOPLEFT", 22, -17) frame.pvpIconFrame:SetHeight(21) frame.pvpIconFrame:SetWidth(21) -- Offline/Dead overlay frame.offDeadGhostTxtFrame:SetPoint("LEFT", frame, "LEFT", 15, 0) frame.offDeadGhostTxtFrame:SetWidth(68) frame.offDeadGhostTxtFrame:SetHeight(15) frame.offDeadGhostTxtFrame.DeadOfflineTxt:SetPoint("CENTER", frame.offDeadGhostTxtFrame , "CENTER", 0, 0) frame.offDeadGhostTxtFrame.DeadOfflineTxt:SetTextColor(.85, .10, .10, 1) frame.offDeadGhostTxtFrame.DeadOfflineTxt:SetJustifyH("CENTER") frame.offDeadGhostTxtFrame.DeadOfflineTxt:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 18, "OUTLINE") -- Target of target frame.targetOfFrame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 1) frame.targetOfFrame:SetWidth(122) frame.targetOfFrame:SetHeight(19) frame.targetOfFrame:SetFrameStrata("HIGH") frame.targetOfFrame:SetFrameLevel("5") frame.targetOfFrame.targetOfText:SetPoint("CENTER", frame.targetOfFrame, "CENTER", 0, 2) frame.targetOfFrame.targetOfText:SetPoint("LEFT", frame.targetOfFrame, "LEFT", 0, 1) frame.targetOfFrame.targetOfText:SetPoint("RIGHT", frame.targetOfFrame, "RIGHT", 0, 1) frame.targetOfFrame.targetOfText:SetTextColor(1, 1, 1, 1) frame.targetOfFrame.targetOfText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font3.ttf", 11, "OUTLINE") end ------------------------- -- Grim Layout Style 2 -- ------------------------- function GrimUI.GrimStyle2(id) local frame = _G["GrimUIPartyFrame" .. id] -- ClearAllPoints for all frames in this style. PFClearAllPoints(id) -- Mmain frame set height/width frame:SetWidth(192) frame:SetHeight(135) -- Pedestal Party1PedestalFrame:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 4, 0) Party1PedestalFrame:SetHeight(15) Party1PedestalFrame:SetWidth(49) Party1PedestalFrame.texture:Hide() Party1PedestalFrame.texture:ClearAllPoints() Party1PedestalFrame.texture:Show() Party1PedestalFrame.texture:SetAllPoints(Party1PedestalFrame) Party1PedestalFrame.texture:SetTexture("Interface\\AddOns\\!GrimUI\\Art\\pedestal.tga") Party1PedestalFrame:SetFrameStrata("LOW") Party1PedestalFrame:SetFrameLevel("2") -- party 1 health bar start Party1HealthBorder:SetHeight(28) Party1HealthBorder:SetWidth(140) Party1HealthBorder:SetPoint("BOTTOMRIGHT", GUI_Party1Frame, "BOTTOMRIGHT", 0, 47) Party1HealthBorder:SetBackdrop{ bgFile = nil, edgeFile = "Interface/DialogFrame/UI-DialogBox-Border", tile = false, tileSize = 0, edgeSize = 5, insets = { left = 0, right = 0, top = 0, bottom = 0 } } Party1HealthBorder:SetBackdropBorderColor(0, 0, 0, 1) Party1HealthBorder:SetFrameStrata("BACKGROUND") Party1HealthBorder:SetFrameLevel("2") Party1HealthBar:SetHeight(26) Party1HealthBar:SetWidth(138) Party1HealthBar:SetPoint("CENTER", Party1HealthBorder, "CENTER", 0, 0) Party1HealthBar:SetStatusBarTexture("Interface\\AddOns\\!GrimUI\\Art\\VBarTexture.tga") Party1HealthBar:SetStatusBarColor(.231, .682, .419, 1) Party1HealthBar:SetOrientation("HORIZONTAL") Party1HealthBar:SetFrameStrata("BACKGROUND") Party1HealthBar:SetFrameLevel("2") percentParty1HText:SetPoint("BOTTOMLEFT", Party1HealthBorder, "BOTTOMLEFT", 0, 2) percentParty1HText:SetTextColor(1, 1, 1, 1) percentParty1HText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 10, "NORMAL") -- party 1 mana bar Start Party1ManaBorder:SetHeight(28) Party1ManaBorder:SetWidth(140) Party1ManaBorder:SetPoint("BOTTOMRIGHT", GUI_Party1Frame, "BOTTOMRIGHT", 0, 20) Party1ManaBorder:SetBackdrop{ bgFile = nil, edgeFile = "Interface/DialogFrame/UI-DialogBox-Border", tile = false, tileSize = 0, edgeSize = 5, insets = { left = 0, right = 0, top = 0, bottom = 0 } } Party1ManaBorder:SetBackdropBorderColor(0, 0, 0, 1) Party1ManaBorder:SetFrameStrata("BACKGROUND") Party1ManaBorder:SetFrameLevel("2") Party1ManaBar:SetWidth(138) Party1ManaBar:SetHeight(26) Party1ManaBar:SetPoint("CENTER", Party1ManaBorder, "CENTER", 0, 0) Party1ManaBar:SetStatusBarTexture("Interface\\AddOns\\!GrimUI\\Art\\VBarTexture.tga") Party1ManaBar:SetOrientation("HORIZONTAL") Party1ManaBar:SetFrameStrata("BACKGROUND") Party1ManaBar:SetFrameLevel("2") percentParty1MText:SetPoint("BOTTOMLEFT", Party1ManaBorder, "BOTTOMLEFT", 0, 2) percentParty1MText:SetTextColor(1, 1, 1, 1) percentParty1MText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 10, "NORMAL") -- Party 1 Mana bar end -- Party 1 TextInfo Frame Start Party1InfoTextFrame:SetPoint("BOTTOMRIGHT", GUI_Party1Frame, "BOTTOMRIGHT", 0, 75) Party1InfoTextFrame:SetWidth(140) Party1InfoTextFrame:SetHeight(26) Party1InfoTextFrame:SetFrameStrata("HIGH") Party1InfoTextFrame:SetFrameLevel("5") -- party 1 name text Frame Start Party1NameText:SetPoint("TOPLEFT", Party1InfoTextFrame, "TOPLEFT", -1, 9) Party1NameText:SetPoint("TOPRIGHT", Party1InfoTextFrame, "TOPRIGHT", 0, 9) Party1NameText:SetJustifyH("LEFT") Party1NameText:SetTextColor(1, 1, 1, 1) Party1NameText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font3.ttf", 17, "OUTLINE") -- health numbered text start Party1HealthNumTxtFrame:SetPoint("RIGHT", Party1HealthBorder, "RIGHT", 0, 0) Party1HealthNumTxtFrame:SetWidth(1) Party1HealthNumTxtFrame:SetHeight(1) Party1chnumtxtFrame:SetPoint("RIGHT", Party1HealthNumTxtFrame , "RIGHT", 0, 0) Party1chnumtxtFrame:SetTextColor(1, 1, 1, 1) Party1chnumtxtFrame:SetJustifyH("RIGHT") Party1chnumtxtFrame:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") -- Mana numbered text start Party1ManaNumTxtFrame:SetPoint("RIGHT", Party1ManaBorder, "RIGHT", 0, 0) Party1ManaNumTxtFrame:SetWidth(1) Party1ManaNumTxtFrame:SetHeight(1) Party1CMNumTxtFrame:SetPoint("RIGHT", Party1ManaNumTxtFrame, "RIGHT", 0, 0) Party1CMNumTxtFrame:SetTextColor(1, 1, 1, 1) Party1CMNumTxtFrame:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") -- mana numbered text end ------------------------------ Party1LvlClassText:SetPoint("BOTTOM", Party1InfoTextFrame, "BOTTOM", 0, 3) Party1LvlClassText:SetPoint("LEFT", Party1InfoTextFrame, "LEFT", 2, 0) Party1LvlClassText:SetPoint("RIGHT", Party1InfoTextFrame, "RIGHT", 0, 0) Party1LvlClassText:SetJustifyH("LEFT") Party1LvlClassText:SetTextColor(0.937, 1, 0.345, 1) Party1LvlClassText:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 12, "OUTLINE") -- party leader icon Party1LeaderFrame:SetPoint("BOTTOMRIGHT", Party1InfoTextFrame, "BOTTOMRIGHT", 0, 0) Party1LeaderFrame:SetHeight(18) Party1LeaderFrame:SetWidth(18) Party1LeaderFrame.texture = Party1LeaderFrame:CreateTexture() Party1LeaderFrame.texture:SetAllPoints(Party1LeaderFrame) Party1LeaderFrame.texture:SetTexture("Interface\\GroupFrame\\UI-Group-LeaderIcon.blp") Party1LeaderFrame:Hide() -- PVP icon Party1pvpIconFrame:SetPoint("BOTTOMRIGHT", Party1InfoTextFrame, "BOTTOMRIGHT", -18, -2) Party1pvpIconFrame:SetHeight(19) Party1pvpIconFrame:SetWidth(19) Party1pvpIconFrame.texture = Party1pvpIconFrame:CreateTexture() Party1pvpIconFrame.texture:SetAllPoints(Party1pvpIconFrame) -- Offline/Dead overlay Party1offDeadGhostTxtFrame:SetPoint("LEFT", GUI_Party1Frame, "LEFT", 15, 0) Party1offDeadGhostTxtFrame:SetWidth(68) Party1offDeadGhostTxtFrame:SetHeight(15) Party1DeadOfflineTxt:ClearAllPoints() Party1DeadOfflineTxt:SetPoint("CENTER", Party1offDeadGhostTxtFrame , "CENTER", 0, 0) Party1DeadOfflineTxt:SetTextColor(.85, .10, .10, 1) Party1DeadOfflineTxt:SetJustifyH("CENTER") Party1DeadOfflineTxt:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font1.ttf", 18, "OUTLINE") --Target targettarget Frame START targetOfParty1Frame:SetWidth(140) targetOfParty1Frame:SetHeight(19) targetOfParty1Frame:SetPoint("BOTTOMRIGHT", GUI_Party1Frame, "BOTTOMRIGHT", 0, 1) Party1ttbg:SetAllPoints(targetOfParty1Frame) targetOfParty1Text:SetPoint("CENTER", targetOfParty1Frame, "CENTER", 0, 0) targetOfParty1Text:SetPoint("LEFT", targetOfParty1Frame, "LEFT", 0, 1) targetOfParty1Text:SetPoint("RIGHT", targetOfParty1Frame, "RIGHT", 0, 1) targetOfParty1Text:SetTextColor(1, 1, 1, 1) targetOfParty1Text:SetFont("Interface\\AddOns\\!GrimUI\\Fonts\\GrimUI_Font3.ttf", 11, "OUTLINE") targetOfParty1Frame:SetScript("OnEvent", function(self) GrimUI.Party1Style2TargEventFunc() end) -- after thoughts Party1LetterMText:Hide() Party1LetterHText:Hide() Party1MMNumTxt:Hide() Party1mhnumtxt:Hide() end ----------------------- -- OnEvent Functions -- ----------------------- local function PartyNameTextEvents(self, event, unit) if event:match('^UNIT_') and self.unit ~= unit then return end local name = UnitName(self.unit) if name then self = self.infoTextFrame.NameText self.infoTextFrame.NameText:SetText(name) if UnitThreatSituation(self.unit) or UnitAffectingCombat(self.unit) then self.infoTextFrame.NameText:SetTextColor(1, 0, 0, 1) else self.infoTextFrame.NameText:SetTextColor(1, 1, 1, 1) end end end local function PartyLvlClassTextEvents(self, event, unit) if event:match('^UNIT_') and self.unit ~= unit then return end local class = UnitClass(self.unit) if class then self.InfoTextFrame.LvlClassText:SetFormattedText("%s %s", UnitLevel(self.unit), class) else self.InfoTextFrame.LvlClassText:SetText("") end end local function PartyPartyLeaderEvent(self) if UnitIsPartyLeader(self.unit) then self.LeaderFrame:Show() else self.LeaderFrame:Hide() end end local function PartypvpIconEvent(self, event, unit) if event:match('^UNIT_') and self.unit ~= unit then return end if UnitIsPVP(self.unit) then self.pvpIconFrame:Show() else self.pvpIconFrame:Hide() end end local function PartyHealthEventFunc(self, event, unit) if event:match('^UNIT_') and self.unit ~= unit then return end local curHealth, maxHealth = UnitHealth(self.unit), UnitHealthMax(self.unit) if curHealth and maxHealth and UnitIsConnected(self.unit) then self.HealthBorder.percentHText:SetFormattedText("%s%%", floor(curHealth / maxHealth * 100)) self.HealthBar:SetMinMaxValues(min(0, curHealth), maxHealth)) self.HealthBar:SetValue(curHealth) if GrimUIData.GUIPartyStyle == 2 then self.HealthNumTxtFrame.chnumtxt:SetFormattedText("%s/%s", curHealth, maxHealth) else self.HealthNumTxtFrame.chnumtxt:SetText(curHealth) self.HealthNumTxtFrame.mhnumtxt:SetText(maxHealth) end else self.HealthBorder.percentHText:SetText("0%") end end local function PartyManaEventFunc(self, event, unit) if event:match('^UNIT_') and self.unit ~= unit then return end local powerType, curPower, maxPower = UnitPowerType(self.unit) if powerType == 0 then curPower, maxPower = UnitMana(self.unit), UnitMaxMana(self.unit) self.ManaBar:SetMinMaxValues(min(0, curPower), maxPower) self.ManaBar:SetValue(curPower) self.ManaBar:SetStatusBarColor(0.556, 0.556, 0.921, 1) elseif powerType == 1 or powerType == 3 or powerType == 6 then curPower, maxPower = UnitPower(self.unit), UnitPowerMax(self.unit) self.ManaBar:SetMinMaxValues(min(0, curPower), maxPower) self.ManaBar:SetValue(curPower) self.ManaBar:SetStatusBarColor(0.656, 0.456, 0.456, 1) else return end if maxPower > 0 then self.ManaBorder.percentMText:SetFormattedText("%s%%", floor(curPower / maxPower * 100)) else self.ManaBorder.percentMText:SetText("0%") end if GrimUIData.GUIPartyStyle == 2 then self.ManaNumTxtFrame.CMNumTxt:SetFormattedText("%s/%s", curPower, maxPower) else self.ManaNumTxtFrame.CMNumTxt:SetText(curPower) self.ManaNumTxtFrame.MMNumTxt:SetText(maxPower) end end local function PartyDeadOffLineEvents(self, event, unit) if event:match('^UNIT_') and self.unit ~= unit then return end if not UnitIsConnected(self.unit) then if UnitIsGhost(self.unit) then self.DeadOfflineTxt:SetText("Ghost\n Offline") elseif UnitIsDead(self.unit) then self.DeadOfflineTxt:SetText("Dead\n Offline") else self.DeadOfflineTxt:SetText("Offline") end elseif UnitIsGhost(self.unit) then self.DeadOfflineTxt:SetText("Ghost") elseif UnitIsDead(self.unit) then self.DeadOfflineTxt:SetText("Dead") else self.DeadOfflineTxt:SetText("") end end local function PartyTargEventFunc(self, event, unit) if event:match('^UNIT_') and self.unit ~= unit then return end if UnitExists(self.unit) then if UnitIsUnit(self.unit, 'player') then self.targetOfText:SetText("** YOU **") elseif UnitIsUnit(self.unittarget, 'target') then self.targetOfText:SetText("** YOUR TARGET **") else self.targetOfText:SetText(UnitName(self.unit)) end if UnitIsFriend(self.unit, 'player') then self.texture:SetTexture(0.10, 0.40, 0.10, 1) else self.texture:SetTexture(0.40, 0.10, 0.10, 1) end else self.targetOfText:SetText("-No Target-") self.texture:SetTexture(0, 0, 0, 0) end end --################### -- Party Event Scripts --################### for id = 1, 4 do local frame = _G['GrimUIPartyFrame' .. id] frame.GUIHealthEvents:SetScript("OnEvent", HealthEventFunc) frame.GUIManaEvents:SetScript("OnEvent", ManaEventFunc) frame.GUINameTextEvents:SetScript("OnEvent", PartyNameTextEvents) frame.GUILvlClassTextEvents:SetScript("OnEvent", LvlClassTextEvents) frame.GUIpvpIconEvent:SetScript("OnEvent", pvpIconEvent) frame.GUIPartyLeaderEvent:SetScript("OnEvent", PartyLeaderEvent) frame.GUIOffLineDeadEvents:SetScript("OnEvent", DeadOffLineEvents) frame.targetOfFrame:SetScript("OnEvent", PartyTargEventFunc) end ------------------------ -- Update Party Frame Style select function ------------------------- function GrimUI.UpdatePartyStyle() if GrimUIData.GUIPartyStyle == 2 then for id = 1, 4 do GrimUI.GrimStyle2(id) end else -- Default to 1 for id = 1, 4 do GrimUI.GrimStyle1(id) end end end ----------------------------------------------------- -- One time init and then monitor for cvar changes -- ----------------------------------------------------- local monitor = CreateFrame('Frame') monitor:SetScript('OnEvent', function(self, event) local pvpTexture = "Interface\\GroupFrame\\UI-Group-PVP-" .. UnitFactionGroup('player') for id = 1, 4 do _G["GrimUIPartyFrame" .. id].pvpIconFrame.texture:SetTexture(pvpTexture) end -- GrimUI.PartyHideShowFunc() GrimUI.BPartyHideShowFunc() GrimUI.UpdatePartyStyle() GrimUI.PartyLayoutInitiate() self:SetScript('OnEvent', function(self, event, cvar, value) if event == 'CVAR_UPDATE' then if cvar ~= "hidePartyInRaid" then return end if value == "1" then RegisterStateDriver(GrimPartyMain, 'group', "[group:raid] Hide; [group:party] Show; Hide") else RegisterStateDriver(GrimPartyMain, 'group', "[group] Show; Hide") end else local inInstance, instanceType = IsInInstance() if inInstance and instanceType == "arena" and GrimUIData.GUIPartyFrame == "show" then RegisterStateDriver(GrimPartyMain, 'group', "Show") elseif GetCVarBool('hidePartyInRaid') then RegisterStateDriver(GrimPartyMain, 'group', "[group:raid] Hide; [group:party] Show; Hide") else RegisterStateDriver(GrimPartyMain, 'group', "[group] Show; Hide") end end end) self:RegisterEvent('CVAR_UPDATE') end) monitor:SetScript('PLAYER_ENTERING_WORLD') -- Clique inclusion start --ClickCastFrames = ClickCastFrames or {} --ClickCastFrames[healthborder] = true --ClickCastFrames[GrimPlayerManaborder] = true --ClickCastFrames[playerModelClickFrame] = true -- Clique inclusion end Last edited by Vrul : 06-16-10 at 05:52 AM. Reason: Cut-and-paste is too hard! |
|
06-16-10, 07:32 AM | #27 |
hmmm the only hide/show function i did was actually in the options file and it was so that people could force hide the party frames if they did not want to use the GrimUI partyframes at all. and of course a function that will force hide/show the bliz party frames to. its supposed to allow the user to chose either GrimUI party frames, bliz party frames or something else entirely. the function in the options.lua looks like this.
lua Code:
clearly i was already having problems with it which is why there is comment out sectins. anyway to restore that option? oh yea about to test stuff, i dont fully understand what you did to the move frames section but it will be interesting if this works. okay looked over everything and yea my options.lua is borked good now lol. also i fixed a few errors but one im not sure about its erroring on this piece of code and ive never seen an event set as a setscript, not sure what should be there? or if that is right and the error is in the script itself? monitor:SetScript('PLAYER_ENTERING_WORLD') monitor has a setscript is that just out of place? i commented it out and loaded bug free but its clear that the PLAYER_ENTERING_WORLD scripts are not running IE the bliz party frames do not do there show/hide check and when i invite someone to group the frames never appear but also no bugs either.... the bliz party frames just has to do with that monitor section and it not being called on PLAYER_ENTERING_WORLD Last edited by Grimsin : 06-16-10 at 07:54 AM. |
|
06-16-10, 07:59 AM | #28 |
here is the option part that is a problem, i know that when its borked it can bork the whole partyframes.lua even if there are no errors in the partyframes.lua... or at lest it did before...
lua Code:
and should this be setpoints? or setpoint? frame:SetPoints(unpack(frame)) im getting an error there. edit -- yes its supposed to be setpoint and not setpoints.... soon as i changed that no more positioning problems and my options panel is working again, two problems still all having to do with events and setscripts. So nothing is registering on player_entering_world? maybe that monitor:setScript"player_entering_world" part i commented out? also no events are registering still although maybe thats because of the monitor part? Last edited by Grimsin : 06-16-10 at 08:04 AM. |
|
06-16-10, 08:12 AM | #29 |
the frame movement is all borked to... the frame mover code looks like this... this is why those sections for initiate were critical they were designed to work in conjunction with this file...
lua Code:
this is based on the original MoveAnything code not any of the new ones... and i take that back the frame movement only appears to cause errors when you try to select layouts otherwise when i get the frame to show it is moveable... lol. i added a registerevent to the monitor part for player entering world its now checking those things properly again at lest. although you put the pvp icon in the monitor script? so the pvp icon is always up now lol... Last edited by Grimsin : 06-16-10 at 08:32 AM. |
|
06-16-10, 08:39 AM | #30 |
i take it back... the frame positions are not saving it loads to default position everytime you reload....
back to what Vrul said about the handlers, events and mainframe. So im guessing this is why the events are not working? Last edited by Grimsin : 06-16-10 at 09:04 AM. |
|
06-16-10, 09:07 AM | #31 |
-- If these values are invalid then they should be purged, not allowed to persist:
-- all: points[1] == "nil" -- party1: points[1] == "LEFT" and points[2] == "UIParent" and points[3] == "TOPRIGHT" then -- party2: points[1] == "BOTTOMLEFT" and points[2] == "UIParent" and points[3] == "BOTTOMRIGHT" then -- party3: points[1] == "RIGHT" and points[2] == "UIParent" and points[3] == "TOPLEFT" then -- party4: points[1] == "BOTTOMLEFT" and points[2] == "UIParent" and points[3] == "BOTTOMRIGHT" then they are only invalid at certain moments like if you do a /GUI framereset then do /reload it would fire a onhide whitch would save invalid positions because it would read the original setpoints but it would only do this until you moved the frame with the frame mover the moment you mouseup from moving it saves new points and valid positions then recalls those each time... i think this is partly why its not saving position now. take that back it was if you do a /framereset or do a /reload with a framereset and then atempt to hide show the frames with the hideshow option in the bliz panel. of course thats borked but... somethings still off with the position saving. another edit-- okay so on the events... i think i understand what your saying i created x# of frames each to handle events of a certain type and those frames are not hooked to the partyframes as they should be, the events should actually be registered to the frame upon which the events script will affect? so best way maybe is to register them all to GrimUIPartyFramex then mash the event scripts into one and then do if event statements for every event? wait wait... thinking about it originally i had made global event frames and had their setscript run the event functions and they were not even parented to the grimuipartyframes at all and they worked ok. not efficient im sure but... so umm im still confused? it looks like it should work in theory. movement edit -- okay it looks like it is still saving the position correctly and when someone joins the party it loads to the saved position spot but when ever i /reload it resets the position. any idea why? it has to do with the change to layoutinitiate... im still studying that chunk trying to figure out what you did with it. awesome its not 4 hudge functions now but lol its not working as intended anymore, granted im sure messing with that chunk of code was difficult without knowing what the moveframes.lua looks like. also just noticed something with the dropdowns... im gonna have to look closely at the code you made for it but the way those were designed orignally there are 4 dropdown points, the targetframe whitch drops down the targets dropdown, then the infotextframe is one, the mana and health bars are two dif ones to. Why? its done this way so that when i do the clique inclusions each one of those things can then be turned into a different clique button, that way you can have your infotext frame do party targeting and dropdown menu as normal then set the health and mana bars to be two different clickcasts. hooking it to the main player frame makes the menu all over the place because that frame is oversized in comparison to everything in it to provide grab space above the name for the frame movement functions. i know... its a big tangled mess lol. Last edited by Grimsin : 06-16-10 at 10:20 AM. |
|
06-16-10, 10:36 AM | #32 |
All 4 files involved with this maybe itll alliviate some confusion if it can all be seen... noticed Vrul that you made a new function for the registerevents? didnt dbl check if it matched the one in the core ornot but... this way it all can be seen.
GrimUICore.lua -- http://www.pastey.net/137744 -- this is the very first file in my UI to load. Loads variable defaults, sets up a few tables and loads addon wide util functions. PartyFrames.lua -- http://www.pastey.net/137745 -- obviously the party frames. loads after GrimUICore. includes changes i made this morn to what Vrul posted. MoveFrames.lua -- http://www.pastey.net/137747 -- moves a lot of frames including the GrimPlayerFrame and Partyframes. Loads after PartyFrames. GrimUIOptions.lua -- http://www.pastey.net/137748 -- Last file in the whole addon to load controls all of the few options currently available accross all files, primarily involves playerframe and party frame for both GrimUI and Bliz frames. by options i mean options actually in the OptionsPanel. oh btw... the current GrimUI release the partyframes function perfectly except the option to switch styles is not available there... you would have to change the variable in the wtf by hand to make it switch lol. But the frames function as intended minus the raid hide/show part but yea the frame movement functions right. and the file is still a monster lol edit-- so after a lot of testing and reading i have it narrowed down to 3 things wrong i think. the frame movement is not loading its saved position as it should because of the layoutinitiate() function. The events are not registering no completly sure why, and the dropdown menus need to have various parents rather then parented to the grimpartyframe which i may have under control, target drop down is showing the party member drop down rather then target drop to to... 3 problems position loading, events registration and dropdowns. pretty good considering i dont know what im doing and vrul was doing it half blind edit-- oh and yes im well aware that style2 to is borked i have not even begun to fix that part Last edited by Grimsin : 06-16-10 at 11:46 AM. |
|
06-16-10, 11:43 AM | #33 |
No that was a mistake, it should have been monitor:RegisterEvent('PLAYER_ENTERING_WORLD')
|
|
06-16-10, 11:50 AM | #34 |
i know this is just throwing another monkey wrench into the issue but that force hide show function i had... idealy an unregister module function or turn of module option that unloads the whole partyframe module would be best. i dont know if thats possible... and would most likely involve a reload to actually unload it entirely. im sure of that... to get rid of the frames already created before the module is unregistered...
|
|
06-16-10, 11:51 AM | #35 |
yea i figured that out
|
|
06-16-10, 11:52 AM | #36 | |
|
||
06-16-10, 11:54 AM | #37 | |
|
||
06-16-10, 12:07 PM | #38 |
Awsome, thank you so much. Im going to keep studying the changes you made last night. Also going to fix some of my other modules with what ive learned from you and Cargor the last few days about shortening my code now i got a handle on the function(i) and for id = 1, 4 do i can cut back on a lot of repetitive coding.
|
|
WoWInterface » Developer Discussions » Lua/XML Help » breaking it down. |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|