TellMeWhen

TellMeWhen

24M Downloads

[CF 1531] Problem with the Custom Condition Configuration Frame

tmw-issue-import opened this issue ยท 2 comments

commented

My snippet

local CNDT = TMW.CNDTlocal ConditionCategory = CNDT:GetCategory("BUFFSDEBUFFS")ConditionCategory:RegisterCondition(1, "BUFFAFTERGCD", {    text = "TEST",    tooltip = "test...",    min = 0,    range = 30,    step = 0.1,    name = function(editbox)       editbox:SetTexts(L["BUFFTOCHECK"], L["BUFFCNDT_DESC"])    end,    useSUG = true,    check = function(check)       check:SetTexts(L["ONLYCHECKMINE"], L["ONLYCHECKMINE_DESC"])    end,    formatter = TMW.C.Formatter.TIME_0ABSENT,    icon = "Interface\\Icons\\inv_misc_map08",    tcoords = CNDT.COMMON.standardtcoords,    funcstr = function(c)       return [[(AuraDur(c.Unit, c.NameFirst, "HELPFUL]] .. (c.Checked and " PLAYER" or "") .. [[") - TMW.GCD) c.Operator c.Level]]    end,    events = function(ConditionObject, c)       return           ConditionObject:GetUnitChangedEventString(CNDT:GetUnit(c.Unit)),           ConditionObject:GenerateNormalEventString("UNIT_AURA", CNDT:GetUnit(c.Unit)),           ConditionObject:GenerateNormalEventString("SPELL_UPDATE_COOLDOWN"),           ConditionObject:GenerateNormalEventString("SPELL_UPDATE_USABLE")       end,    anticipate = [[        local start, duration = GetSpellCooldown(TMW.GCDSpell)        local VALUE = start + duration    ]],})

The condition works well, but the configuration frame looks like this

 

 

and does not show a list of suitable buff/debuff/abilities

 

P.S. Also there is a problem with cursor positioning in Code Snippet <EditBox>


Posted by CurseForge user jim_son | Imported from CurseForge issue #1531 | Raw

commented

There's an error in your code. L is undefined - you're missing "local L = TMW.L".


Posted by CurseForge user Cybeloras

commented

For the cursor position, looks like Blizzard broke TextBox:SetSpacing(x) for any non-zero x - the cursor position doesn't account for the spacing.


Posted by CurseForge user Cybeloras