source: api.lua

Last change on this file was 108, checked in by drazed, 17 months ago

merge

File size: 1.5 KB
Line 
1--[[
2--
3-- This file is going to be the home of some api functionality/events/locks/etc...
4--
5--]]
6targetless.api = {}
7
8--[[
9--
10-- This lock applies to the scanning through radar objects using
11-- `radar.SetRadarSelectionID()` function.
12-- If you are going to use this function in your plugin and don't want targetless
13-- picking up the radar target changed events you should set this variable to true,
14-- make sure to set it back to false once you're done.
15--
16-- Usage example:
17--   * the most likely case where you'd want to use this is to prevent targetless from doing
18--   * stuff while you're passively scanning through roids/ships via the radar table.
19--
20-- {{{
21--
22--  if targetless then targetless.api.radarlock = true end
23--  -- do stuff like scan through radar targets or whatnot, none of this should break
24--  -- re-targetting or hud labels during your scans
25--  if targetless then targetless.api.radarlock = false end
26--
27-- }}}
28--
29--   * additionally you might want to use this lock yourself to prevent running code while
30--   * targetless or other plugins that use this lock scan through radar.
31--
32-- {{{
33--
34--  -- this checks that targetless exists and that radarlock is not set
35--  if(targetless and not targetless.api.radarlock) then
36--      local objecttype,objectid = radar.GetRadarSelectionID()
37--      -- safely use the object type/id values.  This was a valid targetting event
38--      -- not part of a scan or other lockable (ignorable) event.
39--  end
40--
41-- }}}
42--
43--]]
44targetless.api.radarlock = false
Note: See TracBrowser for help on using the repository browser.