diff options
author | Sean Dague | 2008-06-18 22:56:04 +0000 |
---|---|---|
committer | Sean Dague | 2008-06-18 22:56:04 +0000 |
commit | 6753578465f1853ed95d3f8850d7d6f5089501b3 (patch) | |
tree | f6bf5b55e36a730d17fd507164406fb2ad6538da /bin | |
parent | clean up the nhibernate definitions to work with mysql (diff) | |
download | opensim-SC_OLD-6753578465f1853ed95d3f8850d7d6f5089501b3.zip opensim-SC_OLD-6753578465f1853ed95d3f8850d7d6f5089501b3.tar.gz opensim-SC_OLD-6753578465f1853ed95d3f8850d7d6f5089501b3.tar.bz2 opensim-SC_OLD-6753578465f1853ed95d3f8850d7d6f5089501b3.tar.xz |
commit justin's grafitti board to the base OpenSim script
library.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/assets/ScriptsAssetSet/GrafittiBoard.lsl | 74 | ||||
-rw-r--r-- | bin/assets/ScriptsAssetSet/ScriptsAssetSet.xml | 8 | ||||
-rw-r--r-- | bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml | 15 |
3 files changed, 96 insertions, 1 deletions
diff --git a/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl b/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl new file mode 100644 index 0000000..d30e8f0 --- /dev/null +++ b/bin/assets/ScriptsAssetSet/GrafittiBoard.lsl | |||
@@ -0,0 +1,74 @@ | |||
1 | // Grafitti board 0.0.2 for OpenSim | ||
2 | // By Justin Clark-Casey (justincc) | ||
3 | // http://justincc.wordpress.com | ||
4 | |||
5 | // This script is available under the BSD License | ||
6 | |||
7 | string text = ""; | ||
8 | |||
9 | int LISTENING_CHANNEL = 43; | ||
10 | |||
11 | // XXX Only putting this here as well to get around OpenSim's int -> string casting oddness | ||
12 | string LISTENING_CHANNEL_STRING = "43"; | ||
13 | |||
14 | // FIXME: Should be dynamic! | ||
15 | int CHARS_WIDTH = 42; | ||
16 | |||
17 | default | ||
18 | { | ||
19 | state_entry() | ||
20 | { | ||
21 | llSetText( | ||
22 | "Say /" + LISTENING_CHANNEL_STRING + " <message> to add text." | ||
23 | + " Say /" + LISTENING_CHANNEL_STRING | ||
24 | + " !clear to clear board", | ||
25 | <0.0, 1.0, 0.0>, 1.0); | ||
26 | |||
27 | llListen(LISTENING_CHANNEL, "", NULL_KEY, ""); | ||
28 | |||
29 | addGraffiti("justincc's graffiti board v0.0.2"); | ||
30 | addGraffiti("Now with primitive word wrap!"); | ||
31 | draw(); | ||
32 | } | ||
33 | |||
34 | listen(integer channel, string name, key id, string message) | ||
35 | { | ||
36 | if (message == "!clear") | ||
37 | { | ||
38 | clearGraffiti(); | ||
39 | } | ||
40 | else | ||
41 | { | ||
42 | addGraffiti(message); | ||
43 | } | ||
44 | |||
45 | draw(); | ||
46 | } | ||
47 | } | ||
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/ScriptsAssetSet.xml b/bin/assets/ScriptsAssetSet/ScriptsAssetSet.xml index 8f85027..4fd18c1 100644 --- a/bin/assets/ScriptsAssetSet/ScriptsAssetSet.xml +++ b/bin/assets/ScriptsAssetSet/ScriptsAssetSet.xml | |||
@@ -146,4 +146,12 @@ | |||
146 | <Key Name="inventoryType" Value="10" /> | 146 | <Key Name="inventoryType" Value="10" /> |
147 | <Key Name="fileName" Value="osWeatherMap.lsl" /> | 147 | <Key Name="fileName" Value="osWeatherMap.lsl" /> |
148 | </Section> | 148 | </Section> |
149 | <Section Name="GraffitiBoard"> | ||
150 | <Key Name="assetID" Value="fdb637ae-e4fe-f220-62f0-9f9b5c0c2cdb" /> | ||
151 | <Key Name="name" Value="GraffitiBoard" /> | ||
152 | <Key Name="assetType" Value="10" /> | ||
153 | <Key Name="inventoryType" Value="10" /> | ||
154 | <Key Name="fileName" Value="GraffitiBoard.lsl" /> | ||
155 | </Section> | ||
156 | |||
149 | </Nini> | 157 | </Nini> |
diff --git a/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml b/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml index 3f674eb..4cf3081 100644 --- a/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml +++ b/bin/inventory/ScriptsLibrary/ScriptsLibraryItems.xml | |||
@@ -303,7 +303,7 @@ | |||
303 | <Section Name="osWeatherMap"> | 303 | <Section Name="osWeatherMap"> |
304 | <Key Name="inventoryID" Value="b102e3a7-c907-e63e-b9f5-b3fd63e6851b" /> | 304 | <Key Name="inventoryID" Value="b102e3a7-c907-e63e-b9f5-b3fd63e6851b" /> |
305 | <Key Name="assetID" Value="b102e3a7-c907-e63e-b9f5-b3fd63e6851b" /> | 305 | <Key Name="assetID" Value="b102e3a7-c907-e63e-b9f5-b3fd63e6851b" /> |
306 | <Key Name="folderID" Value="284858c8-9391-6bf1-ddf5-b936f73de853"/> | 306 | <Key Name="folderID" Value="284858c8-9391-6bf1-ddf5-b936f73de853" /> |
307 | <Key Name="description" Value="A cycling US Weather Map - contributed by Neas Bade" /> | 307 | <Key Name="description" Value="A cycling US Weather Map - contributed by Neas Bade" /> |
308 | <Key Name="name" Value="osWeatherMap" /> | 308 | <Key Name="name" Value="osWeatherMap" /> |
309 | <Key Name="assetType" Value="10" /> | 309 | <Key Name="assetType" Value="10" /> |
@@ -313,4 +313,17 @@ | |||
313 | <Key Name="everyonePermissions" Value="257487132" /> | 313 | <Key Name="everyonePermissions" Value="257487132" /> |
314 | <Key Name="basePermissions" Value="257487132" /> | 314 | <Key Name="basePermissions" Value="257487132" /> |
315 | </Section> | 315 | </Section> |
316 | <Section Name="GrafittiBoard"> | ||
317 | <Key Name="inventoryID" Value="fdb637ae-e4fe-f220-62f0-9f9b5c0c2cdb" /> | ||
318 | <Key Name="assetID" Value="fdb637ae-e4fe-f220-62f0-9f9b5c0c2cdb" /> | ||
319 | <Key Name="folderID" Value="284858c8-9391-6bf1-ddf5-b936f73de853" /> | ||
320 | <Key Name="description" Value="A text board that records what you say - contributed by Justin Clarke Casey" /> | ||
321 | <Key Name="name" Value="GrafittiBoard" /> | ||
322 | <Key Name="assetType" Value="10" /> | ||
323 | <Key Name="inventoryType" Value="10" /> | ||
324 | <Key Name="currentPermissions" Value="257487132" /> | ||
325 | <Key Name="nextPermissions" Value="257487132" /> | ||
326 | <Key Name="everyonePermissions" Value="257487132" /> | ||
327 | <Key Name="basePermissions" Value="257487132" /> | ||
328 | </Section> | ||
316 | </Nini> | 329 | </Nini> |