65 std::unique_ptr<XML::Document>
doc;
121 std::variant<ImageRect, Image *, ColoredRectangle>
data;
210 std::string
resolvePath(
const std::string &path)
const;
295 const gcn::Color &
getColor(
int type)
const;
308 const gcn::Rectangle &area,
309 const gcn::Color &color,
311 const std::string &text = std::string(),
Class for performing a linear interpolation between colors.
A central point of control for graphics.
Stores a set of subimages originating from a single image.
Defines a class for loading and storing images.
Class controlling the game's color palette.
Automatically counting Resource reference.
void updateAlpha(float alpha)
Updates the alpha value of the skin.
void draw(Graphics *graphics, const WidgetState &state) const
void addState(SkinState state)
int getMinWidth() const
Returns the minimum width which can be used with this skin.
std::vector< SkinState > mStates
const SkinState * getState(uint8_t flags) const
int getMinHeight() const
Returns the minimum height which can be used with this skin.
const std::string & getPath() const
const std::string & getName() const
std::unique_ptr< XML::Document > doc
const XML::Document & getDocument() const
std::string getFullPath() const
void readSkinStateNode(XML::Node node, Skin &skin) const
static std::string prepareThemePath()
bool readTheme(const ThemeInfo &themeInfo)
float mMinimumOpacity
Tells if the current skins opacity should not get less than the given value.
std::string resolvePath(const std::string &path) const
Returns the patch to the given GUI resource relative to the theme or, if it isn't in the theme,...
int getGuiAlpha() const
Get the current GUI alpha value.
const Skin & getSkin(SkinType skinType) const
static const gcn::Color & getThemeColor(int type)
Gets the color associated with the type in the default palette (0).
std::array< std::unique_ptr< DyePalette >, THEME_PROG_END > mProgressColors
ResourceRef< Image > getImage(const std::string &path) const
std::vector< Palette > mPalettes
const Palette & getPalette(size_t index) const
void updateAlpha()
Updates the alpha values of all of the skins and images.
static ResourceRef< Image > getImageFromTheme(const std::string &path)
void readProgressBarNode(XML::Node node)
static std::optional< int > getColorIdForChar(char c)
Returns the color ID associated with a character, if it exists.
void readSkinNode(XML::Node node)
void readIconNode(XML::Node node)
void readSkinStateImgNode(XML::Node node, SkinState &state) const
void setMinimumOpacity(float minimumOpacity)
Set the minimum opacity allowed to skins.
void drawProgressBar(Graphics *graphics, const gcn::Rectangle &area, const gcn::Color &color, float progress, const std::string &text=std::string(), ProgressPalette progressType=ProgressPalette::THEME_PROG_END) const
static std::vector< ThemeInfo > getAvailableThemes()
const gcn::Color & getColor(int type) const
Returns a color from the default palette (0).
static gcn::Color getProgressColor(int type, float progress)
float getMinimumOpacity() const
Get the minimum opacity allowed to skins.
@ SERVER_VERSION_NOT_SUPPORTED
const Image * getIcon(const std::string &name) const
void event(Event::Channel channel, const Event &event) override
const std::string & getThemePath() const
void readPaletteNode(XML::Node node)
std::map< std::string, Image * > mIcons
void drawSkin(Graphics *graphics, SkinType type, const WidgetState &state) const
std::array< std::optional< TextFormat >, THEME_PROG_END > mProgressTextFormats
std::map< SkinType, Skin > mSkins
A helper class for parsing an XML document, which also cleans it up again (RAII).
std::variant< ImageRect, Image *, ColoredRectangle > data
std::vector< SkinPart > parts
std::optional< gcn::Color > shadowColor
std::optional< gcn::Color > outlineColor