2014-04-29 02:26:32 +00:00
|
|
|
# See: http://wiki.flightgear.org/MapStructure
|
2014-01-10 03:04:36 +00:00
|
|
|
# Class things:
|
|
|
|
var name = 'WPT';
|
|
|
|
var parents = [Symbol.Controller];
|
|
|
|
var __self__ = caller(0)[0];
|
|
|
|
Symbol.Controller.add(name, __self__);
|
|
|
|
Symbol.registry[ name ].df_controller = __self__;
|
2014-05-25 18:11:13 +00:00
|
|
|
var last_idx = nil;
|
2014-01-10 03:04:36 +00:00
|
|
|
|
2014-05-25 18:11:13 +00:00
|
|
|
var new = func(symbol, model) {
|
|
|
|
var m = {
|
|
|
|
parents:[__self__],
|
|
|
|
listeners: [],
|
|
|
|
symbol: symbol,
|
|
|
|
model: model,
|
|
|
|
};
|
|
|
|
append(m.listeners, setlistener(symbol.layer.options.current_wp_node, func(n) {
|
|
|
|
var n = n.getValue();
|
|
|
|
if (m.last_idx == model.idx or n == model.idx)
|
|
|
|
symbol.update();
|
|
|
|
m.last_idx = n;
|
|
|
|
}, 0, 0));
|
|
|
|
|
|
|
|
return m;
|
|
|
|
}
|
|
|
|
var del = func() {
|
|
|
|
foreach (var l; me.listeners)
|
|
|
|
removelistener(l);
|
|
|
|
}
|