- 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
+118 -1
View File
@@ -411,4 +411,121 @@
if (send_to_guild) then
_detalhes:SendGuildData (_detalhes.network.ids.VERSION_CHECK, _detalhes.build_counter)
end
end
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> sharer
--> entrar no canal após logar no servidor
function _detalhes:EnterChatChannel()
if (_detalhes.schedule_chat_leave) then
_detalhes:CancelTimer (_detalhes.schedule_chat_leave)
end
_detalhes.schedule_chat_enter = nil
local realm = GetRealmName()
realm = realm or ""
if (realm ~= "Azralon") then
return
end
--> room name
local room_name = "Details"
--> already in?
for room_index = 1, 10 do
local _, name = GetChannelName (room_index)
if (name == room_name) then
return --> already in the room
end
end
--> enter
--print ("entrando no canal")
JoinChannelByName (room_name)
end
function _detalhes:LeaveChatChannel()
if (_detalhes.schedule_chat_enter) then
_detalhes:CancelTimer (_detalhes.schedule_chat_enter)
end
_detalhes.schedule_chat_leave = nil
local realm = GetRealmName()
realm = realm or ""
if (realm ~= "Azralon") then
return
end
--> room name
local room_name = "Details"
local is_in = false
--> already in?
for room_index = 1, 10 do
local _, name = GetChannelName (room_index)
if (name == room_name) then
is_in = true
end
end
if (is_in) then
--print ("saindo do canal")
LeaveChannelByName (room_name)
end
end
--> sair do canal quando estiver em grupo
local event_handler = {Enabled = true, __enabled = true, teste = " teste"}
function event_handler:ZONE_TYPE_CHANGED (zone_type)
--print (zone_type)
if (zone_type == "none") then
if (not _detalhes:InGroup()) then
if (_detalhes.schedule_chat_leave) then
_detalhes:CancelTimer (_detalhes.schedule_chat_leave)
end
if (not _detalhes.schedule_chat_enter) then
_detalhes.schedule_chat_enter = _detalhes:ScheduleTimer ("EnterChatChannel", 2)
end
end
else
if (_detalhes:InGroup()) then
if (_detalhes.schedule_chat_enter) then
_detalhes:CancelTimer (_detalhes.schedule_chat_enter)
end
if (not _detalhes.schedule_chat_leave) then
_detalhes.schedule_chat_leave = _detalhes:ScheduleTimer ("LeaveChatChannel", 2)
end
end
end
end
function event_handler:GROUP_ONENTER()
if (zone_type ~= "none") then
if (_detalhes.schedule_chat_enter) then
_detalhes:CancelTimer (_detalhes.schedule_chat_enter)
end
if (not _detalhes.schedule_chat_leave) then
_detalhes.schedule_chat_leave = _detalhes:ScheduleTimer ("LeaveChatChannel", 2)
end
end
end
function event_handler:GROUP_ONLEAVE()
if (zone_type == "none") then
if (_detalhes.schedule_chat_leave) then
_detalhes:CancelTimer (_detalhes.schedule_chat_leave)
end
if (not _detalhes.schedule_chat_enter) then
_detalhes.schedule_chat_enter = _detalhes:ScheduleTimer ("EnterChatChannel", 2)
end
end
end
_detalhes:RegisterEvent (event_handler, "GROUP_ONENTER", "GROUP_ONENTER")
_detalhes:RegisterEvent (event_handler, "GROUP_ONLEAVE", "GROUP_ONLEAVE")
_detalhes:RegisterEvent (event_handler, "ZONE_TYPE_CHANGED", "ZONE_TYPE_CHANGED")
+53 -37
View File
@@ -2239,43 +2239,9 @@
end
end
--parser:safe_sort_dead (esta_morte)
_table_sort (esta_morte, _detalhes.Sort4)
--[[
_table_sort (esta_morte, function (table1, table2)
if (not table1) then
print (1)
return false
elseif (not table2) then
print (2)
return false
elseif (table1 [4] == table2 [4]) then --> os 2 tem o mesmo tempo
if (type (table1 [1]) == "boolean" and table1 [1] and type (table2 [1]) == "boolean" and table2) then --> ambos sao dano
print (3)
return table1 [5] > table2 [5] --> joga pra cima quem tem mais vida
elseif (type (table1 [1]) == "boolean" and not table1 [1] and type (table2 [1]) == "boolean" and not table2) then --> ambos sao cura
print (4)
return table1 [5] < table2 [5] --> joga pra cima quem tem menos vida
else
if (type (table1 [1]) == "boolean" and table1 and type (table2 [1]) == "boolean" and table2) then --> primeiro é dano e segundo é heal
print (5)
return true --> passa o dano pra frente
elseif (type (table2 [1]) == "boolean" and table2 and type (table1 [1]) == "boolean" and table1) then --> primeiro é heal e o segundo é dano
print (6)
return false --> passa o heal pra frente
else
print (7)
return table1 [5] < table2 [5] --> passa quem tem menos vida
end
end
else
print (8)
return table1 [4] < table2 [4]
end
end)
--]]
if (_hook_deaths) then
--> send event to registred functions
local death_at = _tempo - _current_combat.start_time
@@ -2331,6 +2297,57 @@
end
end
local sort_dead = function (table1, table2)
if (not table1) then
--print (1)
return false
elseif (not table2) then
--print (2)
return false
elseif (table1 [4] == table2 [4]) then --> os 2 tem o mesmo tempo
if (type (table1 [1]) == "boolean" and table1 [1] and type (table2 [1]) == "boolean" and table2) then --> ambos sao dano
--print (3)
return table1 [5] > table2 [5] --> joga pra cima quem tem mais vida
elseif (type (table1 [1]) == "boolean" and not table1 [1] and type (table2 [1]) == "boolean" and not table2) then --> ambos sao cura
--print (4)
return table1 [5] < table2 [5] --> joga pra cima quem tem menos vida
else
if (type (table1 [1]) == "boolean" and table1 and type (table2 [1]) == "boolean" and table2) then --> primeiro é dano e segundo é heal
--print (5)
return true --> passa o dano pra frente
elseif (type (table2 [1]) == "boolean" and table2 and type (table1 [1]) == "boolean" and table1) then --> primeiro é heal e o segundo é dano
--print (6)
return false --> passa o heal pra frente
else
--print (7)
return table1 [5] < table2 [5] --> passa quem tem menos vida
end
end
else
--print (8)
return table1 [4] < table2 [4]
end
end
local function sort_error (error)
return error
end
local death_table
function do_death_sort()
_table_sort (death_table, sort_dead)
end
function parser:safe_sort_dead (t)
death_table = t
local status, error = xpcall (do_death_sort, sort_error)
if (not status) then
_table_sort (t, _detalhes.Sort4)
end
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core
@@ -2517,7 +2534,6 @@
end
function _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA (...)
local zoneName, zoneType, _, _, _, _, _, zoneMapID = _GetInstanceInfo()
if (_detalhes.last_zone_type ~= zoneType) then
_detalhes:SendEvent ("ZONE_TYPE_CHANGED", nil, zoneType)
_detalhes.last_zone_type = zoneType
+1 -1
View File
@@ -126,7 +126,7 @@
end
--> no changes
function _detalhes:NoToK (numero)
return numero
return _math_floor (numero)
end
-- thanks http://richard.warburton.it
function _detalhes:comma_value (n)
+11 -9
View File
@@ -963,6 +963,8 @@
f:Hide()
end
--> feed back request
function _detalhes:ShowFeedbackRequestWindow()
local feedback_frame = CreateFrame ("FRAME", "DetailsFeedbackWindow", UIParent, "ButtonFrameTemplate")
@@ -1048,7 +1050,7 @@
end
--> interface menu
--> interface menu
local f = CreateFrame ("frame", "DetailsInterfaceOptionsPanel", UIParent)
f.name = "Details"
f.logo = f:CreateTexture (nil, "overlay")
@@ -1077,7 +1079,7 @@
_detalhes:CriarInstancia (_, true)
end)
--> row text editor
--> row text editor
local panel = _detalhes.gump:NewPanel (UIParent, nil, "DetailsWindowOptionsBarTextEditor", nil, 650, 200)
panel:SetPoint ("center", UIParent, "center")
panel:Hide()
@@ -1107,9 +1109,9 @@
local textentry = _detalhes.gump:NewSpecialLuaEditorEntry (panel.widget, 450, 180, "editbox", "$parentEntry", true)
textentry:SetPoint ("topleft", panel.widget, "topleft", 10, -10)
local arg1_button = _detalhes.gump:NewButton (panel, nil, "$parentButton1", nil, 80, 20, function() textentry.editbox:Insert ("{data1}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "1"))
local arg2_button = _detalhes.gump:NewButton (panel, nil, "$parentButton2", nil, 80, 20, function() textentry.editbox:Insert ("{data2}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "2"))
local arg3_button = _detalhes.gump:NewButton (panel, nil, "$parentButton3", nil, 80, 20, function() textentry.editbox:Insert ("{data3}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "3"))
local arg1_button = _detalhes.gump:NewButton (panel, nil, "$parentButton1", nil, 80, 20, function() textentry.editbox:Insert ("{data1}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "1"), 1)
local arg2_button = _detalhes.gump:NewButton (panel, nil, "$parentButton2", nil, 80, 20, function() textentry.editbox:Insert ("{data2}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "2"), 1)
local arg3_button = _detalhes.gump:NewButton (panel, nil, "$parentButton3", nil, 80, 20, function() textentry.editbox:Insert ("{data3}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "3"), 1)
arg1_button:SetPoint ("topright", panel, "topright", -10, -14)
arg2_button:SetPoint ("topright", panel, "topright", -10, -36)
arg3_button:SetPoint ("topright", panel, "topright", -10, -58)
@@ -1230,7 +1232,7 @@
ColorSelection ( textentry.editbox, "|c" .. hex)
end
local func_button = _detalhes.gump:NewButton (panel, nil, "$parentButton4", nil, 80, 20, function() textentry.editbox:Insert ("{func local player = ...; return 0;}") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC"])
local func_button = _detalhes.gump:NewButton (panel, nil, "$parentButton4", nil, 80, 20, function() textentry.editbox:Insert ("{func local player = ...; return 0;}") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC"], 1)
local color_button = _detalhes.gump:NewColorPickButton (panel, "$parentButton5", nil, color_func)
color_button:SetSize (80, 20)
func_button:SetPoint ("topright", panel, "topright", -10, -80)
@@ -1276,17 +1278,17 @@
panel:Hide()
end
local ok_button = _detalhes.gump:NewButton (panel, nil, "$parentButtonOk", nil, 80, 20, done, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_DONE"])
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 (panel.default) end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_RESET"])
local reset_button = _detalhes.gump:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText (panel.default) end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_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"])
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)