- Removed keybinds for Open and Close, added toggle instead.
- Added slash command 'toggle'. - Improved 'Align with right chat' tool, now it also supports Forced Square skin.
This commit is contained in:
+14
-76
@@ -11,88 +11,26 @@
|
||||
DetailsKeyBindScrollUp()
|
||||
</Binding>
|
||||
|
||||
<Binding name="DETAILS_REOPEN_WINDOW1" description="Reopen window 1." header="DETAILS_KEYBIND_WINDOW_CONTROL" category="Details!">
|
||||
local instance1 = _detalhes.tabela_instancias [1];
|
||||
if (instance1 and not instance1:IsEnabled()) then
|
||||
instance1:EnableInstance();
|
||||
elseif (not instance1) then
|
||||
_detalhes:Msg ("Window 1 isn't created yet.");
|
||||
end
|
||||
<Binding name="DETAILS_TOGGLE_ALL" description="open or close all windows" header="DETAILS_KEYBIND_WINDOW_CONTROL" category="Details!">
|
||||
_detalhes:ToggleWindows()
|
||||
</Binding>
|
||||
<Binding name="DETAILS_REOPEN_WINDOW2" description="Reopen window 2." category="Details!">
|
||||
local instance2 = _detalhes.tabela_instancias [2];
|
||||
if (instance2 and not instance2:IsEnabled()) then
|
||||
instance2:EnableInstance();
|
||||
elseif (not instance2) then
|
||||
_detalhes:Msg ("Window 2 isn't created yet.");
|
||||
end
|
||||
|
||||
<Binding name="DETAILS_TOOGGLE_WINDOW1" description="Toggle window 1." header="DETAILS_KEYBIND_WINDOW_CONTROL" category="Details!">
|
||||
_detalhes:ToggleWindow (1)
|
||||
</Binding>
|
||||
<Binding name="DETAILS_REOPEN_WINDOW3" description="Reopen window 3." category="Details!">
|
||||
local instance3 = _detalhes.tabela_instancias [3];
|
||||
if (instance3 and not instance3:IsEnabled()) then
|
||||
instance3:EnableInstance();
|
||||
elseif (not instance3) then
|
||||
_detalhes:Msg ("Window 3 isn't created yet.");
|
||||
end
|
||||
<Binding name="DETAILS_TOOGGLE_WINDOW2" description="Toggle window 2." category="Details!">
|
||||
_detalhes:ToggleWindow (2)
|
||||
</Binding>
|
||||
<Binding name="DETAILS_REOPEN_WINDOW4" description="Reopen window 4." category="Details!">
|
||||
local instance4 = _detalhes.tabela_instancias [4];
|
||||
if (instance4 and not instance4:IsEnabled()) then
|
||||
instance4:EnableInstance();
|
||||
elseif (not instance4) then
|
||||
_detalhes:Msg ("Window 4 isn't created yet.");
|
||||
end
|
||||
<Binding name="DETAILS_TOOGGLE_WINDOW3" description="Toggle window 3." category="Details!">
|
||||
_detalhes:ToggleWindow (3)
|
||||
</Binding>
|
||||
<Binding name="DETAILS_REOPEN_WINDOW5" description="Reopen window 5." category="Details!">
|
||||
local instance5 = _detalhes.tabela_instancias [5];
|
||||
if (instance5 and not instance5:IsEnabled()) then
|
||||
instance5:EnableInstance();
|
||||
elseif (not instance5) then
|
||||
_detalhes:Msg ("Window 5 isn't created yet.");
|
||||
end
|
||||
<Binding name="DETAILS_TOOGGLE_WINDOW4" description="Toggle window 4." category="Details!">
|
||||
_detalhes:ToggleWindow (4)
|
||||
</Binding>
|
||||
|
||||
<Binding name="DETAILS_CLOSE_WINDOW1" description="Close window 1." category="Details!">
|
||||
local instance1 = _detalhes.tabela_instancias [1];
|
||||
if (instance1 and instance1:IsEnabled()) then
|
||||
instance1:ShutDown();
|
||||
else
|
||||
_detalhes:Msg ("Window 1 isn't open.");
|
||||
end
|
||||
<Binding name="DETAILS_TOOGGLE_WINDOW5" description="Toggle window 5." category="Details!">
|
||||
_detalhes:ToggleWindow (5)
|
||||
</Binding>
|
||||
<Binding name="DETAILS_CLOSE_WINDOW2" description="Close window 2." category="Details!">
|
||||
local instance2 = _detalhes.tabela_instancias [2];
|
||||
if (instance2 and instance2:IsEnabled()) then
|
||||
instance2:ShutDown();
|
||||
else
|
||||
_detalhes:Msg ("Window 2 isn't open.");
|
||||
end
|
||||
</Binding>
|
||||
<Binding name="DETAILS_CLOSE_WINDOW3" description="Close window 3." category="Details!">
|
||||
local instance3 = _detalhes.tabela_instancias [3];
|
||||
if (instance3 and instance3:IsEnabled()) then
|
||||
instance3:ShutDown();
|
||||
else
|
||||
_detalhes:Msg ("Window 3 isn't open.");
|
||||
end
|
||||
</Binding>
|
||||
<Binding name="DETAILS_CLOSE_WINDOW4" description="Close window 4." category="Details!">
|
||||
local instance4 = _detalhes.tabela_instancias [4];
|
||||
if (instance4 and instance4:IsEnabled()) then
|
||||
instance4:ShutDown();
|
||||
else
|
||||
_detalhes:Msg ("Window 4 isn't open.");
|
||||
end
|
||||
</Binding>
|
||||
<Binding name="DETAILS_CLOSE_WINDOW5" description="Close window 5." category="Details!">
|
||||
local instance5 = _detalhes.tabela_instancias [5];
|
||||
if (instance5 and instance5:IsEnabled()) then
|
||||
instance5:ShutDown();
|
||||
else
|
||||
_detalhes:Msg ("Window 5 isn't open.");
|
||||
end
|
||||
</Binding>
|
||||
|
||||
|
||||
|
||||
<Binding name="DETAILS_BOOKMARK1" description="Change the display on the first window to bookmark #1." header="DETAILS_KEYBIND_BOOKMARK" category="Details!">
|
||||
DetailsChangeDisplayFromBookmark (1);
|
||||
|
||||
@@ -384,6 +384,48 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:ToggleWindow (index)
|
||||
local window = _detalhes:GetInstance (index)
|
||||
|
||||
if (window and _getmetatable (window)) then
|
||||
if (window:IsEnabled()) then
|
||||
window:ShutDown()
|
||||
else
|
||||
window:EnableInstance()
|
||||
|
||||
if (window.meu_id == 1) then
|
||||
local instance2 = _detalhes:GetInstance(2)
|
||||
if (instance2 and instance2:IsEnabled()) then
|
||||
_detalhes.move_janela_func (instance2.baseframe, true, instance2, true)
|
||||
_detalhes.move_janela_func (instance2.baseframe, false, instance2, true)
|
||||
end
|
||||
|
||||
elseif (window.meu_id == 2) then
|
||||
_detalhes.move_janela_func (window.baseframe, true, window, true)
|
||||
_detalhes.move_janela_func (window.baseframe, false, window, true)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:ToggleWindows()
|
||||
local instance = _detalhes:GetInstance (1)
|
||||
if (instance) then
|
||||
if (instance:IsEnabled()) then
|
||||
_detalhes:ShutDownAllInstances()
|
||||
else
|
||||
_detalhes:ReabrirTodasInstancias()
|
||||
|
||||
local instance2 = _detalhes:GetInstance(2)
|
||||
if (instance2) then
|
||||
_detalhes.move_janela_func (instance2.baseframe, true, instance2, true)
|
||||
_detalhes.move_janela_func (instance2.baseframe, false, instance2, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- reabre todas as instancias
|
||||
function _detalhes:ReabrirTodasInstancias (temp)
|
||||
for index = math.min (#_detalhes.tabela_instancias, _detalhes.instances_amount), 1, -1 do
|
||||
|
||||
+74
-61
@@ -892,9 +892,79 @@ local _
|
||||
}
|
||||
})
|
||||
|
||||
-- 0.00048828125
|
||||
--reset 19 514 83 530
|
||||
--close
|
||||
local align_right_chat = function()
|
||||
|
||||
if (not RightChatPanel or not RightChatPanel:IsShown()) then
|
||||
_detalhes:Msg ("Right Chat Panel isn't shown.")
|
||||
return
|
||||
end
|
||||
|
||||
local wight, height = RightChatPanel:GetSize()
|
||||
|
||||
local instance1 = _detalhes.tabela_instancias [1]
|
||||
local instance2 = _detalhes.tabela_instancias [2]
|
||||
local instance3 = _detalhes.tabela_instancias [3]
|
||||
|
||||
if (not instance2) then
|
||||
instance2 = _detalhes:CriarInstancia()
|
||||
instance2:ChangeSkin (instance1.skin)
|
||||
elseif (not instance2.ativa) then
|
||||
instance2:AtivarInstancia()
|
||||
instance2:ChangeSkin (instance1.skin)
|
||||
end
|
||||
|
||||
if (instance3) then
|
||||
instance3:ShutDown()
|
||||
end
|
||||
|
||||
instance1:UngroupInstance()
|
||||
instance2:UngroupInstance()
|
||||
|
||||
instance1.baseframe:ClearAllPoints()
|
||||
instance2.baseframe:ClearAllPoints()
|
||||
|
||||
local statusbar_enabled1 = instance1.show_statusbar
|
||||
local statusbar_enabled2 = instance2.show_statusbar
|
||||
|
||||
local ElvUIRightChatDataPanel = RightChatDataPanel and RightChatDataPanel:IsShown()
|
||||
|
||||
if (instance1.skin == "Forced Square") then
|
||||
instance1.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
|
||||
instance2.baseframe:SetSize (wight/2 - 4 + 2, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
|
||||
|
||||
elseif (instance1.skin == "ElvUI Frame Style") then
|
||||
instance1.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
|
||||
instance2.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
|
||||
|
||||
elseif (instance1.skin == "ElvUI Style II") then
|
||||
instance1.baseframe:SetSize (wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
|
||||
instance2.baseframe:SetSize (wight/2 - 4 - 2, height - 20 - 2 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
|
||||
|
||||
else
|
||||
instance1.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled1 and 14 or 0))
|
||||
instance2.baseframe:SetSize (wight/2 - 4, height-20 - (ElvUIRightChatDataPanel and 21 or 0) - 8 - (statusbar_enabled2 and 14 or 0))
|
||||
|
||||
end
|
||||
|
||||
table.wipe (instance1.snap); table.wipe (instance2.snap)
|
||||
instance1.snap [3] = 2; instance2.snap [1] = 1;
|
||||
instance1.horizontalSnap = true; instance2.horizontalSnap = true
|
||||
|
||||
instance1.baseframe:SetPoint ("bottomleft", RightChatDataPanel, "topleft", 1 - (instance1.skin == "Forced Square" and 1 or 0), 1 + (statusbar_enabled1 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22))
|
||||
instance2.baseframe:SetPoint ("bottomright", RightChatToggleButton, "topright", -1, 1 + (statusbar_enabled2 and 14 or 0) - (ElvUIRightChatDataPanel and 0 or 22))
|
||||
|
||||
instance1:LockInstance (true)
|
||||
instance2:LockInstance (true)
|
||||
|
||||
instance1:SaveMainWindowPosition()
|
||||
instance2:SaveMainWindowPosition()
|
||||
|
||||
_detalhes.move_janela_func (instance1.baseframe, true, instance1)
|
||||
_detalhes.move_janela_func (instance1.baseframe, false, instance1)
|
||||
_detalhes.move_janela_func (instance2.baseframe, true, instance2)
|
||||
_detalhes.move_janela_func (instance2.baseframe, false, instance2)
|
||||
|
||||
end
|
||||
|
||||
_detalhes:InstallSkin ("Forced Square", {
|
||||
file = [[Interface\AddOns\Details\images\skins\simplygray_skin]],
|
||||
@@ -1140,6 +1210,7 @@ local _
|
||||
},
|
||||
|
||||
skin_options = {
|
||||
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1"], func = align_right_chat, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1_DESC"]},
|
||||
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP"], func = reset_tooltip, desc = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP_DESC"]},
|
||||
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = set_tooltip_elvui2, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]},
|
||||
}
|
||||
@@ -1269,64 +1340,6 @@ local _
|
||||
t:SetTexCoord (.4, 1, 0, 1)
|
||||
t2:SetTexCoord (0, .4, 0, 1)
|
||||
--]]
|
||||
|
||||
local align_right_chat = function()
|
||||
|
||||
if (not RightChatPanel or not RightChatPanel:IsShown()) then
|
||||
_detalhes:Msg ("Right Chat Panel isn't shown.")
|
||||
return
|
||||
end
|
||||
|
||||
local wight, height = RightChatPanel:GetSize()
|
||||
|
||||
local instance1 = _detalhes.tabela_instancias [1]
|
||||
local instance2 = _detalhes.tabela_instancias [2]
|
||||
local instance3 = _detalhes.tabela_instancias [3]
|
||||
|
||||
if (not instance2) then
|
||||
instance2 = _detalhes:CriarInstancia()
|
||||
instance2:ChangeSkin (instance1.skin)
|
||||
elseif (not instance2.ativa) then
|
||||
instance2:AtivarInstancia()
|
||||
instance2:ChangeSkin (instance1.skin)
|
||||
end
|
||||
|
||||
if (instance3) then
|
||||
instance3:ShutDown()
|
||||
end
|
||||
|
||||
instance1:UngroupInstance()
|
||||
instance2:UngroupInstance()
|
||||
|
||||
instance1.baseframe:ClearAllPoints()
|
||||
instance2.baseframe:ClearAllPoints()
|
||||
|
||||
local statusbar_enabled1 = instance1.show_statusbar
|
||||
local statusbar_enabled2 = instance2.show_statusbar
|
||||
|
||||
instance1.baseframe:SetSize (wight/2 - 4, height-20-21-8 - (statusbar_enabled1 and 14 or 0))
|
||||
instance2.baseframe:SetSize (wight/2 - 4, height-20-21-8 - (statusbar_enabled2 and 14 or 0))
|
||||
|
||||
table.wipe (instance1.snap); table.wipe (instance2.snap)
|
||||
instance1.snap [3] = 2; instance2.snap [1] = 1;
|
||||
instance1.horizontalSnap = true; instance2.horizontalSnap = true
|
||||
|
||||
instance1.baseframe:SetPoint ("bottomleft", RightChatDataPanel, "topleft", 1, 1 + (statusbar_enabled1 and 14 or 0))
|
||||
instance2.baseframe:SetPoint ("bottomright", RightChatToggleButton, "topright", -1, 1 + (statusbar_enabled2 and 14 or 0))
|
||||
|
||||
instance1:LockInstance (true)
|
||||
instance2:LockInstance (true)
|
||||
|
||||
instance1:SaveMainWindowPosition()
|
||||
instance2:SaveMainWindowPosition()
|
||||
|
||||
_detalhes.move_janela_func (instance1.baseframe, true, instance1)
|
||||
_detalhes.move_janela_func (instance1.baseframe, false, instance1)
|
||||
_detalhes.move_janela_func (instance2.baseframe, true, instance2)
|
||||
_detalhes.move_janela_func (instance2.baseframe, false, instance2)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
_detalhes:InstallSkin ("ElvUI Frame Style", {
|
||||
|
||||
+10
-2
@@ -73,7 +73,12 @@ function SlashCmdList.DETAILS (msg, editbox)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
elseif (command == Loc ["STRING_SLASH_TOGGLE"] or command == "toggle") then
|
||||
|
||||
_detalhes:ToggleWindows()
|
||||
|
||||
|
||||
elseif (command == Loc ["STRING_SLASH_WORLDBOSS"] or command == "worldboss") then
|
||||
|
||||
local questIds = {{"Tarlna the Ageless", 81535}, {"Drov the Ruiner ", 87437}, {"Rukhmar", 87493}}
|
||||
@@ -867,13 +872,16 @@ function SlashCmdList.DETAILS (msg, editbox)
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_NEW"] .. "|r: " .. Loc ["STRING_SLASH_NEW_DESC"])
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_SHOW"] .. "|r: " .. Loc ["STRING_SLASH_SHOW_DESC"])
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_HIDE"] .. "|r: " .. Loc ["STRING_SLASH_HIDE_DESC"])
|
||||
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_TOGGLE"] .. "|r: " .. Loc ["STRING_SLASH_TOGGLE_DESC"])
|
||||
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_ENABLE"] .. "|r: " .. Loc ["STRING_SLASH_ENABLE_DESC"])
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_DISABLE"] .. "|r: " .. Loc ["STRING_SLASH_DISABLE_DESC"])
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_RESET"] .. "|r: " .. Loc ["STRING_SLASH_RESET_DESC"])
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_OPTIONS"] .. "|r|cfffcffb0 <instance number>|r: " .. Loc ["STRING_SLASH_OPTIONS_DESC"])
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_CHANGES"] .. "|r: " .. Loc ["STRING_SLASH_CHANGES_DESC"])
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_WIPECONFIG"] .. "|r: " .. Loc ["STRING_SLASH_WIPECONFIG_DESC"])
|
||||
print ("|cffffaeae/details " .. Loc ["STRING_SLASH_WORLDBOSS"] .. "|r: " .. Loc ["STRING_SLASH_WORLDBOSS_DESC"])
|
||||
--print ("|cffffaeae/details " .. Loc ["STRING_SLASH_WORLDBOSS"] .. "|r: " .. Loc ["STRING_SLASH_WORLDBOSS_DESC"])
|
||||
print (" ")
|
||||
|
||||
end
|
||||
|
||||
@@ -1262,10 +1262,10 @@ local window_openned_at = time()
|
||||
texto7:SetText (Loc ["STRING_WELCOME_30"])
|
||||
|
||||
local texto_shortcut = window:CreateFontString (nil, "overlay", "GameFontNormal")
|
||||
texto_shortcut:SetPoint ("topleft", window, "topleft", 25, -110)
|
||||
texto_shortcut:SetPoint ("topleft", window, "topleft", 25, -105)
|
||||
texto_shortcut:SetText (Loc ["STRING_WELCOME_31"])
|
||||
texto_shortcut:SetWidth (290)
|
||||
texto_shortcut:SetHeight (90)
|
||||
texto_shortcut:SetHeight (120)
|
||||
texto_shortcut:SetJustifyH ("left")
|
||||
texto_shortcut:SetJustifyV ("top")
|
||||
texto_shortcut:SetTextColor (1, 1, 1, 1)
|
||||
|
||||
+3
-2
@@ -497,10 +497,11 @@ function _G._detalhes:Start()
|
||||
DBM:RegisterCallback ("DBM_Announce", dbm_callback_phase)
|
||||
DBM:RegisterCallback ("pull", dbm_callback_pull)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
function _detalhes:TestResize()
|
||||
_detalhes:OpenNewsWindow (_detalhes.resize_debug)
|
||||
_detalhes:OpenNewsWindow ("TESTE, |TInterface\\AddOns\\Details\\images\\key_shift:20:40:0:0:64:64:0:64:0:40|t")
|
||||
end
|
||||
_detalhes:ScheduleTimer ("TestResize", 3)
|
||||
--]]
|
||||
|
||||
Reference in New Issue
Block a user