@@ -182,36 +182,45 @@ function scanDisplay:drawScanInfo(scan, isHighlighted)
182182
183183 -- displayed when the active scanner cannot carry out the scan
184184 local altitude = string.upper (ls .INVALID_SCANNER )
185- local target = " "
186185
187186 local params = scanMgr :GetScanParameters (sBody , scan .minResolution , scan .orbital )
188187 if params and params .canScan then
189188 altitude = ui .Format .Distance (params .maxAltitude )
190189 end
191190
192- if scan .orbital then
193- target = string.format (" %.1f%%" , scan .targetCoverage * 100.0 )
194- else
195- target = ui .Format .Distance (scan .targetCoverage * 1000.0 , " %.1f" )
196- end
197-
198- local completion = math.min (1.0 , scan .coverage / scan .targetCoverage )
191+ local target = ui .Format .Area (scan .targetCoverage * 1e6 )
199192
200193 local data = {
201194 title = sBody .name .. " , " .. scan .bodyPath :GetStarSystem ().name ,
202195 target = target ,
203- completion = string.format ( " %2.1f%% " , completion * 100.0 ),
196+ completion = ui . Format . Area ( scan . coverage * 1e6 ),
204197 isActive = self .scanMgr :GetActiveScan () == scan ,
205198 scan = scan ,
206199 icon = scan .orbital and icons .map or icons .scanner ,
207200 { icons .comms , target , ls .SCAN_TARGET_COVERAGE },
208201 { icons .scanner , ui .Format .Distance (scan .minResolution , " %.1f" ), ls .SCAN_MAXIMUM_SPATIAL_RESOLUTION },
209202 { icons .altitude , altitude , ls .SCAN_MAXIMUM_ALTITUDE },
203+ progress = (scan .targetCoverage / scan .coverage ) * 100
210204 }
211205
212206 return ScanCard :draw (data , isHighlighted )
213207end
214208
209+ --- @param scan ScanData
210+ function scanDisplay :drawScanProgress (scan )
211+ local completion = math.min (1.0 , scan .coverage / scan .targetCoverage )
212+ local width = ui .getContentRegion ().x
213+ -- The default progress bar colour style is yellow which is very jarring
214+ -- for this display. So instead lets use a more suitable colour style.
215+ local progressBarColor = colors .uiPrimaryLight
216+ local progressBarText = ls .DATA_COLLECTED_PROGRESS % {
217+ percent_completed = string.format (" %.2f" , completion * 100.0 )
218+ }
219+ ui .withStyleColors ({ PlotHistogram = progressBarColor }, function ()
220+ ui .progressBar (completion , Vector2 (width , 0 ), progressBarText )
221+ end )
222+ end
223+
215224-- Return a sorted copy of the given scan list for display
216225--- @param scanList ScanData[]
217226function scanDisplay :sortScanList (scanList )
@@ -283,6 +292,8 @@ function scanDisplay:drawBody()
283292
284293 if clicked then
285294 self .scanMgr :ClearActiveScan ()
295+ else
296+ self :drawScanProgress (activeScan )
286297 end
287298 else
288299 self :drawEmptyActiveScan ()
0 commit comments