Thread Tools Display Modes
01/14/15, 05:04 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,959
libMediaProvider problem

Hey there,

Is libMediaProvider still working with current version of the game?
I changed an addon (CraftingMaterialLevelDisplay), added the libMediaProver library and some LAM 2.0 settings to choose a font family, font size, font color and font style.
From the information I've found (I think it was Garkin again who had explained the usage of the fontString in a forum thread) I've build a font string and updated the controls in the inventory with the new font information:

Lua Code:
  1. LMP = LibStub:GetLibrary('LibMediaProvider-1.0')
  2.  
  3. local color = CraftingMaterialLevelDisplay.savedVariables.font.color
  4. local fontPath = LMP:Fetch('font', CraftingMaterialLevelDisplay.savedVariables.font.family)
  5. local fontString = string.format('%s|%u|%s', CraftingMaterialLevelDisplay.savedVariables.font.family, CraftingMaterialLevelDisplay.savedVariables.font.size, CraftingMaterialLevelDisplay.savedVariables.font.style)
  6. ...
  7. for _,labelControl in pairs(CraftingMaterialLevelDisplay.currentInventoryRows) do
  8.             labelControl:SetFont(fontString)
  9.             labelControl:SetColor(color.r, color.g, color.b, color.a)
  10. end

The library is correctly included and working as the LAM menu shows the dropdown box entries correctly and stores it correctly into the SavedVariables.

My Problem now is:
The controls inside the inventory (normally shown right to the name of the item) won#t be shown anymore :-(
I can ZGOO them and the color was updated corretly. But they are not there. Even if I :SetHidden(false) they are still not shown.
Seems as if the dimensions were set to 0 or something like this.

Any ideas why the controls are not shown anymore?
The original addon simply uses ZoFontGame as the font (labelcontrol:SetFont("ZoFontGame")) and this works, but I'm not able to change the size of the font and that annoys me

Thx for the help.
  Reply With Quote
01/14/15, 07:55 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
On line 5, use your fontPath variable instead of CraftingMaterialLevelDisplay.savedVariables.font.family. You're passing through the name of the font instead of the file path for the game to use.
  Reply With Quote
01/14/15, 09:54 PM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,959
Damn, I knew it was a silly simple one...
Thx for 2 more eyes

I shouldn't code anymore after 10pm ^^

Last edited by Baertram : 01/14/15 at 09:57 PM.
  Reply With Quote
01/14/15, 10:19 PM   #4
Minceraft
 
Minceraft's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 51
Originally Posted by Baertram View Post
I shouldn't code anymore after 10pm ^^
Totally agree with that statement!!!!
  Reply With Quote
01/14/15, 10:36 PM   #5
katkat42
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 155
Originally Posted by Minceraft View Post
Originally Posted by Baertram View Post
I shouldn't code anymore after 10pm ^^
Totally agree with that statement!!!!
I know what you mean. I no longer release code after 11pm.... (I do most of my coding after the kid goes to bed, so if my cut-off was 10pm I'd never get anything done )
  Reply With Quote
01/15/15, 07:13 AM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,959
I only got the time to code after work and friends, so 10pm is my starting time in many cases :-(
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » libMediaProvider problem

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