diff --git a/MBB.lua b/MBB.lua
index 46c1be3..44e5f80 100644
--- a/MBB.lua
+++ b/MBB.lua
@@ -1,813 +1,812 @@
-MBB_Version = GetAddOnMetadata("MinimapButtonBag", "Version");
-MBB_DebugFlag = 0;
-MBB_DragFlag = 0;
-MBB_ShowTimeout = -1;
-MBB_Buttons = {};
-MBB_Exclude = {};
-MBB_DragPos ={
-["orig"] = {},
-["start"] = {}
-};
-MBB_DefaultOptions = {
- ["ButtonPos"] = {-18, -100},
- ["AttachToMinimap"] = 1,
- ["CollapseTimeout"] = 1,
- ["ExpandDirection"] = 1,
- ["MaxButtonsPerLine"] = 0,
- ["AltExpandDirection"] = 4,
- ["Scale"] = 100,
- ["Version"] = MBB_Version
-};
-
-MBB_Include = {
- [1] = "DPSMate_MiniMap",
-};
-
---McPewPew
-TW_Include = {
-};
-
-isTWoW = 0
-
-if (TWMinimapShopFrame~=nil) then
- TWMinimapShopFrame:ClearAllPoints() TWMinimapShopFrame:SetParent(Minimap) TWMinimapShopFrame:SetPoint("LEFT",Minimap,"RIGHT",-1, -1)
- isTWoW = 1
- table.insert(TW_Include, "Turtle WoW Shop");
-end
-if (TWMiniMapBattlefieldFrame~=nil) then
- TWMiniMapBattlefieldFrame:ClearAllPoints() TWMiniMapBattlefieldFrame:SetParent(Minimap) TWMiniMapBattlefieldFrame:SetPoint("LEFT",Minimap,"RIGHT",-1, -1)
- isTWoW = 1
- table.insert(TW_Include, "Turtle WoW Battleground Finder");
-end
-if (LFT_Minimap~=nil) then
- LFT_Minimap:ClearAllPoints() LFT_Minimap:SetParent(Minimap) LFT_Minimap:SetPoint("LEFT",Minimap,"RIGHT",-1, -1)
- isTWoW = 1
- table.insert(TW_Include, "LookingForTurtles");
-end
-
-if isTWoW == 1 then
- for i,TWMMB in ipairs(TW_Include) do
- DEFAULT_CHAT_FRAME:AddMessage("scruunch scruunch "..TWMMB, 1, 0, 1)
- end
- DEFAULT_CHAT_FRAME:AddMessage("Don't worry TurtleSnacks has fed your turtles", 1, 0, 1);
-else
- DEFAULT_CHAT_FRAME:AddMessage("Many sad Turtle noises :(", 1, 0, 1);
-end
---McPewPew
-
-MBB_Ignore = {
- [1] = "MiniMapTrackingFrame",
- [2] = "MiniMapMeetingStoneFrame",
- [3] = "MiniMapMailFrame",
- [4] = "MiniMapBattlefieldFrame",
- [5] = "MiniMapPing",
- [6] = "MinimapBackdrop",
- [7] = "MinimapZoomIn",
- [8] = "MinimapZoomOut",
- [9] = "BookOfTracksFrame",
- [10] = "GatherNote",
- [11] = "FishingExtravaganzaMini",
- [12] = "MiniNotePOI",
- [13] = "RecipeRadarMinimapIcon",
- [14] = "FWGMinimapPOI",
- [15] = "MBB_MinimapButtonFrame",
- [16] = "QuestieNote",
- [17] = "MetaMap",
- [18] = "LootLinkMinimapButton",
- [19] = "TimeManagerClockButton",
- [20] = "pfMiniMapPin",
- [21] = "Clock",
- [22] = "Timer"
-};
-
-MBB_IgnoreSize = {
- [1] = "AM_MinimapButton",
- [2] = "STC_HealthstoneButton",
- [3] = "STC_ShardButton",
- [4] = "STC_SoulstoneButton",
- [5] = "STC_SpellstoneButton",
- [6] = "STC_FirestoneButton",
- [7] = "TurtleCount",
-};
-
---Code by Grayhoof (SCT)
-local function CloneTable(t) -- return a copy of the table t
- local new = {}; -- create a new table
- local i, v = next(t, nil); -- i is an index of t, v = t[i]
- while i do
- if type(v)=="table" then
- v=CloneTable(v);
- end
- new[i] = v;
- i, v = next(t, i); -- get next index
- end
- return new;
-end
-
-
-MBB_ExtraSize = {
- ["GathererMinimapButton"] = function()
- GathererMinimapButton.mask:SetHeight(31);
- GathererMinimapButton.mask:SetWidth(31);
- end,
- ["WIM_IconFrame"] = function()
- WIM_IconFrameButton:SetScale(1);
- end,
- ["MonkeyBuddyIconButton"] = function()
- MonkeyBuddyIconButton:SetHeight(33);
- MonkeyBuddyIconButton:SetWidth(33);
- end,
- ["DPSMate_MiniMap"] = function()
- DPSMate_MiniMap:SetScale(MBB_Options.Scale /100);
- end
-};
-
-MBB_CallBack = {
- ["RecipeRadarMinimapButton"] = function()
- RecipeRadar_MinimapButton_UpdatePosition();
- end
-}
-
-
-_rescanned = false;
-_starttime = GetTime();
-
-function MBB_OnLoad()
- this:RegisterEvent("VARIABLES_LOADED");
- this:RegisterEvent("ADDON_LOADED");
- SLASH_MBB1 = "/mbb";
- SlashCmdList["MBB"] = MBB_SlashHandler;
-end
-
-function MBB_SlashHandler(cmd)
- if( cmd == "buttons" ) then
- MBB_Print("MBB Buttons:");
- for i,name in ipairs(MBB_Buttons) do
- MBB_Print(" " .. name);
- end
- elseif( string.sub(cmd, 1, 6) == "debug " ) then
- local iStart, iEnd, sFrame = string.find(cmd, "debug (.+)");
-
- local hasClick, hasMouseUp, hasMouseDown, hasEnter, hasLeave = MBB_TestFrame(sFrame);
-
- MBB_Debug("Frame: " .. sFrame);
- if( hasClick ) then
- MBB_Debug(" has OnClick script");
- else
- MBB_Debug(" has no OnClick script");
- end
- if( hasMouseUp ) then
- MBB_Debug(" has OnMouseUp script");
- else
- MBB_Debug(" has no OnMouseUp script");
- end
- if( hasMouseDown ) then
- MBB_Debug(" has OnMouseDown script");
- else
- MBB_Debug(" has no OnMouseDown script");
- end
- if( hasEnter ) then
- MBB_Debug(" has OnEnter script");
- else
- MBB_Debug(" has no OnEnter script");
- end
- if( hasLeave ) then
- MBB_Debug(" has OnLeave script");
- else
- MBB_Debug(" has no OnLeave script");
- end
- elseif( cmd == "reset position" ) then
- MBB_ResetPosition();
- elseif( cmd == "reset all" ) then
- MBB_Options = CloneTable(MBB_DefaultOptions);
- for i=1,table.getn(MBB_Exclude) do
- MBB_AddButton(MBB_Exclude[1]);
- end
- MBB_SetPositions();
- MBB_ResetPosition();
- else
- MBB_Print("MBB v" .. MBB_Version .. ":");
- MBB_Print(MBB_HELP1);
- MBB_Print(MBB_HELP2);
- MBB_Print(MBB_HELP3);
- MBB_Print(MBB_HELP4);
- end
-end
-
-function MBB_TestFrame(name)
- local hasClick = false;
- local hasMouseUp = false;
- local hasMouseDown = false;
- local hasEnter = false;
- local hasLeave = false;
- local frame = getglobal(name);
-
- if( frame ) then
- if( frame:HasScript("OnClick") ) then
- local test = frame:GetScript("OnClick");
- if( test ) then
- hasClick = true;
- end
- end
- if( frame:HasScript("OnMouseUp") ) then
- local test = frame:GetScript("OnMouseUp");
- if( test ) then
- hasMouseUp = true;
- end
- end
- if( frame:HasScript("OnMouseDown") ) then
- local test = frame:GetScript("OnMouseDown");
- if( test ) then
- hasMouseDown = true;
- end
- end
- if( frame:HasScript("OnEnter") ) then
- local test = frame:GetScript("OnEnter");
- if( test ) then
- hasEnter = true;
- end
- end
- if( frame:HasScript("OnLeave") ) then
- local test = frame:GetScript("OnLeave");
- if( test ) then
- hasLeave = true;
- end
- end
- end
-
- return hasClick, hasMouseUp, hasMouseDown, hasEnter, hasLeave;
-end
-
-function MBB_OnEvent()
- if(event == "ADDON_LOADED" and (arg1 == "Squeenix" or arg1 == "MBB")) then
- MBB_SetButtonPosition();
- end
- if ( event == "VARIABLES_LOADED" ) then
- if ( MBB_Options == nil or MBB_Options["Version"] ~= MBB_Version) then
- MBB_Options = CloneTable(MBB_DefaultOptions)
- end
- end
-end
-
-function MBB_GatherIcons()
- local children = {Minimap:GetChildren()};
- local additional = {MinimapBackdrop:GetChildren()};
- for _,child in ipairs(additional) do
- table.insert(children, child);
- end
- for _,child in ipairs(MBB_Include) do
- local frame = getglobal(child);
- if( frame ) then
- table.insert(children, frame);
- end
- end
-
- for _,child in ipairs(children) do
- if( child:GetName() ) then
- local ignore = false;
- local exclude = false;
- for i,needle in ipairs(MBB_Ignore) do
- if( string.find(child:GetName(), needle) ) then
- ignore = true;
- end
- end
---McPewPew
- if isTWoW == 1 then
- for i,needle in ipairs(MBB_Ignore) do
- if( string.find(child:GetName(), "TWMiniMapBattlefieldFrame") ) then
- ignore = false;
- end
- end
- end
---McPewPew
- if( not ignore ) then
- if( not child:HasScript("OnClick") ) then
- for _,subchild in ipairs({child:GetChildren()}) do
- if( subchild:HasScript("OnClick") ) then
- child = subchild;
- break;
- end
- end
- end
-
- local hasClick, hasMouseUp, hasMouseDown, hasEnter, hasLeave = MBB_TestFrame(child:GetName());
-
- if( hasClick or hasMouseUp or hasMouseDown ) then
- local name = child:GetName();
-
- MBB_PrepareButton(name);
- if( not MBB_IsExcluded(name) ) then
- if( child:IsVisible() ) then
- MBB_Debug("Button is visible: " .. name);
- else
- MBB_Debug("Button is not visible: " .. name);
- end
- MBB_Debug("Button added: " .. name);
- MBB_AddButton(name);
- else
- MBB_Debug("Button excluded: " .. name);
- end
- else
- MBB_Debug("Frame is no button: " .. child:GetName());
- end
- else
- MBB_Debug("Frame ignored: " .. child:GetName());
- end
- end
- end
-
- MBB_SetPositions();
-end
-
-function MBB_PrepareButton(name)
- local frame = getglobal(name);
-
- if( frame ) then
- if( frame.RegisterForClicks ) then
- frame:RegisterForClicks("LeftButtonDown","RightButtonDown");
- end
-
- if( not MBB_IsInArray(MBB_IgnoreSize, name) ) then
- frame:SetScale(MBB_Options.Scale * (1/Minimap:GetEffectiveScale())/100);
- end
- frame.isvisible = frame:IsVisible();
- frame.oshow = frame.Show;
- frame.Show = function(frame)
- frame.isvisible = true;
- MBB_Debug("Showing frame: " .. frame:GetName());
- if( not MBB_IsExcluded(frame:GetName()) ) then
- MBB_SetPositions();
- end
- if( MBB_IsExcluded(frame:GetName()) or (MBB_Buttons[1] and MBB_Buttons[1] ~= frame:GetName() and getglobal(MBB_Buttons[1]):IsVisible()) ) then
- frame.oshow(frame);
- end
- end
- frame.ohide = frame.Hide;
- frame.Hide = function(frame)
- frame.isvisible = false;
- MBB_Debug("Hiding frame: " .. frame:GetName());
- frame.ohide(frame);
- if( not MBB_IsExcluded(frame:GetName()) ) then
- MBB_SetPositions();
- end
- end
-
- if( frame:HasScript("OnClick") ) then
- frame.oclick = frame:GetScript("OnClick");
- frame:SetScript("OnClick", function()
- if( arg1 and arg1 == "RightButton" and IsControlKeyDown() ) then
- local name = this:GetName();
- if( MBB_IsExcluded(name) ) then
- MBB_AddButton(name);
- else
- MBB_RestoreButton(name);
- end
- MBB_SetPositions();
- elseif( this.oclick ) then
- this.oclick();
- end
- end);
- elseif( frame:HasScript("OnMouseUp") ) then
- frame.omouseup = frame:GetScript("OnMouseUp");
- frame:SetScript("OnMouseUp", function()
- if( arg1 and arg1 == "RightButton" and IsControlKeyDown() ) then
- local name = this:GetName();
- if( MBB_IsExcluded(name) ) then
- MBB_AddButton(name);
- else
- MBB_RestoreButton(name);
- end
- MBB_SetPositions();
- elseif( this.omouseup ) then
- this.omouseup();
- end
- end);
- elseif( frame:HasScript("OnMouseDown") ) then
- frame.omousedown = frame:GetScript("OnMouseDown");
- frame:SetScript("OnMouseDown", function()
- if( arg1 and arg1 == "RightButton" and IsControlKeyDown() ) then
- local name = this:GetName();
- if( MBB_IsExcluded(name) ) then
- MBB_AddButton(name);
- else
- MBB_RestoreButton(name);
- end
- MBB_SetPositions();
- elseif( this.omousedown ) then
- this.omousedown();
- end
- end);
- end
- if( frame:HasScript("OnEnter") ) then
- frame.oenter = frame:GetScript("OnEnter");
- frame:SetScript("OnEnter", function()
- if( not MBB_IsExcluded(this:GetName()) ) then
- MBB_ShowTimeout = -1;
- end
- if( this.oenter ) then
- this.oenter();
- end
- end);
- end
- if( frame:HasScript("OnLeave") ) then
- frame.oleave = frame:GetScript("OnLeave");
- frame:SetScript("OnLeave", function()
- if( not MBB_IsExcluded(this:GetName()) ) then
- MBB_ShowTimeout = 0;
- end
- if( this.oleave ) then
- this.oleave();
- end
- end);
- end
-
- if MBB_CallBack[name] then
-
- MBB_Debug("Calling callback: ".. name)
- local func = MBB_CallBack[name];
- func();
- end
-
- end
-end
-
-function MBB_AddButton(name)
- local show = false;
- local child = getglobal(name);
-
- if not child then return end
-
- if( MBB_Buttons[1] and MBB_Buttons[1] ~= name and getglobal(MBB_Buttons[1]):IsVisible() ) then
- show = true;
- end
-
- child.opoint = {child:GetPoint()};
- if( not child.opoint[1] ) then
- child.opoint = {"TOP", Minimap, "BOTTOM", 0, 0};
- end
- child.osize = {child:GetHeight(),child:GetWidth()};
- child.oclearallpoints = child.ClearAllPoints;
- child.ClearAllPoints = function() end;
- child.osetpoint = child.SetPoint;
- child.SetPoint = function() end;
- if( not show ) then
- child.ohide(child);
- end
- table.insert(MBB_Buttons, name);
- local i = MBB_IsInArray(MBB_Exclude, name);
- if( i ) then
- table.remove(MBB_Exclude, i);
- end
-end
-
-function MBB_IsExcluded(name)
- for i,needle in ipairs(MBB_Exclude) do
- if( needle == name ) then
- return true;
- end
- end
- return false;
-end
-
-function MBB_RestoreButton(name)
- local button = getglobal(name);
-
- button.oclearallpoints(button);
- button.osetpoint(button, button.opoint[1], button.opoint[2], button.opoint[3], button.opoint[4], button.opoint[5]);
- button:SetHeight(button.osize[1]);
- button:SetWidth(button.osize[1]);
- button.ClearAllPoints = button.oclearallpoints;
- button.SetPoint = button.osetpoint;
- if (button.isvisible) then
- button.oshow(button);
- else
- button.ohide(button);
- end
-
- table.insert(MBB_Exclude, name);
- local i = MBB_IsInArray(MBB_Buttons, button:GetName());
- if( i ) then
- table.remove(MBB_Buttons, i);
- end
-end
-
-local function ResizeButton(frame)
- frame:SetHeight(31);
- frame:SetWidth(31);
- frame:SetScale(MBB_Options.Scale * (1/Minimap:GetEffectiveScale())/100);
-end
-
-function MBB_SetPositions()
- local directions = {
- [1] = {"RIGHT", "LEFT"},
- [2] = {"BOTTOM", "TOP"},
- [3] = {"LEFT", "RIGHT"},
- [4] = {"TOP", "BOTTOM"}
- };
- local offsets = {
- [1] = {"RIGHT","LEFT"},
- [2] = {"BOTTOM","TOP"},
- [3] = {"LEFT", "RIGHT"},
- [4] = {"TOP", "BOTTOM"}
- };
- local cols ={};
- local parentid = 0;
- local count = 0;
- for i,name in ipairs(MBB_Buttons) do
- local frame = getglobal(name);
- if( frame.isvisible ) then
- count = count + 1 ;
- local mpl = MBB_Options["MaxButtonsPerLine"]
- if (MBB_Options["MaxButtonsPerLine"]==0) then mpl=100 end
- local row = math.floor (count /mpl )
- local col = count - row * mpl
- local parent;
-
- local dirchild, dirparent = directions[MBB_Options.ExpandDirection][1], directions[MBB_Options.ExpandDirection][2];
-
- if( parentid==0 ) then
- parent = MBB_MinimapButtonFrame;
- cols[row] = i
- else
- parent = getglobal(MBB_Buttons[parentid]);
- end
- if( not MBB_IsInArray(MBB_IgnoreSize, name) ) then
- if( MBB_ExtraSize[name] ) then
- local func = MBB_ExtraSize[name];
- func();
- else
- ResizeButton(frame);
- end
- end
-
- frame.oclearallpoints(frame);
- if ((col == 1) and (parentid ~= 0)) then
- cols[row] = i
- parent = getglobal(MBB_Buttons[cols[row - 1]])
- dirchild, dirparent = offsets[MBB_Options.AltExpandDirection][1], offsets[MBB_Options.AltExpandDirection][2]
-
- end
- frame.osetpoint(frame, dirchild, parent, dirparent, 0, 0);
-
- parentid = i;
- end
- end
-end
-
-function MBB_OnClick(arg1)
- if( arg1 and arg1 == "RightButton" and IsControlKeyDown() ) then
- if( MBB_Options.AttachToMinimap == 1 ) then
- local xpos,ypos = GetCursorPosition();
- local scale = MBB_Options.Scale/100;--UIParent:GetEffectiveScale(); --GetCVar("uiScale");
- MBB_Debug("cursor "..(xpos).." "..(ypos))
- MBB_Options.AttachToMinimap = 0;
- MBB_Options.ButtonPos ={xpos/scale ,ypos/scale } --{(xpos/scale)-10, (ypos/scale)-10}
- MBB_Debug("position "..(xpos/scale ).." "..(ypos/scale ))
- --(xpos/scale)-10, (ypos/scale)-10};
- MBB_SetButtonPosition();
- else
- MBB_ResetPosition();
- end
- elseif( arg1 and arg1 == "RightButton" ) then
- MBB_OptionsFrame:Show();
- else
- if( MBB_Buttons[1] and getglobal(MBB_Buttons[1]):IsVisible() ) then
- MBB_HideButtons();
- else
- for i,name in ipairs(MBB_Buttons) do
- local frame = getglobal(name);
- if frame.isvisible then frame.oshow(frame); end
- end
- --MBB_ShowTimeout = 0;
- end
- end
-end
-
-function MBB_DragStart()
- if (IsShiftKeyDown()) then
- GameTooltip:Hide();
- MBB_ShowTimeout = 0;
- MBB_DragFlag = 1;
- if( MBB_Options.AttachToMinimap == 1 ) then
-
- else
- local _,_,_,xpos,ypos = this:GetPoint();
- MBB_DragPos["orig"] = {xpos, ypos};
- MBB_Debug("orig "..(MBB_DragPos.orig[1]).." "..(MBB_DragPos.orig[2]))
- this:StartMoving();
- _,_,_,xpos,ypos = this:GetPoint();
- MBB_DragPos["start"]= {xpos, ypos};
- MBB_Debug("start "..(MBB_DragPos.start[1]).." "..(MBB_DragPos.start[2]))
- end
- else
- MBB_DragFlag = 0;
- end
-
-end
-
-function MBB_DragStop()
- if MBB_DragFlag == 1 then
- local _,_,_,xpos,ypos = this:GetPoint();
- MBB_Debug("stop "..(xpos).." "..(ypos))
- if( MBB_Options.AttachToMinimap == 1 ) then
-
-
- MBB_Options.ButtonPos = {xpos,ypos};
- else
- this:StopMovingOrSizing();
-
- -- local xpos,ypos = GetCursorPosition();
- -- local scale = MBB_Options.Scale/100;
- -- MBB_Options.ButtonPos ={xpos/scale ,ypos/scale }
- xpos = MBB_DragPos.orig[1] + (xpos - MBB_DragPos.start[1])
- ypos = MBB_DragPos.orig[2] + (ypos - MBB_DragPos.start[2])
- MBB_Options.ButtonPos ={xpos ,ypos }
- MBB_Debug("options "..(MBB_Options.ButtonPos[1]).." "..(MBB_Options.ButtonPos[2]))
- end
- MBB_DragFlag = 0;
- end
-end
-
-function MBB_HideButtons()
- MBB_ShowTimeout = -1;
- for i,name in ipairs(MBB_Buttons) do
- local frame = getglobal(name);
- frame.ohide(frame);
- end
-end
-
-function MBB_OnUpdate(elapsed)
-
- if (not _rescanned and (GetTime() - _starttime) > 5) then
- _rescanned = true;
- MBB_GatherIcons();
- MBB_SetButtonPosition();
- return;
- end;
-
- if( MBB_DragFlag == 1 and MBB_Options.AttachToMinimap == 1 ) then
- local xpos,ypos = GetCursorPosition();
- local xmin,ymin,xm,ym = Minimap:GetLeft(), Minimap:GetBottom(), Minimap:GetRight(), Minimap:GetTop();
- local scale = Minimap:GetEffectiveScale();
- local xdelta, ydelta = (xm - xmin)/2*scale, (ym - ymin) /2 * scale;
-
- MBB_Debug( xmin..","..ymin..","..xm..","..ym)
- MBB_Debug( xdelta..","..ydelta)
-
- xpos = xmin*scale-xpos+xdelta;
- ypos = ypos-ymin*scale-ydelta;
-
- local angle = math.deg(math.atan2(ypos,xpos));
-
- local x,y =0,0;
- if (Squeenix or (simpleMinimap_Skins and simpleMinimap_Skins:GetShape() == "square")
- or (pfUI and pfUI_config["disabled"]["minimap"] ~= "1")) then
- x = math.max(-xdelta, math.min((xdelta*1.5) * cos(angle), xdelta))
- y = math.max(-ydelta, math.min((ydelta*1.5) * sin(angle), ydelta))
- else
- x= cos(angle)*xdelta
- y= sin(angle)*ydelta
- end
- local sc= MBB_Options.Scale/100
- MBB_MinimapButtonFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", (xdelta-x)/sc -17 , (y-ydelta)/sc +17);
- end
-
- if( MBB_Options.CollapseTimeout and MBB_Options.CollapseTimeout ~= 0 ) then
- if( MBB_Buttons[1] ) then
- if( MBB_ShowTimeout >= MBB_Options.CollapseTimeout and getglobal(MBB_Buttons[1]):IsVisible() ) then
- MBB_HideButtons();
- end
- end
- if( MBB_ShowTimeout ~= -1 ) then
- MBB_ShowTimeout = MBB_ShowTimeout + elapsed;
- end
- end
-end
-
-function MBB_ResetPosition()
- MBB_Options.ButtonPos[1] = MBB_DefaultOptions.ButtonPos[1];
- MBB_Options.ButtonPos[2] = MBB_DefaultOptions.ButtonPos[2];
- MBB_Options.AttachToMinimap = MBB_DefaultOptions.AttachToMinimap;
- MBB_SetButtonPosition();
-end
-
-function MBB_SetButtonPosition()
- if (not MBB_Options) then MBB_Debug("NO MBB_Options");return; end
- MBB_MinimapButtonFrame:SetScale((MBB_Options.Scale or 100 ) * (1/Minimap:GetEffectiveScale())/100);
- if( MBB_Options.AttachToMinimap == 1 ) then
- MBB_MinimapButtonFrame:ClearAllPoints();
- MBB_MinimapButtonFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", MBB_Options.ButtonPos[1], MBB_Options.ButtonPos[2]);
- else
- MBB_MinimapButtonFrame:ClearAllPoints();
- MBB_MinimapButtonFrame:SetPoint("CENTER", UIParent, "BOTTOMLEFT", MBB_Options.ButtonPos[1], MBB_Options.ButtonPos[2]);
- end
-end
-
-function MBB_RadioButton_OnClick(id, alt)
- local substring;
- if( alt ) then
- substring = "Alt";
- else
- substring = "";
- end
- local buttons = {
- [1] = "Left",
- [2] = "Top",
- [3] = "Right",
- [4] = "Bottom"
- };
-
- for i,name in ipairs(buttons) do
- if( i == id ) then
- getglobal("MBB_OptionsFrame_" .. name .. substring .. "Radio"):SetChecked(true);
- else
- getglobal("MBB_OptionsFrame_" .. name .. substring .. "Radio"):SetChecked(nil);
- end
- end
-end
-
-
-function MBB_UpdateAltRadioButtons()
- local buttons = {
- [1] = "Left",
- [2] = "Top",
- [3] = "Right",
- [4] = "Bottom"
- };
-
- local exchecked = 1;
-
- for i,name in pairs(buttons) do
- if( getglobal("MBB_OptionsFrame_" .. name .. "Radio"):GetChecked() ) then
- exchecked = i;
- break;
- end
- end
-
- local checked = false;
- local textbox = getglobal("MBB_OptionsFrame_MaxButtonsTextBox");
-
- for i,name in pairs(buttons) do
- local radio = getglobal("MBB_OptionsFrame_" .. name .. "AltRadio");
- local label = getglobal("MBB_OptionsFrame_" .. name .. "AltRadioLabel");
- if( textbox:GetText() == "" or tonumber(textbox:GetText()) == 0 ) then
- radio:Disable();
- radio:SetChecked(nil);
- label:SetTextColor(0.5, 0.5, 0.5);
-
- else
- if( (exchecked - math.floor(exchecked/2)*2) == (i - math.floor(i/2)*2) ) then
- if( radio:GetChecked() ) then
- checked = true;
- if( i == 4 ) then
- getglobal("MBB_OptionsFrame_LeftAltRadio"):SetChecked(true);
- else
- getglobal("MBB_OptionsFrame_" .. buttons[i+1] .. "AltRadio"):SetChecked(true);
- end
- end
- radio:Disable();
- radio:SetChecked(nil);
- label:SetTextColor(0.5, 0.5, 0.5);
- else
- if( radio:GetChecked() ) then
- checked = true;
- end
- radio:Enable();
- label:SetTextColor(1, 1, 1);
-
- end
-
- end
-
- end
-
- if( not checked and tonumber(textbox:GetText()) ~= 0 and textbox:GetText() ~= "" ) then
- if( (exchecked - math.floor(exchecked/2)*2 ) == 1 ) then
- getglobal("MBB_OptionsFrame_TopAltRadio"):SetChecked(true);
- else
- getglobal("MBB_OptionsFrame_LeftAltRadio"):SetChecked(true);
- end
- end
-
-end
-
-function MBB_Debug(msg)
- if (MBB_DebugFlag == 1) then
- MBB_Print("MBB Debug : " .. tostring(msg));
- end
-end
-
-function MBB_IsInArray(array, needle)
- if(type(array) == "table") then
- --MBB_Debug("Looking for " .. tostring(needle) .. " in " .. tostring(array));
- for i, element in pairs(array) do
- if(type(element) == type(needle) and element == needle) then
- return i;
- end
- end
- end
- return nil;
-end
-function MBB_Print(msg)
- DEFAULT_CHAT_FRAME:AddMessage(msg, 0.2, 0.8, 0.8);
-end
+MBB_Version = GetAddOnMetadata("MinimapButtonBag_Octo", "Version") or "?";
+MBB_DebugFlag = 0;
+MBB_DragFlag = 0;
+MBB_ShowTimeout = -1;
+MBB_Buttons = {};
+MBB_Exclude = {};
+MBB_DragPos ={
+["orig"] = {},
+["start"] = {}
+};
+MBB_DefaultOptions = {
+ ["ButtonPos"] = {-18, -100},
+ ["AttachToMinimap"] = 1,
+ ["CollapseTimeout"] = 1,
+ ["ExpandDirection"] = 1,
+ ["MaxButtonsPerLine"] = 0,
+ ["AltExpandDirection"] = 4,
+ ["Scale"] = 100,
+ ["Version"] = MBB_Version
+};
+
+MBB_Include = {
+ [1] = "DPSMate_MiniMap",
+};
+
+--McPewPew
+TW_Include = {
+};
+
+isTWoW = 0
+
+if (TWMinimapShopFrame~=nil) then
+ TWMinimapShopFrame:ClearAllPoints() TWMinimapShopFrame:SetParent(Minimap) TWMinimapShopFrame:SetPoint("LEFT",Minimap,"RIGHT",-1, -1)
+ isTWoW = 1
+ table.insert(TW_Include, "Turtle WoW Shop");
+end
+if (TWMiniMapBattlefieldFrame~=nil) then
+ TWMiniMapBattlefieldFrame:ClearAllPoints() TWMiniMapBattlefieldFrame:SetParent(Minimap) TWMiniMapBattlefieldFrame:SetPoint("LEFT",Minimap,"RIGHT",-1, -1)
+ isTWoW = 1
+ table.insert(TW_Include, "Turtle WoW Battleground Finder");
+end
+if (LFT_Minimap~=nil) then
+ LFT_Minimap:ClearAllPoints() LFT_Minimap:SetParent(Minimap) LFT_Minimap:SetPoint("LEFT",Minimap,"RIGHT",-1, -1)
+ isTWoW = 1
+ table.insert(TW_Include, "LookingForTurtles");
+end
+
+if isTWoW == 1 then
+ for i,TWMMB in ipairs(TW_Include) do
+ DEFAULT_CHAT_FRAME:AddMessage("scruunch scruunch "..TWMMB, 1, 0, 1)
+ end
+ DEFAULT_CHAT_FRAME:AddMessage("Don't worry TurtleSnacks has fed your turtles", 1, 0, 1);
+else
+ DEFAULT_CHAT_FRAME:AddMessage("Many sad Turtle noises :(", 1, 0, 1);
+end
+--McPewPew
+
+MBB_Ignore = {
+ [1] = "MiniMapTrackingFrame",
+ [2] = "MiniMapMeetingStoneFrame",
+ [3] = "MiniMapMailFrame",
+ [4] = "MiniMapBattlefieldFrame",
+ [5] = "MiniMapPing",
+ [6] = "MinimapBackdrop",
+ [7] = "MinimapZoomIn",
+ [8] = "MinimapZoomOut",
+ [9] = "BookOfTracksFrame",
+ [10] = "GatherNote",
+ [11] = "FishingExtravaganzaMini",
+ [12] = "MiniNotePOI",
+ [13] = "RecipeRadarMinimapIcon",
+ [14] = "FWGMinimapPOI",
+ [15] = "MBB_MinimapButtonFrame",
+ [16] = "QuestieNote",
+ [17] = "MetaMap",
+ [18] = "LootLinkMinimapButton",
+ [19] = "TimeManagerClockButton",
+ [20] = "pfMiniMapPin",
+ [21] = "Clock",
+ [22] = "Timer"
+};
+
+MBB_IgnoreSize = {
+ [1] = "AM_MinimapButton",
+ [2] = "STC_HealthstoneButton",
+ [3] = "STC_ShardButton",
+ [4] = "STC_SoulstoneButton",
+ [5] = "STC_SpellstoneButton",
+ [6] = "STC_FirestoneButton",
+ [7] = "TurtleCount",
+};
+
+--Code by Grayhoof (SCT)
+local function CloneTable(t) -- return a copy of the table t
+ local new = {}; -- create a new table
+ local i, v = next(t, nil); -- i is an index of t, v = t[i]
+ while i do
+ if type(v)=="table" then
+ v=CloneTable(v);
+ end
+ new[i] = v;
+ i, v = next(t, i); -- get next index
+ end
+ return new;
+end
+
+
+MBB_ExtraSize = {
+ ["GathererMinimapButton"] = function()
+ GathererMinimapButton.mask:SetHeight(31);
+ GathererMinimapButton.mask:SetWidth(31);
+ end,
+ ["WIM_IconFrame"] = function()
+ WIM_IconFrameButton:SetScale(1);
+ end,
+ ["MonkeyBuddyIconButton"] = function()
+ MonkeyBuddyIconButton:SetHeight(33);
+ MonkeyBuddyIconButton:SetWidth(33);
+ end,
+ ["DPSMate_MiniMap"] = function()
+ DPSMate_MiniMap:SetScale(MBB_Options.Scale /100);
+ end
+};
+
+MBB_CallBack = {
+ ["RecipeRadarMinimapButton"] = function()
+ RecipeRadar_MinimapButton_UpdatePosition();
+ end
+}
+
+
+_rescanned = false;
+_starttime = GetTime();
+
+function MBB_OnLoad()
+ this:RegisterEvent("VARIABLES_LOADED");
+ this:RegisterEvent("ADDON_LOADED");
+ SLASH_MBB1 = "/mbb";
+ SlashCmdList["MBB"] = MBB_SlashHandler;
+end
+
+function MBB_SlashHandler(cmd)
+ if( cmd == "buttons" ) then
+ MBB_Print("MBB Buttons:");
+ for i,name in ipairs(MBB_Buttons) do
+ MBB_Print(" " .. name);
+ end
+ elseif( string.sub(cmd, 1, 6) == "debug " ) then
+ local iStart, iEnd, sFrame = string.find(cmd, "debug (.+)");
+
+ local hasClick, hasMouseUp, hasMouseDown, hasEnter, hasLeave = MBB_TestFrame(sFrame);
+
+ MBB_Debug("Frame: " .. sFrame);
+ if( hasClick ) then
+ MBB_Debug(" has OnClick script");
+ else
+ MBB_Debug(" has no OnClick script");
+ end
+ if( hasMouseUp ) then
+ MBB_Debug(" has OnMouseUp script");
+ else
+ MBB_Debug(" has no OnMouseUp script");
+ end
+ if( hasMouseDown ) then
+ MBB_Debug(" has OnMouseDown script");
+ else
+ MBB_Debug(" has no OnMouseDown script");
+ end
+ if( hasEnter ) then
+ MBB_Debug(" has OnEnter script");
+ else
+ MBB_Debug(" has no OnEnter script");
+ end
+ if( hasLeave ) then
+ MBB_Debug(" has OnLeave script");
+ else
+ MBB_Debug(" has no OnLeave script");
+ end
+ elseif( cmd == "reset position" ) then
+ MBB_ResetPosition();
+ elseif( cmd == "reset all" ) then
+ MBB_Options = CloneTable(MBB_DefaultOptions);
+ for i=1,table.getn(MBB_Exclude) do
+ MBB_AddButton(MBB_Exclude[1]);
+ end
+ MBB_SetPositions();
+ MBB_ResetPosition();
+ else
+ MBB_Print("MBB v" .. MBB_Version .. ":");
+ MBB_Print(MBB_HELP1);
+ MBB_Print(MBB_HELP2);
+ MBB_Print(MBB_HELP3);
+ MBB_Print(MBB_HELP4);
+ end
+end
+
+function MBB_TestFrame(name)
+ local hasClick = false;
+ local hasMouseUp = false;
+ local hasMouseDown = false;
+ local hasEnter = false;
+ local hasLeave = false;
+ local frame = getglobal(name);
+
+ if( frame ) then
+ if( frame:HasScript("OnClick") ) then
+ local test = frame:GetScript("OnClick");
+ if( test ) then
+ hasClick = true;
+ end
+ end
+ if( frame:HasScript("OnMouseUp") ) then
+ local test = frame:GetScript("OnMouseUp");
+ if( test ) then
+ hasMouseUp = true;
+ end
+ end
+ if( frame:HasScript("OnMouseDown") ) then
+ local test = frame:GetScript("OnMouseDown");
+ if( test ) then
+ hasMouseDown = true;
+ end
+ end
+ if( frame:HasScript("OnEnter") ) then
+ local test = frame:GetScript("OnEnter");
+ if( test ) then
+ hasEnter = true;
+ end
+ end
+ if( frame:HasScript("OnLeave") ) then
+ local test = frame:GetScript("OnLeave");
+ if( test ) then
+ hasLeave = true;
+ end
+ end
+ end
+
+ return hasClick, hasMouseUp, hasMouseDown, hasEnter, hasLeave;
+end
+
+function MBB_OnEvent()
+ if(event == "ADDON_LOADED" and (arg1 == "Squeenix" or arg1 == "MBB")) then
+ MBB_SetButtonPosition();
+ end
+ if ( event == "VARIABLES_LOADED" ) then
+ if ( MBB_Options == nil or MBB_Options["Version"] ~= MBB_Version) then
+ MBB_Options = CloneTable(MBB_DefaultOptions)
+ end
+ end
+end
+
+function MBB_GatherIcons()
+ local children = {Minimap:GetChildren()};
+ local additional = {MinimapBackdrop:GetChildren()};
+ for _,child in ipairs(additional) do
+ table.insert(children, child);
+ end
+ for _,child in ipairs(MBB_Include) do
+ local frame = getglobal(child);
+ if( frame ) then
+ table.insert(children, frame);
+ end
+ end
+
+ for _,child in ipairs(children) do
+ if( child:GetName() ) then
+ local ignore = false;
+ local exclude = false;
+ for i,needle in ipairs(MBB_Ignore) do
+ if( string.find(child:GetName(), needle) ) then
+ ignore = true;
+ end
+ end
+--McPewPew
+ if isTWoW == 1 then
+ for i,needle in ipairs(MBB_Ignore) do
+ if( string.find(child:GetName(), "TWMiniMapBattlefieldFrame") ) then
+ ignore = false;
+ end
+ end
+ end
+--McPewPew
+ if( not ignore ) then
+ if( not child:HasScript("OnClick") ) then
+ for _,subchild in ipairs({child:GetChildren()}) do
+ if( subchild:HasScript("OnClick") ) then
+ child = subchild;
+ break;
+ end
+ end
+ end
+
+ local hasClick, hasMouseUp, hasMouseDown, hasEnter, hasLeave = MBB_TestFrame(child:GetName());
+
+ if( hasClick or hasMouseUp or hasMouseDown ) then
+ local name = child:GetName();
+
+ MBB_PrepareButton(name);
+ if( not MBB_IsExcluded(name) ) then
+ if( child:IsVisible() ) then
+ MBB_Debug("Button is visible: " .. name);
+ else
+ MBB_Debug("Button is not visible: " .. name);
+ end
+ MBB_Debug("Button added: " .. name);
+ MBB_AddButton(name);
+ else
+ MBB_Debug("Button excluded: " .. name);
+ end
+ else
+ MBB_Debug("Frame is no button: " .. child:GetName());
+ end
+ else
+ MBB_Debug("Frame ignored: " .. child:GetName());
+ end
+ end
+ end
+
+ MBB_SetPositions();
+end
+
+function MBB_PrepareButton(name)
+ local frame = getglobal(name);
+
+ if( frame ) then
+ if( frame.RegisterForClicks ) then
+ frame:RegisterForClicks("LeftButtonDown","RightButtonDown");
+ end
+
+ if( not MBB_IsInArray(MBB_IgnoreSize, name) ) then
+ frame:SetScale(MBB_Options.Scale * (1/Minimap:GetEffectiveScale())/100);
+ end
+ frame.isvisible = frame:IsVisible();
+ frame.oshow = frame.Show;
+ frame.Show = function(frame)
+ frame.isvisible = true;
+ MBB_Debug("Showing frame: " .. frame:GetName());
+ if( not MBB_IsExcluded(frame:GetName()) ) then
+ MBB_SetPositions();
+ end
+ if( MBB_IsExcluded(frame:GetName()) or (MBB_Buttons[1] and MBB_Buttons[1] ~= frame:GetName() and getglobal(MBB_Buttons[1]):IsVisible()) ) then
+ frame.oshow(frame);
+ end
+ end
+ frame.ohide = frame.Hide;
+ frame.Hide = function(frame)
+ frame.isvisible = false;
+ MBB_Debug("Hiding frame: " .. frame:GetName());
+ frame.ohide(frame);
+ if( not MBB_IsExcluded(frame:GetName()) ) then
+ MBB_SetPositions();
+ end
+ end
+
+ if( frame:HasScript("OnClick") ) then
+ frame.oclick = frame:GetScript("OnClick");
+ frame:SetScript("OnClick", function()
+ if( arg1 and arg1 == "RightButton" and IsControlKeyDown() ) then
+ local name = this:GetName();
+ if( MBB_IsExcluded(name) ) then
+ MBB_AddButton(name);
+ else
+ MBB_RestoreButton(name);
+ end
+ MBB_SetPositions();
+ elseif( this.oclick ) then
+ this.oclick();
+ end
+ end);
+ elseif( frame:HasScript("OnMouseUp") ) then
+ frame.omouseup = frame:GetScript("OnMouseUp");
+ frame:SetScript("OnMouseUp", function()
+ if( arg1 and arg1 == "RightButton" and IsControlKeyDown() ) then
+ local name = this:GetName();
+ if( MBB_IsExcluded(name) ) then
+ MBB_AddButton(name);
+ else
+ MBB_RestoreButton(name);
+ end
+ MBB_SetPositions();
+ elseif( this.omouseup ) then
+ this.omouseup();
+ end
+ end);
+ elseif( frame:HasScript("OnMouseDown") ) then
+ frame.omousedown = frame:GetScript("OnMouseDown");
+ frame:SetScript("OnMouseDown", function()
+ if( arg1 and arg1 == "RightButton" and IsControlKeyDown() ) then
+ local name = this:GetName();
+ if( MBB_IsExcluded(name) ) then
+ MBB_AddButton(name);
+ else
+ MBB_RestoreButton(name);
+ end
+ MBB_SetPositions();
+ elseif( this.omousedown ) then
+ this.omousedown();
+ end
+ end);
+ end
+ if( frame:HasScript("OnEnter") ) then
+ frame.oenter = frame:GetScript("OnEnter");
+ frame:SetScript("OnEnter", function()
+ if( not MBB_IsExcluded(this:GetName()) ) then
+ MBB_ShowTimeout = -1;
+ end
+ if( this.oenter ) then
+ this.oenter();
+ end
+ end);
+ end
+ if( frame:HasScript("OnLeave") ) then
+ frame.oleave = frame:GetScript("OnLeave");
+ frame:SetScript("OnLeave", function()
+ if( not MBB_IsExcluded(this:GetName()) ) then
+ MBB_ShowTimeout = 0;
+ end
+ if( this.oleave ) then
+ this.oleave();
+ end
+ end);
+ end
+
+ if MBB_CallBack[name] then
+
+ MBB_Debug("Calling callback: ".. name)
+ local func = MBB_CallBack[name];
+ func();
+ end
+
+ end
+end
+
+function MBB_AddButton(name)
+ local show = false;
+ local child = getglobal(name);
+
+ if not child then return end
+
+ if( MBB_Buttons[1] and MBB_Buttons[1] ~= name and getglobal(MBB_Buttons[1]):IsVisible() ) then
+ show = true;
+ end
+
+ child.opoint = {child:GetPoint()};
+ if( not child.opoint[1] ) then
+ child.opoint = {"TOP", Minimap, "BOTTOM", 0, 0};
+ end
+ child.osize = {child:GetHeight(),child:GetWidth()};
+ child.oclearallpoints = child.ClearAllPoints;
+ child.ClearAllPoints = function() end;
+ child.osetpoint = child.SetPoint;
+ child.SetPoint = function() end;
+ if( not show ) then
+ child.ohide(child);
+ end
+ table.insert(MBB_Buttons, name);
+ local i = MBB_IsInArray(MBB_Exclude, name);
+ if( i ) then
+ table.remove(MBB_Exclude, i);
+ end
+end
+
+function MBB_IsExcluded(name)
+ for i,needle in ipairs(MBB_Exclude) do
+ if( needle == name ) then
+ return true;
+ end
+ end
+ return false;
+end
+
+function MBB_RestoreButton(name)
+ local button = getglobal(name);
+
+ button.oclearallpoints(button);
+ button.osetpoint(button, button.opoint[1], button.opoint[2], button.opoint[3], button.opoint[4], button.opoint[5]);
+ button:SetHeight(button.osize[1]);
+ button:SetWidth(button.osize[2]);
+ button.ClearAllPoints = button.oclearallpoints;
+ button.SetPoint = button.osetpoint;
+ if (button.isvisible) then
+ button.oshow(button);
+ else
+ button.ohide(button);
+ end
+
+ table.insert(MBB_Exclude, name);
+ local i = MBB_IsInArray(MBB_Buttons, button:GetName());
+ if( i ) then
+ table.remove(MBB_Buttons, i);
+ end
+end
+
+local function ResizeButton(frame)
+ frame:SetHeight(31);
+ frame:SetWidth(31);
+ frame:SetScale(MBB_Options.Scale * (1/Minimap:GetEffectiveScale())/100);
+end
+
+function MBB_SetPositions()
+ local directions = {
+ [1] = {"RIGHT", "LEFT"},
+ [2] = {"BOTTOM", "TOP"},
+ [3] = {"LEFT", "RIGHT"},
+ [4] = {"TOP", "BOTTOM"}
+ };
+ local offsets = {
+ [1] = {"RIGHT","LEFT"},
+ [2] = {"BOTTOM","TOP"},
+ [3] = {"LEFT", "RIGHT"},
+ [4] = {"TOP", "BOTTOM"}
+ };
+ local cols ={};
+ local parentid = 0;
+ local count = 0;
+ for i,name in ipairs(MBB_Buttons) do
+ local frame = getglobal(name);
+ if( frame.isvisible ) then
+ count = count + 1 ;
+ local mpl = MBB_Options["MaxButtonsPerLine"]
+ if (MBB_Options["MaxButtonsPerLine"]==0) then mpl=100 end
+ local row = math.floor (count /mpl )
+ local col = count - row * mpl
+ local parent;
+
+ local dirchild, dirparent = directions[MBB_Options.ExpandDirection][1], directions[MBB_Options.ExpandDirection][2];
+
+ if( parentid==0 ) then
+ parent = MBB_MinimapButtonFrame;
+ cols[row] = i
+ else
+ parent = getglobal(MBB_Buttons[parentid]);
+ end
+ if( not MBB_IsInArray(MBB_IgnoreSize, name) ) then
+ if( MBB_ExtraSize[name] ) then
+ local func = MBB_ExtraSize[name];
+ func();
+ else
+ ResizeButton(frame);
+ end
+ end
+
+ frame.oclearallpoints(frame);
+ if ((col == 1) and (parentid ~= 0)) then
+ cols[row] = i
+ parent = getglobal(MBB_Buttons[cols[row - 1]])
+ dirchild, dirparent = offsets[MBB_Options.AltExpandDirection][1], offsets[MBB_Options.AltExpandDirection][2]
+
+ end
+ frame.osetpoint(frame, dirchild, parent, dirparent, 0, 0);
+
+ parentid = i;
+ end
+ end
+end
+
+function MBB_OnClick(arg1)
+ if( arg1 and arg1 == "RightButton" and IsControlKeyDown() ) then
+ if( MBB_Options.AttachToMinimap == 1 ) then
+ local xpos,ypos = GetCursorPosition();
+ local scale = UIParent:GetEffectiveScale();
+ MBB_Debug("cursor "..(xpos).." "..(ypos))
+ MBB_Options.AttachToMinimap = 0;
+ MBB_Options.ButtonPos ={xpos/scale ,ypos/scale }
+ MBB_Debug("position "..(xpos/scale ).." "..(ypos/scale ))
+ MBB_SetButtonPosition();
+ else
+ MBB_ResetPosition();
+ end
+ elseif( arg1 and arg1 == "RightButton" ) then
+ MBB_OptionsFrame:Show();
+ else
+ if( MBB_Buttons[1] and getglobal(MBB_Buttons[1]):IsVisible() ) then
+ MBB_HideButtons();
+ else
+ for i,name in ipairs(MBB_Buttons) do
+ local frame = getglobal(name);
+ if frame.isvisible then frame.oshow(frame); end
+ end
+ --MBB_ShowTimeout = 0;
+ end
+ end
+end
+
+function MBB_DragStart()
+ if (IsShiftKeyDown()) then
+ GameTooltip:Hide();
+ MBB_ShowTimeout = 0;
+ MBB_DragFlag = 1;
+ if( MBB_Options.AttachToMinimap == 1 ) then
+
+ else
+ local _,_,_,xpos,ypos = this:GetPoint();
+ MBB_DragPos["orig"] = {xpos, ypos};
+ MBB_Debug("orig "..(MBB_DragPos.orig[1]).." "..(MBB_DragPos.orig[2]))
+ this:StartMoving();
+ _,_,_,xpos,ypos = this:GetPoint();
+ MBB_DragPos["start"]= {xpos, ypos};
+ MBB_Debug("start "..(MBB_DragPos.start[1]).." "..(MBB_DragPos.start[2]))
+ end
+ else
+ MBB_DragFlag = 0;
+ end
+
+end
+
+function MBB_DragStop()
+ if MBB_DragFlag == 1 then
+ local _,_,_,xpos,ypos = this:GetPoint();
+ MBB_Debug("stop "..(xpos).." "..(ypos))
+ if( MBB_Options.AttachToMinimap == 1 ) then
+
+
+ MBB_Options.ButtonPos = {xpos,ypos};
+ else
+ this:StopMovingOrSizing();
+
+ -- local xpos,ypos = GetCursorPosition();
+ -- local scale = MBB_Options.Scale/100;
+ -- MBB_Options.ButtonPos ={xpos/scale ,ypos/scale }
+ xpos = MBB_DragPos.orig[1] + (xpos - MBB_DragPos.start[1])
+ ypos = MBB_DragPos.orig[2] + (ypos - MBB_DragPos.start[2])
+ MBB_Options.ButtonPos ={xpos ,ypos }
+ MBB_Debug("options "..(MBB_Options.ButtonPos[1]).." "..(MBB_Options.ButtonPos[2]))
+ end
+ MBB_DragFlag = 0;
+ end
+end
+
+function MBB_HideButtons()
+ MBB_ShowTimeout = -1;
+ for i,name in ipairs(MBB_Buttons) do
+ local frame = getglobal(name);
+ frame.ohide(frame);
+ end
+end
+
+function MBB_OnUpdate(elapsed)
+
+ if (not _rescanned and (GetTime() - _starttime) > 5) then
+ _rescanned = true;
+ MBB_GatherIcons();
+ MBB_SetButtonPosition();
+ return;
+ end;
+
+ if( MBB_DragFlag == 1 and MBB_Options.AttachToMinimap == 1 ) then
+ local xpos,ypos = GetCursorPosition();
+ local xmin,ymin,xm,ym = Minimap:GetLeft(), Minimap:GetBottom(), Minimap:GetRight(), Minimap:GetTop();
+ local scale = Minimap:GetEffectiveScale();
+ local xdelta, ydelta = (xm - xmin)/2*scale, (ym - ymin) /2 * scale;
+
+ MBB_Debug( xmin..","..ymin..","..xm..","..ym)
+ MBB_Debug( xdelta..","..ydelta)
+
+ xpos = xmin*scale-xpos+xdelta;
+ ypos = ypos-ymin*scale-ydelta;
+
+ local angle = math.deg(math.atan2(ypos,xpos));
+
+ local x,y =0,0;
+ if (Squeenix or (simpleMinimap_Skins and simpleMinimap_Skins:GetShape() == "square")
+ or (pfUI and pfUI_config and pfUI_config["disabled"] and pfUI_config["disabled"]["minimap"] ~= "1")) then
+ x = math.max(-xdelta, math.min((xdelta*1.5) * cos(angle), xdelta))
+ y = math.max(-ydelta, math.min((ydelta*1.5) * sin(angle), ydelta))
+ else
+ x= cos(angle)*xdelta
+ y= sin(angle)*ydelta
+ end
+ local sc= MBB_Options.Scale/100
+ MBB_MinimapButtonFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", (xdelta-x)/sc -17 , (y-ydelta)/sc +17);
+ end
+
+ if( MBB_Options.CollapseTimeout and MBB_Options.CollapseTimeout ~= 0 ) then
+ if( MBB_Buttons[1] ) then
+ if( MBB_ShowTimeout >= MBB_Options.CollapseTimeout and getglobal(MBB_Buttons[1]):IsVisible() ) then
+ MBB_HideButtons();
+ end
+ end
+ if( MBB_ShowTimeout ~= -1 ) then
+ MBB_ShowTimeout = MBB_ShowTimeout + elapsed;
+ end
+ end
+end
+
+function MBB_ResetPosition()
+ MBB_Options.ButtonPos[1] = MBB_DefaultOptions.ButtonPos[1];
+ MBB_Options.ButtonPos[2] = MBB_DefaultOptions.ButtonPos[2];
+ MBB_Options.AttachToMinimap = MBB_DefaultOptions.AttachToMinimap;
+ MBB_SetButtonPosition();
+end
+
+function MBB_SetButtonPosition()
+ if (not MBB_Options) then MBB_Debug("NO MBB_Options");return; end
+ MBB_MinimapButtonFrame:SetScale((MBB_Options.Scale or 100 ) * (1/Minimap:GetEffectiveScale())/100);
+ if( MBB_Options.AttachToMinimap == 1 ) then
+ MBB_MinimapButtonFrame:ClearAllPoints();
+ MBB_MinimapButtonFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", MBB_Options.ButtonPos[1], MBB_Options.ButtonPos[2]);
+ else
+ MBB_MinimapButtonFrame:ClearAllPoints();
+ MBB_MinimapButtonFrame:SetPoint("CENTER", UIParent, "BOTTOMLEFT", MBB_Options.ButtonPos[1], MBB_Options.ButtonPos[2]);
+ end
+end
+
+function MBB_RadioButton_OnClick(id, alt)
+ local substring;
+ if( alt ) then
+ substring = "Alt";
+ else
+ substring = "";
+ end
+ local buttons = {
+ [1] = "Left",
+ [2] = "Top",
+ [3] = "Right",
+ [4] = "Bottom"
+ };
+
+ for i,name in ipairs(buttons) do
+ if( i == id ) then
+ getglobal("MBB_OptionsFrame_" .. name .. substring .. "Radio"):SetChecked(true);
+ else
+ getglobal("MBB_OptionsFrame_" .. name .. substring .. "Radio"):SetChecked(nil);
+ end
+ end
+end
+
+
+function MBB_UpdateAltRadioButtons()
+ local buttons = {
+ [1] = "Left",
+ [2] = "Top",
+ [3] = "Right",
+ [4] = "Bottom"
+ };
+
+ local exchecked = 1;
+
+ for i,name in pairs(buttons) do
+ if( getglobal("MBB_OptionsFrame_" .. name .. "Radio"):GetChecked() ) then
+ exchecked = i;
+ break;
+ end
+ end
+
+ local checked = false;
+ local textbox = getglobal("MBB_OptionsFrame_MaxButtonsTextBox");
+
+ for i,name in pairs(buttons) do
+ local radio = getglobal("MBB_OptionsFrame_" .. name .. "AltRadio");
+ local label = getglobal("MBB_OptionsFrame_" .. name .. "AltRadioLabel");
+ if( textbox:GetText() == "" or tonumber(textbox:GetText()) == 0 ) then
+ radio:Disable();
+ radio:SetChecked(nil);
+ label:SetTextColor(0.5, 0.5, 0.5);
+
+ else
+ if( (exchecked - math.floor(exchecked/2)*2) == (i - math.floor(i/2)*2) ) then
+ if( radio:GetChecked() ) then
+ checked = true;
+ if( i == 4 ) then
+ getglobal("MBB_OptionsFrame_LeftAltRadio"):SetChecked(true);
+ else
+ getglobal("MBB_OptionsFrame_" .. buttons[i+1] .. "AltRadio"):SetChecked(true);
+ end
+ end
+ radio:Disable();
+ radio:SetChecked(nil);
+ label:SetTextColor(0.5, 0.5, 0.5);
+ else
+ if( radio:GetChecked() ) then
+ checked = true;
+ end
+ radio:Enable();
+ label:SetTextColor(1, 1, 1);
+
+ end
+
+ end
+
+ end
+
+ if( not checked and tonumber(textbox:GetText()) ~= 0 and textbox:GetText() ~= "" ) then
+ if( (exchecked - math.floor(exchecked/2)*2 ) == 1 ) then
+ getglobal("MBB_OptionsFrame_TopAltRadio"):SetChecked(true);
+ else
+ getglobal("MBB_OptionsFrame_LeftAltRadio"):SetChecked(true);
+ end
+ end
+
+end
+
+function MBB_Debug(msg)
+ if (MBB_DebugFlag == 1) then
+ MBB_Print("MBB Debug : " .. tostring(msg));
+ end
+end
+
+function MBB_IsInArray(array, needle)
+ if(type(array) == "table") then
+ --MBB_Debug("Looking for " .. tostring(needle) .. " in " .. tostring(array));
+ for i, element in pairs(array) do
+ if(type(element) == type(needle) and element == needle) then
+ return i;
+ end
+ end
+ end
+ return nil;
+end
+function MBB_Print(msg)
+ DEFAULT_CHAT_FRAME:AddMessage(msg, 0.2, 0.8, 0.8);
+end
diff --git a/MBB.xml b/MBB.xml
index 1dc509e..eb79fec 100644
--- a/MBB.xml
+++ b/MBB.xml
@@ -1,695 +1,695 @@
-
-
-
-
-
- MBB_OnLoad();
-
-
- MBB_OnEvent();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if( this:GetValue() == 0 ) then
- getglobal(this:GetName().."Text"):SetText(MBB_OPTIONS_SLIDEROFF);
- else
- getglobal(this:GetName().."Text"):SetText(this:GetValue() .. " " .. MBB_OPTIONS_SLIDERSEK);
- end
-
-
- this:SetMinMaxValues(0,5);
- this:SetValueStep(1);
- getglobal(this:GetName().."High"):SetText("5 " .. MBB_OPTIONS_SLIDERSEK);
- getglobal(this:GetName().."Low"):SetText(MBB_OPTIONS_SLIDEROFF);
-
-
- this:SetValue(MBB_Options.CollapseTimeout);
- if( MBB_Options.CollapseTimeout == 0 ) then
- getglobal(this:GetName().."Text"):SetText(MBB_OPTIONS_SLIDEROFF);
- else
- getglobal(this:GetName().."Text"):SetText(this:GetValue() .. " " .. MBB_OPTIONS_SLIDERSEK);
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MBB_RadioButton_OnClick(1);
- MBB_UpdateAltRadioButtons();
-
-
- if( MBB_Options.ExpandDirection == 1 ) then
- MBB_RadioButton_OnClick(1);
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MBB_RadioButton_OnClick(2);
- MBB_UpdateAltRadioButtons();
-
-
- if( MBB_Options.ExpandDirection == 2 ) then
- MBB_RadioButton_OnClick(2);
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MBB_RadioButton_OnClick(3);
- MBB_UpdateAltRadioButtons();
-
-
- if( MBB_Options.ExpandDirection == 3 ) then
- MBB_RadioButton_OnClick(3);
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MBB_RadioButton_OnClick(4);
- MBB_UpdateAltRadioButtons();
-
-
- if( MBB_Options.ExpandDirection == 4 ) then
- MBB_RadioButton_OnClick(4);
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this:SetText(MBB_Options.MaxButtonsPerLine);
- this:ClearFocus();
-
-
- MBB_UpdateAltRadioButtons();
-
-
- if( not tonumber(this:GetText()) ) then
- this:SetText(MBB_Options.MaxButtonsPerLine);
- end
- MBB_UpdateAltRadioButtons();
- this:ClearFocus();
-
-
- this:SetTextInsets(2, 4, 2, 2);
-
-
- this:SetText(MBB_Options.MaxButtonsPerLine);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MBB_RadioButton_OnClick(1, true);
-
-
- if( MBB_Options.AltExpandDirection == 1 ) then
- MBB_RadioButton_OnClick(1, true);
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MBB_RadioButton_OnClick(2, true);
-
-
- if( MBB_Options.AltExpandDirection == 2 ) then
- MBB_RadioButton_OnClick(2, true);
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MBB_RadioButton_OnClick(3, true);
-
-
- if( MBB_Options.AltExpandDirection == 3 ) then
- MBB_RadioButton_OnClick(3, true);
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MBB_RadioButton_OnClick(4, true);
-
-
- if( MBB_Options.AltExpandDirection == 4 ) then
- MBB_RadioButton_OnClick(4, true);
- end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getglobal(this:GetName().."Text"):SetText(this:GetValue() .. "%");
- MBB_Options.Scale = MBB_OptionsFrame_Scale:GetValue();
- MBB_SetPositions();
- MBB_SetButtonPosition();
-
-
- this:SetMinMaxValues(50,150);
- this:SetValueStep(1);
- getglobal(this:GetName().."High"):SetText("150%");
- getglobal(this:GetName().."Low"):SetText("50%");
-
-
- this:SetValue(MBB_Options.Scale);
- getglobal(this:GetName().."Text"):SetText(this:GetValue() .. "%");
-
-
-
-
-
-
-
-
-
- MBB_OptionsFrame_HeaderText:SetText("MBB v" .. MBB_Version .. " " .. MBB_OPTIONS_HEADER);
- MBB_UpdateAltRadioButtons();
-
-
-
-
+
+
+
+
+
+ MBB_OnLoad();
+
+
+ MBB_OnEvent();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if( this:GetValue() == 0 ) then
+ getglobal(this:GetName().."Text"):SetText(MBB_OPTIONS_SLIDEROFF);
+ else
+ getglobal(this:GetName().."Text"):SetText(this:GetValue() .. " " .. MBB_OPTIONS_SLIDERSEK);
+ end
+
+
+ this:SetMinMaxValues(0,5);
+ this:SetValueStep(1);
+ getglobal(this:GetName().."High"):SetText("5 " .. MBB_OPTIONS_SLIDERSEK);
+ getglobal(this:GetName().."Low"):SetText(MBB_OPTIONS_SLIDEROFF);
+
+
+ this:SetValue(MBB_Options.CollapseTimeout);
+ if( MBB_Options.CollapseTimeout == 0 ) then
+ getglobal(this:GetName().."Text"):SetText(MBB_OPTIONS_SLIDEROFF);
+ else
+ getglobal(this:GetName().."Text"):SetText(this:GetValue() .. " " .. MBB_OPTIONS_SLIDERSEK);
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MBB_RadioButton_OnClick(1);
+ MBB_UpdateAltRadioButtons();
+
+
+ if( MBB_Options.ExpandDirection == 1 ) then
+ MBB_RadioButton_OnClick(1);
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MBB_RadioButton_OnClick(2);
+ MBB_UpdateAltRadioButtons();
+
+
+ if( MBB_Options.ExpandDirection == 2 ) then
+ MBB_RadioButton_OnClick(2);
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MBB_RadioButton_OnClick(3);
+ MBB_UpdateAltRadioButtons();
+
+
+ if( MBB_Options.ExpandDirection == 3 ) then
+ MBB_RadioButton_OnClick(3);
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MBB_RadioButton_OnClick(4);
+ MBB_UpdateAltRadioButtons();
+
+
+ if( MBB_Options.ExpandDirection == 4 ) then
+ MBB_RadioButton_OnClick(4);
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ this:SetText(MBB_Options.MaxButtonsPerLine);
+ this:ClearFocus();
+
+
+ MBB_UpdateAltRadioButtons();
+
+
+ if( not tonumber(this:GetText()) ) then
+ this:SetText(MBB_Options.MaxButtonsPerLine);
+ end
+ MBB_UpdateAltRadioButtons();
+ this:ClearFocus();
+
+
+ this:SetTextInsets(2, 4, 2, 2);
+
+
+ this:SetText(MBB_Options.MaxButtonsPerLine);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MBB_RadioButton_OnClick(1, true);
+
+
+ if( MBB_Options.AltExpandDirection == 1 ) then
+ MBB_RadioButton_OnClick(1, true);
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MBB_RadioButton_OnClick(2, true);
+
+
+ if( MBB_Options.AltExpandDirection == 2 ) then
+ MBB_RadioButton_OnClick(2, true);
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MBB_RadioButton_OnClick(3, true);
+
+
+ if( MBB_Options.AltExpandDirection == 3 ) then
+ MBB_RadioButton_OnClick(3, true);
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MBB_RadioButton_OnClick(4, true);
+
+
+ if( MBB_Options.AltExpandDirection == 4 ) then
+ MBB_RadioButton_OnClick(4, true);
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getglobal(this:GetName().."Text"):SetText(this:GetValue() .. "%");
+ MBB_Options.Scale = MBB_OptionsFrame_Scale:GetValue();
+ MBB_SetPositions();
+ MBB_SetButtonPosition();
+
+
+ this:SetMinMaxValues(50,150);
+ this:SetValueStep(1);
+ getglobal(this:GetName().."High"):SetText("150%");
+ getglobal(this:GetName().."Low"):SetText("50%");
+
+
+ this:SetValue(MBB_Options.Scale);
+ getglobal(this:GetName().."Text"):SetText(this:GetValue() .. "%");
+
+
+
+
+
+
+
+
+
+ MBB_OptionsFrame_HeaderText:SetText("MBB v" .. MBB_Version .. " " .. MBB_OPTIONS_HEADER);
+ MBB_UpdateAltRadioButtons();
+
+
+
+
diff --git a/MinimapButtonBag_Octo.toc b/MinimapButtonBag_Octo.toc
new file mode 100644
index 0000000..968d3b2
--- /dev/null
+++ b/MinimapButtonBag_Octo.toc
@@ -0,0 +1,14 @@
+## Interface: 11200
+## Title: MinimapButtonBag_Octo
+## Version: 1.0
+## Author: Tunhadil, LaYt (+McPewPew, +Olzon)
+## X-Website: https://github.com/McPewPew/MinimapButtonBag
+## X-Date: 2026-07-09
+## Notes: Reduces minimap buttons and makes them accessible through a menu!
+## Notes-deDE: Reduziert die Minimap Knöpfe und erlaubt den Zugriff auf diese über ein Menü!
+## Notes-ruRU: Компанует все иконки на миникарте в одну.
+## SavedVariablesPerCharacter: MBB_Exclude, MBB_Options
+localization-enGB.lua
+localization-deDE.lua
+localization-ruRU.lua
+MBB.xml
diff --git a/README.md b/README.md
index f3d8dc8..c34ab4e 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,19 @@
-# MinimapButtonBag
+# MinimapButtonBag_Octo
-MinimapButtonBag cleans up your Minimap and relocates the buttons in a menu bar.
+MinimapButtonBag_Octo cleans up your Minimap and relocates the buttons in a menu bar.

-[A minor edit of MBB, all credit to Tunhadil and [LaYt](https://github.com/laytya/MinimapButtonBag-vanilla)]
+[A fork of MBB, all credit to Tunhadil, LaYt ([MinimapButtonBag-vanilla](https://github.com/laytya/MinimapButtonBag-vanilla)), and McPewPew ([MinimapButtonBag-TurtleWoW](https://github.com/McPewPew/MinimapButtonBag-TurtleWoW))]
## Instructions
-* Download **[Latest Version](https://github.com/McPewPew/MinimapButtonBag-TurtleWoW/archive/refs/heads/master.zip)**
-* Unzip it into WoW\Interface\AddOns
-* Rename "MinimapButtonBag-master" to "MinimapButtonBag"
+* Unzip into `WoW\Interface\AddOns`
+* Make sure the resulting folder is named exactly `MinimapButtonBag_Octo`
+
+## Changelog (Octo fork - V1.0)
+* Original addon was causing crashes with OctoWoW., forked to get it working without issues.
+* Fixed a bug in `MBB_RestoreButton` where right-click-restoring a button to the minimap set its width equal to its height instead of its original width, distorting non-square buttons.
+* Hardened the pfUI drag-position check (`pfUI_config["disabled"]["minimap"]`) with proper nil-guards, so it can no longer throw a Lua error every frame while dragging if `pfUI_config` isn't shaped as expected.
+* Replaced the custom `icon.tga` with the stock in-game bag icon `Interface\Icons\INV_Misc_Bag_08` — no more bundled icon file, and it sidesteps the RLE-compressed TGA loading issue on the 1.12.1 client entirely.
+* Cleaned up a malformed `## X-Date` line in the `.toc` (missing colon).
+* Fixed Ctrl+Right-click "detach from minimap" positioning: it was converting the cursor position using the icon's own display scale (`MBB_Options.Scale/100`) instead of the UI's actual effective scale (`UIParent:GetEffectiveScale()`), so the button would land in the wrong spot instead of following your cursor away from the minimap.
diff --git a/localization-deDE.lua b/localization-deDE.lua
index b6cd5d9..e207123 100644
--- a/localization-deDE.lua
+++ b/localization-deDE.lua
@@ -1,23 +1,23 @@
-if( GetLocale() == "deDE" ) then
- MBB_TOOLTIP1 = "Strg + Rechtsklick auf einen Button, um ihn aus der Leiste zu lösen.\nUmschalt + Linke Ziehen-Taste zum Verschieben.";
- MBB_OPTIONS_HEADER = "Einstellungen";
- MBB_OPTIONS_OKBUTTON = "Ok";
- MBB_OPTIONS_CANCELBUTTON = "Abbrechen";
- MBB_OPTIONS_SLIDEROFF = "Aus";
- MBB_OPTIONS_SLIDERSEK = "Sek.";
- MBB_OPTIONS_SLIDERLABEL = "Autom. ausblenden:";
- MBB_OPTIONS_EXPANSIONLABEL = "Ausklappen nach:";
- MBB_OPTIONS_EXPANSIONLEFT = "Links";
- MBB_OPTIONS_EXPANSIONTOP = "Oben";
- MBB_OPTIONS_EXPANSIONRIGHT = "Rechts";
- MBB_OPTIONS_EXPANSIONBOTTOM = "Unten";
- MBB_OPTIONS_MAXBUTTONSLABEL = "Max. Knöpfe/Zeile:";
- MBB_OPTIONS_MAXBUTTONSINFO = "(0=unendlich)";
- MBB_OPTIONS_ALTEXPANSIONLABEL = "Alt. Ausklappen nach:";
- MBB_OPTIONS_SCALE="Knopfmaßstab";
- MBB_HELP1 = "Gib \"/mbb \" ein, wobei folgendes sein kann:";
- MBB_HELP2 = " |c00ffffffbuttons|r: Zeigt eine Liste aller Frames in der MBB Leiste";
- MBB_HELP3 = " |c00ffffffreset position|r: Setzt den MBB Minimap Button an seine ursprüngliche Position";
- MBB_HELP4 = " |c00ffffffreset all|r: Setzt alle Einstellungen auf ihre ursprünglichen Werte";
- MBB_NOERRORS = "Keine Fehler gefunden!";
+if( GetLocale() == "deDE" ) then
+ MBB_TOOLTIP1 = "Strg + Rechtsklick auf einen Button, um ihn aus der Leiste zu lösen.\nUmschalt + Linke Ziehen-Taste zum Verschieben.";
+ MBB_OPTIONS_HEADER = "Einstellungen";
+ MBB_OPTIONS_OKBUTTON = "Ok";
+ MBB_OPTIONS_CANCELBUTTON = "Abbrechen";
+ MBB_OPTIONS_SLIDEROFF = "Aus";
+ MBB_OPTIONS_SLIDERSEK = "Sek.";
+ MBB_OPTIONS_SLIDERLABEL = "Autom. ausblenden:";
+ MBB_OPTIONS_EXPANSIONLABEL = "Ausklappen nach:";
+ MBB_OPTIONS_EXPANSIONLEFT = "Links";
+ MBB_OPTIONS_EXPANSIONTOP = "Oben";
+ MBB_OPTIONS_EXPANSIONRIGHT = "Rechts";
+ MBB_OPTIONS_EXPANSIONBOTTOM = "Unten";
+ MBB_OPTIONS_MAXBUTTONSLABEL = "Max. Knöpfe/Zeile:";
+ MBB_OPTIONS_MAXBUTTONSINFO = "(0=unendlich)";
+ MBB_OPTIONS_ALTEXPANSIONLABEL = "Alt. Ausklappen nach:";
+ MBB_OPTIONS_SCALE="Knopfmaßstab";
+ MBB_HELP1 = "Gib \"/mbb \" ein, wobei folgendes sein kann:";
+ MBB_HELP2 = " |c00ffffffbuttons|r: Zeigt eine Liste aller Frames in der MBB Leiste";
+ MBB_HELP3 = " |c00ffffffreset position|r: Setzt den MBB Minimap Button an seine ursprüngliche Position";
+ MBB_HELP4 = " |c00ffffffreset all|r: Setzt alle Einstellungen auf ihre ursprünglichen Werte";
+ MBB_NOERRORS = "Keine Fehler gefunden!";
end
\ No newline at end of file
diff --git a/localization-enGB.lua b/localization-enGB.lua
index bc25bcf..ce73d42 100644
--- a/localization-enGB.lua
+++ b/localization-enGB.lua
@@ -1,21 +1,21 @@
-MBB_TOOLTIP1 = "Ctrl + Right click on a button to detach from or reattach it to the minimap.\nShift + Left drag to move button.";
-MBB_OPTIONS_HEADER = "Options";
-MBB_OPTIONS_OKBUTTON = "Ok";
-MBB_OPTIONS_CANCELBUTTON = "Cancel";
-MBB_OPTIONS_SLIDEROFF = "Off";
-MBB_OPTIONS_SLIDERSEK = "sec";
-MBB_OPTIONS_SLIDERLABEL = "Collapse Timeout:";
-MBB_OPTIONS_EXPANSIONLABEL = "Expand to:";
-MBB_OPTIONS_EXPANSIONLEFT = "Left";
-MBB_OPTIONS_EXPANSIONTOP = "Top";
-MBB_OPTIONS_EXPANSIONRIGHT = "Right";
-MBB_OPTIONS_EXPANSIONBOTTOM = "Bottom";
-MBB_OPTIONS_MAXBUTTONSLABEL = "Max. Buttons/Line:";
-MBB_OPTIONS_MAXBUTTONSINFO = "(0=infinity)";
-MBB_OPTIONS_ALTEXPANSIONLABEL = "Alt. Expand to:";
-MBB_OPTIONS_SCALE="Button's scale";
-MBB_HELP1 = "Type \"/mbb \" where is one of the following:";
-MBB_HELP2 = " |c00ffffffbuttons|r: Shows a list of all frames in the MBB bar";
-MBB_HELP3 = " |c00ffffffreset position|r: resets the position of the MBB minimap button";
-MBB_HELP4 = " |c00ffffffreset all|r: resets all options";
+MBB_TOOLTIP1 = "Ctrl + Right click on a button to detach from or reattach it to the minimap.\nShift + Left drag to move button.";
+MBB_OPTIONS_HEADER = "Options";
+MBB_OPTIONS_OKBUTTON = "Ok";
+MBB_OPTIONS_CANCELBUTTON = "Cancel";
+MBB_OPTIONS_SLIDEROFF = "Off";
+MBB_OPTIONS_SLIDERSEK = "sec";
+MBB_OPTIONS_SLIDERLABEL = "Collapse Timeout:";
+MBB_OPTIONS_EXPANSIONLABEL = "Expand to:";
+MBB_OPTIONS_EXPANSIONLEFT = "Left";
+MBB_OPTIONS_EXPANSIONTOP = "Top";
+MBB_OPTIONS_EXPANSIONRIGHT = "Right";
+MBB_OPTIONS_EXPANSIONBOTTOM = "Bottom";
+MBB_OPTIONS_MAXBUTTONSLABEL = "Max. Buttons/Line:";
+MBB_OPTIONS_MAXBUTTONSINFO = "(0=infinity)";
+MBB_OPTIONS_ALTEXPANSIONLABEL = "Alt. Expand to:";
+MBB_OPTIONS_SCALE="Button's scale";
+MBB_HELP1 = "Type \"/mbb \" where is one of the following:";
+MBB_HELP2 = " |c00ffffffbuttons|r: Shows a list of all frames in the MBB bar";
+MBB_HELP3 = " |c00ffffffreset position|r: resets the position of the MBB minimap button";
+MBB_HELP4 = " |c00ffffffreset all|r: resets all options";
MBB_NOERRORS = "No errors found!";
\ No newline at end of file
diff --git a/localization-ruRU.lua b/localization-ruRU.lua
index 7049abd..aa19aad 100644
--- a/localization-ruRU.lua
+++ b/localization-ruRU.lua
@@ -1,23 +1,23 @@
-if( GetLocale() == "ruRU" ) then
- MBB_TOOLTIP1 = "Ctrl + ПКМ на кнопку, чтобы прикрепить/открепить ее от миникарты.\nShift + Left Drag чтобы перемещать кнопку аддона.";
- MBB_OPTIONS_HEADER = "Настройки";
- MBB_OPTIONS_OKBUTTON = "Ок";
- MBB_OPTIONS_CANCELBUTTON = "Отмена";
- MBB_OPTIONS_SLIDEROFF = "Выкл.";
- MBB_OPTIONS_SLIDERSEK = "сек.";
- MBB_OPTIONS_SLIDERLABEL = "Таймаут до скрытия:";
- MBB_OPTIONS_EXPANSIONLABEL = "Расширяться:";
- MBB_OPTIONS_EXPANSIONLEFT = "Влево";
- MBB_OPTIONS_EXPANSIONTOP = "Вверх";
- MBB_OPTIONS_EXPANSIONRIGHT = "Вправо";
- MBB_OPTIONS_EXPANSIONBOTTOM = "Вниз";
- MBB_OPTIONS_MAXBUTTONSLABEL = "Max. кнопок в строке:";
- MBB_OPTIONS_MAXBUTTONSINFO = "(0=бесконечно)";
- MBB_OPTIONS_ALTEXPANSIONLABEL = "Расширять строки:";
- MBB_OPTIONS_SCALE="Масштаб кнопок";
- MBB_HELP1 = "Введите \"/mbb \", где одна из команд:";
- MBB_HELP2 = " |c00ffffffbuttons|r: Показать список всех кнопок в MBB";
- MBB_HELP3 = " |c00ffffffreset position|r: Сбросить позицию кнопки МBB у миникарты";
- MBB_HELP4 = " |c00ffffffreset all|r: Сбросить все настройки";
- MBB_NOERRORS = "Ошибок не найдено!";
-end
+if( GetLocale() == "ruRU" ) then
+ MBB_TOOLTIP1 = "Ctrl + ПКМ на кнопку, чтобы прикрепить/открепить ее от миникарты.\nShift + Left Drag чтобы перемещать кнопку аддона.";
+ MBB_OPTIONS_HEADER = "Настройки";
+ MBB_OPTIONS_OKBUTTON = "Ок";
+ MBB_OPTIONS_CANCELBUTTON = "Отмена";
+ MBB_OPTIONS_SLIDEROFF = "Выкл.";
+ MBB_OPTIONS_SLIDERSEK = "сек.";
+ MBB_OPTIONS_SLIDERLABEL = "Таймаут до скрытия:";
+ MBB_OPTIONS_EXPANSIONLABEL = "Расширяться:";
+ MBB_OPTIONS_EXPANSIONLEFT = "Влево";
+ MBB_OPTIONS_EXPANSIONTOP = "Вверх";
+ MBB_OPTIONS_EXPANSIONRIGHT = "Вправо";
+ MBB_OPTIONS_EXPANSIONBOTTOM = "Вниз";
+ MBB_OPTIONS_MAXBUTTONSLABEL = "Max. кнопок в строке:";
+ MBB_OPTIONS_MAXBUTTONSINFO = "(0=бесконечно)";
+ MBB_OPTIONS_ALTEXPANSIONLABEL = "Расширять строки:";
+ MBB_OPTIONS_SCALE="Масштаб кнопок";
+ MBB_HELP1 = "Введите \"/mbb \", где одна из команд:";
+ MBB_HELP2 = " |c00ffffffbuttons|r: Показать список всех кнопок в MBB";
+ MBB_HELP3 = " |c00ffffffreset position|r: Сбросить позицию кнопки МBB у миникарты";
+ MBB_HELP4 = " |c00ffffffreset all|r: Сбросить все настройки";
+ MBB_NOERRORS = "Ошибок не найдено!";
+end