Make plugins be in the list of displays

This commit is contained in:
Tercio Jose
2021-06-14 15:55:10 -03:00
parent bd1700b5f1
commit 39aa5f0e77
12 changed files with 180 additions and 186 deletions
+2 -2
View File
@@ -8,11 +8,11 @@
_detalhes.build_counter = 8516
_detalhes.alpha_build_counter = 8516 --if this is higher than the regular counter, use it instead
_detalhes.bcc_counter = 19
_detalhes.bcc_counter = 20
_detalhes.dont_open_news = true
_detalhes.game_version = version
_detalhes.userversion = version .. _detalhes.build_counter
_detalhes.realversion = 144 --core version, this is used to check API version for scripts and plugins (see alias below)
_detalhes.realversion = 145 --core version, this is used to check API version for scripts and plugins (see alias below)
_detalhes.APIVersion = _detalhes.realversion --core version
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" --simple stirng to show to players
+1 -1
View File
@@ -600,7 +600,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta
if (instancia.row_info.use_spec_icons) then
local nome = morte[3]
local spec = instancia.showing (1, nome) and instancia.showing (1, nome).spec or (instancia.showing (2, nome) and instancia.showing (2, nome).spec)
if (spec) then
if (spec and spec ~= 0) then
esta_barra.icone_classe:SetTexture (instancia.row_info.spec_file)
esta_barra.icone_classe:SetTexCoord (_unpack (_detalhes.class_specs_coords[spec]))
else
+2
View File
@@ -417,7 +417,9 @@
--]=]
_detalhes.cached_talents[guid] = talents
if (spec and spec ~= 0) then
_detalhes.cached_specs[guid] = spec
end
_detalhes.cached_roles[guid] = playerRole
_detalhes.item_level_pool[guid] = {
name = player,
+9 -21
View File
@@ -5809,40 +5809,28 @@ local build_mode_list = function (self, elapsed)
CoolTip:AddMenu (1, instancia.AlteraModo, 3, true)
CoolTip:AddIcon ([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 32/256*2, 32/256*3, 0, 1)
CoolTip:AddLine (Loc ["STRING_MODE_RAID"])
CoolTip:AddLine (Loc ["STRING_OPTIONS_PLUGINS"])
CoolTip:AddMenu (1, instancia.AlteraModo, 4, true)
CoolTip:AddIcon ([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 32/256*3, 32/256*4, 0, 1)
--build raid plugins list
local available_plugins = _detalhes.RaidTables:GetAvailablePlugins()
if (#available_plugins >= 0) then
local amt = 0
for index, ptable in _ipairs (available_plugins) do
if (ptable [3].__enabled) then
CoolTip:AddMenu (2, _detalhes.RaidTables.EnableRaidMode, instancia, ptable [4], true, ptable [1], ptable [2], true) --PluginName, PluginIcon, PluginObject, PluginAbsoluteName
amt = amt + 1
local raidPlugins = _detalhes.RaidTables:GetAvailablePlugins()
if (#raidPlugins >= 0) then
for index, ptable in _ipairs (raidPlugins) do
--if a plugin has the member 'NoMenu', it won't be shown on menus to select plugins
if (ptable[3].__enabled and not ptable[3].NoMenu) then
--PluginName, PluginIcon, PluginObject, PluginAbsoluteName
CoolTip:AddMenu (2, _detalhes.RaidTables.EnableRaidMode, instancia, ptable[4], true, ptable[1], ptable[2], true)
end
end
--CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
end
CoolTip:AddLine (Loc ["STRING_MODE_SELF"])
CoolTip:AddMenu (1, instancia.AlteraModo, 1, true)
CoolTip:AddIcon ([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 0, 32/256, 0, 1)
--build self plugins list
--pega a list de plugins solo:
if (#_detalhes.SoloTables.Menu > 0) then
for index, ptable in _ipairs (_detalhes.SoloTables.Menu) do
if (ptable [3].__enabled) then
if (ptable[3].__enabled and not ptable[3].NoMenu) then
CoolTip:AddMenu (2, _detalhes.SoloTables.EnableSoloMode, instancia, ptable[4], true, ptable[1], ptable[2], true)
end
end
--CoolTip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
end
--> window control
+70 -129
View File
@@ -142,7 +142,7 @@ do
local all_switch = CreateFrame ("frame", "DetailsAllAttributesFrame", UIParent,"BackdropTemplate")
all_switch:SetFrameStrata ("tooltip")
all_switch:Hide()
all_switch:SetSize (400, 150)
all_switch:SetSize(600, 150)
all_switch:SetClampedToScreen (true)
all_switch:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16 })
all_switch:SetBackdropColor (0.05, 0.05, 0.05, 0.3)
@@ -195,40 +195,6 @@ do
DetailsSwitchPanel.all_switch = all_switch
function _detalhes:ShowAllSwitch()
--[=[ --tutorial removed, I don't think is necessary anymore, July 2019
--_detalhes:SetTutorialCVar ("SWITCH_PANEL_FIRST_OPENED", false)
if (not _detalhes:GetTutorialCVar ("SWITCH_PANEL_FIRST_OPENED")) then
_detalhes:SetTutorialCVar ("SWITCH_PANEL_FIRST_OPENED", true)
local fake_window = _detalhes:CreateFakeWindow()
fake_window:SetPoint ("bottomleft", all_switch, "topleft", 0, 10)
local all_switch_titlebar_help = CreateFrame ("frame", "DetailsSwitchAllPopUp1", fake_window, "DetailsHelpBoxTemplate")
all_switch_titlebar_help.ArrowUP:Show()
all_switch_titlebar_help.ArrowGlowUP:Show()
all_switch_titlebar_help.Text:SetText ("Right click on Title Bar to open all displays menu.")
all_switch_titlebar_help:SetPoint ("bottom", fake_window.TitleBar, "top", 0, 30)
all_switch_titlebar_help:Show()
local all_switch_titlebar2_help = CreateFrame ("frame", "DetailsSwitchAllPopUp1", fake_window, "DetailsHelpBoxTemplate")
all_switch_titlebar2_help.ArrowLEFT:Show()
all_switch_titlebar2_help.ArrowGlowLEFT:Show()
all_switch_titlebar2_help.Text:SetText ("Right clicking anywhere else opens your Bookmarks.")
all_switch_titlebar2_help:SetPoint ("right", fake_window, "left", -30, 0)
all_switch_titlebar2_help:Show()
local close = CreateFrame ("button", nil, fake_window)
close:SetPoint ("bottomright", fake_window, "bottomright", -10, 10)
close:SetScript ("OnClick", function() fake_window:Hide(); all_switch_titlebar2_help:Hide(); all_switch_titlebar_help:Hide() end)
close:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16 })
close:SetBackdropColor (0.7, 0.7, 0.7, 0.4)
close:SetSize (100, 20)
local t = close:CreateFontString (nil, "overlay", "GameFontNormal")
t:SetPoint ("center", 0, 0)
t:SetText ("CLOSE")
end
--]=]
if (all_switch:IsShown()) then
return all_switch:Hide()
end
@@ -238,7 +204,6 @@ do
all_switch:ClearAllPoints()
all_switch:SetPoint ("bottom", self.baseframe.UPFrame, "top", 4)
--all_switch.ShowAnimation:Play()
all_switch:Show()
if (_detalhes.switch.frame:IsShown()) then
@@ -280,7 +245,6 @@ do
hover_over_texture:ClearAllPoints()
hover_over_texture:SetPoint ("topleft", self, "topleft", -2, 1)
hover_over_texture:Show()
--self.texture:SetSize (icon_size+1, icon_size+1)
end
local on_leave_all_switch_button = function (self)
@@ -288,7 +252,6 @@ do
all_switch.interacting = false
all_switch.last_up = GetTime()
hover_over_texture:Hide()
--self.texture:SetSize (icon_size, icon_size)
end
local on_enter_all_switch_button_icon = function (self)
@@ -387,28 +350,42 @@ do
y = -8
end
--> prepare for customs
--> prepare for scripts
all_switch.x = x
all_switch.y = -8
all_switch.buttons [_detalhes.atributos[0]+1] = {}
local title_icon = all_switch:CreateTexture (nil, "overlay")
local texture, l, r, t, b = _detalhes:GetAttributeIcon (_detalhes.atributos[0]+1)
title_icon:SetTexture (texture)
title_icon:SetTexCoord (l, r, t, b)
title_icon:SetSize (18, 18)
title_icon:SetTexture([[Interface\AddOns\Details\images\icons]])
title_icon:SetTexCoord(412/512, 441/512, 43/512, 79/512)
title_icon:SetVertexColor(.7, .6, .5, 1)
title_icon:SetSize(16, 16)
local title_str = all_switch:CreateFontString (nil, "overlay", "GameFontNormal")
title_str:SetPoint ("left", title_icon, "right", 2, 0)
title_str:SetText (_detalhes.atributos.lista [_detalhes.atributos[0]+1])
title_str:SetText ("Scripts")
title_icon:SetPoint ("topleft", all_switch.x, all_switch.y)
all_switch.y = all_switch.y - 20
all_switch.title_custom = title_icon
all_switch.already_built = true
--> prepare for plugins
all_switch.buttons[6] = {}
local title_icon = all_switch:CreateTexture(nil, "overlay")
title_icon:SetTexture ([[Interface\AddOns\Details\images\modo_icones]])
title_icon:SetTexCoord (32/256*3, 32/256*4, 0, 1)
title_icon:SetSize (16, 16)
local title_str = all_switch:CreateFontString(nil, "overlay", "GameFontNormal")
title_str:SetPoint("left", title_icon, "right", 2, 0)
title_str:SetText(Loc["STRING_OPTIONS_PLUGINS"])
title_icon:SetPoint("topleft", all_switch.x + 130, -8)
all_switch.title_scripts = title_icon
end
--> update customs
--> update scripts
local custom_index = _detalhes.atributos[0]+1
for _, button in ipairs (all_switch.buttons [custom_index]) do
button:Hide()
@@ -437,32 +414,57 @@ do
all_switch.higher_counter = #_detalhes.custom
end
--> update plugins
local script_index = 6
local button_index = 1
all_switch.x = all_switch.x + 130
all_switch.y = -28
--build raid plugins list
local raidPlugins = _detalhes.RaidTables:GetAvailablePlugins()
if (#raidPlugins >= 0) then
for i, ptable in ipairs (raidPlugins) do
--if a plugin has the member 'NoMenu', it won't be shown on menus to select plugins
if (ptable[3].__enabled and not ptable[3].NoMenu) then
--PluginName, PluginIcon, PluginObject, PluginAbsoluteName
--CoolTip:AddMenu (2, _detalhes.RaidTables.EnableRaidMode, instancia, ptable[4], true, ptable[1], ptable[2], true)
local button = all_switch.buttons [script_index] [button_index]
if (not button) then
button = create_all_switch_button(script_index, button_index, all_switch.x, all_switch.y)
tinsert (all_switch.buttons [script_index], button)
all_switch.y = all_switch.y - 17
end
button.text:SetText(ptable[1])
all_switch.check_text_size(button.text)
button.texture:SetTexture (ptable[2])
button.texture:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875)
button:Show()
button_index = button_index + 1
end
end
end
--check if the plugins list is the biggest list
button_index = button_index - 1
if (button_index > all_switch.higher_counter) then
all_switch.higher_counter = button_index
end
all_switch:SetHeight ((all_switch.higher_counter * 17) + 20 + 16)
all_switch:SetWidth ((120 * 5) + (5 * 2) + (12*4))
all_switch:SetWidth ((120 * 6) + (6 * 2) + (12*4))
all_switch.last_up = GetTime()
local cursor_x, cursor_y = GetCursorPosition()
all_switch.cursor_x, all_switch.cursor_y = floor (cursor_x), floor (cursor_y)
all_switch:SetScript ("OnUpdate", on_update_all_switch)
--[=[
all_switch.wallpaper:SetTexture (_detalhes.tooltip.menus_bg_texture)
all_switch.wallpaper:SetTexCoord (unpack (_detalhes.tooltip.menus_bg_coords))
all_switch.wallpaper:SetVertexColor (unpack (_detalhes.tooltip.menus_bg_color))
all_switch.wallpaper:SetDesaturated (true)
--]=]
--[=[
all_switch:SetBackdrop (_detalhes.tooltip_backdrop)
all_switch:SetBackdropColor (0.09019, 0.09019, 0.18823, 1)
all_switch:SetBackdropBorderColor (unpack (_detalhes.tooltip_border_color))
--]=]
--updated colors (these colors are set inside the janela_principal file
all_switch:SetBackdrop (_detalhes.menu_backdrop_config.menus_backdrop)
all_switch:SetBackdropColor (unpack (_detalhes.menu_backdrop_config.menus_backdropcolor))
all_switch:SetBackdropBorderColor (unpack (_detalhes.menu_backdrop_config.menus_bordercolor))
end)
---------------------------------------------------------------------------------------------------------------------------
@@ -603,9 +605,6 @@ _detalhes.switch.current_instancia = nil
_detalhes.switch.current_button = nil
_detalhes.switch.height_necessary = (_detalhes.switch.button_height * _detalhes.switch.slots) / 2
local right_click_text = {text = Loc ["STRING_SHORTCUT_RIGHTCLICK"], size = 9, color = {.9, .9, .9}}
local right_click_texture = {[[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 14, 14, 0.0019531, 0.1484375, 0.6269531, 0.8222656}
function _detalhes.switch:HideAllBookmarks()
for _, bookmark in ipairs (_detalhes.switch.buttons) do
bookmark:Hide()
@@ -923,60 +922,12 @@ function _detalhes.switch:ShowMe (instancia)
_detalhes.switch.frame:SetScale (instancia.window_scale)
_detalhes.switch.frame:Show()
--_detalhes.switch.frame.ShowAnimation:Play()
--[=[ --removed bookmark tutorials July 2019
if (not _detalhes.tutorial.bookmark_tutorial) then
if (not SwitchPanelTutorial) then
local tutorial_frame = CreateFrame ("frame", "SwitchPanelTutorial", _detalhes.switch.frame)
tutorial_frame:SetFrameStrata ("FULLSCREEN_DIALOG")
tutorial_frame:SetAllPoints()
tutorial_frame:EnableMouse (true)
tutorial_frame:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16 })
tutorial_frame:SetBackdropColor (0.05, 0.05, 0.05, 0.95)
tutorial_frame.info_label = tutorial_frame:CreateFontString (nil, "overlay", "GameFontNormal")
tutorial_frame.info_label:SetPoint ("topleft", tutorial_frame, "topleft", 10, -10)
tutorial_frame.info_label:SetText (Loc ["STRING_MINITUTORIAL_BOOKMARK2"])
tutorial_frame.info_label:SetJustifyH ("left")
tutorial_frame.mouse = tutorial_frame:CreateTexture (nil, "overlay")
tutorial_frame.mouse:SetTexture ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]])
tutorial_frame.mouse:SetTexCoord (0.0019531, 0.1484375, 0.6269531, 0.8222656)
tutorial_frame.mouse:SetSize (20, 22)
tutorial_frame.mouse:SetPoint ("topleft", tutorial_frame.info_label, "bottomleft", -3, -10)
tutorial_frame.close_label = tutorial_frame:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
tutorial_frame.close_label:SetPoint ("left", tutorial_frame.mouse, "right", 4, 0)
tutorial_frame.close_label:SetText (Loc ["STRING_MINITUTORIAL_BOOKMARK3"])
tutorial_frame.close_label:SetJustifyH ("left")
local checkbox = CreateFrame ("CheckButton", "SwitchPanelTutorialCheckBox", tutorial_frame, "ChatConfigCheckButtonTemplate")
checkbox:SetPoint ("topleft", tutorial_frame.mouse, "bottomleft", -1, -5)
_G [checkbox:GetName().."Text"]:SetText (Loc ["STRING_MINITUTORIAL_BOOKMARK4"])
tutorial_frame:SetScript ("OnMouseDown", function()
if (checkbox:GetChecked()) then
_detalhes.tutorial.bookmark_tutorial = true
end
tutorial_frame:Hide()
end)
end
SwitchPanelTutorial:Show()
SwitchPanelTutorial.info_label:SetWidth (_detalhes.switch.frame:GetWidth()-30)
SwitchPanelTutorial.close_label:SetWidth (_detalhes.switch.frame:GetWidth()-30)
end
--]=]
_detalhes.switch:Resize (precisa_mostrar)
--instancia:StatusBarAlert (right_click_text, right_click_texture) --icon, color, time
if (DetailsSwitchPanel.all_switch:IsShown()) then
return DetailsSwitchPanel.all_switch:Hide()
end
end
-- ~setting
@@ -1024,10 +975,7 @@ end
end
_detalhes:FastSwitch (nil, bookmark, number)
--return _detalhes:FastSwitch (paramTable)
end
end
function _detalhes:FastSwitch (button, bookmark, bookmark_number, select_new)
@@ -1049,43 +997,36 @@ function _detalhes:FastSwitch (button, bookmark, bookmark_number, select_new)
_detalhes:MontaAtributosOption (_detalhes.switch.current_instancia, _detalhes.switch.Config)
--> build raid plugins list
GameCooltip:AddLine (Loc ["STRING_MODE_RAID"])
GameCooltip:AddLine(Loc["STRING_MODE_PLUGINS"])
GameCooltip:AddMenu(1, function() end, 4, true)
GameCooltip:AddIcon([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 32/256*3, 32/256*4, 0, 1)
local available_plugins = _detalhes.RaidTables:GetAvailablePlugins()
if (#available_plugins >= 0) then
local amt = 0
if (#available_plugins >= 0) then
for index, ptable in ipairs (available_plugins) do
if (ptable [3].__enabled) then
if (ptable [3].__enabled and not ptable[3].NoMenu) then
GameCooltip:AddMenu (2, _detalhes.switch.Config, _detalhes.switch.current_instancia, ptable [4], true, ptable [1], ptable [2], true) --PluginName, PluginIcon, PluginObject, PluginAbsoluteName
amt = amt + 1
end
end
GameCooltip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
if (amt <= 3) then
GameCooltip:SetOption ("SubFollowButton", true)
end
end
--> build self plugins list
GameCooltip:AddLine (Loc ["STRING_MODE_SELF"])
GameCooltip:AddMenu (1, function() end, 1, true)
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\modo_icones]], 1, 1, 20, 20, 0, 32/256, 0, 1)
if (#_detalhes.SoloTables.Menu > 0) then
for index, ptable in ipairs (_detalhes.SoloTables.Menu) do
if (ptable [3].__enabled) then
if (ptable [3].__enabled and not ptable[3].NoMenu) then
GameCooltip:AddMenu (2, _detalhes.switch.Config, _detalhes.switch.current_instancia, ptable [4], true, ptable [1], ptable [2], true)
end
end
GameCooltip:SetWallpaper (2, _detalhes.tooltip.menus_bg_texture, _detalhes.tooltip.menus_bg_coords, _detalhes.tooltip.menus_bg_color, true)
end
if (amt <= 3) then
GameCooltip:SetOption ("SubFollowButton", true)
end
GameCooltip:SetColor (1, {.1, .1, .1, .3})
GameCooltip:SetColor (2, {.1, .1, .1, .3})
GameCooltip:SetOption ("HeightAnchorMod", -7)
@@ -1435,7 +1376,7 @@ local onenter = function (self)
if (not _detalhes.switch.table [self.id].atributo) then
GameCooltip:Reset()
_detalhes:CooltipPreset (1)
GameCooltip:AddLine ("add bookmark")
GameCooltip:AddLine (Loc["STRING_SWITCH_CLICKME"]) --add bookmark
GameCooltip:AddIcon ([[Interface\Glues\CharacterSelect\Glues-AddOn-Icons]], 1, 1, 16, 16, 0.75, 1, 0, 1, {0, 1, 0})
GameCooltip:SetOwner (self)
+1 -1
View File
@@ -113,7 +113,7 @@ do
Loc ["STRING_ATTRIBUTE_HEAL"], --> Healing
Loc ["STRING_ATTRIBUTE_ENERGY"], --> Energy
Loc ["STRING_ATTRIBUTE_MISC"], --> Misc
Loc ["STRING_ATTRIBUTE_CUSTOM"] --> Custom
Loc ["STRING_SCRIPTS_TITLE"] --> Custom
}
}
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

+66 -19
View File
@@ -5,12 +5,16 @@ local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true)
local LibWindow = LibStub ("LibWindow-1.1")
local _
---need cleanup Loc ["STRING_MEMORY_ALERT_BUTTON"],
--> create the plugin object
-- "Details_StreamOverlay" is the old name
local StreamOverlay = _detalhes:NewPluginObject ("Details_Streamer", DETAILSPLUGIN_ALWAYSENABLED)
--tinsert (UISpecialFrames, "Details_StreamOverlays")
--> main frame (shortcut)
local SOF = StreamOverlay.Frame
--> shortcut for details framework
local fw = StreamOverlay.gump
local player_name
@@ -1255,16 +1259,18 @@ function listener:RegisterMyEvents()
listener:RegisterEvent ("UNIT_SPELLCAST_SENT")
listener:RegisterEvent ("UNIT_SPELLCAST_SUCCEEDED")
listener:RegisterEvent ("UNIT_SPELLCAST_INTERRUPTED")
listener:RegisterEvent ("UNIT_SPELLCAST_FAILED_QUIET")
listener:RegisterEvent ("UNIT_SPELLCAST_FAILED")
listener:RegisterEvent ("UNIT_SPELLCAST_NOT_INTERRUPTIBLE")
listener:RegisterEvent ("UNIT_SPELLCAST_INTERRUPTIBLE")
listener:RegisterEvent ("UNIT_SPELLCAST_DELAYED")
listener:RegisterEvent ("UNIT_SPELLCAST_CHANNEL_START")
listener:RegisterEvent ("UNIT_SPELLCAST_CHANNEL_STOP")
listener:RegisterEvent ("UNIT_SPELLCAST_CHANNEL_UPDATE")
listener:RegisterEvent ("UNIT_SPELLCAST_STOP")
if (not DetailsFramework.IsTBCWow()) then
listener:RegisterEvent ("UNIT_SPELLCAST_INTERRUPTIBLE")
listener:RegisterEvent ("UNIT_SPELLCAST_NOT_INTERRUPTIBLE")
end
end
function listener:UnregisterMyEvents()
@@ -1272,16 +1278,18 @@ function listener:UnregisterMyEvents()
listener:UnregisterEvent ("UNIT_SPELLCAST_SENT")
listener:UnregisterEvent ("UNIT_SPELLCAST_SUCCEEDED")
listener:UnregisterEvent ("UNIT_SPELLCAST_INTERRUPTED")
listener:UnregisterEvent ("UNIT_SPELLCAST_FAILED_QUIET")
listener:UnregisterEvent ("UNIT_SPELLCAST_FAILED")
listener:UnregisterEvent ("UNIT_SPELLCAST_NOT_INTERRUPTIBLE")
listener:UnregisterEvent ("UNIT_SPELLCAST_INTERRUPTIBLE")
listener:UnregisterEvent ("UNIT_SPELLCAST_DELAYED")
listener:UnregisterEvent ("UNIT_SPELLCAST_CHANNEL_START")
listener:UnregisterEvent ("UNIT_SPELLCAST_CHANNEL_STOP")
listener:UnregisterEvent ("UNIT_SPELLCAST_CHANNEL_UPDATE")
listener:UnregisterEvent ("UNIT_SPELLCAST_STOP")
if (not DetailsFramework.IsTBCWow()) then
listener:UnregisterEvent ("UNIT_SPELLCAST_INTERRUPTIBLE")
listener:UnregisterEvent ("UNIT_SPELLCAST_NOT_INTERRUPTIBLE")
end
end
local lastspell, lastcastid, lastchannelid, ischanneling, lastspellID
@@ -1659,7 +1667,7 @@ function StreamOverlay.OpenOptionsPanel (from_options_panel)
options_frame:SetBackdropColor (0, 0, 0, 0.5)
options_frame:SetBackdropBorderColor (0, 0, 0, 1)
options_frame:SetWidth (520)
options_frame:SetHeight (500)
options_frame:SetHeight (520)
-- select texture
local set_row_texture = function (_, _, value)
@@ -2079,7 +2087,7 @@ function StreamOverlay.OpenOptionsPanel (from_options_panel)
}
fw:BuildMenu (options_frame, options, 15, -100, 540, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
fw:BuildMenu (options_frame, options, 15, -120, 560, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
--select profile dropdown
local select_profile = function (_, _, profileName)
@@ -2129,7 +2137,7 @@ function StreamOverlay.OpenOptionsPanel (from_options_panel)
local label_profile = Details.gump:CreateLabel (options_frame, "Profile" .. ": ", Details.gump:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE"))
local dropdown_profile = Details.gump:CreateDropDown (options_frame, select_profile_fill, nil, 160, 20, "dropdown_profile", nil, Details.gump:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
dropdown_profile:SetPoint ("left", label_profile, "right", 2, 0)
label_profile:SetPoint ("topleft", options_frame, "topleft", 15, -65)
label_profile:SetPoint ("topleft", options_frame, "topleft", 15, -75)
local pname = UnitName ("player") .. " - " .. GetRealmName()
dropdown_profile:Select (Details_StreamerDB.characters [pname])
@@ -2161,6 +2169,34 @@ function StreamOverlay.OpenOptionsPanel (from_options_panel)
options_frame.NewProfileButton:SetPoint ("left", dropdown_profile, "right", 4, 0)
end
--enable / disable plugin button
local toggle_OnOff = function()
local pluginStable = Details:GetPluginSavedTable("DETAILS_PLUGIN_STREAM_OVERLAY")
local pluginObject = Details:GetPlugin("DETAILS_PLUGIN_STREAM_OVERLAY")
if (pluginStable.enabled) then
pluginStable.enabled = false
pluginObject.__enabled = false
Details:SendEvent("PLUGIN_DISABLED", pluginObject)
options_frame.toggleButton.text = "Start Plugin"
else
pluginStable.enabled = true
pluginObject.__enabled = true
Details:SendEvent("PLUGIN_ENABLED", pluginObject)
options_frame.toggleButton.text = "Disable Plugin"
end
end
--get the plugin state
local pluginStable = Details:GetPluginSavedTable("DETAILS_PLUGIN_STREAM_OVERLAY")
local toggleButton = DetailsFramework:CreateButton(options_frame, toggle_OnOff, 120, 20, pluginStable.enabled and "Disable Plugin" or "Start Plugin")
toggleButton:SetPoint ("topleft", options_frame, "topleft", 15, -45)
toggleButton:SetTemplate(DetailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
options_frame.toggleButton = toggleButton
options_frame:SetScript ("OnHide", function()
if (StreamOverlay.FromOptionsPanel) then
--> reopen the options panel
@@ -2285,7 +2321,8 @@ function StreamOverlay:OnEvent (_, event, ...)
welcome_window:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
welcome_window:SetBackdropColor (0, 0, 0, 0.5)
welcome_window:SetBackdropBorderColor (0, 0, 0, 1)
welcome_window:SetSize (800, 270)
welcome_window:SetSize (740, 270)
DetailsFramework:ApplyStandardBackdrop(welcome_window)
local icon = welcome_window:CreateTexture (nil, "overlay")
icon:SetTexture ([[Interface\MINIMAP\MOVIERECORDINGICON]])
@@ -2294,16 +2331,24 @@ function StreamOverlay:OnEvent (_, event, ...)
StreamOverlay:SetFontSize (title, 20)
local text1 = welcome_window:CreateFontString (nil, "overlay", "GameFontNormal")
text1:SetText ("If you are a Streamer or Youtuber, you might want to take a look at the Details! Action Tracker plugin.")
text1:SetText ("If you are a Streamer or Youtuber, \nthis plugin shows to your audience the spells you're casting,\nhence they can follow your steps and learn together.")
local text2 = welcome_window:CreateFontString (nil, "overlay", "GameFontNormal")
text2:SetText ("Go to Options Panel -> Plugin Management and enable the Action Tracker plugin.")
icon:SetPoint ("topleft", welcome_window, "topleft", 10, -60)
text2:SetText ("Use the command:")
local text3 = welcome_window:CreateFontString (nil, "overlay", "GameFontNormal")
text3:SetText ("/streamer")
DetailsFramework:SetFontSize(text3, 16)
icon:SetPoint ("topleft", welcome_window, "topleft", 10, -20)
title:SetPoint ("left", icon, "right", 10, 0)
text1:SetPoint ("topleft", welcome_window, "topleft", 10, -120)
text2:SetPoint ("topleft", welcome_window, "topleft", 10, -140)
text1:SetPoint ("topleft", welcome_window, "topleft", 10, -70)
text2:SetPoint ("center", text1, "center", 0, -50)
text3:SetPoint ("center", text2, "center", 0, -16)
local image1 = welcome_window:CreateTexture(nil, "overlay")
image1:SetTexture([[Interface\AddOns\Details_Streamer\streamer_plugin_lines]])
image1:SetPoint("topleft", welcome_window, "topleft", 410, -6)
image1:SetSize(512, 256)
local close_func = function()
StreamOverlay.db.is_first_run = false
@@ -2311,8 +2356,8 @@ function StreamOverlay:OnEvent (_, event, ...)
welcome_window:Hide()
end
local close = Details.gump:CreateButton (welcome_window, close_func, 127, 20, Loc ["STRING_MEMORY_ALERT_BUTTON"], nil, nil, nil, nil, nil, nil, Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"))
close:SetPoint ("topleft", welcome_window, "topleft", 10, -200)
local close = Details.gump:CreateButton (welcome_window, close_func, 120, 20, "Okay", nil, nil, nil, nil, nil, nil, Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"))
close:SetPoint ("center", text3, "center", 0, -50)
end
StreamOverlay.ShowWelcomeFrame = C_Timer.NewTicker (5, show_frame)
@@ -2325,6 +2370,7 @@ function StreamOverlay:OnEvent (_, event, ...)
--profile name
SOF.PlayerNameProfile = UnitName("player") .. " - " .. GetRealmName()
local pname = SOF.PlayerNameProfile
--default if is first run
local next_pname = next (Details_StreamerDB.profiles or {})
Details_StreamerDB.characters [pname] = Details_StreamerDB.characters [pname] or next_pname or pname
@@ -2339,7 +2385,8 @@ function StreamOverlay:OnEvent (_, event, ...)
end
elseif (event == "PLAYER_LOGOUT") then
local pname = SOF.PlayerNameProfile
local pname = UnitName("player") .. " - " .. GetRealmName()
--print(Details_Streamer.PlayerNameProfile)
Details_StreamerDB.profiles [ Details_StreamerDB.characters [pname] ] = StreamOverlay.db
end
end
Binary file not shown.

After

Width:  |  Height:  |  Size: 512 KiB

@@ -632,6 +632,19 @@ local build_options_panel = function()
desc = "When enabled, threat bars uses the class color of the character.",
name = "Use Class Colors"
},
{type = "blank"},
--[=[
{
type = "toggle",
get = function() return ThreatMeter.saveddata.playSound end,
set = function (self, fixedparam, value) ThreatMeter.saveddata.playSound = value end,
desc = "Except for tanks",
name = "Play Audio On High Threat"
},
--]=]
}
_detalhes.gump:BuildMenu (options_frame, menu, 15, -65, 260)
@@ -704,6 +717,9 @@ function ThreatMeter:OnEvent (_, event, ...)
ThreatMeter.saveddata.playercolor = ThreatMeter.saveddata.playercolor or {1, 1, 1}
ThreatMeter.saveddata.useclasscolors = ThreatMeter.saveddata.useclasscolors or false
ThreatMeter.saveddata.playSound = ThreatMeter.saveddata.playSound or false
ThreatMeter.saveddata.playSoundFile = ThreatMeter.saveddata.playSoundFile or "Details Threat Warning Volume 3"
ThreatMeter.options = ThreatMeter.saveddata
--> Register slash commands