[CF 1623] "Unit Condition Icon" How to return unit refference for lua type condition?
tmw-issue-import opened this issue ยท 9 comments
I have created "Unit Condition Icon" and set arena1-10 for objects. Inside "Unit Conditions" I have lua condition for each object and looking info how to get each unit there? I tried use thisobj.Unit , thisobj.UnitSet and thisobj.UnitSet.translatedUnits[5] but it doesn't return me current unit which has been parsed. Using 8.5.5 maybe have bug as another guy here.
I mean how to get "unit" alias?
Posted by CurseForge user cordankos | Imported from CurseForge issue #1623 | Raw
You can't do this, but you probably should be able to, so I'm going to add this.
Posted by CurseForge user Cybeloras
https://wow.curseforge.com/projects/tellmewhen/files/2643292
Use "thisunit" in your Lua, as in "UnitHealth(thisunit) > 100000"
Posted by CurseForge user Cybeloras
Message: ...Ons\TellMeWhen\Components\Core\Conditions\Config.lua:703: <unnamed>:SetPoint(): trying to anchor to itself
Time: Sun Dec 2 18:30:36 2018
Count: 1
Stack: ...Ons\TellMeWhen\Components\Core\Conditions\Config.lua:703: <unnamed>:SetPoint(): trying to anchor to itself
[C]: in function `SetPoint'
...Ons\TellMeWhen\Components\Core\Conditions\Config.lua:703: in function `AddRow'
...omponents\Core\Conditions\Categories\Misc_config.lua:29: in function <...omponents\Core\Conditions\Categories\Misc_config.lua:25>
(tail call): ?
[C]: ?
[string "safecall Dispatcher[4]"]:9: in function <[string "safecall Dispatcher[4]"]:5>
(tail call): ?
Interface\AddOns\TellMeWhen\TellMeWhen.lua:795: in function `Fire'
...Ons\TellMeWhen\Components\Core\Conditions\Config.lua:696: in function <...Ons\TellMeWhen\Components\Core\Conditions\Config.lua:689>
(tail call): ?
[C]: ?
[string "safecall Dispatcher[1]"]:9: in function <[string "safecall Dispatcher[1]"]:5>
(tail call): ?
...ace\AddOns\TellMeWhen\Options\TellMeWhen_Options.lua:1130: in function `CScriptCall'
...ace\AddOns\TellMeWhen\Options\TellMeWhen_Options.lua:1474: in function `RequestReload'
...Ons\TellMeWhen\Components\Core\Conditions\Config.lua:86: in function `LoadConfig'
[string "*:OnClick"]:4: in function <[string "*:OnClick"]:1>
Locals: <none>
Received one time this, never saw again when tried use "thisunit" for my own function
Posted by CurseForge user cordankos
Saw this issue again, now it was twice :) Error debug absolutely same
Edited Dec 6, 2018
Posted by CurseForge user cordankos
Can you determine a set of steps that will reproduce this? Including exact configurations of icons that you are trying to configure that will cause this.
Posted by CurseForge user Cybeloras
I found another bug which you can reproduce. Create Icon as "Unit Condition Icon", write units as: raid1-40 > Go to "Unit Condition" > Select TMW default conditions "UnitIsUnit" by clicking "+" and you will see one error.
About bug which I was noticed above - I saw it only twice for few days and can't figure how to reprocude it but if I will see it again I will try save it and notice here.
Posted by CurseForge user cordankos
Also can you make first priority to check "Conditions" tab and then "Unit Condition"? Because in performance things way better first check general icon's conditions and then their unit's conditions.
Posted by CurseForge user cordankos
^1^T^SUnit^Starget ^SType^Sunitcondition ^SUnitConditions^T ^N1^T ^SType^SLUA ^SName^Sreturn~`GetUnitSpeed(unit)~`>~`0~`--~`I~`~`know~`that~`here~`is~`should~`be~`"thisunit",~`but~`it~`querying~`for~`some~`reasons~`while~`"Conditions"~`for~`icon~`itself~`is~`not~`true~`and~`it~`giving~`lua~`error ^t^Sn^N1 ^t^SConditions^T ^N1^T ^SType^SLUA ^SName^Sreturn~`TELLMEWHEN_VERSIONNUMBER~`>=~`89602~`--~`example ^t^Sn^N1 ^t^SEnabled^B ^SSettingsPerView^T ^Sicon^T ^STextLayout^Sicon1 ^STexts^T ^N1^S ^t^t^t^SStates^T ^N1^T ^t^N3^T ^t^N4^T ^t^t^t^N85602^S~`~| ^Sicon^^
Posted by CurseForge user cordankos
That is working as intended. The icon's conditions have no bearing on when nor how the unit conditions will update. These are two separate systems that work in isolation of one another. There are no plans to change this.
Open a new issue if you manage to reproduce that first error (trying to anchor to itself) the other one (add Unit is Unit) will be fixed in the next version. Thanks!
Posted by CurseForge user Cybeloras