--[[
Name        : AtlasLootFu
Version     : 1.1
Author      : Daviesh (oma_daviesh@hotmail.com)
Website     : http://www.atlasloot.net
Description : Adds AtlasLoot to FuBar.
Dependencies: FuBar, AtlasLoot, (optional) Ace2, (optional) FuBarPlugin-2.0
]]

local tablet = AceLibrary("Tablet-2.0")

AtlasLootFu = AceLibrary("AceAddon-2.0"):new("AceDB-2.0", "FuBarPlugin-2.0");
AtlasLootFu.hasIcon = "Interface\\AddOns\\AtlasLoot\\Images\\AtlasLootMinimap.blp";
AtlasLootFu.defaultPosition = "LEFT";
AtlasLootFu.defaultMinimapPosition = 180;
AtlasLootFu.cannotDetachTooltip = true;

-- Activate menu options to hide icon/text (no point in having the colour option)
AtlasLootFu.hasNoColor = true;
AtlasLootFu:RegisterDB("AtlasLootFuDB");

function AtlasLootFu:OnTooltipUpdate()
	local cat = tablet:AddCategory()
		cat:AddLine(
			"text", ATLASLOOT_MINIMAPBUTTON_LINE1
		)
		cat:AddLine(
			"text", ATLASLOOT_MINIMAPBUTTON_LINE2_ALT
		)
end

function AtlasLootFu:OnClick(button)
	if IsShiftKeyDown() then
        AtlasLootOptions_Toggle();
    else
        AtlasLootDefaultFrame:Show();
    end
end
