diff --git a/src/decor.h b/src/decor.h index 16ab37d..98d2231 100644 --- a/src/decor.h +++ b/src/decor.h @@ -370,9 +370,9 @@ public: void StatisticDraw (); void GenerateStatictic (); bool StatisticDown (Point pos); - bool StatisticMove (Point pos); + bool StatisticMove (Point pos, bool & disable); bool StatisticUp (Point pos); - Sint32 StatisticDetect (Point pos); + Sint32 StatisticDetect (Point pos, bool & disable); // Chemin.cpp void CheminMemPos (Sint32 exRank); diff --git a/src/decstat.cxx b/src/decstat.cxx index 91558b6..aed44bb 100644 --- a/src/decstat.cxx +++ b/src/decstat.cxx @@ -807,8 +807,9 @@ CDecor::StatisticDown (Point pos) StatisticUpdate (); - hili = StatisticDetect (pos); - if (hili < 0) + bool disable; + hili = StatisticDetect (pos, disable); + if (hili < 0 || disable) return false; if (m_bStatUp && hili == 0) // flèche up ? @@ -984,11 +985,11 @@ select: // Souris déplacée dans les statistiques. bool -CDecor::StatisticMove (Point pos) +CDecor::StatisticMove (Point pos, bool & disable) { Sint32 rank; - rank = StatisticDetect (pos); + rank = StatisticDetect (pos, disable); if (rank != m_statHili) // autre mise en évidence ? m_statHili = rank; @@ -1007,10 +1008,12 @@ CDecor::StatisticUp (Point pos) // Détecte dans quelle statistique est la souris. Sint32 -CDecor::StatisticDetect (Point pos) +CDecor::StatisticDetect (Point pos, bool & disable) { Sint32 rank; + disable = false; + // Dans un bouton stop/setup/write ? if (pos.x >= 10 && pos.x <= 10 + 42 * 3 && pos.y >= 422 && pos.y <= 422 + 40) { @@ -1029,12 +1032,18 @@ CDecor::StatisticDetect (Point pos) if (rank >= STATNB) return -1; - auto pStatistic = StatisticGet (rank); + if (rank == 11 && this->m_bStatDown) + return rank; + + if (rank == 0 && this->m_bStatUp) + return rank; + + auto pStatistic = StatisticGet (m_statFirst + rank - !!m_bStatUp); if ( this->GetSkill () >= 1 && pStatistic->perso >= 0 && (pStatistic->perso != 0 && pStatistic->perso != 8)) { - return -1; + disable = true; } return rank; diff --git a/src/event.cxx b/src/event.cxx index 01064ef..8babb37 100644 --- a/src/event.cxx +++ b/src/event.cxx @@ -1703,6 +1703,7 @@ CEvent::CEvent () m_updateBlinking = 0; this->shiftDirection = 0; + this->statDisabled = false; } // Destructeur. @@ -2875,6 +2876,9 @@ CEvent::MousePosToSprite (Point pos) if (bRight && bDown) sprite = SPRITE_ARROWDR; } + + if (this->statDisabled) + sprite = SPRITE_ARROW; } else if (m_phase == EV_PHASE_INTRO1) sprite = SPRITE_POINTER; @@ -3995,7 +3999,7 @@ CEvent::PlayMove (Point pos) return true; } - m_pDecor->StatisticMove (pos); + m_pDecor->StatisticMove (pos, this->statDisabled); if (m_bMouseDown) // bouton souris pressé ? { diff --git a/src/event.h b/src/event.h index 2554ab3..b6e5c83 100644 --- a/src/event.h +++ b/src/event.h @@ -274,6 +274,7 @@ protected: Sint32 m_updateBlinking; std::string m_updateVersion; Uint32 shiftDirection; + bool statDisabled; }; /////////////////////////////////////////////////////////////////////////////