From 7538f0032c1f7f743c1c84dceb6b24d74e849b3c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 27 Dec 2012 19:46:48 +0300 Subject: Add some outline colors. Set outline colors to normal colors if no in configuration. --- src/gui/theme.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- src/gui/theme.h | 22 ++++++++++++++++++++++ 2 files changed, 71 insertions(+), 2 deletions(-) (limited to 'src/gui') 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 }; -- cgit v1.2.3-70-g09d2