Fabi Marzan
Well-Known Member
- Joined
- Aug 31, 2020
- Messages
- 141
- Solutions
- 7
- Reaction score
- 74
Greetings as always, I have a problem that does not show the text when the value of the attribute is 0, I added the Tier attribute in the items, but apparently when I set it to 0, it does not show me the Tier text.
Add in sources in item.ccp
But when placing in attribute
Basically does not show the text
![image_2023-07-21_234944871.png image_2023-07-21_234944871.png](https://static3.otland.net/d/attachments/68/68477-4bc0ddc5e4d94fe7ad73750d2fc075b0.jpg)
Just so you know, if it works if I put it in 1 or another number
![1689997916277.png 1689997916277.png](https://static3.otland.net/d/attachments/68/68478-00848dc6f9ad901b9f8031f2082e95c4.jpg)
Any idea what it could be? I would be grateful for the help
EDIT:
In fact, I put it like this:
But then it shows me on all items, when they don't even have the attribute
Add in sources in item.ccp
Lua:
// Show Classification and Tier on item
uint32_t classification = item ? item->getClassification() : it.classification;
uint32_t tier = item ? item->getTier() : it.tier;
if (classification) {
s << "\nClassification: " << classification;
}
if (tier) {
if (tier >= 0) {
s << " Tier " << tier;
}
}
But when placing in attribute
Code:
<attribute key="tier" value="0"/>
Basically does not show the text
![image_2023-07-21_234944871.png image_2023-07-21_234944871.png](https://static3.otland.net/d/attachments/68/68477-4bc0ddc5e4d94fe7ad73750d2fc075b0.jpg)
Just so you know, if it works if I put it in 1 or another number
![1689997916277.png 1689997916277.png](https://static3.otland.net/d/attachments/68/68478-00848dc6f9ad901b9f8031f2082e95c4.jpg)
Any idea what it could be? I would be grateful for the help
EDIT:
In fact, I put it like this:
Lua:
// Show Classification and Tier on item
uint32_t classification = item ? item->getClassification() : it.classification;
uint32_t tier = item ? item->getTier() : it.tier;
if (classification) {
s << "\nClassification: " << classification;
}
if (tier >= 0) {
s << " Tier: " << tier;
}
But then it shows me on all items, when they don't even have the attribute
Last edited: