- Plugin Tiny Threat received a options panel and also a minor revamp.

- Timeline plugin got some rework and now its window can be open while in combat.
- Plugin You Are Not Prepared, got a options panel.
- Added Data Broker for: Combat Time, Player Dps and Player Hps.
- Fixed non formatted numbers where it shows its fractional part.
- Texts on options panel now auto-resizes depending on the test's lengh.
- Slash commands now are multi language, accepting both english and the localized language.

- New API: framework:BuildMenu (parent, menu, x_offset, y_offset, height), auto build menu, similar to Ace3 GUI.
This commit is contained in:
tercio
2014-07-21 14:23:28 -03:00
parent 0b8cab413e
commit e5eff411c9
21 changed files with 1377 additions and 891 deletions
+48 -1
View File
@@ -401,6 +401,30 @@ local ButtonMetaFunctions = {}
else
self.icon:SetVertexColor (1, 1, 1, 1)
end
local w = self.button:GetWidth()
local iconw = self.icon:GetWidth()
local text_width = self.button.text:GetStringWidth()
if (text_width > w-15-iconw) then
if (not short_method) then
local new_width = text_width+15+iconw
self.button:SetWidth (new_width)
elseif (short_method == 1) then
local loop = true
local textsize = 11
while (loop) do
if (text_width+15+iconw < w or textsize < 8) then
loop = false
break
else
_detalhes:SetFontSize (self.button.text, textsize)
text_width = self.button.text:GetStringWidth()
textsize = textsize - 1
end
end
end
end
end
-- frame stratas
@@ -691,7 +715,7 @@ local ButtonMetaFunctions = {}
------------------------------------------------------------------------------------------------------------
--> object constructor
function gump:NewButton (parent, container, name, member, w, h, func, param1, param2, texture, text)
function gump:NewButton (parent, container, name, member, w, h, func, param1, param2, texture, text, short_method)
if (not name) then
return nil
@@ -766,11 +790,34 @@ function gump:NewButton (parent, container, name, member, w, h, func, param1, pa
ButtonObject.button.text:SetText (text)
ButtonObject.button.text:SetPoint ("center", ButtonObject.button, "center")
local text_width = ButtonObject.button.text:GetStringWidth()
if (text_width > w-15) then
if (not short_method) then
local new_width = text_width+15
ButtonObject.button:SetWidth (new_width)
elseif (short_method == 1) then
local loop = true
local textsize = 11
while (loop) do
if (text_width+15 < w or textsize < 8) then
loop = false
break
else
_detalhes:SetFontSize (ButtonObject.button.text, textsize)
text_width = ButtonObject.button.text:GetStringWidth()
textsize = textsize - 1
end
end
end
end
ButtonObject.func = func or cleanfunction
ButtonObject.funcright = cleanfunction
ButtonObject.param1 = param1
ButtonObject.param2 = param2
ButtonObject.short_method = short_method
--> hooks
ButtonObject.button:SetScript ("OnEnter", OnEnter)
ButtonObject.button:SetScript ("OnLeave", OnLeave)
+15
View File
@@ -165,6 +165,21 @@ function gump:BuildMenu (parent, menu, x_offset, y_offset, height)
switch:SetPoint ("left", label, "right", 2)
label:SetPoint (cur_x, cur_y)
local size = label.widget:GetStringWidth() + 60 + 4
if (size > max_x) then
max_x = size
end
elseif (widget_table.type == "range" or widget_table.type == "slider") then
local is_decimanls = widget_table.usedecimals
local slider = self:NewSlider (parent, nil, "$parentWidget" .. index, nil, 140, 20, widget_table.min, widget_table.max, widget_table.step, widget_table.get(), is_decimanls)
slider.tooltip = widget_table.desc
slider:SetHook ("OnValueChange", widget_table.set)
local label = self:NewLabel (parent, nil, "$parentLabel" .. index, nil, widget_table.name, "GameFontNormal", 12)
slider:SetPoint ("left", label, "right", 2)
label:SetPoint (cur_x, cur_y)
local size = label.widget:GetStringWidth() + 60 + 4
if (size > max_x) then
max_x = size
+10 -9
View File
@@ -1,5 +1,6 @@
local _detalhes = _G._detalhes
local g = _detalhes.gump
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
local _
local window = g:NewPanel (UIParent, nil, "DetailsImageEdit", nil, 100, 100, false)
@@ -219,20 +220,20 @@ local _
window [side.."Slider"]:Show()
end
local leftTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentLeftTexButton", nil, 100, 20, enableTexEdit, "left", nil, nil, "Crop Left")
local leftTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentLeftTexButton", nil, 100, 20, enableTexEdit, "left", nil, nil, Loc ["STRING_IMAGEEDIT_CROPLEFT"], 1)
leftTexCoordButton:SetPoint ("topright", buttonsBackground, "topright", -8, -10)
local rightTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentRightTexButton", nil, 100, 20, enableTexEdit, "right", nil, nil, "Crop Right")
local rightTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentRightTexButton", nil, 100, 20, enableTexEdit, "right", nil, nil, Loc ["STRING_IMAGEEDIT_CROPRIGHT"], 1)
rightTexCoordButton:SetPoint ("topright", buttonsBackground, "topright", -8, -30)
local topTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentTopTexButton", nil, 100, 20, enableTexEdit, "top", nil, nil, "Crop Top")
local topTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentTopTexButton", nil, 100, 20, enableTexEdit, "top", nil, nil, Loc ["STRING_IMAGEEDIT_CROPTOP"], 1)
topTexCoordButton:SetPoint ("topright", buttonsBackground, "topright", -8, -50)
local bottomTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentBottomTexButton", nil, 100, 20, enableTexEdit, "bottom", nil, nil, "Crop Bottom")
local bottomTexCoordButton = g:NewButton (buttonsBackground, nil, "$parentBottomTexButton", nil, 100, 20, enableTexEdit, "bottom", nil, nil, Loc ["STRING_IMAGEEDIT_CROPBOTTOM"], 1)
bottomTexCoordButton:SetPoint ("topright", buttonsBackground, "topright", -8, -70)
leftTexCoordButton:InstallCustomTexture()
rightTexCoordButton:InstallCustomTexture()
topTexCoordButton:InstallCustomTexture()
bottomTexCoordButton:InstallCustomTexture()
local Alpha = g:NewButton (buttonsBackground, nil, "$parentBottomAlphaButton", nil, 100, 20, alpha, nil, nil, nil, "Transparency")
local Alpha = g:NewButton (buttonsBackground, nil, "$parentBottomAlphaButton", nil, 100, 20, alpha, nil, nil, nil, Loc ["STRING_IMAGEEDIT_ALPHA"], 1)
Alpha:SetPoint ("topright", buttonsBackground, "topright", -8, -115)
Alpha:InstallCustomTexture()
@@ -283,7 +284,7 @@ local _
end
end
local changeColorButton = g:NewButton (buttonsBackground, nil, "$parentOverlayColorButton", nil, 100, 20, changeColor, nil, nil, nil, "Overlay Color")
local changeColorButton = g:NewButton (buttonsBackground, nil, "$parentOverlayColorButton", nil, 100, 20, changeColor, nil, nil, nil, Loc ["STRING_IMAGEEDIT_COLOR"], 1)
changeColorButton:SetPoint ("topright", buttonsBackground, "topright", -8, -95)
changeColorButton:InstallCustomTexture()
@@ -392,11 +393,11 @@ local _
end
end
local flipButtonH = g:NewButton (buttonsBackground, nil, "$parentFlipButton", nil, 100, 20, flip, 1, nil, nil, "Flip Horizontal")
local flipButtonH = g:NewButton (buttonsBackground, nil, "$parentFlipButton", nil, 100, 20, flip, 1, nil, nil, Loc ["STRING_IMAGEEDIT_FLIPH"], 1)
flipButtonH:SetPoint ("topright", buttonsBackground, "topright", -8, -140)
flipButtonH:InstallCustomTexture()
--
local flipButtonV = g:NewButton (buttonsBackground, nil, "$parentFlipButton2", nil, 100, 20, flip, 2, nil, nil, "Flip Vertical")
local flipButtonV = g:NewButton (buttonsBackground, nil, "$parentFlipButton2", nil, 100, 20, flip, 2, nil, nil, Loc ["STRING_IMAGEEDIT_FLIPV"], 1)
flipButtonV:SetPoint ("topright", buttonsBackground, "topright", -8, -160)
flipButtonV:InstallCustomTexture()
@@ -432,7 +433,7 @@ local _
return window.callback_func (edit_texture.width, edit_texture.height, {edit_texture:GetVertexColor()}, edit_texture:GetAlpha(), coords, window.extra_param)
end
local acceptButton = g:NewButton (buttonsBackground, nil, "$parentAcceptButton", nil, 100, 20, window.accept, nil, nil, nil, "DONE")
local acceptButton = g:NewButton (buttonsBackground, nil, "$parentAcceptButton", nil, 100, 20, window.accept, nil, nil, nil, Loc ["STRING_IMAGEEDIT_DONE"], 1)
acceptButton:SetPoint ("topright", buttonsBackground, "topright", -8, -200)
acceptButton:InstallCustomTexture()
+2 -1
View File
@@ -338,7 +338,8 @@ local SliderMetaFunctions = {}
slider.thumb:SetAlpha (1)
if (slider.MyObject.have_tooltip and slider.MyObject.have_tooltip ~= Loc ["STRING_RIGHTCLICK_TYPEVALUE"]) then
GameCooltip:Reset()
--GameCooltip:Reset()
_detalhes:CooltipPreset (2)
GameCooltip:AddLine (slider.MyObject.have_tooltip)
GameCooltip:ShowCooltip (slider, "tooltip")
else