mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-01 15:50:27 +02:00
Remove unused attribute saving and loading (#86)
This commit is contained in:
@ -556,103 +556,6 @@ bool CGUIButton::isDrawingBorder() const
|
||||
}
|
||||
|
||||
|
||||
//! Writes attributes of the element.
|
||||
void CGUIButton::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
|
||||
{
|
||||
IGUIButton::serializeAttributes(out,options);
|
||||
|
||||
out->addBool ("PushButton", IsPushButton );
|
||||
if (IsPushButton)
|
||||
out->addBool("Pressed", Pressed);
|
||||
|
||||
for ( u32 i=0; i<(u32)EGBIS_COUNT; ++i )
|
||||
{
|
||||
if ( ButtonImages[i].Texture )
|
||||
{
|
||||
core::stringc name( GUIButtonImageStateNames[i] );
|
||||
out->addTexture(name.c_str(), ButtonImages[i].Texture);
|
||||
name += "Rect";
|
||||
out->addRect(name.c_str(), ButtonImages[i].SourceRect);
|
||||
}
|
||||
}
|
||||
|
||||
out->addBool ("UseAlphaChannel", UseAlphaChannel);
|
||||
out->addBool ("Border", DrawBorder);
|
||||
out->addBool ("ScaleImage", ScaleImage);
|
||||
|
||||
for ( u32 i=0; i<(u32)EGBS_COUNT; ++i )
|
||||
{
|
||||
if ( ButtonSprites[i].Index >= 0 )
|
||||
{
|
||||
core::stringc nameIndex( GUIButtonStateNames[i] );
|
||||
nameIndex += "Index";
|
||||
out->addInt(nameIndex.c_str(), ButtonSprites[i].Index );
|
||||
|
||||
core::stringc nameColor( GUIButtonStateNames[i] );
|
||||
nameColor += "Color";
|
||||
out->addColor(nameColor.c_str(), ButtonSprites[i].Color );
|
||||
|
||||
core::stringc nameLoop( GUIButtonStateNames[i] );
|
||||
nameLoop += "Loop";
|
||||
out->addBool(nameLoop.c_str(), ButtonSprites[i].Loop );
|
||||
|
||||
core::stringc nameScale( GUIButtonStateNames[i] );
|
||||
nameScale += "Scale";
|
||||
out->addBool(nameScale.c_str(), ButtonSprites[i].Scale );
|
||||
}
|
||||
}
|
||||
|
||||
// out->addString ("OverrideFont", OverrideFont);
|
||||
}
|
||||
|
||||
|
||||
//! Reads attributes of the element
|
||||
void CGUIButton::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
|
||||
{
|
||||
IGUIButton::deserializeAttributes(in,options);
|
||||
|
||||
IsPushButton = in->getAttributeAsBool("PushButton", IsPushButton);
|
||||
Pressed = IsPushButton ? in->getAttributeAsBool("Pressed", Pressed) : false;
|
||||
|
||||
for ( u32 i=0; i<(u32)EGBIS_COUNT; ++i )
|
||||
{
|
||||
core::stringc nameRect( GUIButtonImageStateNames[i] );
|
||||
nameRect += "Rect";
|
||||
|
||||
setImage((EGUI_BUTTON_IMAGE_STATE)i,
|
||||
in->getAttributeAsTexture(GUIButtonImageStateNames[i], ButtonImages[i].Texture),
|
||||
in->getAttributeAsRect(nameRect.c_str(), ButtonImages[i].SourceRect) );
|
||||
}
|
||||
|
||||
setDrawBorder(in->getAttributeAsBool("Border", DrawBorder));
|
||||
setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel", UseAlphaChannel));
|
||||
setScaleImage(in->getAttributeAsBool("ScaleImage", ScaleImage));
|
||||
|
||||
for ( u32 i=0; i<(u32)EGBS_COUNT; ++i )
|
||||
{
|
||||
core::stringc nameIndex( GUIButtonStateNames[i] );
|
||||
nameIndex += "Index";
|
||||
ButtonSprites[i].Index = in->getAttributeAsInt(nameIndex.c_str(), ButtonSprites[i].Index );
|
||||
|
||||
core::stringc nameColor( GUIButtonStateNames[i] );
|
||||
nameColor += "Color";
|
||||
ButtonSprites[i].Color = in->getAttributeAsColor(nameColor.c_str(), ButtonSprites[i].Color );
|
||||
|
||||
core::stringc nameLoop( GUIButtonStateNames[i] );
|
||||
nameLoop += "Loop";
|
||||
ButtonSprites[i].Loop = in->getAttributeAsBool(nameLoop.c_str(), ButtonSprites[i].Loop );
|
||||
|
||||
core::stringc nameScale( GUIButtonStateNames[i] );
|
||||
nameScale += "Scale";
|
||||
ButtonSprites[i].Scale = in->getAttributeAsBool(nameScale.c_str(), ButtonSprites[i].Scale );
|
||||
}
|
||||
|
||||
// setOverrideFont(in->getAttributeAsString("OverrideFont"));
|
||||
|
||||
updateAbsolutePosition();
|
||||
}
|
||||
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
|
Reference in New Issue
Block a user