Render the global time of day beyond the local one.

This commit is contained in:
fendrin 2013-06-04 22:36:50 +02:00
parent e423d7ddab
commit 643009c62a
2 changed files with 49 additions and 8 deletions

View file

@ -155,6 +155,45 @@
xanchor=right
yanchor=fixed
[/mini_map]
[panel]
id=endturn-panel
image=themes/game/classic/endturn.png
ref=minimap-panel
#ref=top-panel
rect="843,+3,+181,+75"
xanchor=right
yanchor=fixed
[/panel]
[panel]
id=unitinfo-top-panel
image=themes/game/classic/unitinfo_top.png
ref=endturn-panel
rect="843,+3,+181,+170"
xanchor=right
yanchor=fixed
[/panel]
[panel]
id=unitinfo-panel
image=themes/game/classic/unitinfo.png
ref=unitinfo-top-panel
rect="843,+0,+181,+170"
xanchor=right
yanchor=fixed
[/panel]
[panel]
id=unitinfo-panel
image=themes/game/classic/unitinfo_bottom.png
ref=unitinfo-panel
rect="843,+0,+181,+13"
xanchor=right
yanchor=fixed
[/panel]
# [mini_map]
# id=mini-map
@ -171,7 +210,7 @@
title2= _ "End Scenario"
items=endturn
ref=sidebar-panel
rect="=-17,=-30,+80,+20"
rect="=+37,-30,+80,+20"
xanchor=right
yanchor=bottom
[/action]
@ -292,8 +331,8 @@
# the time of day image
[unit_box]
id=image-tod
ref=top-right-panel
rect="=+10,=+159,+154,+94"
ref=unitinfo-top-panel
rect="=+16,=+14,+154,+94"
xanchor=right
yanchor=fixed
[/unit_box]

View file

@ -1137,11 +1137,11 @@ static config unit_box_at(const map_location& mouseover_hex)
<< _("Liminal units: ") << "<span foreground=\"" << liminal_color << "\">"
<< utils::signed_percent(-(abs(bonus))) << "</span>\n";
std::string local_tod_image = local_tod.image;
std::string global_tod_image = global_tod.image;
if (local_tod.bonus_modified > 0) tod_image += "~BRIGHTEN()";
else if (local_tod.bonus_modified < 0) tod_image += "~DARKEN()";
if (preferences::flip_time()) tod_image += "~FL(horiz)";
std::string local_tod_image = "themes/classic/" + local_tod.image;
std::string global_tod_image = "themes/classic/" + global_tod.image;
if (local_tod.bonus_modified > 0) local_tod_image += "~BRIGHTEN()";
else if (local_tod.bonus_modified < 0) local_tod_image += "~DARKEN()";
if (preferences::flip_time()) local_tod_image += "~FL(horiz)";
const gamemap &map = *resources::game_map;
t_translation::t_terrain terrain = map.get_terrain(mouseover_hex);
@ -1172,6 +1172,8 @@ static config unit_box_at(const map_location& mouseover_hex)
if (u)
unit_image = "~BLIT(" + u->absolute_image() + u->image_mods() + ",35,22)";
std::string tod_image = global_tod_image + "~BLIT(" + local_tod_image + ")";
return image_report(tod_image + bg_terrain_image + unit_image, tooltip.str(), "time_of_day");
}
REPORT_GENERATOR(unit_box)