(EDIT:I have fixed the issue, but gonna leave it here anyway)
this is something incredibly stupid i am sure, but i am having trouble show/hiding my icon.
I have it registered like this in my OnInitialize
Code:
if not icon:IsRegistered("RollCrafterCombatFeed") then
print("hit");
RC_MISC.Icon = {};
local rccf = ldb:GetDataObjectByName("RollCrafterCombatFeed");
icon:Register("RollCrafterCombatFeed", rccf, RC_MISC.Icon);
if RC_MISC["MMI"] == 1 then
icon:Hide("RollCrafterCombatFeed");
else
icon:Show("RollCrafterCombatFeed");
end
end
now my icon is there is just not responding to show/hide commands, even if i do it manually with wow lua
I guess i will include my choppy broker code (Note i refer to all my code negatively, bad habit) just incase the problem lies there
Code:
local combatFeed = ldb:NewDataObject("RollCrafterCombatFeed", {
type = "launcher",--"data source",
icon = "Interface\\Icons\\INV_Misc_Dice_01",
text = "RollCraft",
value = "",
label = "Sheet:",
--[[OnClick = function(clickedframe, button)
if button == "RightButton" then
local Welmenu = GHM_NewFrame(RC_WelMenu)
Welmenu.ClearAll()
Welmenu:Show();
else
core:ABHS();
end]]
--end,
}
)
function RC_setFeed()
if RC_Plrydata["CurrentSheet"] ~= nil then
combatFeed.vlaue = tostring(RC_Plrydata["CurrentSheet"]);
else
combatFeed.value = "No Sheet";
end
end
sheetcount = 0;
local function RCHandlerFunc(cell, arg, event)
local text = arg;
if sheetcount <= 1 or RC_Plrydata["CurrentSheet"] == text then
D(L["sheetselerr"])
return;
end
core:UpdateCS(text);
RC_setFeed()
end
function hideTooltip()
if MouseIsOver(tooltip) then return end
tooltip:SetScript("OnLeave", nil)
tooltip:Hide()
QTC:Release(tooltip)
tooltip = nil
end
function combatFeed:OnClick(button)
if button == "RightButton" then
if IsAltKeyDown() then
ABHS();
else
--makeTooltip();
tooltip = QTC:Acquire("cfTip", 5,"CENTER")
tooltip:Clear()
tooltip:SmartAnchorTo(self)
tooltip:SetScript("OnLeave", hideTooltip)
tooltip:Hide()
tooltip:Show()
tooltip:SetCallback("OnMouseDown", RCHandlerFunc)
for k,v in pairs(RC_Classdata) do
local y, x = tooltip:AddLine()
y, x = tooltip:SetCell(y, x, k, function() return k end, "CENTER")
sheetcount = sheetcount +1;
--print(sheetcount);
end
end
else
if IsAltKeyDown() then
local Optmenu = GHM_NewFrame(RC_OptMenu)
Optmenu.ClearAll()
Optmenu.ForceLabel("bar_scale",RC_MISC["abScale"]);
--Optmenu.ForceLabel("rattk",RC_MISC["emAttk"]);
Optmenu.ForceLabel("MMI",RC_MISC["MMI"]);
Optmenu.ForceLabel("pbroad",RC_MISC["pBcast"]);
Optmenu.ForceLabel("abvert",RC_MISC["vert"]);
Optmenu:Show();
else
local Welmenu = GHM_NewFrame(RC_WelMenu)
Welmenu.ClearAll()
Welmenu:Show();
end
end
end
local LQT = LibStub('LibQTip-1.0');
function combatFeed.OnEnter(self)
local csheet
if RC_Plrydata["CurrentSheet"] ~= nil then
csheet = RC_Plrydata["CurrentSheet"];
else
csheet = "No Sheet";
end
local tip = LQT:Acquire("ABTIP", 3, "LEFT")
self.tip = tip
tip:SetScript("OnLeave", nil)
tip:AddHeader("|cFF0000FFRollCraft|r")
tip:AddLine("|cFF00FF00"..L["Your Current Sheet is:"].."|cFFFFFF00"..csheet.."|r")
tip:AddLine("Left Click for options")
tip:AddLine("Right Click for Class Select")
tip:AddLine("Alt-Right Click to show hide skill bar")
tip:AddLine("Alt-Left Click for config")
tip:SmartAnchorTo(self)
tip:Show()
end
function combatFeed.OnLeave(self)
self.tip:Hide();
LQT:Release(self.tip)
self.tip = nil
end