TellMeWhen

TellMeWhen

24M Downloads

icon:SetAlpha being sent values outside the 0..1 range

waveofthought-code opened this issue ยท 2 comments

commented

WoW Version

Retail

TellMeWhen Version

10.1.1

Describe the bug

icon:SetAlpha() calls are being passed values outside the 0..1 range in Alpha:REALALPHA(), located in Components/IconModules/IconModule_Alpha/Alpha.lua

To fix it I added a clamping method and now pass all intended alpha values to this first:

function Alpha:Clamp(a)

	if a > 1 then return 1
	elseif a < 0 then return 0
	end

	return a

end

Export Strings

n/a
commented

Thanks for the report. Without a full stack trace to hint at where the errant values might be coming from, or export strings to see if the values might be originating from configuration, I'm not willing to make any code changes at this time. Let me know if you're able to provide any of that additional information.

commented

I reverted my change to capture the stack in bugstack/buggrabber:

1x TellMeWhen: ...en/Components/IconModules/IconModule_Alpha/Alpha.lua:213: bad argument #1 to 'SetAlpha' (Usage: self:SetAlpha(alpha))
[string "@TellMeWhen/TellMeWhen.lua"]:2812: in function <TellMeWhen/TellMeWhen.lua:2769>

Locals:
self = TMW {
 0 = <userdata>
 CovenantIcons = <table> {
 }
 SlashCommand = <function> defined @TellMeWhen/TellMeWhen.lua:3015
 modules = <table> {
 }
 CancelTimer = <function> defined @!kExtraBossFrames/libs/Ace3/AceTimer-3.0/AceTimer-3.0.lua:147
 DeserializeData = <function> defined @TellMeWhen/Options/TellMeWhen_Options.lua:3907
 InNLengthTable = <function> defined @TellMeWhen/Components/Core/Utils.lua:1060
 InIconSettings = <function> defined @TellMeWhen/TellMeWhen.lua:918
 TryGetNPCName = <function> defined @TellMeWhen/Components/Core/Utils.lua:1614
 DS = <table> {
 }
 ScheduleTimer = <function> defined @!kExtraBossFrames/libs/Ace3/AceTimer-3.0/AceTimer-3.0.lua:94
 ConvertContainerToScrollFrame = <function> defined @TellMeWhen/Options/TellMeWhen_Options.lua:118
 GameTooltip_SetDogTag = <function> defined @TellMeWhen/Components/Core/Common/DogTags/config.lua:403
 toSeconds = <function> defined @TellMeWhen/Components/Core/Utils.lua:476
 QueueValidityCheck = <function> defined @TellMeWhen/TellMeWhen.lua:3376
 db = <table> {
 }
 GetDataOwner = <function> defined @TellMeWhen/TellMeWhen.lua:1321
 SetEnabledState = <function> defined @!kExtraBossFrames/libs/Ace3/AceAddon-3.0/AceAddon-3.0.lua:424
 CopyWithMetatable = <function> defined @TellMeWhen/Components/Core/Utils.lua:924
 ALLOW_LOCKDOWN_CONFIG = true
 InGroups = <function> defined @TellMeWhen/TellMeWhen.lua:994
 tDeleteItem = <function> defined @TellMeWhen/Components/Core/Utils.lua:827
 RegisterLuaImportDetector = <function> defined @TellMeWhen/Components/Core/Utils.lua:1650
 operators = <table> {
 }
 isNumber = <table> {
 }
 tRemoveDuplicates = <function> defined @TellMeWhen/Components/Core/Utils.lua:845
 StringToCachedRGBATable = <function> defined @TellMeWhen/Components/Core/Utils.lua:364
 UnregisterAllEvents = <function> defined @!kExtraBossFrames/libs/Ace3/CallbackHandler-1.0/CallbackHandler-1.0.lua:174
 print = <function> defined @TellMeWhen/TellMeWhen.lua:477
 COMMON = <table> {
 }
 TEXT = <table> {
 }
 binaryInsert = <function> defined @TellMeWhen/Components/Core/Utils.lua:890
 Deserialize = <function> defined @BetterWardrobe/Libs/AceSerializer-3.0/AceSerializer-3.0.lua:246
 Initialized = true
 EquivFullIDLookup = <table> {
 }
 GetName = <function> defined @!kExtraBossFrames/libs/Ace3/AceAddon-3.0/AceAddon-3.0.lua:279
 InitializedDatabase = true
 oneUpString = <function> defined @TellMeWhen/Components/Core/Utils.lua:1291
 name = "TellMeWhen"
 GetSettingsStrings = <function> defined @TellMeWhen/Options/TellMeWhen_Options.lua:3943
 RestoreCase = <function> defined @TellMeWhen/Components/Core/Spells/Spells.lua:493
 Defaults = <table> {
 }
 C = <table> {
 }
 Warn = <function> defined @TellMeWhen/Components/Core/Utils.lua:422
 Print = <function> defined @!kExtraBossFrames/libs/Ace3/AceConsole-3.0/AceConsole-3.0.lua:54
 BackupDate = "09:15:54 AM"
 SNIPPETS = <table> {
 }
 L = <table> {
 }
 OrderedTypes = <table> {
 }
 safecall = <function> defined @TellMeWhen/TellMeWhen.lua:2758
 Debug = <function> defined @TellMeWhen/Components/Core/Utils.lua:433
 ClickSound = <function> defined @TellMeWhen/Components/Core/Utils.lua:1682
 justifyVPoints = <table> {
 }
 UpdateViaCoroutine = <function> defined @TellMeWhen/TellMeWhen.lua:2821
 Views = <table> {
 }
 BARBER_SHOP_OPEN = <function> defined @TellMeWhen/TellMeWhen.lua:2960
 RGBATableToStringWithFallback = <function> defined @TellMeWhen/Components/Core/Utils.lua:650
 SetDefaultModuleLibraries = <function> defined @!kExtraBos