mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Merge branch 'master' into wip/landscape
This commit is contained in:
commit
ab39906c5e
@ -2915,7 +2915,6 @@ CEvent::HideMouse (bool bHide)
|
|||||||
bool
|
bool
|
||||||
CEvent::EventButtons (const SDL_Event & event, Point pos)
|
CEvent::EventButtons (const SDL_Event & event, Point pos)
|
||||||
{
|
{
|
||||||
Point test;
|
|
||||||
Sint32 lg;
|
Sint32 lg;
|
||||||
Sounds sound;
|
Sounds sound;
|
||||||
|
|
||||||
@ -2923,27 +2922,27 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
|
|||||||
m_textToolTips[0] = 0;
|
m_textToolTips[0] = 0;
|
||||||
m_posToolTips.x = -1;
|
m_posToolTips.x = -1;
|
||||||
|
|
||||||
const auto progress = [&](CJauge & prog, const char * text) -> bool {
|
|
||||||
if (prog.GetHide ())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
test = prog.GetPos ();
|
|
||||||
if (
|
|
||||||
pos.x >= test.x && pos.x <= test.x + DIMJAUGEX && pos.y >= test.y &&
|
|
||||||
pos.y <= test.y + DIMJAUGEY)
|
|
||||||
{
|
|
||||||
snprintf (m_textToolTips, sizeof (m_textToolTips), "%s", text);
|
|
||||||
lg = GetTextWidth (m_textToolTips);
|
|
||||||
test.x += (DIMJAUGEX - lg) / 2;
|
|
||||||
test.y += 4;
|
|
||||||
m_posToolTips = test;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (m_phase == EV_PHASE_PLAY)
|
if (m_phase == EV_PHASE_PLAY)
|
||||||
{
|
{
|
||||||
|
const static auto progress = [&](CJauge & prog, const char * text) -> bool {
|
||||||
|
if (prog.GetHide ())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Point test = prog.GetPos ();
|
||||||
|
if (
|
||||||
|
pos.x >= test.x && pos.x <= test.x + DIMJAUGEX && pos.y >= test.y &&
|
||||||
|
pos.y <= test.y + DIMJAUGEY)
|
||||||
|
{
|
||||||
|
snprintf (m_textToolTips, sizeof (m_textToolTips), "%s", text);
|
||||||
|
lg = GetTextWidth (m_textToolTips);
|
||||||
|
test.x += (DIMJAUGEX - lg) / 2;
|
||||||
|
test.y += 4;
|
||||||
|
m_posToolTips = test;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
const auto spotted = progress (m_jauges[0], gettext ("Blupi's energy"));
|
const auto spotted = progress (m_jauges[0], gettext ("Blupi's energy"));
|
||||||
if (!spotted)
|
if (!spotted)
|
||||||
progress (m_jauges[1], gettext ("Work done"));
|
progress (m_jauges[1], gettext ("Work done"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user