| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -12,9 +12,15 @@ module DFHack
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    ref.unit_tg if ref.kind_of?(GeneralRefUnit)
 | 
					 | 
					 | 
					 | 
					                    ref.unit_tg if ref.kind_of?(GeneralRefUnit)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                when :viewscreen_unitlistst
 | 
					 | 
					 | 
					 | 
					                when :viewscreen_unitlistst
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    v = curview
 | 
					 | 
					 | 
					 | 
					                    v = curview
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    # TODO fix xml to use enums everywhere
 | 
					 | 
					 | 
					 | 
					                    v.units[v.page][v.cursor_pos[v.page]]
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    page = DFHack::ViewscreenUnitlistst_TPage.int(v.page)
 | 
					 | 
					 | 
					 | 
					                when :viewscreen_petst
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    v.units[page][v.cursor_pos[page]]
 | 
					 | 
					 | 
					 | 
					                    v = curview
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    case v.mode
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    when :List
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                        v.animal[v.cursor].unit if !v.is_vermin[v.cursor]
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    when :SelectTrainer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                        v.trainer_unit[v.trainer_cursor]
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    end
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                else
 | 
					 | 
					 | 
					 | 
					                else
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    case ui.main.mode
 | 
					 | 
					 | 
					 | 
					                    case ui.main.mode
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    when :ViewUnits
 | 
					 | 
					 | 
					 | 
					                    when :ViewUnits
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -48,7 +54,7 @@ module DFHack
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }
 | 
					 | 
					 | 
					 | 
					            }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        end
 | 
					 | 
					 | 
					 | 
					        end
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						def unit_iscitizen(u)
 | 
					 | 
					 | 
					 | 
					        def unit_iscitizen(u)
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            u.race == ui.race_id and u.civ_id == ui.civ_id and !u.flags1.dead and !u.flags1.merchant and !u.flags1.forest and
 | 
					 | 
					 | 
					 | 
					            u.race == ui.race_id and u.civ_id == ui.civ_id and !u.flags1.dead and !u.flags1.merchant and !u.flags1.forest and
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            !u.flags1.diplomat and !u.flags2.resident and !u.flags3.ghostly and
 | 
					 | 
					 | 
					 | 
					            !u.flags1.diplomat and !u.flags2.resident and !u.flags3.ghostly and
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            !u.curse.add_tags1.OPPOSED_TO_LIFE and !u.curse.add_tags1.CRAZED and
 | 
					 | 
					 | 
					 | 
					            !u.curse.add_tags1.OPPOSED_TO_LIFE and !u.curse.add_tags1.CRAZED and
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |