Thread Tools Display Modes
07-14-14, 10:37 AM   #1
mec666
A Deviate Faerie Dragon
 
mec666's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 13
Warforged Seals

i'm writing an ldb plugin so i can see warforged seals. but what is the name the icon i use for it? is there somewhere i can find this? right now its a blank box.

i'm new to writing addons/plugs so not sure what we have available for finding this information.

Last edited by mec666 : 07-14-14 at 10:48 AM.
  Reply With Quote
07-14-14, 11:02 AM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Think you can use this with the appropriate currency ID:
Code:
local name, amount, texturePath, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo(id)
__________________
Grab your sword and fight the Horde!
  Reply With Quote
07-14-14, 11:44 AM   #3
mec666
A Deviate Faerie Dragon
 
mec666's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 13
this is what I have so far. it worked for timeless coins. so not sure why it wouldn't work for warforged.

Lua Code:
  1. local WarforgedSeal = CreateFrame("Frame", "MEC_Warforged_Seal")
  2. WarforgedSeals.obj = LibStub("LibDataBroker-1.1"):NewDataObject("MEC Warforged Seals",{
  3.     type  = "data source",
  4.     text  = "0",
  5.     label = "Warforged Seal",
  6.     icon  = "Interface\\Icons\\inv_arcane_orb",
  7. } )
  8.  
  9. WarforgedSeal:SetScript("OnEvent", function()
  10.     for i = 1, GetCurrencyListSize(), 1 do
  11.         local _, _, _, _, _, _, icon, _, _, _, _ = GetCurrencyListInfo(i)
  12.         if icon == "Interface\\Icons\\inv_arcane_orb" then
  13.             local _, _, _, _, _, count, _, _, _, _, _ = GetCurrencyListInfo(i)
  14.             Warforgedseal.obj.text = count or "0"
  15.         end
  16.     end
  17. end)
  18.  
  19. WarforgedSeal:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
  20. WarforgedSeal:RegisterEvent("PLAYER_ENTERING_WORLD")
  Reply With Quote
07-14-14, 11:55 AM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You should only need something like this..
Lua Code:
  1. WarforgedSeal:SetScript("OnEvent", function(self)
  2.     local name, count, texture = GetCurrencyInfo(776)
  3.     self.obj.text = count or "0"
  4. end)
You can get the currency id from the wowhead url for it, timeless coins are 777.

Also you have a typo (presumably) with "WarforgedSeals.obj", the S on the end should likely not be there.

Last edited by semlar : 07-14-14 at 12:21 PM.
  Reply With Quote
07-14-14, 12:15 PM   #5
mec666
A Deviate Faerie Dragon
 
mec666's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 13
so just something like this then?

Lua Code:
  1. local WarforgedSeal = CreateFrame("Frame", "MEC_Warforged_Seal")
  2. WarforgedSeals.obj = LibStub("LibDataBroker-1.1"):NewDataObject("MEC Warforged Seals",{
  3.     type  = "data source",
  4.     text  = "0",
  5.     label = "Warforged Seal",
  6.     icon  = "Interface\\Icons\\inv_arcane_orb",
  7. } )
  8.  
  9. WarforgedSeal:SetScript("OnEvent", function()
  10.  
  11.     local name, count, texture = GetCurrencyInfo(776)
  12.  
  13.     Warforgedseal.obj.text = count or "0"
  14.  
  15. end)
  16.  
  17. WarforgedSeal:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
  18. WarforgedSeal:RegisterEvent("PLAYER_ENTERING_WORLD")

I tried this and it still shows 0. unless i'm still doing something wrong
  Reply With Quote
07-14-14, 12:19 PM   #6
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
You should really enable Lua errors, or install an addon that lets you see them. You first have 'WarforgedSeal', then you set 'WarforgedSeals.obj' with an extra 's', as I believe semlar pointed out. Finally you use 'Warforgedseal.obj.text' with a lower case 's'. These all need to be the same. (Lua is case sensitive)
__________________
Grab your sword and fight the Horde!
  Reply With Quote
07-14-14, 12:23 PM   #7
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Yeah, all of those problems would throw errors so it should be fairly obvious when you try to run it. Errors can be enabled under Interface > Help in-game.

My bad for not actually reading the parts that I copied.
  Reply With Quote
07-14-14, 01:07 PM   #8
mec666
A Deviate Faerie Dragon
 
mec666's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 13
wow. that was the main part of the problem. thank you that works now.

still don't understand why my code works for timeless coins but not the rest.

but your code does work for the lesser charms and warforged.

thank you for your help. now I just gotta fix the problems with docking station. unless you know of a better ldb viewer. cuz this one isn't working so well. I gotta move it everytime I login. but that's something I can take up with the developer of it.
  Reply With Quote
07-14-14, 01:41 PM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I switched to Bazooka several years ago and haven't had any problems with it. I've also had several users of my LDB plugins report problems with Docking Station not supporting some LDB properties correctly or at all, so you're not alone.

On a mostly-unrelated note, please don't put prefixes like "MEC" in front of your addon names where they're going to be displayed in alphabetical lists, such as TOC Title fields and LDB object names. If your addon is called "Warforged Seals" then users will expect to find it in the "W" section of these lists, not the "M" section. Likewise, if you are using color codes in your TOC title, that also screws up alphabetizing, and makes the addon list look like a clown's makeup tray, so don't do it. If you really feel the need to stick your name/initials/whatever in the title, put them at the end so users don't have to read every single item in the list when looking for your addon.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
07-14-14, 02:42 PM   #10
mec666
A Deviate Faerie Dragon
 
mec666's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 13
will do. these are the first ones I've done. and I did that just so I could find them. but yeah i'll change that before I release it. I wanna make it stable first. but I think i'm going to change from docking station. I just can't get it to work right at all.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Warforged Seals

Thread Tools
Display Modes

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