Skip to content

Commit

Permalink
added debug system and more comments + readability
Browse files Browse the repository at this point in the history
  • Loading branch information
XenHat committed Jan 20, 2014
1 parent 6796c00 commit 8b6a943
Showing 1 changed file with 48 additions and 14 deletions.
62 changes: 48 additions & 14 deletions ccng v2.lsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,53 @@
// For better readability,
// extend the size of the editor until this comment fits fully on one line.



/* TODO
-Fix weird child prim lag when restoring ocolor.
- Make it faster? D:
*/

float glowAmount = 0.08; // How much glow
integer colorRoot = 1; // Needed for checking if we want to recolor the root prim
list foundPrims = []; // Internal use, don't touch.
vector color; // Internal use, don't touch.
vector ocolor;
integer fp; // Internal use, don't touch.
integer isTyping; // Typing indicator bit
integer x;
integer listLen;

integer cCheckID; // color change bug fix for single prim
// user preferences //
float glowAmount = 0.08; // How much glow
integer colorRoot = 1; // Needed for checking if we want to recolor the root prim
list foundPrims = []; // Internal use, don't touch.

integer MessagesLevel = 0; /// Verbosity.

///////////////////////////////////////////////////////////////////
// internal variables, LEAVE THEM ALONE!! D:
vector color; // Internal use, don't touch.
vector ocolor; // original color of the prim
integer fp; // counter
integer isTyping; // Typing indicator bit
integer x; //counter
integer listLen; // Length of the prim list. used for checks

integer cCheckID; // color change bug fix for single prim
///////////////////////////////////////////////////////////////////


////////////////////// Custom Functions /////////////////////////


////// Debug system /////////
ErrorMessage(string message)
{
if(MessagesLevel >= 1)
llOwnerSay("E: " + message);
}
InfoMessage(string message)
{
if(MessagesLevel >= 2)
llOwnerSay("I: " + message);
}
DebugMessage(string message)
{
if(MessagesLevel >= 3)
llOwnerSay("D: " + message);
}


string GetLinkDesc(integer link)
{
return (string)llGetObjectDetails(llGetLinkKey(link), (list)OBJECT_DESC);
Expand Down Expand Up @@ -171,7 +202,6 @@ listPrims()
}
doColor(vector dcolor)
{
// llOwnerSay((string)dcolor);
integer i;
for(i = 0; i <listLen; i ++)
{
Expand All @@ -181,13 +211,17 @@ doColor(vector dcolor)
PRIM_GLOW,ALL_SIDES,glowAmount
]);
}

// we do this to color the root prim if it contains
// the name in the description
if( llToLower(llGetObjectDesc()) == "colorprim")
{
llSetColor(dcolor, ALL_SIDES);
}
}


/////////////////////////// Script Starts Here ///////////////////////////
default
{
state_entry()
Expand All @@ -214,7 +248,7 @@ default
else
{
isTyping = 0;
// llSay(DEBUG_CHANNEL,(string)ocolor);
DebugMessage((string)ocolor);
llSetTimerEvent(0.5);
}
}
Expand Down

0 comments on commit 8b6a943

Please sign in to comment.