diff options
author | Mike Mazur | 2008-07-18 04:51:36 +0000 |
---|---|---|
committer | Mike Mazur | 2008-07-18 04:51:36 +0000 |
commit | 2558f8ac3122f2721c9f47500626f781ff548bbe (patch) | |
tree | b38ed2afbb202f164480be3a362b512d6ea8deb9 /bin/assets/ScriptsAssetSet | |
parent | masks MySQL password from console startup messages (diff) | |
download | opensim-SC_OLD-2558f8ac3122f2721c9f47500626f781ff548bbe.zip opensim-SC_OLD-2558f8ac3122f2721c9f47500626f781ff548bbe.tar.gz opensim-SC_OLD-2558f8ac3122f2721c9f47500626f781ff548bbe.tar.bz2 opensim-SC_OLD-2558f8ac3122f2721c9f47500626f781ff548bbe.tar.xz |
Make scripts LSL compliant.
Diffstat (limited to 'bin/assets/ScriptsAssetSet')
-rw-r--r-- | bin/assets/ScriptsAssetSet/GrafittiBoard.lsl | 58 | ||||
-rw-r--r-- | bin/assets/ScriptsAssetSet/osTextBoard.lsl | 53 | ||||
-rw-r--r-- | bin/assets/ScriptsAssetSet/osWeatherMap.lsl | 50 |
3 files changed, 81 insertions, 80 deletions
diff --git a/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl b/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl index 954e3ea..83adfb1 100644 --- a/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl +++ b/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl | |||
@@ -6,13 +6,40 @@ | |||
6 | 6 | ||
7 | string text = ""; | 7 | string text = ""; |
8 | 8 | ||
9 | int LISTENING_CHANNEL = 43; | 9 | integer LISTENING_CHANNEL = 43; |
10 | 10 | ||
11 | // XXX Only putting this here as well to get around OpenSim's int -> string casting oddness | 11 | // XXX Only putting this here as well to get around OpenSim's int -> string casting oddness |
12 | string LISTENING_CHANNEL_STRING = "43"; | 12 | string LISTENING_CHANNEL_STRING = "43"; |
13 | 13 | ||
14 | // FIXME: Should be dynamic! | 14 | // FIXME: Should be dynamic! |
15 | int CHARS_WIDTH = 42; | 15 | integer CHARS_WIDTH = 42; |
16 | |||
17 | // Add some additional graffiti | ||
18 | addGraffiti(string message) | ||
19 | { | ||
20 | while (llStringLength(message) > CHARS_WIDTH) | ||
21 | { | ||
22 | text += "\n\n" + llGetSubString(message, 0, CHARS_WIDTH - 1); | ||
23 | message = llDeleteSubString(message, 0, CHARS_WIDTH - 1); | ||
24 | } | ||
25 | |||
26 | text += "\n\n" + message; | ||
27 | } | ||
28 | |||
29 | // Clear the existing graffiti | ||
30 | clearGraffiti() | ||
31 | { | ||
32 | text = ""; | ||
33 | } | ||
34 | |||
35 | // Actually fires the graffiti out to the dynamic texture module | ||
36 | draw() | ||
37 | { | ||
38 | //llSay(0, text); | ||
39 | string drawList = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text " + text + ";"; | ||
40 | |||
41 | osSetDynamicTextureData("", "vector", drawList, "1024", 0); | ||
42 | } | ||
16 | 43 | ||
17 | default | 44 | default |
18 | { | 45 | { |
@@ -45,30 +72,3 @@ default | |||
45 | draw(); | 72 | draw(); |
46 | } | 73 | } |
47 | } | 74 | } |
48 | |||
49 | // Add some additional graffiti | ||
50 | void addGraffiti(string message) | ||
51 | { | ||
52 | while (llStringLength(message) > CHARS_WIDTH) | ||
53 | { | ||
54 | text += "\n\n" + llGetSubString(message, 0, CHARS_WIDTH - 1); | ||
55 | message = llDeleteSubString(message, 0, CHARS_WIDTH - 1); | ||
56 | } | ||
57 | |||
58 | text += "\n\n" + message; | ||
59 | } | ||
60 | |||
61 | // Clear the existing graffiti | ||
62 | void clearGraffiti() | ||
63 | { | ||
64 | text = ""; | ||
65 | } | ||
66 | |||
67 | // Actually fires the graffiti out to the dynamic texture module | ||
68 | void draw() | ||
69 | { | ||
70 | //llSay(0, text); | ||
71 | string drawList = "PenColour BLACK; MoveTo 40,220; FontSize 32; Text " + text + ";"; | ||
72 | |||
73 | osSetDynamicTextureData("", "vector", drawList, "1024", 0); | ||
74 | } | ||
diff --git a/bin/assets/ScriptsAssetSet/osTextBoard.lsl b/bin/assets/ScriptsAssetSet/osTextBoard.lsl index bb5ae81..7aacab4 100644 --- a/bin/assets/ScriptsAssetSet/osTextBoard.lsl +++ b/bin/assets/ScriptsAssetSet/osTextBoard.lsl | |||
@@ -4,6 +4,33 @@ string text = ""; | |||
4 | string add = ""; | 4 | string add = ""; |
5 | integer channel = 0; // if this is >= 0, llSay on that channel on updates | 5 | integer channel = 0; // if this is >= 0, llSay on that channel on updates |
6 | 6 | ||
7 | push_text() | ||
8 | { | ||
9 | compile_text(); | ||
10 | draw_text(); | ||
11 | } | ||
12 | |||
13 | compile_text() | ||
14 | { | ||
15 | title = "Some Title"; | ||
16 | subtitle = "Some subtitle"; | ||
17 | |||
18 | text = "Plenty of text for the main body.\n"; | ||
19 | text += "You need to manual do line breaks\n"; | ||
20 | text += "here. No word wrap yet."; | ||
21 | |||
22 | add = "Additional text at the bottom"; | ||
23 | } | ||
24 | |||
25 | draw_text() | ||
26 | { | ||
27 | string drawList = "MoveTo 40,80; PenColour RED; FontSize 48; Text " + title + ";"; | ||
28 | drawList += "MoveTo 160,160; FontSize 32; Text " + subtitle + ";"; | ||
29 | drawList += "PenColour BLACK; MoveTo 40,220; FontSize 24; Text " + text + ";"; | ||
30 | drawList += "PenColour RED; FontName Times New Roman; MoveTo 40,900; Text " + add + ";"; | ||
31 | osSetDynamicTextureData("", "vector", drawList, "1024", 0); | ||
32 | } | ||
33 | |||
7 | default { | 34 | default { |
8 | state_entry() | 35 | state_entry() |
9 | { | 36 | { |
@@ -18,30 +45,4 @@ default { | |||
18 | } | 45 | } |
19 | } | 46 | } |
20 | 47 | ||
21 | void push_text() | ||
22 | { | ||
23 | compile_text(); | ||
24 | draw_text(); | ||
25 | } | ||
26 | |||
27 | void compile_text() | ||
28 | { | ||
29 | title = "Some Title"; | ||
30 | subtitle = "Some subtitle"; | ||
31 | |||
32 | text = "Plenty of text for the main body.\n"; | ||
33 | text += "You need to manual do line breaks\n"; | ||
34 | text += "here. No word wrap yet."; | ||
35 | |||
36 | add = "Additional text at the bottom"; | ||
37 | } | ||
38 | |||
39 | void draw_text() | ||
40 | { | ||
41 | string drawList = "MoveTo 40,80; PenColour RED; FontSize 48; Text " + title + ";"; | ||
42 | drawList += "MoveTo 160,160; FontSize 32; Text " + subtitle + ";"; | ||
43 | drawList += "PenColour BLACK; MoveTo 40,220; FontSize 24; Text " + text + ";"; | ||
44 | drawList += "PenColour RED; FontName Times New Roman; MoveTo 40,900; Text " + add + ";"; | ||
45 | osSetDynamicTextureData("", "vector", drawList, "1024", 0); | ||
46 | } | ||
47 | } | 48 | } |
diff --git a/bin/assets/ScriptsAssetSet/osWeatherMap.lsl b/bin/assets/ScriptsAssetSet/osWeatherMap.lsl index 7dda87b..8fc6007 100644 --- a/bin/assets/ScriptsAssetSet/osWeatherMap.lsl +++ b/bin/assets/ScriptsAssetSet/osWeatherMap.lsl | |||
@@ -1,13 +1,30 @@ | |||
1 | default | 1 | integer count = 0; |
2 | integer refreshRate = 300; | ||
3 | string URL1 = "http://icons.wunderground.com/data/640x480/2xus_rd.gif"; | ||
4 | string URL2 = "http://icons.wunderground.com/data/640x480/2xus_sf.gif"; | ||
5 | string URL3 = "http://icons.wunderground.com/data/640x480/2xus_st.gif"; | ||
6 | string dynamicID=""; | ||
7 | string contentType="image"; | ||
8 | |||
9 | void refresh_texture() | ||
2 | { | 10 | { |
3 | integer count = 0; | 11 | count++; |
4 | integer refreshRate = 300; | 12 | string url = ""; |
5 | string URL1 = "http://icons.wunderground.com/data/640x480/2xus_rd.gif"; | 13 | integer c = count % 3; |
6 | string URL2 = "http://icons.wunderground.com/data/640x480/2xus_sf.gif"; | 14 | |
7 | string URL3 = "http://icons.wunderground.com/data/640x480/2xus_st.gif"; | 15 | if (c == 0) { |
8 | string dynamicID=""; | 16 | url = URL1; |
9 | string contentType="image"; | 17 | } else if (c == 1) { |
18 | url = URL2; | ||
19 | } else { | ||
20 | url = URL3; | ||
21 | } | ||
22 | // refresh rate is not yet respected here, which is why we need the timer | ||
23 | osSetDynamicTextureURL(dynamicID, contentType ,url , "", refreshRate ); | ||
24 | } | ||
10 | 25 | ||
26 | default | ||
27 | { | ||
11 | state_entry() | 28 | state_entry() |
12 | { | 29 | { |
13 | refresh_texture(); | 30 | refresh_texture(); |
@@ -23,21 +40,4 @@ default | |||
23 | { | 40 | { |
24 | refresh_texture(); | 41 | refresh_texture(); |
25 | } | 42 | } |
26 | |||
27 | void refresh_texture() | ||
28 | { | ||
29 | count++; | ||
30 | string url = ""; | ||
31 | integer c = count % 3; | ||
32 | |||
33 | if (c == 0) { | ||
34 | url = URL1; | ||
35 | } else if (c == 1) { | ||
36 | url = URL2; | ||
37 | } else { | ||
38 | url = URL3; | ||
39 | } | ||
40 | // refresh rate is not yet respected here, which is why we need the timer | ||
41 | osSetDynamicTextureURL(dynamicID, contentType ,url , "", refreshRate ); | ||
42 | } | ||
43 | } | 43 | } |