- Added tutorial for bookmarks.

- Added option for choose the format type of data broker's text.

- New API: framework:CreateSimplePanel (parent, w, h, title, name)
This commit is contained in:
tercio
2014-09-12 19:45:26 -03:00
parent 714daf6a99
commit 6c0c02e89a
15 changed files with 453 additions and 103 deletions
+74 -62
View File
@@ -1166,19 +1166,78 @@
end
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local ActivityTime = {
name = Loc ["STRING_CUSTOM_ACTIVITY_ALL"],
icon = [[INTERFACE\ICONS\Achievement_PVP_G_15]],
local DamageActivityTime = {
name = Loc ["STRING_CUSTOM_ACTIVITY_DPS"],
icon = [[Interface\ICONS\Achievement_PVP_H_06]],
attribute = false,
spellid = false,
author = "Details!",
desc = Loc ["STRING_CUSTOM_ACTIVITY_ALL_DESC"],
desc = Loc ["STRING_CUSTOM_ACTIVITY_DPS_DESC"],
source = false,
target = false,
total_script = [[
local value, top, total, combat, instance = ...
return math.floor (value)
local minutos, segundos = math.floor (value/60), math.floor (value%60)
return minutos .. "m " .. segundos .. "s"
]],
percent_script = [[
local value, top, total, combat, instance = ...
return string.format ("%.1f", value/top*100)
]],
script = [[
--init:
local combat, instance_container, instance = ...
local total, amount = 0, 0
--get the misc actor container
local damage_container = combat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE )
--do the loop:
for _, player in ipairs ( damage_container ) do
if (player.grupo) then
local activity = player:Tempo()
total = total + activity
amount = amount + 1
--add amount to the player
instance_container:AddValue (player, activity)
end
end
--return:
return total, combat:GetCombatTime(), amount
]],
tooltip = [[
]],
}
local have = false
for _, custom in ipairs (self.custom) do
if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_DPS"]) then
have = true
break
end
end
if (not have) then
setmetatable (DamageActivityTime, _detalhes.atributo_custom)
DamageActivityTime.__index = _detalhes.atributo_custom
self.custom [#self.custom+1] = DamageActivityTime
end
local HealActivityTime = {
name = Loc ["STRING_CUSTOM_ACTIVITY_HPS"],
icon = [[Interface\ICONS\Achievement_PVP_G_06]],
attribute = false,
spellid = false,
author = "Details!",
desc = Loc ["STRING_CUSTOM_ACTIVITY_HPS_DESC"],
source = false,
target = false,
total_script = [[
local value, top, total, combat, instance = ...
local minutos, segundos = math.floor (value/60), math.floor (value%60)
return minutos .. "m " .. segundos .. "s"
]],
percent_script = [[
local value, top, total, combat, instance = ...
@@ -1189,86 +1248,39 @@
local combat, instance_container, instance = ...
local total, top, amount = 0, 0, 0
--get the heal actor container
local heal_container = combat:GetActorList ( DETAILS_ATTRIBUTE_HEAL )
--do the loop:
for _, player in ipairs ( heal_container ) do
if (player.grupo) then
local activity = player:Tempo()
total = total + activity
amount = amount + 1
--add amount to the player
instance_container:AddValue (player, activity)
if (activity > top) then
top = activity
end
end
end
--get the damage actor container
local damage_container = combat:GetActorList ( DETAILS_ATTRIBUTE_DAMAGE )
--get the misc actor container
local damage_container = combat:GetActorList ( DETAILS_ATTRIBUTE_HEAL )
--do the loop:
for _, player in ipairs ( damage_container ) do
if (player.grupo) then
local activity = player:Tempo()
total = total + activity
if (not instance_container._NameIndexTable [player:Name()]) then
amount = amount + 1
end
amount = amount + 1
--add amount to the player
local value = instance_container:AddValue (player, activity)
if (value > top) then
top = value
end
instance_container:AddValue (player, activity)
end
end
--return:
return total, top, amount
return total, combat:GetCombatTime(), amount
]],
tooltip = [[
--init:
local player, combat, instance = ...
local damage_actor = combat (DETAILS_ATTRIBUTE_DAMAGE, player:Name())
if (damage_actor) then
local damage_activity = damage_actor:Tempo()
local minutos1, segundos1 = math.floor (damage_activity/60), math.floor (damage_activity%60)
GameCooltip:AddLine ("Damage Activity", minutos1 .. "m " .. segundos1 .. "s")
_detalhes:AddTooltipBackgroundStatusbar()
GameCooltip:AddIcon ('Interface\\ICONS\\Achievement_PVP_H_06', 1, 1, 14, 14)
else
GameCooltip:AddLine ("Damage Activity", "0m 0s")
end
local heal_actor = combat (DETAILS_ATTRIBUTE_HEAL, player:Name())
if (heal_actor) then
local heal_activity = heal_actor:Tempo()
local minutos2, segundos2 = math.floor (heal_activity/60), math.floor (heal_activity%60)
GameCooltip:AddLine ("Heal Activity", minutos2 .. "m " .. segundos2 .. "s")
_detalhes:AddTooltipBackgroundStatusbar()
GameCooltip:AddIcon ('Interface\\ICONS\\Achievement_PVP_G_06', 1, 1, 14, 14)
else
GameCooltip:AddLine ("Heal Activity", "0m 0s")
end
]],
}
--/run _detalhes:AddDefaultCustomDisplays()
local have = false
for _, custom in ipairs (self.custom) do
if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_ALL"]) then
if (custom.name == Loc ["STRING_CUSTOM_ACTIVITY_HPS"]) then
have = true
break
end
end
if (not have) then
setmetatable (ActivityTime, _detalhes.atributo_custom)
ActivityTime.__index = _detalhes.atributo_custom
self.custom [#self.custom+1] = ActivityTime
setmetatable (HealActivityTime, _detalhes.atributo_custom)
HealActivityTime.__index = _detalhes.atributo_custom
self.custom [#self.custom+1] = HealActivityTime
end
end
+11 -4
View File
@@ -261,7 +261,7 @@ end
if (config) then
if (not _detalhes.profile_save_pos) then
self.posicao = config.pos
self.posicao = table_deepcopy (config.pos)
end
self.ativa = config.is_open
@@ -269,10 +269,10 @@ end
self.sub_atributo = config.sub_attribute
self.modo = config.mode
self.segmento = config.segment
self.snap = config.snap or {}
self.snap = config.snap and table_deepcopy (config.snap) or {}
self.horizontalSnap = config.horizontalSnap
self.verticalSnap = config.verticalSnap
self.sub_atributo_last = config.sub_atributo_last
self.sub_atributo_last = table_deepcopy (config.sub_atributo_last)
self.isLocked = config.isLocked
self.last_raid_plugin = config.last_raid_plugin
@@ -1041,7 +1041,7 @@ end
atributo = 1, --> dano
sub_atributo = 1, --> damage done
sub_atributo_last = {1, 1, 1, 1, 1},
segmento = -1, --> combate atual
segmento = 0, --> combate atual
modo = modo_grupo,
last_modo = modo_grupo,
LastModo = modo_grupo,
@@ -1958,6 +1958,13 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
_detalhes.popup:Select (1, atributo)
_detalhes.popup:Select (2, instancia.sub_atributo, atributo)
end
--_detalhes:SetTutorialCVar ("ATTRIBUTE_SELECT_TUTORIAL1", nil)
if (not _detalhes:GetTutorialCVar ("ATTRIBUTE_SELECT_TUTORIAL1") and not _detalhes.initializing and not iniciando_instancia) then
if (not _G ["DetailsWelcomeWindow"] or not _G ["DetailsWelcomeWindow"]:IsShown()) then
_detalhes:TutorialBookmark (instancia)
end
end
if (_detalhes.cloud_process) then
+6 -2
View File
@@ -271,7 +271,9 @@
if (func) then
func (player, realm, dversion, arg6, arg7, arg8, arg9)
else
_detalhes:Msg ("comm prefix not found:", prefix)
if (_detalhes.debug) then
_detalhes:Msg ("comm prefix not found:", prefix)
end
end
end
end
@@ -318,7 +320,9 @@
if (func) then
func (_select (2, _detalhes:Deserialize (data)))
else
_detalhes:Msg ("comm prefix not found:", prefix)
if (_detalhes.debug) then
_detalhes:Msg ("comm prefix not found:", prefix)
end
end
end
+2
View File
@@ -151,6 +151,8 @@
GameCooltip:SetOption ("IgnoreButtonAutoHeight", true)
GameCooltip:SetColor (1, 0.5, 0.5, 0.5, 0.5)
GameCooltip:SetBackdrop (1, _detalhes.tooltip_backdrop, nil, _detalhes.tooltip_border_color)
--[[title]] GameCooltip:AddLine (button.__name, nil, 1, "orange", nil, 12, SharedMedia:Fetch ("font", "Friz Quadrata TT"))
GameCooltip:AddIcon (button.__icon, 1, 1, 16, 16)
----[[desc]] GameCooltip:AddLine (button.tooltip)
+166 -1
View File
@@ -222,7 +222,7 @@
local _scale = self.baseframe:GetEffectiveScale()
local _UIscale = _UIParent:GetScale()
local novo_x = self.posicao[self.mostrando].x*_UIscale/_scale
local novo_y = self.posicao[self.mostrando].y*_UIscale/_scale
@@ -708,6 +708,171 @@
end
end
--> tutorial bookmark
function _detalhes:TutorialBookmark (instance)
_detalhes:SetTutorialCVar ("ATTRIBUTE_SELECT_TUTORIAL1", true)
local func = function()
local f = CreateFrame ("frame", nil, instance.baseframe)
f:SetAllPoints();
f:SetFrameStrata ("FULLSCREEN")
f:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 16})
f:SetBackdropColor (0, 0, 0, 0.8)
f.alert = CreateFrame ("frame", "DetailsTutorialBookmarkAlert", UIParent, "ActionBarButtonSpellActivationAlert")
f.alert:SetPoint ("topleft", f, "topleft")
f.alert:SetPoint ("bottomright", f, "bottomright")
f.alert.animOut:Stop()
f.alert.animIn:Play()
f.text = f:CreateFontString (nil, "overlay", "GameFontNormal")
f.text:SetText (Loc ["STRING_MINITUTORIAL_BOOKMARK1"])
f.text:SetWidth (f:GetWidth()-15)
f.text:SetPoint ("center", f)
f.text:SetJustifyH ("center")
f.bg = f:CreateTexture (nil, "border")
f.bg:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Parchment-Horizontal-Desaturated]])
f.bg:SetAllPoints()
f.bg:SetAlpha (0.8)
f.textbg = f:CreateTexture (nil, "artwork")
f.textbg:SetTexture ([[Interface\ACHIEVEMENTFRAME\UI-Achievement-RecentHeader]])
f.textbg:SetPoint ("center", f)
f.textbg:SetAlpha (0.4)
f.textbg:SetTexCoord (0, 1, 0, 24/32)
f:SetScript ("OnMouseDown", function (self, button)
if (button == "RightButton") then
f.alert.animIn:Stop()
f.alert.animOut:Play()
_detalhes.switch:ShowMe (instance)
f:Hide()
end
end)
end
_detalhes:GetFramework():ShowTutorialAlertFrame ("How to Use Bookmarks", "switch fast between displays", func)
end
--> config bookmarks
function _detalhes:OpenBookmarkConfig()
if (not _G.DetailsBookmarkManager) then
gump:CreateSimplePanel (UIParent, 300, 480, "Manage Bookmarks", "DetailsBookmarkManager")
local panel = _G.DetailsBookmarkManager
panel.blocks = {}
local clear_func = function (id)
if (_detalhes.switch.table [id]) then
_detalhes.switch.table [id].atributo = nil
_detalhes.switch.table [id].sub_atributo = nil
panel:Refresh()
_detalhes.switch:Update()
end
end
local select_attribute = function (_, _, _, attribute, sub_atribute)
if (not sub_atribute) then
return
end
_detalhes.switch.table [panel.selecting_slot].atributo = attribute
_detalhes.switch.table [panel.selecting_slot].sub_atributo = sub_atribute
panel:Refresh()
_detalhes.switch:Update()
end
local cooltip_color = {.1, .1, .1, .3}
local set_att = function (id, _, self)
panel.selecting_slot = id
GameCooltip:Reset()
GameCooltip:SetType (3)
GameCooltip:SetOwner (self)
_detalhes:MontaAtributosOption (_detalhes:GetInstance(1), select_attribute)
GameCooltip:SetColor (1, cooltip_color)
GameCooltip:SetColor (2, cooltip_color)
GameCooltip:SetOption ("HeightAnchorMod", -7)
GameCooltip:ShowCooltip()
end
local button_backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 64, insets = {left=0, right=0, top=0, bottom=0}}
local set_onenter = function (self, capsule)
self:SetBackdropColor (1, 1, 1, 0.9)
capsule.icon:SetBlendMode ("ADD")
end
local set_onleave = function (self, capsule)
self:SetBackdropColor (0, 0, 0, 0.5)
capsule.icon:SetBlendMode ("BLEND")
end
for i = 1, 40 do
local clear = gump:CreateButton (panel, clear_func, 16, 16, nil, i, nil, [[Interface\Glues\LOGIN\Glues-CheckBox-Check]])
if (i%2 ~= 0) then
--impar
clear:SetPoint (15, (( i*10 ) * -1) - 35) --left
else
--par
local o = i-1
clear:SetPoint (150, (( o*10 ) * -1) - 35) --right
end
local set = gump:CreateButton (panel, set_att, 16, 16, nil, i)
set:SetPoint ("left", clear, "right")
set:SetPoint ("right", clear, "right", 110, 0)
set:SetBackdrop (button_backdrop)
set:SetBackdropColor (0, 0, 0, 0.5)
set:SetHook ("OnEnter", set_onenter)
set:SetHook ("OnLeave", set_onleave)
local icon = gump:CreateImage (set, nil, 16, 16, nil, nil, "icon")
icon:SetPoint ("left", clear, "right", 2, 0)
local label = gump:CreateLabel (set, "")
label:SetPoint ("left", icon, "right", 2, 0)
tinsert (panel.blocks, {icon = icon, label = label})
end
local normal_coords = {0, 1, 0, 1}
local unknown_coords = {157/512, 206/512, 39/512, 89/512}
function panel:Refresh()
local bookmarks = _detalhes.switch.table
for i = 1, 40 do
local bookmark = bookmarks [i]
local this_block = panel.blocks [i]
if (bookmark and bookmark.atributo and bookmark.sub_atributo) then
if (bookmark.atributo == 5) then --> custom
local CustomObject = _detalhes.custom [bookmark.sub_atributo]
if (not CustomObject) then --> ele já foi deletado
this_block.label.text = "-- x -- x --"
this_block.icon.texture = "Interface\\ICONS\\Ability_DualWield"
this_block.icon.texcoord = normal_coords
else
this_block.label.text = CustomObject.name
this_block.icon.texture = CustomObject.icon
this_block.icon.texcoord = normal_coords
end
else
this_block.label.text = _detalhes.sub_atributos [bookmark.atributo].lista [bookmark.sub_atributo]
this_block.icon.texture = _detalhes.sub_atributos [bookmark.atributo].icones [bookmark.sub_atributo] [1]
this_block.icon.texcoord = _detalhes.sub_atributos [bookmark.atributo].icones [bookmark.sub_atributo] [2]
end
else
this_block.label.text = "-- x -- x --"
this_block.icon.texture = [[Interface\AddOns\Details\images\icons]]
this_block.icon.texcoord = unknown_coords
end
end
end
end
_G.DetailsBookmarkManager:Show()
_G.DetailsBookmarkManager:Refresh()
end
--> tutorial bubbles
do
--[1] criar nova instancia
+61
View File
@@ -1654,3 +1654,64 @@ function gump:CreateChartPanel (parent, w, h, name)
return f
end
local simple_panel_counter = 1
local simple_panel_mouse_down = function (self, button)
if (button == "RightButton") then
if (self.IsMoving) then
self.IsMoving = false
self:StopMovingOrSizing()
end
self:Hide()
return
end
self.IsMoving = true
self:StartMoving()
end
local simple_panel_mouse_up = function (self, button)
if (self.IsMoving) then
self.IsMoving = false
self:StopMovingOrSizing()
end
end
local simple_panel_settitle = function (self, title)
self.title:SetText (title)
end
function gump:CreateSimplePanel (parent, w, h, title, name)
if (not name) then
name = "DetailsSimplePanel" .. simple_panel_counter
end
if (not parent) then
parent = UIParent
end
local f = CreateFrame ("frame", name, UIParent)
f:SetSize (w or 400, h or 250)
f:SetPoint ("center", UIParent, "center", 0, 0)
f:SetFrameStrata ("FULLSCREEN")
f:EnableMouse()
f:SetMovable (true)
tinsert (UISpecialFrames, name)
f:SetScript ("OnMouseDown", simple_panel_mouse_down)
f:SetScript ("OnMouseUp", simple_panel_mouse_up)
local bg = f:CreateTexture (nil, "background")
bg:SetAllPoints (f)
bg:SetTexture ([[Interface\AddOns\Details\images\welcome]])
local close = CreateFrame ("button", name .. "Close", f, "UIPanelCloseButton")
close:SetSize (32, 32)
close:SetPoint ("topright", f, "topright", 0, -12)
f.title = gump:CreateLabel (f, title or "", 12, nil, "GameFontNormal")
f.title:SetPoint ("top", f, "top", 0, -22)
f.SetTitle = simple_panel_settitle
simple_panel_counter = simple_panel_counter + 1
return f
end
+17 -5
View File
@@ -103,6 +103,10 @@ end
function _detalhes:GetProfile (name, create)
--> get the profile, create and return
if (not name) then
name = _detalhes:GetCurrentProfileName()
end
local profile = _detalhes_global.__profiles [name]
if (not profile and not create) then
@@ -340,6 +344,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
instance:LoadLocalInstanceConfig()
--> check window positioning
if (_detalhes.profile_save_pos) then
--print ("is profile save pos", skin.__pos.normal.x, skin.__pos.normal.y)
if (skin.__pos) then
instance.posicao = table_deepcopy (skin.__pos)
else
@@ -361,23 +366,25 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
instance.posicao.normal = {x = 1, y = 1, w = 300, h = 200}
end
end
--> open the instance
if (instance:IsEnabled()) then
if (not instance.baseframe) then
instance:AtivarInstancia()
end
instance:LockInstance (instance.isLocked)
instance:RestoreMainWindowPosition()
instance:ReajustaGump()
instance:SaveMainWindowPosition()
instance:ChangeSkin()
else
instance.skin = skin.skin
end
instances_loaded = instances_loaded + 1
end
--> move unused instances for unused container
@@ -694,7 +701,7 @@ local default_profile = {
},
--> minimap
minimap = {hide = false, radius = 160, minimapPos = 220, onclick_what_todo = 1, text_type = 1},
minimap = {hide = false, radius = 160, minimapPos = 220, onclick_what_todo = 1, text_type = 1, text_format = 3},
--> horcorner
hotcorner_topleft = {hide = false},
@@ -778,7 +785,7 @@ local default_profile = {
--> skins
standard_skin = false,
skin = "Default Skin",
profile_save_pos = false,
profile_save_pos = true,
--> tooltip
tooltip = {
@@ -870,7 +877,12 @@ local default_global_data = {
lastUpdateWarning = 0,
report_where = "SAY",
--> switch tables
switchSaved = {slots = 6, table = {}},
switchSaved = {slots = 4, table = {
{["atributo"] = 1, ["sub_atributo"] = 1}, --damage done
{["atributo"] = 2, ["sub_atributo"] = 1}, --healing done
{["atributo"] = 1, ["sub_atributo"] = 6}, --enemies
{["atributo"] = 4, ["sub_atributo"] = 5}, --deaths
}},
report_pos = {1, 1},
--> tutorial
tutorial = {
+18 -3
View File
@@ -21,7 +21,8 @@ local is_exception = {
function _detalhes:SaveLocalInstanceConfig()
for index, instance in _detalhes:ListInstances() do
local a1, a2 = instance:GetDisplay()
_detalhes.local_instances_config [index] = {
local t = {
pos = table_deepcopy (instance:GetPosition()),
is_open = instance:IsEnabled(),
attribute = a1,
@@ -36,9 +37,23 @@ function _detalhes:SaveLocalInstanceConfig()
last_raid_plugin = instance.last_raid_plugin
}
if (_detalhes.local_instances_config [index].isLocked == nil) then
_detalhes.local_instances_config [index].isLocked = false
if (t.isLocked == nil) then
t.isLocked = false
end
if (_detalhes.profile_save_pos) then
local cprofile = _detalhes:GetProfile()
local skin = cprofile.instances [instance:GetId()]
if (skin) then
t.pos = table_deepcopy (skin.__pos)
t.horizontalSnap = skin.__snapH
t.verticalSnap = skin.__snapV
t.snap = table_deepcopy (skin.__snap)
t.is_open = skin.__was_opened
t.isLocked = skin.__locked
end
end
_detalhes.local_instances_config [index] = t
end
end
+18 -6
View File
@@ -37,6 +37,14 @@ local _
_detalhes:SetTooltipBackdrop ("Blizzard Tooltip", 16, {1, 1, 1, 1})
_detalhes:DelayOptionsRefresh()
end
local set_tooltip_elvui1 = function()
_detalhes:SetTooltipBackdrop ("Blizzard Tooltip", 16, {0, 0, 0, 1})
_detalhes:DelayOptionsRefresh()
end
local set_tooltip_elvui2 = function()
_detalhes:SetTooltipBackdrop ("Blizzard Tooltip", 16, {1, 1, 1, 0})
_detalhes:DelayOptionsRefresh()
end
--> install default skins:
_detalhes:InstallSkin ("Default Skin", {
@@ -107,6 +115,7 @@ local _
skin_options = {
{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"]},
}
})
@@ -170,6 +179,7 @@ local _
skin_options = {
{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"]},
}
})
@@ -236,6 +246,7 @@ local _
skin_options = {
{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"]},
}
})
@@ -301,6 +312,7 @@ local _
skin_options = {
{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"]},
}
})
@@ -383,6 +395,7 @@ local _
skin_options = {
{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"]},
}
})
@@ -568,10 +581,7 @@ local _
end
local set_tooltip_elvui = function()
_detalhes:SetTooltipBackdrop ("Blizzard Tooltip", 16, {0, 0, 0, 1})
_detalhes:DelayOptionsRefresh()
end
_detalhes:InstallSkin ("ElvUI Frame Style", {
file = [[Interface\AddOns\Details\images\skins\elvui]],
@@ -667,7 +677,8 @@ 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_ELVUI_BUTTON2"], func = set_tooltip_elvui, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2"], func = set_tooltip_elvui1, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = set_tooltip_elvui2, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]},
}
})
@@ -813,7 +824,8 @@ 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_ELVUI_BUTTON2"], func = set_tooltip_elvui, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2"], func = set_tooltip_elvui1, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON2_DESC"]},
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = set_tooltip_elvui2, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]},
}
})
+6 -4
View File
@@ -242,6 +242,8 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> broker dps stuff
local ToKFunctions = _detalhes.ToKFunctions
local broker_functions = {
-- raid dps [1]
function()
@@ -250,7 +252,7 @@
if (not time or time == 0) then
return 0
else
return _detalhes:comma_value (_math_floor (combat.totals_grupo[1] / time))
return ToKFunctions [_detalhes.minimap.text_format] (_, combat.totals_grupo[1] / time)
end
end,
-- raid hps [2]
@@ -260,7 +262,7 @@
if (not time or time == 0) then
return 0
else
return _detalhes:comma_value (_math_floor (combat.totals_grupo[2] / time))
return ToKFunctions [_detalhes.minimap.text_format] (_, combat.totals_grupo[2] / time)
end
end,
-- elapsed time
@@ -274,7 +276,7 @@
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"] .. ": " .. _math_floor (player_actor.total / combat_time)
return Loc ["STRING_ATTRIBUTE_DAMAGE_DPS"] .. ": " .. ToKFunctions [_detalhes.minimap.text_format] (_, player_actor.total / combat_time)
else
return 0
end
@@ -284,7 +286,7 @@
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"] .. ": " .. _math_floor (player_actor.total / combat_time)
return Loc ["STRING_ATTRIBUTE_HEAL_HPS"] .. ": " .. ToKFunctions [_detalhes.minimap.text_format] (_, player_actor.total / combat_time)
else
return 0
end
+45 -1
View File
@@ -1462,6 +1462,38 @@ function window:CreateFrame19()
frame19.brokerTextDropdown:SetPoint ("left", frame19.brokerTextLabel, "right", 2, 0)
window:CreateLineBackground2 (frame19, "brokerTextDropdown", "brokerTextLabel", Loc ["STRING_OPTIONS_DATABROKER_TEXT_DESC"])
end
--number format
g:NewLabel (frame19, _, "$parentBrokerNumberAbbreviateLabel", "BrokerNumberAbbreviateLabel", Loc ["STRING_OPTIONS_PS_ABBREVIATE"], "GameFontHighlightLeft")
--
local onSelectTimeAbbreviation = function (_, _, abbreviationtype)
_detalhes.minimap.text_format = abbreviationtype
end
local icon = [[Interface\COMMON\mini-hourglass]]
local iconcolor = {1, 1, 1, .5}
local abbreviationOptions = {
{value = 1, label = Loc ["STRING_OPTIONS_PS_ABBREVIATE_NONE"], desc = Loc ["STRING_EXAMPLE"] .. ": 305.500 -> 305500", onclick = onSelectTimeAbbreviation, icon = icon, iconcolor = iconcolor}, --, desc = ""
{value = 2, label = Loc ["STRING_OPTIONS_PS_ABBREVIATE_TOK"], desc = Loc ["STRING_EXAMPLE"] .. ": 305.500 -> 305.5K", onclick = onSelectTimeAbbreviation, icon = icon, iconcolor = iconcolor}, --, desc = ""
{value = 3, label = Loc ["STRING_OPTIONS_PS_ABBREVIATE_TOK2"], desc = Loc ["STRING_EXAMPLE"] .. ": 305.500 -> 305K", onclick = onSelectTimeAbbreviation, icon = icon, iconcolor = iconcolor}, --, desc = ""
{value = 4, label = Loc ["STRING_OPTIONS_PS_ABBREVIATE_TOK0"], desc = Loc ["STRING_EXAMPLE"] .. ": 25.305.500 -> 25M", onclick = onSelectTimeAbbreviation, icon = icon, iconcolor = iconcolor}, --, desc = ""
{value = 5, label = Loc ["STRING_OPTIONS_PS_ABBREVIATE_TOKMIN"], desc = Loc ["STRING_EXAMPLE"] .. ": 305.500 -> 305.5k", onclick = onSelectTimeAbbreviation, icon = icon, iconcolor = iconcolor}, --, desc = ""
{value = 6, label = Loc ["STRING_OPTIONS_PS_ABBREVIATE_TOK2MIN"], desc = Loc ["STRING_EXAMPLE"] .. ": 305.500 -> 305k", onclick = onSelectTimeAbbreviation, icon = icon, iconcolor = iconcolor}, --, desc = ""
{value = 7, label = Loc ["STRING_OPTIONS_PS_ABBREVIATE_TOK0MIN"], desc = Loc ["STRING_EXAMPLE"] .. ": 25.305.500 -> 25m", onclick = onSelectTimeAbbreviation, icon = icon, iconcolor = iconcolor}, --, desc = ""
{value = 8, label = Loc ["STRING_OPTIONS_PS_ABBREVIATE_COMMA"], desc = Loc ["STRING_EXAMPLE"] .. ": 25305500 -> 25.305.500", onclick = onSelectTimeAbbreviation, icon = icon, iconcolor = iconcolor} --, desc = ""
}
local buildAbbreviationMenu = function()
return abbreviationOptions
end
local d = g:NewDropDown (frame19, _, "$parentBrokerNumberAbbreviateDropdown", "BrokerNumberAbbreviateDropdown", 160, 20, buildAbbreviationMenu, _detalhes.minimap.text_format)
d.onenter_backdrop = dropdown_backdrop_onenter
d.onleave_backdrop = dropdown_backdrop_onleave
d:SetBackdrop (dropdown_backdrop)
d:SetBackdropColor (unpack (dropdown_backdrop_onleave))
frame19.BrokerNumberAbbreviateDropdown:SetPoint ("left", frame19.BrokerNumberAbbreviateLabel, "right", 2, 0)
window:CreateLineBackground2 (frame19, "BrokerNumberAbbreviateDropdown", "BrokerNumberAbbreviateLabel", Loc ["STRING_OPTIONS_PS_ABBREVIATE_DESC"])
--> anchors:
@@ -1478,6 +1510,7 @@ function window:CreateFrame19()
{"hotcornerLabel", 5},
{"brokerAnchorLabel", 6, true},
{"brokerTextLabel", 7},
{"BrokerNumberAbbreviateLabel", 8},
}
window:arrange_menu (frame19, left_side, x, -90)
@@ -3308,7 +3341,7 @@ function window:CreateFrame1()
--> window controls
local buttons_width = 140
local buttons_width = 160
--lock unlock
g:NewButton (frame1, _, "$parentLockButton", "LockButton", buttons_width, 18, _detalhes.lock_instance_function, nil, nil, nil, Loc ["STRING_OPTIONS_WC_LOCK"], 1)
@@ -3341,6 +3374,14 @@ function window:CreateFrame1()
frame1.CreateWindowButton:SetIcon ([[Interface\Buttons\UI-AttributeButton-Encourage-Up]])
frame1.CreateWindowButton:SetTextColor (button_color_rgb)
--config bookmarks
g:NewButton (frame1, _, "$parentBookmarkButton", "BookmarkButton", buttons_width, 18, _detalhes.OpenBookmarkConfig, nil, nil, nil, Loc ["STRING_OPTIONS_WC_BOOKMARK"], 1)
frame1.BookmarkButton:InstallCustomTexture()
window:CreateLineBackground2 (frame1, "BookmarkButton", "BookmarkButton", Loc ["STRING_OPTIONS_WC_BOOKMARK_DESC"], nil, {1, 0.8, 0}, button_color_rgb)
frame1.BookmarkButton:SetIcon ([[Interface\Glues\CharacterSelect\Glues-AddOn-Icons]], nil, nil, nil, {0.75, 1, 0, 1})
frame1.BookmarkButton:SetTextColor (button_color_rgb)
--> anchors
@@ -3381,6 +3422,7 @@ function window:CreateFrame1()
{"BreakSnapButton", 12},
{"CloseButton", 11},
{"CreateWindowButton", 13, true},
{"BookmarkButton", 14},
}
window:arrange_menu (frame1, left_side, window.left_start_at, window.top_start_at)
@@ -8229,7 +8271,9 @@ function window:update_all (editing_instance)
--> window 19
_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.DetailsOptionsWindow19BrokerNumberAbbreviateDropdown.MyObject:Select (_detalhes.minimap.text_format)
if (not _G.HotCorners) then
_G.DetailsOptionsWindow19HotcornerSlider.MyObject:Disable()
+13 -4
View File
@@ -563,6 +563,12 @@ local function move_janela (baseframe, iniciando, instancia)
baseframe.isMoving = false
baseframe:SetScript ("OnUpdate", nil)
for _, ins in _detalhes:ListInstances() do
if (ins.baseframe) then
ins.baseframe:SetUserPlaced (false)
end
end
--baseframe:SetClampRectInsets (unpack (_detalhes.window_clamp))
if (instancia_alvo) then
@@ -2339,7 +2345,11 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
-- main frames -----------------------------------------------------------------------------------------------------------------------------------------------
--> create the base frame, everything connect in this frame except the rows.
local baseframe = CreateFrame ("scrollframe", "DetailsBaseFrame"..ID, _UIParent)
local baseframe = CreateFrame ("scrollframe", "DetailsBaseFrame"..ID, _UIParent) --
baseframe:SetMovable (true)
baseframe:SetResizable (true)
baseframe:SetUserPlaced (false)
baseframe.instance = instancia
baseframe:SetFrameStrata (baseframe_strata)
baseframe:SetFrameLevel (2)
@@ -2480,8 +2490,6 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
baseframe:SetPoint ("center", _UIParent)
baseframe:EnableMouseWheel (false)
baseframe:EnableMouse (true)
baseframe:SetMovable (true)
baseframe:SetResizable (true)
baseframe:SetMinResize (150, 7)
baseframe:SetMaxResize (_detalhes.max_window_size.width, _detalhes.max_window_size.height)
@@ -5814,7 +5822,7 @@ end
self.instance.baseframe.cabecalho.button_mouse_over = true
GameCooltip:Reset()
GameCooltip:SetOption ("ButtonsYMod", -2)
GameCooltip:SetOption ("ButtonsYMod", -4)
GameCooltip:SetOption ("ButtonsYModSub", -2)
GameCooltip:SetOption ("YSpacingMod", 0)
GameCooltip:SetOption ("YSpacingModSub", -3)
@@ -5824,6 +5832,7 @@ end
GameCooltip:SetOption ("IgnoreButtonAutoHeightSub", false)
GameCooltip:SetOption ("SubMenuIsTooltip", true)
GameCooltip:SetOption ("FixedWidthSub", 180)
GameCooltip:SetOption ("FixedHeight", 30)
local font = SharedMedia:Fetch ("font", "Friz Quadrata TT")
GameCooltip:AddLine (Loc ["STRING_MENU_CLOSE_INSTANCE"], nil, 1, "white", nil, _detalhes.font_sizes.menus, font)
+1
View File
@@ -180,6 +180,7 @@ function _detalhes:OpenWelcomeWindow ()
if (instance and instance.ativa) then
if (instance.skin ~= "ElvUI Frame Style") then
instance:ChangeSkin ("ElvUI Frame Style")
_detalhes:SetTooltipBackdrop ("Blizzard Tooltip", 16, {1, 1, 1, 0})
end
end
+15 -11
View File
@@ -152,27 +152,27 @@ function _detalhes.switch:ShowMe (instancia)
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.9)
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 ("Bookmarks gives quick access to favorite displays.")
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", 0, -20)
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 ("Use right click to close the bookmark panel.")
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", 0, -10)
_G [checkbox:GetName().."Text"]:SetText ("Don't show this again.")
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
@@ -249,6 +249,9 @@ function _detalhes.switch:OnRemoveCustom (CustomIndex)
end
end
local default_coords = {0, 1, 0, 1}
local unknown_coords = {157/512, 206/512, 39/512, 89/512}
function _detalhes.switch:Update()
local slots = _detalhes.switch.slots
@@ -289,12 +292,13 @@ function _detalhes.switch:Update()
if (options.atributo == 5) then --> custom
local CustomObject = _detalhes.custom [options.sub_atributo]
if (not CustomObject) then --> ele já foi deletado
icone = "Interface\\ICONS\\Ability_DualWield"
coords = {0, 1, 0, 1}
--icone = "Interface\\ICONS\\Ability_DualWield"
icone = [[Interface\AddOns\Details\images\icons]]
coords = unknown_coords
name = Loc ["STRING_SWITCH_CLICKME"]
else
icone = CustomObject.icon
coords = {0, 1, 0, 1}
coords = default_coords
name = CustomObject.name
end
else
@@ -303,8 +307,8 @@ function _detalhes.switch:Update()
name = _detalhes.sub_atributos [options.atributo].lista [options.sub_atributo]
end
else
icone = "Interface\\ICONS\\Ability_DualWield"
coords = {0, 1, 0, 1}
icone = [[Interface\AddOns\Details\images\icons]]
coords = unknown_coords
name = Loc ["STRING_SWITCH_CLICKME"]
end
BIN
View File
Binary file not shown.