@@ -165,7 +165,7 @@ void TrackerChartButton::updateIcon()
165165 std::string chartState = " treasure_chart_closed.png" ;
166166 if (mainWindow->trackerSettings .randomize_charts ) {
167167 if (const GameItem chart = mainWindow->chartForIsland (islandNum); chart != GameItem::INVALID) {
168- if (chart == GameItem::TriforceChart1 || chart == GameItem::TriforceChart2 || chart == GameItem::TriforceChart3 ) {
168+ if (this -> isForTriforceChart () ) {
169169 chartState = " triforce_chart_open.png" ;
170170 }
171171 else {
@@ -174,15 +174,15 @@ void TrackerChartButton::updateIcon()
174174 }
175175 }
176176 else if (const GameItem chart = roomNumToDefaultChart (islandNum); elementInPool (Item (chart, &mainWindow->trackerWorlds [0 ]), mainWindow->trackerInventory )) {
177- if (chart == GameItem::TriforceChart1 || chart == GameItem::TriforceChart2 || chart == GameItem::TriforceChart3 ) {
177+ if (this -> isForTriforceChart () ) {
178178 chartState = " triforce_chart_open.png" ;
179179 }
180180 else {
181181 chartState = " treasure_chart_open.png" ;
182182 }
183183 }
184184 else {
185- if (chart == GameItem::TriforceChart1 || chart == GameItem::TriforceChart2 || chart == GameItem::TriforceChart3 ) {
185+ if (this -> isForTriforceChart () ) {
186186 chartState = " triforce_chart_closed.png" ;
187187 }
188188 }
@@ -192,6 +192,17 @@ void TrackerChartButton::updateIcon()
192192 + " background-position: center;" );
193193}
194194
195+ bool TrackerChartButton::isForTriforceChart () const
196+ {
197+ const GameItem chart = roomNumToDefaultChart (islandNum);
198+ return chart == GameItem::TriforceChart1 || chart == GameItem::TriforceChart2 || chart == GameItem::TriforceChart3;
199+ }
200+
201+ bool TrackerChartButton::isForTreasureChart () const
202+ {
203+ return !isForTriforceChart ();
204+ }
205+
195206void TrackerChartButton::mouseReleaseEvent (QMouseEvent* e)
196207{
197208 if (e->button () == Qt::LeftButton)
0 commit comments