| 1 |
# Copyright 2018 Stuart Buchanan |
| 2 |
# This file is part of FlightGear. |
| 3 |
# |
| 4 |
# FlightGear is free software: you can redistribute it and/or modify |
| 5 |
# it under the terms of the GNU General Public License as published by |
| 6 |
# the Free Software Foundation, either version 2 of the License, or |
| 7 |
# (at your option) any later version. |
| 8 |
# |
| 9 |
# FlightGear is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
# GNU General Public License for more details. |
| 13 |
# |
| 14 |
# You should have received a copy of the GNU General Public License |
| 15 |
# along with FlightGear. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
# |
| 17 |
# AirportInfo Styles |
| 18 |
var AirportInfoStyles = |
| 19 |
{ |
| 20 |
new : func() { |
| 21 |
var obj = { parents : [ AirportInfoStyles ]}; |
| 22 |
obj.Styles = {}; |
| 23 |
obj.loadStyles(); |
| 24 |
return obj; |
| 25 |
}, |
| 26 |
|
| 27 |
getStyle : func(type) { |
| 28 |
return me.Styles[type]; |
| 29 |
}, |
| 30 |
|
| 31 |
setStyle : func(type, name, value) { |
| 32 |
me.Styles[type][name] = value; |
| 33 |
}, |
| 34 |
|
| 35 |
loadStyles : func() { |
| 36 |
me.clearStyles(); |
| 37 |
me.Styles.RWY = {}; |
| 38 |
me.Styles.RWY.text_color = [0,0,0,1]; # Black text ... |
| 39 |
me.Styles.RWY.text_bgcolor = [1,1,1,1]; # ... on a white background |
| 40 |
me.Styles.RWY.text_mode = canvas.Text.TEXT + canvas.Text.FILLEDBOUNDINGBOX; |
| 41 |
me.Styles.RWY.text_padding = 1; |
| 42 |
me.Styles.RWY.text_alignment = 'center-center'; |
| 43 |
me.Styles.RWY.text_size = 14; |
| 44 |
me.Styles.RWY.show_labels= 1; |
| 45 |
|
| 46 |
me.Styles.APT = {}; |
| 47 |
me.Styles.APT.scale_factor = 0.4; # 40% (applied to whole group) |
| 48 |
me.Styles.APT.line_width = 3.0; |
| 49 |
me.Styles.APT.color_default = [0,0.6,0.85]; #rgb |
| 50 |
me.Styles.APT.label_font_color = me.Styles.APT.color_default; |
| 51 |
me.Styles.APT.label_font_size=28; |
| 52 |
|
| 53 |
}, |
| 54 |
|
| 55 |
clearStyles : func() { |
| 56 |
me.Styles = {}; |
| 57 |
}, |
| 58 |
|
| 59 |
}; |