mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Remove unused (de)serializeAttributes() methods
This commit is contained in:
parent
9b650b9efb
commit
05573d6d8d
10 changed files with 0 additions and 274 deletions
|
@ -632,85 +632,6 @@ bool GUIButton::isDrawingBorder() const
|
|||
}
|
||||
|
||||
|
||||
//! Writes attributes of the element.
|
||||
void GUIButton::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 GUIButton::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
|
||||
{
|
||||
IGUIButton::deserializeAttributes(in,options);
|
||||
|
||||
IsPushButton = in->getAttributeAsBool("PushButton");
|
||||
Pressed = IsPushButton ? in->getAttributeAsBool("Pressed") : false;
|
||||
|
||||
core::rect<s32> rec = in->getAttributeAsRect("ImageRect");
|
||||
if (rec.isValid())
|
||||
setImage( in->getAttributeAsTexture("Image"), rec);
|
||||
else
|
||||
setImage( in->getAttributeAsTexture("Image") );
|
||||
|
||||
rec = in->getAttributeAsRect("PressedImageRect");
|
||||
if (rec.isValid())
|
||||
setPressedImage( in->getAttributeAsTexture("PressedImage"), rec);
|
||||
else
|
||||
setPressedImage( in->getAttributeAsTexture("PressedImage") );
|
||||
|
||||
setDrawBorder(in->getAttributeAsBool("Border"));
|
||||
setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel"));
|
||||
setScaleImage(in->getAttributeAsBool("ScaleImage"));
|
||||
|
||||
// setOverrideFont(in->getAttributeAsString("OverrideFont"));
|
||||
|
||||
updateAbsolutePosition();
|
||||
}
|
||||
|
||||
// PATCH
|
||||
GUIButton* GUIButton::addButton(IGUIEnvironment *environment,
|
||||
const core::rect<s32>& rectangle, ISimpleTextureSource *tsrc,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue