SC2: always show uncollected locations (#1007)
This commit is contained in:
		
							parent
							
								
									1c0a93acad
								
							
						
					
					
						commit
						0215e1fa28
					
				| 
						 | 
				
			
			@ -295,34 +295,37 @@ class SC2Context(CommonContext):
 | 
			
		|||
                            category_panel.add_widget(
 | 
			
		||||
                                Label(text=category, size_hint_y=None, height=50, outline_width=1))
 | 
			
		||||
 | 
			
		||||
                            # Map is completed
 | 
			
		||||
                            for mission in categories[category]:
 | 
			
		||||
                                text = mission
 | 
			
		||||
                                tooltip = ""
 | 
			
		||||
                                text: str = mission
 | 
			
		||||
                                tooltip: str = ""
 | 
			
		||||
 | 
			
		||||
                                # Map has uncollected locations
 | 
			
		||||
                                if mission in unfinished_missions:
 | 
			
		||||
                                    text = f"[color=6495ED]{text}[/color]"
 | 
			
		||||
 | 
			
		||||
                                    tooltip = f"Uncollected locations:\n"
 | 
			
		||||
                                    tooltip += "\n".join([self.ctx.location_names[loc] for loc in
 | 
			
		||||
                                                          self.ctx.locations_for_mission(mission)
 | 
			
		||||
                                                          if loc in self.ctx.missing_locations])
 | 
			
		||||
                                elif mission in available_missions:
 | 
			
		||||
                                    text = f"[color=FFFFFF]{text}[/color]"
 | 
			
		||||
                                # Map requirements not met
 | 
			
		||||
                                else:
 | 
			
		||||
                                    text = f"[color=a9a9a9]{text}[/color]"
 | 
			
		||||
                                    tooltip = f"Requires: "
 | 
			
		||||
                                    if len(self.ctx.mission_req_table[mission].required_world) > 0:
 | 
			
		||||
                                    if self.ctx.mission_req_table[mission].required_world:
 | 
			
		||||
                                        tooltip += ", ".join(list(self.ctx.mission_req_table)[req_mission - 1] for
 | 
			
		||||
                                                             req_mission in
 | 
			
		||||
                                                             self.ctx.mission_req_table[mission].required_world)
 | 
			
		||||
 | 
			
		||||
                                        if self.ctx.mission_req_table[mission].number > 0:
 | 
			
		||||
                                        if self.ctx.mission_req_table[mission].number:
 | 
			
		||||
                                            tooltip += " and "
 | 
			
		||||
                                    if self.ctx.mission_req_table[mission].number > 0:
 | 
			
		||||
                                    if self.ctx.mission_req_table[mission].number:
 | 
			
		||||
                                        tooltip += f"{self.ctx.mission_req_table[mission].number} missions completed"
 | 
			
		||||
                                remaining_location_names: typing.List[str] = [
 | 
			
		||||
                                    self.ctx.location_names[loc] for loc in self.ctx.locations_for_mission(mission)
 | 
			
		||||
                                    if loc in self.ctx.missing_locations]
 | 
			
		||||
                                if remaining_location_names:
 | 
			
		||||
                                    if tooltip:
 | 
			
		||||
                                        tooltip += "\n"
 | 
			
		||||
                                    tooltip += f"Uncollected locations:\n"
 | 
			
		||||
                                    tooltip += "\n".join(remaining_location_names)
 | 
			
		||||
 | 
			
		||||
                                mission_button = MissionButton(text=text, size_hint_y=None, height=50)
 | 
			
		||||
                                mission_button.tooltip_text = tooltip
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue