]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Remove unused (de)serializeAttributes() methods
authorROllerozxa <temporaryemail4meh+github@gmail.com>
Wed, 29 Dec 2021 22:00:16 +0000 (23:00 +0100)
committerGitHub <noreply@github.com>
Wed, 29 Dec 2021 22:00:16 +0000 (23:00 +0100)
src/gui/guiButton.cpp
src/gui/guiButton.h
src/gui/guiEditBox.cpp
src/gui/guiEditBox.h
src/gui/guiEditBoxWithScrollbar.cpp
src/gui/guiEditBoxWithScrollbar.h
src/gui/guiSkin.cpp
src/gui/guiSkin.h
src/irrlicht_changes/static_text.cpp
src/irrlicht_changes/static_text.h

index d6dbddf54afb0920014af99b0a45bd164d3e2d9c..ba95b81c39e50d3a8971ff2fe51035bc3abf2dea 100644 (file)
@@ -632,85 +632,6 @@ bool GUIButton::isDrawingBorder() const
 }\r
 \r
 \r
-//! Writes attributes of the element.\r
-void GUIButton::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const\r
-{\r
-       IGUIButton::serializeAttributes(out,options);\r
-\r
-       out->addBool    ("PushButton",          IsPushButton );\r
-       if (IsPushButton)\r
-               out->addBool("Pressed",             Pressed);\r
-\r
-       for ( u32 i=0; i<(u32)EGBIS_COUNT; ++i )\r
-       {\r
-               if ( ButtonImages[i].Texture )\r
-               {\r
-                       core::stringc name( GUIButtonImageStateNames[i] );\r
-                       out->addTexture(name.c_str(), ButtonImages[i].Texture);\r
-                       name += "Rect";\r
-                       out->addRect(name.c_str(), ButtonImages[i].SourceRect);\r
-               }\r
-       }\r
-\r
-       out->addBool    ("UseAlphaChannel",     UseAlphaChannel);\r
-       out->addBool    ("Border",                  DrawBorder);\r
-       out->addBool    ("ScaleImage",          ScaleImage);\r
-\r
-       for ( u32 i=0; i<(u32)EGBS_COUNT; ++i )\r
-       {\r
-               if ( ButtonSprites[i].Index >= 0 )\r
-               {\r
-                       core::stringc nameIndex( GUIButtonStateNames[i] );\r
-                       nameIndex += "Index";\r
-                       out->addInt(nameIndex.c_str(), ButtonSprites[i].Index );\r
-\r
-                       core::stringc nameColor( GUIButtonStateNames[i] );\r
-                       nameColor += "Color";\r
-                       out->addColor(nameColor.c_str(), ButtonSprites[i].Color );\r
-\r
-                       core::stringc nameLoop( GUIButtonStateNames[i] );\r
-                       nameLoop += "Loop";\r
-                       out->addBool(nameLoop.c_str(), ButtonSprites[i].Loop );\r
-\r
-                       core::stringc nameScale( GUIButtonStateNames[i] );\r
-                       nameScale += "Scale";\r
-                       out->addBool(nameScale.c_str(), ButtonSprites[i].Scale );\r
-               }\r
-       }\r
-\r
-       //   out->addString  ("OverrideFont",   OverrideFont);\r
-}\r
-\r
-\r
-//! Reads attributes of the element\r
-void GUIButton::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)\r
-{\r
-       IGUIButton::deserializeAttributes(in,options);\r
-\r
-       IsPushButton    = in->getAttributeAsBool("PushButton");\r
-       Pressed         = IsPushButton ? in->getAttributeAsBool("Pressed") : false;\r
-\r
-       core::rect<s32> rec = in->getAttributeAsRect("ImageRect");\r
-       if (rec.isValid())\r
-               setImage( in->getAttributeAsTexture("Image"), rec);\r
-       else\r
-               setImage( in->getAttributeAsTexture("Image") );\r
-\r
-       rec = in->getAttributeAsRect("PressedImageRect");\r
-       if (rec.isValid())\r
-               setPressedImage( in->getAttributeAsTexture("PressedImage"), rec);\r
-       else\r
-               setPressedImage( in->getAttributeAsTexture("PressedImage") );\r
-\r
-       setDrawBorder(in->getAttributeAsBool("Border"));\r
-       setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel"));\r
-       setScaleImage(in->getAttributeAsBool("ScaleImage"));\r
-\r
-       //   setOverrideFont(in->getAttributeAsString("OverrideFont"));\r
-\r
-       updateAbsolutePosition();\r
-}\r
-\r
 // PATCH\r
 GUIButton* GUIButton::addButton(IGUIEnvironment *environment,\r
                const core::rect<s32>& rectangle, ISimpleTextureSource *tsrc,\r
index 834405f51093bd3bb12fd453f9a3a91ef72ec1b0..ee9bb6f2196412fcef5a09f51bee845d3488f2ec 100644 (file)
@@ -221,14 +221,6 @@ class GUIButton : public gui::IGUIButton
                return ClickControlState;\r
        }\r
 \r
-       //! Writes attributes of the element.\r
-       virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const override;\r
-\r
-       //! Reads attributes of the element\r
-       virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) override;\r
-\r
-\r
-\r
        void setColor(video::SColor color);\r
        // PATCH\r
        //! Set element properties from a StyleSpec corresponding to the button state\r
index 8459107cd1b80fbe59ba6c0d77d1f2117e1839d7..4a0f5013dfb030f0d4e16bc97eb9f639f16281e4 100644 (file)
@@ -846,54 +846,3 @@ void GUIEditBox::updateVScrollBar()
                }
        }
 }
-
-void GUIEditBox::deserializeAttributes(
-               io::IAttributes *in, io::SAttributeReadWriteOptions *options = 0)
-{
-       IGUIEditBox::deserializeAttributes(in, options);
-
-       setOverrideColor(in->getAttributeAsColor("OverrideColor"));
-       enableOverrideColor(in->getAttributeAsBool("OverrideColorEnabled"));
-       setMax(in->getAttributeAsInt("MaxChars"));
-       setWordWrap(in->getAttributeAsBool("WordWrap"));
-       setMultiLine(in->getAttributeAsBool("MultiLine"));
-       setAutoScroll(in->getAttributeAsBool("AutoScroll"));
-       core::stringw ch = in->getAttributeAsStringW("PasswordChar");
-
-       if (ch.empty())
-               setPasswordBox(in->getAttributeAsBool("PasswordBox"));
-       else
-               setPasswordBox(in->getAttributeAsBool("PasswordBox"), ch[0]);
-
-       setTextAlignment((EGUI_ALIGNMENT)in->getAttributeAsEnumeration(
-                                        "HTextAlign", GUIAlignmentNames),
-                       (EGUI_ALIGNMENT)in->getAttributeAsEnumeration(
-                                       "VTextAlign", GUIAlignmentNames));
-
-       setWritable(in->getAttributeAsBool("Writable"));
-       // setOverrideFont(in->getAttributeAsFont("OverrideFont"));
-}
-
-//! Writes attributes of the element.
-void GUIEditBox::serializeAttributes(
-               io::IAttributes *out, io::SAttributeReadWriteOptions *options = 0) const
-{
-       // IGUIEditBox::serializeAttributes(out,options);
-
-       out->addBool("OverrideColorEnabled", m_override_color_enabled);
-       out->addColor("OverrideColor", m_override_color);
-       // out->addFont("OverrideFont",m_override_font);
-       out->addInt("MaxChars", m_max);
-       out->addBool("WordWrap", m_word_wrap);
-       out->addBool("MultiLine", m_multiline);
-       out->addBool("AutoScroll", m_autoscroll);
-       out->addBool("PasswordBox", m_passwordbox);
-       core::stringw ch = L" ";
-       ch[0] = m_passwordchar;
-       out->addString("PasswordChar", ch.c_str());
-       out->addEnum("HTextAlign", m_halign, GUIAlignmentNames);
-       out->addEnum("VTextAlign", m_valign, GUIAlignmentNames);
-       out->addBool("Writable", m_writable);
-
-       IGUIEditBox::serializeAttributes(out, options);
-}
index 2a5c911bc397228c4ed0dc383db44ca73f7c6a50..4c7413f549544823e0bd6643b503e8ebd2b4975f 100644 (file)
@@ -130,14 +130,6 @@ class GUIEditBox : public IGUIEditBox
        //! called if an event happened.
        virtual bool OnEvent(const SEvent &event);
 
-       //! Writes attributes of the element.
-       virtual void serializeAttributes(io::IAttributes *out,
-                       io::SAttributeReadWriteOptions *options) const;
-
-       //! Reads attributes of the element
-       virtual void deserializeAttributes(
-                       io::IAttributes *in, io::SAttributeReadWriteOptions *options);
-
        virtual bool acceptsIME() { return isEnabled() && m_writable; };
 
 protected:
index fb4bc2a0b2b14e9c10089c666395b2de18d67d2b..1b7f7832a517c5f9eff79742fe8372b65bd9c631 100644 (file)
@@ -652,26 +652,6 @@ void GUIEditBoxWithScrollBar::setBackgroundColor(const video::SColor &bg_color)
        m_bg_color_used = true;
 }
 
-//! Writes attributes of the element.
-void GUIEditBoxWithScrollBar::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options = 0) const
-{
-       out->addBool("Border", m_border);
-       out->addBool("Background", m_background);
-       // out->addFont("OverrideFont", OverrideFont);
-
-       GUIEditBox::serializeAttributes(out, options);
-}
-
-
-//! Reads attributes of the element
-void GUIEditBoxWithScrollBar::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options = 0)
-{
-       GUIEditBox::deserializeAttributes(in, options);
-
-       setDrawBorder(in->getAttributeAsBool("Border"));
-       setDrawBackground(in->getAttributeAsBool("Background"));
-}
-
 bool GUIEditBoxWithScrollBar::isDrawBackgroundEnabled() const { return false; }
 bool GUIEditBoxWithScrollBar::isDrawBorderEnabled() const { return false; }
 void GUIEditBoxWithScrollBar::setCursorChar(const wchar_t cursorChar) { }
index 3f7450dcb7d7edde8a38f3bea6fbf4414b131316..cea482fc26be4f4306a993a16346b4207da3166b 100644 (file)
@@ -31,12 +31,6 @@ class GUIEditBoxWithScrollBar : public GUIEditBox
        //! Change the background color
        virtual void setBackgroundColor(const video::SColor &bg_color);
 
-       //! Writes attributes of the element.
-       virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
-
-       //! Reads attributes of the element
-       virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
-
        virtual bool isDrawBackgroundEnabled() const;
        virtual bool isDrawBorderEnabled() const;
        virtual void setCursorChar(const wchar_t cursorChar);
index e09209bd90af02ef366de2aeeef2ade8a982d592..ca692f6cbc7d5c7216f0979236f8b15f5b5fa979 100644 (file)
@@ -1024,48 +1024,6 @@ void GUISkin::draw2DRectangle(IGUIElement* element,
 }\r
 \r
 \r
-//! Writes attributes of the object.\r
-//! Implement this to expose the attributes of your scene node animator for\r
-//! scripting languages, editors, debuggers or xml serialization purposes.\r
-void GUISkin::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const\r
-{\r
-       u32 i;\r
-       for (i=0; i<EGDC_COUNT; ++i)\r
-               out->addColor(GUISkinColorNames[i], Colors[i]);\r
-\r
-       for (i=0; i<EGDS_COUNT; ++i)\r
-               out->addInt(GUISkinSizeNames[i], Sizes[i]);\r
-\r
-       for (i=0; i<EGDT_COUNT; ++i)\r
-               out->addString(GUISkinTextNames[i], Texts[i].c_str());\r
-\r
-       for (i=0; i<EGDI_COUNT; ++i)\r
-               out->addInt(GUISkinIconNames[i], Icons[i]);\r
-}\r
-\r
-\r
-//! Reads attributes of the object.\r
-//! Implement this to set the attributes of your scene node animator for\r
-//! scripting languages, editors, debuggers or xml deserialization purposes.\r
-void GUISkin::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options)\r
-{\r
-       // TODO: This is not nice code for downward compatibility, whenever new values are added and users\r
-       // load an old skin the corresponding values will be set to 0.\r
-       u32 i;\r
-       for (i=0; i<EGDC_COUNT; ++i)\r
-               Colors[i] = in->getAttributeAsColor(GUISkinColorNames[i]);\r
-\r
-       for (i=0; i<EGDS_COUNT; ++i)\r
-               Sizes[i] = in->getAttributeAsInt(GUISkinSizeNames[i]);\r
-\r
-       for (i=0; i<EGDT_COUNT; ++i)\r
-               Texts[i] = in->getAttributeAsStringW(GUISkinTextNames[i]);\r
-\r
-       for (i=0; i<EGDI_COUNT; ++i)\r
-               Icons[i] = in->getAttributeAsInt(GUISkinIconNames[i]);\r
-}\r
-\r
-\r
 //! gets the colors\r
 // PATCH\r
 void GUISkin::getColors(video::SColor* colors)\r
index bbb900f9f5d80b6ede702916c8cd30377d24150c..fa9b27bddaec2e8c2e4156e8d2867184cb53fe57 100644 (file)
@@ -290,16 +290,6 @@ namespace gui
                //! get the type of this skin\r
                virtual EGUI_SKIN_TYPE getType() const;\r
 \r
-               //! Writes attributes of the object.\r
-               //! Implement this to expose the attributes of your scene node animator for\r
-               //! scripting languages, editors, debuggers or xml serialization purposes.\r
-               virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const;\r
-\r
-               //! Reads attributes of the object.\r
-               //! Implement this to set the attributes of your scene node animator for\r
-               //! scripting languages, editors, debuggers or xml deserialization purposes.\r
-               virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);\r
-\r
                //! gets the colors\r
                virtual void getColors(video::SColor* colors); // ::PATCH:\r
 \r
index 8908a91f78aea080b2c6106b178e2833d3b59cd6..f548c3f7120be1ee12918f9681ef71bc4d2118e4 100644 (file)
@@ -588,50 +588,6 @@ s32 StaticText::getTextWidth() const
 }
 
 
-//! Writes attributes of the element.
-//! Implement this to expose the attributes of your element for
-//! scripting languages, editors, debuggers or xml serialization purposes.
-void StaticText::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
-{
-       IGUIStaticText::serializeAttributes(out,options);
-
-       out->addBool    ("Border",              Border);
-       out->addBool    ("OverrideColorEnabled",true);
-       out->addBool    ("OverrideBGColorEnabled",ColoredText.hasBackground());
-       out->addBool    ("WordWrap",            WordWrap);
-       out->addBool    ("Background",          Background);
-       out->addBool    ("RightToLeft",         RightToLeft);
-       out->addBool    ("RestrainTextInside",  RestrainTextInside);
-       out->addColor   ("OverrideColor",       ColoredText.getDefaultColor());
-       out->addColor   ("BGColor",             ColoredText.getBackground());
-       out->addEnum    ("HTextAlign",          HAlign, GUIAlignmentNames);
-       out->addEnum    ("VTextAlign",          VAlign, GUIAlignmentNames);
-
-       // out->addFont ("OverrideFont",        OverrideFont);
-}
-
-
-//! Reads attributes of the element
-void StaticText::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
-{
-       IGUIStaticText::deserializeAttributes(in,options);
-
-       Border = in->getAttributeAsBool("Border");
-       setWordWrap(in->getAttributeAsBool("WordWrap"));
-       Background = in->getAttributeAsBool("Background");
-       RightToLeft = in->getAttributeAsBool("RightToLeft");
-       RestrainTextInside = in->getAttributeAsBool("RestrainTextInside");
-       if (in->getAttributeAsBool("OverrideColorEnabled"))
-               ColoredText.setDefaultColor(in->getAttributeAsColor("OverrideColor"));
-       if (in->getAttributeAsBool("OverrideBGColorEnabled"))
-               ColoredText.setBackground(in->getAttributeAsColor("BGColor"));
-
-       setTextAlignment( (EGUI_ALIGNMENT) in->getAttributeAsEnumeration("HTextAlign", GUIAlignmentNames),
-                      (EGUI_ALIGNMENT) in->getAttributeAsEnumeration("VTextAlign", GUIAlignmentNames));
-
-       // OverrideFont = in->getAttributeAsFont("OverrideFont");
-}
-
 } // end namespace gui
 
 #endif // USE_FREETYPE
index 83bbf4c3d709a300b3293f2d8f6db91aebd2fc62..17a3bf75326d59fa33af659aaa9bf2aaa7a77c83 100644 (file)
@@ -184,12 +184,6 @@ namespace gui
                //! Checks if the text should be interpreted as right-to-left text
                virtual bool isRightToLeft() const;
 
-               //! Writes attributes of the element.
-               virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
-
-               //! Reads attributes of the element
-               virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
-
                virtual bool hasType(EGUI_ELEMENT_TYPE t) const {
                        return (t == EGUIET_ENRICHED_STATIC_TEXT) || (t == EGUIET_STATIC_TEXT);
                };