1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

WIP: continue fixing of right layout (hebrew)

This commit is contained in:
Mathieu Schroeter 2019-01-29 23:06:05 +01:00
parent 01f0b19658
commit 4467559165
3 changed files with 13 additions and 10 deletions

View File

@ -147,9 +147,6 @@ CButton::Draw ()
Point pos = this->m_pos; Point pos = this->m_pos;
Rect rect; Rect rect;
if (IsRightReading ())
pos.x = LXIMAGE () - pos.x - m_dim.x;
if (m_bHide) // bouton caché ? if (m_bHide) // bouton caché ?
{ {
rect.left = pos.x; rect.left = pos.x;
@ -340,9 +337,6 @@ CButton::Detect (Point pos)
if (m_bHide || !m_bEnable) if (m_bHide || !m_bEnable)
return false; return false;
if (IsRightReading ())
pos.x = LXIMAGE () - pos.x;
if (m_nbMenu > 1 && m_bMouseDown) // sous-menu déroulé ? if (m_nbMenu > 1 && m_bMouseDown) // sous-menu déroulé ?
width += 2 + (m_dim.x - 1) * m_nbMenu; width += 2 + (m_dim.x - 1) * m_nbMenu;

View File

@ -2028,10 +2028,13 @@ CEvent::CreateButtons (Sint32 phase)
pos.y = table[m_index].buttons[i].y; pos.y = table[m_index].buttons[i].y;
message = table[m_index].buttons[i].message; message = table[m_index].buttons[i].message;
if (IsRightReading ())
pos.x = LXIMAGE () - pos.x - DIMBUTTONX;
if ( if (
phase != EV_PHASE_PLAY && phase != EV_PHASE_BUILD && phase != EV_PHASE_PLAY && phase != EV_PHASE_BUILD &&
phase != EV_PHASE_INIT) phase != EV_PHASE_INIT)
pos.x += LXOFFSET (); pos.x = IsRightReading () ? pos.x - LXOFFSET () : pos.x + LXOFFSET ();
if (m_bPrivate) if (m_bPrivate)
{ {
@ -2984,13 +2987,14 @@ bool
CEvent::EventButtons (const SDL_Event & event, Point pos) CEvent::EventButtons (const SDL_Event & event, Point pos)
{ {
Sint32 lg; Sint32 lg;
Point _pos = pos;
// Cherche le tool tips à utiliser pour la souris. // Cherche le tool tips à utiliser pour la souris.
m_textToolTips[0] = 0; m_textToolTips[0] = 0;
m_posToolTips.x = -1; m_posToolTips.x = -1;
if (IsRightReading ()) if (IsRightReading ())
pos.x = LXIMAGE () - pos.x; _pos.x = LXIMAGE () - _pos.x;
if (m_phase == EV_PHASE_PLAY) if (m_phase == EV_PHASE_PLAY)
{ {
@ -3030,10 +3034,12 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
{ {
snprintf (m_textToolTips, sizeof (m_textToolTips), "%s", text); snprintf (m_textToolTips, sizeof (m_textToolTips), "%s", text);
lg = GetTextWidth (m_textToolTips); lg = GetTextWidth (m_textToolTips);
pos.x += 10; pos.x += IsRightReading () ? -lg : 10;
pos.y += 20; pos.y += 20;
if (pos.x > LXIMAGE () - lg) if (pos.x > LXIMAGE () - lg)
pos.x = LXIMAGE () - lg; pos.x = LXIMAGE () - lg;
if (pos.x < 0)
pos.x = 0;
if (pos.y > LYIMAGE () - 14) if (pos.y > LYIMAGE () - 14)
pos.y = LYIMAGE () - 14; pos.y = LYIMAGE () - 14;
m_posToolTips = pos; m_posToolTips = pos;

View File

@ -138,5 +138,8 @@ CJauge::SetHide (bool bHide)
Point Point
CJauge::GetPos () CJauge::GetPos ()
{ {
return m_pos; Point pos = m_pos;
if (IsRightReading ())
pos.x = LXIMAGE () - pos.x - m_dim.x;
return pos;
} }