#pragma once #include "V8DataModel/GlobalSettings.h" #include "Util/BrickColor.h" #include "V8DataModel/PartInstance.h" #include "V8DataModel/IModelModifier.h" #include "Util/TextureId.h" namespace RBX { class Humanoid; extern const char* const sCharacterAppearance; class RBXBaseClass CharacterAppearance :public DescribedNonCreatable ,public IModelModifier { private: typedef Instance Super; public: virtual void apply(); protected: virtual void onAncestorChanged(const AncestorChanged& event); virtual bool askSetParent(const Instance* instance) const; private: virtual void applyByMyself(Humanoid* humanoid) = 0; }; class LegacyCharacterAppearance : public CharacterAppearance { private: typedef CharacterAppearance Super; public: // Hack: This apply() function is ugly, but necessary because // this class changes properties of other objects (like // Part colors and Decal images). However, to avoid // crosstalk the apply function should only do something // in the backend case. /*override*/ void apply(); }; // Old-style T-shirts extern const char *const sShirtGraphic; class ShirtGraphic : public DescribedCreatable { public: TextureId graphic; static Reflection::BoundProp prop_Graphic; ShirtGraphic(); protected: /*override*/ void applyByMyself(Humanoid* humanoid); private: void dataChanged(const Reflection::PropertyDescriptor&) { CharacterAppearance::apply(); } }; extern const char *const sClothing; class Clothing : public DescribedNonCreatable { friend class CharacterAppearance; public: TextureId outfit1; TextureId outfit2; static Reflection::BoundProp prop_outfit1; static Reflection::BoundProp prop_outfit2; Clothing(); virtual TextureId getTemplate() const { RBXASSERT(false); return NULL; } protected: /*override*/ void applyByMyself(Humanoid* humanoid); void dataChanged(const Reflection::PropertyDescriptor&) { CharacterAppearance::apply(); } }; extern const char *const sPants; class Pants : public DescribedCreatable { public: Pants(); static Reflection::PropDescriptor prop_PantsTemplate; TextureId getTemplate() const { return outfit1; } void setTemplate(TextureId value); }; extern const char *const sShirt; class Shirt : public DescribedCreatable { public: Shirt(); static Reflection::PropDescriptor prop_ShirtTemplate; TextureId getTemplate() const { return outfit2; } void setTemplate(TextureId value); }; extern const char *const sBodyColors; class BodyColors : public DescribedCreatable { BrickColor headColor; BrickColor leftArmColor; BrickColor rightArmColor; BrickColor torsoColor; BrickColor leftLegColor; BrickColor rightLegColor; public: static Reflection::BoundProp prop_HeadColor; static Reflection::BoundProp prop_LeftArmColor; static Reflection::BoundProp prop_RightArmColor; static Reflection::BoundProp prop_TorsoColor; static Reflection::BoundProp prop_LeftLegColor; static Reflection::BoundProp prop_RightLegColor; BodyColors(); private: virtual void applyByMyself(Humanoid* humanoid); void dataChanged(const Reflection::PropertyDescriptor&) { CharacterAppearance::apply(); } }; extern const char *const sSkin; class Skin : public DescribedCreatable { BrickColor skinColor; public: static Reflection::BoundProp prop_skinColor; Skin(); private: virtual void applyByMyself(Humanoid* humanoid); void dataChanged(const Reflection::PropertyDescriptor&) { CharacterAppearance::apply(); } }; } // namespace