@@ -101,7 +101,7 @@ GraphsState::GraphsState(Game *game) : State(game), _butRegionsOffset(0), _butCo
101101 // initially add the GRAPH_MAX_BUTTONS having the first regions information
102102 if (offset < GRAPH_MAX_BUTTONS )
103103 {
104- _btnRegions.push_back (new ToggleTextButton (80 , 11 , 0 , offset*11 , true ));
104+ _btnRegions.push_back (new ToggleTextButton (80 , 11 , 0 , offset*11 ));
105105 _btnRegions.at (offset)->setColor (Palette::blockOffset (9 )+7 );
106106 _btnRegions.at (offset)->setInvertColor (-42 + (4 *offset));
107107 _btnRegions.at (offset)->setText (tr ((*iter)->getRules ()->getType ()));
@@ -119,9 +119,9 @@ GraphsState::GraphsState(Game *game) : State(game), _butRegionsOffset(0), _butCo
119119 }
120120
121121 if (_regionToggles.size () < GRAPH_MAX_BUTTONS )
122- _btnRegionTotal = new ToggleTextButton (80 , 11 , 0 , _regionToggles.size ()*11 , true );
122+ _btnRegionTotal = new ToggleTextButton (80 , 11 , 0 , _regionToggles.size ()*11 );
123123 else
124- _btnRegionTotal = new ToggleTextButton (80 , 11 , 0 , GRAPH_MAX_BUTTONS *11 , true );
124+ _btnRegionTotal = new ToggleTextButton (80 , 11 , 0 , GRAPH_MAX_BUTTONS *11 );
125125 _regionToggles.push_back (new GraphButInfo (tr (" STR_TOTAL_UC" ), 22 ));
126126 _btnRegionTotal->onMousePress ((ActionHandler)&GraphsState::btnRegionListClick);
127127 _btnRegionTotal->setColor (Palette::blockOffset (9 )+7 );
@@ -141,7 +141,7 @@ GraphsState::GraphsState(Game *game) : State(game), _butRegionsOffset(0), _butCo
141141 // initially add the GRAPH_MAX_BUTTONS having the first countries information
142142 if (offset < GRAPH_MAX_BUTTONS )
143143 {
144- _btnCountries.push_back (new ToggleTextButton (80 , 11 , 0 , offset*11 , true ));
144+ _btnCountries.push_back (new ToggleTextButton (80 , 11 , 0 , offset*11 ));
145145 _btnCountries.at (offset)->setColor (Palette::blockOffset (9 )+7 );
146146 _btnCountries.at (offset)->setInvertColor (-42 + (4 *offset));
147147 _btnCountries.at (offset)->setText (tr ((*iter)->getRules ()->getType ()));
@@ -161,9 +161,9 @@ GraphsState::GraphsState(Game *game) : State(game), _butRegionsOffset(0), _butCo
161161 }
162162
163163 if (_countryToggles.size () < GRAPH_MAX_BUTTONS )
164- _btnCountryTotal = new ToggleTextButton (80 , 11 , 0 , _countryToggles.size ()*11 , true );
164+ _btnCountryTotal = new ToggleTextButton (80 , 11 , 0 , _countryToggles.size ()*11 );
165165 else
166- _btnCountryTotal = new ToggleTextButton (80 , 11 , 0 , GRAPH_MAX_BUTTONS *11 , true );
166+ _btnCountryTotal = new ToggleTextButton (80 , 11 , 0 , GRAPH_MAX_BUTTONS *11 );
167167 _countryToggles.push_back (new GraphButInfo (tr (" STR_TOTAL_UC" ), 22 ));
168168 _btnCountryTotal->onMousePress ((ActionHandler)&GraphsState::btnCountryListClick);
169169 _btnCountryTotal->setColor (Palette::blockOffset (9 )+7 );
@@ -467,7 +467,7 @@ void GraphsState::btnFinanceClick(Action *)
467467 */
468468void GraphsState::btnRegionListClick (Action * action)
469469{
470- size_t number = (action->getSender ()->getY ()-Screen:: getDY ())/11 ;
470+ size_t number = (action->getSender ()->getY ()-_game-> getScreen ()-> getDY ())/11 ;
471471 ToggleTextButton *button = 0 ;
472472
473473 if ((_regionToggles.size () <= GRAPH_MAX_BUTTONS + 1 && number == _regionToggles.size ()-1 )||(_regionToggles.size () > GRAPH_MAX_BUTTONS + 1 && number == GRAPH_MAX_BUTTONS ))
@@ -489,7 +489,7 @@ void GraphsState::btnRegionListClick(Action * action)
489489 */
490490void GraphsState::btnCountryListClick (Action * action)
491491{
492- size_t number = (action->getSender ()->getY ()-Screen:: getDY ())/11 ;
492+ size_t number = (action->getSender ()->getY ()-_game-> getScreen ()-> getDY ())/11 ;
493493 ToggleTextButton *button = 0 ;
494494
495495 if ((_countryToggles.size () <= GRAPH_MAX_BUTTONS + 1 && number == _countryToggles.size ()-1 )||(_countryToggles.size () > GRAPH_MAX_BUTTONS + 1 && number == GRAPH_MAX_BUTTONS ))
@@ -511,7 +511,7 @@ void GraphsState::btnCountryListClick(Action * action)
511511 */
512512void GraphsState::btnFinanceListClick (Action *action)
513513{
514- size_t number = (action->getSender ()->getY ()-Screen:: getDY ())/11 ;
514+ size_t number = (action->getSender ()->getY ()-_game-> getScreen ()-> getDY ())/11 ;
515515 ToggleTextButton *button = _btnFinances.at (number);
516516
517517 _financeLines.at (number)->setVisible (!_financeToggles.at (number));
0 commit comments