Thread Tools Display Modes
05-02-24, 12:38 AM   #1
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 237
Aardvark Cata

Hi all

I am the author of the Aardvark addon.

I am trying to update my addon to work in Cata.

It worked perfectly in Wrath and the code currently works in both Classic and Retail.

I have 3 bug reports;
Lua Code:
  1. 15x Aardvark/Aardvark.lua:3091: bad argument #1 to '?' (Usage: self:SetJustifyV(justifyV))
  2. [string "=[C]"]: in function `?'
  3. [string "@Aardvark/Aardvark.lua"]:3091: in main chunk
  4.  
  5. Locals:
  6. (*temporary) = AardvarkSellOptionsPanelText {
  7. 0 = <userdata>
  8. }
  9. (*temporary) = "RIGHT"
Lua Code:
  1. 161x Aardvark/Aardvark.lua:2397: attempt to index global 'AardvarkMagicButton' (a nil value)
  2. [string "@Aardvark/Aardvark.lua"]:2397: in function <Aardvark/Aardvark.lua:2295>
  3.  
  4. Locals:
  5. self = AardvarkMainFrame {
  6.  0 = <userdata>
  7.  Banner = AardvarkMainFrameBanner {
  8.  }
  9.  OnBackdropLoaded = <function> defined @Blizzard_SharedXML/Backdrop.lua:152
  10.  CloseButton = AardvarkMainFrameCloseButton {
  11.  }
  12.  Center = Texture {
  13.  }
  14.  GetBackdropColor = <function> defined @Blizzard_SharedXML/Backdrop.lua:390
  15.  SetupTextureCoordinates = <function> defined @Blizzard_SharedXML/Backdrop.lua:214
  16.  OnBackdropSizeChanged = <function> defined @Blizzard_SharedXML/Backdrop.lua:182
  17.  HasBackdropInfo = <function> defined @Blizzard_SharedXML/Backdrop.lua:278
  18.  SetBackdropBorderColor = <function> defined @Blizzard_SharedXML/Backdrop.lua:422
  19.  RightEdge = Texture {
  20.  }
  21.  backdropInfo = <table> {
  22.  }
  23.  BottomEdge = Texture {
  24.  }
  25.  GetEdgeSize = <function> defined @Blizzard_SharedXML/Backdrop.lua:188
  26.  BottomLeftCorner = Texture {
  27.  }
  28.  BottomRightCorner = Texture {
  29.  }
  30.  TopEdge = Texture {
  31.  }
  32.  ApplyBackdrop = <function> defined @Blizzard_SharedXML/Backdrop.lua:294
  33.  SetBackdrop = <function> defined @Blizzard_SharedXML/Backdrop.lua:329
  34.  ClearBackdrop = <function> defined @Blizzard_SharedXML/Backdrop.lua:282
  35.  TopRightCorner = Texture {
  36.  }
  37.  GetBackdropBorderColor = <function> defined @Blizzard_SharedXML/Backdrop.lua:409
  38.  GetBackdrop = <function> defined @Blizzard_SharedXML/Backdrop.lua:347
  39.  TopLeftCorner = Texture {
  40.  }
  41.  SetupPieceVisuals = <function> defined @Blizzard_SharedXML/Backdrop.lua:246
  42.  SetBackdropColor = <function> defined @Blizzard_SharedXML/Backdrop.lua:399
  43.  LeftEdge = Texture {
  44.  }
  45.  SetBorderBlendMode = <function> defined @Blizzard_SharedXML/Backdrop.lua:266
  46. }
  47. event = "ADDON_LOADED"
  48. arg1 = "Aardvark"
  49. (*temporary) = nil
  50. (*temporary) = nil
  51. (*temporary) = 1
  52. (*temporary) = <userdata>
  53. (*temporary) = nil
  54. (*temporary) = nil
  55. (*temporary) = nil
  56. (*temporary) = "attempt to index global 'AardvarkMagicButton' (a nil value)"
  57. TextList = <table> {
  58.  avkKeybinds = "Keybinds:
  59.  
  60. Default keybinds have now been removed due to conflicts with some blizzard and other addon keybinds.
  61.  
  62. Keybinds are still enabled for players to set themselves.
  63.  
  64. You can set your own keybinds in Key Bindings UI."
  65.  avkAboutAardvark = "There once was a little blue Aardvark that grew up in Azeroth.
  66.  
  67. He loved to farm, spending all day and half of the night digging up herbs, mining ore, weaving cloth and collecting little treasures.
  68.  
  69. After few years he started to develop RSI in his little paws as he was always clicking to sell items that he didn't want, dragging and dropping items that he couldn't sell and, in a lot of cases, deleting items just to clean out his bags ready to farm again.
  70.  
  71. One day after an extremely long day of farming he thought;|cff00ffff
  72. "What if I could open my bags and have all the stuff I don't want just magically disappear?"|r
  73.  
  74. With this thought he started to teach his little arthritic paws how to code.
  75. His code is very messy, overly long and undoubtedly very inefficient but it does what he wants it to do.
  76.  
  77. Hopefully you can find it useful too."
  78. avkRepairOptions = "The |cffff00ffAardvark Repair|r function operates after the destroy function and prior to the
  79. sell function.
  80.  
  81. Damaged items must
  82. be repaired before
  83. they can  be sold."
  84. avkBulkAddCharacter = "Add displayed items to your Character list.
  85. Items with a value will be added your Character Sell List.
  86. Items with no value will be added to your Character Destroy List."
  87. avkSlashCommands = "Slash Commands:
  88.  
  89. |cff00ffff/avk |r ~  Show/Hide Aardvark frame
  90. |cff00ffff/avkdestroy |r ~  Destroy function
  91. |cff00ffff/avkclear |r ~  Clear all lists
  92. |cff00ffff/avkpos |r ~  Reset Aardvark frame and button positions
  93. |cff00ffff/avkrsd |r ~  Reset all Aardvark settings to default
  94. "
  95. avkMagicButton = "Drag&Drop/Click&Drop: Add Item to Character List
  96. Drag&Drop/Click&Drop + Alt: Add Item to Global List
  97. Drag&Drop/Click&Drop + Ctrl: Add Item to Global Protect List
  98. Drag&Drop/Click&Drop + Shi
Lua Code:
  1. 7x Aardvark/Aardvark.lua:391: attempt to index field '?' (a nil value)
  2. [string "@Aardvark/Aardvark.lua"]:391: in function <Aardvark/Aardvark.lua:326>
  3. [string "@Aardvark/Aardvark.lua"]:2298: in function <Aardvark/Aardvark.lua:2295>
  4.  
  5. Locals:
  6. (for generator) = <function> defined =[C]:-1
  7. (for state) = <table> {
  8.  Destroy = <table> {
  9.  }
  10.  Aardvark = <table> {
  11.  }
  12.  Repair = <table> {
  13.  }
  14.  Sell = <table> {
  15.  }
  16.  Protect = <table> {
  17.  }
  18.  FrameScales = <table> {
  19.  }
  20. }
  21. (for control) = "Destroy"
  22. k = "Destroy"
  23. v = <table> {
  24.  dddm = true
  25.  ded = true
  26.  dlit = true
  27.  dialsm = true
  28.  dtdm = true
  29.  dntdm = true
  30.  dirlm = true
  31.  dialfm = true
  32. }
  33. (for generator) = <function> defined =[C]:-1
  34. (for state) = <table> {
  35.  dddm = true
  36.  ded = true
  37.  dlit = true
  38.  dialsm = true
  39.  dtdm = true
  40.  dntdm = true
  41.  dirlm = true
  42.  dialfm = true
  43. }
  44. (for control) = "dddm"
  45. a = "dddm"
  46. b = true
  47. (*temporary) = nil
  48. (*temporary) = nil
  49. (*temporary) = nil
  50. (*temporary) = "attempt to index field '?' (a nil value)"
  51. ColourList = <table> {
  52.  textBlue = "|cff00ffff"
  53.  rarityPoor = "|cff9d9d9d"
  54.  textBluePrefix = "|cff00ffff [Aardvark]: "
  55.  textGreen = "|cff00ff00"
  56.  rarityCommon = "|cffffffff"
  57.  rarityArtifact = "|cffe6cc80"
  58.  rarityHeirloom = "|cff00ccff"
  59.  rarityLegendary = "|cffff8000"
  60.  textRed = "|cffff0000"
  61.  textBluePrefixSuffix = "|cff00ffff [Aardvark]: |r"
  62.  rarityOther = "|cff00ccff"
  63.  rarityEpic = "|cffa335ee"
  64.  textYellow = "|cfffffff0"
  65.  rarityRare = "|cff0070dd"
  66.  textPink = "|cffff00ff"
  67.  textOrange = "|cffff8c00"
  68.  rarityUncommon = "|cff1eff00"
  69. }
I have been banging my head against a wall for hours now without success.
I can't understand why the code worked in Wrath without issue, (the same code currently works in Classic and Retail), yet can not find any changes that Cata made that could have broken my code.

Here is my current code

I am seeking help understanding what happened and how to fix it.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote
05-02-24, 12:44 AM   #2
AcidWeb
A Theradrim Guardian
 
AcidWeb's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 69
SetJustifyV("CENTER") -> SetJustifyV("MIDDLE")
  Reply With Quote
05-02-24, 06:08 PM   #3
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 237
Hi AcidWeb

MIDDLE is not a valid anchor designation, only TOP, BOTTOM, LEFT, RIGHT and CENTER are valid.
Even knowing this I did try it and still no go.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote
05-02-24, 07:17 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
It is (always has been) for SetJustifyV on a FontString. Until now (Cata atm.), the game just accepted "CENTER" without complaining. SetJustfyH still uses "CENTER".
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-02-24 at 07:19 PM.
  Reply With Quote
05-03-24, 05:47 PM   #5
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 237
Hi Fizzlemizz

So does it mean that "MIDDLE" is acceptable for SetJustifyV() for text only?
I have tried bulk changing CENTER to MIDDLE without success.
I have tried bulk changing SetJustifyV("CENTER") to SetJustifyV("MIDDLE") without success.
I have manually gone through the code line by line and changed CENTER to MIDDLE only where it applies to text without success.

This one is twisting my mind in knots.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote
05-03-24, 06:36 PM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
SetJustifyV is not for anchoring (SetPoint), it purely to set the vertical justification of the text inside a FontString (Think of the FontString as a container you anchor and the text inside as something separate that you control the look of based on the containers dimensions along with SetJustifyV/SetJustifyH).

For Cata (and presumably the other versions at some point) you can't use "CENTER" for SetJustifV, only "MIDDLE". Retail and Vanilla will sitll accept "CENTER" or "MIDDLE" for the time being but you may as well change those.

If you have saved any FontStrings SetJustifyV settings in your SavedVariables as "CENTER" then they will also cause an error and the SV entries will need to be updated to "MIDDLE".

Example:
Lua Code:
  1. local Text = "This is text to test. [%s] "
  2.  
  3. local V = { "TOP", "MIDDLE", "BOTTOM" }
  4. local H = { "LEFT", "CENTER", "RIGHT" }
  5.  
  6. local last
  7. for i = 1, 3 do
  8.     local t1 = UIParent:CreateFontString()
  9.     t1:SetFontObject(GameFontNormal)
  10.     t1:SetSize(55, 100)
  11.     t1:SetPoint("TOP", last and last or UIParent, last and "BOTTOM" or nil)
  12.     t1:SetJustifyV(V[i])
  13.     t1:SetText(format(Text, V[i]))
  14.     local x = UIParent:CreateTexture()
  15.     x:SetAllPoints(t1)
  16.     x:SetColorTexture(random(0, 255) / 255, random(0, 255) / 255, random(0, 255) / 255, 0.3)
  17.  
  18.     local t2 = UIParent:CreateFontString()
  19.     t2:SetFontObject(GameFontNormal)
  20.     t2:SetSize(250, 20)
  21.     t2:SetPoint("LEFT", t1, "RIGHT", 10, 0)
  22.     t2:SetJustifyH(H[i])
  23.     t2:SetText(format(Text, H[i]))
  24.     local x = UIParent:CreateTexture()
  25.     x:SetAllPoints(t2)
  26.     x:SetColorTexture(random(0, 255) / 255, random(0, 255) / 255, random(0, 255) / 255, 0.3)
  27.  
  28.     last = t1
  29. end
  30. -- add a no size FontString that will adjust to fit the text, JustifyV is "CENTER" by default
  31. local t1 = UIParent:CreateFontString()
  32. t1:SetFontObject(GameFontNormal)
  33. --t1:SetSize(55, 100)
  34. t1:SetPoint("TOP", last, "BOTTOM", 0, -10)
  35. --t1:SetJustifyV(V[i])
  36. t1:SetText("NO SIZE\n" .. Text .. Text .."\n" .. Text .."\n" .. Text .. Text .. Text)
  37. local x = UIParent:CreateTexture()
  38. x:SetAllPoints(t1)
  39. x:SetColorTexture(random(0, 255) / 255, random(0, 255) / 255, random(0, 255) / 255, 0.3)
If the FontString is too narrow for a word it should terminate with ...
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-03-24 at 09:45 PM.
  Reply With Quote
05-03-24, 11:27 PM   #7
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 237
Hii Fizzlemizz

Thanks for your detailed explanation; not only did I have :SetJustifyV("CENTER") I also had :SetJustifyH("BOTTOM"), so I was doubly screwed.

I have gone through the code and now it is working properly.

Thanks to you and AcidWeb for all of your help.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Aardvark Cata


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off