mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	citra_qt/game_list: Add an All Regions check
Some titles (mostly homebrews) do not use the region free value 0x7FFF but instead set all of the region flags, resulting in all regions displayed in game list, which is not beautiful and not what we want. This fixes it by adding an all_regions check.
This commit is contained in:
		
							parent
							
								
									1cf75e55c2
								
							
						
					
					
						commit
						82fea86717
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		|  | @ -4,6 +4,7 @@ | ||||||
| 
 | 
 | ||||||
| #pragma once | #pragma once | ||||||
| 
 | 
 | ||||||
|  | #include <algorithm> | ||||||
| #include <map> | #include <map> | ||||||
| #include <unordered_map> | #include <unordered_map> | ||||||
| #include <utility> | #include <utility> | ||||||
|  | @ -95,6 +96,14 @@ static QString GetRegionFromSMDH(const Loader::SMDH& smdh) { | ||||||
|         return QObject::tr("Region free"); |         return QObject::tr("Region free"); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     const bool all_regions = | ||||||
|  |         std::all_of(regions_map.begin(), regions_map.end(), [®ions](const auto& it) { | ||||||
|  |             return std::find(regions.begin(), regions.end(), it.first) != regions.end(); | ||||||
|  |         }); | ||||||
|  |     if (all_regions) { | ||||||
|  |         return QObject::tr("All regions"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     QString result = QObject::tr(regions_map.at(regions.front())); |     QString result = QObject::tr(regions_map.at(regions.front())); | ||||||
|     for (auto region = ++regions.begin(); region != regions.end(); ++region) { |     for (auto region = ++regions.begin(); region != regions.end(); ++region) { | ||||||
|         result += QStringLiteral("\n") + QObject::tr(regions_map.at(*region)); |         result += QStringLiteral("\n") + QObject::tr(regions_map.at(*region)); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue