I realized that I was using the label field incorrectly in my addon anyways. That said, I'm fairly certain (correct me if I'm wrong) that ChocolateBar shows label text for data sources if there is no text. It would be nice if this was toggle-able, i.e., show the text if there is some but otherwise show nothing.
for data sources: (i can show you the code-ish logic better than explaining it.)
if obj.label and obj.value then
if db.showLabel then
():SetText(label..value..(suffix or ""))
else
():SetText(value..(suffix or ""))
end
elseif obj.text then
():SetText(obj.text)
end
IMO that's the rational way of doing labels. However it's also been seen where the value is formatted into the label, but it's less prevalent.
On a side note, i also ran into this problem recently when adding a ldb feed to SickOfClickingDailies to show when the dailies reset.
Wait really? I was under the impression that the label feed in a data source was supposed to just hold the source's name but it seems like every mod handles it differently. For example, I had my mod set up to use label and value but then in Broker2Fubar the name of my data source showed up as "Quests:" (which was the label).
Why would it hold the sources name? it is an irrelevant piece of information to be held inside an object. (obj.name) suits this need perfectly, and in chocolate bar it does set obj.name = name.
If you go by the spec the discrete components are:
[icon] [label] [value/suffix or text]
There are many deviations such as using text instead of label or completely swapping the two. I think the trend is just put what you want where ever and let the display guess what is intended.
Well given my new understanding of how the label/value/suffix thing works in LDB, I'd like to reiterate my request for label support, particularly something like the bit of code OrionShock posted a few posts ago.
That said, I'm fairly certain (correct me if I'm wrong) that ChocolateBar shows label text for data sources if there is no text. It would be nice if this was toggle-able, i.e., show the text if there is some but otherwise show nothing.
Yes but text is a *required* field for any data source. If one data object does it wrong you can easily disable the text for it by dragging it to the toggle text drop point.
Well given my new understanding of how the label/value/suffix thing works in LDB, I'd like to reiterate my request for label support, particularly something like the bit of code OrionShock posted a few posts ago.
Why do you need label support?
Is it not clear form the icon and text what a data source does and which addon it probably is?
maybe a minor thing. But you use of LSM is a bit akward. Periodically when i load into the game the texture isn't set right.
local LSM = LibStub("LibSharedMedia-3.0")
LSM:RegisterCallback("LibSharedMedia_Registered", function(event, mediaType, value)
if mediaType == "statusbar" then
for k,v in pairs(chocolateBars) do
v:UpdateTexture(db)
end
end
end)
Added to the end of the core file works just fine.
But I can add an option to let you select a font provided by LibSharedMedia.
yes please. i think a lot of people already use LSM based fonts for everything else (i know i do), so having the bars look the same as the rest of the UI would be really nice.
Don't forget to also adjust the LSM callback to account for the fonts been added on load :)
I won't, not this time:)
But I don't want to update all the frames with the font I get from LSM on every callback.
I am also not happy with the way I postponed the texture update for the bars until PLAYER_ENTERING_WORLD is fired.
Maybe its best to save the actual texture/font path. That way I don't even need the LSM callback and you can use textures from disabled addons.
But I don't want to update all the frames with the font I get from LSM on every callback.
I am also not happy with the way I postponed the texture update for the bars until PLAYER_ENTERING_WORLD is fired.
Maybe its best to save the actual texture/font path. That way I don't even need the LSM callback and you can use textures from disabled addons.
you do not have to update on every callback all you have to do is check if the font you are looking for is now available and only when it is update your frames
to check if your font is available you can check with
Yes I know about the default media but I don't think that it is better to get a wrong texture instead of none.
It makes more sense for the font. Some users will freak out when suddenly there isn't a font anymore^^
But it is not that hard to right click the panel and select a new font if you have removed the addon the font is from.
I really hate the idea of a timer oO
Also some addons won't load until a specific action like joining a raid. If you select a texture provided by that addon if will not show until then.
for data sources: (i can show you the code-ish logic better than explaining it.)
IMO that's the rational way of doing labels. However it's also been seen where the value is formatted into the label, but it's less prevalent.
On a side note, i also ran into this problem recently when adding a ldb feed to SickOfClickingDailies to show when the dailies reset.
Why would it hold the sources name? it is an irrelevant piece of information to be held inside an object. (obj.name) suits this need perfectly, and in chocolate bar it does set obj.name = name.
[icon] [label] [value/suffix or text]
There are many deviations such as using text instead of label or completely swapping the two. I think the trend is just put what you want where ever and let the display guess what is intended.
Yes but text is a *required* field for any data source. If one data object does it wrong you can easily disable the text for it by dragging it to the toggle text drop point.
Why do you need label support?
Is it not clear form the icon and text what a data source does and which addon it probably is?
Goto
http://www.wowace.com/projects/chocolatebar/localization/
if you want to help with the localization.
I have already done German.
Updated deDE a bit ;)
Btw: I fear I have to hack it so it stays English for me ;) All that chocolate stuff is very weird for me to read in German :o
You could also play with the English game version like I do.
Btw: I like my wired German spelling, I do it deliberately but thanks for the fix^^
Added to the end of the core file works just fine.
But I can add an option to let you select a font provided by LibSharedMedia.
Don't forget to also adjust the LSM callback to account for the fonts been added on load :)
yes please. i think a lot of people already use LSM based fonts for everything else (i know i do), so having the bars look the same as the rest of the UI would be really nice.
I won't, not this time:)
But I don't want to update all the frames with the font I get from LSM on every callback.
I am also not happy with the way I postponed the texture update for the bars until PLAYER_ENTERING_WORLD is fired.
Maybe its best to save the actual texture/font path. That way I don't even need the LSM callback and you can use textures from disabled addons.
What you could do is make a timmer and grab the update ~3sec after load
you do not have to update on every callback all you have to do is check if the font you are looking for is now available and only when it is update your frames
to check if your font is available you can check with
that returns true if its available and false if not :P
It makes more sense for the font. Some users will freak out when suddenly there isn't a font anymore^^
But it is not that hard to right click the panel and select a new font if you have removed the addon the font is from.
I really hate the idea of a timer oO
Also some addons won't load until a specific action like joining a raid. If you select a texture provided by that addon if will not show until then.
edit:
Ah ok, but when do I know that there are no more callbacks coming?