Shaladownlands Launch

This commit is contained in:
Tercio Jose
2020-11-23 17:03:08 -03:00
parent 3d5095bd2c
commit ea9ad32a7f
18 changed files with 375 additions and 88 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
## Interface: 90001
## Interface: 90002
## Title: Lib: LibDFramework-1.0
## Notes: Base Framework for many Addons
+11 -12
View File
@@ -1,6 +1,6 @@
local dversion = 215
local dversion = 220
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -611,7 +611,7 @@ function DF:TruncateText (fontString, maxWidth)
end
end
DF:CleanTruncateUTF8String(text)
text = DF:CleanTruncateUTF8String(text)
fontString:SetText (text)
end
@@ -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
@@ -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)
+20 -16
View File
@@ -534,14 +534,14 @@ 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
@@ -549,14 +549,14 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
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
@@ -565,14 +565,14 @@ 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()
@@ -580,7 +580,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
self.timer = false
end
function BarMetaFunctions:CancelTimerBar (no_timer_end)
function BarMetaFunctions:CancelTimerBar(no_timer_end)
if (not self.HasTimer) then
return
end
@@ -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
@@ -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
@@ -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()
@@ -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()
@@ -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)
+22 -2
View File
@@ -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")
@@ -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
@@ -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
@@ -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
@@ -5330,6 +5338,8 @@ 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,
@@ -5337,6 +5347,8 @@ local default_icon_row_options = {
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,
@@ -5344,6 +5356,8 @@ local default_icon_row_options = {
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,
@@ -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,
}
@@ -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)
+5 -6
View File
@@ -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)