aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llcontroldef.cpp
blob: aed0a82aa00b3bc690df7fa1274ba73d813d3387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
/** 
 * @file llcontroldef.cpp
 * @author James Cook
 * @brief Viewer control settings
 *
 * $LicenseInfo:firstyear=2001&license=viewergpl$
 * 
 * Copyright (c) 2001-2008, Linden Research, Inc.
 * 
 * Second Life Viewer Source Code
 * The source code in this file ("Source Code") is provided by Linden Lab
 * to you under the terms of the GNU General Public License, version 2.0
 * ("GPL"), unless you have obtained a separate licensing agreement
 * ("Other License"), formally executed by you and Linden Lab.  Terms of
 * the GPL can be found in doc/GPL-license.txt in this distribution, or
 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
 * 
 * There are special exceptions to the terms and conditions of the GPL as
 * it is applied to this Source Code. View the full text of the exception
 * in the file doc/FLOSS-exception.txt in this software distribution, or
 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
 * 
 * By copying, modifying or distributing this software, you acknowledge
 * that you have read and understood your obligations described above,
 * and agree to abide by those obligations.
 * 
 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
 * COMPLETENESS OR PERFORMANCE.
 * $/LicenseInfo$
 */

// Put default viewer settings in here

#include "llviewerprecompiledheaders.h"

#include "llviewercontrol.h"

#include "indra_constants.h"

#include "v3math.h"
#include "v3dmath.h"
#include "llrect.h"
#include "v4color.h"
#include "v4coloru.h"
#include "v3color.h"
#include "llfirstuse.h"

// For Listeners
#include "audioengine.h"
#include "llagent.h"
#include "llconsole.h"
#include "lldrawpoolterrain.h"
#include "llflexibleobject.h"
#include "llfeaturemanager.h"
#include "llglslshader.h"
#include "llpanelgeneral.h"
#include "llpanelinput.h"
#include "llsky.h"
#include "llvieweraudio.h"
#include "llviewerimagelist.h"
#include "llviewerthrottle.h"
#include "llviewerwindow.h"
#include "llvoavatar.h"
#include "llvosurfacepatch.h"
#include "llvosky.h"
#include "llvowlsky.h"
#include "llvotree.h"
#include "llvovolume.h"
#include "llworld.h"
#include "pipeline.h"
#include "llviewerjoystick.h"
#include "llviewerparcelmgr.h"
#include "llparcel.h"
#include "llnotify.h"
#include "llkeyboard.h"
#include "llglimmediate.h"

extern BOOL gResizeScreenTexture;

void declare_settings()
{
	// Somewhat under 1024 by 768, to give space for Windows task bar / Mac menu bar
	// to emphasize window isn't actually maximized.
	const S32 WINDOW_WIDTH = 1000;
	const S32 WINDOW_HEIGHT = 700;

	//------------------------------------------------------------------------
	// Color constants
	//------------------------------------------------------------------------

	const S32 TOOL_PANEL_HEIGHT = 162 + 32;
	const S32 TOOL_PANEL_WIDTH = 75 + 8;

	// Colors that can be changed in the UI
	gSavedSettings.declareColor4("EffectColor", LLColor4(1.f, 1.f, 1.f, 1.f), "Particle effects color");
	gSavedSettings.declareColor4("SystemChatColor",	LLColor4(0.8f, 1.f, 1.f, 1.f), "Color of chat messages from SL System");
	gSavedSettings.declareColor4("AgentChatColor",	LLColor4(1.0f, 1.0f, 1.0f, 1.0f), "Color of chat messages from other residents");
	gSavedSettings.declareColor4("ObjectChatColor",	LLColor4(0.7f, 0.9f, 0.7f, 1.0f), "Color of chat messages from objects");
	gSavedSettings.declareColor4("llOwnerSayChatColor",	LLColor4(0.99f, 0.99f, 0.69f, 1.0f), "Color of chat messages from objects only visible to the owner");
	gSavedSettings.declareColor4("BackgroundChatColor",	LLColor4(0.f, 0.f, 0.f, 1.0f), "Color of chat bubble background");
	gSavedSettings.declareColor4("ScriptErrorColor",	LLColor4(0.82f, 0.82f, 0.99f, 1.0f), "Color of script error messages");
	gSavedSettings.declareColor4("HTMLLinkColor",	LLColor4(0.6f, 0.6f, 1.0f, 1.0f), "Color of hyperlinks");
	
	// color palette in color picker
	gSavedSettings.declareColor4("ColorPaletteEntry01", LLColor4 ( 0.0f, 0.0f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry02", LLColor4 ( 0.5f, 0.5f, 0.5f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry03", LLColor4 ( 0.5f, 0.0f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry04", LLColor4 ( 0.5f, 0.5f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry05", LLColor4 ( 0.0f, 0.5f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry06", LLColor4 ( 0.0f, 0.5f, 0.5f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry07", LLColor4 ( 0.0f, 0.0f, 0.5f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry08", LLColor4 ( 0.5f, 0.0f, 0.5f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry09", LLColor4 ( 0.5f, 0.5f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry10", LLColor4 ( 0.0f, 0.25f, 0.25f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry11", LLColor4 ( 0.0f, 0.5f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry12", LLColor4 ( 0.0f, 0.25f, 0.5f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry13", LLColor4 ( 0.5f, 0.0f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry14", LLColor4 ( 0.5f, 0.25f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry15", LLColor4 ( 1.0f, 1.0f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry16", LLColor4 ( 1.0f, 1.0f, 1.0f, 1.0f ), "Color picker palette entry");

	gSavedSettings.declareColor4("ColorPaletteEntry17", LLColor4 ( 1.0f, 1.0f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry18", LLColor4 ( 0.75f, 0.75f, 0.75f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry19", LLColor4 ( 1.0f, 0.0f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry20", LLColor4 ( 1.0f, 1.0f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry21", LLColor4 ( 0.0f, 1.0f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry22", LLColor4 ( 0.0f, 1.0f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry23", LLColor4 ( 0.0f, 0.0f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry24", LLColor4 ( 1.0f, 0.0f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry25", LLColor4 ( 1.0f, 1.0f, 0.5f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry26", LLColor4 ( 0.0f, 1.0f, 0.5f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry27", LLColor4 ( 0.5f, 1.0f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry28", LLColor4 ( 0.5f, 0.5f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry29", LLColor4 ( 1.0f, 0.0f, 0.5f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry30", LLColor4 ( 1.0f, 0.5f, 0.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry31", LLColor4 ( 1.0f, 1.0f, 1.0f, 1.0f ), "Color picker palette entry");
	gSavedSettings.declareColor4("ColorPaletteEntry32", LLColor4 ( 1.0f, 1.0f, 1.0f, 1.0f ), "Color picker palette entry");

	//------------------------------------------------------------------------
	// Main menu
	//------------------------------------------------------------------------
	gSavedSettings.declareS32("MenuBarHeight", 18, "", NO_PERSIST );
	gSavedSettings.declareS32("MenuBarWidth", 410, "", NO_PERSIST );

	gSavedSettings.declareF32("MenuAccessKeyTime", 0.25f, "Time (seconds) in which the menu key must be tapped to move focus to the menu bar");
	gSavedSettings.declareBOOL("UseAltKeyForMenus", FALSE, "Access menus via keyboard by tapping Alt");
	// Which background overlay to use
	gSavedSettings.declareS32("MapOverlayIndex", 0, "Currently selected world map type");


	//------------------------------------------------------------------------
	// Pie Menus
	//------------------------------------------------------------------------
	gSavedSettings.declareF32("PieMenuLineWidth", 2.5f, "Width of lines in pie menu display (pixels)");

	//------------------------------------------------------------------------
	// Drop Shadows
	//------------------------------------------------------------------------
	gSavedSettings.declareS32("DropShadowButton",	2, "Drop shadow width for buttons (pixels)");
	gSavedSettings.declareS32("DropShadowFloater",	5, "Drop shadow width for floaters (pixels)");
	gSavedSettings.declareS32("DropShadowSlider",	3, "Drop shadow width for sliders (pixels)");
	gSavedSettings.declareS32("DropShadowTooltip",	4, "Drop shadow width for tooltips (pixels)");

	//------------------------------------------------------------------------
	// Buttons
	//------------------------------------------------------------------------
	gSavedSettings.declareS32("ButtonHPad", 10, "Default horizontal spacing between buttons (pixels)");		// space from left of button to text
	gSavedSettings.declareS32("ButtonVPad", 1, "Default vertical spacing between buttons (pixels)");		// space from bottom of button to text
	gSavedSettings.declareS32("ButtonHeightSmall", 16, "Default height for small buttons (pixels)");
	gSavedSettings.declareS32("ButtonHeight", 20, "Default height for normal buttons (pixels)");
	gSavedSettings.declareF32("ButtonFlashRate", 2.f, "Frequency at which buttons flash (hz)");
	gSavedSettings.declareS32("ButtonFlashCount", 3, "Number of flashes after which flashing buttons stay lit up");
	//gSavedSettings.declareS32("ButtonHeightToolbar", 32, "[NOT USED]");

	//gSavedSettings.declareS32("DefaultButtonWidth", DEFAULT_BUTTON_WIDTH, "[NOT USED]");
	//gSavedSettings.declareS32("DefaultButtonHeight", DEFAULT_BUTTON_HEIGHT, "[NOT USED]");

	//------------------------------------------------------------------------
	// Scroll Lists
	//------------------------------------------------------------------------
	gSavedSettings.declareF32("TypeAheadTimeout", 1.5f, "Time delay before clearing type-ahead buffer in lists (seconds)");

	//------------------------------------------------------------------------
	// ToolTips
	//------------------------------------------------------------------------
	gSavedSettings.declareF32("ToolTipDelay", 0.7f, "Seconds before displaying tooltip when mouse stops over UI element");
	gSavedSettings.declareF32("DragAndDropToolTipDelay", 0.1f, "Seconds before displaying tooltip when performing drag and drop operation");

	//------------------------------------------------------------------------
	// Auto-Open Folders
	//------------------------------------------------------------------------
	gSavedSettings.declareF32("FolderAutoOpenDelay", 0.75f, "Seconds before automatically expanding the folder under the mouse when performing inventory drag and drop");
	gSavedSettings.declareF32("InventoryAutoOpenDelay", 1.f, "Seconds before automatically opening inventory when mouse is over inventory button when performing inventory drag and drop");
	gSavedSettings.declareBOOL("ShowEmptyFoldersWhenSearching", FALSE, "Shows folders that do not have any visible contents when applying a filter to inventory");
	gSavedSettings.declareS32("FilterItemsPerFrame", 500, "Maximum number of inventory items to match against search filter every frame (lower to increase framerate while searching, higher to improve search speed)");
	gSavedSettings.declareBOOL("DebugInventoryFilters", FALSE, "Turn on debugging display for inventory filtering");
	gSavedSettings.declareF32("FolderLoadingMessageWaitTime", 0.5f, "Seconds to wait before showing the LOADING... text in folder views");

	//------------------------------------------------------------------------
	// Status bar
	//------------------------------------------------------------------------
	gSavedSettings.declareS32("StatusBarHeight", 26, "Height of menu/status bar at top of screen (pixels)" );
	//gSavedSettings.declareS32("StatusBarButtonWidth", 80, "[NOT USED]");

	gSavedSettings.declareS32("StatusBarPad", 10, "Spacing between popup buttons at bottom of screen (Stand up, Release Controls)");

	//gSavedSettings.declareS32("ChatWidth", 250, "[NOT USED]");

	//------------------------------------------------------------------------
	// Toolbar bar
	//------------------------------------------------------------------------
	//gSavedSettings.declareS32("ToolBarHeight", 20, "[NOT USED]" );
	//gSavedSettings.declareS32("ToolBarWidth", 480, "[NOT USED]" );
	//gSavedSettings.declareS32("ToolBarButtonWidth", 80, "[NOT USED]" );

	//------------------------------------------------------------------------
	// Fonts
	//------------------------------------------------------------------------
	gSavedSettings.declareF32("FontScreenDPI",	96.f, "Font resolution, higher is bigger (pixels per inch)");		// windows standard
	gSavedSettings.declareF32("FontSizeMonospace", 9.f, "Size of monospaced font (points, or 1/72 of an inch)");
	gSavedSettings.declareF32("FontSizeSmall",	9.f, "Size of small font (points, or 1/72 of an inch)");
	gSavedSettings.declareF32("FontSizeMedium",	10.f, "Size of medium font (points, or 1/72 of an inch)");
	gSavedSettings.declareF32("FontSizeLarge",	12.f, "Size of large font (points, or 1/72 of an inch)");
	gSavedSettings.declareF32("FontSizeHuge",	16.f, "Size of huge font (points, or 1/72 of an inch)");

	gSavedSettings.declareString("FontMonospace",		"profontwindows.ttf", "Name of monospace font (Truetype file name)");
	gSavedSettings.declareString("FontSansSerif",		"MtBkLfRg.ttf", "Name of san-serif font (Truetype file name)");
#if LL_WINDOWS
	// Lists Japanese, Korean, and Chinese sanserif fonts available in
	// Windows XP and Vista, as well as "Arial Unicode MS".
	gSavedSettings.declareString(
		"FontSansSerifFallback",
		"MSGOTHIC.TTC;gulim.ttc;simhei.ttf;ArialUni.ttf",
		"Name of fallback san-serif font (Truetype file name)");
#elif LL_DARWIN
	// This is a fairly complete Japanese font that ships with Mac OS X.
	// The first filename is in UTF8, but it shows up in the font menu as "Hiragino Kaku Gothic Pro W3".
	// The third filename is in UTF8, but it shows up in the font menu as "STHeiti Light"
	gSavedSettings.declareString("FontSansSerifFallback",	"\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 Pro W3.otf;\xE3\x83\x92\xE3\x83\xA9\xE3\x82\xAD\xE3\x82\x99\xE3\x83\x8E\xE8\xA7\x92\xE3\x82\xB3\xE3\x82\x99 ProN W3.otf;AppleGothic.dfont;AppleGothic.ttf;\xe5\x8d\x8e\xe6\x96\x87\xe7\xbb\x86\xe9\xbb\x91.ttf", "Name of san-serif font (Truetype file name)");
#else
	// 'unicode.ttf' doesn't exist, but hopefully an international
	// user can take the hint and drop in their favourite local font.
	gSavedSettings.declareString("FontSansSerifFallback",	"unicode.ttf", "Name of fallback san-serif font (Truetype file name)");
#endif
	gSavedSettings.declareF32("FontSansSerifFallbackScale", 1.0, "Scale of fallback font relative to huge font (fraction of huge font size)");
	gSavedSettings.declareString("FontSansSerifBold",	"MtBdLfRg.ttf", "Name of bold font (Truetype file name)");

	//------------------------------------------------------------------------
	// Chat
	//------------------------------------------------------------------------

	// 0 = small, 1 = big
	gSavedSettings.declareS32("ChatFontSize", 1, "Size of chat text in chat console (0 = small, 1 = big)");

	// Does the console occupy full window width or only left 2/3?
	gSavedSettings.declareBOOL("ChatFullWidth", TRUE, "Chat console takes up full width of SL window");

	// opacity of console background
	gSavedSettings.declareF32("ConsoleBackgroundOpacity", 0.4f, "Opacity of chat console (0.0 = completely transparent, 1.0 = completely opaque)");
	gSavedSettings.declareS32("ConsoleMaxLines", 40, "Max number of lines of chat text visible in console.");

	// Seconds to keep line of text on console
	gSavedSettings.declareF32("ChatPersistTime", 15.f, "Time for which chat stays visible in console (seconds)");
	gSavedSettings.declareBOOL("PlayTypingAnim", TRUE, "Your avatar plays the typing animation whenever you type in the chat bar");

	// show chat in bubbles above avatar heads
	gSavedSettings.declareBOOL("UseChatBubbles", FALSE, "Show chat above avatars head in chat bubbles");
	gSavedSettings.declareF32("ChatBubbleOpacity", 0.5f, "Opacity of chat bubble background (0.0 = completely transparent, 1.0 = completely opaque)");

	gSavedSettings.declareBOOL("AllowIdleAFK", TRUE, "Automatically set AFK (away from keyboard) mode when idle");
	gSavedSettings.declareF32("AFKTimeout", 300.f, "Time before automatically setting AFK (away from keyboard) mode (seconds)");	// 5 minutes

	gSavedSettings.declareBOOL("SmallAvatarNames", TRUE, "Display avatar name text in smaller font");
	gSavedSettings.declareBOOL("ScriptErrorsAsChat", FALSE, "Display script errors and warning in chat history");

	gSavedSettings.declareBOOL("ChatShowTimestamps", TRUE, "Show timestamps in chat");

	gSavedSettings.declareBOOL("EnableVoiceChat", TRUE, "Enable talking to other residents with a microphone");
	gSavedSettings.declareBOOL("VoiceCallsFriendsOnly", FALSE, "Only accept voice calls from residents on your friends list");
	gSavedSettings.declareBOOL("PTTCurrentlyEnabled", TRUE, "", NO_PERSIST);
	gSavedSettings.declareBOOL("ShowVoiceChannelPopup", FALSE, "Controls visibility of the current voice channel popup above the voice tab");
	gSavedSettings.declareBOOL("EnablePushToTalk", TRUE, "Must hold down a key or moouse button when talking into your microphone");
	gSavedSettings.declareString("PushToTalkButton", "MiddleMouse", "Which button or keyboard key is used for push-to-talk");
	gSavedSettings.declareBOOL("PushToTalkToggle", FALSE, "Should the push-to-talk button behave as a toggle");
	gSavedSettings.declareS32("VoiceEarLocation", 0, "Location of the virtual ear for voice");
	gSavedSettings.declareString("VivoxDebugServerName", "bhd.vivox.com", "Hostname of the vivox account server to use for voice when not connected to Agni.");
	gSavedSettings.declareColor4("SpeakingColor", LLColor4(0.f, 1.f, 0.f, 1.f), "Color of various indicators when resident is speaking on a voice channel.");
	gSavedSettings.declareColor4("OverdrivenColor", LLColor4(1.f, 0.f, 0.f, 1.f), "Color of various indicators when resident is speaking too loud.");
	gSavedSettings.declareString("VoiceInputAudioDevice", "Default", "Audio input device to use for voice");
	gSavedSettings.declareString("VoiceOutputAudioDevice", "Default", "Audio output device to use for voice");
	gSavedSettings.declareString("VivoxDebugLevel", "-1", "Logging level to use when launching the vivox daemon");

	//voice amplitude images;
	
	/*
	gSavedSettings.declareString("VoiceImageLevel0", "5b41b4c3-eb70-0f0f-17d9-1765cbd07d39", "Texture UUID for voice image level 0");	
	gSavedSettings.declareString("VoiceImageLevel1", "b06ffd0a-7bfe-0449-0bbc-df291f1857c4", "Texture UUID for voice image level 1");
	gSavedSettings.declareString("VoiceImageLevel2", "bfa16494-b731-5b59-3260-9e4fd29d63f7", "Texture UUID for voice image level 2");
	gSavedSettings.declareString("VoiceImageLevel3", "6951074f-de1d-3c55-cb2f-e972877f7f81", "Texture UUID for voice image level 3");
	gSavedSettings.declareString("VoiceImageLevel4", "ce3df80a-f0c5-a7cb-f5bc-d3bb38949d0d", "Texture UUID for voice image level 4");
	gSavedSettings.declareString("VoiceImageLevel5", "8d0e359c-5cea-bdf5-b6b0-32d2fea6355c", "Texture UUID for voice image level 5");
	gSavedSettings.declareString("VoiceImageLevel6", "ad9e64e0-a763-5d8c-f2e8-7b5dfdb7f20f", "Texture UUID for voice image level 6");
	*/
	
	/*
	// Jeffrey's first version
	gSavedSettings.declareString("VoiceImageLevel0", "5b41b4c3-eb70-0f0f-17d9-1765cbd07d39", "Texture UUID for voice image level 0");	
	gSavedSettings.declareString("VoiceImageLevel1", "cde76ae8-0044-d575-8e2c-65fb0a14cbde", "Texture UUID for voice image level 1");
	gSavedSettings.declareString("VoiceImageLevel2", "cde76ae8-0044-d575-8e2c-65fb0a14cbde", "Texture UUID for voice image level 2");
	gSavedSettings.declareString("VoiceImageLevel3", "cde76ae8-0044-d575-8e2c-65fb0a14cbde", "Texture UUID for voice image level 3");
	gSavedSettings.declareString("VoiceImageLevel4", "cde76ae8-0044-d575-8e2c-65fb0a14cbde", "Texture UUID for voice image level 4");
	gSavedSettings.declareString("VoiceImageLevel5", "cde76ae8-0044-d575-8e2c-65fb0a14cbde", "Texture UUID for voice image level 5");
	gSavedSettings.declareString("VoiceImageLevel6", "cde76ae8-0044-d575-8e2c-65fb0a14cbde", "Texture UUID for voice image level 6");
	*/
	
	// Brent's first version
	/*
	gSavedSettings.declareString("VoiceImageLevel0", "5b41b4c3-eb70-0f0f-17d9-1765cbd07d39", "Texture UUID for voice image level 0");	
	gSavedSettings.declareString("VoiceImageLevel1", "72365124-c7a7-a1f9-3d7a-d8e521eb5011", "Texture UUID for voice image level 1");
	gSavedSettings.declareString("VoiceImageLevel2", "72365124-c7a7-a1f9-3d7a-d8e521eb5011", "Texture UUID for voice image level 2");
	gSavedSettings.declareString("VoiceImageLevel3", "72365124-c7a7-a1f9-3d7a-d8e521eb5011", "Texture UUID for voice image level 3");
	gSavedSettings.declareString("VoiceImageLevel4", "72365124-c7a7-a1f9-3d7a-d8e521eb5011", "Texture UUID for voice image level 4");
	gSavedSettings.declareString("VoiceImageLevel5", "72365124-c7a7-a1f9-3d7a-d8e521eb5011", "Texture UUID for voice image level 5");
	gSavedSettings.declareString("VoiceImageLevel6", "72365124-c7a7-a1f9-3d7a-d8e521eb5011", "Texture UUID for voice image level 6");
	*/
	
	/*
	// Brent's second version
	gSavedSettings.declareString("VoiceImageLevel0", "5b41b4c3-eb70-0f0f-17d9-1765cbd07d39", "Texture UUID for voice image level 0");	
	gSavedSettings.declareString("VoiceImageLevel1", "4ee6a7ac-472e-b5ff-7125-f6213798cbee", "Texture UUID for voice image level 1");
	gSavedSettings.declareString("VoiceImageLevel2", "4ee6a7ac-472e-b5ff-7125-f6213798cbee", "Texture UUID for voice image level 2");
	gSavedSettings.declareString("VoiceImageLevel3", "4ee6a7ac-472e-b5ff-7125-f6213798cbee", "Texture UUID for voice image level 3");
	gSavedSettings.declareString("VoiceImageLevel4", "4ee6a7ac-472e-b5ff-7125-f6213798cbee", "Texture UUID for voice image level 4");
	gSavedSettings.declareString("VoiceImageLevel5", "4ee6a7ac-472e-b5ff-7125-f6213798cbee", "Texture UUID for voice image level 5");
	gSavedSettings.declareString("VoiceImageLevel6", "4ee6a7ac-472e-b5ff-7125-f6213798cbee", "Texture UUID for voice image level 6");
	*/
	
	// Jeffrey's tweak on 4/9/07
	gSavedSettings.declareString("VoiceImageLevel0", "041ee5a0-cb6a-9ac5-6e49-41e9320507d5", "Texture UUID for voice image level 0");	
	gSavedSettings.declareString("VoiceImageLevel1", "29de489d-0491-fb00-7dab-f9e686d31e83", "Texture UUID for voice image level 1");
	gSavedSettings.declareString("VoiceImageLevel2", "29de489d-0491-fb00-7dab-f9e686d31e83", "Texture UUID for voice image level 2");
	gSavedSettings.declareString("VoiceImageLevel3", "29de489d-0491-fb00-7dab-f9e686d31e83", "Texture UUID for voice image level 3");
	gSavedSettings.declareString("VoiceImageLevel4", "29de489d-0491-fb00-7dab-f9e686d31e83", "Texture UUID for voice image level 4");
	gSavedSettings.declareString("VoiceImageLevel5", "29de489d-0491-fb00-7dab-f9e686d31e83", "Texture UUID for voice image level 5");
	gSavedSettings.declareString("VoiceImageLevel6", "29de489d-0491-fb00-7dab-f9e686d31e83", "Texture UUID for voice image level 6");
	
	gSavedSettings.declareString("VoiceHost", "127.0.0.1", "Client SLVoice host to connect to");
	gSavedSettings.declareU32("VoicePort", 44124, "Client SLVoice port to connect to");
	
	//------------------------------------------------------------------------
	// Caution Script Permission Prompts
	//------------------------------------------------------------------------

	gSavedSettings.declareBOOL("PermissionsCautionEnabled", TRUE, "When enabled, changes the handling of script permission requests to help avoid accidental granting of certain permissions, such as the debit permission", NO_PERSIST);
	gSavedSettings.declareS32("PermissionsCautionNotifyBoxHeight", 344, "Height of caution-style notification messages", NO_PERSIST);

	//------------------------------------------------------------------------
	// Other....
	//------------------------------------------------------------------------

	gSavedSettings.declareBOOL("ScriptHelpFollowsCursor", FALSE, "Scripting help window updates contents based on script editor contents under text cursor");

	gSavedSettings.declareS32("LastFeatureVersion", 0, "[DO NOT MODIFY] Version number for tracking hardware changes", TRUE);
	gSavedSettings.declareS32("NumSessions", 0, "Number of successful logins to Second Life");
	gSavedSettings.declareBOOL("ShowInventory", FALSE, "Open inventory window on login");
	gSavedSettings.declareBOOL("ChatOnlineNotification", TRUE, "Provide notifications for when friend log on and off of SL");

	gSavedSettings.declareString("DefaultObjectTexture", "89556747-24cb-43ed-920b-47caed15465f", "Texture used as 'Default' in texture picker. (UUID texture reference)" );  // maple texture

	gSavedSettings.declareBOOL("ShowPropertyLines", FALSE, "Show line overlay demarking property boundaries");
	gSavedSettings.declareBOOL("ShowParcelOwners", FALSE, "", NO_PERSIST);
	gSavedSettings.declareBOOL("ToolboxAutoMove", FALSE, "[NOT USED]");
	gSavedSettings.declareBOOL("ToolboxShowMore", TRUE, "Whether to show additional build tool controls", TRUE);

	gSavedSettings.declareRect("ToolboxRect", LLRect(0, 100, 100, 100), "Rectangle for tools window" ); // only care about position

	// User interface button states
	gSavedSettings.declareBOOL("FirstPersonBtnState",	FALSE,	"", NO_PERSIST);
	gSavedSettings.declareBOOL("MouselookBtnState",		FALSE,	"", NO_PERSIST);
	gSavedSettings.declareBOOL("ThirdPersonBtnState",	TRUE,	"", NO_PERSIST);
	gSavedSettings.declareBOOL("BuildBtnState",			FALSE,	"", NO_PERSIST);

	//gSavedSettings.declareBOOL("TalkBtnState",		FALSE, "[NOT USED]");

	gSavedSettings.declareBOOL("ShowPermissions",	FALSE, "", NO_PERSIST);
	gSavedSettings.declareBOOL("ShowTools",			FALSE, "", NO_PERSIST);


	gSavedSettings.declareString("NextLoginLocation", "", "Location to log into by default.");	// if present in settings.ini, will force you to that sim/x/y/z on next login 

//	gSavedSettings.declareBOOL("ShowBasicHelpOnLaunch",	TRUE);
	gSavedSettings.declareRect("BasicHelpRect",			LLRect(0, 404, 467, 0), "Rectangle for help window" );  // Only width and height are used

	gSavedSettings.declareS32("LastPrefTab", 0, "Last selected tab in preferences window");
	
	gSavedSettings.declareString("LSLHelpURL", "https://wiki.secondlife.com/wiki/[LSL_STRING]", "URL that points to LSL help files, with [LSL_STRING] corresponding to the referenced LSL function or keyword");
	// link for editable wiki (https doesn't seem to work right now with our embedded browser)
	//gSavedSettings.declareString("LSLHelpURL", "https://wiki.secondlife.com/wiki/[LSL_STRING]", "URL that points to LSL help files, with [LSL_STRING] corresponding to the referenced LSL function or keyword");
	// Wearable default images
//	const char* UI_IMG_BLACK_UUID		= "e2244626-f22f-4839-8123-1e7baddeb659";
	const char* UI_IMG_WHITE_UUID		= "5748decc-f629-461c-9a36-a35a221fe21f";
//	const char* UI_IMG_DARKGRAY_UUID	= "267e26d3-e0e1-41b8-91b1-3b337102928d";
//	const char* UI_IMG_LIGHTGRAY_UUID	= "c520bf46-cc5d-412b-a60b-9f1bd245189f";

	gSavedSettings.declareString("UIImgDefaultShirtUUID",		UI_IMG_WHITE_UUID,					"", NO_PERSIST);
	gSavedSettings.declareString("UIImgDefaultPantsUUID",		UI_IMG_WHITE_UUID,					"", NO_PERSIST);
	gSavedSettings.declareString("UIImgDefaultEyesUUID",		"6522e74d-1660-4e7f-b601-6f48c1659a77", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgDefaultHairUUID",		"7ca39b4c-bd19-4699-aff7-f93fd03d3e7b", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgDefaultShoesUUID",		UI_IMG_WHITE_UUID,						"", NO_PERSIST);
	gSavedSettings.declareString("UIImgDefaultSocksUUID",		UI_IMG_WHITE_UUID,					"", NO_PERSIST);
	gSavedSettings.declareString("UIImgDefaultGlovesUUID",		UI_IMG_WHITE_UUID,					"", NO_PERSIST);
	gSavedSettings.declareString("UIImgDefaultJacketUUID",		UI_IMG_WHITE_UUID,					"", NO_PERSIST);
	gSavedSettings.declareString("UIImgDefaultUnderwearUUID",	UI_IMG_WHITE_UUID,					"", NO_PERSIST);
	gSavedSettings.declareString("UIImgDefaultSkirtUUID",		UI_IMG_WHITE_UUID,					"", NO_PERSIST);

	// Utility color for texture defaults
	gSavedSettings.declareString("UIImgWhiteUUID",				UI_IMG_WHITE_UUID,						"", NO_PERSIST);

	// Movement widget controls
	const S32 MOVE_BTN_COL1 = 20;
	const S32 MOVE_BTN_COL2 = MOVE_BTN_COL1 + 25;
	const S32 MOVE_BTN_COL3 = MOVE_BTN_COL2 + 21;
	const S32 MOVE_BTN_COL4 = MOVE_BTN_COL3 + 25;
	const S32 MOVE_BTN_COL5 = MOVE_BTN_COL4 + 25;
//	const S32 MOVE_BTN_COL6 = MOVE_BTN_COL5 + 20;
	const S32 MOVE_BTN_ROW1 = 4;
	const S32 MOVE_BTN_ROW2 = MOVE_BTN_ROW1 + 25;
	const S32 MOVE_BTN_ROW3 = MOVE_BTN_ROW2 + 25;
	const S32 MOVE_BTN_FLY_LEFT = MOVE_BTN_COL1+96;
	const S32 MOVE_BTN_FLY_WIDTH = 40;
	const S32 MOVE_BTN_FLY_RIGHT = MOVE_BTN_FLY_LEFT + MOVE_BTN_FLY_WIDTH;

	//gSavedSettings.declareBOOL("CreateObjectsCentered",	FALSE, "[NOT USED]");

	//gSavedSettings.declareBOOL("ShowMoveArrows", TRUE, "[NOT USED]");

	gSavedSettings.declareRect("SlideLeftBtnRect",
		LLRect(MOVE_BTN_COL1, MOVE_BTN_ROW3,	MOVE_BTN_COL2,	MOVE_BTN_ROW2),
		"", NO_PERSIST	);
	gSavedSettings.declareRect("TurnLeftBtnRect",
		LLRect(MOVE_BTN_COL1, MOVE_BTN_ROW2,	MOVE_BTN_COL2,	MOVE_BTN_ROW1),
		"", NO_PERSIST  );
	gSavedSettings.declareRect("ForwardBtnRect",
		LLRect(MOVE_BTN_COL2, MOVE_BTN_ROW3,	MOVE_BTN_COL3,	MOVE_BTN_ROW2),
		"", NO_PERSIST	);
	gSavedSettings.declareRect("BackwardBtnRect",
		LLRect(MOVE_BTN_COL2, MOVE_BTN_ROW2,	MOVE_BTN_COL3,	MOVE_BTN_ROW1),
		"", NO_PERSIST	);
	gSavedSettings.declareRect("SlideRightBtnRect",
		LLRect(MOVE_BTN_COL3, MOVE_BTN_ROW3,	MOVE_BTN_COL4,	MOVE_BTN_ROW2),
		"", NO_PERSIST  );
	gSavedSettings.declareRect("TurnRightBtnRect",
		LLRect(MOVE_BTN_COL3, MOVE_BTN_ROW2,	MOVE_BTN_COL4,	MOVE_BTN_ROW1),
		"", NO_PERSIST	);
	gSavedSettings.declareRect("MoveUpBtnRect",
		LLRect(MOVE_BTN_COL4, MOVE_BTN_ROW3,	MOVE_BTN_COL5,	MOVE_BTN_ROW2),
		"", NO_PERSIST  );
	gSavedSettings.declareRect("MoveDownBtnRect",
		LLRect(MOVE_BTN_COL4, MOVE_BTN_ROW2,	MOVE_BTN_COL5,	MOVE_BTN_ROW1),
		"", NO_PERSIST	);
	gSavedSettings.declareBOOL("FlyBtnState",			FALSE,	"", NO_PERSIST);
	gSavedSettings.declareBOOL("SitBtnState",			FALSE,	"", NO_PERSIST);
	gSavedSettings.declareRect("FlyBtnRect",
		LLRect(MOVE_BTN_FLY_LEFT, 20,	MOVE_BTN_FLY_RIGHT,	 4), "", NO_PERSIST	);
	gSavedSettings.declareBOOL("RunBtnState",			FALSE,	"", NO_PERSIST);
	gSavedSettings.declareRect("RunBtnRect",
		LLRect(MOVE_BTN_FLY_LEFT, 40,	MOVE_BTN_FLY_RIGHT,	 24), "", NO_PERSIST	);

	const S32 MOVE_WIDTH = MOVE_BTN_FLY_RIGHT + 4;
	const S32 MOVE_HEIGHT = MOVE_BTN_ROW3 + 4;
	gSavedSettings.declareRect("FloaterMoveRect", LLRect(0, MOVE_HEIGHT, MOVE_WIDTH, 0), "Rectangle for avatar control window");

	// 0 = never, 1 = fade, 2 = always
	gSavedSettings.declareS32("RenderName", 2, "Controls display of names above avatars (0 = never, 1 = fade, 2 = always)");
	gSavedSettings.declareF32("RenderNameShowTime", 10.f, "Fade avatar names after specified time (seconds)");		// seconds
	gSavedSettings.declareF32("RenderNameFadeDuration", 1.f, "Time interval over which to fade avatar names (seconds)");	// seconds
	gSavedSettings.declareBOOL("RenderNameHideSelf", FALSE, "Don't display own name above avatar");
	gSavedSettings.declareBOOL("RenderHideGroupTitle", FALSE, "Don't show my group title in my name label");
	gSavedSettings.declareBOOL("RenderGroupTitleAll", TRUE, "Show group titles in name labels");

	// Camera widget controls
	const S32 CAMERA_LEFT = MOVE_BTN_FLY_RIGHT + 10;
	const S32 CAMERA_WIDTH = 16 + 64 + 16 + 64 + 16;
	const S32 CAMERA_HEIGHT = 64;
	gSavedSettings.declareRect("FloaterCameraRect",
		LLRect(CAMERA_LEFT, CAMERA_HEIGHT, CAMERA_LEFT+CAMERA_WIDTH, 0), "Rectangle for camera control window");

	// Tool view
	LLRect floater_tools_rect;
	floater_tools_rect.setOriginAndSize(0, 300, TOOL_PANEL_WIDTH, 368);
	//gSavedSettings.declareRect("FloaterToolsRect",	floater_tools_rect, "[NOT USED]");
	gSavedSettings.declareRect("ToolHelpRect",	LLRect(8, TOOL_PANEL_HEIGHT-16, TOOL_PANEL_WIDTH -8, TOOL_PANEL_HEIGHT-16-16), "", NO_PERSIST); // relative to ToolPanelRect

	gSavedSettings.declareRect("FloaterFriendsRect", LLRect(0, 400, 250, 0), "Rectangle for friends window");
	gSavedSettings.declareRect("FloaterSnapshotRect", LLRect(0, 200, 200, 400), "Rectangle for snapshot window");

	//gSavedSettings.declareRect("AccountHistoryRect", LLRect(100, 500, 500, 200), "[NOT USED]");

	// Energy bar
	//gSavedSettings.declareBOOL("ShowEnergyPanel", FALSE, "[NOT USED]");
	gSavedSettings.declareS32("EnergyFromTop", 20, "", NO_PERSIST );
	gSavedSettings.declareS32("EnergyWidth", 175, "", NO_PERSIST );
	gSavedSettings.declareS32("EnergyHeight", 40, "", NO_PERSIST );

	gSavedSettings.declareBOOL("UIFloaterTestBool", FALSE, "Example saved setting for the test floater");

	//------------------------------------------------------------------------
	// UI UUIDS
	//------------------------------------------------------------------------
	gSavedSettings.declareString("UIImgBtnCloseInactiveUUID",	"779e4fa3-9b13-f74a-fba9-3886fe9c86ba", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnCloseActiveUUID",		"47a8c844-cd2a-4b1a-be01-df8b1612fe5d", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnClosePressedUUID",	"e5821134-23c0-4bd0-af06-7fa95b9fb01a", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgBtnMinimizeInactiveUUID","6e72abba-1378-437f-bf7a-f0c15f3e99a3", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnMinimizeActiveUUID",	"34c9398d-bb78-4643-9633-46a2fa3e9637", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnMinimizePressedUUID",	"39801651-26cb-4926-af57-7af9352c273c", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgBtnRestoreInactiveUUID",	"0eafa471-70af-4882-b8c1-40a310929744", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnRestoreActiveUUID",	"111b39de-8928-4690-b7b2-e17d5c960277", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnRestorePressedUUID",	"90a0ed5c-2e7b-4845-9958-a64a1b30f312", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgBtnTearOffInactiveUUID",	"74e1a96f-4833-a24d-a1bb-1bce1468b0e7", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnTearOffActiveUUID",	"74e1a96f-4833-a24d-a1bb-1bce1468b0e7", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnTearOffPressedUUID",	"d2524c13-4ba6-af7c-e305-8ac6cc18d86a", "", NO_PERSIST);

	// Stay in IM after hitting return.
	gSavedSettings.declareBOOL("PinTalkViewOpen", TRUE, "Stay in IM after hitting return");

	// Close chat after hitting return.
	gSavedSettings.declareBOOL("CloseChatOnReturn", FALSE, "Close chat after hitting return");

	// Copy IM messages into chat history
	gSavedSettings.declareBOOL("ContactsTornOff", FALSE, "Show contacts window separately from Communicate window.");
	gSavedSettings.declareBOOL("ChatHistoryTornOff", FALSE, "Show chat history window separately from Communicate window.");
	gSavedSettings.declareBOOL("IMInChatHistory", FALSE, "Copy IM into chat history");
	gSavedSettings.declareBOOL("IMShowTimestamps", TRUE, "Show timestamps in IM");

	// Has the user intentionally entered chatting mode, hence wanting the
	// chat UI to be displayed, keyboard focus to go into chat, etc.
	gSavedSettings.declareBOOL("ChatVisible", FALSE, "Chat bar is visible");

	gSavedSettings.declareString("UIImgDirectionArrowUUID",		"586383e8-4d9b-4fba-9196-2b5938e79c2c", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgResizeBottomRightUUID",	"e3690e25-9690-4f6c-a745-e7dcd885285a", "", NO_PERSIST);

	// Move buttons
	gSavedSettings.declareString("UIImgBtnForwardOutUUID",		"a0eb4021-1b20-4a53-892d-8faa9265a6f5", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnForwardInUUID",		"54197a61-f5d1-4c29-95d2-c071d08849cb", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnSlideLeftOutUUID",	"82476321-0374-4c26-9567-521535ab4cd7", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnSlideLeftInUUID",		"724996f5-b956-46f6-9844-4fcfce1d5e83", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnLeftOutUUID",			"13a93910-6b44-45eb-ad3a-4d1324c59bac", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnLeftInUUID",			"95463c78-aaa6-464d-892d-3a805b6bb7bf", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnRightOutUUID",		"5a44fd04-f52b-4c30-8b00-4a31e27614bd", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnRightInUUID",			"5e616d0d-4335-476f-9977-560bccd009da", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnSlideRightOutUUID",	"1fbe4e60-0607-44d1-a50a-032eff56ae75", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnSlideRightInUUID",	"7eeb57d2-3f37-454d-a729-8b217b8be443", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnMoveUpInUUID",		"49b4b357-e430-4b56-b9e0-05b8759c3c82", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnMoveUpOutUUID",		"f887146d-829f-4e39-9211-cf872b78f97c", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnMoveDownInUUID",		"b92a70b9-c841-4c94-b4b3-cee9eb460d48", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnMoveDownOutUUID",		"b5abc9fa-9e62-4e03-bc33-82c4c1b6b689", "", NO_PERSIST);

//	gSavedSettings.declareString("UIImgBtnPopupOutUUID",		"f41ecdbf-e4b7-4eae-80fa-f0c842d85c1c");
//	gSavedSettings.declareString("UIImgBtnPopupInUUID",			"432fd877-f2ad-45ce-8ae7-d1ced88462cb");

	// Scrollbar
	gSavedSettings.declareString("UIImgBtnScrollUpOutUUID",		"dad084d7-9a46-452a-b0ff-4b9f1cefdde9",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnScrollUpInUUID",		"a93abdf3-27b5-4e22-a8fa-c48216cd2e3a",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnScrollDownOutUUID",	"b4ecdecf-5c8d-44e7-b882-17a77e88ed55",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnScrollDownInUUID",	"d2421bab-2eaf-4863-b8f6-5e4c52519247",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnScrollLeftOutUUID",	"43773e8d-49aa-48e0-80f3-a04715f4677a",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnScrollLeftInUUID",	"ea137a32-6718-4d05-9c22-7d570d27b2cd",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnScrollRightOutUUID",	"3d700d19-e708-465d-87f2-46c8c0ee7938",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnScrollRightInUUID",	"b749de64-e903-4c3c-ac0b-25fb6fa39cb5",	"", NO_PERSIST);

	gSavedSettings.declareString("UIImgBtnJumpLeftOutUUID",	    "3c18c87e-5f50-14e2-e744-f44734aa365f",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnJumpLeftInUUID",	    "9cad3e6d-2d6d-107d-f8ab-5ba272b5bfe1",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnJumpRightOutUUID",	"ff9a71eb-7414-4cf8-866e-a701deb7c3cf",	"", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnJumpRightInUUID",	    "7dabc040-ec13-2309-ddf7-4f161f6de2f4",	"", NO_PERSIST);

	// Spin control
	gSavedSettings.declareString("UIImgBtnSpinUpOutUUID",			"56576e6e-6710-4e66-89f9-471b59122794", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnSpinUpInUUID",			"c8450082-96a0-4319-8090-d3ff900b4954", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnSpinDownOutUUID",			"b6d240dd-5602-426f-b606-bbb49a30726d", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnSpinDownInUUID",			"a985ac71-052f-48e6-9c33-d931c813ac92", "", NO_PERSIST);

	// Radio button control
	gSavedSettings.declareString("UIImgRadioActiveUUID",			"7a1ba9b8-1047-4d1e-9cfc-bc478c80b63f", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgRadioActiveSelectedUUID",	"52f09e07-5816-4052-953c-94c6c10479b7", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgRadioInactiveUUID",			"90688481-67ff-4af0-be69-4aa084bcad1e", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgRadioInactiveSelectedUUID",	"1975db39-aa29-4251-aea0-409ac09d414d", "", NO_PERSIST);

	// Checkbox control
	gSavedSettings.declareString("UIImgCheckboxActiveUUID",			"05bb64ee-96fd-4243-b74e-f40a41bc53ba", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgCheckboxActiveSelectedUUID", "cf4a2ed7-1533-4686-9dde-df9a37ddca55", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgCheckboxInactiveUUID",		"7d94cb59-32a2-49bf-a516-9e5a2045f9d9", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgCheckboxInactiveSelectedUUID", "c817c642-9abd-4236-9287-ae0513fe7d2b", "", NO_PERSIST);

	// Tab panels
	gSavedSettings.declareString("UIImgBtnTabTopPartialOutUUID",	"932ad585-0e45-4a57-aa23-4cf81beeb7b0", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnTabTopPartialInUUID",		"7c6c6c26-0e25-4438-89bd-30d8b8e9d704", "",  NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnTabBottomPartialOutUUID",	"8dca716c-b29c-403a-9886-91c028357d6e", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnTabBottomPartialInUUID",	"eb0b0904-8c91-4f24-b500-1180b91140de", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnTabTopOutUUID",			"1ed83f57-41cf-4052-a3b4-2e8bb78d8191", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnTabTopInUUID",			"16d032e8-817b-4368-8a4e-b7b947ae3889", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnTabBottomOutUUID",		"bf0a8779-689b-48c3-bb9a-6af546366ef4", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnTabBottomInUUID",			"c001d8fd-a869-4b6f-86a1-fdcb106df9c7", "", NO_PERSIST);

	// Tools
	// TODO: Move to gViewerArt
	gSavedSettings.declareString("UIImgGrabUUID",					"c63f124c-6340-4fbf-b59e-0869a44adb64", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgGrabSelectedUUID",			"c1e21504-f136-451d-b8e9-929037812f1d", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgMoveUUID",					"2fa5dc06-bcdd-4e09-a426-f9f262d4fa65", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgMoveSelectedUUID",			"46f17c7b-8381-48c3-b628-6a406e060dd6", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgRotateUUID",					"c34b1eaa-aae3-4351-b082-e26c0b636779", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgRotateSelectedUUID",			"cdfb7fde-0d13-418a-9d89-2bd91019fc95", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgScaleUUID",					"88a90fef-b448-4883-9344-ecf378a60433", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgScaleSelectedUUID",			"55aa57ef-508a-47f7-8867-85d21c5a810d", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgFaceUUID",					"ce15fd63-b0b6-463c-a37d-ea6393208b3e", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgFaceSelectedUUID",			"b4870163-6208-42a9-9801-93133bf9a6cd", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgFocusUUID",					"57bc39d1-288c-4519-aea6-6d1786a5c274", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgFocusSelectedUUID",			"ab6a730e-ddfd-4982-9a32-c6de3de6d31d", "", NO_PERSIST);

	gSavedSettings.declareString("UIImgCreateUUID",					"7a0b1bdb-b5d9-4df5-bac2-ba230da93b5b", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgCreateSelectedUUID",			"0098b015-3daf-4cfe-a72f-915369ea97c2", "", NO_PERSIST);

	// Gun Tool texures
	gSavedSettings.declareBOOL("ShowCrosshairs",					TRUE, "Display crosshairs when in mouselook mode");
	gSavedSettings.declareString("UIImgCrosshairsUUID",				"6e1a3980-bf2d-4274-8970-91e60d85fb52", "Image to use for crosshair display (UUID texture reference)");

	gSavedSettings.declareString("Language", 						"default", "Language specifier (for XUI)" );
	gSavedSettings.declareString("SystemLanguage", 					"en-us", "Language indicated by system settings (for XUI)" );
	
	/////////////////////////////////////////////////
	// Other booleans
	gSavedSettings.declareBOOL("DebugPermissions",					FALSE, "Log permissions for selected inventory items");

	gSavedSettings.declareBOOL("ApplyColorImmediately", TRUE, "Preview selections in color picker immediately");
	gSavedSettings.declareBOOL("ApplyTextureImmediately", TRUE, "Preview selections in texture picker immediately");

	gSavedSettings.declareBOOL("CreateToolKeepSelected", FALSE, "After using create tool, keep the create tool active");
	gSavedSettings.declareBOOL("CreateToolCopySelection", FALSE, "", NO_PERSIST);
	gSavedSettings.declareBOOL("CreateToolCopyCenters", TRUE, "", NO_PERSIST);
	gSavedSettings.declareBOOL("CreateToolCopyRotates", FALSE, "", NO_PERSIST);

	gSavedSettings.declareBOOL("QuietSnapshotsToDisk", FALSE, "Take snapshots to disk without playing animation or sound");
	gSavedSettings.declareBOOL("DisableCameraConstraints", FALSE, "Disable the normal bounds put on the camera by avatar position");
	
	//gSavedSettings.declareBOOL("LogTimestamps", FALSE, "[NOT USED]");
	//gSavedSettings.declareBOOL("AgentUpdateMouseQuery", FALSE, "[NOT USED]");
	gSavedSettings.declareBOOL("AutoLogin", FALSE, "Login automatically using last username/password combination");
	gSavedSettings.declareBOOL("LoginAsGod", FALSE, "Attempt to login with god powers (Linden accounts only)");
	//gSavedSettings.declareBOOL("CameraFromPelvis", FALSE, "[NOT USED]");
	gSavedSettings.declareBOOL("CameraOffset", FALSE, "Render with camera offset from view frustum (rendering debug)");
	//gSavedSettings.declareBOOL("DynamicNearClip", TRUE, "[NOT USED]");
	gSavedSettings.declareBOOL("AnimationDebug", FALSE, "Show active animations in a bubble above avatars head");
	gSavedSettings.declareBOOL("DisplayAvatarAgentTarget", FALSE, "Show avatar positioning locators (animation debug)");
	//gSavedSettings.declareBOOL("DisplaySkeletons", TRUE, "[NOT USED]");
	gSavedSettings.declareBOOL("DisplayTimecode", FALSE, "Display timecode on screen");
	//gSavedSettings.declareBOOL("Drone", FALSE, "[NOT USED]");
	gSavedSettings.declareBOOL("DisableRendering", FALSE, "Disable GL rendering and GUI (load testing)");
	//gSavedSettings.declareBOOL("DumpPolyMeshTable", FALSE, "[NOT USED]");
	//gSavedSettings.declareBOOL("LimitAvatarToValidRegions", TRUE, "[NOT USED]");
	gSavedSettings.declareBOOL("VerboseLogs", FALSE, "Display source file and line number for each log item for debugging purposes");
	gSavedSettings.declareBOOL("FirstPersonAvatarVisible", FALSE, "Display avatar and attachments below neck while in mouselook");
	gSavedSettings.declareBOOL("ShowNearClip", FALSE, "", NO_PERSIST);
	gSavedSettings.declareBOOL("DebugWindowProc", FALSE, "Log windows messages");
	gSavedSettings.declareBOOL("ShowTangentBasis", FALSE, "Render normal and binormal (debugging bump mapping)");
	gSavedSettings.declareBOOL("AnimateTextures", TRUE, "Enable texture animation (debug)");

	// Selection stuff
	gSavedSettings.declareBOOL("LimitSelectDistance", TRUE, "Disallow selection of objects beyond max select distance");
	gSavedSettings.declareF32( "MaxSelectDistance", 64.f, "Maximum allowed selection distance (meters from avatar)");
	gSavedSettings.declareBOOL("LimitDragDistance", TRUE, "Limit translation of object via translate tool");
	gSavedSettings.declareF32( "MaxDragDistance", 48.f, "Maximum allowed translation distance in a single operation of translate tool (meters from start point)");
	gSavedSettings.declareBOOL( "SelectOwnedOnly", FALSE, "Select only objects you own" );
	gSavedSettings.declareBOOL( "SelectMovableOnly", FALSE, "Select only objects you can move" );
	gSavedSettings.declareBOOL( "RectangleSelectInclusive", TRUE, "Select objects that have at least one vertex inside selection rectangle" );
	gSavedSettings.declareBOOL( "RenderHiddenSelections", TRUE, "Show selection lines on objects that are behind other objects" );
	gSavedSettings.declareBOOL( "RenderLightRadius", FALSE, "Render the radius of selected lights" );

	gSavedSettings.declareF32("SelectionHighlightThickness", 0.010f, "Thickness of selection highlight line (fraction of view distance)");
	gSavedSettings.declareF32("SelectionHighlightUScale", 0.1f, "Scale of texture display on selection highlight line (fraction of texture size)");
	gSavedSettings.declareF32("SelectionHighlightVScale", 1.f, "Scale of texture display on selection highlight line (fraction of texture size)");
	gSavedSettings.declareF32("SelectionHighlightAlpha", 0.40f, "Opacity of selection highlight (0.0 = completely transparent, 1.0 = completely opaque)" );
	gSavedSettings.declareF32("SelectionHighlightAlphaTest", 0.1f, "Alpha value below which pixels are displayed on selection highlight line (0.0 = show all pixels, 1.0 = show now pixels)");
	gSavedSettings.declareF32("SelectionHighlightUAnim", 0.f, "Rate at which texture animates along U direction in selection highlight line (fraction of texture per second)");
	gSavedSettings.declareF32("SelectionHighlightVAnim", 0.5f, "Rate at which texture animates along V direction in selection highlight line (fraction of texture per second)");

	gSavedSettings.declareBOOL("LogMessages", FALSE, "Log network traffic");
	gSavedSettings.declareBOOL("MouseSun", FALSE, "", NO_PERSIST);

	gSavedSettings.declareBOOL("ShowAxes", FALSE, "Render coordinate frame at your position");

	gSavedSettings.declareBOOL("ShowMiniMap", TRUE, "Display mini map on login");
	gSavedSettings.declareBOOL("ShowWorldMap", FALSE, "Display world map on login");
	gSavedSettings.declareBOOL("ShowToolBar", TRUE, "Show toolbar at bottom of screen");
	gSavedSettings.declareBOOL("ShowCameraControls", FALSE, "Display camera controls on login");
	gSavedSettings.declareBOOL("ShowMovementControls", FALSE, "Display movement controls on login");

	gSavedSettings.declareBOOL("ShowLeaders", FALSE, "", NO_PERSIST);
	gSavedSettings.declareBOOL("ShowDirectory", FALSE, "", NO_PERSIST);

	gSavedSettings.declareBOOL("AutoLoadWebProfiles", FALSE, "Automatically load ALL profile webpages without asking first.");

	gSavedSettings.declareBOOL("ShowCommunicate", FALSE, "", NO_PERSIST);
	gSavedSettings.declareBOOL("ShowChatHistory", FALSE, "", NO_PERSIST);

#ifdef LL_RELEASE_FOR_DOWNLOAD
	gSavedSettings.declareBOOL("ShowConsoleWindow", FALSE, "Show log in separate OS window");
#else
	gSavedSettings.declareBOOL("ShowConsoleWindow", TRUE, "Show log in separate OS window");
#endif

	// These are ignorable warnings

	gSavedSettings.addWarning("AboutDirectX9");
	gSavedSettings.addWarning("AboutBadPCI");
	gSavedSettings.addWarning("AboutOldGraphicsDriver");
	gSavedSettings.addWarning("AboutPCIGraphics");
	gSavedSettings.addWarning("ReturnToOwner");
	gSavedSettings.addWarning("QuickTimeInstalled");
	gSavedSettings.addWarning("BrowserLaunch");
	gSavedSettings.addWarning("DeedObject");
	gSavedSettings.addWarning("NewClassified");

	// These are warnings that appear on the first experience of that condition.
	
	LLFirstUse::addConfigVariable("FirstBalanceIncrease");
	LLFirstUse::addConfigVariable("FirstBalanceDecrease");
	LLFirstUse::addConfigVariable("FirstSit");
	LLFirstUse::addConfigVariable("FirstMap");
	LLFirstUse::addConfigVariable("FirstGoTo");
	LLFirstUse::addConfigVariable("FirstBuild");
	LLFirstUse::addConfigVariable("FirstLeftClickNoHit");
	LLFirstUse::addConfigVariable("FirstTeleport");
	LLFirstUse::addConfigVariable("FirstOverrideKeys");
	LLFirstUse::addConfigVariable("FirstAttach");
	LLFirstUse::addConfigVariable("FirstAppearance");
	LLFirstUse::addConfigVariable("FirstInventory");
	LLFirstUse::addConfigVariable("FirstSandbox");
	LLFirstUse::addConfigVariable("FirstFlexible");
	LLFirstUse::addConfigVariable("FirstDebugMenus");
	LLFirstUse::addConfigVariable("FirstStreamingMusic");
	LLFirstUse::addConfigVariable("FirstStreamingVideo");
	LLFirstUse::addConfigVariable("FirstSculptedPrim");
	LLFirstUse::addConfigVariable("FirstVoice");
	LLFirstUse::addConfigVariable("FirstMedia");

	gSavedSettings.declareBOOL("ShowDebugConsole", FALSE, "Show log in SL window");
	gSavedSettings.declareBOOL("ShowDebugStats", FALSE, "Show performance stats display");
	gSavedSettings.declareBOOL("OpenDebugStatBasic", TRUE, "Expand basic performance stats display");
	gSavedSettings.declareBOOL("OpenDebugStatAdvanced", FALSE, "Expand advanced performance stats display");
	gSavedSettings.declareBOOL("OpenDebugStatNet", TRUE, "Expand network stats display");
	gSavedSettings.declareBOOL("OpenDebugStatRender", TRUE, "Expand render stats display");
	gSavedSettings.declareBOOL("OpenDebugStatSim", TRUE, "Expand simulator performance stats display");
	gSavedSettings.declareBOOL("ShowDepthBuffer", FALSE, "Show depth buffer contents");

	gSavedSettings.declareBOOL("DebugShowTime", FALSE, "Show depth buffer contents");
	gSavedSettings.declareBOOL("DebugShowRenderInfo", FALSE, "Show depth buffer contents");
	gSavedSettings.declareBOOL("DebugShowColor", FALSE, "Show color under cursor");
	
//	gSavedSettings.declareBOOL("ShowHUD", TRUE);
	//gSavedSettings.declareBOOL("ShowHUDText", TRUE, "[NOT USED]");
	//gSavedSettings.declareBOOL("ShowHeadlight", FALSE, "[NOT USED]");
	//gSavedSettings.declareBOOL("ShowLand", TRUE, "[NOT USED]");
//	gSavedSettings.declareBOOL("ShowMove", TRUE);
	//gSavedSettings.declareBOOL("SurfaceDetail", TRUE, "[NOT USED]");
	//gSavedSettings.declareBOOL("ShowObjectBounds", FALSE, "[NOT USED]");
	//gSavedSettings.declareBOOL("ShowObjectEdit", FALSE, "[NOT USED]");
	gSavedSettings.declareBOOL("ShowObjectUpdates", FALSE, "Show when update messages are received for individual objects");
	//gSavedSettings.declareBOOL("ShowObjects", TRUE, "[NOT USED]");
	//gSavedSettings.declareBOOL("ShowRegions", FALSE, "[NOT USED]");
//	gSavedSettings.declareBOOL("ShowTalk", TRUE);
	//gSavedSettings.declareBOOL("ShowTimerBar", FALSE, "[NOT USED]");
	//gSavedSettings.declareBOOL("ShowWater", FALSE, "[NOT USED]");
	gSavedSettings.declareBOOL("SpeedTest", FALSE, "Performance testing mode, no network");
	//gSavedSettings.declareBOOL("TempMouseLook", FALSE, "[NOT USED]");
	gSavedSettings.declareBOOL("UseEnergy", TRUE, "", NO_PERSIST);
//	gSavedSettings.declareBOOL("UseFirstPersonDrag", FALSE);
	//gSavedSettings.declareBOOL("UseLighting", TRUE, "[NOT USED]");
	//gSavedSettings.declareBOOL("UseWireframe", FALSE, NO_PERSIST);
	gSavedSettings.declareBOOL("VelocityInterpolate", TRUE, "Extrapolate object motion from last packet based on received velocity");
	gSavedSettings.declareBOOL("PingInterpolate", FALSE, "Extrapolate object position along velocity vector based on ping delay");
	gSavedSettings.declareBOOL("AvatarBacklight", TRUE, "Add rim lighting to avatar rendering to approximate shininess of skin");

	// Startup stuff
	gSavedSettings.declareF32("PrecachingDelay", 6.f, "Delay when logging in to load world before showing it (seconds)");	// seconds

	// Rendering stuff
	gSavedSettings.declareBOOL("RenderCubeMap",				TRUE, "Whether we can render the cube map or not");
	gSavedSettings.declareF32("RenderGamma",				0.f, "Sets gamma exponent for renderer");
	gSavedSettings.declareBOOL("RenderWater",				TRUE, "Display water" );
	gSavedSettings.declareF32( "RenderFarClip",				256.f, "Distance of far clip plane from camera (meters)" );
	gSavedSettings.declareBOOL( "RenderUseFarClip",			TRUE, "If false, frustum culling will ignore far clip plane.");
	gSavedSettings.declareF32( "RenderFogRatio",			4.0f, "Distance from camera where fog reaches maximum density (fraction or multiple of far clip distance)");
	gSavedSettings.declareBOOL("RenderAnisotropic",			FALSE, "Render textures using anisotropic filtering" );
	gSavedSettings.declareBOOL("ShowXUINames",			    FALSE, "Display XUI Names as Tooltips" );
	gSavedSettings.declareS32("RenderLightingDetail",		1, "Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights)" );
	gSavedSettings.declareS32("RenderTerrainDetail",		2, "Detail applied to terrain texturing (0 = none, 1 or 2 = full)" );
	gSavedSettings.declareBOOL("RenderDynamicLOD",			TRUE, "Dynamically adjust level of detail.");
	gSavedSettings.declareF32( "RenderVolumeLODFactor",		1.f, "Controls level of detail of primitives (multiplier for current screen area when calculated level of detail)" );
	gSavedSettings.declareF32( "RenderFlexTimeFactor",		1.f, "Controls level of detail of flexible objects (multiplier for amount of time spent processing flex objects)" );
	gSavedSettings.declareF32( "RenderTreeLODFactor",		0.5f, "Controls level of detail of vegetation (multiplier for current screen area when calculated level of detail)" );
	gSavedSettings.declareF32( "RenderAvatarLODFactor",		0.5f, "Controls level of detail of avatars (multiplier for current screen area when calculated level of detail)" );
	gSavedSettings.declareF32( "RenderTerrainLODFactor",	1.0f, "Controls level of detail of terrain (multiplier for current screen area when calculated level of detail)" );
	gSavedSettings.declareF32( "RenderBumpmapMinDistanceSquared", 100.f, "Maximum distance at which to render bumpmapped primitives (distance in meters, squared)" );
	gSavedSettings.declareS32( "RenderMaxPartCount",		4096, "Maximum number of particles to display on screen");
	gSavedSettings.declareBOOL("RenderVBOEnable",			TRUE, "Use GL Vertex Buffer Objects" );
	gSavedSettings.declareS32("RenderMaxVBOSize",			32,	"Maximum size of a vertex buffer (in KB).");
	gSavedSettings.declareS32("RenderReflectionRes",		64, "Reflection map resolution.");
	//gSavedSettings.declareBOOL("RenderUseTriStrips",		FALSE, "[NOT USED]");
	//gSavedSettings.declareBOOL("RenderCullBySize",			FALSE, "[NOT USED]" );
	gSavedSettings.declareF32("RenderTerrainScale",			12.f, "Terrain detail texture scale");
	gSavedSettings.declareBOOL("VertexShaderEnable",		FALSE, "Enable/disable all GLSL shaders (debug)");
	gSavedSettings.declareBOOL("RenderInitError",			FALSE, "Error occured while initializing GL");
	
	gSavedSettings.declareBOOL("RenderWaterMipNormal", TRUE, "Use mip maps for water normal map.");
	gSavedSettings.declareBOOL("RenderDynamicReflections",	FALSE, "Generate a dynamic cube map for reflections (objects reflect their environment, experimental).");
	gSavedSettings.declareBOOL("RenderWaterReflections",	FALSE, "Reflect the environment in the water.");
	gSavedSettings.declareS32("RenderReflectionDetail",		2, "Detail of reflection render pass.");
	gSavedSettings.declareBOOL("RenderGammaFull",			TRUE, "Use fully controllable gamma correction, instead of faster, hard-coded gamma correction of 2.");

	gSavedSettings.declareBOOL("RenderGlow",				TRUE, "Render bloom post effect.");
	gSavedSettings.declareF32("RenderGlowStrength",			0.35f, "Additive strength of glow");
	gSavedSettings.declareF32("RenderGlowWidth",			1.3f, "Glow sample size (higher = wider and softer but eventually more pixelated");
	gSavedSettings.declareS32("RenderGlowIterations",		2, "Number of times to iterate the glow (higher = wider and smoother but slower)");
	gSavedSettings.declareS32("RenderGlowResolutionPow",	9, "Glow map resolution power of two.");
	gSavedSettings.declareF32("RenderGlowMinLuminance",		1.0f, "Min luminance intensity necessary to consider an object bright enough to automatically glow. (Gets clamped to 0 - 1.0 range)");
	gSavedSettings.declareF32("RenderGlowMaxExtractAlpha",	0.065f, "Max glow alpha value for brightness extraction to auto-glow.");
	
	gSavedSettings.declareVec3("RenderGlowLumWeights",		LLVector3(0.299f, 0.587f, 0.114f), "Weights for each color channel to be used in calculating luminance (should add up to 1.0)");
	
	gSavedSettings.declareVec3("RenderGlowWarmthWeights",	LLVector3(1.0f, 0.5f, 0.7f), "Weight of each color channel used before finding the max warmth");
	
	gSavedSettings.declareF32("RenderGlowWarmthAmount",		0.f, "Amount of warmth extraction to use (versus luminance extraction). 0 = lum, 1.0 = warmth");

	gSavedSettings.declareS32("RenderWaterRefResolution",	512, "Water planar reflection resolution.");
	gSavedSettings.declareBOOL("RenderObjectBump",			TRUE, "Show bumpmapping on primitives");
	gSavedSettings.declareBOOL("RenderAvatarCloth",			1, "Controls if avatars use wavy cloth");
	gSavedSettings.declareBOOL("RenderAvatarVP",			TRUE, "Use vertex programs to perform hardware skinning of avatar");
	gSavedSettings.declareS32("RenderAvatarMaxVisible",		35, "Maximum number of avatars to display at any one time");
	//gSavedSettings.declareBOOL("RenderForceGetTexImage",	FALSE, "[NOT USED]");
	gSavedSettings.declareBOOL("RenderFastUI",				FALSE, "[NOT USED]");	
	gSavedSettings.declareS32("DebugBeaconLineWidth", 1, "Size of lines for Debug Beacons");

	gSavedSettings.declareBOOL("RenderCustomSettings", 0, "Do you want to set the graphics settings yourself");
	gSavedSettings.declareU32("RenderQualityPerformance", 1, "Which graphics settings you've chosen");

	gSavedSettings.declareBOOL("RenderUseShaderLOD",	TRUE, "Whether we want to have different shaders for LOD" );	
	gSavedSettings.declareF32("RenderShaderLODThreshold", 1.0f, "Fraction of draw distance defining the switch to a different shader LOD");
	gSavedSettings.declareBOOL("RenderUseShaderNearParticles",	FALSE, "Whether we want to use shaders on near particles" );
	gSavedSettings.declareF32("RenderShaderParticleThreshold", 0.25f, "Fraction of draw distance to not use shader on particles");
	gSavedSettings.declareBOOL("RenderUseFBO", FALSE, "Whether we want to use GL_EXT_framebuffer_objects.");
	gSavedSettings.declareBOOL("RenderUseImpostors", TRUE, "Whether we want to use impostors for far away avatars.");
	gSavedSettings.declareBOOL("RenderAppleUseMultGL", FALSE, "Whether we want to use multi-threaded OpenGL on Apple hardware (requires restart of SL).");
	gSavedSettings.declareF32("RenderSunDynamicRange", 1.0f, "Defines what percent brighter the sun is than local point lights (1.0 = 100% brighter. Value should not be less than 0. ).");
	gSavedSettings.declareBOOL("RenderUseCleverUI", FALSE, "Turns on the \"clever\" UI rendering optimization.  It's a known performace gain (and enabled by default) on apple.");

	//debug render stuff
	gSavedSettings.declareBOOL("RenderDebugTextureBind", FALSE, "Enable texture bind performance test.");

	// Snapshot params
	gSavedSettings.declareBOOL("RenderUIInSnapshot",		FALSE, "Display user interface in snapshot" );
	gSavedSettings.declareBOOL("RenderHUDInSnapshot",		FALSE, "Display HUD attachments in snapshot" );
	gSavedSettings.declareBOOL("HighResSnapshot",			FALSE, "Double resolution of snapshot from current window resolution" );
	gSavedSettings.declareBOOL("CompressSnapshotsToDisk",	FALSE, "Compress snapshots saved to disk (Using JPEG 2000)" );
	gSavedSettings.declareBOOL("FreezeTime",				FALSE, "", FALSE );
	gSavedSettings.declareBOOL("UseFreezeFrame",			FALSE, "Freeze time when taking snapshots.");
	gSavedSettings.declareBOOL("CloseSnapshotOnKeep",		TRUE, "Close snapshot window after saving snapshot" );
	gSavedSettings.declareBOOL("KeepAspectForSnapshot",		TRUE, "Use full window when taking snapshot, regardless of requested image size" );
	gSavedSettings.declareBOOL("AutoSnapshot",				FALSE, "Update snapshot when camera stops moving, or any parameter changes" );
	gSavedSettings.declareBOOL("AdvanceSnapshot",		    FALSE, "Display advanced parameter settings in snaphot interface" );
	gSavedSettings.declareS32("LastSnapshotType",			0, "Select this as next type of snapshot to take (0 = postcard, 1 = texture, 2 = local image)" );
	gSavedSettings.declareS32("LastSnapshotWidth",			1024, "The width of the last snapshot, in px" );
	gSavedSettings.declareS32("LastSnapshotHeight",			768, "The height of the last snapshot, in px" );
	
	gSavedSettings.declareS32("SnapshotPostcardLastResolution",	0, "Take next postcard snapshot at this resolution" );
	gSavedSettings.declareS32("SnapshotTextureLastResolution",	0, "Take next texture snapshot at this resolution" );
	gSavedSettings.declareS32("SnapshotLocalLastResolution",	0, "Take next local snapshot at this resolution" );
	gSavedSettings.declareS32("SnapshotQuality",			75, "Quality setting of postcard JPEGs (0 = worst, 100 = best)" );

	gSavedSettings.declareBOOL("DisableVerticalSync",		TRUE, "Update frames as fast as possible (FALSE = update frames between display scans)" );

	// Statistics stuff
	gSavedSettings.declareBOOL("StatsAutoRun", FALSE, "Play back autopilot");
	gSavedSettings.declareS32("StatsNumRuns", -1, "Loop autopilot playback this number of times");
	//gSavedSettings.declareBOOL("StatsContinuousLoop", FALSE, "[NOT USED]");
	gSavedSettings.declareBOOL("StatsQuitAfterRuns", FALSE, "Quit application after this number of autopilot playback runs");
	gSavedSettings.declareBOOL("StatsSessionTrackFrameStats", FALSE, "Track rendering and network statistics");
	gSavedSettings.declareString("StatsPilotFile", "pilot.txt", "Filename for stats logging autopilot path");
	gSavedSettings.declareString("StatsSummaryFile", "fss.txt", "Filename for stats logging summary");
	gSavedSettings.declareString("StatsFile", "fs.txt", "Filename for stats logging output");

	// Image pipeline stuff
	gSavedSettings.declareS32("TextureMemory", 0, "Amount of memory to use for textures in MB (0 = autodetect)"); // default to auto-detect
	//gSavedSettings.declareS32("ImageRadioTexMem", 0, "Texture memory allocation (0 = <512 megabytes system RAM, 1 = >512 megabytes system RAM)");
	//gSavedSettings.declareS32("ImageRadioVidCardMem", 1, "Video card onboard memory (0 = 16MB, 1 = 32MB, 2 = 64MB, 3 = 128MB, 4 = 256MB, 5 = 512MB)");
	//gSavedSettings.declareU32("LastRAMDetected", 0, "[DO NOT MODIFY] Detected system memory (bytes)");  // used to detect RAM changes
	gSavedSettings.declareBOOL("ImagePipelineUseHTTP", FALSE, "If TRUE use HTTP GET to fetch textures from the server");

	// Image compression
	gSavedSettings.declareBOOL("LosslessJ2CUpload", FALSE, "Use lossless compression for small image uploads");
	
	// Threading
	gSavedSettings.declareBOOL("RunMultipleThreads", FALSE, "If TRUE keep background threads active during render");

	// Cooperative Multitasking
	gSavedSettings.declareS32("BackgroundYieldTime", 40, "Amount of time to yield every frame to other applications when SL is not the foreground window (milliseconds)");

	// Camera control
	gSavedSettings.declareBOOL("AutoPilotLocksCamera", FALSE, "Keep camera position locked when avatar walks to selected position");
	//gSavedSettings.declareBOOL("AvatarLooksAtCamera", TRUE, "[NOT USED]");
	//gSavedSettings.declareF32("FlyHeightOffGround",		1.f, "[NOT USED]");
	gSavedSettings.declareF32("DynamicCameraStrength", 2.f, "Amount camera lags behind avatar motion (0 = none, 30 = avatar velocity)");

	gSavedSettings.declareVec3("CameraOffsetBuild",		LLVector3(-6.0f,  0,  6.0f), "Default camera position relative to focus point when entering build mode");
	gSavedSettings.declareVec3("CameraOffsetDefault",	LLVector3(-3.0f,  0,  0.75f), "Default camera offset from avatar");
	//gSavedSettings.declareVec3("CameraOffsetDefault",	LLVector3(-3.0f,  0,  1.5f));

	//gSavedSettings.declareVec3("FocusOffsetBuild",		LLVector3(4,  0,  0), "[NOT USED]");
	gSavedSettings.declareVec3("FocusOffsetDefault",	LLVector3(1,  0,  1), "Default focus point offset relative to avatar (x-axis is forward)");
	gSavedSettings.declareBOOL("TrackFocusObject", TRUE, "Camera tracks last object zoomed on");
	gSavedSettings.declareBOOL("CameraMouseWheelZoom", TRUE, "Camera zooms in and out with mousewheel");

	gSavedSettings.declareVec3d("FocusPosOnLogout",		LLVector3d(0,  0,  0), "Camera focus point when last logged out (global coordinates)");
	gSavedSettings.declareVec3d("CameraPosOnLogout",	LLVector3d(0,  0,  0), "Camera position when last logged out (global coordinates)");

	// Terrain coloring
	// JC 8/28/2002 - Adjusted to make the beta farm look good, with
	// 20 meter water height.  Talk with me before changing these.
	gSavedSettings.declareF32("TerrainColorStartHeight", 20.f, "Starting altitude for terrain texturing (meters)"); // -1 to 1
	gSavedSettings.declareF32("TerrainColorHeightRange", 60.f, "Altitude range over which a given terrain texture has effect (meters)");	// max land height

	// Avatar stuff
	gSavedSettings.declareF32("PitchFromMousePosition", 90.f, "Vertical range over which avatar head tracks mouse position (degrees of head rotation from top of window to bottom)");
	gSavedSettings.declareF32("YawFromMousePosition", 90.f, "Horizontal range over which avatar head tracks mouse position (degrees of head rotation from left of window to right)");
	gSavedSettings.declareF32("ZoomTime", 0.4f, "Time of transition between different camera modes (seconds)");
	gSavedSettings.declareS32("AvatarCompositeLimit", 5, "Maximum number of avatars to display appearance changes on the fly");

	// Default throttle
	// These must also be changed in llviewerthrottle.h
	// Currently matches BW_PRESET_300
	gSavedSettings.declareF32("ThrottleBandwidthKBPS", 500.f, "Maximum allowable downstream bandwidth (kilo bits per second)");

	gSavedSettings.declareBOOL("ConnectionPortEnabled", FALSE, "Use the custom connection port?");
	gSavedSettings.declareU32("ConnectionPort", 13000, "Custom connection port number");

	// File xfer throttle
	gSavedSettings.declareF32("XferThrottle", 150000.f, "Maximum allowable downstream bandwidth for asset transfers (bits per second)");

	//gSavedSettings.declareS32("BWRadio", 0, "[NOT USED]");

	gSavedSettings.declareRect("ChatterboxRect", LLRect(0, 400, 350, 0), "Rectangle for chatterbox window");
	gSavedSettings.declareRect("FloaterActiveSpeakersRect", LLRect(0, 300, 250, 0), "Rectangle for active speakers window");

	// Avatar customizing floaters
	gSavedSettings.declareRect("FloaterCustomizeAppearanceRect", LLRect(0, 540, 494, 0), "Rectangle for avatar customization window");

	// Build options floater
	gSavedSettings.declareRect("FloaterBuildOptionsRect", LLRect(0,0,0,0), "Rectangle for build options window.");
	
	gSavedSettings.declareRect("FloaterJoystickRect", LLRect(0,0,0,0), "Rectangle for joystick controls window.");

	// Map floater
	gSavedSettings.declareRect("FloaterMiniMapRect", LLRect(0, 225, 200, 0), "Rectangle for world map");

	//Lag-o-Meter floater
	gSavedSettings.declareRect("FloaterLagMeter", LLRect(0, 142, 350, 0), "Rectangle for lag meter");
	gSavedSettings.declareBOOL("LagMeterShrunk", FALSE, "Last large/small state for lag meter");

	gSavedSettings.declareF32("MapScale", 128.f, "World map zoom level (pixels per region)");

	gSavedSettings.declareF32("MiniMapScale", 128.f, "Miniature world map zoom levle (pixels per region)");

	gSavedSettings.declareBOOL("MiniMapRotate",	TRUE, "Rotate miniature world map to avatar direction");

	gSavedSettings.declareString("UIImgBtnPanUpOutUUID",	"47a8c844-cd2a-4b1a-be01-df8b1612fe5d", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnPanUpInUUID",		"e5821134-23c0-4bd0-af06-7fa95b9fb01a", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnPanDownOutUUID",	"47a8c844-cd2a-4b1a-be01-df8b1612fe5d", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnPanDownInUUID",	"e5821134-23c0-4bd0-af06-7fa95b9fb01a", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnPanLeftOutUUID",	"47a8c844-cd2a-4b1a-be01-df8b1612fe5d", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnPanLeftInUUID",	"e5821134-23c0-4bd0-af06-7fa95b9fb01a", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnPanRightOutUUID",	"47a8c844-cd2a-4b1a-be01-df8b1612fe5d", "", NO_PERSIST);
	gSavedSettings.declareString("UIImgBtnPanRightInUUID",	"e5821134-23c0-4bd0-af06-7fa95b9fb01a", "", NO_PERSIST);

	// Talk panel
	gSavedSettings.declareRect("FloaterIMRect",				LLRect(0, 10*16, 500, 0), "Rectangle for IM window");

	// Chat floater
	// Rectangle should almost fill the bottom of the screen on 800x600
	// Note that the saved rect size is the size with history shown.
	gSavedSettings.declareRect("FloaterChatRect",			LLRect( 0, 10*16 + 12, 500, 0 ), "Rectangle for chat history");
	gSavedSettings.declareRect("FloaterContactsRect",		LLRect( 0, 390, 395, 0 ), "Rectangle for chat history");
	gSavedSettings.declareRect("FloaterMuteRect3",			LLRect( 0, 300, 300, 0), "Rectangle for mute window");
	gSavedPerAccountSettings.declareString("BusyModeResponse",		"The Resident you messaged is in 'busy mode' which means they have requested not to be disturbed.  Your message will still be shown in their IM panel for later viewing.", "Auto response to instant messages while in busy mode.");
	gSavedPerAccountSettings.declareString("InstantMessageLogPath",	"", "Path to your log files.");
	gSavedPerAccountSettings.declareBOOL("LogInstantMessages",	FALSE, "Log Instant Messages");
	gSavedPerAccountSettings.declareBOOL("LogChat",	FALSE, "Log Chat");
	gSavedPerAccountSettings.declareBOOL("LogShowHistory",	FALSE, "Log Show History");
	gSavedPerAccountSettings.declareBOOL("IMLogTimestamp",	FALSE, "Log Timestamp of Instant Messages");
	gSavedPerAccountSettings.declareBOOL("LogChatTimestamp",	FALSE, "Log Timestamp of Chat");
	gSavedPerAccountSettings.declareBOOL("LogChatIM",	FALSE, "Log Incoming Instant Messages with Chat");
	gSavedPerAccountSettings.declareBOOL("LogTimestampDate",	FALSE, "Include Date with Timestamp");

	// Inventory
	gSavedSettings.declareRect("FloaterInventoryRect", LLRect(0, 400, 300, 0), "Rectangle for inventory window" );

	// properties, only width and height is used.
	gSavedSettings.declareRect("PropertiesRect", LLRect(0, 320, 350, 0), "Rectangle for inventory item properties window");

	// Previews - only width and height are used
	gSavedSettings.declareRect("PreviewTextureRect",			LLRect(0, 400, 400, 0), "Rectangle for texture preview window" );  // Only width and height are used
	gSavedSettings.declareRect("PreviewScriptRect",				LLRect(0, 550, 500, 0), "Rectangle for script preview window" );  // Only width and height are used
	gSavedSettings.declareRect("LSLHelpRect",					LLRect(0, 400, 400, 0), "Rectangle for LSL help window" );  // Only width and height are used
	gSavedSettings.declareRect("PreviewLandmarkRect",			LLRect(0,  90, 300, 0), "Rectangle for landmark preview window" );  // Only width and height are used
	gSavedSettings.declareRect("PreviewURLRect",				LLRect(0,  90, 300, 0), "Rectangle for URL preview window" );  // Only width and height are used
	gSavedSettings.declareRect("PreviewEventRect",				LLRect(0, 530, 420, 0), "Rectangle for Event preview window" );  // Only width and height are used
	gSavedSettings.declareRect("PreviewClassifiedRect",			LLRect(0, 530, 420, 0), "Rectangle for URL preview window" );  // Only width and height are used
	gSavedSettings.declareRect("PreviewSoundRect",				LLRect(0,  85, 300, 0), "Rectangle for sound preview window" );  // Only width and height are used
	gSavedSettings.declareRect("PreviewObjectRect",				LLRect(0,  85, 300, 0), "Rectangle for object preview window" );  // Only width and height are used
	gSavedSettings.declareRect("PreviewWearableRect",			LLRect(0,  85, 300, 0), "Rectangle for wearable preview window" );  // Only width and height are used
	gSavedSettings.declareRect("PreviewAnimRect",				LLRect(0,  85, 300, 0), "Rectangle for animation preview window" );  // Only width and height are used
	// permissions manager
	gSavedSettings.declareRect("PermissionsManagerRect",		LLRect(0,  85, 300, 0), "Rectangle for permissions manager window" );  // Only width and height are used

	// Land floater - force to top left
	//gSavedSettings.declareRect("FloaterLandRect3", LLRect(0, 370, 340, 0));
	//gSavedSettings.declareRect("FloaterLandRect4", LLRect(0, 370, 400, 0), "Rectangle for About Land window"); // deprecated
	gSavedSettings.declareRect("FloaterLandRect5", LLRect(0, 370, 460, 0), "Rectangle for About Land window");

	// Texture Picker
	gSavedSettings.declareRect("TexturePickerRect",				LLRect(0, 290, 350, 0), "Rectangle for texture picker" );  // Only width and height are used
	gSavedSettings.declareBOOL("TexturePickerShowFolders", TRUE, "Show folders with no texures in texture picker");

	gSavedSettings.declareRect("FloaterGestureRect", LLRect(0, 480, 320, 0), "Rectangle for gestures window");
	gSavedSettings.declareRect("FloaterClothingRect", LLRect(0, 480, 320, 0), "Rectangle for clothing window");
	gSavedSettings.declareBOOL("ClothingBtnState", FALSE, "", NO_PERSIST);
	gSavedSettings.declareRect("FloaterHTMLRect", LLRect(0, 500, 700, 0), "Rectangle for HTML window");

	gSavedSettings.declareRect("FloaterRegionInfo", LLRect(0, 512, 480, 0), "Rectangle for region info window");

	// Landmark Picker
	gSavedSettings.declareRect("FloaterLandmarkRect", LLRect(0, 290, 310, 0), "Rectangle for landmark picker" );  // Only width and height are used

	// editors
	// Only width and height are used
	gSavedSettings.declareRect("NotecardEditorRect", LLRect(0, 400, 400, 0), "Rectangle for notecard editor");

	// recompile everything dialog
	gSavedSettings.declareRect("CompileOutputRect", LLRect(0, 400, 300, 0), "Rectangle for script Recompile Everything output window");

	// L$
	gSavedSettings.declareRect("FloaterPayRectB", LLRect(0, 150, 400, 0), "Rectangle for pay window");

	// Buy
	gSavedSettings.declareRect("FloaterBuyRect", LLRect(0, 250, 300, 0), "Rectangle for buy window");

	// Buy Contents
	gSavedSettings.declareRect("FloaterBuyContentsRect", LLRect(0, 250, 300, 0), "Rectangle for Buy Contents window");

	// Open Contents
	gSavedSettings.declareRect("FloaterOpenObjectRect", LLRect(0, 350, 300, 0), "Rectangle for Open Object window");

	// the about box
	gSavedSettings.declareRect("FloaterMediaRect", LLRect(0, 400, 400, 0), "Rectangle for media browser window");

	// the about box
	gSavedSettings.declareRect("FloaterAboutRect", LLRect(0, 440, 470, 0), "Rectangle for About window");

	// the mean box
	gSavedSettings.declareRect("FloaterBumpRect", LLRect(0, 180, 400, 0), "Rectangle for Bumps/Hits window");

	// the inspect box
	gSavedSettings.declareRect("FloaterInspectRect", LLRect(0, 400, 400, 0), "Rectangle for Object Inspect window");

	// World map.  If 0,0,0,0, will attempt to size to 80% of fullscreen.
	gSavedSettings.declareRect("FloaterWorldMapRect2",
								LLRect(0,0,0,0), "Rectangle for world map window");

	// Find dialog.
	gSavedSettings.declareRect("FloaterFindRect2", LLRect(0, 570, 780, 0), "Rectangle for Find window");

	// Talk To dialog, force to top of screen
	//gSavedSettings.declareRect("FloaterTalkToRect", LLRect(0, 130, 330, 0), "[NOT USED]");
	// Script error/debug dialog, force to top of screen
	gSavedSettings.declareRect("FloaterScriptDebugRect", LLRect(0, 130, 450, 0), "Rectangle for Script Error/Debug window");

	// HUD Console
	gSavedSettings.declareS32("ConsoleBufferSize",	40, "Size of chat console history (lines of chat)");

	//gSavedSettings.declareString("UIImgCompassTextureUUID",		"79156764-de98-4815-9d50-b10a7646bcf4", "[NOT USED]");

	// Script Panel
	//gSavedSettings.declareRect("ScriptPanelRect",  LLRect(250,  175 + 400,  250 + 400, 175), "[NOT USED]");

	// volume floater
	gSavedSettings.declareRect("FloaterAudioVolumeRect", LLRect(0, 440, 470, 0), "Rectangle for Audio Volume window");
	
	// Radio button sets
	gSavedSettings.declareU32("AvatarSex", 0, "", NO_PERSIST);

	// Radio button sets
	gSavedSettings.declareS32("RadioLandBrushAction", 0, "Last selected land modification operation (0 = flatten, 1 = raise, 2 = lower, 3 = smooth, 4 = roughen, 5 = revert)");
	gSavedSettings.declareS32("RadioLandBrushSize", 0, "Size of land modification brush (0 = small, 1 = medium, 2 = large)");

	// Build Options Panel
	gSavedSettings.declareBOOL("SnapEnabled", TRUE, "Enable snapping to grid");
	gSavedSettings.declareBOOL("SnapToMouseCursor", FALSE, "When snapping to grid, center object on nearest grid point to mouse cursor");
	gSavedSettings.declareF32 ("GridResolution", 0.5f, "Size of single grid step (meters)");
	gSavedSettings.declareF32 ("GridDrawSize", 12.0f, "Visible extent of 2D snap grid (meters)");
	gSavedSettings.declareBOOL("GridSubUnit", FALSE, "Display fractional grid steps, relative to grid size");
	gSavedSettings.declareF32("GridOpacity", 0.7f, "Grid line opacity (0.0 = completely transparent, 1.0 = completely opaque)");
	gSavedSettings.declareBOOL("GridCrossSections", FALSE, "Highlight cross sections of prims with grid manipulation plane.");
	
	gSavedSettings.declareS32("GridMode", 0, "Snap grid reference frame (0 = world, 1 = local, 2 = reference object)");
	//gSavedSettings.declareBOOL("GridIsLocal", FALSE, "[NOT USED]");
	gSavedSettings.declareS32("GridSubdivision", 32, "Maximum number of times to divide single snap grid unit when GridSubUnit is true");
	gSavedSettings.declareF32 ("RotationStep", 1.0f, "All rotations via rotation tool are constrained to multiples of this unit (degrees)");

	// Saved state for window
	gSavedSettings.declareBOOL("WindowMaximized", TRUE, "SL viewer window maximized on login");
	gSavedSettings.declareS32("WindowHeight", WINDOW_HEIGHT, "SL viewer window height");
	gSavedSettings.declareS32("WindowWidth", WINDOW_WIDTH, "SL viewer window width");
	gSavedSettings.declareS32("WindowX", 10, "X coordinate of lower left corner of SL viewer window, relative to primary display (pixels)");
	gSavedSettings.declareS32("WindowY", 10, "Y coordinate of lower left corner of SL viewer window, relative to primary display (pixels)");

	// Fullscreen menu options
	gSavedSettings.declareBOOL("FullScreen", FALSE, "Run SL in fullscreen mode");
//#if LL_DARWIN
//	gSavedSettings.declareBOOL("FullScreen", FALSE);
//#else
//	gSavedSettings.declareBOOL("FullScreen", TRUE);
//#endif

	// Fullscreen actual settings
	gSavedSettings.declareS32("FullScreenWidth", 1024, "Fullscreen resolution in width");
	gSavedSettings.declareS32("FullScreenHeight", 768, "Fullscreen resolution in height");
	gSavedSettings.declareF32("FullScreenAspectRatio", 1.3333f, "Aspect ratio of fullscreen display (width / height)");
	gSavedSettings.declareBOOL("FullScreenAutoDetectAspectRatio", TRUE, "Automatically detect proper aspect ratio for fullscreen display");
	
	//resolution divisor
	gSavedSettings.declareU32("RenderResolutionDivisor", 1, "Divisor for rendering 3D scene at reduced resolution.");

	// UI general settigns
	gSavedSettings.declareBOOL("TabToTextFieldsOnly", FALSE, "TAB key takes you to next text entry field, instead of next widget");
	gSavedSettings.declareF32("UIScaleFactor", 1.f, "Size of UI relative to default layout on 1024x768 screen");
	gSavedSettings.declareBOOL("UIAutoScale", TRUE, "Keep UI scale consistent across different resolutions");
	
	// Login
	gSavedSettings.declareString("FirstName", "", "Login first name");
	gSavedSettings.declareString("LastName", "", "Login last name");
    gSavedPerAccountSettings.declareU32("LastLogoff", 0, "Last logoff");

	// Legacy password storage.  Now stored in separate file.
	gSavedSettings.declareString("Marker", "", "[NOT USED]");

	gSavedSettings.declareBOOL("RememberPassword", TRUE, "Keep password (in encrypted form) for next login");
	gSavedSettings.declareBOOL("LoginLastLocation", TRUE, "Login at same location you last logged out");
	gSavedSettings.declareBOOL("ShowStartLocation", FALSE, "Display starting location menu on login screen");
	gSavedSettings.declareBOOL("FlyingAtExit", FALSE, "Was flying when last logged out, so fly when logging in");
	gSavedSettings.declareBOOL("ForceShowGrid", FALSE, "Always show grid dropdown on login screen");

//	gSavedSettings.declareString("AvatarTexture", "be20de2d-7812-4e0e-80f2-33aadf185a9f");
	gSavedSettings.declareU32("RegionTextureSize", 256, "Terrain texture dimensions (power of 2)");

	// Selection option
	gSavedSettings.declareBOOL("EditLinkedParts", FALSE, "Select individual parts of linked objects", NO_PERSIST);

	// Selection beam
	gSavedSettings.declareBOOL("ShowSelectionBeam", TRUE, "Show selection particle beam when selecting or interacting with objects.");
	
	// Scale manipulator
	gSavedSettings.declareBOOL("ScaleUniform", FALSE, "Scale selected objects evenly about center of selection");
	gSavedSettings.declareBOOL("ScaleShowAxes", FALSE, "Show indicator of selected scale axis when scaling");
	gSavedSettings.declareBOOL("ScaleStretchTextures", TRUE, "Stretch textures along with object when scaling");

	//------------------------------------------------------------------------
	// Help viewer
	//------------------------------------------------------------------------
	gSavedSettings.declareString("HelpHomeURL", "help/index.html", "URL of initial help page");
	gSavedSettings.declareString("HelpLastVisitedURL", "help/index.html", "URL of last help page, will be shown next time help is accessed");

	// HTML dialog (general purpose)
	gSavedSettings.declareRect("HtmlFloaterRect", LLRect(100,460,370,100), "Rectangle for HTML Floater window");

	// HTML sim release message floater
	gSavedSettings.declareRect("HtmlReleaseMessage", LLRect(46,520,400,128), "Rectangle for HTML Release Message Floater window");
	
	
	// HTML help 
	gSavedSettings.declareString("HtmlHelpLastPage", "", "Last URL visited via help system");
	gSavedSettings.declareRect("HtmlHelpRect", LLRect(16,650,600,128), "Rectangle for HTML help window");
	gSavedSettings.declareRect("HtmlFindRect", LLRect(16,650,600,128), "Rectangle for HTML find window");

	// Audio
	gSavedSettings.declareBOOL("ShowVolumeSettingsPopup", FALSE, "Show individual volume slider for voice, sound effects, etc");
	gSavedSettings.declareF32("AudioLevelMaster", 1.0f, "Master audio level, or overall volume");
	gSavedSettings.declareF32("AudioLevelSFX", 	  1.0f, "Audio level of in-world sound effects");
	gSavedSettings.declareF32("AudioLevelAmbient",0.5f, "Audio level of environment sounds");
	gSavedSettings.declareF32("AudioLevelUI", 	 0.5f, "Audio level of UI sound effects");
	gSavedSettings.declareF32("AudioLevelMusic", 1.0f, "Audio level of streaming music");
	gSavedSettings.declareF32("AudioLevelVoice", 0.5f, "Audio level of voice chat");
	gSavedSettings.declareF32("AudioLevelMedia", 1.0f, "Audio level of Quicktime movies");
	gSavedSettings.declareF32("AudioLevelMic", 1.0f, "Audio level of microphone input");

// 	gSavedSettings.declareF32("MediaAudioVolume", 1.0f, "Audio level of Quicktime movies"); // removed

	gSavedSettings.declareF32("AudioLevelDistance", 1.0f, "Scale factor for audio engine (multiple of world scale, 2.0 = audio falls off twice as fast)");
	gSavedSettings.declareF32("AudioLevelDoppler", 1.0f, "Scale of doppler effect on moving audio sources (1.0 = normal, <1.0 = diminished doppler effect, >1.0 = enhanced doppler effect)");
	gSavedSettings.declareF32("AudioLevelRolloff", 1.0f, "Controls the distance-based dropoff of audio volume (fraction or multiple of default audio rolloff)");

	gSavedSettings.declareBOOL("AudioStreamingMusic", FALSE, "Enable streaming audio");
	gSavedSettings.declareBOOL("AudioStreamingVideo", FALSE, "Enable streaming video");
	gSavedSettings.declareBOOL("AutoMimeDiscovery", FALSE, "Enable viewer mime type discovery of media URLs");

	// Media
	gSavedSettings.declareBOOL("ParcelMediaAutoPlayEnable", FALSE, "Auto play parcel media when available");

	//UI Sounds

	gSavedSettings.declareBOOL("UISndDebugSpamToggle", FALSE, "Log UI sound effects as they are played");

	gSavedSettings.declareF32("UISndHealthReductionThreshold", 10.f, "Amount of health reduction required to trigger \"pain\" sound");
	gSavedSettings.declareF32("UISndMoneyChangeThreshold", 50.f, "Amount of change in L$ balance required to trigger \"money\" sound");

	gSavedSettings.declareString("UISndAlert",		        "ed124764-705d-d497-167a-182cd9fa2e6c", "Sound file for alerts (uuid for sound asset)");
	//gSavedSettings.declareString("UISndAppearanceAnimate",	"6cf2be26-90cb-2669-a599-f5ab7698225f", "[NOT USED]");
	gSavedSettings.declareString("UISndBadKeystroke",       "2ca849ba-2885-4bc3-90ef-d4987a5b983a", "Sound file for invalid keystroke (uuid for sound asset)");
	//gSavedSettings.declareString("UISndChatFromObject", 	"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	gSavedSettings.declareString("UISndClick",		        "4c8c3c77-de8d-bde2-b9b8-32635e0fd4a6", "Sound file for mouse click (uuid for sound asset)");
	gSavedSettings.declareString("UISndClickRelease",       "4c8c3c77-de8d-bde2-b9b8-32635e0fd4a6", "Sound file for mouse button release (uuid for sound asset)");
//	gSavedSettings.declareString("UISndError",		        "cb58f920-5b52-8a49-b81c-e532adbbe6f1", "Sound file for UI error (uuid for sound asset)");
	gSavedSettings.declareString("UISndHealthReductionF",   "219c5d93-6c09-31c5-fb3f-c5fe7495c115", "Sound file for female pain (uuid for sound asset)");
	gSavedSettings.declareString("UISndHealthReductionM",   "e057c244-5768-1056-c37e-1537454eeb62", "Sound file for male pain (uuid for sound asset)");
	//gSavedSettings.declareString("UISndIncomingChat",		"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	//gSavedSettings.declareString("UISndIncomingIM",		    "00000000-0000-0000-0000-000000000000", "[NOT USED]");
	//gSavedSettings.declareString("UISndInvApplyToObject", 	"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	gSavedSettings.declareString("UISndInvalidOp",	        "4174f859-0d3d-c517-c424-72923dc21f65", "Sound file for invalid operations (uuid for sound asset)");
	//gSavedSettings.declareString("UISndInventoryCopyToInv",	"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	gSavedSettings.declareString("UISndMoneyChangeDown",  	"104974e3-dfda-428b-99ee-b0d4e748d3a3", "Sound file for L$ balance increase (uuid for sound asset)");
	gSavedSettings.declareString("UISndMoneyChangeUp",  	"77a018af-098e-c037-51a6-178f05877c6f", "Sound file for L$ balance decrease(uuid for sound asset)");
	gSavedSettings.declareString("UISndNewIncomingIMSession",     "67cc2844-00f3-2b3c-b991-6418d01e1bb7", "Sound file for new instant message session(uuid for sound asset)");
	//gSavedSettings.declareString("UISndObjectCopyToInv",	"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	gSavedSettings.declareString("UISndObjectCreate",	  	"f4a0660f-5446-dea2-80b7-6482a082803c", "Sound file for object creation (uuid for sound asset)");
	gSavedSettings.declareString("UISndObjectDelete",	  	"0cb7b00a-4c10-6948-84de-a93c09af2ba9", "Sound file for object deletion (uuid for sound asset)");
	gSavedSettings.declareString("UISndObjectRezIn",	  	"3c8fc726-1fd6-862d-fa01-16c5b2568db6", "Sound file for rezzing objects (uuid for sound asset)");
	gSavedSettings.declareString("UISndObjectRezOut",	  	"00000000-0000-0000-0000-000000000000", "Sound file for derezzing objects (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuAppear",   	"8eaed61f-92ff-6485-de83-4dcc938a478e", "Sound file for opening pie menu (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuHide",   	    "00000000-0000-0000-0000-000000000000", "Sound file for closing pie menu (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuSliceHighlight0", 	"d9f73cf8-17b4-6f7a-1565-7951226c305d", "Sound file for selecting pie menu item 0 (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuSliceHighlight1", 	"f6ba9816-dcaf-f755-7b67-51b31b6233e5", "Sound file for selecting pie menu item 1 (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuSliceHighlight2", 	"7aff2265-d05b-8b72-63c7-dbf96dc2f21f", "Sound file for selecting pie menu item 2 (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuSliceHighlight3", 	"09b2184e-8601-44e2-afbb-ce37434b8ba1", "Sound file for selecting pie menu item 3 (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuSliceHighlight4", 	"bbe4c7fc-7044-b05e-7b89-36924a67593c", "Sound file for selecting pie menu item 4 (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuSliceHighlight5", 	"d166039b-b4f5-c2ec-4911-c85c727b016c", "Sound file for selecting pie menu item 5 (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuSliceHighlight6", 	"242af82b-43c2-9a3b-e108-3b0c7e384981", "Sound file for selecting pie menu item 6 (uuid for sound asset)");
	gSavedSettings.declareString("UISndPieMenuSliceHighlight7", 	"c1f334fb-a5be-8fe7-22b3-29631c21cf0b", "Sound file for selecting pie menu item 7 (uuid for sound asset)");
	gSavedSettings.declareString("UISndSnapshot",	  	    "3d09f582-3851-c0e0-f5ba-277ac5c73fb4", "Sound file for taking a snapshot (uuid for sound asset)");
	//gSavedSettings.declareString("UISndStartAutopilot", 	"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	//gSavedSettings.declareString("UISndStartFollowpilot", 	"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	gSavedSettings.declareString("UISndStartIM",		    "c825dfbc-9827-7e02-6507-3713d18916c1", "Sound file for starting a new IM session (uuid for sound asset)");
	//gSavedSettings.declareString("UISndStopAutopilot",   	"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	gSavedSettings.declareString("UISndTeleportOut", 		"d7a9a565-a013-2a69-797d-5332baa1a947", "Sound file for teleporting (uuid for sound asset)");
	//gSavedSettings.declareString("UISndTextureApplyToObject",	"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	//gSavedSettings.declareString("UISndTextureCopyToInv", 	"00000000-0000-0000-0000-000000000000", "[NOT USED]");
	gSavedSettings.declareString("UISndTyping", 	        "5e191c7b-8996-9ced-a177-b2ac32bfea06", "Sound file for starting to type a chat message (uuid for sound asset)");
//	gSavedSettings.declareString("UISndWarning",	        "449bc80c-91b6-6365-8fd1-95bd91016624", "Sound file for alerts (uuid for sound asset)");
	gSavedSettings.declareString("UISndWindowClose",  	    "2c346eda-b60c-ab33-1119-b8941916a499", "Sound file for closing a window (uuid for sound asset)");
	gSavedSettings.declareString("UISndWindowOpen",	  	    "c80260ba-41fd-8a46-768a-6bf236360e3a", "Sound file for opening a window (uuid for sound asset)");

	// Sky params
	gSavedSettings.declareBOOL("SkyOverrideSimSunPosition", FALSE, "", NO_PERSIST);
	gSavedSettings.declareVec3("SkySunDefaultPosition", LLVector3(1.f, 0.f, 0.1f), "Default position of sun in sky (direction in world coordinates)");
	gSavedSettings.declareF32("SkyAmbientScale", 0.3f, "Controls strength of ambient, or non-directional light from the sun and moon (fraction or multiple of default ambient level)");
	gSavedSettings.declareColor3("SkyNightColorShift", LLColor3(0.7f, 0.7f, 1.0f), "Controls moonlight color (base color applied to moon as light source)");
	gSavedSettings.declareBOOL("FixedWeather", FALSE, "Weather effects do not change over time");
	gSavedSettings.declareU32("WLSkyDetail", 64, "Controls vertex detail on the WindLight sky.  Lower numbers will give better performance and uglier skies.");
	gSavedSettings.declareBOOL("SkyUseClassicClouds", TRUE, "Whether to use the old Second Life particle clouds or not");
	gSavedSettings.declareBOOL("WindLightUseAtmosShaders", TRUE, "Whether to enable or disable WindLight atmospheric shaders.");
	gSavedSettings.declareBOOL("SkyEditPresets", FALSE, "Whether to be able to edit the sky defaults or not");

	// Water params
	gSavedSettings.declareF32("WaterGLFogDepthFloor", 0.25f, "Controls how dark water gl fog can get");
	gSavedSettings.declareF32("WaterGLFogDepthScale", 50.0f, "Controls how quickly gl fog gets dark under water");
	gSavedSettings.declareF32("WaterGLFogDensityScale", 0.02f, "Maps shader water fog density to gl fog density");
	gSavedSettings.declareBOOL("EnableRippleWater", TRUE, "Whether to use ripple water shader or not");
	gSavedSettings.declareBOOL("WaterEditPresets", FALSE, "Whether to be able to edit the water defaults or not");

	// Windlight window params
	gSavedSettings.declareRect("FloaterEnvRect", LLRect(50, 150, 650, 0), "Rectangle for Environment Editor" );
	gSavedSettings.declareRect("FloaterAdvancedSkyRect", LLRect(50, 220, 450, 0), "Rectangle for Advanced Sky Editor" );
	gSavedSettings.declareRect("FloaterDayCycleRect", LLRect(50, 450, 300, 0), "Rectangle for Day Cycle Editor" );
	gSavedSettings.declareRect("FloaterAdvancedWaterRect", LLRect(50, 220, 450, 0), "Rectangle for Advanced Water Editor" );

	// Tweaked draw distance default settings
	gSavedSettings.declareBOOL("Disregard128DefaultDrawDistance", TRUE, "Whether to use the auto default to 128 draw distance");
	gSavedSettings.declareBOOL("Disregard96DefaultDrawDistance", TRUE, "Whether to use the auto default to 96 draw distance");

	// Cache Stuff
	gSavedSettings.declareU32("VFSSalt", 1, "[DO NOT MODIFY] Controls local file caching behavior");
	gSavedSettings.declareU32("VFSOldSize", 0, "[DO NOT MODIFY] Controls resizing of local file cache");
// 	gSavedSettings.declareU32("VFSSize", 2, "Controls amount of hard drive space reserved for local file caching (0 = 50MB, 1 = 200MB, 2 = 500MB, 3 = 1000MB)");
 	gSavedSettings.declareU32("CacheSize", 500, "Controls amount of hard drive space reserved for local file caching in MB");
 	gSavedSettings.declareString("CacheLocation", "", "Controls the location of the local disk cache");
 	gSavedSettings.declareString("NewCacheLocation", "", "Change the location of the local disk cache to this");
 	gSavedSettings.declareU32("CacheValidateCounter", 0, "Used to distribute cache validation");
	// Delete all files in cache directory on startup
	gSavedSettings.declareBOOL("PurgeCacheOnStartup", FALSE, "Clear local file cache every time viewer is run");
	gSavedSettings.declareBOOL("PurgeCacheOnNextStartup", FALSE, "Clear local file cache next time viewer is run");

	// Used for special titles such as "Second Life - Special E3 2003 Beta"
	gSavedSettings.declareBOOL("ShowOverlayTitle", FALSE, "Prints watermark text message on screen");
	gSavedSettings.declareString("OverlayTitle", "Set_via_OverlayTitle_in_settings.xml", 
		"Controls watermark text message displayed on screen when \"ShowOverlayTitle\" is enabled (one word, underscores become spaces)");  // Must be one word, but underscores are replaced by spaces. Hah!

	// Secret debug stuff.
	gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "Turns on \"Debug\" menu");
	gSavedSettings.declareS32("ServerChoice", 0, "[DO NOT MODIFY] Controls which grid you connect to");
	gSavedSettings.declareString("CustomServer", "", "Specifies IP address or hostname of grid to which you connect");
	gSavedSettings.declareBOOL("UseDebugLogin", FALSE, "Provides extra control over which grid to connect to");

	// First run is true on the first startup of a given installation.
	// It is not related to whether your ACCOUNT has been logged in before.
	// Set to false if you reach the login screen.
	gSavedSettings.declareBOOL("FirstRunThisInstall", TRUE, "Specifies that you have not run the viewer since you installed the latest update");

	// Is this the first successful login for a given installation?
	// It is not related to whether your ACCOUNT has been logged in before.
	// Set to false if you successfully connect.
	gSavedSettings.declareBOOL("FirstLoginThisInstall", TRUE, "Specifies that you have not successfully logged in since you installed the latest update");

	// The last version that was run with this prefs file.  Default to a version that will never be current,
	// and update after the setting is used in the startup sequence.
	gSavedSettings.declareString("LastRunVersion", "0.0.0", "Version number of last instance of the viewer that you ran");
	// Local cache version (change if format changes)
	gSavedSettings.declareS32("LocalCacheVersion", 0, "Version number of cache");

	// cached mean collision values
	gSavedSettings.declareBOOL("MeanCollisionBump", FALSE, "You have experienced an abuse of being bumped by an object or avatar" );
	gSavedSettings.declareBOOL("MeanCollisionPushObject", FALSE, "You have experienced an abuse of being pushed by a scripted object");
	gSavedSettings.declareBOOL("MeanCollisionSelected", FALSE, "You have experienced an abuse of being pushed via a selected object");
	gSavedSettings.declareBOOL("MeanCollisionScripted", FALSE, "You have experienced an abuse from a scripted object");
	gSavedSettings.declareBOOL("MeanCollisionPhysical", FALSE, "You have experienced an abuse from a physical object");

	// Does left-click show menu, or only do grabbing?
	gSavedSettings.declareBOOL("LeftClickShowMenu", FALSE, "Left click opens pie menu (FALSE = left click touches or grabs object)");

	gSavedSettings.declareF32("MouseSensitivity", 3.f, "Controls responsiveness of mouse when in mouselook mode (fraction or multiple of default mouse sensitivity)");
	gSavedSettings.declareBOOL("MouseSmooth", FALSE, "Smooths out motion of mouse when in mouselook mode.");
	gSavedSettings.declareBOOL("InvertMouse", FALSE, "When in mouselook, moving mouse up looks down and vice verse (FALSE = moving up looks up)");

	gSavedSettings.declareBOOL("EditCameraMovement", FALSE, "When entering build mode, camera moves up above avatar");
	gSavedSettings.declareBOOL("AppearanceCameraMovement", TRUE, "When entering appearance editing mode, camera zooms in on currently selected portion of avatar");

	//gSavedSettings.declareBOOL("AltShowsPhysical", FALSE, "When ALT key is held down, physical objects are rendered in red.");
	gSavedSettings.declareBOOL("BeaconAlwaysOn", FALSE, "Beacons / highlighting always on");
	gSavedSettings.declareBOOL("scriptsbeacon", FALSE, "Beacon / Highlight scripted objects");
	gSavedSettings.declareBOOL("physicalbeacon", TRUE, "Beacon / Highlight physical objects");
	gSavedSettings.declareBOOL("soundsbeacon", FALSE, "Beacon / Highlight sound generators");
	gSavedSettings.declareBOOL("particlesbeacon", FALSE, "Beacon / Highlight particle generators");
	gSavedSettings.declareBOOL("scripttouchbeacon", TRUE, "Beacon / Highlight scripted objects with touch function");
	gSavedSettings.declareBOOL("renderbeacons", FALSE, "Beacon / Highlight particle generators");
	gSavedSettings.declareBOOL("renderhighlights", TRUE, "Beacon / Highlight scripted objects with touch function");

	gSavedSettings.declareBOOL("MuteAudio", FALSE, "All audio plays at 0 volume (streaming audio still takes up bandwidth, for example)");
	gSavedSettings.declareBOOL("MuteWhenMinimized", TRUE, "Mute audio when SL window is minimized");

	gSavedSettings.declareBOOL("MuteMusic", FALSE, "Music plays at 0 volume (streaming audio still takes up bandwidth)");
	gSavedSettings.declareBOOL("MuteMedia", FALSE, "Media plays at 0 volume (streaming audio still takes up bandwidth)");
	gSavedSettings.declareBOOL("MuteVoice", FALSE, "Voice plays at 0 volume (streaming audio still takes up bandwidth)");
	gSavedSettings.declareBOOL("MuteSounds", FALSE, "Sound effects play at 0 volume");
	gSavedSettings.declareBOOL("MuteAmbient", FALSE, "Ambient sound effects, such as wind noise, play at 0 volume");
	gSavedSettings.declareBOOL("MuteUI", FALSE, "UI sound effects play at 0 volume");

	gSavedSettings.declareS32("NotifyBoxWidth", 350, "Width of notification messages");
	gSavedSettings.declareS32("NotifyBoxHeight", 200, "Height of notification messages");

	gSavedSettings.declareS32("GroupNotifyBoxWidth", 400, "Width of group notice messages");
	gSavedSettings.declareS32("GroupNotifyBoxHeight", 260, "Height of group notice messages");

	// Time in seconds.
	gSavedSettings.declareF32("NotifyTipDuration", 4.f, "Length of time that notification tips stay on screen (seconds)");

	gSavedSettings.declareBOOL("NotifyMoneyChange", TRUE, "Pop up notifications for all L$ transactions");

	gSavedSettings.declareBOOL("ShowNewInventory", TRUE,
		"Automatically views new notecards/textures/landmarks");
	gSavedSettings.declareBOOL("AutoAcceptNewInventory", FALSE,
		"Automatically accept new notecards/textures/landmarks");

	// Bitfield
	// 1 = by date
	// 2 = folders always by name
	// 4 = system folders to top
	// This where the default first time user gets his settings.
	gSavedSettings.declareU32("InventorySortOrder", 1 | 2 | 4, "Specifies sort key for inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)");
	gSavedSettings.declareU32("RecentItemsSortOrder", 1, "Specifies sort key for recent inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)");
	gSavedSettings.declareU32("TexturePickerSortOrder", 2, "Specifies sort key for textures in texture picker (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)");
	gSavedSettings.declareU32("AvatarPickerSortOrder", 2, "Specifies sort key for textures in avatar picker (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top)");

	// Pixels away from edge that windows snap.
	gSavedSettings.declareS32("SnapMargin", 10, "Controls maximum distance between windows before they auto-snap together (pixels)");

	// Will be set on first run
	gSavedSettings.declareS32("FloaterViewBottom", -1, "[DO NOT MODIFY] Controls layout of floating windows within SL window");

	// Automatically fly when up key held down, and automatically stop
	// flying when landing on something.
	gSavedSettings.declareBOOL("AutomaticFly", TRUE, "Fly by holding jump key or using \"Fly\" command (FALSE = fly by using \"Fly\" command only)");

	// Index of the last find panel you opened.
	gSavedSettings.declareString("LastFindPanel", "find_all_panel", "Controls which find operation appears by default when clicking \"Find\" button ");

	// grab keystrokes at last possible moment to minimize latency
	gSavedSettings.declareBOOL("AsyncKeyboard", TRUE, "Improves responsiveness to keyboard input when at low framerates");

	// Numpad numbers move avatar even when numlock is off/you're using a Mac?
	gSavedSettings.declareS32("NumpadControl", 0, "How numpad keys control your avatar. 0 = Like the normal arrow keys, 1 = Numpad moves avatar when numlock is off, 2 = Numpad moves avatar regardless of numlock (use this if you have no numlock)");

	// 1.2.9: For transition from 1.2.8 to 1.2.9, need to ask people
	// this question regardless of number of executions.
	// 1.6.10: We're just defaulting crash reporting to on
	// 1.7.x: We ask at crash time, but leave this so when you flip back and
	// forth between 1.6 and 1.7 it doesn't ask you every time.
	gSavedSettings.declareBOOL("AskedAboutCrashReports", FALSE, "Turns off dialog asking if you want to enable crash reporting");

	// Default for the "Online" checkbox in Find -> People
	gSavedSettings.declareBOOL("FindPeopleOnline", TRUE, "Limits people search to only users who are logged on");

	// Default for checkboxes in Find -> Land
	//gSavedSettings.declareBOOL("FindLandForSale", TRUE);
	//gSavedSettings.declareBOOL("FindLandAuction", TRUE);

	// Default for Find -> Land combo box
	gSavedSettings.declareString("FindLandType", "All", "Controls which type of land you are searching for in Find Land interface (\"All\", \"Auction\", \"For Sale\")");

	gSavedSettings.declareBOOL("FindLandPrice", TRUE, "Enables filtering of land search results by price");
	gSavedSettings.declareBOOL("FindLandArea", FALSE, "Enables filtering of land search results by area");

	// Checkboxes in Find -> Popular
	// Should these all be the same?  I imagine we might want a single "show mature." - bbc
	gSavedSettings.declareBOOL("ShowMatureFindAll",FALSE, "Display results of find all that are in mature sims");
	gSavedSettings.declareBOOL("ShowMatureSims", FALSE, "Display results of find places or find popular that are in mature sims");
	gSavedSettings.declareBOOL("ShowMatureEvents", FALSE, "Display results of find events that are flagged as mature");
	gSavedSettings.declareBOOL("ShowMatureClassifieds", FALSE, "Display results of find classifieds that are flagged as mature");
	gSavedSettings.declareBOOL("ShowMatureGroups", TRUE, "Display results of find groups that are in flagged as mature");
	
	gSavedSettings.declareBOOL("FindPlacesPictures", TRUE, "Display only results of find places that have pictures");

	gSavedSettings.declareBOOL("MapShowEvents", TRUE, "Show events on world map");
	//gSavedSettings.declareBOOL("MapShowPicks", TRUE, "[NOT USED]");
	gSavedSettings.declareBOOL("MapShowPopular", TRUE, "Show popular places on world map");
	gSavedSettings.declareBOOL("MapShowLandForSale", FALSE, "Show land for sale on world map");
	gSavedSettings.declareBOOL("MapShowTelehubs", TRUE, "Show telehubs on world map");
	gSavedSettings.declareBOOL("MapShowPeople", TRUE, "Show other users on world map");
	gSavedSettings.declareBOOL("MapShowInfohubs", TRUE, "Show infohubs on the world map");
	gSavedSettings.declareBOOL("MapShowClassifieds", TRUE, "Show locations associated with classified ads on world map");

	// Search panel in directory uses this URL for queries
	gSavedSettings.declareString("SearchURLDefault",
		"http://secondlife.com/app/search/index.php?",
		"URL to load for empty searches");
	gSavedSettings.declareString("SearchURLQuery",
		"http://secondlife.com/app/search/search_proxy.php?q=[QUERY]&s=[COLLECTION]&",
		"URL to use for searches");
	// Version 2 added [SESSION], must invalidate old saved settings.
	gSavedSettings.declareString("SearchURLSuffix2",
		"lang=[LANG]&m=[MATURE]&t=[TEEN]&region=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION]",
		"Parameters added to end of search queries");

	// Hide/Show search bar
	gSavedSettings.declareBOOL("ShowSearchBar", TRUE, "Show the Search Bar in the Status Overlay");

	// Arrow keys move avatar while in chat?
	gSavedSettings.declareBOOL("ArrowKeysMoveAvatar", TRUE, "While cursor is in chat entry box, arrow keys still control your avatar");
	gSavedSettings.declareBOOL("ChatBarStealsFocus", TRUE, "Whenever keyboard focus is removed from the UI, and the chat bar is visible, the chat bar takes focus");

	// Show yellow selection fence in snapshots for auctions?
	gSavedSettings.declareBOOL("AuctionShowFence", TRUE, "When auctioning land, include parcel boundary marker in snapshot");

	// Use DX9 to probe hardware on startup.  Only do this once,
	// because it's slow.
	gSavedSettings.declareBOOL("ProbeHardwareOnStartup", TRUE, "Query current hardware configuration on application startup");
	
	// have we told the user his hardware sucks?  Let him know just once
	gSavedSettings.declareBOOL("AlertedUnsupportedHardware", FALSE, "Toggle that lets us tell the user he's on old hardware only once");

	// enable/disable system color picker
	gSavedSettings.declareBOOL("UseDefaultColorPicker", FALSE, "Use color picker supplied by operating system");
	gSavedSettings.declareF32("PickerContextOpacity", 0.35f, "Controls overall opacity of context frustrum connecting color and texture pickers with their swatches");

	gSavedSettings.declareF32("ColumnHeaderDropDownDelay", 0.3f, "Time in seconds of mouse click before column header shows sort options list");
	// support for avatar exporter
	//gSavedSettings.declareString("AvExportPath", "", "[NOT USED]");
	//gSavedSettings.declareString("AvExportBaseName", "", "[NOT USED]");

	// Show in-world hover tips for objects
	gSavedSettings.declareBOOL("ShowHoverTips", TRUE, "Show descriptive tooltip when mouse hovers over items in world");
	gSavedSettings.declareBOOL("ShowLandHoverTip", FALSE, "Show descriptive tooltip when mouse hovers over land");
	gSavedSettings.declareBOOL("ShowAllObjectHoverTip", FALSE, "Show descriptive tooltip when mouse hovers over non-interactive and interactive objects.");

	// Use an external web browser (Firefox, Internet Explorer)
	gSavedSettings.declareBOOL("UseExternalBrowser", FALSE, "Use default browser when opening web pages instead of in-world browser.");
	gSavedSettings.declareBOOL("CookiesEnabled", TRUE, "Accept cookies from Web sites?");

	// browser home page
	gSavedSettings.declareString("BrowserHomePage", "http://www.secondlife.com", "[NOT USED]");

	// browser proxy variables
	gSavedSettings.declareBOOL("BrowserProxyEnabled", FALSE, "Use Web Proxy");
	gSavedSettings.declareString("BrowserProxyAddress", "", "Address for the Web Proxy]");
	gSavedSettings.declareS32("BrowserProxyPort", 3128, "Port for Web Proxy");
	gSavedSettings.declareS32("BrowserProxySocks45", 5, "[NOT USED]");
	gSavedSettings.declareString("BrowserProxyExclusions", "", "[NOT USED]");

	// Allow user to completely disable web pages on prims
	gSavedSettings.declareBOOL("UseWebPagesOnPrims", FALSE, "[NOT USED]");

	// use object-object occlusion culling
	gSavedSettings.declareBOOL("UseOcclusion", TRUE, "Enable object culling based on occlusion (coverage) by other objects");
	gSavedSettings.declareBOOL("RenderFastAlpha", TRUE, "Use lossy alpha rendering optimization (opaque/nonexistent small alpha faces).");

	gSavedSettings.declareBOOL("DoubleClickAutoPilot", FALSE, "Enable double-click auto pilot");
	
	//cheesy beacon effects
	gSavedSettings.declareBOOL("CheesyBeacon", FALSE, "Enable cheesy beacon effects");

	//flycam controls and joystick mapping
	gSavedSettings.declareS32("FlycamAxis0", 0, "Flycam hardware axis mapping for internal axis 0 ([0, 5]).");
	gSavedSettings.declareS32("FlycamAxis1", 1, "Flycam hardware axis mapping for internal axis 1 ([0, 5]).");
	gSavedSettings.declareS32("FlycamAxis2", 2, "Flycam hardware axis mapping for internal axis 2 ([0, 5]).");
	gSavedSettings.declareS32("FlycamAxis3", 3, "Flycam hardware axis mapping for internal axis 3 ([0, 5]).");
	gSavedSettings.declareS32("FlycamAxis4", 4, "Flycam hardware axis mapping for internal axis 4 ([0, 5]).");
	gSavedSettings.declareS32("FlycamAxis5", 5, "Flycam hardware axis mapping for internal axis 5 ([0, 5]).");
	gSavedSettings.declareS32("FlycamAxis6", -1, "Flycam hardware axis mapping for internal axis 6 ([0, 5]).");

	gSavedSettings.declareF32("FlycamAxisScale0", 1, "Flycam axis 0 scaler.");
	gSavedSettings.declareF32("FlycamAxisScale1", 1, "Flycam axis 1 scaler.");
	gSavedSettings.declareF32("FlycamAxisScale2", 1, "Flycam axis 2 scaler.");
	gSavedSettings.declareF32("FlycamAxisScale3", 1, "Flycam axis 3 scaler.");
	gSavedSettings.declareF32("FlycamAxisScale4", 1, "Flycam axis 4 scaler.");
	gSavedSettings.declareF32("FlycamAxisScale5", 1, "Flycam axis 5 scaler.");
	gSavedSettings.declareF32("FlycamAxisScale6", 1, "Flycam axis 6 scaler.");

	gSavedSettings.declareF32("FlycamAxisDeadZone0", 0.1f, "Flycam axis 0 dead zone.");
	gSavedSettings.declareF32("FlycamAxisDeadZone1", 0.1f, "Flycam axis 1 dead zone.");
	gSavedSettings.declareF32("FlycamAxisDeadZone2", 0.1f, "Flycam axis 2 dead zone.");
	gSavedSettings.declareF32("FlycamAxisDeadZone3", 0.1f, "Flycam axis 3 dead zone.");
	gSavedSettings.declareF32("FlycamAxisDeadZone4", 0.1f, "Flycam axis 4 dead zone.");
	gSavedSettings.declareF32("FlycamAxisDeadZone5", 0.1f, "Flycam axis 5 dead zone.");
	gSavedSettings.declareF32("FlycamAxisDeadZone6", 0.1f, "Flycam axis 6 dead zone.");

	gSavedSettings.declareF32("FlycamFeathering", 16.f, "Flycam feathering (less is softer)");
	gSavedSettings.declareBOOL("FlycamAutoLeveling", TRUE, "Keep Flycam level.");
	gSavedSettings.declareBOOL("FlycamAbsolute", FALSE, "Treat Flycam values as absolute positions (not deltas).");
	gSavedSettings.declareBOOL("FlycamZoomDirect", FALSE, "Map flycam zoom axis directly to camera zoom."); 

	// logitech LCD settings
	gSavedSettings.declareS32("LCDDestination", 0, "Which LCD to use");
	gSavedSettings.declareBOOL("DisplayChat", TRUE, "Display Latest Chat message on LCD");
	gSavedSettings.declareBOOL("DisplayIM", TRUE, "Display Latest IM message on LCD");
	gSavedSettings.declareBOOL("DisplayRegion", TRUE, "Display Location information on LCD");
	gSavedSettings.declareBOOL("DisplayDebug", TRUE, "Display Network Information on LCD");
	gSavedSettings.declareBOOL("DisplayDebugConsole", TRUE, "Display Console Debug Information on LCD");
	gSavedSettings.declareBOOL("DisplayLinden", TRUE, "Display Account Information on LCD");

	// Vector Processor & Math
	gSavedSettings.declareBOOL("VectorizePerfTest", TRUE, "Test SSE/vectorization performance and choose fastest version.");
	gSavedSettings.declareBOOL("VectorizeEnable", FALSE, "Enable general vector operations and data alignment.");
	gSavedSettings.declareBOOL("VectorizeSkin", TRUE, "Enable vector operations for avatar skinning.");
	gSavedSettings.declareU32( "VectorizeProcessor", 0, "0=Compiler Default, 1=SSE, 2=SSE2, autodetected", NO_PERSIST);

	//
	// crash_settings.xml
	//

	// Setting name is shared with win_crash_logger
	gCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes "
		"(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)");

}


void fixup_settings()
{
#if LL_RELEASE_FOR_DOWNLOAD
	// Force some settings on startup
	gSavedSettings.setBOOL("AnimateTextures", TRUE); // Force AnimateTextures to always be on
#endif
	
	// Special code to tweak with defaults
	std::string last_major, last_minor, last_patch;
	S32 digit = gLastRunVersion.find_first_of("0123456789");
	S32 dot = gLastRunVersion.find_first_of('.', digit);
	if (dot != std::string::npos && digit != std::string::npos)
	{
		last_major = gLastRunVersion.substr(digit, dot-digit);
		digit = dot+1;
		dot = gLastRunVersion.find_first_of('.', digit);
	}
	if (dot != std::string::npos && digit != std::string::npos)
	{
		last_minor = gLastRunVersion.substr(digit, dot-digit);
		digit = dot+1;
		dot = gLastRunVersion.find_first_of('.', digit);
	}
	if (dot != std::string::npos && digit != std::string::npos)
	{
		last_patch = gLastRunVersion.substr(digit, dot-digit);
	}
	// 1.18.x -> 1.19.x
	if (last_major == "1" && last_minor == "18")
	{
		if (!gSavedSettings.hasLoaded("EnableVoiceChat"))
		{
			gSavedSettings.setBOOL("EnableVoiceChat", FALSE); // Default 1.18.x users to voice chat disabled
		}
	}

	gSavedSettings.clearLoaded();
}

////////////////////////////////////////////////////////////////////////////
// Listeners

class LLAFKTimeoutListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gAFKTimeout = (F32) event->getValue().asReal();
		return true;
	}
};
static LLAFKTimeoutListener afk_timeout_listener;

class LLMouseSensitivityListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gMouseSensitivity = (F32) event->getValue().asReal();
		return true;
	}
};
static LLMouseSensitivityListener mouse_sensitivity_listener;


class LLInvertMouseListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gInvertMouse = event->getValue().asBoolean();
		return true;
	}
};
static LLInvertMouseListener invert_mouse_listener;

class LLRenderAvatarMouselookListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLVOAvatar::sVisibleInFirstPerson = event->getValue().asBoolean();
		return true;
	}
};
static LLRenderAvatarMouselookListener render_avatar_mouselook_listener;

class LLRenderFarClipListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		F32 draw_distance = (F32) event->getValue().asReal();
		gAgent.mDrawDistance = draw_distance;
		if (gWorldPointer)
		{
			gWorldPointer->setLandFarClip(draw_distance);
		}
		return true;
	}
};
static LLRenderFarClipListener render_far_clip_listener;

class LLTerrainDetailListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLDrawPoolTerrain::sDetailMode = event->getValue().asInteger();
		return true;
	}
};
static LLTerrainDetailListener terrain_detail_listener;


class LLSetShaderListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLShaderMgr::setShaders();
		return true;
	}
};
static LLSetShaderListener set_shader_listener;

class LLReleaseGLBufferListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		if (gPipeline.isInit())
		{
			gPipeline.releaseGLBuffers();
			gPipeline.createGLBuffers();
		}
		return true;
	}
};
static LLReleaseGLBufferListener release_gl_buffer_listener;

class LLVolumeLODListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLVOVolume::sLODFactor = (F32) event->getValue().asReal();
		LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f;
		return true;
	}
};
static LLVolumeLODListener volume_lod_listener;

class LLAvatarLODListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLVOAvatar::sLODFactor = (F32) event->getValue().asReal();
		return true;
	}
};
static LLAvatarLODListener avatar_lod_listener;

class LLTerrainLODListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLVOSurfacePatch::sLODFactor = (F32) event->getValue().asReal();
		//sqaure lod factor to get exponential range of [0,4] and keep
		//a value of 1 in the middle of the detail slider for consistency
		//with other detail sliders (see panel_preferences_graphics1.xml)
		LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor;
		return true;
	}
};
static LLTerrainLODListener terrain_lod_listener;

class LLTreeLODListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLVOTree::sTreeFactor = (F32) event->getValue().asReal();
		return true;
	}
};
static LLTreeLODListener tree_lod_listener;

class LLFlexLODListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLVolumeImplFlexible::sUpdateFactor = (F32) event->getValue().asReal();
		return true;
	}
};
static LLFlexLODListener flex_lod_listener;

class LLGammaListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		F32 gamma = (F32) event->getValue().asReal();
		if (gamma == 0.0f)
		{
			gamma = 1.0f; // restore normal gamma
		}
		if (gViewerWindow && gViewerWindow->getWindow() && gamma != gViewerWindow->getWindow()->getGamma())
		{
			// Only save it if it's changed
			if (!gViewerWindow->getWindow()->setGamma(gamma))
			{
				llwarns << "setGamma failed!" << llendl;
			}
		}

		return true;
	}
};
static LLGammaListener gamma_listener;

const F32 MAX_USER_FOG_RATIO = 10.f;
const F32 MIN_USER_FOG_RATIO = 0.5f;

class LLFogRatioListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		F32 fog_ratio = llmax(MIN_USER_FOG_RATIO, 
							llmin((F32) event->getValue().asReal(), 
							MAX_USER_FOG_RATIO));
		gSky.setFogRatio(fog_ratio);
		return true;
	}
};
static LLFogRatioListener fog_ratio_listener;

class LLMaxPartCountListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLViewerPartSim::setMaxPartCount(event->getValue().asInteger());
		return true;
	}
};
static LLMaxPartCountListener max_partCount_listener;

const S32 MAX_USER_COMPOSITE_LIMIT = 100;
const S32 MIN_USER_COMPOSITE_LIMIT = 0;

class LLCompositeLimitListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		S32 composite_limit = llmax(MIN_USER_COMPOSITE_LIMIT, 
							llmin((S32)event->getValue().asInteger(), 
							MAX_USER_COMPOSITE_LIMIT));
		LLVOAvatar::sMaxOtherAvatarsToComposite = composite_limit;
		return true;
	}
};
static LLCompositeLimitListener composite_limit_listener;

class LLVideoMemoryListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gImageList.updateMaxResidentTexMem(event->getValue().asInteger());
		return true;
	}
};
static LLVideoMemoryListener video_memory_listener;

class LLBandwidthListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gViewerThrottle.setMaxBandwidth((F32) event->getValue().asReal());
		return true;
	}
};
static LLBandwidthListener bandwidth_listener;

class LLChatFontSizeListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gConsole->setFontSize(event->getValue().asInteger());
		return true;
	}
};
static LLChatFontSizeListener chat_font_size_listener;

class LLChatPersistTimeListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gConsole->setLinePersistTime((F32) event->getValue().asReal());
		return true;
	}
};
static LLChatPersistTimeListener chat_persist_time_listener;

class LLConsoleMaxLinesListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gConsole->setMaxLines(event->getValue().asInteger());
		return true;
	}
};
static LLConsoleMaxLinesListener console_max_lines_listener;

// Listener for all volume settings
class LLAudioListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		audio_update_volume(true);
		return true;
	}
};
static LLAudioListener audio_listener;

class LLJoystickListener : public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLViewerJoystick::updateCamera(TRUE);
		return true;
	}
};
static LLJoystickListener joystick_listener;



class LLAudioStreamMusicListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		if (gAudiop)
		{
			if ( event->getValue().asBoolean() )
			{
				if (gParcelMgr
					&& gParcelMgr->getAgentParcel()
					&& !gParcelMgr->getAgentParcel()->getMusicURL().empty())
				{
					// if stream is already playing, don't call this
					// otherwise music will briefly stop
					if ( ! gAudiop->isInternetStreamPlaying() )
					{
						gAudiop->startInternetStream(gParcelMgr->getAgentParcel()->getMusicURL().c_str());
					}
				}
			}
			else
			{
				gAudiop->stopInternetStream();
			}
		}
		return true;
	}
};

static LLAudioStreamMusicListener audio_stream_music_listener;



class LLUseOcclusionListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLPipeline::sUseOcclusion = (event->getValue().asBoolean() && gGLManager.mHasOcclusionQuery 
				&& gFeatureManagerp->isFeatureAvailable("UseOcclusion") && !gUseWireframe) ? 2 : 0;
		return true;
	}
};
static LLUseOcclusionListener use_occlusion_listener;

class LLNumpadControlListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		if (gKeyboard)
		{
			gKeyboard->setNumpadDistinct(static_cast<LLKeyboard::e_numpad_distinct>(event->getValue().asInteger()));
		}
		return true;
	}
};

static LLNumpadControlListener numpad_control_listener;

class LLRenderUseVBOListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		if (gPipeline.isInit())
		{
			gPipeline.setUseVBO(event->getValue().asBoolean());
		}
		return true;
	}
};
static LLRenderUseVBOListener render_use_vbo_listener;

class LLWLSkyDetailListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		if (gSky.mVOWLSkyp.notNull())
		{
			gSky.mVOWLSkyp->updateGeometry(gSky.mVOWLSkyp->mDrawable);
		}
		return true;
	}
};
static LLWLSkyDetailListener wl_sky_detail_listener;

class LLRenderLightingDetailListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		if (gPipeline.isInit())
		{
			gPipeline.setLightingDetail(event->getValue().asInteger());
		}
		return true;
	}
};
static LLRenderLightingDetailListener render_lighting_detail_listener;

class LLResetVertexBuffersListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		if (gPipeline.isInit())
		{
			gPipeline.resetVertexBuffers();
		}
		return true;
	}
};
static LLResetVertexBuffersListener reset_vbo_listener;

class LLRenderDynamicLODListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLPipeline::sDynamicLOD = event->getValue().asBoolean();
		return true;
	}
};
static LLRenderDynamicLODListener render_dynamic_lod_listener;

class LLRenderUseFBOListener: public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLRenderTarget::sUseFBO = event->getValue().asBoolean();
		if (gPipeline.isInit())
		{
			gPipeline.releaseGLBuffers();
			gPipeline.createGLBuffers();
		}
		return true;
	}
};
static LLRenderUseFBOListener render_use_fbo_listener;

class LLRenderUseImpostorsListener : public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		LLVOAvatar::sUseImpostors = event->getValue().asBoolean();
		return true;
	}
};
static LLRenderUseImpostorsListener render_use_impostors_listener;

class LLRenderUseCleverUIListener : public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gGL.setClever(event->getValue().asBoolean());
		return true;
	}
};
static LLRenderUseCleverUIListener render_use_clever_ui_listener;

class LLRenderResolutionDivisorListener : public LLSimpleListener
{
	bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
	{
		gResizeScreenTexture = TRUE;
		return true;
	}
};
static LLRenderResolutionDivisorListener render_resolution_divisor_listener;
////////////////////////////////////////////////////////////////////////////

void settings_setup_listeners()
{
	gSavedSettings.getControl("FirstPersonAvatarVisible")->addListener(&render_avatar_mouselook_listener);
	gSavedSettings.getControl("MouseSensitivity")->addListener(&mouse_sensitivity_listener);
	gSavedSettings.getControl("InvertMouse")->addListener(&invert_mouse_listener);
	gSavedSettings.getControl("AFKTimeout")->addListener(&afk_timeout_listener);
	gSavedSettings.getControl("RenderFarClip")->addListener(&render_far_clip_listener);
	gSavedSettings.getControl("RenderTerrainDetail")->addListener(&terrain_detail_listener);
	gSavedSettings.getControl("RenderAvatarVP")->addListener(&set_shader_listener);
	gSavedSettings.getControl("VertexShaderEnable")->addListener(&set_shader_listener);
	gSavedSettings.getControl("RenderDynamicReflections")->addListener(&set_shader_listener);
	gSavedSettings.getControl("RenderGlow")->addListener(&release_gl_buffer_listener);
	gSavedSettings.getControl("RenderGlow")->addListener(&set_shader_listener);
	gSavedSettings.getControl("EnableRippleWater")->addListener(&set_shader_listener);
	gSavedSettings.getControl("RenderGlowResolutionPow")->addListener(&release_gl_buffer_listener);
	gSavedSettings.getControl("RenderAvatarCloth")->addListener(&set_shader_listener);
	gSavedSettings.getControl("WindLightUseAtmosShaders")->addListener(&set_shader_listener);
	gSavedSettings.getControl("RenderGammaFull")->addListener(&set_shader_listener);
	gSavedSettings.getControl("RenderVolumeLODFactor")->addListener(&volume_lod_listener);
	gSavedSettings.getControl("RenderAvatarLODFactor")->addListener(&avatar_lod_listener);
	gSavedSettings.getControl("RenderTerrainLODFactor")->addListener(&terrain_lod_listener);
	gSavedSettings.getControl("RenderTreeLODFactor")->addListener(&tree_lod_listener);
	gSavedSettings.getControl("RenderFlexTimeFactor")->addListener(&flex_lod_listener);
	gSavedSettings.getControl("ThrottleBandwidthKBPS")->addListener(&bandwidth_listener);
	gSavedSettings.getControl("RenderGamma")->addListener(&gamma_listener);
	gSavedSettings.getControl("RenderFogRatio")->addListener(&fog_ratio_listener);
	gSavedSettings.getControl("RenderMaxPartCount")->addListener(&max_partCount_listener);
	gSavedSettings.getControl("RenderDynamicLOD")->addListener(&render_dynamic_lod_listener);
	gSavedSettings.getControl("RenderDebugTextureBind")->addListener(&reset_vbo_listener);
	gSavedSettings.getControl("RenderFastAlpha")->addListener(&reset_vbo_listener);
	gSavedSettings.getControl("RenderObjectBump")->addListener(&reset_vbo_listener);
	gSavedSettings.getControl("RenderMaxVBOSize")->addListener(&reset_vbo_listener);
	gSavedSettings.getControl("RenderUseFBO")->addListener(&render_use_fbo_listener);
	gSavedSettings.getControl("RenderUseImpostors")->addListener(&render_use_impostors_listener);
	gSavedSettings.getControl("RenderUseCleverUI")->addListener(&render_use_clever_ui_listener);
	gSavedSettings.getControl("RenderResolutionDivisor")->addListener(&render_resolution_divisor_listener);
	gSavedSettings.getControl("AvatarCompositeLimit")->addListener(&composite_limit_listener);
	gSavedSettings.getControl("TextureMemory")->addListener(&video_memory_listener);
	gSavedSettings.getControl("ChatFontSize")->addListener(&chat_font_size_listener);
	gSavedSettings.getControl("ChatPersistTime")->addListener(&chat_persist_time_listener);
	gSavedSettings.getControl("ConsoleMaxLines")->addListener(&console_max_lines_listener);
	gSavedSettings.getControl("UseOcclusion")->addListener(&use_occlusion_listener);
	gSavedSettings.getControl("AudioLevelMaster")->addListener(&audio_listener);
 	gSavedSettings.getControl("AudioLevelSFX")->addListener(&audio_listener);
 	gSavedSettings.getControl("AudioLevelUI")->addListener(&audio_listener);
	gSavedSettings.getControl("AudioLevelAmbient")->addListener(&audio_listener);
	gSavedSettings.getControl("AudioLevelMusic")->addListener(&audio_listener);
	gSavedSettings.getControl("AudioLevelMedia")->addListener(&audio_listener);
	gSavedSettings.getControl("AudioLevelVoice")->addListener(&audio_listener);
	gSavedSettings.getControl("AudioLevelDistance")->addListener(&audio_listener);
	gSavedSettings.getControl("AudioLevelDoppler")->addListener(&audio_listener);
	gSavedSettings.getControl("AudioLevelRolloff")->addListener(&audio_listener);
	gSavedSettings.getControl("AudioStreamingMusic")->addListener(&audio_stream_music_listener);
	// AudioStreamingVideo initialized in llviewermedia.cpp
	gSavedSettings.getControl("MuteAudio")->addListener(&audio_listener);
	gSavedSettings.getControl("MuteMusic")->addListener(&audio_listener);
	gSavedSettings.getControl("MuteMedia")->addListener(&audio_listener);
	gSavedSettings.getControl("MuteVoice")->addListener(&audio_listener);
	gSavedSettings.getControl("MuteAmbient")->addListener(&audio_listener);
	gSavedSettings.getControl("MuteUI")->addListener(&audio_listener);
	gSavedSettings.getControl("RenderVBOEnable")->addListener(&render_use_vbo_listener);
	gSavedSettings.getControl("WLSkyDetail")->addListener(&wl_sky_detail_listener);
	gSavedSettings.getControl("RenderLightingDetail")->addListener(&render_lighting_detail_listener);
	gSavedSettings.getControl("NumpadControl")->addListener(&numpad_control_listener);
	gSavedSettings.getControl("FlycamAxis0")->addListener(&joystick_listener);
	gSavedSettings.getControl("FlycamAxis1")->addListener(&joystick_listener);
	gSavedSettings.getControl("FlycamAxis2")->addListener(&joystick_listener);
	gSavedSettings.getControl("FlycamAxis3")->addListener(&joystick_listener);
	gSavedSettings.getControl("FlycamAxis4")->addListener(&joystick_listener);
	gSavedSettings.getControl("FlycamAxis5")->addListener(&joystick_listener);
	gSavedSettings.getControl("FlycamAxis6")->addListener(&joystick_listener);
}