Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Talk:FlightGear Missions and Adventures

From FlightGear wiki
Jump to: navigation, search

MapStructure layer for tutorial targets (05/2014)

Tutorials#Targets

# See: http://wiki.flightgear.org/MapStructure
# Class things:
var name = 'TUTORIAL_TGT';
var parents = [SymbolLayer.Controller];
var __self__ = caller(0)[0];
SymbolLayer.Controller.add(name, __self__);
SymbolLayer.add(name, {
	parents: [MultiSymbolLayer],
	type: name, # Symbol type
	df_controller: __self__, # controller to use by default -- this one
        df_style:{},
});
var new = func(layer) {
	var m = {
		parents: [__self__],
		layer: layer,
		map: layer.map,
		listeners: [],
query_type:'"tutorial targets"',
	};
# TODO: for non-navaid/FGPositioned layers this needs to be customized to compare objects on the layer
# layer.searcher._equals = func(a,b) 0;

	return m;
}; # ctor
var del = func() {
	foreach (var l; me.listeners)
		removelistener(l);
}; # del
var searchCmd = func {
	printlog(_MP_dbg_lvl, "Running query:", me.query_type);
	var range = me.map.controller.query_range();
	if (range == nil) return;
	return tutorial.get_targets(range);
};