summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-27 19:46:48 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-27 23:15:06 +0300
commit7538f0032c1f7f743c1c84dceb6b24d74e849b3c (patch)
treeb04dc030ed11798c987416b30eaea72a3aa899a2 /src/gui
parentcdc721a1c6c5cf80736101352161b66ea3f90c50 (diff)
downloadmanaverse-7538f0032c1f7f743c1c84dceb6b24d74e849b3c.tar.gz
manaverse-7538f0032c1f7f743c1c84dceb6b24d74e849b3c.tar.bz2
manaverse-7538f0032c1f7f743c1c84dceb6b24d74e849b3c.tar.xz
manaverse-7538f0032c1f7f743c1c84dceb6b24d74e849b3c.zip
Add some outline colors. Set outline colors to normal colors if no in configuration.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/theme.cpp51
-rw-r--r--src/gui/theme.h22
2 files changed, 71 insertions, 2 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 8be991bd6..32a71d3c1 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -207,6 +207,20 @@ Theme::Theme():
mCharColors['S'] = SERVER;
mCharColors['L'] = LOGGER;
mCharColors['<'] = HYPERLINK;
+
+ // here need use outlined colors
+ mCharColors['H' | 0x80] = HIGHLIGHT_OUTLINE;
+ mCharColors['C' | 0x80] = CHAT_OUTLINE;
+ mCharColors['G' | 0x80] = GM_OUTLINE;
+ mCharColors['Y' | 0x80] = PLAYER_OUTLINE;
+ mCharColors['W' | 0x80] = WHISPER_TAB_OUTLINE;
+ mCharColors['w' | 0x80] = WHISPER_TAB_OFFLINE_OUTLINE;
+ mCharColors['I' | 0x80] = IS_OUTLINE;
+ mCharColors['P' | 0x80] = PARTY_CHAT_TAB_OUTLINE;
+ mCharColors['U' | 0x80] = GUILD_CHAT_TAB_OUTLINE;
+ mCharColors['S' | 0x80] = SERVER_OUTLINE;
+ mCharColors['L' | 0x80] = LOGGER_OUTLINE;
+ mCharColors['<' | 0x80] = HYPERLINK_OUTLINE;
}
Theme::~Theme()
@@ -711,6 +725,7 @@ static int readColorType(const std::string &type)
static const std::string colors[] =
{
"BROWSERBOX",
+ "BROWSERBOX_OUTLINE",
"TEXT",
"CARET",
"SHADOW",
@@ -735,8 +750,10 @@ static int readColorType(const std::string &type)
"TEXTFIELD",
"WINDOW",
"PARTY_CHAT_TAB",
+ "PARTY_CHAT_TAB_OUTLINE",
"PARTY_SOCIAL_TAB",
"GUILD_CHAT_TAB",
+ "GUILD_CHAT_TAB_OUTLINE",
"GUILD_SOCIAL_TAB",
"PARTY_CHAT_TAB_HIGHLIGHTED",
"PARTY_SOCIAL_TAB_HIGHLIGHTED",
@@ -751,24 +768,34 @@ static int readColorType(const std::string &type)
"SCROLLBAR_GRAY",
"DROPDOWN_SHADOW",
"HIGHLIGHT",
+ "HIGHLIGHT_OUTLINE",
"TAB_FLASH",
"TAB_PLAYER_FLASH",
"SHOP_WARNING",
"ITEM_EQUIPPED",
"ITEM_NOT_EQUIPPED",
"CHAT",
+ "CHAT_OUTLINE",
"GM",
+ "GM_OUTLINE",
"PLAYER",
+ "PLAYER_OUTLINE",
"WHISPER_TAB",
+ "WHISPER_TAB_OUTLINE",
"WHISPER_TAB_OFFLINE",
+ "WHISPER_TAB_OFFLINE_OUTLINE",
"WHISPER_TAB_HIGHLIGHTED",
"WHISPER_TAB_OFFLINE_HIGHLIGHTED",
"WHISPER_TAB_SELECTED",
"WHISPER_TAB_OFFLINE_SELECTED",
"IS",
+ "IS_OUTLINE",
"SERVER",
+ "SERVER_OUTLINE",
"LOGGER",
+ "LOGGER_OUTLINE",
"HYPERLINK",
+ "HYPERLINK_OUTLINE",
"UNKNOWN_ITEM",
"GENERIC",
"HEAD",
@@ -790,14 +817,23 @@ static int readColorType(const std::string &type)
"BUBBLE_NAME",
"BUBBLE_TEXT",
"RED",
+ "RED_OUTLINE",
"GREEN",
+ "GREEN_OUTLINE",
"BLUE",
+ "BLUE_OUTLINE",
"ORANGE",
+ "ORANGE_OUTLINE",
"YELLOW",
+ "YELLOW_OUTLINE",
"PINK",
+ "PINK_OUTLINE",
"PURPLE",
+ "PURPLE_OUTLINE",
"GRAY",
- "BROWN"
+ "GRAY_OUTLINE",
+ "BROWN",
+ "BROWN_OUTLINE"
};
if (type.empty())
@@ -951,7 +987,8 @@ void Theme::loadColors(std::string file)
{
if (xmlNameEqual(node, "color"))
{
- type = readColorType(XML::getProperty(node, "id", ""));
+ std::string id = XML::getProperty(node, "id", "");
+ type = readColorType(id);
if (type < 0) // invalid or no type given
continue;
@@ -963,6 +1000,16 @@ void Theme::loadColors(std::string file)
grad = readColorGradient(XML::getProperty(node, "effect", ""));
mColors[paletteId * THEME_COLORS_END + type].set(
type, color, grad, 10);
+
+
+ if (!findLast(id, "_OUTLINE"))
+ {
+ const int type2 = readColorType(id + "_OUTLINE");
+ if (type2 < 0)
+ continue;
+ const int idx = paletteId * THEME_COLORS_END;
+ mColors[idx + type2] = mColors[idx + type];
+ }
}
}
}
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 741f3be44..df293a0b6 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -189,6 +189,7 @@ class Theme final : public Palette, public ConfigListener
enum ThemePalette
{
BROWSERBOX = 0,
+ BROWSERBOX_OUTLINE,
TEXT,
CARET,
SHADOW,
@@ -213,8 +214,10 @@ class Theme final : public Palette, public ConfigListener
TEXTFIELD,
WINDOW,
PARTY_CHAT_TAB,
+ PARTY_CHAT_TAB_OUTLINE,
PARTY_SOCIAL_TAB,
GUILD_CHAT_TAB,
+ GUILD_CHAT_TAB_OUTLINE,
GUILD_SOCIAL_TAB,
PARTY_CHAT_TAB_HIGHLIGHTED,
PARTY_SOCIAL_TAB_HIGHLIGHTED,
@@ -229,24 +232,34 @@ class Theme final : public Palette, public ConfigListener
SCROLLBAR_GRAY,
DROPDOWN_SHADOW,
HIGHLIGHT,
+ HIGHLIGHT_OUTLINE,
TAB_FLASH,
TAB_PLAYER_FLASH,
SHOP_WARNING,
ITEM_EQUIPPED,
ITEM_NOT_EQUIPPED,
CHAT,
+ CHAT_OUTLINE,
GM,
+ GM_OUTLINE,
PLAYER,
+ PLAYER_OUTLINE,
WHISPER_TAB,
+ WHISPER_TAB_OUTLINE,
WHISPER_TAB_OFFLINE,
+ WHISPER_TAB_OFFLINE_OUTLINE,
WHISPER_TAB_HIGHLIGHTED,
WHISPER_TAB_OFFLINE_HIGHLIGHTED,
WHISPER_TAB_SELECTED,
WHISPER_TAB_OFFLINE_SELECTED,
IS,
+ IS_OUTLINE,
SERVER,
+ SERVER_OUTLINE,
LOGGER,
+ LOGGER_OUTLINE,
HYPERLINK,
+ HYPERLINK_OUTLINE,
UNKNOWN_ITEM,
GENERIC,
HEAD,
@@ -268,14 +281,23 @@ class Theme final : public Palette, public ConfigListener
BUBBLE_NAME,
BUBBLE_TEXT,
RED,
+ RED_OUTLINE,
GREEN,
+ GREEN_OUTLINE,
BLUE,
+ BLUE_OUTLINE,
ORANGE,
+ ORANGE_OUTLINE,
YELLOW,
+ YELLOW_OUTLINE,
PINK,
+ PINK_OUTLINE,
PURPLE,
+ PURPLE_OUTLINE,
GRAY,
+ GRAY_OUTLINE,
BROWN,
+ BROWN_OUTLINE,
THEME_COLORS_END
};