View Single Post
09-19-14, 12:41 PM   #9
Lightbound
An Aku'mai Servant
 
Lightbound's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 35
Damn Phanx you drive ma crazy. Thanks for all the advices and informations! I guess i can start learning lua in around 1 week. Ill definitly tell you after i'd understand that world of warcraft dev if/elseif example cause for now i dont even get whats wrong with it or how i could get the same result in a other way .

Ill come back to that bunch of snippeds in the week ill start learning lua and the wow api so ye, for now i just want to tell you that i tryed your addon check / border modification snipped.

Lua Code:
  1. local addonFuncs = {}
  2.  
  3. addonFuncs["Bagnon"] = function()
  4. hooksecurefunc(Bagnon, "CreateFrame", function(Bagnon, id)
  5.         frame:CreateBorder(13,20,20,20, 2)
  6.     end)
  7. end
  8.  
  9. addonFuncs["XLoot_Frame"] = function()
  10.     XLootFrame:AddBorder(50,20,20,20, 2)
  11. end
  12.  
  13. for addon, func in pairs(addonFuncs) do
  14. -- Check for addons that were already loaded before yours:
  15. if IsAddOnLoaded(addon) then
  16. -- Run the function now:
  17. func()
  18. -- Remove it from the queue:
  19. addonFuncs[addon] = nil
  20. else
  21. -- Check for addons that aren't installed or aren't enabled:
  22. local _, _, _, enabled, loadable = GetAddOnInfo(addon)
  23. if not enabled or not loadable then
  24. -- Remove it from the queue:
  25. addonFuncs[addon] = nil
  26. end
  27. end
  28.  
  29. -- If any addons are still in the queue, listen for addon loading events:
  30. if next(addonFuncs) then
  31. local eventFrame = CreateFrame("Frame")
  32. eventFrame:RegisterEvent("ADDON_LOADED")
  33. eventFrame:SetScript("OnEvent", function(self, event, addon)
  34. local func = addonFuncs[addon]
  35. if func then
  36. func()
  37. addonFuncs[addon] = nil
  38. end
  39. if not next(addonFuncs) then
  40. -- Clean up and send everything to the garbage collector
  41. self:UnregisterEvent(event)
  42. self:SetScript("OnEvent", nil)
  43. addonFuncs = nil
  44. end
  45. end)
  46. end

Since you missed a [/code] at the end of your post i thought there is something missing. the Error code was:

Code:
1x LightboundUI\LightboundUI-v1.0.1.lua:46: "end" expected (to close "for" at line 13) near "<eof>"
I tryed to add some "end" around here and there between the functions of the snipped and /rl. Did result in larger and shorter lua errors Couldnt manage to fix that. Also tryed to use the XLoot code itself:

Lua Code:
  1. if XLootFrame then
  2.     XLootFrame:AddBorder(13,20,20,20, 2)
  3. end

and

Lua Code:
  1. if XLootFrame then
  2.     XLootFrame:CreateBorder(13,20,20,20, 2)
  3. end

Also played with the Arguments. Borders wont appear.
  Reply With Quote