Remove unused attribute saving and loading (#86)

This commit is contained in:
ROllerozxa
2021-12-29 23:00:56 +01:00
committed by GitHub
parent dd09fdcb4e
commit 52e03a8485
72 changed files with 21 additions and 6512 deletions

View File

@ -685,86 +685,6 @@ bool CGUIListBox::getSerializationLabels(EGUI_LISTBOX_COLOR colorType, core::str
}
//! Writes attributes of the element.
void CGUIListBox::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
{
IGUIListBox::serializeAttributes(out,options);
// todo: out->addString ("IconBank", IconBank->getName?);
out->addBool ("DrawBack", DrawBack);
out->addBool ("MoveOverSelect", MoveOverSelect);
out->addBool ("AutoScroll", AutoScroll);
out->addInt("ItemCount", Items.size());
for (u32 i=0;i<Items.size(); ++i)
{
core::stringc label("text");
label += i;
out->addString(label.c_str(), Items[i].Text.c_str() );
for ( s32 c=0; c < (s32)EGUI_LBC_COUNT; ++c )
{
core::stringc useColorLabel, colorLabel;
if ( !getSerializationLabels((EGUI_LISTBOX_COLOR)c, useColorLabel, colorLabel) )
return;
label = useColorLabel; label += i;
if ( Items[i].OverrideColors[c].Use )
{
out->addBool(label.c_str(), true );
label = colorLabel; label += i;
out->addColor(label.c_str(), Items[i].OverrideColors[c].Color);
}
else
{
out->addBool(label.c_str(), false );
}
}
}
out->addInt("Selected", Selected);
}
//! Reads attributes of the element
void CGUIListBox::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
clear();
DrawBack = in->getAttributeAsBool("DrawBack", DrawBack);
MoveOverSelect = in->getAttributeAsBool("MoveOverSelect", MoveOverSelect);
AutoScroll = in->getAttributeAsBool("AutoScroll", AutoScroll);
IGUIListBox::deserializeAttributes(in,options);
const s32 count = in->getAttributeAsInt("ItemCount");
for (s32 i=0; i<count; ++i)
{
core::stringc label("text");
ListItem item;
label += i;
item.Text = in->getAttributeAsStringW(label.c_str());
addItem(item.Text.c_str(), item.Icon);
for ( u32 c=0; c < EGUI_LBC_COUNT; ++c )
{
core::stringc useColorLabel, colorLabel;
if ( !getSerializationLabels((EGUI_LISTBOX_COLOR)c, useColorLabel, colorLabel) )
return;
label = useColorLabel; label += i;
Items[i].OverrideColors[c].Use = in->getAttributeAsBool(label.c_str());
if ( Items[i].OverrideColors[c].Use )
{
label = colorLabel; label += i;
Items[i].OverrideColors[c].Color = in->getAttributeAsColor(label.c_str());
}
}
}
Selected = in->getAttributeAsInt("Selected", Selected);
recalculateScrollPos();
}
void CGUIListBox::recalculateItemWidth(s32 icon)
{
if (IconBank && icon > -1 &&