Issue Details (XML | Word | Printable)

Key: GATH-100
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Esamynn
Reporter: Aesir
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Gatherer

Gatherer requires SlideBar to be Loaded

Created: 14/Dec/08 11:59 AM   Updated: 03/Feb/09 07:32 PM
Component/s: GUI - Minimap Icon
Affects Version/s: None
Fix Version/s: 3.1.10

Environment: r786


 Description  « Hide
Gatherer errors at load. I believe this is because SlideBar is not enabled.

Date: 2008-12-14 10:53:46
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\Gatherer\GatherMiniIcon.lua line 157:
attempt to index upvalue 'sideIcon' (a nil value)
Debug:
[C]: ?
Gatherer\GatherMiniIcon.lua:157: Update()
Gatherer\GatherEvent.lua:76: OnLoad()
Gatherer\GatherEvent.lua:101: OnEvent()
[string "*:OnEvent"]:1:
[string "*:OnEvent"]:1
AddOns:
Swatter, v5.1.DEV.150
WowheadLooter, v30018
AckisRecipeList, vBeta 12 1234
AucAdvanced, v5.1.DEV.2530
AucFilterBasic, v5.1.DEV.3854
AucFilterOutlier, v5.1.DEV.3855
AucMatchUndercut, v5.1.DEV.2531
AucStatHistogram, v5.1.DEV.3858
AucStatiLevel, v<%version%> (<%codename%>)
AucStatPurchased, v5.1.DEV.3820
AucStatSales, v5.1.DEV.2842
AucStatSimple, v5.1.DEV.3822
AucStatStdDev, v5.1.DEV.3821
AucUtilAHWindowControl, v5.1.DEV.3311
AucUtilAppraiser, v5.1.DEV.2530
AucUtilCompactUI, v5.1.DEV.2530
AucUtilItemSuggest, v5.1.DEV.3108
AucUtilPriceLevel, v5.1.DEV.2545
AucUtilScanButton, v5.1.DEV.2530
AucUtilScanProgress, v5.1.DEV.2530
AucUtilSearchUI, v5.1.DEV.3655
AucUtilVendMarkup, v5.1.DEV.2530
Babylonian, v5.1.DEV.130
BankStack, v1
BasicChatMods, v3.2
BeanCounter, v5.1.DEV.3583
ButtonFacade, v0.1Alpha
ButtonFacadeApathy, v3.0.3.2
ButtonFacadeCaith, v3.0.3.2
ButtonFacadeEntropy, v3.0.3.2
ButtonFacadeGears, v3.0.3.2
ButtonFacadeLiteStep, v3.0.3.2
ButtonFacadeOnyx, v3.0.3.2
ButtonFacadeSerenity, v3.0.2
cargBags, v0.4.2
cargBagsPernobilis, v0.4.2
Configator, v5.1.DEV.160
DebugLib, v5.1.DEV.130
Enchantrix, v5.1.DEV.3744
EveryQuest, v$Revision: 48 $
EWOLandmarks, v
FBMergeDatabase, v0.9.6
FBOutfitDisplayFrame, v0.9.6c
FBTrackingFrame, v0.9.6d
FishingBuddy, v0.9.6f
Gatherer, v<%version%>
Informant, v5.1.DEV.3721
LibExtraTip, v1.0
LilSparkysWorkshop, v0.80
Skillet, v
Stubby, v5.1.DEV.130
TipHelper, v<%version%> (<%codename%>)
(ck=5fd)



 All   Comments   Change History   Transitions   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Anaral added a comment - 14/Dec/08 12:46 PM
While I can confirm the error when Slidebar is disabled, it does not stop Gatherer from working normally. Looks like we just need to take out some debug code?

Aesir added a comment - 14/Dec/08 08:12 PM
Locally, I eliminated the error by replacing GatherMiniIcon.lua line 154:
function miniIcon.Update()
local enabled = Gatherer.Config.GetSetting("minimap.enable")
miniIcon.icon:SetDesaturated(not enabled)
sideIcon.icon:SetDesaturated(not enabled)
end

with:
function miniIcon.Update()
local enabled = Gatherer.Config.GetSetting("minimap.enable")
miniIcon.icon:SetDesaturated(not enabled)
if (SlideBar) then
sideIcon.icon:SetDesaturated(not enabled)
end
end

I don't like it, so I'll run that local until a better more elegant solution comes along.


Esamynn added a comment - 15/Dec/08 06:12 PM
Gatherer should check if the sideIcon was actually created (at load time) before trying to update it. If SlideBar is not present, then the icon is not created, thus the error when we try to update it.

Kouri added a comment - 16/Dec/08 07:21 PM
Alternatively, replace line 157:
sideIcon.icon:SetDesaturated(not enabled)
with:
sideIcon and sideIcon.icon:SetDesaturated(not enabled)

Matthew Del Buono (Shirik) added a comment - 16/Dec/08 07:24 PM
sideIcon and sideIcon.icon:SetDesaturated(not enabled)

Is not a valid line of code. While normally this syntax works like you want it to, an expression is not a valid statement in Lua like it is in C. Thus, if you want to do something like this, it needs to be part of another line.

if sideIcon then
sideIcon.icon:SetDesaturated(not enabled)
end


Psyonix added a comment - 09/Jan/09 01:20 AM
The only other option I can see is to have the slidebar check to see if the icon should be saturated or desaturated every time it slides out, which is clunkier and inexact. None of the other addons that use the slidebar have similar functionality, so I haven't seen an alternate implementation we can copy.

Gonna wait a little bit to see if anyone comes up with anything better, but considering that it is generating an error (Even if it doesn't affect the addon) we might want to just pop in the fix.

On a side note, why does it only error on load, and not any time after that?