Added button's scale option

This commit is contained in:
LaYt
2017-02-01 13:36:17 +07:00
parent 20228d9373
commit a40424b63f
6 changed files with 61 additions and 9 deletions
+6 -3
View File
@@ -11,6 +11,7 @@ MBB_DefaultOptions = {
["ExpandDirection"] = 1, ["ExpandDirection"] = 1,
["MaxButtonsPerLine"] = 0, ["MaxButtonsPerLine"] = 0,
["AltExpandDirection"] = 4, ["AltExpandDirection"] = 4,
["Scale"] = 100,
["Version"] = MBB_Version ["Version"] = MBB_Version
}; };
@@ -35,7 +36,8 @@ MBB_Ignore = {
[14] = "FWGMinimapPOI", [14] = "FWGMinimapPOI",
[15] = "MBB_MinimapButtonFrame", [15] = "MBB_MinimapButtonFrame",
[16] = "QuestieNote", [16] = "QuestieNote",
[17] = "MetaMap" [17] = "MetaMap",
[18] = "LootLinkMinimapButton"
}; };
@@ -268,7 +270,7 @@ function MBB_PrepareButton(name)
end end
if( not MBB_IsInArray(MBB_IgnoreSize, name) ) then if( not MBB_IsInArray(MBB_IgnoreSize, name) ) then
frame:SetScale(1/Minimap:GetEffectiveScale()); frame:SetScale(MBB_Options.Scale * (1/Minimap:GetEffectiveScale())/100);
end end
frame.isvisible = frame:IsVisible(); frame.isvisible = frame:IsVisible();
frame.oshow = frame.Show; frame.oshow = frame.Show;
@@ -458,6 +460,7 @@ function MBB_SetPositions()
else else
frame:SetHeight(31); -- 33 frame:SetHeight(31); -- 33
frame:SetWidth(31); frame:SetWidth(31);
frame:SetScale(MBB_Options.Scale * (1/Minimap:GetEffectiveScale())/100);
end end
end end
@@ -571,7 +574,7 @@ end
function MBB_SetButtonPosition() function MBB_SetButtonPosition()
if (not MBB_Options) then MBB_Debug("NO MBB_Options");return; end if (not MBB_Options) then MBB_Debug("NO MBB_Options");return; end
MBB_MinimapButtonFrame:SetScale(1/Minimap:GetEffectiveScale()); MBB_MinimapButtonFrame:SetScale(MBB_Options.Scale* (1/Minimap:GetEffectiveScale())/100);
if( MBB_Options.AttachToMinimap == 1 ) then if( MBB_Options.AttachToMinimap == 1 ) then
MBB_MinimapButtonFrame:ClearAllPoints(); MBB_MinimapButtonFrame:ClearAllPoints();
MBB_MinimapButtonFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", MBB_Options.ButtonPos[1], MBB_Options.ButtonPos[2]); MBB_MinimapButtonFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", MBB_Options.ButtonPos[1], MBB_Options.ButtonPos[2]);
+1 -1
View File
@@ -1,6 +1,6 @@
## Interface: 11200 ## Interface: 11200
## Title: MinimapButtonBag ## Title: MinimapButtonBag
## Version: 0.504 ## Version: 0.505
## Author: Tunhadil, LaYt - continue ## Author: Tunhadil, LaYt - continue
## Notes: Reduces minimap buttons and makes them accessible through a menu! ## 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-deDE: Reduziert die Minimap Knöpfe und erlaubt den Zugriff auf diese über ein Menü!
+51 -5
View File
@@ -109,7 +109,7 @@
<Frame name="MBB_OptionsFrame" toplevel="true" enableMouse="true" movable="true" parent="UIParent" hidden="true"> <Frame name="MBB_OptionsFrame" toplevel="true" enableMouse="true" movable="true" parent="UIParent" hidden="true">
<Size> <Size>
<AbsDimension x="300" y="290" /> <AbsDimension x="300" y="330" />
</Size> </Size>
<Anchors> <Anchors>
<Anchor point="CENTER" /> <Anchor point="CENTER" />
@@ -600,14 +600,58 @@
</OnShow> </OnShow>
</Scripts> </Scripts>
</CheckButton> </CheckButton>
<Slider name="$parent_Scale" inherits="OptionsSliderTemplate">
<Anchors>
<Anchor point="TOP" relativeTo="$parent_BottomAltRadio" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="55" y="-20" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentLabel" inherits="GameFontHighlight" justifyH="LEFT" text="MBB_OPTIONS_SCALE">
<Size>
<AbsDimension x="125" y="15" />
</Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0" />
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnValueChanged>
getglobal(this:GetName().."Text"):SetText(this:GetValue() .. "%");
MBB_Options.Scale = MBB_OptionsFrame_Scale:GetValue();
MBB_SetPositions();
MBB_SetButtonPosition();
</OnValueChanged>
<OnLoad>
this:SetMinMaxValues(50,150);
this:SetValueStep(1);
getglobal(this:GetName().."High"):SetText("150%");
getglobal(this:GetName().."Low"):SetText("50%");
</OnLoad>
<OnShow>
this:SetValue(MBB_Options.Scale);
getglobal(this:GetName().."Text"):SetText(this:GetValue() .. "%");
</OnShow>
</Scripts>
</Slider>
<Button name="$parent_OKButton" inherits="UIPanelButtonTemplate" text="MBB_OPTIONS_OKBUTTON"> <Button name="$parent_OKButton" inherits="UIPanelButtonTemplate" text="MBB_OPTIONS_OKBUTTON">
<Size> <Size>
<AbsDimension x="125" y="21" /> <AbsDimension x="125" y="21" />
</Size> </Size>
<Anchors> <Anchors>
<Anchor point="TOP" relativeTo="$parent" relativeFrom="TOPLEFT"> <Anchor point="BOTTOMLEFT" relativeTo="$parent" relativeFrom="BOTTOMLEFT">
<Offset> <Offset>
<AbsDimension x="-75" y="-245" /> <AbsDimension x="20" y="15" />
</Offset> </Offset>
</Anchor> </Anchor>
</Anchors> </Anchors>
@@ -615,6 +659,7 @@
<OnClick> <OnClick>
MBB_OptionsFrame:Hide(); MBB_OptionsFrame:Hide();
MBB_Options.CollapseTimeout = MBB_OptionsFrame_TimeoutSlider:GetValue(); MBB_Options.CollapseTimeout = MBB_OptionsFrame_TimeoutSlider:GetValue();
MBB_Options.Scale = MBB_OptionsFrame_Scale:GetValue();
if( MBB_OptionsFrame_LeftRadio:GetChecked() ) then if( MBB_OptionsFrame_LeftRadio:GetChecked() ) then
MBB_Options.ExpandDirection = 1; MBB_Options.ExpandDirection = 1;
elseif( MBB_OptionsFrame_TopRadio:GetChecked() ) then elseif( MBB_OptionsFrame_TopRadio:GetChecked() ) then
@@ -637,6 +682,7 @@
MBB_Options.AltExpandDirection = 4; MBB_Options.AltExpandDirection = 4;
end end
MBB_SetPositions(); MBB_SetPositions();
MBB_SetButtonPosition();
</OnClick> </OnClick>
</Scripts> </Scripts>
</Button> </Button>
@@ -645,9 +691,9 @@
<AbsDimension x="125" y="21" /> <AbsDimension x="125" y="21" />
</Size> </Size>
<Anchors> <Anchors>
<Anchor point="TOP" relativeTo="$parent" relativeFrom="TOPLEFT"> <Anchor point="LEFT" relativeTo="$parent_OKButton" relativeFrom="LEFT">
<Offset> <Offset>
<AbsDimension x="75" y="-245" /> <AbsDimension x="130" y="0" />
</Offset> </Offset>
</Anchor> </Anchor>
</Anchors> </Anchors>
+1
View File
@@ -14,6 +14,7 @@ if( GetLocale() == "deDE" ) then
MBB_OPTIONS_MAXBUTTONSLABEL = "Max. Knöpfe/Zeile:"; MBB_OPTIONS_MAXBUTTONSLABEL = "Max. Knöpfe/Zeile:";
MBB_OPTIONS_MAXBUTTONSINFO = "(0=unendlich)"; MBB_OPTIONS_MAXBUTTONSINFO = "(0=unendlich)";
MBB_OPTIONS_ALTEXPANSIONLABEL = "Alt. Ausklappen nach:"; MBB_OPTIONS_ALTEXPANSIONLABEL = "Alt. Ausklappen nach:";
MBB_OPTIONS_SCALE="Knopfmaßstab";
MBB_HELP1 = "Gib \"/mbb <cmd>\" ein, wobei <cmd> folgendes sein kann:"; MBB_HELP1 = "Gib \"/mbb <cmd>\" ein, wobei <cmd> folgendes sein kann:";
MBB_HELP2 = " |c00ffffffbuttons|r: Zeigt eine Liste aller Frames in der MBB Leiste"; 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_HELP3 = " |c00ffffffreset position|r: Setzt den MBB Minimap Button an seine ursprüngliche Position";
+1
View File
@@ -13,6 +13,7 @@ MBB_OPTIONS_EXPANSIONBOTTOM = "Bottom";
MBB_OPTIONS_MAXBUTTONSLABEL = "Max. Buttons/Line:"; MBB_OPTIONS_MAXBUTTONSLABEL = "Max. Buttons/Line:";
MBB_OPTIONS_MAXBUTTONSINFO = "(0=infinity)"; MBB_OPTIONS_MAXBUTTONSINFO = "(0=infinity)";
MBB_OPTIONS_ALTEXPANSIONLABEL = "Alt. Expand to:"; MBB_OPTIONS_ALTEXPANSIONLABEL = "Alt. Expand to:";
MBB_OPTIONS_SCALE="Button's scale";
MBB_HELP1 = "Type \"/mbb <cmd>\" where <cmd> is one of the following:"; MBB_HELP1 = "Type \"/mbb <cmd>\" where <cmd> is one of the following:";
MBB_HELP2 = " |c00ffffffbuttons|r: Shows a list of all frames in the MBB bar"; 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_HELP3 = " |c00ffffffreset position|r: resets the position of the MBB minimap button";
+1
View File
@@ -14,6 +14,7 @@ if( GetLocale() == "ruRU" ) then
MBB_OPTIONS_MAXBUTTONSLABEL = "Max. кнопок на строку:"; MBB_OPTIONS_MAXBUTTONSLABEL = "Max. кнопок на строку:";
MBB_OPTIONS_MAXBUTTONSINFO = "(0=бесконечно)"; MBB_OPTIONS_MAXBUTTONSINFO = "(0=бесконечно)";
MBB_OPTIONS_ALTEXPANSIONLABEL = "Расширять строки в:"; MBB_OPTIONS_ALTEXPANSIONLABEL = "Расширять строки в:";
MBB_OPTIONS_SCALE="Масштаб кнопок";
MBB_HELP1 = "Напечатайте \"/mbb <cmd>\" где <cmd> есть одна из команд:"; MBB_HELP1 = "Напечатайте \"/mbb <cmd>\" где <cmd> есть одна из команд:";
MBB_HELP2 = " |c00ffffffbuttons|r: Показать список всех кнопок в MBB"; MBB_HELP2 = " |c00ffffffbuttons|r: Показать список всех кнопок в MBB";
MBB_HELP3 = " |c00ffffffreset position|r: Сбросить позицию кнопки МBB у миникарты"; MBB_HELP3 = " |c00ffffffreset position|r: Сбросить позицию кнопки МBB у миникарты";