- Finished another cosmetic revamp on options panel.

- Rewrite on Raid Plugins Support, now can open more then 1 plugins at once on diferent windows.
- Functions inside custom right text now receives the actor object as first parameter.
- Added a large text editor for make changes on custom texts.
- Added cosmetic menus for report and erase segments button.
- Added new option for add borders on the bars.
- Added Death Barrier as a absorb spell.
- Speed improvaments on bar animations.
- Fixed a bug on overheal tooltip where was showing the Hps instead of overheal.
- Fixed few issues when ignoring combats with 5 seconds or less.
- Fixed bug when reloging inside a raid or dungeon instance was erasing pet owner database.
- Fixed Data Broker text where was passing the total damage/healing instead of Dps/Hps.

- Fixed a issue with _detalhes:Hex(): where wasn't correctly formating number below 16.
- New Api: _detalhes:SetBarBackdropSettings (enabled, size, color, texture): set row border settings.
- New Api: _detalhes:GetInstanceAttributeText(): return the text to show on the title text.
- New Api: _detalhes.RaidTables:DisableRaidMode (instance): turn off the raid mode in the instance.
- New Api: _detalhes:RaidPluginInstalled (plugin_name): return is the plugin is installed.
- New Api: _detalhes.RaidTables:EnableRaidMode (instance, plugin_name): enable the raid mode on the instance.
- New Api: _detalhes.RaidTables:GetAvailablePlugins(): return all plugins which is installed, enabled and not in use.
- New Api: _detalhes.RaidTables:IsAvailable (plugin_name, instance): return if the plugin is available for use.
- New Api: _detalhes.RaidTables:SetInUse (absolute_name, instance_number): declare a plugin as in use by a instance.
- New Api: _detalhes.RaidTables:switch (_, plugin_name, instance): change the plugin shown on the instance.
This commit is contained in:
tercio
2014-05-23 20:58:57 -03:00
parent e2e13288c0
commit b74b58ada6
41 changed files with 2080 additions and 1524 deletions
+18 -3
View File
@@ -28,9 +28,9 @@
-- end
-- @class file
-- @name AceAddon-3.0.lua
-- @release $Id: AceAddon-3.0.lua 1036 2011-08-16 22:45:05Z nevcairiel $
-- @release $Id: AceAddon-3.0.lua 1084 2013-04-27 20:14:11Z nevcairiel $
local MAJOR, MINOR = "AceAddon-3.0", 11
local MAJOR, MINOR = "AceAddon-3.0", 12
local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceAddon then return end -- No Upgrade needed.
@@ -108,6 +108,16 @@ local Enable, Disable, EnableModule, DisableModule, Embed, NewModule, GetModule,
-- used in the addon metatable
local function addontostring( self ) return self.name end
-- Check if the addon is queued for initialization
local function queuedForInitialization(addon)
for i = 1, #AceAddon.initializequeue do
if AceAddon.initializequeue[i] == addon then
return true
end
end
return false
end
--- Create a new AceAddon-3.0 addon.
-- Any libraries you specified will be embeded, and the addon will be scheduled for
-- its OnInitialize and OnEnable callbacks.
@@ -314,7 +324,12 @@ end
-- MyModule:Enable()
function Enable(self)
self:SetEnabledState(true)
return AceAddon:EnableAddon(self)
-- nevcairiel 2013-04-27: don't enable an addon/module if its queued for init still
-- it'll be enabled after the init process
if not queuedForInitialization(self) then
return AceAddon:EnableAddon(self)
end
end
--- Disables the Addon, if possible, return true or false depending on success.
+37 -117
View File
@@ -9,7 +9,7 @@
-- make into AceComm.
-- @class file
-- @name AceComm-3.0
-- @release $Id: AceComm-3.0.lua 1019 2011-03-27 12:08:33Z mikk $
-- @release $Id: AceComm-3.0.lua 1107 2014-02-19 16:40:32Z nevcairiel $
--[[ AceComm-3.0
@@ -17,7 +17,7 @@ TODO: Time out old data rotting around from dead senders? Not a HUGE deal since
]]
local MAJOR, MINOR = "AceComm-3.0", 7
local MAJOR, MINOR = "AceComm-3.0", 9
local AceComm,oldminor = LibStub:NewLibrary(MAJOR, MINOR)
@@ -33,6 +33,9 @@ local match = string.match
local tinsert, tconcat = table.insert, table.concat
local error, assert = error, assert
-- WoW APIs
local Ambiguate = Ambiguate
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub, DEFAULT_CHAT_FRAME, geterrorhandler, RegisterAddonMessagePrefix
@@ -45,15 +48,10 @@ local MSG_MULTI_NEXT = "\002"
local MSG_MULTI_LAST = "\003"
local MSG_ESCAPE = "\004"
if not RegisterAddonMessagePrefix then
AceComm.multipart_origprefixes = AceComm.multipart_origprefixes or {} -- e.g. "Prefix\001"="Prefix", "Prefix\002"="Prefix"
AceComm.multipart_reassemblers = AceComm.multipart_reassemblers or {} -- e.g. "Prefix\001"="OnReceiveMultipartFirst"
else
AceComm.multipart_origprefixes = nil
AceComm.multipart_reassemblers = nil
end
-- remove old structures (pre WoW 4.0)
AceComm.multipart_origprefixes = nil
AceComm.multipart_reassemblers = nil
-- the multipart message spool: indexed by a combination of sender+distribution+
AceComm.multipart_spool = AceComm.multipart_spool or {}
@@ -65,12 +63,11 @@ function AceComm:RegisterComm(prefix, method)
method = "OnCommReceived"
end
if RegisterAddonMessagePrefix then
if #prefix>16 then -- TODO: 15?
error("AceComm:RegisterComm(prefix,method): prefix length is limited to 16 characters")
end
RegisterAddonMessagePrefix(prefix)
if #prefix > 16 then -- TODO: 15?
error("AceComm:RegisterComm(prefix,method): prefix length is limited to 16 characters")
end
RegisterAddonMessagePrefix(prefix)
return AceComm._RegisterComm(self, prefix, method) -- created by CallbackHandler
end
@@ -94,26 +91,9 @@ function AceComm:SendCommMessage(prefix, text, distribution, target, prio, callb
) then
error('Usage: SendCommMessage(addon, "prefix", "text", "distribution"[, "target"[, "prio"[, callbackFn, callbackarg]]])', 2)
end
if not RegisterAddonMessagePrefix then
if strfind(prefix, "[\001-\009]") then
if strfind(prefix, "[\001-\003]") then
error("SendCommMessage: Characters \\001--\\003 in prefix are reserved for AceComm metadata", 2)
elseif not warnedPrefix then
-- I have some ideas about future extensions that require more control characters /mikk, 20090808
geterrorhandler()("SendCommMessage: Heads-up developers: Characters \\004--\\009 in prefix are reserved for AceComm future extension")
warnedPrefix = true
end
end
end
local textlen = #text
local maxtextlen;
if not RegisterAddonMessagePrefix then
maxtextlen = 254 - #prefix -- 254 is the max length of prefix + text that can be sent in one message (there's an internal separator char)
else
maxtextlen = 255 -- Yes, the max is 255 even if the dev post said 256. I tested. Char 256+ get silently truncated. /Mikk, 20110327
end
local maxtextlen = 255 -- Yes, the max is 255 even if the dev post said 256. I tested. Char 256+ get silently truncated. /Mikk, 20110327
local queueName = prefix..distribution..(target or "")
local ctlCallback = nil
@@ -124,7 +104,7 @@ function AceComm:SendCommMessage(prefix, text, distribution, target, prio, callb
end
local forceMultipart
if RegisterAddonMessagePrefix and match(text, "^[\001-\009]") then -- 4.1+: see if the first character is a control character
if match(text, "^[\001-\009]") then -- 4.1+: see if the first character is a control character
-- we need to escape the first character with a \004
if textlen+1 > maxtextlen then -- would we go over the size limit?
forceMultipart = true -- just make it multipart, no escape problems then
@@ -141,32 +121,20 @@ function AceComm:SendCommMessage(prefix, text, distribution, target, prio, callb
-- first part
local chunk = strsub(text, 1, maxtextlen)
if not RegisterAddonMessagePrefix then
CTL:SendAddonMessage(prio, prefix..MSG_MULTI_FIRST, chunk, distribution, target, queueName, ctlCallback, maxtextlen)
else
CTL:SendAddonMessage(prio, prefix, MSG_MULTI_FIRST..chunk, distribution, target, queueName, ctlCallback, maxtextlen)
end
CTL:SendAddonMessage(prio, prefix, MSG_MULTI_FIRST..chunk, distribution, target, queueName, ctlCallback, maxtextlen)
-- continuation
local pos = 1+maxtextlen
while pos+maxtextlen <= textlen do
chunk = strsub(text, pos, pos+maxtextlen-1)
if not RegisterAddonMessagePrefix then
CTL:SendAddonMessage(prio, prefix..MSG_MULTI_NEXT, chunk, distribution, target, queueName, ctlCallback, pos+maxtextlen-1)
else
CTL:SendAddonMessage(prio, prefix, MSG_MULTI_NEXT..chunk, distribution, target, queueName, ctlCallback, pos+maxtextlen-1)
end
CTL:SendAddonMessage(prio, prefix, MSG_MULTI_NEXT..chunk, distribution, target, queueName, ctlCallback, pos+maxtextlen-1)
pos = pos + maxtextlen
end
-- final part
chunk = strsub(text, pos)
if not RegisterAddonMessagePrefix then
CTL:SendAddonMessage(prio, prefix..MSG_MULTI_LAST, chunk, distribution, target, queueName, ctlCallback, textlen)
else
CTL:SendAddonMessage(prio, prefix, MSG_MULTI_LAST..chunk, distribution, target, queueName, ctlCallback, textlen)
end
CTL:SendAddonMessage(prio, prefix, MSG_MULTI_LAST..chunk, distribution, target, queueName, ctlCallback, textlen)
end
end
@@ -269,80 +237,32 @@ if not AceComm.callbacks then
"UnregisterAllComm")
end
local OnEvent
AceComm.callbacks.OnUsed = nil
AceComm.callbacks.OnUnused = nil
if not RegisterAddonMessagePrefix then -- 4.0: per-prefix callbacks per part type
function AceComm.callbacks:OnUsed(target, prefix)
AceComm.multipart_origprefixes[prefix..MSG_MULTI_FIRST] = prefix
AceComm.multipart_reassemblers[prefix..MSG_MULTI_FIRST] = "OnReceiveMultipartFirst"
AceComm.multipart_origprefixes[prefix..MSG_MULTI_NEXT] = prefix
AceComm.multipart_reassemblers[prefix..MSG_MULTI_NEXT] = "OnReceiveMultipartNext"
AceComm.multipart_origprefixes[prefix..MSG_MULTI_LAST] = prefix
AceComm.multipart_reassemblers[prefix..MSG_MULTI_LAST] = "OnReceiveMultipartLast"
end
function AceComm.callbacks:OnUnused(target, prefix)
AceComm.multipart_origprefixes[prefix..MSG_MULTI_FIRST] = nil
AceComm.multipart_reassemblers[prefix..MSG_MULTI_FIRST] = nil
AceComm.multipart_origprefixes[prefix..MSG_MULTI_NEXT] = nil
AceComm.multipart_reassemblers[prefix..MSG_MULTI_NEXT] = nil
AceComm.multipart_origprefixes[prefix..MSG_MULTI_LAST] = nil
AceComm.multipart_reassemblers[prefix..MSG_MULTI_LAST] = nil
end
function OnEvent(this, event, ...)
if event == "CHAT_MSG_ADDON" then
local prefix,message,distribution,sender = ...
local reassemblername = AceComm.multipart_reassemblers[prefix]
if reassemblername then
-- multipart: reassemble
local aceCommReassemblerFunc = AceComm[reassemblername]
local origprefix = AceComm.multipart_origprefixes[prefix]
aceCommReassemblerFunc(AceComm, origprefix, message, distribution, sender)
local function OnEvent(self, event, prefix, message, distribution, sender)
if event == "CHAT_MSG_ADDON" then
sender = Ambiguate(sender, "none")
local control, rest = match(message, "^([\001-\009])(.*)")
if control then
if control==MSG_MULTI_FIRST then
AceComm:OnReceiveMultipartFirst(prefix, rest, distribution, sender)
elseif control==MSG_MULTI_NEXT then
AceComm:OnReceiveMultipartNext(prefix, rest, distribution, sender)
elseif control==MSG_MULTI_LAST then
AceComm:OnReceiveMultipartLast(prefix, rest, distribution, sender)
elseif control==MSG_ESCAPE then
AceComm.callbacks:Fire(prefix, rest, distribution, sender)
else
-- single part: fire it off immediately and let CallbackHandler decide if it's registered or not
AceComm.callbacks:Fire(prefix, message, distribution, sender)
-- unknown control character, ignore SILENTLY (dont warn unnecessarily about future extensions!)
end
else
assert(false, "Received "..tostring(event).." event?!")
-- single part: fire it off immediately and let CallbackHandler decide if it's registered or not
AceComm.callbacks:Fire(prefix, message, distribution, sender)
end
else
assert(false, "Received "..tostring(event).." event?!")
end
else -- 4.1+: only one prefix for all
AceComm.callbacks.OnUsed = nil
AceComm.callbacks.OnUnused = nil
function OnEvent(this, event, ...)
if event == "CHAT_MSG_ADDON" then
local prefix,message,distribution,sender = ...
local control, rest = match(message, "^([\001-\009])(.*)")
if control then
if control==MSG_MULTI_FIRST then
AceComm:OnReceiveMultipartFirst(prefix, rest, distribution, sender)
elseif control==MSG_MULTI_NEXT then
AceComm:OnReceiveMultipartNext(prefix, rest, distribution, sender)
elseif control==MSG_MULTI_LAST then
AceComm:OnReceiveMultipartLast(prefix, rest, distribution, sender)
elseif control==MSG_ESCAPE then
AceComm.callbacks:Fire(prefix, rest, distribution, sender)
else
-- unknown control character, ignore SILENTLY (dont warn unnecessarily about future extensions!)
end
else
-- single part: fire it off immediately and let CallbackHandler decide if it's registered or not
AceComm.callbacks:Fire(prefix, message, distribution, sender)
end
else
assert(false, "Received "..tostring(event).." event?!")
end
end
end
AceComm.frame = AceComm.frame or CreateFrame("Frame", "AceComm30Frame")
+167 -368
View File
@@ -1,296 +1,138 @@
--- **AceTimer-3.0** provides a central facility for registering timers.
-- AceTimer supports one-shot timers and repeating timers. All timers are stored in an efficient
-- data structure that allows easy dispatching and fast rescheduling. Timers can be registered, rescheduled
-- data structure that allows easy dispatching and fast rescheduling. Timers can be registered
-- or canceled at any time, even from within a running timer, without conflict or large overhead.\\
-- AceTimer is currently limited to firing timers at a frequency of 0.1s. This constant may change
-- in the future, but for now it seemed like a good compromise in efficiency and accuracy.
-- AceTimer is currently limited to firing timers at a frequency of 0.01s. This constant may change
-- in the future, but for now it's required as animations with lower frequencies are buggy.
--
-- All `:Schedule` functions will return a handle to the current timer, which you will need to store if you
-- need to cancel or reschedule the timer you just registered.
-- need to cancel the timer you just registered.
--
-- **AceTimer-3.0** can be embeded into your addon, either explicitly by calling AceTimer:Embed(MyAddon) or by
-- **AceTimer-3.0** can be embeded into your addon, either explicitly by calling AceTimer:Embed(MyAddon) or by
-- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
-- and can be accessed directly, without having to explicitly call AceTimer itself.\\
-- It is recommended to embed AceTimer, otherwise you'll have to specify a custom `self` on all calls you
-- make into AceTimer.
-- @class file
-- @name AceTimer-3.0
-- @release $Id: AceTimer-3.0.lua 1037 2011-09-02 16:24:08Z mikk $
-- @release $Id: AceTimer-3.0.lua 1079 2013-02-17 19:56:06Z funkydude $
--[[
Basic assumptions:
* In a typical system, we do more re-scheduling per second than there are timer pulses per second
* Regardless of timer implementation, we cannot guarantee timely delivery due to FPS restriction (may be as low as 10)
This implementation:
CON: The smallest timer interval is constrained by HZ (currently 1/10s).
PRO: It will still correctly fire any timer slower than HZ over a length of time, e.g. 0.11s interval -> 90 times over 10 seconds
PRO: In lag bursts, the system simly skips missed timer intervals to decrease load
CON: Algorithms depending on a timer firing "N times per minute" will fail
PRO: (Re-)scheduling is O(1) with a VERY small constant. It's a simple linked list insertion in a hash bucket.
CAUTION: The BUCKETS constant constrains how many timers can be efficiently handled. With too many hash collisions, performance will decrease.
Major assumptions upheld:
- ALLOWS scheduling multiple timers with the same funcref/method
- ALLOWS scheduling more timers during OnUpdate processing
- ALLOWS unscheduling ANY timer (including the current running one) at any time, including during OnUpdate processing
]]
local MAJOR, MINOR = "AceTimer-3.0", 6
local MAJOR, MINOR = "AceTimer-3.0", 16 -- Bump minor on changes
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceTimer then return end -- No upgrade needed
AceTimer.hash = AceTimer.hash or {} -- Array of [0..BUCKET-1] = linked list of timers (using .next member)
-- Linked list gets around ACE-88 and ACE-90.
AceTimer.selfs = AceTimer.selfs or {} -- Array of [self]={[handle]=timerobj, [handle2]=timerobj2, ...}
AceTimer.frame = AceTimer.frame or CreateFrame("Frame", "AceTimer30Frame")
AceTimer.frame = AceTimer.frame or CreateFrame("Frame", "AceTimer30Frame") -- Animation parent
AceTimer.inactiveTimers = AceTimer.inactiveTimers or {} -- Timer recycling storage
AceTimer.activeTimers = AceTimer.activeTimers or {} -- Active timer list
-- Lua APIs
local assert, error, loadstring = assert, error, loadstring
local setmetatable, rawset, rawget = setmetatable, rawset, rawget
local select, pairs, type, next, tostring = select, pairs, type, next, tostring
local floor, max, min = math.floor, math.max, math.min
local tconcat = table.concat
local type, unpack, next, error, pairs, tostring, select = type, unpack, next, error, pairs, tostring, select
-- WoW APIs
local GetTime = GetTime
-- Upvalue our private data
local inactiveTimers = AceTimer.inactiveTimers
local activeTimers = AceTimer.activeTimers
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: DEFAULT_CHAT_FRAME, geterrorhandler
-- Simple ONE-SHOT timer cache. Much more efficient than a full compost for our purposes.
local timerCache = nil
--[[
Timers will not be fired more often than HZ-1 times per second.
Keep at intended speed PLUS ONE or we get bitten by floating point rounding errors (n.5 + 0.1 can be n.599999)
If this is ever LOWERED, all existing timers need to be enforced to have a delay >= 1/HZ on lib upgrade.
If this number is ever changed, all entries need to be rehashed on lib upgrade.
]]
local HZ = 11
--[[
Prime for good distribution
If this number is ever changed, all entries need to be rehashed on lib upgrade.
]]
local BUCKETS = 131
local hash = AceTimer.hash
for i=1,BUCKETS do
hash[i] = hash[i] or false -- make it an integer-indexed array; it's faster than hashes
end
--[[
xpcall safecall implementation
]]
local xpcall = xpcall
local function errorhandler(err)
return geterrorhandler()(err)
end
local function CreateDispatcher(argCount)
local code = [[
local xpcall, eh = ... -- our arguments are received as unnamed values in "..." since we don't have a proper function declaration
local method, ARGS
local function call() return method(ARGS) end
local function dispatch(func, ...)
method = func
if not method then return end
ARGS = ...
return xpcall(call, eh)
end
return dispatch
]]
local ARGS = {}
for i = 1, argCount do ARGS[i] = "arg"..i end
code = code:gsub("ARGS", tconcat(ARGS, ", "))
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
end
local Dispatchers = setmetatable({}, {
__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
local function OnFinished(self)
local id = self.id
if type(self.func) == "string" then
-- We manually set the unpack count to prevent issues with an arg set that contains nil and ends with nil
-- e.g. local t = {1, 2, nil, 3, nil} print(#t) will result in 2, instead of 5. This fixes said issue.
self.object[self.func](self.object, unpack(self.args, 1, self.argsCount))
else
self.func(unpack(self.args, 1, self.argsCount))
end
-- If the id is different it means that the timer was already cancelled
-- and has been used to create a new timer during the OnFinished callback.
if not self.looping and id == self.id then
activeTimers[self.id] = nil
self.args = nil
inactiveTimers[self] = true
end
})
Dispatchers[0] = function(func)
return xpcall(func, errorhandler)
end
local function safecall(func, ...)
return Dispatchers[select('#', ...)](func, ...)
end
local lastint = floor(GetTime() * HZ)
-- --------------------------------------------------------------------
-- OnUpdate handler
--
-- traverse buckets, always chasing "now", and fire timers that have expired
local function OnUpdate()
local now = GetTime()
local nowint = floor(now * HZ)
-- Have we passed into a new hash bucket?
if nowint == lastint then return end
local soon = now + 1 -- +1 is safe as long as 1 < HZ < BUCKETS/2
-- Pass through each bucket at most once
-- Happens on e.g. instance loads, but COULD happen on high local load situations also
for curint = (max(lastint, nowint - BUCKETS) + 1), nowint do -- loop until we catch up with "now", usually only 1 iteration
local curbucket = (curint % BUCKETS)+1
-- Yank the list of timers out of the bucket and empty it. This allows reinsertion in the currently-processed bucket from callbacks.
local nexttimer = hash[curbucket]
hash[curbucket] = false -- false rather than nil to prevent the array from becoming a hash
while nexttimer do
local timer = nexttimer
nexttimer = timer.next
local when = timer.when
if when < soon then
-- Call the timer func, either as a method on given object, or a straight function ref
local callback = timer.callback
if type(callback) == "string" then
safecall(timer.object[callback], timer.object, timer.arg)
elseif callback then
safecall(callback, timer.arg)
else
-- probably nilled out by CancelTimer
timer.delay = nil -- don't reschedule it
end
local delay = timer.delay -- NOW make a local copy, can't do it earlier in case the timer cancelled itself in the callback
if not delay then
-- single-shot timer (or cancelled)
AceTimer.selfs[timer.object][tostring(timer)] = nil
timerCache = timer
else
-- repeating timer
local newtime = when + delay
if newtime < now then -- Keep lag from making us firing a timer unnecessarily. (Note that this still won't catch too-short-delay timers though.)
newtime = now + delay
end
timer.when = newtime
-- add next timer execution to the correct bucket
local bucket = (floor(newtime * HZ) % BUCKETS) + 1
timer.next = hash[bucket]
hash[bucket] = timer
end
else -- if when>=soon
-- reinsert (yeah, somewhat expensive, but shouldn't be happening too often either due to hash distribution)
timer.next = hash[curbucket]
hash[curbucket] = timer
end -- if when<soon ... else
end -- while nexttimer do
end -- for curint=lastint,nowint
lastint = nowint
end
-- ---------------------------------------------------------------------
-- Reg( callback, delay, arg, repeating )
--
-- callback( function or string ) - direct function ref or method name in our object for the callback
-- delay(int) - delay for the timer
-- arg(variant) - any argument to be passed to the callback function
-- repeating(boolean) - repeating timer, or oneshot
--
-- returns the handle of the timer for later processing (canceling etc)
local function Reg(self, callback, delay, arg, repeating)
if type(callback) ~= "string" and type(callback) ~= "function" then
local error_origin = repeating and "ScheduleRepeatingTimer" or "ScheduleTimer"
error(MAJOR..": " .. error_origin .. "(callback, delay, arg): 'callback' - function or method name expected.", 3)
local function new(self, loop, func, delay, ...)
local timer = next(inactiveTimers)
if timer then
inactiveTimers[timer] = nil
else
local anim = AceTimer.frame:CreateAnimationGroup()
timer = anim:CreateAnimation()
timer:SetScript("OnFinished", OnFinished)
end
if type(callback) == "string" then
if type(self)~="table" then
local error_origin = repeating and "ScheduleRepeatingTimer" or "ScheduleTimer"
error(MAJOR..": " .. error_origin .. "(\"methodName\", delay, arg): 'self' - must be a table.", 3)
end
if type(self[callback]) ~= "function" then
local error_origin = repeating and "ScheduleRepeatingTimer" or "ScheduleTimer"
error(MAJOR..": " .. error_origin .. "(\"methodName\", delay, arg): 'methodName' - method not found on target object.", 3)
end
-- Very low delays cause the animations to fail randomly.
-- A limited resolution of 0.01 seems reasonable.
if delay < 0.01 then
delay = 0.01
end
if delay < (1 / (HZ - 1)) then
delay = 1 / (HZ - 1)
end
-- Create and stuff timer in the correct hash bucket
local now = GetTime()
local timer = timerCache or {} -- Get new timer object (from cache if available)
timerCache = nil
timer.object = self
timer.callback = callback
timer.delay = (repeating and delay)
timer.arg = arg
timer.when = now + delay
timer.func = func
timer.looping = loop
timer.args = {...}
timer.argsCount = select("#", ...)
local bucket = (floor((now+delay)*HZ) % BUCKETS) + 1
timer.next = hash[bucket]
hash[bucket] = timer
-- Insert timer in our self->handle->timer registry
local handle = tostring(timer)
local selftimers = AceTimer.selfs[self]
if not selftimers then
selftimers = {}
AceTimer.selfs[self] = selftimers
local anim = timer:GetParent()
if loop then
anim:SetLooping("REPEAT")
else
anim:SetLooping("NONE")
end
selftimers[handle] = timer
selftimers.__ops = (selftimers.__ops or 0) + 1
return handle
timer:SetDuration(delay)
local id = tostring(timer.args)
timer.id = id
activeTimers[id] = timer
anim:Play()
return id
end
--- Schedule a new one-shot timer.
-- The timer will fire once in `delay` seconds, unless canceled before.
-- @param callback Callback function for the timer pulse (funcref or method name).
-- @param delay Delay for the timer, in seconds.
-- @param arg An optional argument to be passed to the callback function.
-- @param ... An optional, unlimited amount of arguments to pass to the callback function.
-- @usage
-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("TimerTest", "AceTimer-3.0")
--
-- function MyAddon:OnEnable()
-- MyAddOn = LibStub("AceAddon-3.0"):NewAddon("MyAddOn", "AceTimer-3.0")
--
-- function MyAddOn:OnEnable()
-- self:ScheduleTimer("TimerFeedback", 5)
-- end
--
-- function MyAddon:TimerFeedback()
-- function MyAddOn:TimerFeedback()
-- print("5 seconds passed")
-- end
function AceTimer:ScheduleTimer(callback, delay, arg)
return Reg(self, callback, delay, arg)
function AceTimer:ScheduleTimer(func, delay, ...)
if not func or not delay then
error(MAJOR..": ScheduleTimer(callback, delay, args...): 'callback' and 'delay' must have set values.", 2)
end
if type(func) == "string" then
if type(self) ~= "table" then
error(MAJOR..": ScheduleTimer(callback, delay, args...): 'self' - must be a table.", 2)
elseif not self[func] then
error(MAJOR..": ScheduleTimer(callback, delay, args...): Tried to register '"..func.."' as the callback, but it doesn't exist in the module.", 2)
end
end
return new(self, nil, func, delay, ...)
end
--- Schedule a repeating timer.
-- The timer will fire every `delay` seconds, until canceled.
-- @param callback Callback function for the timer pulse (funcref or method name).
-- @param delay Delay for the timer, in seconds.
-- @param arg An optional argument to be passed to the callback function.
-- @param ... An optional, unlimited amount of arguments to pass to the callback function.
-- @usage
-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("TimerTest", "AceTimer-3.0")
--
-- function MyAddon:OnEnable()
-- MyAddOn = LibStub("AceAddon-3.0"):NewAddon("MyAddOn", "AceTimer-3.0")
--
-- function MyAddOn:OnEnable()
-- self.timerCount = 0
-- self.testTimer = self:ScheduleRepeatingTimer("TimerFeedback", 5)
-- end
--
-- function MyAddon:TimerFeedback()
-- function MyAddOn:TimerFeedback()
-- self.timerCount = self.timerCount + 1
-- print(("%d seconds passed"):format(5 * self.timerCount))
-- -- run 30 seconds in total
@@ -298,131 +140,106 @@ end
-- self:CancelTimer(self.testTimer)
-- end
-- end
function AceTimer:ScheduleRepeatingTimer(callback, delay, arg)
return Reg(self, callback, delay, arg, true)
function AceTimer:ScheduleRepeatingTimer(func, delay, ...)
if not func or not delay then
error(MAJOR..": ScheduleRepeatingTimer(callback, delay, args...): 'callback' and 'delay' must have set values.", 2)
end
if type(func) == "string" then
if type(self) ~= "table" then
error(MAJOR..": ScheduleRepeatingTimer(callback, delay, args...): 'self' - must be a table.", 2)
elseif not self[func] then
error(MAJOR..": ScheduleRepeatingTimer(callback, delay, args...): Tried to register '"..func.."' as the callback, but it doesn't exist in the module.", 2)
end
end
return new(self, true, func, delay, ...)
end
--- Cancels a timer with the given handle, registered by the same addon object as used for `:ScheduleTimer`
-- Both one-shot and repeating timers can be canceled with this function, as long as the `handle` is valid
--- Cancels a timer with the given id, registered by the same addon object as used for `:ScheduleTimer`
-- Both one-shot and repeating timers can be canceled with this function, as long as the `id` is valid
-- and the timer has not fired yet or was canceled before.
-- @param handle The handle of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
-- @param silent If true, no error is raised if the timer handle is invalid (expired or already canceled)
-- @return True if the timer was successfully cancelled.
function AceTimer:CancelTimer(handle, silent)
if not handle then return end -- nil handle -> bail out without erroring
if type(handle) ~= "string" then
error(MAJOR..": CancelTimer(handle): 'handle' - expected a string", 2) -- for now, anyway
end
local selftimers = AceTimer.selfs[self]
local timer = selftimers and selftimers[handle]
if silent then
if timer then
timer.callback = nil -- don't run it again
timer.delay = nil -- if this is the currently-executing one: don't even reschedule
-- The timer object is removed in the OnUpdate loop
end
return not not timer -- might return "true" even if we double-cancel. we'll live.
else
if not timer then
geterrorhandler()(MAJOR..": CancelTimer(handle[, silent]): '"..tostring(handle).."' - no such timer registered")
return false
end
if not timer.callback then
geterrorhandler()(MAJOR..": CancelTimer(handle[, silent]): '"..tostring(handle).."' - timer already cancelled or expired")
return false
end
timer.callback = nil -- don't run it again
timer.delay = nil -- if this is the currently-executing one: don't even reschedule
return true
end
-- @param id The id of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
function AceTimer:CancelTimer(id)
local timer = activeTimers[id]
if not timer then return false end
local anim = timer:GetParent()
anim:Stop()
activeTimers[id] = nil
timer.args = nil
inactiveTimers[timer] = true
return true
end
--- Cancels all timers registered to the current addon object ('self')
function AceTimer:CancelAllTimers()
if not(type(self) == "string" or type(self) == "table") then
error(MAJOR..": CancelAllTimers(): 'self' - must be a string or a table",2)
end
if self == AceTimer then
error(MAJOR..": CancelAllTimers(): supply a meaningful 'self'", 2)
end
local selftimers = AceTimer.selfs[self]
if selftimers then
for handle,v in pairs(selftimers) do
if type(v) == "table" then -- avoid __ops, etc
AceTimer.CancelTimer(self, handle, true)
end
for k,v in pairs(activeTimers) do
if v.object == self then
AceTimer.CancelTimer(self, k)
end
end
end
--- Returns the time left for a timer with the given handle, registered by the current addon object ('self').
-- This function will raise a warning when the handle is invalid, but not stop execution.
-- @param handle The handle of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
-- @return The time left on the timer, or false if the handle is invalid.
function AceTimer:TimeLeft(handle)
if not handle then return end
if type(handle) ~= "string" then
error(MAJOR..": TimeLeft(handle): 'handle' - expected a string", 2) -- for now, anyway
end
local selftimers = AceTimer.selfs[self]
local timer = selftimers and selftimers[handle]
if not timer then
geterrorhandler()(MAJOR..": TimeLeft(handle): '"..tostring(handle).."' - no such timer registered")
return false
end
return timer.when - GetTime()
--- Returns the time left for a timer with the given id, registered by the current addon object ('self').
-- This function will return 0 when the id is invalid.
-- @param id The id of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
-- @return The time left on the timer.
function AceTimer:TimeLeft(id)
local timer = activeTimers[id]
if not timer then return 0 end
return timer:GetDuration() - timer:GetElapsed()
end
-- ---------------------------------------------------------------------
-- PLAYER_REGEN_ENABLED: Run through our .selfs[] array step by step
-- and clean it out - otherwise the table indices can grow indefinitely
-- if an addon starts and stops a lot of timers. AceBucket does this!
--
-- See ACE-94 and tests/AceTimer-3.0-ACE-94.lua
-- Upgrading
local lastCleaned = nil
local function OnEvent(this, event)
if event~="PLAYER_REGEN_ENABLED" then
return
end
-- Get the next 'self' to process
local selfs = AceTimer.selfs
local self = next(selfs, lastCleaned)
if not self then
self = next(selfs)
end
lastCleaned = self
if not self then -- should only happen if .selfs[] is empty
return
end
-- Time to clean it out?
local list = selfs[self]
if (list.__ops or 0) < 250 then -- 250 slosh indices = ~10KB wasted (worst case!). For one 'self'.
return
end
-- Create a new table and copy all members over
local newlist = {}
local n=0
for k,v in pairs(list) do
newlist[k] = v
if type(v)=="table" and v.callback then -- if the timer is actually live: count it
n=n+1
-- Upgrade from old hash-bucket based timers to animation timers
if oldminor and oldminor < 10 then
-- disable old timer logic
AceTimer.frame:SetScript("OnUpdate", nil)
AceTimer.frame:SetScript("OnEvent", nil)
AceTimer.frame:UnregisterAllEvents()
-- convert timers
for object,timers in pairs(AceTimer.selfs) do
for handle,timer in pairs(timers) do
if type(timer) == "table" and timer.callback then
local id
if timer.delay then
id = AceTimer.ScheduleRepeatingTimer(timer.object, timer.callback, timer.delay, timer.arg)
else
id = AceTimer.ScheduleTimer(timer.object, timer.callback, timer.when - GetTime(), timer.arg)
end
-- change id to the old handle
local t = activeTimers[id]
activeTimers[id] = nil
activeTimers[handle] = t
t.id = handle
end
end
end
newlist.__ops = 0 -- Reset operation count
-- And since we now have a count of the number of live timers, check that it's reasonable. Emit a warning if not.
if n>BUCKETS then
DEFAULT_CHAT_FRAME:AddMessage(MAJOR..": Warning: The addon/module '"..tostring(self).."' has "..n.." live timers. Surely that's not intended?")
AceTimer.selfs = nil
AceTimer.hash = nil
AceTimer.debug = nil
elseif oldminor and oldminor < 13 then
for handle, id in pairs(AceTimer.hashCompatTable) do
local t = activeTimers[id]
if t then
activeTimers[id] = nil
activeTimers[handle] = t
t.id = handle
end
end
selfs[self] = newlist
AceTimer.hashCompatTable = nil
end
-- upgrade existing timers to the latest OnFinished
for timer in pairs(inactiveTimers) do
timer:SetScript("OnFinished", OnFinished)
end
for _,timer in pairs(activeTimers) do
timer:SetScript("OnFinished", OnFinished)
end
-- ---------------------------------------------------------------------
@@ -431,7 +248,7 @@ end
AceTimer.embeds = AceTimer.embeds or {}
local mixins = {
"ScheduleTimer", "ScheduleRepeatingTimer",
"ScheduleTimer", "ScheduleRepeatingTimer",
"CancelTimer", "CancelAllTimers",
"TimeLeft"
}
@@ -444,32 +261,14 @@ function AceTimer:Embed(target)
return target
end
-- AceTimer:OnEmbedDisable( target )
-- AceTimer:OnEmbedDisable(target)
-- target (object) - target object that AceTimer is embedded in.
--
-- cancel all timers registered for the object
function AceTimer:OnEmbedDisable( target )
function AceTimer:OnEmbedDisable(target)
target:CancelAllTimers()
end
for addon in pairs(AceTimer.embeds) do
AceTimer:Embed(addon)
end
-- ---------------------------------------------------------------------
-- Debug tools (expose copies of internals to test suites)
AceTimer.debug = AceTimer.debug or {}
AceTimer.debug.HZ = HZ
AceTimer.debug.BUCKETS = BUCKETS
-- ---------------------------------------------------------------------
-- Finishing touchups
AceTimer.frame:SetScript("OnUpdate", OnUpdate)
AceTimer.frame:SetScript("OnEvent", OnEvent)
AceTimer.frame:RegisterEvent("PLAYER_REGEN_ENABLED")
-- In theory, we could hide&show the frame based on there being timers or not.
-- However, this job is fairly expensive, and the chance that there will
-- actually be zero timers running is diminuitive to say the least.
+3 -3
View File
@@ -35,9 +35,9 @@ end
local CONST_COMM_LOGONREVISION = 2
local CONST_COMM_REQUESTPERSONA = 3
NICKTAG_DEFAULT_AVATAR = [[Interface\EncounterJournal\UI-EJ-BOSS-Default]]
NICKTAG_DEFAULT_BACKGROUND = [[Interface\PetBattles\Weather-ArcaneStorm]]
NICKTAG_DEFAULT_BACKGROUND_CORDS = {0.129609375, 1, 1, 0}
--[[global]] NICKTAG_DEFAULT_AVATAR = [[Interface\EncounterJournal\UI-EJ-BOSS-Default]]
--[[global]] NICKTAG_DEFAULT_BACKGROUND = [[Interface\PetBattles\Weather-ArcaneStorm]]
--[[global]] NICKTAG_DEFAULT_BACKGROUND_CORDS = {0.129609375, 1, 1, 0}
------------------------------------------------------------------------------------------------------------------------------------------------------
--> library stuff
+6 -1
View File
@@ -8,7 +8,7 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0", "LibHotCorners")
_detalhes.userversion = "v1.14.1"
_detalhes.userversion = "v1.14.5"
_detalhes.version = "Alpha 018"
_detalhes.realversion = 18
@@ -75,6 +75,9 @@ do
_detalhes.RaidTables.Plugins = {}
--> name to plugin object
_detalhes.RaidTables.NameTable = {}
--> using by
_detalhes.RaidTables.InstancesInUse = {}
_detalhes.RaidTables.PluginsInUse = {}
--> solo -------------------------------------------------------------------
--> general functions for solo mode plugins
@@ -203,6 +206,8 @@ do
SharedMedia:Register ("statusbar", "Details D'ictum (reverse)", [[Interface\AddOns\Details\images\bar4_reverse]])
SharedMedia:Register ("statusbar", "Details Serenity", [[Interface\AddOns\Details\images\bar_serenity]])
SharedMedia:Register ("background", "Details Ground", [[Interface\AddOns\Details\images\background]])
SharedMedia:Register ("border", "Details BarBorder 1", [[Interface\AddOns\Details\images\border_1]])
SharedMedia:Register ("border", "Details BarBorder 2", [[Interface\AddOns\Details\images\border_2]])
--> global 'vardump' for dump table contents over chat panel
function vardump (t)
+5 -5
View File
@@ -1152,7 +1152,7 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
local formated_dps = SelectedToKFunction (_, dps)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_damage, formated_dps, porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_damage, formated_dps, porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_damage .. " (" .. formated_dps .. ", " .. porcentagem .. "%)") --seta o texto da direita
end
@@ -1165,7 +1165,7 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
local formated_dps = SelectedToKFunction (_, dps)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_dps, formated_damage, porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_dps, formated_damage, porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_dps .. " (" .. formated_damage .. ", " .. porcentagem .. "%)") --seta o texto da direita
end
@@ -1176,7 +1176,7 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
local formated_damage_taken = SelectedToKFunction (_, self.damage_taken)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_damage_taken, "", porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_damage_taken, "", porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_damage_taken .." (" .. porcentagem .. "%)") --seta o texto da direita --
end
@@ -1187,7 +1187,7 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
local formated_friendly_fire = SelectedToKFunction (_, self.friendlyfire_total)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_friendly_fire, "", porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_friendly_fire, "", porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_friendly_fire .. " (" .. porcentagem .. "%)") --seta o texto da direita --
end
@@ -1200,7 +1200,7 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
local formated_dps = SelectedToKFunction (_, dps)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_damage, formated_dps, porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_damage, formated_dps, porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_damage .. " (" .. formated_dps .. ", " .. porcentagem .. "%)") --seta o texto da direita
end
+1 -1
View File
@@ -449,7 +449,7 @@ function atributo_energy:AtualizaBarra (instancia, barras_container, qual_barra,
local formated_energy = SelectedToKFunction (_, esta_e_energy_total)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_energy, "", porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_energy, "", porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_energy .. " (" .. porcentagem .. "%)") --seta o texto da direita
end
+7 -7
View File
@@ -574,7 +574,7 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l
local formated_hps = SelectedToKFunction (_, hps)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_heal, formated_hps, porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_heal, formated_hps, porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_heal .." (" .. formated_hps .. ", " .. porcentagem .. "%)") --seta o texto da direita
end
@@ -587,7 +587,7 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l
local formated_hps = SelectedToKFunction (_, hps)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_hps, formated_heal, porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_hps, formated_heal, porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_hps .. " (" .. formated_heal .. ", " .. porcentagem .. "%)") --seta o texto da direita
end
@@ -598,7 +598,7 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l
local formated_overheal = SelectedToKFunction (_, self.totalover)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_overheal, "", porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_overheal, "", porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_overheal .." (" .. porcentagem .. "%)") --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
end
@@ -609,7 +609,7 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l
local formated_healtaken = SelectedToKFunction (_, self.healing_taken)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_healtaken, "", porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_healtaken, "", porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_healtaken .. " (" .. porcentagem .. "%)") --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
end
@@ -620,7 +620,7 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l
local formated_enemyheal = SelectedToKFunction (_, self.heal_enemy_amt)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_enemyheal, "", porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_enemyheal, "", porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_enemyheal .. " (" .. porcentagem .. "%)") --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
end
@@ -631,7 +631,7 @@ function atributo_heal:AtualizaBarra (instancia, barras_container, qual_barra, l
local formated_absorbs = SelectedToKFunction (_, self.totalabsorb)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_absorbs, "", porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (formated_absorbs, "", porcentagem, self))
else
esta_barra.texto_direita:SetText (formated_absorbs .. " (" .. porcentagem .. "%)") --seta o texto da direita --_cstr("%.1f", dps) .. " - ".. DPS do damage taken não será possivel correto?
end
@@ -978,7 +978,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
elseif (instancia.sub_atributo == 3) then --> overheal
local overheal = ActorHealingTable[i][2]
local total = ActorHealingTable[i][6]
GameCooltip:AddLine (ActorHealingTable[i][4][1] .." (|cFFFF3333" .. _math_floor ( (overheal / (overheal+total)) *100) .. "%|r):", FormatTooltipNumber (_, _math_floor (ActorHealingTable[i][5])).." (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)")
GameCooltip:AddLine (ActorHealingTable[i][4][1] .." (|cFFFF3333" .. _math_floor ( (overheal / (overheal+total)) *100) .. "%|r):", FormatTooltipNumber (_, _math_floor (ActorHealingTable[i][2])).." (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)")
else
GameCooltip:AddLine (ActorHealingTable[i][4][1]..": ", FormatTooltipNumber (_, ActorHealingTable[i][2]).." (".._cstr ("%.1f", ActorHealingTable[i][3]).."%)")
end
+78 -32
View File
@@ -63,6 +63,9 @@ local segmentos = _detalhes.segmentos
--> API: call a function to all enabled instances
function _detalhes:InstanceCall (funcao, ...)
if (type (funcao) == "string") then
funcao = _detalhes [funcao]
end
for index, instance in _ipairs (_detalhes.tabela_instancias) do
if (instance:IsAtiva()) then --> only enabled
funcao (instance, ...)
@@ -151,11 +154,7 @@ function _detalhes:IsSoloMode()
end
function _detalhes:IsRaidMode()
if (not _detalhes.raid) then
return false
else
return _detalhes.raid == self:GetInstanceId()
end
return self.modo == _detalhes._detalhes_props["MODO_RAID"]
end
function _detalhes:IsNormalMode()
@@ -212,8 +211,7 @@ end
self:Desagrupar (-1)
if (self.modo == modo_raid) then
_detalhes.RaidTables:switch()
_detalhes.raid = nil
_detalhes.RaidTables:DisableRaidMode (self)
elseif (self.modo == modo_alone) then
_detalhes.SoloTables:switch()
@@ -332,7 +330,7 @@ end
if (not temp) then
if (self.modo == modo_raid) then
_detalhes:RaidMode (true, self)
_detalhes.RaidTables:EnableRaidMode (self)
elseif (self.modo == modo_alone) then
self:SoloMode (true)
@@ -407,7 +405,7 @@ end
end
function _detalhes:CriarInstancia (_, id)
if (id and _type (id) == "boolean") then
if (#_detalhes.tabela_instancias >= _detalhes.instances_amount) then
@@ -1520,15 +1518,7 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
return _detalhes.SoloTables.switch (nil, nil, -1)
elseif ( (instancia.modo == modo_raid) and not (_detalhes.initializing or iniciando_instancia) ) then --> raid
if (_detalhes.RaidTables.Mode == #_detalhes.RaidTables.Plugins) then
_detalhes.popup:Select (1, 1)
else
if (_detalhes.PluginCount.RAID > 0) then
_detalhes.popup:Select (1, _detalhes.RaidTables.Mode+1)
end
end
return _detalhes.RaidTables.switch (nil, nil, -1)
return --nao faz nada quando clicar no botão
end
atributo_changed = true
@@ -1620,18 +1610,67 @@ function _detalhes:TrocaTabela (instancia, segmento, atributo, sub_atributo, ini
end
function _detalhes:MontaRaidOption (instancia)
for index, ptable in _ipairs (_detalhes.RaidTables.Menu) do
if (ptable [3].__enabled) then
GameCooltip:AddMenu (1, _detalhes.RaidTables.switch, index, nil, nil, ptable [1], ptable [2], true)
function _detalhes:GetRaidPluginName()
return self.current_raid_plugin or self.last_raid_plugin
end
function _detalhes:GetInstanceAttributeText()
if (self.modo == modo_grupo or self.modo == modo_all) then
local attribute = self.atributo
local sub_attribute = self.sub_atributo
local name = _detalhes:GetSubAttributeName (attribute, sub_attribute)
return name or "Unknown"
elseif (self.modo == modo_raid) then
local plugin_name = self.current_raid_plugin or self.last_raid_plugin
if (plugin_name) then
local plugin_object = _detalhes:GetPlugin (plugin_name)
if (plugin_object) then
return plugin_object.__name
else
return "Unknown Plugin"
end
else
return "Unknown Plugin"
end
elseif (self.modo == modo_alone) then
local atributo = _detalhes.SoloTables.Mode or 1
local SoloInfo = _detalhes.SoloTables.Menu [atributo]
if (SoloInfo) then
return SoloInfo [1]
else
return "Unknown Plugin"
end
end
if (_detalhes.RaidTables.Mode and _detalhes.RaidTables.Mode == index) then
GameCooltip:SetLastSelected (1, _detalhes.RaidTables.Mode)
end
function _detalhes:MontaRaidOption (instancia)
local available_plugins = _detalhes.RaidTables:GetAvailablePlugins()
if (#available_plugins == 0) then
return false
end
local amount = 0
for index, ptable in _ipairs (available_plugins) do
if (ptable [3].__enabled) then
GameCooltip:AddMenu (1, _detalhes.RaidTables.switch, ptable [4], instancia, nil, ptable [1], ptable [2], true) --PluginName, PluginIcon, PluginObject, PluginAbsoluteName
amount = amount + 1
end
end
if (amount == 0) then
return false
end
GameCooltip:SetOption ("NoLastSelectedBar", true)
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
return true
end
function _detalhes:MontaSoloOption (instancia)
@@ -1646,6 +1685,8 @@ function _detalhes:MontaSoloOption (instancia)
end
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
return true
end
-- ~menu
@@ -1742,6 +1783,8 @@ function _detalhes:ChangeIcon (icon)
local skin = _detalhes.skins [self.skin]
--print (debugstack())
if (icon) then
--> plugin chamou uma troca de icone
@@ -1824,11 +1867,11 @@ function _detalhes:AlteraModo (instancia, qual)
if (not instancia.atributo) then
instancia.atributo = 1
instancia.sub_atributo = 1
print ("Details found a internal probleam and fixed: 'instancia.atributo' were null, now is 1.")
--print ("Details found a internal probleam and fixed: 'instancia.atributo' were null, now is 1.")
end
if (not instancia.showing[instancia.atributo]) then
instancia.showing = _detalhes.tabela_vigente
print ("Details found a internal problem and fixed: container for instancia.showing were null, now is current combat.")
--print ("Details found a internal problem and fixed: container for instancia.showing were null, now is current combat.")
end
instancia.atributo = instancia.atributo or 1
instancia.showing[instancia.atributo].need_refresh = true
@@ -1839,7 +1882,7 @@ function _detalhes:AlteraModo (instancia, qual)
instancia.LastModo = instancia.modo
if (instancia:IsRaidMode()) then
instancia:RaidMode (false, instancia)
_detalhes.RaidTables:DisableRaidMode (instancia)
end
--> verifica se ja tem alguma instancia desativada em solo e remove o solo dela
@@ -1859,12 +1902,13 @@ function _detalhes:AlteraModo (instancia, qual)
instancia:SoloMode (false)
end
_detalhes:InstanciaCallFunctionOffline (_detalhes.InstanciaCheckForDisabledRaid)
--_detalhes:InstanciaCallFunctionOffline (_detalhes.InstanciaCheckForDisabledRaid)
instancia.modo = modo_raid
instancia:ChangeIcon()
_detalhes:RaidMode (true, instancia)
_detalhes.RaidTables:EnableRaidMode (instancia)
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_raid)
elseif (qual == modo_grupo) then
@@ -1875,7 +1919,7 @@ function _detalhes:AlteraModo (instancia, qual)
--instancia.modo = modo_grupo
instancia:SoloMode (false)
elseif (instancia:IsRaidMode()) then
instancia:RaidMode (false, instancia)
_detalhes.RaidTables:DisableRaidMode (instancia)
end
_detalhes:ResetaGump (instancia)
@@ -1887,6 +1931,7 @@ function _detalhes:AlteraModo (instancia, qual)
instancia:AtualizaGumpPrincipal (true)
instancia.last_modo = modo_grupo
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_grupo)
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, instancia.atributo, instancia.sub_atributo)
elseif (qual == modo_all) then
@@ -1897,7 +1942,7 @@ function _detalhes:AlteraModo (instancia, qual)
instancia:SoloMode (false)
elseif (instancia:IsRaidMode()) then
instancia:RaidMode (false, instancia)
_detalhes.RaidTables:DisableRaidMode (instancia)
end
instancia.modo = modo_all
@@ -1906,6 +1951,7 @@ function _detalhes:AlteraModo (instancia, qual)
instancia:AtualizaGumpPrincipal (true)
instancia.last_modo = modo_all
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEMODE", nil, instancia, modo_all)
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, instancia.atributo, instancia.sub_atributo)
end
local checked
+2
View File
@@ -146,6 +146,8 @@ _detalhes.instance_defaults = {
start_after_icon = true,
--percent type
percent_type = 1,
--backdrop
backdrop = {enabled = false, size = 12, color = {1, 1, 1, 1}, texture = "Details BarBorder 2"}
},
--instance window color
+1 -1
View File
@@ -667,7 +667,7 @@ function atributo_misc:AtualizaBarra (instancia, barras_container, qual_barra, l
local esta_porcentagem = _math_floor ((meu_total/instancia.top) * 100)
if (UsingCustomRightText) then
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (meu_total, "", porcentagem))
esta_barra.texto_direita:SetText (instancia.row_info.textR_custom_text:ReplaceData (meu_total, "", porcentagem, self))
else
esta_barra.texto_direita:SetText (meu_total .." (" .. porcentagem .. "%)") --seta o texto da direita
end
+5 -19
View File
@@ -340,19 +340,11 @@
if (instancia.auto_switch_to) then
--salva o estado atual
instancia.auto_switch_to_old = {instancia.modo, instancia.atributo, instancia.sub_atributo, instancia.segmento, _detalhes.RaidTables.Mode, _detalhes.SoloTables.Mode}
instancia.auto_switch_to_old = {instancia.modo, instancia.atributo, instancia.sub_atributo, instancia.segmento, instancia:GetRaidPluginName(), _detalhes.SoloTables.Mode}
--muda para um plugin de raid
if (instancia.auto_switch_to [1] == "raid") then
for index, ptable in _ipairs (_detalhes.RaidTables.Menu) do
if (ptable[1] == instancia.auto_switch_to [2]) then
if (instancia.modo ~= _detalhes._detalhes_props ["MODO_RAID"]) then
_detalhes:AlteraModo (instancia, _detalhes._detalhes_props ["MODO_RAID"])
end
_detalhes.RaidTables:switch (nil, index)
break
end
end
_detalhes.RaidTables:EnableRaidMode (instancia, instancia.auto_switch_to [2])
else
--muda para um atributo normal
if (instancia.modo ~= _detalhes._detalhes_props["MODO_GROUP"]) then
@@ -511,8 +503,6 @@
end
end
end
if (_detalhes.solo) then
--> debuffs need a checkup, not well functional right now
@@ -534,8 +524,8 @@
end
_detalhes.tabela_overall = _detalhes.tabela_overall - _detalhes.tabela_vigente --> isso aqui é novo, ele vai subtrair da overall qualquer dado adicionado na tabela descardata
_table_wipe (_detalhes.tabela_vigente) --> descarta ela, não será mais usada
--_table_wipe (_detalhes.tabela_vigente) --> descarta ela, não será mais usada
_detalhes.tabela_vigente = _detalhes.tabela_historico.tabelas[1] --> pega a tabela do ultimo combate
if (_detalhes.tabela_vigente.start_time == 0) then
@@ -607,7 +597,7 @@
end
if (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then
_detalhes.RaidTables:switch (nil, self.auto_switch_to_old [5])
_detalhes.RaidTables:switch (nil, self.auto_switch_to_old [5], self)
elseif (self.modo == _detalhes._detalhes_props["MODO_ALONE"]) then
_detalhes.SoloTables:switch (nil, self.auto_switch_to_old [6])
@@ -945,13 +935,9 @@
if (esta_barra.minha_tabela.serial and esta_barra.minha_tabela.serial ~= "") then
local avatar = NickTag:GetNicknameTable (esta_barra.minha_tabela.serial)
if (avatar) then
if (avatar [2]) then
if (avatar [2] and avatar [4] and avatar [1]) then
GameCooltip:SetBannerImage (1, avatar [2], 80, 40, avatarPoint, avatarTexCoord, nil) --> overlay [2] avatar path
end
if (avatar [4]) then
GameCooltip:SetBannerImage (2, avatar [4], 200, 55, backgroundPoint, avatar [5], avatar [6]) --> background
end
if (avatar [1]) then
GameCooltip:SetBannerText (1, avatar [1], textPoint) --> text [1] nickname
end
end
+9 -11
View File
@@ -176,25 +176,22 @@
if (_detalhes.segments_amount_to_save and _detalhes.segments_amount_to_save < _detalhes.segments_amount) then
for i = _detalhes.segments_amount, _detalhes.segments_amount_to_save+1, -1 do
if (_detalhes.tabela_historico.tabelas [i]) then
--_detalhes.tabela_historico.tabelas [i] = nil
table.remove (_detalhes.tabela_historico.tabelas, i)
end
end
end
--local tabela_overall = _detalhes.tabela_overall
_detalhes.tabela_overall = nil
--tabela do combate atual
local tabela_atual = _detalhes.tabela_vigente or _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
local tabela_atual = _detalhes.tabela_vigente or {}
--limpa a tabela overall
_detalhes.tabela_overall = nil
for _, _tabela in _ipairs (historico_tabelas) do
tabelas_de_combate [#tabelas_de_combate+1] = _tabela
end
--tabelas_de_combate [#tabelas_de_combate+1] = tabela_atual --não salva mais a atual
--tabelas_de_combate [#tabelas_de_combate+1] = tabela_overall --não salva mais a overall
--> make sure details database exists
--verifica se a database existe mesmo
_detalhes_database = _detalhes_database or {}
for tabela_index, _combate in _ipairs (tabelas_de_combate) do
@@ -238,9 +235,6 @@
if (_iter.data.grupo or _iter.data.boss or _iter.data.boss_fight_component or IsBossEncounter) then
can_erase = false
--if (class_type == 1) then
-- print ("SAVE ", _iter.data.nome, tabela_index)
--end
else
local owner = _iter.data.owner
if (owner) then
@@ -563,6 +557,10 @@
esta_instancia.lastIcon = nil
esta_instancia.menu_attribute_string = nil
esta_instancia.wait_for_plugin_created = nil
esta_instancia.waiting_raid_plugin = nil
esta_instancia.waiting_pid = nil
end
+7 -1
View File
@@ -25,6 +25,10 @@
print (PluginName, Loc ["STRING_TOOOLD"])
return _detalhes:NewError ("Details version is out of date.")
end
if (PluginType == "TANK") then
PluginType = "RAID"
end
if (not PluginType) then
return _detalhes:NewError ("InstallPlugin parameter 1 (plugin type) not especified")
@@ -77,7 +81,7 @@
_detalhes.PluginCount.SOLO = _detalhes.PluginCount.SOLO + 1
elseif (PluginType == "TANK") then
elseif (PluginType == "RAID") then
--> Install Plugin
_detalhes.RaidTables.Plugins [#_detalhes.RaidTables.Plugins+1] = PluginObject
@@ -87,6 +91,8 @@
_detalhes.PluginCount.RAID = _detalhes.PluginCount.RAID + 1
_detalhes:InstanceCall ("RaidPluginInstalled", PluginAbsoluteName)
elseif (PluginType == "TOOLBAR") then
--> Install Plugin
+195 -106
View File
@@ -19,135 +19,224 @@
--> constants
local modo_raid = _detalhes._detalhes_props["MODO_RAID"]
local modo_alone = _detalhes._detalhes_props["MODO_ALONE"]
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> internal functions
function _detalhes:RaidMode (enable, instancia)
if (enable) then
_detalhes.RaidTables.instancia = instancia
_detalhes.RaidTables.Mode = _detalhes.RaidTables.Mode or 1 --> solo mode
instancia.modo = _detalhes._detalhes_props["MODO_RAID"]
gump:Fade (instancia, 1, nil, "barras")
if (instancia.rolagem) then
instancia:EsconderScrollBar (true) --> hida a scrollbar
end
_detalhes:ResetaGump (instancia)
_detalhes.raid = instancia.meu_id
instancia:AtualizaGumpPrincipal (true)
local first_enabled_plugin, first_enabled_plugin_index
for index, plugin in ipairs (_detalhes.RaidTables.Plugins) do
if (plugin.__enabled) then
first_enabled_plugin = plugin
first_enabled_plugin_index = index
end
end
if (not first_enabled_plugin) then
_detalhes:WaitForSoloPlugin (instancia)
else
if (not _detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode]) then
_detalhes.RaidTables.Mode = first_enabled_plugin_index
end
_detalhes.RaidTables:switch (nil, _detalhes.RaidTables.Mode)
end
function _detalhes.RaidTables:DisableRaidMode (instance)
--free
self:SetInUse (instance.current_raid_plugin, nil)
--hide
local current_plugin_object = _detalhes:GetPlugin (instance.current_raid_plugin)
if (current_plugin_object) then
current_plugin_object.Frame:Hide()
end
instance.current_raid_plugin = nil
--[[
if (_G.DetailsWaitForPluginFrame:IsShown()) then
_detalhes:CancelWaitForPlugin()
end
gump:Fade (instancia, 1, nil, "barras")
gump:Fade (instancia.scroll, 0)
if (instancia.need_rolagem) then
instancia:MostrarScrollBar (true)
else
_detalhes.RaidTables:switch()
_detalhes.raid = nil
--> precisa verificar se ele precisa a rolagem certo?
instancia:ReajustaGump()
end
--> calcula se existem barras, etc...
if (not instancia.rows_fit_in_window) then --> as barras não forma iniciadas ainda
instancia.rows_fit_in_window = _math_floor (instancia.baseframe.BoxBarrasAltura / instancia.row_height)
if (instancia.rows_created < instancia.rows_fit_in_window) then
for i = #instancia.barras+1, instancia.rows_fit_in_window do
local nova_barra = gump:CriaNovaBarra (instancia, i, 30) --> cria nova barra
nova_barra.texto_esquerdo:SetText (Loc ["STRING_NEWROW"])
nova_barra.statusbar:SetValue (100)
instancia.barras [i] = nova_barra
end
instancia.rows_created = #instancia.barras
end
end
--]]
end
function _detalhes:RaidPluginInstalled (plugin_name)
if (self.waiting_raid_plugin) then
--print (self.meu_id, 2, self.last_raid_plugin, " == ", plugin_name)
if (self.last_raid_plugin == plugin_name) then
if (self.waiting_pid) then
self:CancelTimer (self.waiting_pid, true)
end
self:CancelWaitForPlugin()
_detalhes.RaidTables:EnableRaidMode (self, plugin_name)
end
end
end
function _detalhes.RaidTables:EnableRaidMode (instance, plugin_name)
if (_G.DetailsWaitForPluginFrame:IsShown()) then
_detalhes:CancelWaitForPlugin()
end
gump:Fade (instancia, 1, nil, "barras")
gump:Fade (instancia.scroll, 0)
if (instancia.need_rolagem) then
instancia:MostrarScrollBar (true)
else
--> precisa verificar se ele precisa a rolagem certo?
instancia:ReajustaGump()
end
--> calcula se existem barras, etc...
if (not instancia.rows_fit_in_window) then --> as barras não forma iniciadas ainda
instancia.rows_fit_in_window = _math_floor (instancia.baseframe.BoxBarrasAltura / instancia.row_height)
if (instancia.rows_created < instancia.rows_fit_in_window) then
for i = #instancia.barras+1, instancia.rows_fit_in_window do
local nova_barra = gump:CriaNovaBarra (instancia, i, 30) --> cria nova barra
nova_barra.texto_esquerdo:SetText (Loc ["STRING_NEWROW"])
nova_barra.statusbar:SetValue (100)
instancia.barras [i] = nova_barra
end
instancia.rows_created = #instancia.barras
--> set the mode
if (instance.modo == modo_alone) then
instance:SoloMode (false)
end
instance.modo = modo_raid
--> hide rows, scrollbar
gump:Fade (instance, 1, nil, "barras")
if (instance.rolagem) then
instance:EsconderScrollBar (true) --> hida a scrollbar
end
_detalhes:ResetaGump (instance)
instance:AtualizaGumpPrincipal (true)
--> get the plugin name
--if the desired plugin isn't passed, try to get the latest used.
if (not plugin_name) then
local last_plugin_used = instance.last_raid_plugin
if (last_plugin_used) then
if (self:IsAvailable (last_plugin_used, instance)) then
plugin_name = last_plugin_used
end
end
end
--if we still doesnt have a name, try to get the first available
if (not plugin_name) then
local available = self:GetAvailablePlugins()
if (#available == 0) then
if (not instance.wait_for_plugin_created or not instance.WaitForPlugin) then
instance:CreateWaitForPlugin()
end
return instance:WaitForPlugin()
end
plugin_name = available [1] [4]
end
--last check if the name is okey
if (self:IsAvailable (plugin_name, instance)) then
self:switch (nil, plugin_name, instance)
else
if (not instance.wait_for_plugin) then
instance:CreateWaitForPlugin()
end
return instance:WaitForPlugin()
end
end
function _detalhes:InstanciaCheckForDisabledRaid (instancia)
if (not instancia) then
instancia = self
end
if (instancia.modo == modo_raid) then
if (instancia.iniciada) then
_detalhes:AlteraModo (instancia, _detalhes._detalhes_props["MODO_GROUP"])
instancia:RaidMode (false, instancia)
_detalhes:ResetaGump (instancia)
else
instancia.modo = _detalhes._detalhes_props["MODO_GROUP"]
instancia.last_modo = _detalhes._detalhes_props["MODO_GROUP"]
function _detalhes.RaidTables:GetAvailablePlugins()
local available = {}
for index, plugin in ipairs (self.Menu) do
if (not self.PluginsInUse [ plugin [4] ] and plugin [3].__enabled) then -- 3 = plugin object 4 = absolute name
tinsert (available, plugin)
end
end
return available
end
function _detalhes.RaidTables:IsAvailable (plugin_name, instance)
--check if is installed
if (not self.NameTable [plugin_name]) then
return false
end
function _detalhes.RaidTables:switch (_, _switchTo)
--> just hide all
if (not _switchTo) then
if (#_detalhes.RaidTables.Plugins > 0) then --> have at least one plugin
_detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].Frame:Hide()
--check if is enabled
if (not self.NameTable [plugin_name].__enabled) then
return false
end
--check if is available
local in_use = self.PluginsInUse [ plugin_name ]
-- print (instance:GetId() .. " In Use By Instance: ", in_use )
if (in_use and in_use ~= instance:GetId()) then
return false
else
return true
end
end
function _detalhes.RaidTables:SetInUse (absolute_name, instance_number)
if (absolute_name) then
self.PluginsInUse [ absolute_name ] = instance_number
end
end
----------------
function _detalhes.RaidTables:switch (_, plugin_name, instance)
local update_menu = false
if (not self) then --came from cooltip
self = _detalhes.RaidTables
update_menu = true
end
--only hide the current plugin shown
if (not plugin_name) then
if (instance.current_raid_plugin) then
--free
self:SetInUse (instance.current_raid_plugin, nil)
--hide
local current_plugin_object = _detalhes:GetPlugin (instance.current_raid_plugin)
if (current_plugin_object) then
current_plugin_object.Frame:Hide()
end
instance.current_raid_plugin = nil
end
return
end
--> jump to the next
if (_switchTo == -1) then
_switchTo = _detalhes.RaidTables.Mode + 1
if (_switchTo > #_detalhes.RaidTables.Plugins) then
_switchTo = 1
--check if is realy available
if (not self:IsAvailable (plugin_name, instance)) then
instance.last_raid_plugin = plugin_name
if (not instance.wait_for_plugin) then
instance:CreateWaitForPlugin()
end
return instance:WaitForPlugin()
end
--hide current shown plugin
if (instance.current_raid_plugin) then
--free
self:SetInUse (instance.current_raid_plugin, nil)
--hide
local current_plugin_object = _detalhes:GetPlugin (instance.current_raid_plugin)
if (current_plugin_object) then
current_plugin_object.Frame:Hide()
end
end
local plugin_object = _detalhes:GetPlugin (plugin_name)
local ThisFrame = _detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode]
if (not ThisFrame or not ThisFrame.__enabled) then
--> frame not found, try in few second again
_detalhes.RaidTables.Mode = _switchTo
_detalhes:WaitForSoloPlugin (_detalhes:GetRaidMode())
return
if (plugin_object and plugin_object.__enabled and plugin_object.Frame) then
instance.last_raid_plugin = plugin_name
instance.current_raid_plugin = plugin_name
self:SetInUse (plugin_name, instance:GetId())
plugin_object.instance_id = instance:GetId()
plugin_object.Frame:SetPoint ("TOPLEFT", instance.bgframe)
plugin_object.Frame:Show()
instance:ChangeIcon (plugin_object.__icon)--; print (instance:GetId(),"icon",plugin_object.__icon)
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instance, instance.atributo, instance.sub_atributo)
if (update_menu) then
GameCooltip:ExecFunc (instance.baseframe.cabecalho.atributo)
--instance _detalhes.popup:ExecFunc (DeleteButton)
end
else
if (not instance.wait_for_plugin) then
instance:CreateWaitForPlugin()
end
return instance:WaitForPlugin()
end
--> hide current frame
_detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].Frame:Hide()
--> switch mode
_detalhes.RaidTables.Mode = _switchTo
--> show and setpoint new frame
_detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].Frame:Show()
_detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].Frame:SetPoint ("TOPLEFT",_detalhes.RaidTables.instancia.bgframe)
_detalhes.RaidTables.instancia:ChangeIcon (_detalhes.RaidTables.Menu [_detalhes.RaidTables.Mode] [2])
end
+2
View File
@@ -192,6 +192,8 @@
_detalhes.SoloTables.instancia:ChangeIcon (_detalhes.SoloTables.Menu [_detalhes.SoloTables.Mode] [2])
_detalhes:SendEvent ("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, _detalhes.SoloTables.instancia, _detalhes.SoloTables.instancia.atributo, _detalhes.SoloTables.instancia.sub_atributo)
end
return true
+1 -1
View File
@@ -870,7 +870,7 @@ do
for index, child in _ipairs (PAttribute.childs) do
if (child.instance == instance and child.enabled and child.instance:IsEnabled()) then
local sName = _detalhes:GetSubAttributeName (attribute, subAttribute)
local sName = child.instance:GetInstanceAttributeText()
child.text:SetText (sName)
end
end
+2 -2
View File
@@ -146,8 +146,8 @@
GameCooltip:Reset()
--GameCooltip:SetOption ("FixedWidth", 200)
GameCooltip:SetOption ("ButtonsYMod", -5)
GameCooltip:SetOption ("YSpacingMod", -5)
GameCooltip:SetOption ("ButtonsYMod", -3)
GameCooltip:SetOption ("YSpacingMod", -3)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", true)
GameCooltip:SetColor (1, 0.5, 0.5, 0.5, 0.5)
+16 -11
View File
@@ -20,6 +20,7 @@
local _math_max = math.max --lua local
local _type = type --lua local
local _string_match = string.match --lua local
local loadstring = loadstring --lua local
local _UnitClass = UnitClass --wow api local
local _IsInRaid = IsInRaid --wow api local
@@ -115,17 +116,18 @@
_detalhes.ToKFunctions = {_detalhes.NoToK, _detalhes.ToK, _detalhes.ToK2, _detalhes.ToK0, _detalhes.ToKMin, _detalhes.ToK2Min, _detalhes.ToK0Min, _detalhes.comma_value}
--> replacing data
local args
local replace_arg = function (i)
return args [tonumber(i)]
end
local run_function = function (str)
local r = loadstring (str)(args[4])
return r or 0
end
function string:ReplaceData (...)
local args = {...}
local function getarg (i)
local n = tonumber (i)
if (n) then
return args [tonumber(i)]
else
return loadstring (i)()
end
end
return (self:gsub('{data(%d+)}', getarg):gsub ('{func(.-)}', getarg))
args = {...}
return (self:gsub ("{data(%d+)}", replace_arg):gsub ("{func(.-)}", run_function))
end
--local usertext = "i got the time: {data2}, {data3}% of {data1} minutes"
@@ -160,7 +162,10 @@
s = string.sub(hexstr, mod+1, mod+1) .. s
num = math.floor(num / 16)
end
if s == '' then s = '0' end
if s == '' then s = '00' end
if (string.len (s) == 1) then
s = "0"..s
end
return s
end
+100 -28
View File
@@ -74,39 +74,31 @@
function _detalhes:AnimarBarra (esta_barra, fim)
esta_barra.inicio = esta_barra.statusbar:GetValue()
esta_barra.fim = fim
esta_barra.proximo_update = 0
esta_barra.tem_animacao = 1
esta_barra:SetScript ("OnUpdate", self.FazerAnimacao)
if (esta_barra.fim > esta_barra.inicio) then
esta_barra:SetScript ("OnUpdate", self.FazerAnimacao_Direita)
else
esta_barra:SetScript ("OnUpdate", self.FazerAnimacao_Esquerda)
end
end
function _detalhes:FazerAnimacao (elapsed)
function _detalhes:FazerAnimacao_Esquerda (elapsed)
self.inicio = self.inicio - 0.8
self.statusbar:SetValue (self.inicio)
if (self.inicio-1 <= self.fim) then
self.tem_animacao = 0
self:SetScript ("OnUpdate", nil)
end
end
local velocidade = 0.8
--[[
local velocidade = 0.1
local distancia = self.inicio - self.fim
if (distancia > 40 or distancia < -40) then
velocidade = 0.8
elseif (distancia > 20 or distancia < -20) then
velocidade = 0.4
function _detalhes:FazerAnimacao_Direita (elapsed)
self.inicio = self.inicio + 0.8
self.statusbar:SetValue (self.inicio)
if (self.inicio+1 >= self.fim) then
self.tem_animacao = 0
self:SetScript ("OnUpdate", nil)
end
--]]
if (self.fim > self.inicio) then
self.inicio = self.inicio+velocidade
self.statusbar:SetValue (self.inicio)
if (self.inicio+1 >= self.fim) then
self.tem_animacao = 0
self:SetScript ("OnUpdate", nil)
end
else
self.inicio = self.inicio-velocidade
self.statusbar:SetValue (self.inicio)
if (self.inicio-1 <= self.fim) then
self.tem_animacao = 0
self:SetScript ("OnUpdate", nil)
end
end
self.proximo_update = 0
end
function _detalhes:AtualizaPontos()
@@ -530,6 +522,86 @@
end
--> cria o frame de wait for plugin
function _detalhes:CreateWaitForPlugin()
local WaitForPluginFrame = CreateFrame ("frame", "DetailsWaitForPluginFrame" .. self.meu_id, UIParent)
local WaitTexture = WaitForPluginFrame:CreateTexture (nil, "overlay")
WaitTexture:SetTexture ("Interface\\UNITPOWERBARALT\\Mechanical_Circular_Frame")
WaitTexture:SetPoint ("center", WaitForPluginFrame)
WaitTexture:SetWidth (180)
WaitTexture:SetHeight (180)
WaitForPluginFrame.wheel = WaitTexture
local RotateAnimGroup = WaitForPluginFrame:CreateAnimationGroup()
local rotate = RotateAnimGroup:CreateAnimation ("Rotation")
rotate:SetDegrees (360)
rotate:SetDuration (60)
RotateAnimGroup:SetLooping ("repeat")
local bgpanel = gump:NewPanel (UIParent, UIParent, "DetailsWaitFrameBG"..self.meu_id, nil, 120, 30, false, false, false)
bgpanel:SetPoint ("center", WaitForPluginFrame, "center")
bgpanel:SetBackdrop ({bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"})
bgpanel:SetBackdropColor (.2, .2, .2, 1)
local label = gump:NewLabel (UIParent, UIParent, nil, nil, Loc ["STRING_WAITPLUGIN"]) --> localize-me
label.color = "silver"
label:SetPoint ("center", WaitForPluginFrame, "center")
label:SetJustifyH ("center")
label:Hide()
WaitForPluginFrame:Hide()
self.wait_for_plugin_created = true
function self:WaitForPlugin()
self:ChangeIcon ([[Interface\GossipFrame\ActiveQuestIcon]])
if (WaitForPluginFrame:IsShown() and WaitForPluginFrame:GetParent() == self.baseframe) then
self.waiting_pid = self:ScheduleTimer ("ExecDelayedPlugin1", 5, self)
end
WaitForPluginFrame:SetParent (self.baseframe)
WaitForPluginFrame:SetAllPoints (self.baseframe)
local size = math.max (self.baseframe:GetHeight()* 0.35, 100)
WaitForPluginFrame.wheel:SetWidth (size)
WaitForPluginFrame.wheel:SetHeight (size)
WaitForPluginFrame:Show()
label:Show()
bgpanel:Show()
RotateAnimGroup:Play()
self.waiting_raid_plugin = true
self.waiting_pid = self:ScheduleTimer ("ExecDelayedPlugin1", 5, self)
end
function self:CancelWaitForPlugin()
RotateAnimGroup:Stop()
WaitForPluginFrame:Hide()
label:Hide()
bgpanel:Hide()
end
function self:ExecDelayedPlugin1()
self.waiting_raid_plugin = nil
self.waiting_pid = nil
RotateAnimGroup:Stop()
WaitForPluginFrame:Hide()
label:Hide()
bgpanel:Hide()
if (self.meu_id == _detalhes.solo) then
_detalhes.SoloTables:switch (nil, _detalhes.SoloTables.Mode)
elseif (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then
_detalhes.RaidTables:EnableRaidMode (self)
end
end
end
do
local WaitForPluginFrame = CreateFrame ("frame", "DetailsWaitForPluginFrame", UIParent)
local WaitTexture = WaitForPluginFrame:CreateTexture (nil, "overlay")
+16 -8
View File
@@ -362,13 +362,15 @@ function DetailsCreateCoolTip()
----------------------------------------------------------------------
function GameCooltipButtonMouseDown (button)
button.leftText:SetPoint ("center", button.leftIcon, "center", 0, 0)
button.leftText:SetPoint ("left", button.leftIcon, "right", 4, -1)
local mod = CoolTip.OptionsTable.TextHeightMod or 0
button.leftText:SetPoint ("center", button.leftIcon, "center", 0, 0+mod)
button.leftText:SetPoint ("left", button.leftIcon, "right", 4, -1+mod)
end
function GameCooltipButtonMouseUp (button)
button.leftText:SetPoint ("center", button.leftIcon, "center", 0, 0)
button.leftText:SetPoint ("left", button.leftIcon, "right", 3, 0)
local mod = CoolTip.OptionsTable.TextHeightMod or 0
button.leftText:SetPoint ("center", button.leftIcon, "center", 0, 0+mod)
button.leftText:SetPoint ("left", button.leftIcon, "right", 3, 0+mod)
end
function CoolTip:CreateButton (index, frame, name)
@@ -670,6 +672,10 @@ function DetailsCreateCoolTip()
flags = leftTextTable [8] or CoolTip.OptionsTable.TextShadow or nil
menuButton.leftText:SetFont (face, size, flags)
end
local height_mod = CoolTip.OptionsTable.TextHeightMod or 0
menuButton.leftText:SetPoint ("center", menuButton.leftIcon, "center", 0, 0+height_mod)
menuButton.leftText:SetPoint ("left", menuButton.leftIcon, "right", 3, 0+height_mod)
else
menuButton.leftText:SetText ("")
@@ -1551,6 +1557,10 @@ function DetailsCreateCoolTip()
--> frame [, x mod, y mod]
--> alias
function CoolTip:GetOwner()
return CoolTip.Host
end
function CoolTip:SetOwner (frame, myPoint, hisPoint, x, y)
return CoolTip:SetHost (frame, myPoint, hisPoint, x, y)
end
@@ -2543,22 +2553,20 @@ function DetailsCreateCoolTip()
function CoolTip:Close()
CoolTip.active = false
CoolTip.Host = nil
gump:Fade (frame1, 1)
gump:Fade (frame2, 1)
end
--> old function call
function CoolTip:ShowMe (host, arg2)
--> ignore if mouse is up me
if (CoolTip.mouseOver) then
return
end
if (not host or not arg2) then --> hideme
CoolTip.active = false
gump:Fade (frame1, 1)
gump:Fade (frame2, 1)
CoolTip:Close()
end
end
+1
View File
@@ -752,6 +752,7 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
editbox:SetBackdrop ({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = "Interface\\ChatFrame\\ChatFrameBackground", edgeSize = 1})
editbox:SetBackdropColor (1, 1, 1, 0.1)
editbox:SetBackdropBorderColor (1, 1, 1, 0.1)
editbox.editbox.current_bordercolor = {1, 1, 1, 0.1}
--> insert in the table
tinsert (row.row_widgets, editbox)
+13 -10
View File
@@ -306,23 +306,25 @@ local SliderMetaFunctions = {}
local OnEnter = function (slider)
DetailsFrameworkSliderButtons:ShowMe (slider)
if (slider.MyObject.OnEnterHook) then
local interrupt = slider.MyObject.OnEnterHook (slider)
if (interrupt) then
return
end
end
DetailsFrameworkSliderButtons:ShowMe (slider)
slider.thumb:SetAlpha (1)
if (slider.MyObject.have_tooltip) then
_detalhes:CooltipPreset (1)
if (slider.MyObject.have_tooltip and slider.MyObject.have_tooltip ~= Loc ["STRING_RIGHTCLICK_TYPEVALUE"]) then
GameCooltip:Reset()
GameCooltip:AddLine (slider.MyObject.have_tooltip)
if (slider.MyObject.have_tooltip == Loc ["STRING_RIGHTCLICK_TYPEVALUE"]) then
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 16, 16, 0.015625, 0.15671875, 0.640625, 0.798828125)
end
GameCooltip:ShowCooltip (slider, "tooltip")
else
_detalhes:CooltipPreset (1)
GameCooltip:AddLine (Loc ["STRING_RIGHTCLICK_TYPEVALUE"])
GameCooltip:AddIcon ([[Interface\TUTORIALFRAME\UI-TUTORIAL-FRAME]], 1, 1, 16, 16, 0.015625, 0.15671875, 0.640625, 0.798828125)
GameCooltip:ShowCooltip (slider, "tooltip")
end
@@ -336,6 +338,9 @@ local SliderMetaFunctions = {}
end
local OnLeave = function (slider)
DetailsFrameworkSliderButtons:PrepareToHide()
if (slider.MyObject.OnLeaveHook) then
local interrupt = slider.MyObject.OnLeaveHook (slider)
if (interrupt) then
@@ -343,8 +348,6 @@ local SliderMetaFunctions = {}
end
end
DetailsFrameworkSliderButtons:PrepareToHide()
slider.thumb:SetAlpha (.7)
if (slider.MyObject.have_tooltip) then
+9 -6
View File
@@ -251,7 +251,7 @@ local TextEntryMetaFunctions = {}
------------------------------------------------------------------------------------------------------------
--> scripts
local OnEnter = function (textentry)
if (textentry.MyObject.OnEnterHook) then
local interrupt = textentry.MyObject.OnEnterHook (textentry)
if (interrupt) then
@@ -527,11 +527,14 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
TextEntryObject.editbox:SetJustifyH ("center")
TextEntryObject.editbox:EnableMouse (true)
TextEntryObject.editbox:SetText ("")
TextEntryObject.editbox:SetBackdrop ({bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\ChatFrame\\ChatFrameBackground",
tile = true, edgeSize = 1, tileSize = 5})
TextEntryObject.editbox:SetBackdropColor (0, 0, 0, 0.5)
TextEntryObject.editbox:SetBackdropBorderColor (0.3, 0.3, 0.30, 0.80)
--TextEntryObject.editbox:SetBackdrop ({bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
--edgeFile = "Interface\\ChatFrame\\ChatFrameBackground",
--tile = true, edgeSize = 1, tileSize = 5})
--TextEntryObject.editbox:SetBackdropColor (0, 0, 0, 0.5)
--TextEntryObject.editbox:SetBackdropBorderColor (0.3, 0.3, 0.30, 0.80)
TextEntryObject.editbox.current_bordercolor = {1, 1, 1, 1}
TextEntryObject.editbox:SetAutoFocus (false)
TextEntryObject.editbox:SetFontObject ("GameFontHighlightSmall")
+3 -3
View File
@@ -5,15 +5,15 @@
<EditBox name="DetailsEditBoxTemplate2" virtual="true">
<Size x="232" y="20"/>
<Backdrop bgFile="Interface\\ChatFrame\\ChatFrameBackground" edgeFile="Interface\\ChatFrame\\ChatFrameBackground" tile="true">
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<EdgeSize>
<AbsValue val="1"/>
<AbsValue val="10"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="0" right="0" top="0" bottom="0"/>
<AbsInset left="1" right="1" top="0" bottom="1"/>
</BackgroundInsets>
</Backdrop>
+19 -11
View File
@@ -152,10 +152,8 @@ function _detalhes:LoadCombatTables()
--> if isn't nothing saved, build a new one
if (not _detalhes_database.tabela_historico) then
_detalhes.tabela_historico = _detalhes.historico:NovoHistorico()
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (_, _detalhes.tabela_overall)
else
--> build basic containers
@@ -164,7 +162,10 @@ function _detalhes:LoadCombatTables()
-- overall
_detalhes.tabela_overall = _detalhes.combate:NovaTabela()
-- pets
_detalhes.tabela_pets = _detalhes_database.tabela_pets or _detalhes.container_pets:NovoContainer()
_detalhes.tabela_pets = _detalhes.container_pets:NovoContainer()
if (_detalhes_database.tabela_pets) then
_detalhes.tabela_pets.pets = _detalhes_database.tabela_pets
end
--> if the core revision was incremented, reset all combat data
if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < _detalhes.realversion) then
@@ -250,14 +251,21 @@ function _detalhes:LoadConfig()
end
end
if (_detalhes_database.RaidTablesSaved) then
if (_detalhes_database.RaidTablesSaved.Mode) then
_detalhes.RaidTables.Mode = _detalhes_database.RaidTablesSaved.Mode
_detalhes.RaidTables.LastSelected = _detalhes_database.RaidTablesSaved.LastSelected
else
_detalhes.RaidTables.Mode = 1
end
end
--if (_detalhes_database.RaidTablesSaved) then
--for id, instance in ipairs (_detalhes.tabela_instancias) do
-- if (instance.modo == _detalhes._detalhes_props["MODO_RAID"]) then
-- _detalhes:AlteraModo (instance, _detalhes._detalhes_props["MODO_GROUP"])
-- end
--end
--if (_detalhes_database.RaidTablesSaved.Mode) then
-- _detalhes.RaidTables.Mode = _detalhes_database.RaidTablesSaved.Mode
-- _detalhes.RaidTables.LastSelected = _detalhes_database.RaidTablesSaved.LastSelected
--else
-- _detalhes.RaidTables.Mode = 1
--end
--end
--> switch tables
_detalhes.switch.slots = _detalhes_database.switchSaved.slots
+15 -7
View File
@@ -435,6 +435,12 @@ function _detalhes:SaveConfig()
_detalhes_database.tabela_instancias = _detalhes.tabela_instancias
_detalhes_database.tabela_historico = _detalhes.tabela_historico
local name, ttype, difficulty, difficultyName, maxPlayers, playerDifficulty, isDynamicInstance, mapID, instanceGroupSize = GetInstanceInfo()
if (ttype == "party" or ttype == "raid") then
--> salvar container de pet
_detalhes_database.tabela_pets = _detalhes.tabela_pets.pets
end
_detalhes:TimeDataCleanUpTemporary()
--> buffs
@@ -462,13 +468,15 @@ function _detalhes:SaveConfig()
_detalhes_database.SoloTablesSaved.LastSelected = _detalhes.SoloTables.Plugins [_detalhes.SoloTables.Mode].real_name
end
end
if (_detalhes.RaidTables.Mode) then
_detalhes_database.RaidTablesSaved = {}
_detalhes_database.RaidTablesSaved.Mode = _detalhes.RaidTables.Mode
if (_detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode]) then
_detalhes_database.RaidTablesSaved.LastSelected = _detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].real_name
end
end
--if (_detalhes.RaidTables.Mode) then
-- _detalhes_database.RaidTablesSaved = {}
-- _detalhes_database.RaidTablesSaved.Mode = _detalhes.RaidTables.Mode
-- if (_detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode]) then
-- _detalhes_database.RaidTablesSaved.LastSelected = _detalhes.RaidTables.Plugins [_detalhes.RaidTables.Mode].real_name
-- end
--end
_detalhes_database.RaidTablesSaved = nil
--> salva switch tables
_detalhes_database.switchSaved.slots = _detalhes.switch.slots
+10 -3
View File
@@ -260,6 +260,7 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (command == "owner") then
local petname = rest:match ("^(%S*)%s*(.-)$")
local petGUID = UnitGUID ("target")
if (not _G.DetailsScanTooltip) then
local scanTool = CreateFrame ("GameTooltip", "DetailsScanTooltip", nil, "GameTooltipTemplate")
@@ -271,15 +272,21 @@ function SlashCmdList.DETAILS (msg, editbox)
local scanText = _G ["DetailsScanTooltipTextLeft2"] -- This is the line with <[Player]'s Pet>
scanTool:ClearLines()
print (petName)
scanTool:SetUnit (petName)
local ownerText = scanText:GetText()
if not ownerText then return nil end
local owner, _ = string.split("'",ownerText)
if (not ownerText) then
return nil
end
local owner, _ = string.split ("'", ownerText)
return owner -- This is the pet's owner
end
print (getPetOwner (petname))
--print (getPetOwner (petname))
print (getPetOwner (petGUID))
elseif (command == "buffsof") then
+1
View File
@@ -906,6 +906,7 @@ do
[116888] = true, --Shroud of Purgatory (talent)
[51052] = true, --Anti-Magic Zone (talent)
[77535] = true, --Blood Shield
[115635] = true, --death barrier
--shaman
[114893] = true, --Stone Bulwark (stone bulwark totem)
+12 -2
View File
@@ -229,10 +229,20 @@
function _detalhes:BrokerTick()
local texttype = _detalhes.minimap.text_type
if (texttype == 1) then --dps
_detalhes.databroker.text = _detalhes.tabela_vigente.totals_grupo[1]
local time = _detalhes.tabela_vigente:GetCombatTime()
if (not time or time == 0) then
_detalhes.databroker.text = 0
else
_detalhes.databroker.text = _detalhes.tabela_vigente.totals_grupo[1] / time
end
elseif (texttype == 2) then --hps
_detalhes.databroker.text = _detalhes.tabela_vigente.totals_grupo[2]
local time = _detalhes.tabela_vigente:GetCombatTime()
if (not time or time == 0) then
_detalhes.databroker.text = 0
else
_detalhes.databroker.text = _detalhes.tabela_vigente.totals_grupo[2] / time
end
else
if (_detalhes.minimap.text_func) then
+902 -709
View File
File diff suppressed because it is too large Load Diff
+170 -33
View File
@@ -1151,6 +1151,7 @@ local function resize_scripts (resizer, instancia, scrollbar, side, baseframe)
_G.GameCooltip:SetType ("tooltip")
_G.GameCooltip:AddFromTable (resizeTooltip)
_G.GameCooltip:SetOption ("NoLastSelectedBar", true)
_G.GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
_G.GameCooltip:SetOwner (resizer)
_G.GameCooltip:ShowCooltip()
end
@@ -2467,6 +2468,7 @@ function gump:CriaNovaBarra (instancia, index)
local rowframe = instancia.rowframe
local esta_barra = CreateFrame ("button", "DetailsBarra_"..instancia.meu_id.."_"..index, rowframe)
esta_barra.row_id = index
esta_barra.instance_id = instancia.meu_id
local y = instancia.row_height*(index-1)
@@ -2476,9 +2478,7 @@ function gump:CriaNovaBarra (instancia, index)
esta_barra:SetPoint ("topleft", baseframe, "topleft", instancia.row_info.space.left, y)
elseif (instancia.bars_grow_direction == 2) then
--y = y*-1
esta_barra:SetPoint ("bottomleft", baseframe, "bottomleft", instancia.row_info.space.left, y + 2)
end
esta_barra:SetHeight (instancia.row_info.height) --> altura determinada pela instância
@@ -2493,7 +2493,19 @@ function gump:CriaNovaBarra (instancia, index)
esta_barra:RegisterForClicks ("LeftButtonDown", "RightButtonDown")
esta_barra.statusbar = CreateFrame ("StatusBar", "DetailsBarra_Statusbar_"..instancia.meu_id.."_"..index, esta_barra)
--esta_barra.statusbar:SetAllPoints (esta_barra)
esta_barra.border = CreateFrame ("Frame", "DetailsBarra_Border_" .. instancia.meu_id .. "_" .. index, esta_barra.statusbar)
esta_barra.border:SetFrameLevel (esta_barra.statusbar:GetFrameLevel()+1)
esta_barra.border:SetAllPoints (esta_barra)
local backdrop = instancia.row_info.backdrop.enabled
if (backdrop) then
esta_barra.border:SetBackdrop ({edgeFile = SharedMedia:Fetch ("border", instancia.row_info.backdrop.texture), edgeSize = instancia.row_info.backdrop.size})
esta_barra.border:SetBackdropBorderColor (_unpack (instancia.row_info.backdrop.color))
end
esta_barra.border:SetBackdrop ({edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 12})
esta_barra.border:SetBackdropBorderColor (0, 0, 0, 1)
esta_barra.textura = esta_barra.statusbar:CreateTexture (nil, "artwork")
esta_barra.textura:SetHorizTile (false)
@@ -2627,6 +2639,31 @@ function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass,
self:InstanceRefreshRows()
end
function _detalhes:SetBarBackdropSettings (enabled, size, color, texture)
if (type (enabled) ~= "boolean") then
enabled = self.row_info.backdrop.enabled
end
if (not size) then
size = self.row_info.backdrop.size
end
if (not color) then
color = self.row_info.backdrop.color
end
if (not texture) then
texture = self.row_info.backdrop.texture
end
self.row_info.backdrop.enabled = enabled
self.row_info.backdrop.size = size
self.row_info.backdrop.color = color
self.row_info.backdrop.texture = texture
self:InstanceReset()
self:InstanceRefreshRows()
self:ReajustaGump()
end
function _detalhes:SetBarSettings (height, texture, colorclass, fixedcolor, backgroundtexture, backgroundcolorclass, backgroundfixedcolor, alpha, iconfile, barstart, spacement)
--> bar start
@@ -2752,6 +2789,14 @@ function _detalhes:InstanceRefreshRows (instancia)
local custom_right_text_enabled = self.row_info.textR_enable_custom_text
local custom_right_text = self.row_info.textR_custom_text
--backdrop
local backdrop = self.row_info.backdrop.enabled
local backdrop_color
if (backdrop) then
backdrop = {edgeFile = SharedMedia:Fetch ("border", self.row_info.backdrop.texture), edgeSize = self.row_info.backdrop.size}
backdrop_color = self.row_info.backdrop.color
end
-- do it
for _, row in _ipairs (self.barras) do
@@ -2829,6 +2874,14 @@ function _detalhes:InstanceRefreshRows (instancia)
_detalhes:SetFontFace (row.texto_esquerdo, self.row_info.font_face_file or "GameFontHighlight")
_detalhes:SetFontFace (row.texto_direita, self.row_info.font_face_file or "GameFontHighlight")
--backdrop
if (backdrop) then
row.border:SetBackdrop (backdrop)
row.border:SetBackdropBorderColor (_unpack (backdrop_color))
else
row.border:SetBackdrop (nil)
end
end
self:SetBarGrowDirection()
@@ -3626,7 +3679,7 @@ local parameters_table = {}
local on_leave_menu = function (self, elapsed)
parameters_table[2] = parameters_table[2] + elapsed
if (parameters_table[2] > 0.3) then
if (not _G.GameCooltip.mouseOver and not _G.GameCooltip.buttonOver) then
if (not _G.GameCooltip.mouseOver and not _G.GameCooltip.buttonOver and (not _G.GameCooltip:GetOwner() or _G.GameCooltip:GetOwner() == self)) then
_G.GameCooltip:ShowMe (false)
end
self:SetScript ("OnUpdate", nil)
@@ -4072,12 +4125,12 @@ function _detalhes:ChangeSkin (skin_name)
end
elseif (self.modo == 4) then
if (_detalhes.RaidTables.Plugins [1] and _detalhes.RaidTables.Mode) then
local plugin_index = _detalhes.RaidTables.Mode
if (plugin_index and _detalhes.RaidTables.Menu [plugin_index]) then
self:ChangeIcon (_detalhes.RaidTables.Menu [plugin_index] [2])
end
end
--if (_detalhes.RaidTables.Plugins [1] and _detalhes.RaidTables.Mode) then
-- local plugin_index = _detalhes.RaidTables.Mode
-- if (plugin_index and _detalhes.RaidTables.Menu [plugin_index]) then
--self:ChangeIcon (_detalhes.RaidTables.Menu [plugin_index] [2])
-- end
--end
end
else
local icon_anchor = this_skin.icon_anchor_main --> ancora do icone do canto direito superior
@@ -4102,6 +4155,7 @@ function _detalhes:ChangeSkin (skin_name)
----------> call widgets handlers
self:SetBarSettings (self.row_info.height)
self:SetBarBackdropSettings()
--> update toolbar
self:ToolbarSide()
@@ -4336,11 +4390,13 @@ function _detalhes:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side
function self.menu_attribute_string:OnEvent (instance, attribute, subAttribute)
if (instance == label.owner_instance) then
label.text = _detalhes:GetSubAttributeName (attribute, subAttribute)
local sName = instance:GetInstanceAttributeText()
label.text = sName
end
end
_detalhes:RegisterEvent (self.menu_attribute_string, "DETAILS_INSTANCE_CHANGEATTRIBUTE", self.menu_attribute_string.OnEvent)
_detalhes:RegisterEvent (self.menu_attribute_string, "DETAILS_INSTANCE_CHANGEMODE", self.menu_attribute_string.OnEvent)
end
@@ -5057,10 +5113,44 @@ end
--> reset button functions
local reset_button_onenter = function (self)
OnEnterMainWindow (self.instance, self)
GameCooltip.buttonOver = true
self.instance.baseframe.cabecalho.button_mouse_over = true
GameCooltip:Reset()
GameCooltip:SetOption ("ButtonsYMod", -2)
GameCooltip:SetOption ("YSpacingMod", 0)
GameCooltip:SetOption ("TextHeightMod", 0)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
GameCooltip:AddLine (Loc ["STRING_ERASE_DATA"], nil, 1, "white", nil, 10, SharedMedia:Fetch ("font", "Friz Quadrata TT"))
--GameCooltip:AddIcon ([[Interface\Buttons\UI-MinusButton-Up]], 1, 1)
GameCooltip:AddIcon ([[Interface\PetBattles\DeadPetIcon]], 1, 1)
GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar)
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
show_anti_overlap (self.instance, self, "top")
GameCooltip:ShowCooltip (self, "menu")
end
local reset_button_onleave = function (self)
OnLeaveMainWindow (self.instance, self)
hide_anti_overlap (self.instance.baseframe.anti_menu_overlap)
GameCooltip.buttonOver = false
self.instance.baseframe.cabecalho.button_mouse_over = false
if (GameCooltip.active) then
parameters_table [2] = 0
self:SetScript ("OnUpdate", on_leave_menu)
else
self:SetScript ("OnUpdate", nil)
end
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -5235,12 +5325,6 @@ function gump:CriaCabecalho (baseframe, instancia)
{icon = [[Interface\AddOns\Details\images\modo_icones]], l = 32/256*2, r = 32/256*3, t = 0, b = 1, width = 20, height = 20},
{text = Loc ["STRING_HELP_MODEALL"], type = 2},
{icon = [[Interface\TUTORIALFRAME\TutorialFrame-QuestionMark]], type = 2, width = 16, height = 16, l = 8/64, r = 1 - (8/64), t = 8/64, b = 1 - (8/64)},
{text = Loc ["STRING_MODE_SELF"]}, -- .. " (|cffa0a0a0" .. Loc ["STRING_MODE_PLUGINS"] .. "|r)"
{func = instancia.AlteraModo, param1 = 1},
{icon = [[Interface\AddOns\Details\images\modo_icones]], l = 0, r = 32/256, t = 0, b = 1, width = 20, height = 20},
{text = Loc ["STRING_HELP_MODESELF"], type = 2},
{icon = [[Interface\TUTORIALFRAME\TutorialFrame-QuestionMark]], type = 2, width = 16, height = 16, l = 8/64, r = 1 - (8/64), t = 8/64, b = 1 - (8/64)},
{text = Loc ["STRING_MODE_RAID"]}, -- .. " (|cffa0a0a0" .. Loc ["STRING_MODE_PLUGINS"] .. "|r)"
{func = instancia.AlteraModo, param1 = 4},
@@ -5248,6 +5332,12 @@ function gump:CriaCabecalho (baseframe, instancia)
{text = Loc ["STRING_HELP_MODERAID"], type = 2},
{icon = [[Interface\TUTORIALFRAME\TutorialFrame-QuestionMark]], type = 2, width = 16, height = 16, l = 8/64, r = 1 - (8/64), t = 8/64, b = 1 - (8/64)},
{text = Loc ["STRING_MODE_SELF"]}, -- .. " (|cffa0a0a0" .. Loc ["STRING_MODE_PLUGINS"] .. "|r)"
{func = instancia.AlteraModo, param1 = 1},
{icon = [[Interface\AddOns\Details\images\modo_icones]], l = 0, r = 32/256, t = 0, b = 1, width = 20, height = 20},
{text = Loc ["STRING_HELP_MODESELF"], type = 2},
{icon = [[Interface\TUTORIALFRAME\TutorialFrame-QuestionMark]], type = 2, width = 16, height = 16, l = 8/64, r = 1 - (8/64), t = 8/64, b = 1 - (8/64)},
{text = Loc ["STRING_OPTIONS_WINDOW"]},
{func = _detalhes.OpenOptionsWindow},
{icon = [[Interface\AddOns\Details\images\modo_icones]], l = 32/256*4, r = 32/256*5, t = 0, b = 1, width = 20, height = 20},
@@ -5273,13 +5363,13 @@ function gump:CriaCabecalho (baseframe, instancia)
local checked
if (instancia.modo == 1) then
checked = 3
checked = 4
elseif (instancia.modo == 2) then
checked = 1
elseif (instancia.modo == 3) then
checked = 2
elseif (instancia.modo == 4) then
checked = 4
checked = 3
end
parameters_table [1] = instancia
@@ -5419,8 +5509,18 @@ function gump:CriaCabecalho (baseframe, instancia)
local BuildAttributeMenu = function()
if (_detalhes.solo and _detalhes.solo == instancia.meu_id) then
return _detalhes:MontaSoloOption (instancia)
elseif (_detalhes.raid and _detalhes.raid == instancia.meu_id) then
return _detalhes:MontaRaidOption (instancia)
elseif (instancia:IsRaidMode()) then
local have_plugins = _detalhes:MontaRaidOption (instancia)
if (not have_plugins) then
GameCooltip:SetType ("tooltip")
GameCooltip:SetOption ("ButtonsYMod", 0)
GameCooltip:SetOption ("YSpacingMod", 0)
GameCooltip:SetOption ("TextHeightMod", 0)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
GameCooltip:AddLine ("All raid plugins already\nin use or disabled.", nil, 1, "white", nil, 10, SharedMedia:Fetch ("font", "Friz Quadrata TT"))
GameCooltip:AddIcon ([[Interface\GROUPFRAME\UI-GROUP-ASSISTANTICON]], 1, 1)
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
end
else
return _detalhes:MontaAtributosOption (instancia)
end
@@ -5475,19 +5575,46 @@ function gump:CriaCabecalho (baseframe, instancia)
self:GetNormalTexture():SetDesaturated (false)
end
GameCooltip.buttonOver = true
baseframe.cabecalho.button_mouse_over = true
GameCooltip:Reset()
GameCooltip:AddLine (Loc ["STRING_REPORT_BUTTON_TOOLTIP"])
GameCooltip:SetOwner (baseframe.cabecalho.report.widget)
GameCooltip:SetOption ("ButtonsYMod", -3)
GameCooltip:SetOption ("YSpacingMod", 0)
GameCooltip:SetOption ("TextHeightMod", 0)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", false)
GameCooltip:AddLine ("Report Results", nil, 1, "white", nil, 10, SharedMedia:Fetch ("font", "Friz Quadrata TT"))
GameCooltip:AddIcon ([[Interface\Addons\Details\Images\report_button]], 1, 1, 12, 19)
GameCooltip:AddMenu (1, _detalhes.Reportar, instancia)
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
GameCooltip:Show()
show_anti_overlap (instancia, self, "top")
GameCooltip:ShowCooltip (self, "menu")
end)
baseframe.cabecalho.report:SetScript ("OnLeave", function (self)
OnLeaveMainWindow (instancia, self, 3)
hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
GameCooltip.buttonOver = false
baseframe.cabecalho.button_mouse_over = false
if (instancia.desaturated_menu) then
self:GetNormalTexture():SetDesaturated (true)
end
GameCooltip:Hide()
if (GameCooltip.active) then
parameters_table [2] = 0
self:SetScript ("OnUpdate", on_leave_menu)
else
self:SetScript ("OnUpdate", nil)
end
end)
--> NOVA INSTANCIA ----------------------------------------------------------------------------------------------------------------------------------------------------
@@ -5517,7 +5644,7 @@ function gump:CriaCabecalho (baseframe, instancia)
--> Build Menu Function
local BuildClosedInstanceMenu = function()
local ClosedInstances = {}
local ClosedInstances = 0
for index = 1, math.min (#_detalhes.tabela_instancias, _detalhes.instances_amount), 1 do
@@ -5528,6 +5655,7 @@ function gump:CriaCabecalho (baseframe, instancia)
--> pegar o que ela ta mostrando
local atributo = _this_instance.atributo
local sub_atributo = _this_instance.sub_atributo
ClosedInstances = ClosedInstances + 1
if (atributo == 5) then --> custom
@@ -5554,11 +5682,15 @@ function gump:CriaCabecalho (baseframe, instancia)
elseif (modo == 4) then --raid
atributo = _detalhes.RaidTables.Mode or 1
local RaidInfo = _detalhes.RaidTables.Menu [atributo]
if (RaidInfo) then
CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " " .. RaidInfo [1], _, true)
CoolTip:AddIcon (RaidInfo [2], 1, 1, 20, 20, 0, 1, 0, 1)
local plugin_name = _this_instance.current_raid_plugin or _this_instance.last_raid_plugin
if (plugin_name) then
local plugin_object = _detalhes:GetPlugin (plugin_name)
if (plugin_object) then
CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " " .. plugin_object.__name, _, true)
CoolTip:AddIcon (plugin_object.__icon, 1, 1, 20, 20, 0, 1, 0, 1)
else
CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " Unknown Plugin", _, true)
end
else
CoolTip:AddMenu (1, OnClickNovoMenu, index, nil, nil, "#".. index .. " Unknown Plugin", _, true)
end
@@ -5575,6 +5707,11 @@ function gump:CriaCabecalho (baseframe, instancia)
end
end
if (ClosedInstances == 0) then
CoolTip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_NOCLOSED_INSTANCES"], _, true)
CoolTip:AddIcon ([[Interface\Buttons\UI-AttributeButton-Encourage-Up]], 1, 1, 16, 16)
end
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
return ClosedInstances
@@ -5593,12 +5730,12 @@ function gump:CriaCabecalho (baseframe, instancia)
--> a hook for OnLeaveScript
OnLeaveFunc = function() OnLeaveMainWindow (instancia, baseframe.cabecalho.novo, 3) end,
--> default message if there is no option avaliable
Default = Loc ["STRING_NOCLOSED_INSTANCES"],
Default = Loc ["STRING_NOCLOSED_INSTANCES"],
--> instancia is the first parameter sent after click, before parameters
FixedValue = instancia,
Options = function()
if (instancia.toolbar_side == 1) then --top
return {TextSize = 10, NoLastSelectedBar = true}
return {TextSize = 10, NoLastSelectedBar = true, ButtonsYMod = -2}
elseif (instancia.toolbar_side == 2) then --bottom
return {HeightAnchorMod = -7, TextSize = 10, NoLastSelectedBar = true}
end
+6 -2
View File
@@ -137,12 +137,16 @@ local _UISpecialFrames = UISpecialFrames --> wow api locals
--> internal details report functions -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function _detalhes:Reportar (param2, options)
function _detalhes:Reportar (param2, options, arg3)
if (not _detalhes.janela_report) then
_detalhes.janela_report = gump:CriaJanelaReport()
end
if (options.meu_id) then
self = options
end
--> trabalha com as opções:
if (options and options._no_current) then
_G ["Details_Report_CB_1"]:Disable()
@@ -163,7 +167,7 @@ local _UISpecialFrames = UISpecialFrames --> wow api locals
_detalhes.janela_report.slider:Enable()
_detalhes.janela_report.slider.lockTexture:Hide()
_detalhes.janela_report.slider.amt:Show()
if (options) then
_detalhes.janela_report.enviar:SetScript ("OnClick", function() self:monta_relatorio (param2, options._custom) end)
else
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -375,7 +375,6 @@ Message: ..\AddOns\Details_EncounterDetails\frames.lua line 156:
GameCooltip:SetOption ("TextSize", 9.5)
GameCooltip:SetOption ("IconSize", 12)
GameCooltip:SetOption ("HeightAnchorMod", -15)
GameCooltip:SetOption ("TextHeightMod", -2)
GameCooltip:ShowCooltip (frame, "tooltip")
end
@@ -347,7 +347,6 @@ local function CreatePluginFrames (data)
GameCooltip:AddLine (string.format ("%.1f", TimeObject.FinishIlevel))
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Humanoid")
GameCooltip:SetOption ("TextHeightMod", -4)
GameCooltip:ShowCooltip (self.background, "tooltip")
else --> history
@@ -368,7 +367,6 @@ local function CreatePluginFrames (data)
GameCooltip:AddLine (string.format ("%.1f", TimeObject.ItemLevel))
GameCooltip:AddIcon ("Interface\\TARGETINGFRAME\\PetBadge-Humanoid")
GameCooltip:SetOption ("TextHeightMod", -4)
GameCooltip:ShowCooltip (self.background, "tooltip")
end
end
@@ -56,7 +56,7 @@ local function CreatePluginFrames (data)
ThreatMeter:Cancel()
elseif (event == "SHOW") then
instance = _detalhes.RaidTables.instancia
instance = ThreatMeter:GetInstance (ThreatMeter.instance_id)
ThreatMeter.RowWidth = instance.baseframe:GetWidth()-6
@@ -507,7 +507,7 @@ function ThreatMeter:OnEvent (_, event, ...)
local MINIMAL_DETAILS_VERSION_REQUIRED = 1
--> Install
local install, saveddata = _G._detalhes:InstallPlugin ("TANK", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Paladin_ShieldofVengeance", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.04")
local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Paladin_ShieldofVengeance", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.05")
if (type (install) == "table" and install.error) then
print (install.error)
end
+11 -4
View File
@@ -66,7 +66,8 @@ local function CreatePluginFrames (data)
elseif (event == "SHOW") then --> plugin shown, enabled
instancia = _detalhes.RaidTables.instancia
instancia = Vanguard:GetInstance (Vanguard.instance_id)
for index, tankframe in _ipairs (Vanguard.TankFrames) do
DetailsFrameWork:RegisterForDetailsMove (tankframe.Frame.frame, instancia)
end
@@ -85,7 +86,7 @@ local function CreatePluginFrames (data)
Vanguard:IdentifyTanks()
if (Vanguard:IsInCombat()) then
instancia = _detalhes.RaidTables.instancia
instancia = Vanguard:GetInstance (Vanguard.instance_id)
_combat_object = _detalhes.tabela_vigente
_track_player_object = nil
_track_player_name = nil
@@ -101,7 +102,8 @@ local function CreatePluginFrames (data)
elseif (event == "COMBAT_PLAYER_ENTER") then --> a new combat has been started
instancia = _detalhes.RaidTables.instancia
--instancia = _detalhes.RaidTables.instancia
instancia = Vanguard:GetInstance (Vanguard.instance_id)
_combat_object = select (1, ...)
_track_player_object = nil
_track_player_name = nil
@@ -127,7 +129,7 @@ local function CreatePluginFrames (data)
_combat_object = select (1, ...)
Vanguard.Running = false
VanguardFrame:SetScript ("OnUpdate", onupdate)
VanguardFrame:SetScript ("OnUpdate", nil)
Vanguard:ResetBars()
Vanguard:ResetDamage()
@@ -1190,6 +1192,11 @@ local function CreatePluginFrames (data)
end
end
if (not _track_player_object) then
_detalhes:ScheduleTimer ("VanguardWait", 1)
return
end
--print ("Vanguard: playername: ".. _track_player_name)
hits_last = 0
+228 -4
View File
@@ -145,13 +145,15 @@ function _G._detalhes:Start()
self:AtualizaGumpPrincipal (-1, true)
local lower_instance = _detalhes:GetLowerInstanceNumber()
for index = 1, #self.tabela_instancias do
local instance = self.tabela_instancias [index]
if (instance:IsAtiva()) then
--> refresh wallpaper
if (instance.wallpaper.enabled) then
instance:InstanceWallpaper (true)
else
instance:InstanceWallpaper (false)
end
--> refresh desaturated icons if is lower instance
@@ -164,8 +166,21 @@ function _G._detalhes:Start()
_detalhes.ToolBar:ReorganizeIcons() --> refresh all skin
self.RefreshAfterStartup = nil
function _detalhes:CheckWallpaperAfterStartup()
for _, instance in ipairs (self.tabela_instancias) do
if (not instance.wallpaper.enabled) then
if (instance:IsAtiva()) then
instance:InstanceWallpaper (false)
end
end
end
self.CheckWallpaperAfterStartup = nil
end
_detalhes:ScheduleTimer ("CheckWallpaperAfterStartup", 5)
end
self:ScheduleTimer ("RefreshAfterStartup", 4)
self:ScheduleTimer ("RefreshAfterStartup", 5)
@@ -211,8 +226,6 @@ function _G._detalhes:Start()
-- self.listener:RegisterEvent ("UNIT_SPELLCAST_INTERRUPTED")
----------------------------------------------------------------------------------------------------------------------------------------
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
function _detalhes:CooltipPreset (preset)
local GameCooltip = GameCooltip
@@ -227,6 +240,17 @@ function _G._detalhes:Start()
GameCooltip:SetOption ("YSpacingMod", -4)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", true)
GameCooltip:SetColor (1, 0.5, 0.5, 0.5, 0.5)
elseif (preset == 2) then
GameCooltip:SetOption ("TextFont", "Friz Quadrata TT")
GameCooltip:SetOption ("TextColor", "orange")
GameCooltip:SetOption ("TextSize", 12)
GameCooltip:SetOption ("FixedWidth", 220)
GameCooltip:SetOption ("ButtonsYMod", -4)
GameCooltip:SetOption ("YSpacingMod", -4)
GameCooltip:SetOption ("IgnoreButtonAutoHeight", true)
GameCooltip:SetColor (1, 0.5, 0.5, 0.5, 0.5)
end
end
@@ -806,6 +830,206 @@ function _G._detalhes:Start()
b:SetAlpha (1)
--]]
local panel = self.gump:NewPanel (UIParent, nil, "DetailsWindowOptionsBarTextEditor", 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, edgeFile="Interface\\Tooltips\\UI-Tooltip-Border", edgeSize=16, insets = {left=3, right=3, top=3, bottom=3}})
panel:DisableGradient()
panel:SetBackdropColor (0, 0, 0, 1)
function panel.widget:Open (text, callback, host)
if (host) then
panel:SetPoint ("center", host, "center")
end
text = text:gsub ("||", "|")
panel.default_text = text
panel.widget.editbox:SetText (text)
panel.callback = callback
panel:Show()
end
local textentry = self.gump:NewSpecialLuaEditorEntry (panel.widget, 450, 180, "editbox", "$parentEntry", true)
textentry:SetPoint ("topleft", panel.widget, "topleft", 10, -10)
local arg1_button = self.gump:NewButton (panel, nil, "$parentButton1", nil, 80, 20, function() textentry.editbox:Insert ("{data1}") end, nil, nil, nil, "{data1}")
local arg2_button = self.gump:NewButton (panel, nil, "$parentButton2", nil, 80, 20, function() textentry.editbox:Insert ("{data2}") end, nil, nil, nil, "{data2}")
local arg3_button = self.gump:NewButton (panel, nil, "$parentButton3", nil, 80, 20, function() textentry.editbox:Insert ("{data3}") end, nil, nil, nil, "{data3}")
arg1_button:SetPoint ("topright", panel, "topright", -10, -14)
arg2_button:SetPoint ("topright", panel, "topright", -10, -36)
arg3_button:SetPoint ("topright", panel, "topright", -10, -58)
arg1_button:InstallCustomTexture()
arg2_button:InstallCustomTexture()
arg3_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 func_button = self.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 color_button = self.gump:NewColorPickButton (panel, "$parentButton5", nil, color_func)
color_button:SetSize (80, 20)
func_button:SetPoint ("topright", panel, "topright", -10, -80)
color_button:SetPoint ("topright", panel, "topright", -10, -102)
func_button:InstallCustomTexture()
color_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COLOR_TOOLTIP"]
func_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC_TOOLTIP"]
--color_button:InstallCustomTexture()
local comma_button = self.gump:NewButton (panel, nil, "$parentButtonComma", nil, 80, 20, function() textentry.editbox:Insert ("_detalhes:comma_value ( )") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_COMMA"])
local tok_button = self.gump:NewButton (panel, nil, "$parentButtonTok", nil, 80, 20, function() textentry.editbox:Insert ("_detalhes:ToK2 ( )") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_TOK"])
comma_button:InstallCustomTexture()
tok_button:InstallCustomTexture()
comma_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COMMA_TOOLTIP"]
tok_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_TOK_TOOLTIP"]
comma_button:SetPoint ("topright", panel, "topright", -100, -14)
tok_button:SetPoint ("topright", panel, "topright", -100, -36)
local done = function()
local text = panel.widget.editbox:GetText()
text = text:gsub ("\n", "")
local test = text
local function errorhandler(err)
return geterrorhandler()(err)
end
local code = [[local str = "STR"; str = str:ReplaceData (100, 50, 75, {nome = "you", total = 10, total_without_pet = 5, damage_taken = 7, last_dps = 1, friendlyfire_total = 6, totalover = 2, totalabsorb = 4, totalover_without_pet = 6, healing_taken = 1, heal_enemy_amt = 2});]]
code = code:gsub ("STR", test)
local f = loadstring (code)
local err, two = xpcall (f, errorhandler)
if (not err) then
return
end
panel.callback (text)
panel:Hide()
end
local ok_button = self.gump:NewButton (panel, nil, "$parentButtonOk", nil, 80, 20, done, nil, nil, nil, "DONE")
ok_button:InstallCustomTexture()
ok_button:SetPoint ("topright", panel, "topright", -10, -174)
local reset_button = self.gump:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText (_detalhes.instance_defaults.row_info.textR_custom_text) end, nil, nil, nil, "Default")
reset_button:InstallCustomTexture()
reset_button:SetPoint ("topright", panel, "topright", -100, -152)
local cancel_button = self.gump:NewButton (panel, nil, "$parentDefaultCancel", nil, 80, 20, function() textentry.editbox:SetText (panel.default_text); done(); end, nil, nil, nil, "Cancel")
cancel_button:InstallCustomTexture()
cancel_button:SetPoint ("topright", panel, "topright", -100, -174)
function _detalhes:OpenOptionsWindowAtStart()
--_detalhes:OpenOptionsWindow (_detalhes.tabela_instancias[1])
--print (_G ["DetailsClearSegmentsButton1"]:GetSize())