pulsar/ObservatoryExplorer
Repository files (latest commit first)
Filename Latest commit message Latest commit date
F K 11a2dcb819
Adds ring/belt helper functions, improved criteria debuggability (#96)
Adds new functions to the Lua environment available to custom criteria for handling rings and belts:
- the existing `rings(scan.Rings)` function behavior is unchanged
- NEW: `ringsOnly(scan.Rings)` and `beltsOnly(scan.Rings)` functions return ONLY rings or belts, respectively, and shortcuts the `scan.Rings` check
- NEW: `hasRings(scan.Rings)` and `hasBelts(scan.Rings)` functions return true if there are one or more proper rings or belts, respectively, in scan.Rings and shortcuts the check, too

Furthermore, this adds a debugging aid that identifies what custom criteria caused an error/crash. For simple criteria, ie:
`::Hot Landable::`
... the description "Hot Landable" is used. For complex criteria, you can now annotate the `::Criteria::` line with a description used for debugging like so:
`::Criteria=Hot Landable::`. Criteria errors are logged like this:

```
Error encountered in Elite Observatory from plugin Explorer while processing custom criteria 'Criteria14=I just crash' on scan:
```

Duplicates are avoided by prepending the user-provided description with a generated name (ie. `Criteria14`, in the example above).

Finally, the Detail expression for simple criteria can now safely reference values checked as part of the criteria condition. In particular, the Detail expression is now conditionally evaluated if the result is true. So the following will now work (previously it failed for non-star bodies when StarType was nil):

```
::Ringed Star::
scan.StarType and hasRings(scan.Rings)
::Detail::
'Star type: ' .. scan.StarType
```
2022-08-29 09:45:51 -02:30
..
CriteriaLoadException.cs Reorganize all observatory core projects into monorepo (#25) 2021-10-21 19:31:32 -02:30
CustomCriteriaManager.cs Adds ring/belt helper functions, improved criteria debuggability (#96) 2022-08-29 09:45:51 -02:30
DefaultCriteria.cs Guard against empty rings array. 2022-05-29 21:52:44 -02:30
Explorer.cs Handle barycentres without ordinals 2022-06-26 13:27:21 -02:30
ExplorerSettings.cs Explorer: Show data for the current system only (#86) 2022-05-28 10:33:36 -02:30
ExplorerUIResults.cs Reorganize all observatory core projects into monorepo (#25) 2021-10-21 19:31:32 -02:30
ObservatoryExplorer.csproj Updated versioning 2022-04-04 12:29:59 -02:30
ObservatoryExplorer.sln Reorganize all observatory core projects into monorepo (#25) 2021-10-21 19:31:32 -02:30
Worker.cs Explorer: Show data for the current system only (#86) 2022-05-28 10:33:36 -02:30