mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-04-05 17:39:39 -04:00
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 ```