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

WoWInterface » Developer Discussions » General Authoring Discussion » Warforged Seals


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