Skip to content

Commit

Permalink
Shaladownlands Launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Nov 23, 2020
1 parent 3d5095b commit ea9ad32
Show file tree
Hide file tree
Showing 18 changed files with 375 additions and 88 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ a.lua
functions/pack2.lua
*.json
*.afphoto
wowapi.lua
3 changes: 2 additions & 1 deletion Details.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 90001
## Interface: 90002
## Title: Details! Damage Meter
## Notes: Essential tool to impress that chick in your raid.
## SavedVariables: _detalhes_global
Expand Down Expand Up @@ -67,6 +67,7 @@ frames\window_copy.lua
frames\window_options2.lua
frames\window_options2_sections.lua
frames\window_api.lua
#frames\window_cdtracker.lua
frames\window_playerbreakdown.lua
frames\window_playerbreakdown_list.lua
frames\window_report.lua
Expand Down
2 changes: 1 addition & 1 deletion Libs/DF/LibDFramework-1.0.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 90001
## Interface: 90002
## Title: Lib: LibDFramework-1.0
## Notes: Base Framework for many Addons

Expand Down
23 changes: 11 additions & 12 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 215
local dversion = 220

local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
Expand Down Expand Up @@ -611,7 +611,7 @@ function DF:TruncateText (fontString, maxWidth)
end
end

DF:CleanTruncateUTF8String(text)
text = DF:CleanTruncateUTF8String(text)
fontString:SetText (text)
end

Expand Down Expand Up @@ -3399,13 +3399,13 @@ function DF:CoreDispatch (context, func, ...)
error (errortext)
end

local okay, result1, result2, result3, result4 = pcall (func, ...)
if (not okay) then
local stack = debugstack(2)
local errortext = "D!Framework (" .. context .. ") error: " .. result1 .. "\n====================\n" .. stack .. "\n====================\n"
error (errortext)
end
local okay, result1, result2, result3, result4 = xpcall(func, geterrorhandler(), ...)

--if (not okay) then --when using pcall
--local stack = debugstack(2)
--local errortext = "D!Framework (" .. context .. ") error: " .. result1 .. "\n====================\n" .. stack .. "\n====================\n"
--error (errortext)
--end

return result1, result2, result3, result4
end
Expand Down Expand Up @@ -4204,10 +4204,9 @@ end
end
}

function DF:SetEnvironment(func, environmentHandle)
function DF:SetEnvironment(func, environmentHandle, newEnvironment)
environmentHandle = environmentHandle or DF.DefaultSecureScriptEnvironmentHandle

local newEnvironment = {}
newEnvironment = newEnvironment or {}

setmetatable(newEnvironment, environmentHandle)
_G.setfenv(func, newEnvironment)
Expand Down
36 changes: 20 additions & 16 deletions Libs/DF/normal_bar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,29 +534,29 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
return
end
end

local OnMouseDown = function (frame, button)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule)
if (kill) then
return
end

if (not frame.MyObject.container.isLocked and frame.MyObject.container:IsMovable()) then
if (not frame.isLocked and frame:IsMovable()) then
frame.MyObject.container.isMoving = true
frame.MyObject.container:StartMoving()
end
end
end

local OnMouseUp = function (frame, button)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule)
if (kill) then
return
end

if (frame.MyObject.container.isMoving) then
frame.MyObject.container:StopMovingOrSizing()
frame.MyObject.container.isMoving = false
Expand All @@ -565,22 +565,22 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]

------------------------------------------------------------------------------------------------------------
--> timer

function BarMetaFunctions:OnTimerEnd()
local capsule = self
local kill = capsule:RunHooksForWidget ("OnTimerEnd", self.widget, capsule)
if (kill) then
return
end

self.timer_texture:Hide()
self.timer_textureR:Hide()
self.div_timer:Hide()
self:Hide()
self.timer = false
end

function BarMetaFunctions:CancelTimerBar (no_timer_end)
function BarMetaFunctions:CancelTimerBar(no_timer_end)
if (not self.HasTimer) then
return
end
Expand All @@ -592,7 +592,11 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
self.statusbar:SetScript ("OnUpdate", nil)
end
end

self.righttext = ""
self.timer_texture:Hide()
self.timer_textureR:Hide()

if (not no_timer_end) then
self:OnTimerEnd()
end
Expand All @@ -601,6 +605,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local OnUpdate = function (self, elapsed)
--> percent of elapsed
local pct = abs (self.end_timer - GetTime() - self.tempo) / self.tempo

if (self.inverse) then
self.t:SetWidth (self.total_size * pct)
else
Expand All @@ -624,7 +629,6 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
end

function BarMetaFunctions:SetTimer (tempo, end_at)

if (end_at) then
self.statusbar.tempo = end_at - tempo
self.statusbar.remaining = end_at - GetTime()
Expand All @@ -637,13 +641,13 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]

self.statusbar.total_size = self.statusbar:GetWidth()
self.statusbar.inverse = self.BarIsInverse
self (0)

self(0)

self.div_timer:Show()
self.background:Show()
self:Show()

if (self.LeftToRight) then
self.timer_texture:Hide()
self.timer_textureR:Show()
Expand All @@ -659,19 +663,19 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
self.timer_texture:SetPoint ("left", self.statusbar, "left")
self.div_timer:SetPoint ("left", self.timer_texture, "right", -16, -1)
end

if (self.BarIsInverse) then
self.statusbar.t:SetWidth (1)
else
self.statusbar.t:SetWidth (self.statusbar.total_size)
end

self.timer = true

self.HasTimer = true
self.TimerScheduled = DF:ScheduleTimer ("StartTimeBarAnimation", 0.1, self)
end

function DF:StartTimeBarAnimation (timebar)
timebar.TimerScheduled = nil
timebar.statusbar:SetScript ("OnUpdate", OnUpdate)
Expand Down
24 changes: 22 additions & 2 deletions Libs/DF/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5131,6 +5131,7 @@ DF.IconRowFunctions = {
cooldownFrame:SetAllPoints()
cooldownFrame:EnableMouse (false)
cooldownFrame:SetFrameLevel (newIconFrame:GetFrameLevel()+1)
cooldownFrame:SetHideCountdownNumbers (self.options.surpress_blizzard_cd_timer)
cooldownFrame.noCooldownCount = self.options.surpress_tulla_omni_cc

newIconFrame.CountdownText = cooldownFrame:CreateFontString (nil, "overlay", "GameFontNormal")
Expand Down Expand Up @@ -5224,12 +5225,15 @@ DF.IconRowFunctions = {

iconFrame.CountdownText:SetPoint (self.options.text_anchor or "center", iconFrame, self.options.text_rel_anchor or "center", self.options.text_x_offset or 0, self.options.text_y_offset or 0)
DF:SetFontSize (iconFrame.CountdownText, self.options.text_size)
DF:SetFontFace (iconFrame.CountdownText, self.options.text_font)
DF:SetFontOutline (iconFrame.CountdownText, self.options.text_outline)
iconFrame.CountdownText:SetText (formattedTime)
iconFrame.Cooldown:SetHideCountdownNumbers (true)

else
iconFrame.CountdownText:Hide()
iconFrame.Cooldown:SetHideCountdownNumbers (false)
end

iconFrame.Cooldown:SetHideCountdownNumbers (self.options.surpress_blizzard_cd_timer)
else
iconFrame.CountdownText:Hide()
end
Expand All @@ -5240,6 +5244,8 @@ DF.IconRowFunctions = {
iconFrame.Desc:SetTextColor (DF:ParseColors (descText.text_color or self.options.desc_text_color))
iconFrame.Desc:SetPoint(self.options.desc_text_anchor or "bottom", iconFrame, self.options.desc_text_rel_anchor or "top", self.options.desc_text_x_offset or 0, self.options.desc_text_y_offset or 2)
DF:SetFontSize (iconFrame.Desc, descText.text_size or self.options.desc_text_size)
DF:SetFontFace (iconFrame.Desc, self.options.desc_text_font)
DF:SetFontOutline (iconFrame.Desc, self.options.desc_text_outline)
else
iconFrame.Desc:Hide()
end
Expand All @@ -5250,6 +5256,8 @@ DF.IconRowFunctions = {
iconFrame.StackText:SetTextColor (DF:ParseColors (self.options.desc_text_color))
iconFrame.StackText:SetPoint (self.options.stack_text_anchor or "center", iconFrame, self.options.stack_text_rel_anchor or "bottomright", self.options.stack_text_x_offset or 0, self.options.stack_text_y_offset or 0)
DF:SetFontSize (iconFrame.StackText, self.options.stack_text_size)
DF:SetFontFace (iconFrame.StackText, self.options.stack_text_font)
DF:SetFontOutline (iconFrame.StackText, self.options.stack_text_outline)
else
iconFrame.StackText:Hide()
end
Expand Down Expand Up @@ -5330,20 +5338,26 @@ local default_icon_row_options = {
show_text = true,
text_color = {1, 1, 1, 1},
text_size = 12,
text_font = "Arial Narrow",
text_outline = "NONE",
text_anchor = "center",
text_rel_anchor = "center",
text_x_offset = 0,
text_y_offset = 0,
desc_text = true,
desc_text_color = {1, 1, 1, 1},
desc_text_size = 7,
desc_text_font = "Arial Narrow",
desc_text_outline = "NONE",
desc_text_anchor = "bottom",
desc_text_rel_anchor = "top",
desc_text_x_offset = 0,
desc_text_y_offset = 2,
stack_text = true,
stack_text_color = {1, 1, 1, 1},
stack_text_size = 10,
stack_text_font = "Arial Narrow",
stack_text_outline = "NONE",
stack_text_anchor = "center",
stack_text_rel_anchor = "bottomright",
stack_text_x_offset = 0,
Expand All @@ -5356,6 +5370,7 @@ local default_icon_row_options = {
backdrop_border_color = {0, 0, 0, 1},
anchor = {side = 6, x = 2, y = 0},
grow_direction = 1, --1 = to right 2 = to left
surpress_blizzard_cd_timer = false,
surpress_tulla_omni_cc = false,
}

Expand Down Expand Up @@ -7287,6 +7302,11 @@ DF.StatusBarFunctions = {
end

healthBarMetaFunctions.UpdateHealth = function (self)
-- update max health regardless to avoid weird wrong values on UpdateMaxHealth sometimes
-- local maxHealth = UnitHealthMax (self.displayedUnit)
-- self:SetMinMaxValues (0, maxHealth)
-- self.currentHealthMax = maxHealth

local health = UnitHealth (self.displayedUnit)
self.currentHealth = health
PixelUtil.SetStatusBarValue (self, health)
Expand Down
11 changes: 5 additions & 6 deletions Libs/DF/slider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -847,23 +847,22 @@ local SwitchOnClick = function (self, button, forced_value, value)
slider._thumb:SetPoint ("right", slider.widget, "right")
end
end

if (slider.OnSwitch and not forced_value) then
local value = _rawget (slider, "value")
if (slider.return_func) then
value = slider:return_func (value)
end

--> safe call
local success, errorText = pcall (slider.OnSwitch, slider, slider.FixedValue, value)

local success, errorText = xpcall (slider.OnSwitch, geterrorhandler(), slider, slider.FixedValue, value)
if (not success) then
error ("Details! Framework: OnSwitch() " .. (button.GetName and button:GetName() or "-NONAME-") .. " error: " .. (errorText or ""))
end

--> trigger hooks
slider:RunHooksForWidget ("OnSwitch", slider, slider.FixedValue, value)
end

end

local default_switch_func = function (self, passed_value)
Expand Down
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")

_detalhes.build_counter = 7950
_detalhes.alpha_build_counter = 7950 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 8000
_detalhes.alpha_build_counter = 8000 --if this is higher than the regular counter, use it instead
_detalhes.game_version = "v9.0.1"
_detalhes.userversion = "v9.0.1." .. _detalhes.build_counter
_detalhes.realversion = 144 --core version, this is used to check API version for scripts and plugins (see alias below)
Expand Down
Loading

0 comments on commit ea9ad32

Please sign in to comment.