Make multiplayer selection focus colored by the theme

This commit is contained in:
Alayan 2018-10-12 03:12:44 +02:00
parent ad144c6fb7
commit 4af04b0123
6 changed files with 47 additions and 16 deletions

View File

@ -147,7 +147,7 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHaloBW" image="common/glass_square_focused_bw.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo" image="common/glass_square_focused_black.png"
<element type="squareFocusHalo1" image="common/glass_square_focused_black.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo2" image="common/glass_square_focused_cyan.png"
@ -159,6 +159,9 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHalo4" image="common/glass_square_focused_green.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo5" image="common/glass_square_focused_yellow.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
<element type="selectionHalo" image="coal/bubble.png" />

View File

@ -147,7 +147,7 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHaloBW" image="common/glass_square_focused_bw.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo" image="common/glass_square_focused_green.png"
<element type="squareFocusHalo1" image="common/glass_square_focused_green.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo2" image="common/glass_square_focused_yellow.png"
@ -159,6 +159,9 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHalo4" image="common/glass_square_focused_cyan.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo5" image="common/glass_square_focused_black.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
<element type="selectionHalo" image="forest/bubble.png" />

View File

@ -146,7 +146,7 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHaloBW" image="common/glass_square_focused_bw.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo" image="common/glass_square_focused_cyan.png"
<element type="squareFocusHalo1" image="common/glass_square_focused_cyan.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo2" image="common/glass_square_focused_yellow.png"
@ -158,6 +158,9 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHalo4" image="common/glass_square_focused_green.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo5" image="common/glass_square_focused_black.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
<element type="selectionHalo" image="ocean/bubble.png" />

View File

@ -146,7 +146,7 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHaloBW" image="common/glass_square_focused_bw.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo" image="common/glass_square_focused_red.png"
<element type="squareFocusHalo1" image="common/glass_square_focused_red.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo2" image="common/glass_square_focused_cyan.png"
@ -158,6 +158,9 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHalo4" image="common/glass_square_focused_yellow.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo5" image="common/glass_square_focused_black.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
<element type="selectionHalo" image="peach/bubble.png" />

View File

@ -147,7 +147,7 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHaloBW" image="common/glass_square_focused_bw.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo" image="common/glass_square_focused_pink.png"
<element type="squareFocusHalo1" image="common/glass_square_focused_pink.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo2" image="common/glass_square_focused_cyan.png"
@ -159,6 +159,9 @@ when the border that intersect at this corner are enabled.
<element type="squareFocusHalo4" image="common/glass_square_focused_yellow.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<element type="squareFocusHalo5" image="common/glass_square_focused_black.png"
left_border="6" right_border ="6" top_border="6" bottom_border="6"
hborder_out_portion="1.0" />
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
<element type="selectionHalo" image="ruby/bubble.png" />

View File

@ -1192,7 +1192,7 @@ void Skin::drawRibbonChild(const core::recti &rect, Widget* widget,
return;
drawBoxFromStretchableTexture(parentRibbonWidget, rect,
SkinConfig::m_render_params["squareFocusHalo::neutral"]);
SkinConfig::m_render_params["squareFocusHalo1::neutral"]);
nPlayersOnThisItem++;
}
} // end if mark_focused
@ -1209,11 +1209,24 @@ void Skin::drawRibbonChild(const core::recti &rect, Widget* widget,
short green_previous = parentRibbonWidget->m_skin_g;
short blue_previous = parentRibbonWidget->m_skin_b;
SColorf color_rgb = getPlayerColor(i);
if (i>=4)
{
SColorf color_rgb = getPlayerColor(i);
parentRibbonWidget->m_skin_r = short(color_rgb.r * 255.0f);
parentRibbonWidget->m_skin_g = short(color_rgb.g * 255.0f);
parentRibbonWidget->m_skin_b = short(color_rgb.b * 255.0f);
parentRibbonWidget->m_skin_r = short(color_rgb.r * 255.0f);
parentRibbonWidget->m_skin_g = short(color_rgb.g * 255.0f);
parentRibbonWidget->m_skin_b = short(color_rgb.b * 255.0f);
}
std::string square_focus;
// 1 = player n°2
// TODO : current skins support 5 custom colors before using the coloring
// but dynamic detection of the number of colors supported would be better
if (i>=5)
square_focus = "squareFocusHaloBW::neutral";
else
square_focus = "squareFocusHalo" + StringUtils::toString(i+1) + "::neutral";
if (nPlayersOnThisItem > 0)
{
@ -1225,16 +1238,19 @@ void Skin::drawRibbonChild(const core::recti &rect, Widget* widget,
rect2.LowerRightCorner.Y += enlarge;
drawBoxFromStretchableTexture(parentRibbonWidget, rect2,
SkinConfig::m_render_params["squareFocusHaloBW::neutral"]);
SkinConfig::m_render_params[square_focus.c_str()]);
}
else
{
drawBoxFromStretchableTexture(parentRibbonWidget, rect,
SkinConfig::m_render_params["squareFocusHaloBW::neutral"]);
SkinConfig::m_render_params[square_focus.c_str()]);
}
if (i>=5)
{
parentRibbonWidget->m_skin_r = red_previous;
parentRibbonWidget->m_skin_g = green_previous;
parentRibbonWidget->m_skin_b = blue_previous;
}
parentRibbonWidget->m_skin_r = red_previous;
parentRibbonWidget->m_skin_g = green_previous;
parentRibbonWidget->m_skin_b = blue_previous;
nPlayersOnThisItem++;
}
}
@ -1295,7 +1311,7 @@ void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget,
BoxRenderParams* params;
SpinnerWidget* q = dynamic_cast<SpinnerWidget*>(widget);
std::string texture = "squareFocusHalo::neutral";
std::string texture = "squareFocusHalo1::neutral";
SColorf color_rgb = { 1,1,1,1 };
if(q->getUseBackgroundColor())
{