- Changed thw way to set the broker text.
- Fixed a problem while reporting a custom display. - New API: _detalhes:GetOpenedWindowsAmount()
This commit is contained in:
+1064
-1103
File diff suppressed because it is too large
Load Diff
@@ -179,25 +179,25 @@
|
||||
local total_script = _detalhes.custom_function_cache [instance.customName .. "Total"]
|
||||
|
||||
for index, actor in _ipairs (instance_container._ActorTable) do
|
||||
local percent, total
|
||||
local percent, ptotal
|
||||
if (percent_script) then
|
||||
percent = percent_script (actor.value, top, total, combat, instance)
|
||||
percent = percent_script (_math_floor (actor.value), top, total, combat, instance)
|
||||
else
|
||||
percent = _cstr ("%.1f", self.value / total * 100)
|
||||
percent = _cstr ("%.1f", _math_floor (actor.value) / total * 100)
|
||||
end
|
||||
|
||||
if (total_script) then
|
||||
local value = total_script (actor.value, top, total, combat, instance)
|
||||
local value = total_script (_math_floor (actor.value), top, total, combat, instance)
|
||||
if (type (value) == "number") then
|
||||
total = SelectedToKFunction (_, value)
|
||||
ptotal = SelectedToKFunction (_, value)
|
||||
else
|
||||
total = value
|
||||
ptotal = value
|
||||
end
|
||||
else
|
||||
total = SelectedToKFunction (_, self.value)
|
||||
ptotal = SelectedToKFunction (_, _math_floor (actor.value))
|
||||
end
|
||||
|
||||
actor.report_value = total .. " (" .. percent .. "%)"
|
||||
actor.report_value = ptotal .. " (" .. percent .. "%)"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -231,6 +231,16 @@ function _detalhes:GetFreeInstancesAmount()
|
||||
return _detalhes.instances_amount - #_detalhes.tabela_instancias
|
||||
end
|
||||
|
||||
function _detalhes:GetOpenedWindowsAmount()
|
||||
local amount = 0
|
||||
for _, instance in _detalhes:ListInstances() do
|
||||
if (instance:IsEnabled()) then
|
||||
amount = amount + 1
|
||||
end
|
||||
end
|
||||
return amount
|
||||
end
|
||||
|
||||
function _detalhes:GetNumRows()
|
||||
return self.rows_fit_in_window
|
||||
end
|
||||
|
||||
+224
-2
@@ -1246,6 +1246,220 @@
|
||||
_detalhes:CriarInstancia (_, true)
|
||||
end)
|
||||
|
||||
function _detalhes:OpenBrokerTextEditor()
|
||||
|
||||
if (not DetailsWindowOptionsBrokerTextEditor) then
|
||||
|
||||
local panel = _detalhes.gump:NewPanel (UIParent, nil, "DetailsWindowOptionsBrokerTextEditor", nil, 650, 200)
|
||||
panel:SetPoint ("center", UIParent, "center")
|
||||
panel:Hide()
|
||||
panel:SetFrameStrata ("FULLSCREEN")
|
||||
panel:SetBackdrop ({ bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 64, insets = {left=3, right=3, top=3, bottom=3}})
|
||||
panel:DisableGradient()
|
||||
panel:SetBackdropColor (0, 0, 0, 0)
|
||||
panel.locked = false
|
||||
|
||||
local bg_texture = _detalhes.gump:NewImage (panel, [[Interface\AddOns\Details\images\welcome]], 1, 1, "background")
|
||||
bg_texture:SetPoint ("topleft", panel, "topleft")
|
||||
bg_texture:SetPoint ("bottomright", panel, "bottomright")
|
||||
|
||||
local textentry = _detalhes.gump:NewSpecialLuaEditorEntry (panel.widget, 450, 180, "editbox", "$parentEntry", true)
|
||||
textentry:SetPoint ("topleft", panel.widget, "topleft", 10, -10)
|
||||
|
||||
textentry.editbox:SetScript ("OnTextChanged", function()
|
||||
local text = panel.widget.editbox:GetText()
|
||||
_detalhes.data_broker_text = text
|
||||
_detalhes:BrokerTick()
|
||||
if (_G.DetailsOptionsWindow) then
|
||||
_G.DetailsOptionsWindow19BrokerEntry.MyObject:SetText (_detalhes.data_broker_text)
|
||||
end
|
||||
end)
|
||||
|
||||
local option_selected = 1
|
||||
local onclick= function (_, _, value)
|
||||
option_selected = value
|
||||
end
|
||||
local AddOptions = {
|
||||
{label = Loc ["STRING_OPTIONS_DATABROKER_TEXT_ADD1"], value = 1, onclick = onclick},
|
||||
{label = Loc ["STRING_OPTIONS_DATABROKER_TEXT_ADD2"], value = 2, onclick = onclick},
|
||||
{label = Loc ["STRING_OPTIONS_DATABROKER_TEXT_ADD3"], value = 3, onclick = onclick},
|
||||
{label = Loc ["STRING_OPTIONS_DATABROKER_TEXT_ADD4"], value = 4, onclick = onclick},
|
||||
|
||||
{label = Loc ["STRING_OPTIONS_DATABROKER_TEXT_ADD5"], value = 5, onclick = onclick},
|
||||
{label = Loc ["STRING_OPTIONS_DATABROKER_TEXT_ADD6"], value = 6, onclick = onclick},
|
||||
{label = Loc ["STRING_OPTIONS_DATABROKER_TEXT_ADD7"], value = 7, onclick = onclick},
|
||||
{label = Loc ["STRING_OPTIONS_DATABROKER_TEXT_ADD8"], value = 8, onclick = onclick},
|
||||
|
||||
{label = Loc ["STRING_OPTIONS_DATABROKER_TEXT_ADD9"], value = 9, onclick = onclick},
|
||||
}
|
||||
local buildAddMenu = function()
|
||||
return AddOptions
|
||||
end
|
||||
|
||||
local d = _detalhes.gump:NewDropDown (panel, _, "$parentTextOptionsDropdown", "TextOptionsDropdown", 150, 20, buildAddMenu, 1)
|
||||
d:SetPoint ("topright", panel, "topright", -10, -14)
|
||||
--d:SetFrameStrata ("TOOLTIP")
|
||||
|
||||
local optiontable = {"{dmg}", "{dps}", "{dpos}", "{ddiff}", "{heal}", "{hps}", "{hpos}", "{hdiff}", "{time}"}
|
||||
|
||||
local add_button = _detalhes.gump:NewButton (panel, nil, "$parentAddButton", nil, 20, 20, function()
|
||||
textentry.editbox:Insert (optiontable [option_selected])
|
||||
end,
|
||||
nil, nil, nil, "<-")
|
||||
add_button:SetPoint ("right", d, "left", -2, 0)
|
||||
add_button:InstallCustomTexture()
|
||||
|
||||
|
||||
-- code author Saiket from http://www.wowinterface.com/forums/showpost.php?p=245759&postcount=6
|
||||
--- @return StartPos, EndPos of highlight in this editbox.
|
||||
local function GetTextHighlight ( self )
|
||||
local Text, Cursor = self:GetText(), self:GetCursorPosition();
|
||||
self:Insert( "" ); -- Delete selected text
|
||||
local TextNew, CursorNew = self:GetText(), self:GetCursorPosition();
|
||||
-- Restore previous text
|
||||
self:SetText( Text );
|
||||
self:SetCursorPosition( Cursor );
|
||||
local Start, End = CursorNew, #Text - ( #TextNew - CursorNew );
|
||||
self:HighlightText( Start, End );
|
||||
return Start, End;
|
||||
end
|
||||
|
||||
local StripColors;
|
||||
do
|
||||
local CursorPosition, CursorDelta;
|
||||
--- Callback for gsub to remove unescaped codes.
|
||||
local function StripCodeGsub ( Escapes, Code, End )
|
||||
if ( #Escapes % 2 == 0 ) then -- Doesn't escape Code
|
||||
if ( CursorPosition and CursorPosition >= End - 1 ) then
|
||||
CursorDelta = CursorDelta - #Code;
|
||||
end
|
||||
return Escapes;
|
||||
end
|
||||
end
|
||||
--- Removes a single escape sequence.
|
||||
local function StripCode ( Pattern, Text, OldCursor )
|
||||
CursorPosition, CursorDelta = OldCursor, 0;
|
||||
return Text:gsub( Pattern, StripCodeGsub ), OldCursor and CursorPosition + CursorDelta;
|
||||
end
|
||||
--- Strips Text of all color escape sequences.
|
||||
-- @param Cursor Optional cursor position to keep track of.
|
||||
-- @return Stripped text, and the updated cursor position if Cursor was given.
|
||||
function StripColors ( Text, Cursor )
|
||||
Text, Cursor = StripCode( "(|*)(|c%x%x%x%x%x%x%x%x)()", Text, Cursor );
|
||||
return StripCode( "(|*)(|r)()", Text, Cursor );
|
||||
end
|
||||
end
|
||||
|
||||
local COLOR_END = "|r";
|
||||
--- Wraps this editbox's selected text with the given color.
|
||||
local function ColorSelection ( self, ColorCode )
|
||||
local Start, End = GetTextHighlight( self );
|
||||
local Text, Cursor = self:GetText(), self:GetCursorPosition();
|
||||
if ( Start == End ) then -- Nothing selected
|
||||
--Start, End = Cursor, Cursor; -- Wrap around cursor
|
||||
return; -- Wrapping the cursor in a color code and hitting backspace crashes the client!
|
||||
end
|
||||
-- Find active color code at the end of the selection
|
||||
local ActiveColor;
|
||||
if ( End < #Text ) then -- There is text to color after the selection
|
||||
local ActiveEnd;
|
||||
local CodeEnd, _, Escapes, Color = 0;
|
||||
while ( true ) do
|
||||
_, CodeEnd, Escapes, Color = Text:find( "(|*)(|c%x%x%x%x%x%x%x%x)", CodeEnd + 1 );
|
||||
if ( not CodeEnd or CodeEnd > End ) then
|
||||
break;
|
||||
end
|
||||
if ( #Escapes % 2 == 0 ) then -- Doesn't escape Code
|
||||
ActiveColor, ActiveEnd = Color, CodeEnd;
|
||||
end
|
||||
end
|
||||
|
||||
if ( ActiveColor ) then
|
||||
-- Check if color gets terminated before selection ends
|
||||
CodeEnd = 0;
|
||||
while ( true ) do
|
||||
_, CodeEnd, Escapes = Text:find( "(|*)|r", CodeEnd + 1 );
|
||||
if ( not CodeEnd or CodeEnd > End ) then
|
||||
break;
|
||||
end
|
||||
if ( CodeEnd > ActiveEnd and #Escapes % 2 == 0 ) then -- Terminates ActiveColor
|
||||
ActiveColor = nil;
|
||||
break;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local Selection = Text:sub( Start + 1, End );
|
||||
-- Remove color codes from the selection
|
||||
local Replacement, CursorReplacement = StripColors( Selection, Cursor - Start );
|
||||
|
||||
self:SetText( ( "" ):join(
|
||||
Text:sub( 1, Start ),
|
||||
ColorCode, Replacement, COLOR_END,
|
||||
ActiveColor or "", Text:sub( End + 1 )
|
||||
) );
|
||||
|
||||
-- Restore cursor and highlight, adjusting for wrapper text
|
||||
Cursor = Start + CursorReplacement;
|
||||
if ( CursorReplacement > 0 ) then -- Cursor beyond start of color code
|
||||
Cursor = Cursor + #ColorCode;
|
||||
end
|
||||
if ( CursorReplacement >= #Replacement ) then -- Cursor beyond end of color
|
||||
Cursor = Cursor + #COLOR_END;
|
||||
end
|
||||
|
||||
self:SetCursorPosition( Cursor );
|
||||
-- Highlight selection and wrapper
|
||||
self:HighlightText( Start, #ColorCode + ( #Replacement - #Selection ) + #COLOR_END + End );
|
||||
end
|
||||
|
||||
local color_func = function (_, r, g, b, a)
|
||||
local hex = _detalhes:hex (a*255).._detalhes:hex (r*255).._detalhes:hex (g*255).._detalhes:hex (b*255)
|
||||
ColorSelection ( textentry.editbox, "|c" .. hex)
|
||||
end
|
||||
|
||||
local color_button = _detalhes.gump:NewColorPickButton (panel, "$parentButton5", nil, color_func)
|
||||
color_button:SetSize (80, 20)
|
||||
color_button:SetPoint ("topright", panel, "topright", -10, -102)
|
||||
color_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COLOR_TOOLTIP"]
|
||||
|
||||
local done = function()
|
||||
local text = panel.widget.editbox:GetText()
|
||||
_detalhes.data_broker_text = text
|
||||
if (_G.DetailsOptionsWindow) then
|
||||
_G.DetailsOptionsWindow19BrokerEntry.MyObject:SetText (_detalhes.data_broker_text)
|
||||
end
|
||||
_detalhes:BrokerTick()
|
||||
panel:Hide()
|
||||
end
|
||||
|
||||
local ok_button = _detalhes.gump:NewButton (panel, nil, "$parentButtonOk", nil, 80, 20, done, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_DONE"], 1)
|
||||
ok_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DONE_TOOLTIP"]
|
||||
ok_button:InstallCustomTexture()
|
||||
ok_button:SetPoint ("topright", panel, "topright", -10, -174)
|
||||
|
||||
local reset_button = _detalhes.gump:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText ("") end, nil, nil, nil, "Reset", 1)
|
||||
reset_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_RESET_TOOLTIP"]
|
||||
reset_button:InstallCustomTexture()
|
||||
reset_button:SetPoint ("topright", panel, "topright", -100, -152)
|
||||
|
||||
local cancel_button = _detalhes.gump:NewButton (panel, nil, "$parentDefaultCancel", nil, 80, 20, function() textentry.editbox:SetText (panel.default_text); done(); end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL"], 1)
|
||||
cancel_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL_TOOLTIP"]
|
||||
cancel_button:InstallCustomTexture()
|
||||
cancel_button:SetPoint ("topright", panel, "topright", -100, -174)
|
||||
|
||||
end
|
||||
|
||||
local panel = DetailsWindowOptionsBrokerTextEditor.MyObject
|
||||
|
||||
local text = _detalhes.data_broker_text:gsub ("||", "|")
|
||||
panel.default_text = text
|
||||
panel.widget.editbox:SetText (text)
|
||||
|
||||
panel:Show()
|
||||
end
|
||||
|
||||
--> row text editor
|
||||
local panel = _detalhes.gump:NewPanel (UIParent, nil, "DetailsWindowOptionsBarTextEditor", nil, 650, 200)
|
||||
panel:SetPoint ("center", UIParent, "center")
|
||||
@@ -1658,9 +1872,15 @@
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 2) then
|
||||
_detalhes.tabela_historico:resetar()
|
||||
|
||||
--> 3 = unknown
|
||||
--> 3 = show hide windows
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 3) then
|
||||
|
||||
local opened = _detalhes:GetOpenedWindowsAmount()
|
||||
|
||||
if (opened == 0) then
|
||||
_detalhes:ReabrirTodasInstancias()
|
||||
else
|
||||
_detalhes:ShutDownAllInstances()
|
||||
end
|
||||
end
|
||||
|
||||
elseif (button == "RightButton") then
|
||||
@@ -1727,6 +1947,8 @@
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP1"])
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 2) then
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP11"])
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 3) then
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP12"])
|
||||
end
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP2"])
|
||||
end,
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
<Frames>
|
||||
|
||||
<Frame name="$Parent_Border" parentKey="dropdownborder" hidden="true" frameStrata="DIALOG">
|
||||
<Frame name="$Parent_Border" parentKey="dropdownborder" hidden="true" frameStrata="FULLSCREEN">
|
||||
<Size x="150" y="170"/>
|
||||
|
||||
<Anchors>
|
||||
@@ -102,14 +102,14 @@
|
||||
|
||||
</Frame>
|
||||
|
||||
<ScrollFrame name="$Parent_ScrollFrame" parentKey="dropdownframe" hidden="true" frameStrata="DIALOG">
|
||||
<ScrollFrame name="$Parent_ScrollFrame" parentKey="dropdownframe" hidden="true" frameStrata="FULLSCREEN">
|
||||
<Size x="150" y="150"/>
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT" relativeTo="$Parent" relativePoint="BOTTOMLEFT" x="0" y="-10" />
|
||||
</Anchors>
|
||||
|
||||
<ScrollChild>
|
||||
<Frame name="$Parent_ScrollChild" frameStrata="DIALOG">
|
||||
<Frame name="$Parent_ScrollChild" frameStrata="DIALOG" parentKey="scrollchild">
|
||||
|
||||
<Size x="150" y="150"/>
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
|
||||
</Button>
|
||||
|
||||
<Button name="DetailsDropDownOptionTemplate" virtual="true" frameStrata="DIALOG">
|
||||
<Button name="DetailsDropDownOptionTemplate" virtual="true" frameStrata="TOOLTIP">
|
||||
<Size x="150" y="20" />
|
||||
|
||||
<Layers>
|
||||
|
||||
@@ -702,6 +702,7 @@ local default_profile = {
|
||||
|
||||
--> minimap
|
||||
minimap = {hide = false, radius = 160, minimapPos = 220, onclick_what_todo = 1, text_type = 1, text_format = 3},
|
||||
data_broker_text = "",
|
||||
--> horcorner
|
||||
hotcorner_topleft = {hide = false},
|
||||
|
||||
|
||||
+199
-37
@@ -264,50 +264,212 @@
|
||||
else
|
||||
return ToKFunctions [_detalhes.minimap.text_format] (_, combat.totals_grupo[2] / time)
|
||||
end
|
||||
end,
|
||||
-- elapsed time
|
||||
function()
|
||||
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
|
||||
local minutos, segundos = _math_floor (combat_time / 60), _math_floor (combat_time % 60)
|
||||
return minutos .. "m " .. segundos .. "s"
|
||||
end,
|
||||
-- player dps
|
||||
function()
|
||||
local player_actor = _detalhes.tabela_vigente (1, _detalhes.playername)
|
||||
if (player_actor) then
|
||||
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
|
||||
return Loc ["STRING_ATTRIBUTE_DAMAGE_DPS"] .. ": " .. ToKFunctions [_detalhes.minimap.text_format] (_, player_actor.total / combat_time)
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end,
|
||||
-- player hps
|
||||
function()
|
||||
local player_actor = _detalhes.tabela_vigente (2, _detalhes.playername)
|
||||
if (player_actor) then
|
||||
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
|
||||
return Loc ["STRING_ATTRIBUTE_HEAL_HPS"] .. ": " .. ToKFunctions [_detalhes.minimap.text_format] (_, player_actor.total / combat_time)
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end,
|
||||
end
|
||||
}
|
||||
|
||||
local broker_generic_func = function()
|
||||
local func = _detalhes.minimap.text_func
|
||||
if (func) then
|
||||
return func()
|
||||
|
||||
local get_combat_time = function()
|
||||
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
|
||||
local minutos, segundos = _math_floor (combat_time / 60), _math_floor (combat_time % 60)
|
||||
if (segundos < 10) then
|
||||
segundos = "0" .. segundos
|
||||
end
|
||||
return minutos .. "m " .. segundos .. "s"
|
||||
end
|
||||
|
||||
local get_damage_position = function()
|
||||
local damage_container = _detalhes.tabela_vigente [1]
|
||||
damage_container:SortByKey ("total")
|
||||
|
||||
local pos = 1
|
||||
for index, actor in ipairs (damage_container._ActorTable) do
|
||||
if (actor.grupo) then
|
||||
if (actor.nome == _detalhes.playername) then
|
||||
return pos
|
||||
end
|
||||
pos = pos + 1
|
||||
end
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
local get_heal_position = function()
|
||||
local heal_container = _detalhes.tabela_vigente [2]
|
||||
heal_container:SortByKey ("total")
|
||||
|
||||
local pos = 1
|
||||
for index, actor in ipairs (heal_container._ActorTable) do
|
||||
if (actor.grupo) then
|
||||
if (actor.nome == _detalhes.playername) then
|
||||
return pos
|
||||
end
|
||||
pos = pos + 1
|
||||
end
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
local get_damage_diff = function()
|
||||
local damage_container = _detalhes.tabela_vigente [1]
|
||||
damage_container:SortByKey ("total")
|
||||
|
||||
local first
|
||||
local first_index
|
||||
for index, actor in ipairs (damage_container._ActorTable) do
|
||||
if (actor.grupo) then
|
||||
first = actor
|
||||
first_index = index
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if (first) then
|
||||
if (first.nome == _detalhes.playername) then
|
||||
local second
|
||||
local container = damage_container._ActorTable
|
||||
for i = first_index+1, #container do
|
||||
if (container[i].grupo) then
|
||||
second = container[i]
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if (second) then
|
||||
local diff = first.total - second.total
|
||||
return "+" .. ToKFunctions [_detalhes.minimap.text_format] (_, diff)
|
||||
else
|
||||
return "0"
|
||||
end
|
||||
else
|
||||
local player = damage_container._NameIndexTable [_detalhes.playername]
|
||||
if (player) then
|
||||
player = damage_container._ActorTable [player]
|
||||
local diff = first.total - player.total
|
||||
return "-" .. ToKFunctions [_detalhes.minimap.text_format] (_, diff)
|
||||
else
|
||||
return ToKFunctions [_detalhes.minimap.text_format] (_, first.total)
|
||||
end
|
||||
end
|
||||
else
|
||||
return "0"
|
||||
end
|
||||
end
|
||||
|
||||
local get_heal_diff = function()
|
||||
local heal_container = _detalhes.tabela_vigente [2]
|
||||
heal_container:SortByKey ("total")
|
||||
|
||||
local first
|
||||
local first_index
|
||||
for index, actor in ipairs (heal_container._ActorTable) do
|
||||
if (actor.grupo) then
|
||||
first = actor
|
||||
first_index = index
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if (first) then
|
||||
if (first.nome == _detalhes.playername) then
|
||||
local second
|
||||
local container = heal_container._ActorTable
|
||||
for i = first_index+1, #container do
|
||||
if (container[i].grupo) then
|
||||
second = container[i]
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if (second) then
|
||||
local diff = first.total - second.total
|
||||
return "+" .. ToKFunctions [_detalhes.minimap.text_format] (_, diff)
|
||||
else
|
||||
return "0"
|
||||
end
|
||||
else
|
||||
local player = heal_container._NameIndexTable [_detalhes.playername]
|
||||
if (player) then
|
||||
player = heal_container._ActorTable [player]
|
||||
local diff = first.total - player.total
|
||||
return "-" .. ToKFunctions [_detalhes.minimap.text_format] (_, diff)
|
||||
else
|
||||
return ToKFunctions [_detalhes.minimap.text_format] (_, first.total)
|
||||
end
|
||||
end
|
||||
else
|
||||
return "0"
|
||||
end
|
||||
end
|
||||
|
||||
local get_player_dps = function()
|
||||
local damage_player = _detalhes.tabela_vigente (1, _detalhes.playername)
|
||||
if (damage_player) then
|
||||
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
|
||||
if (combat_time > 0) then
|
||||
return ToKFunctions [_detalhes.minimap.text_format] (_, damage_player.total / combat_time)
|
||||
else
|
||||
return 0
|
||||
end
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:BrokerTick()
|
||||
local func = broker_functions [_detalhes.minimap.text_type]
|
||||
if (func) then
|
||||
_detalhes.databroker.text = func()
|
||||
|
||||
local get_player_hps = function()
|
||||
local heal_player = _detalhes.tabela_vigente (2, _detalhes.playername)
|
||||
if (heal_player) then
|
||||
local combat_time = _detalhes.tabela_vigente:GetCombatTime()
|
||||
if (combat_time > 0) then
|
||||
return ToKFunctions [_detalhes.minimap.text_format] (_, heal_player.total / combat_time)
|
||||
else
|
||||
return 0
|
||||
end
|
||||
else
|
||||
_detalhes.databroker.text = broker_generic_func()
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
local get_player_damage = function()
|
||||
local damage_player = _detalhes.tabela_vigente(1, _detalhes.playername)
|
||||
if (damage_player) then
|
||||
return ToKFunctions [_detalhes.minimap.text_format] (_, damage_player.total)
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
local get_player_heal = function()
|
||||
local heal_player = _detalhes.tabela_vigente (2, _detalhes.playername)
|
||||
if (heal_player) then
|
||||
return ToKFunctions [_detalhes.minimap.text_format] (_, heal_player.total)
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
local parse_broker_text = function()
|
||||
|
||||
local text = _detalhes.data_broker_text
|
||||
if (text == "") then
|
||||
return
|
||||
end
|
||||
|
||||
text = text:gsub ("{dmg}", get_player_damage)
|
||||
text = text:gsub ("{dps}", get_player_dps)
|
||||
text = text:gsub ("{heal}", get_player_heal)
|
||||
text = text:gsub ("{hps}", get_player_hps)
|
||||
text = text:gsub ("{time}", get_combat_time)
|
||||
text = text:gsub ("{dpos}", get_damage_position)
|
||||
text = text:gsub ("{hpos}", get_heal_position)
|
||||
text = text:gsub ("{ddiff}", get_damage_diff)
|
||||
text = text:gsub ("{hdiff}", get_heal_diff)
|
||||
|
||||
return text
|
||||
end
|
||||
|
||||
function _detalhes:BrokerTick()
|
||||
_detalhes.databroker.text = parse_broker_text()
|
||||
end
|
||||
|
||||
+47
-39
@@ -1399,11 +1399,13 @@ function window:CreateFrame19()
|
||||
local on_select = function (_, _, option)
|
||||
_detalhes.minimap.onclick_what_todo = option
|
||||
end
|
||||
local build_menu = function()
|
||||
return {
|
||||
local menu = {
|
||||
{value = 1, label = Loc ["STRING_OPTIONS_MINIMAP_ACTION1"], onclick = on_select, icon = [[Interface\FriendsFrame\FriendsFrameScrollIcon]]},
|
||||
{value = 2, label = Loc ["STRING_OPTIONS_MINIMAP_ACTION2"], onclick = on_select, icon = [[Interface\Buttons\UI-GuildButton-PublicNote-Up]], iconcolor = {1, .8, 0, 1}},
|
||||
{value = 3, label = Loc ["STRING_OPTIONS_MINIMAP_ACTION3"], onclick = on_select, icon = [[Interface\Buttons\UI-CheckBox-Up]], texcoord = {0.1, 0.9, 0.1, 0.9}},
|
||||
}
|
||||
local build_menu = function()
|
||||
return menu
|
||||
end
|
||||
local dropdown = g:NewDropDown (frame19, _, "$parentMinimapActionDropdown", "minimapActionDropdown", 160, 20, build_menu, _detalhes.minimap.onclick_what_todo)
|
||||
dropdown.onenter_backdrop = dropdown_backdrop_onenter
|
||||
@@ -1434,40 +1436,47 @@ function window:CreateFrame19()
|
||||
g:NewLabel (frame19, _, "$parentHotcornerAnchor", "brokerAnchorLabel", Loc ["STRING_OPTIONS_DATABROKER"], "GameFontNormal")
|
||||
|
||||
--broker text
|
||||
do
|
||||
g:NewLabel (frame19, _, "$parentBrokerTextLabel", "brokerTextLabel", Loc ["STRING_OPTIONS_DATABROKER_TEXT"], "GameFontHighlightLeft")
|
||||
local on_select = function (_, _, option)
|
||||
_detalhes.minimap.text_type = option
|
||||
end
|
||||
local build_menu = function()
|
||||
return {
|
||||
--raid dps
|
||||
{value = 1, label = Loc ["STRING_OPTIONS_DATABROKER_TEXT1"], onclick = on_select, icon = "Interface\\AddOns\\Details\\images\\atributos_icones", texcoord = {0, 0.125, 0, 1}},
|
||||
--raid hps
|
||||
{value = 2, label = Loc ["STRING_OPTIONS_DATABROKER_TEXT2"], onclick = on_select, icon = "Interface\\AddOns\\Details\\images\\atributos_icones", texcoord = {0.125, 0.25, 0, 1}},
|
||||
--combat time
|
||||
{value = 3, label = Loc ["STRING_OPTIONS_DATABROKER_TEXT3"], onclick = on_select, icon = [[Interface\COMMON\mini-hourglass]], texcoord = {0, 1, 0, 1}},
|
||||
--player dps
|
||||
{value = 4, label = Loc ["STRING_OPTIONS_DATABROKER_TEXT4"], onclick = on_select, icon = _detalhes.sub_atributos[1].icones[2][1], texcoord = _detalhes.sub_atributos[1].icones[2][2]},
|
||||
--player hps
|
||||
{value = 5, label = Loc ["STRING_OPTIONS_DATABROKER_TEXT5"], onclick = on_select, icon = _detalhes.sub_atributos[2].icones[2][1], texcoord = _detalhes.sub_atributos[2].icones[2][2]},
|
||||
}
|
||||
end
|
||||
local dropdown = g:NewDropDown (frame19, _, "$parentBrokerTextDropdown", "brokerTextDropdown", 160, 20, build_menu, _detalhes.minimap.text_type)
|
||||
dropdown.onenter_backdrop = dropdown_backdrop_onenter
|
||||
dropdown.onleave_backdrop = dropdown_backdrop_onleave
|
||||
dropdown:SetBackdrop (dropdown_backdrop)
|
||||
dropdown:SetBackdropColor (unpack (dropdown_backdrop_onleave))
|
||||
|
||||
frame19.brokerTextDropdown:SetPoint ("left", frame19.brokerTextLabel, "right", 2, 0)
|
||||
window:CreateLineBackground2 (frame19, "brokerTextDropdown", "brokerTextLabel", Loc ["STRING_OPTIONS_DATABROKER_TEXT_DESC"])
|
||||
end
|
||||
g:NewLabel (frame19, _, "$parentBrokerTextLabel", "brokerTextLabel", Loc ["STRING_OPTIONS_DATABROKER_TEXT"], "GameFontHighlightLeft")
|
||||
|
||||
local broker_entry = g:NewTextEntry (frame19, _, "$parentBrokerEntry", "BrokerTextEntry", 180, 20)
|
||||
broker_entry:SetPoint ("left", frame19.brokerTextLabel, "right", 2, -1)
|
||||
broker_entry.text = _detalhes.data_broker_text
|
||||
|
||||
broker_entry:SetHook ("OnTextChanged", function (self, byUser)
|
||||
_detalhes.data_broker_text = broker_entry.text
|
||||
_detalhes:BrokerTick()
|
||||
end)
|
||||
|
||||
window:CreateLineBackground2 (frame19, "BrokerTextEntry", "brokerTextLabel", Loc ["STRING_OPTIONS_DATABROKER_TEXT1_DESC"])
|
||||
|
||||
local editor = g:NewButton (broker_entry, _, "$parentOpenEditorButton", "OpenEditorButton", 22, 22, function()
|
||||
_detalhes:OpenBrokerTextEditor()
|
||||
end)
|
||||
editor:SetPoint ("left", broker_entry, "right", 2, 1)
|
||||
editor:SetNormalTexture ([[Interface\HELPFRAME\OpenTicketIcon]])
|
||||
editor:SetHighlightTexture ([[Interface\HELPFRAME\OpenTicketIcon]])
|
||||
editor:SetPushedTexture ([[Interface\HELPFRAME\OpenTicketIcon]])
|
||||
editor:GetNormalTexture():SetDesaturated (true)
|
||||
editor.tooltip = Loc ["STRING_OPTIONS_OPEN_TEXT_EDITOR"]
|
||||
|
||||
local clear = g:NewButton (broker_entry, _, "$parentResetButton", "ResetButton", 20, 20, function()
|
||||
broker_entry.text = ""
|
||||
_detalhes:BrokerTick()
|
||||
end)
|
||||
|
||||
clear:SetPoint ("left", editor, "right", 0, 0)
|
||||
clear:SetNormalTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Down]])
|
||||
clear:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]])
|
||||
clear:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]])
|
||||
clear:GetNormalTexture():SetDesaturated (true)
|
||||
clear.tooltip = Loc ["STRING_OPTIONS_RESET_TO_DEFAULT"]
|
||||
|
||||
--number format
|
||||
g:NewLabel (frame19, _, "$parentBrokerNumberAbbreviateLabel", "BrokerNumberAbbreviateLabel", Loc ["STRING_OPTIONS_PS_ABBREVIATE"], "GameFontHighlightLeft")
|
||||
--
|
||||
local onSelectTimeAbbreviation = function (_, _, abbreviationtype)
|
||||
_detalhes.minimap.text_format = abbreviationtype
|
||||
_detalhes:BrokerTick()
|
||||
end
|
||||
local icon = [[Interface\COMMON\mini-hourglass]]
|
||||
local iconcolor = {1, 1, 1, .5}
|
||||
@@ -5053,7 +5062,7 @@ function window:CreateFrame5()
|
||||
frame5.TextBarEditorButton:SetHighlightTexture ([[Interface\HELPFRAME\OpenTicketIcon]])
|
||||
frame5.TextBarEditorButton:SetPushedTexture ([[Interface\HELPFRAME\OpenTicketIcon]])
|
||||
frame5.TextBarEditorButton:GetNormalTexture():SetDesaturated (true)
|
||||
frame5.TextBarEditorButton.tooltip = "Row Text Editor"
|
||||
frame5.TextBarEditorButton.tooltip = Loc ["STRING_OPTIONS_OPEN_ROWTEXT_EDITOR"]
|
||||
|
||||
g:NewButton (frame5.cutomRightTextEntry, _, "$parentResetCustomRightTextButton", "customRightTextButton", 20, 20, function()
|
||||
frame5.cutomRightTextEntry.text = _detalhes.instance_defaults.row_info.textR_custom_text
|
||||
@@ -5065,7 +5074,7 @@ function window:CreateFrame5()
|
||||
frame5.customRightTextButton:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]])
|
||||
frame5.customRightTextButton:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]])
|
||||
frame5.customRightTextButton:GetNormalTexture():SetDesaturated (true)
|
||||
frame5.customRightTextButton.tooltip = "Reset to Default"
|
||||
frame5.customRightTextButton.tooltip = Loc ["STRING_OPTIONS_RESET_TO_DEFAULT"]
|
||||
|
||||
--> left text customization
|
||||
|
||||
@@ -5143,7 +5152,7 @@ function window:CreateFrame5()
|
||||
frame5.TextBarEditorButton:SetHighlightTexture ([[Interface\HELPFRAME\OpenTicketIcon]])
|
||||
frame5.TextBarEditorButton:SetPushedTexture ([[Interface\HELPFRAME\OpenTicketIcon]])
|
||||
frame5.TextBarEditorButton:GetNormalTexture():SetDesaturated (true)
|
||||
frame5.TextBarEditorButton.tooltip = "Row Text Editor"
|
||||
frame5.TextBarEditorButton.tooltip = Loc ["STRING_OPTIONS_OPEN_ROWTEXT_EDITOR"]
|
||||
|
||||
g:NewButton (frame5.cutomLeftTextEntry, _, "$parentResetCustomLeftTextButton", "customLeftTextButton", 20, 20, function()
|
||||
frame5.cutomLeftTextEntry.text = _detalhes.instance_defaults.row_info.textL_custom_text
|
||||
@@ -5155,7 +5164,7 @@ function window:CreateFrame5()
|
||||
frame5.customLeftTextButton:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]])
|
||||
frame5.customLeftTextButton:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]])
|
||||
frame5.customLeftTextButton:GetNormalTexture():SetDesaturated (true)
|
||||
frame5.customLeftTextButton.tooltip = "Reset to Default"
|
||||
frame5.customLeftTextButton.tooltip = Loc ["STRING_OPTIONS_RESET_TO_DEFAULT"]
|
||||
|
||||
--> anchors
|
||||
|
||||
@@ -7141,7 +7150,7 @@ function window:CreateFrame11()
|
||||
reset_next:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]])
|
||||
reset_next:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]])
|
||||
reset_next:GetNormalTexture():SetDesaturated (true)
|
||||
reset_next.tooltip = "Reset to Default"
|
||||
reset_next.tooltip = Loc ["STRING_OPTIONS_RESET_TO_DEFAULT"]
|
||||
|
||||
--campo para digitar a fala customizada
|
||||
g:NewLabel (frame11, _, "$parentInterruptsCustomLabel", "InterruptsCustomLabel", Loc ["STRING_OPTIONS_RT_INTERRUPTS_CUSTOM"], "GameFontHighlightLeft")
|
||||
@@ -7163,7 +7172,7 @@ function window:CreateFrame11()
|
||||
reset_custom:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]])
|
||||
reset_custom:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]])
|
||||
reset_custom:GetNormalTexture():SetDesaturated (true)
|
||||
reset_custom.tooltip = "Reset to Default"
|
||||
reset_custom.tooltip = Loc ["STRING_OPTIONS_RESET_TO_DEFAULT"]
|
||||
|
||||
local test_custom_text = g:NewButton (frame11.InterruptsCustomEntry, _, "$parentTestCustomPhraseButton", "TestCustomPhraseButton", 16, 16, function()
|
||||
local text = frame11.InterruptsCustomEntry.text
|
||||
@@ -7242,7 +7251,7 @@ function window:CreateFrame11()
|
||||
reset_custom:SetHighlightTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GROUPLOOT-PASS-HIGHLIGHT]])
|
||||
reset_custom:SetPushedTexture ([[Interface\Glues\LOGIN\Glues-CheckBox-Check]] or [[Interface\Buttons\UI-GroupLoot-Pass-Up]])
|
||||
reset_custom:GetNormalTexture():SetDesaturated (true)
|
||||
reset_custom.tooltip = "Reset to Default"
|
||||
reset_custom.tooltip = Loc ["STRING_OPTIONS_RESET_TO_DEFAULT"]
|
||||
|
||||
local test_custom_text = g:NewButton (frame11.CooldownCustomEntry, _, "$parentTestCustomPhraseButton", "TestCustomPhraseButton", 16, 16, function()
|
||||
local text = frame11.CooldownCustomEntry.text
|
||||
@@ -8272,7 +8281,7 @@ function window:update_all (editing_instance)
|
||||
_G.DetailsOptionsWindow19MinimapSlider.MyObject:SetValue (not _detalhes.minimap.hide)
|
||||
_G.DetailsOptionsWindow19MinimapActionDropdown.MyObject:Select (_detalhes.minimap.onclick_what_todo)
|
||||
|
||||
_G.DetailsOptionsWindow19BrokerTextDropdown.MyObject:Select (_detalhes.minimap.text_type)
|
||||
_G.DetailsOptionsWindow19BrokerEntry.MyObject:SetText (_detalhes.data_broker_text)
|
||||
_G.DetailsOptionsWindow19BrokerNumberAbbreviateDropdown.MyObject:Select (_detalhes.minimap.text_format)
|
||||
|
||||
if (not _G.HotCorners) then
|
||||
@@ -8448,4 +8457,3 @@ end
|
||||
window:Show()
|
||||
|
||||
end --> OpenOptionsWindow
|
||||
|
||||
|
||||
@@ -435,6 +435,8 @@ function _G._detalhes:Start()
|
||||
_detalhes:OpenWelcomeWindow()
|
||||
end
|
||||
|
||||
_detalhes:BrokerTick()
|
||||
|
||||
--test realtime dps
|
||||
--[[
|
||||
local real_time_frame = CreateFrame ("frame", nil, UIParent)
|
||||
|
||||
Reference in New Issue
Block a user