| 173 | } |
| 174 | |
| 175 | void CUIAmmoCellItem::UpdateItemText() |
| 176 | { |
| 177 | { |
| 178 | u16 total{}; |
| 179 | if (auto* curr_obj = object()) |
| 180 | total = curr_obj->m_boxCurr; |
| 181 | |
| 182 | for (auto* child : m_childs) |
| 183 | if (auto* _child_obj = smart_cast<CUIAmmoCellItem*>(child)) |
| 184 | if (auto* child_obj = _child_obj->object()) |
| 185 | total += child_obj->m_boxCurr; |
| 186 | |
| 187 | string32 str; |
| 188 | sprintf_s(str, "%d", total); |
| 189 | |
| 190 | if (Core.Features.test(xrCore::Feature::show_inv_item_condition)) |
| 191 | { |
| 192 | m_text->SetText(str); |
| 193 | m_text->Show(true); |
| 194 | } |
| 195 | else |
| 196 | SetText(str); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | CUIWeaponCellItem::CUIWeaponCellItem(CWeapon* itm) : inherited(itm) |
| 201 | { |