void CUICellItem::UpdateItemText() { string32 str; if ( ChildsCount() ) { sprintf_s (str,"x%d",ChildsCount()+1); m_text->SetText(str); m_text->Show( true ); }else{ sprintf_s (str,""); m_text->Show( false ); } }
void CUICellItem::UpdateItemText() { if ( ChildsCount() ) { string32 str; xr_sprintf( str, "x%d", ChildsCount()+1 ); m_text->TextItemControl()->SetText( str ); m_text->Show( true ); } else { m_text->TextItemControl()->SetText( "" ); m_text->Show( false ); } }
void CUIInventoryCellItem::Update() { inherited::Update (); UpdateItemText(); u32 color = GetColor(); if ( IsHelper() && !ChildsCount() ) { color = 0xbbbbbbbb; } else if ( IsHelperOrHasHelperChild() ) { color = 0xffffffff; } SetColor(color); }
void CUIInventoryCellItem::UpdateItemText() { const u32 helper_count = (u32)std::count_if(m_childs.begin(), m_childs.end(), detail::is_helper_pred()) + IsHelper() ? 1 : 0; const u32 count = ChildsCount() + 1 - helper_count; string32 str; if ( count > 1 || helper_count ) { sprintf_s ( str, "x%d", count ); m_text->SetText ( str ); m_text->Show ( true ); } else { sprintf_s ( str, ""); m_text->SetText ( str ); m_text->Show ( false ); } }
void CUICellItem::Update() { EnableHeading(m_pParentList->GetVerticalPlacement()); if(Heading()) { SetHeading ( 90.0f * (PI/180.0f) ); SetHeadingPivot (Fvector2().set(0.0f,0.0f), Fvector2().set(0.0f,GetWndSize().y), true); }else ResetHeadingPivot (); inherited::Update(); if ( CursorOverWindow() ) { Frect clientArea; m_pParentList->GetClientArea(clientArea); Fvector2 cp = GetUICursor().GetCursorPosition(); if(clientArea.in(cp)) GetMessageTarget()->SendMessage(this, DRAG_DROP_ITEM_FOCUSED_UPDATE, NULL); } PIItem item = (PIItem)m_pData; if ( item ) { m_has_upgrade = item->has_any_upgrades(); // Fvector2 size = GetWndSize(); // Fvector2 up_size = m_upgrade->GetWndSize(); // pos.x = size.x - up_size.x - 4.0f; Fvector2 pos; pos.set( m_upgrade_pos ); if ( ChildsCount() ) { pos.x += m_text->GetWndSize().x + 2.0f; } m_upgrade->SetWndPos( pos ); } m_upgrade->Show( m_has_upgrade ); }