#include <theme.h>
|
enum | ThemePalette {
TEXT
, BLACK
, RED
, GREEN
,
BLUE
, ORANGE
, YELLOW
, PINK
,
PURPLE
, GRAY
, BROWN
, CARET
,
SHADOW
, OUTLINE
, PARTY_TAB
, WHISPER_TAB
,
BACKGROUND
, HIGHLIGHT
, HIGHLIGHT_TEXT
, TAB_FLASH
,
SHOP_WARNING
, ITEM_EQUIPPED
, CHAT
, OLDCHAT
,
AWAYCHAT
, BUBBLE_TEXT
, GM
, GLOBAL
,
PLAYER
, WHISPER
, IS
, PARTY
,
GUILD
, SERVER
, LOGGER
, HYPERLINK
,
UNKNOWN_ITEM
, GENERIC
, HEAD
, USABLE
,
TORSO
, ONEHAND
, LEGS
, FEET
,
TWOHAND
, SHIELD
, RING
, NECKLACE
,
ARMS
, AMMO
, SERVER_VERSION_NOT_SUPPORTED
, THEME_COLORS_END
} |
|
enum | ProgressPalette {
PROG_DEFAULT
, PROG_HP
, PROG_MP
, PROG_NO_MP
,
PROG_EXP
, PROG_INVY_SLOTS
, PROG_WEIGHT
, PROG_JOB
,
THEME_PROG_END
} |
|
|
| Theme (const ThemeInfo &themeInfo) |
|
| ~Theme () override |
|
const std::string & | getThemePath () const |
|
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, relative to 'graphics/gui'.
|
|
const Palette & | getPalette (size_t index) const |
|
const gcn::Color & | getColor (int type) const |
| Returns a color from the default palette (0).
|
|
void | drawSkin (Graphics *graphics, SkinType type, const WidgetState &state) const |
|
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 |
|
const Skin & | getSkin (SkinType skinType) const |
|
const Image * | getIcon (const std::string &name) const |
|
int | getGuiAlpha () const |
| Get the current GUI alpha value.
|
|
float | getMinimumOpacity () const |
| Get the minimum opacity allowed to skins.
|
|
void | setMinimumOpacity (float minimumOpacity) |
| Set the minimum opacity allowed to skins.
|
|
void | event (Event::Channel channel, const Event &event) override |
|
virtual | ~EventListener () |
|
void | listen (Event::Channel channel) |
|
void | ignore (Event::Channel channel) |
|
Definition at line 195 of file theme.h.
◆ ProgressPalette
Enumerator |
---|
PROG_DEFAULT | |
PROG_HP | |
PROG_MP | |
PROG_NO_MP | |
PROG_EXP | |
PROG_INVY_SLOTS | |
PROG_WEIGHT | |
PROG_JOB | |
THEME_PROG_END | |
Definition at line 268 of file theme.h.
◆ ThemePalette
Enumerator |
---|
TEXT | |
BLACK | |
RED | |
GREEN | |
BLUE | |
ORANGE | |
YELLOW | |
PINK | |
PURPLE | |
GRAY | |
BROWN | |
CARET | |
SHADOW | |
OUTLINE | |
PARTY_TAB | |
WHISPER_TAB | |
BACKGROUND | |
HIGHLIGHT | |
HIGHLIGHT_TEXT | |
TAB_FLASH | |
SHOP_WARNING | |
ITEM_EQUIPPED | |
CHAT | |
OLDCHAT | |
AWAYCHAT | |
BUBBLE_TEXT | |
GM | |
GLOBAL | |
PLAYER | |
WHISPER | |
IS | |
PARTY | |
GUILD | |
SERVER | |
LOGGER | |
HYPERLINK | |
UNKNOWN_ITEM | |
GENERIC | |
HEAD | |
USABLE | |
TORSO | |
ONEHAND | |
LEGS | |
FEET | |
TWOHAND | |
SHIELD | |
RING | |
NECKLACE | |
ARMS | |
AMMO | |
SERVER_VERSION_NOT_SUPPORTED | |
THEME_COLORS_END | |
Definition at line 213 of file theme.h.
◆ Theme()
◆ ~Theme()
◆ drawProgressBar()
◆ drawSkin()
◆ event()
◆ getAvailableThemes()
std::vector< ThemeInfo > Theme::getAvailableThemes |
( |
| ) |
|
|
static |
◆ getColor()
const gcn::Color & Theme::getColor |
( |
int |
type | ) |
const |
Returns a color from the default palette (0).
Definition at line 333 of file theme.cpp.
◆ getColorIdForChar()
std::optional< int > Theme::getColorIdForChar |
( |
char |
c | ) |
|
|
static |
Returns the color ID associated with a character, if it exists.
Returns no value if the character is not found.
- Parameters
-
- Returns
- the requested color or none
Definition at line 338 of file theme.cpp.
◆ getGuiAlpha()
int Theme::getGuiAlpha |
( |
| ) |
const |
|
inline |
Get the current GUI alpha value.
Definition at line 321 of file theme.h.
◆ getIcon()
const Image * Theme::getIcon |
( |
const std::string & |
name | ) |
const |
◆ getImage()
◆ getImageFromTheme()
◆ getMinimumOpacity()
float Theme::getMinimumOpacity |
( |
| ) |
const |
|
inline |
Get the minimum opacity allowed to skins.
Definition at line 326 of file theme.h.
◆ getPalette()
const Palette & Theme::getPalette |
( |
size_t |
index | ) |
const |
◆ getProgressColor()
gcn::Color Theme::getProgressColor |
( |
int |
type, |
|
|
float |
progress |
|
) |
| |
|
static |
◆ getSkin()
◆ getThemeColor()
const gcn::Color & Theme::getThemeColor |
( |
int |
type | ) |
|
|
static |
Gets the color associated with the type in the default palette (0).
- Parameters
-
type | the color type requested |
- Returns
- the requested color
Definition at line 313 of file theme.cpp.
◆ getThemePath()
const std::string & Theme::getThemePath |
( |
| ) |
const |
|
inline |
◆ prepareThemePath()
std::string Theme::prepareThemePath |
( |
| ) |
|
|
static |
◆ readIconNode()
◆ readPaletteNode()
void Theme::readPaletteNode |
( |
XML::Node |
node | ) |
|
|
private |
◆ readProgressBarNode()
void Theme::readProgressBarNode |
( |
XML::Node |
node | ) |
|
|
private |
◆ readSkinNode()
◆ readSkinStateImgNode()
◆ readSkinStateNode()
void Theme::readSkinStateNode |
( |
XML::Node |
node, |
|
|
Skin & |
skin |
|
) |
| const |
|
private |
◆ readTheme()
bool Theme::readTheme |
( |
const ThemeInfo & |
themeInfo | ) |
|
|
private |
◆ resolvePath()
std::string Theme::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, relative to 'graphics/gui'.
Definition at line 284 of file theme.cpp.
◆ setMinimumOpacity()
void Theme::setMinimumOpacity |
( |
float |
minimumOpacity | ) |
|
Set the minimum opacity allowed to skins.
Set a negative value to free the minimum allowed.
Definition at line 450 of file theme.cpp.
◆ updateAlpha()
void Theme::updateAlpha |
( |
| ) |
|
|
private |
Updates the alpha values of all of the skins and images.
Definition at line 459 of file theme.cpp.
◆ mAlpha
float Theme::mAlpha = 1.0 |
|
private |
◆ mIcons
std::map<std::string, Image *> Theme::mIcons |
|
private |
◆ mMinimumOpacity
float Theme::mMinimumOpacity = 0.0f |
|
private |
Tells if the current skins opacity should not get less than the given value.
Definition at line 360 of file theme.h.
◆ mPalettes
std::vector<Palette> Theme::mPalettes |
|
private |
◆ mProgressColors
◆ mProgressTextFormats
◆ mSkins
◆ mThemePath
std::string Theme::mThemePath |
|
private |
The documentation for this class was generated from the following files: