Fix compilation errors
This commit is contained in:
parent
ebbf99c342
commit
7af5d6d9f7
1 changed files with 88 additions and 29 deletions
|
@ -31,16 +31,26 @@
|
||||||
// CONSTANTS
|
// CONSTANTS
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
|
|
||||||
|
// Link Commands
|
||||||
|
integer LINK_MENU_DISPLAY = 300;
|
||||||
|
integer LINK_MENU_CLOSE = 310;
|
||||||
|
integer LINK_MENU_RETURN = 320;
|
||||||
|
integer LINK_MENU_TIMEOUT = 330;
|
||||||
|
integer LINK_MENU_CHANNEL = 303; // Returns from the dialog module to inform what the channel is
|
||||||
|
integer LINK_MENU_ONLYCHANNEL = 302; // Sent with a ident to make a channel. No dialog will pop up, and it will expire just like any other menu if input is not received.
|
||||||
|
|
||||||
|
// Main Menu Details
|
||||||
|
string BACK = "<<";
|
||||||
string FOWARD = ">>";
|
string FOWARD = ">>";
|
||||||
string MANUAL_ENTRY = ">manual<";
|
string MANUAL_ENTRY = ">manual<";
|
||||||
|
list MENU_NAVIGATE_BUTTONS = [ " ", " ", "-exit-"];
|
||||||
float MENU_TIMEOUT_CHECK = 10.0;
|
float MENU_TIMEOUT_CHECK = 10.0;
|
||||||
integer MENU_TIMEOUT = 120;
|
integer MENU_TIMEOUT = 120;
|
||||||
integer MAX_TEXT = 510;
|
integer MAX_TEXT = 510;
|
||||||
list NUMBER_PAD = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
list NUMBER_PAD = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
|
||||||
//list NUMBER_PAD = ["7", "8", "9", "4", "5", "6", "1", "2", "3"];
|
//list NUMBER_PAD = ["7", "8", "9", "4", "5", "6", "1", "2", "3"];
|
||||||
list NUMBER_PAD_END_NO_RNG = ["Submit", "0", "Cancel"];
|
list NUMBER_PAD_END_NO_RNG = ["C", "0", "Confirm"];
|
||||||
list NUMBER_PAD_END_RNG = ["Submit", "RANDOM", "Cancel"];
|
list NUMBER_PAD_END_RNG = ["Random", "0", "Confirm"];
|
||||||
|
|
||||||
string g_sNumPadCode;
|
string g_sNumPadCode;
|
||||||
|
|
||||||
|
@ -61,18 +71,63 @@ list menusActive;
|
||||||
// Functions - General
|
// Functions - General
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
|
|
||||||
|
integer IsLikelyAvatarID(key kID)
|
||||||
|
{
|
||||||
|
if(!IsLikelyUUID(kID))return FALSE;
|
||||||
|
// Avatar UUIDs always have the 15th digit set to a 4
|
||||||
|
if(llGetSubString(kID,8,8) == "-" && llGetSubString(kID,14,14)=="4")return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
string SLURL(key kID){
|
||||||
|
return "secondlife:///app/agent/"+(string)kID+"/about";
|
||||||
|
}
|
||||||
|
integer IsListOfIDs(list lIDs)
|
||||||
|
{
|
||||||
|
integer i=0;
|
||||||
|
integer end = llGetListLength(lIDs);
|
||||||
|
for(i=0;i<end;i++){
|
||||||
|
if(IsLikelyUUID(llList2String(lIDs,i)))return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
list numberRange(integer start, integer end)
|
||||||
|
{
|
||||||
|
list ret = [];
|
||||||
|
for(start = start; start<end; start++)
|
||||||
|
{
|
||||||
|
ret += [(string)start];
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
string sSetor(integer a, string b, string c)
|
||||||
|
{
|
||||||
|
if(a)return b;
|
||||||
|
else return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
integer IsLikelyUUID(string sID)
|
||||||
|
{
|
||||||
|
if(sID == (string)NULL_KEY)return TRUE;
|
||||||
|
if(llStringLength(sID)==32)return TRUE;
|
||||||
|
key kID = (key)sID;
|
||||||
|
if(kID)return TRUE;
|
||||||
|
if(llStringLength(sID) >25){
|
||||||
|
if(llGetSubString(sID,8,8)=="-" && llGetSubString(sID, 13,13) == "-" && llGetSubString(sID,18,18) == "-" && llGetSubString(sID,23,23)=="-") return TRUE;
|
||||||
|
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
debug(string debug)
|
debug(string debug)
|
||||||
{
|
{
|
||||||
if (DEBUG) llSay(DEBUG_CHANNEL,"DEBUG:"+llGetScriptName()+":"+debug+" : Free("+(string)llGetFreeMemory()+")");
|
if (DEBUG) llSay(DEBUG_CHANNEL,"DEBUG:"+llGetScriptName()+":"+debug+" : Free("+(string)llGetFreeMemory()+")");
|
||||||
}
|
}
|
||||||
|
|
||||||
Notify(key kID, string sMsg)
|
|
||||||
{
|
|
||||||
if(llGetAgentSize(kID) == ZERO_VECTOR)
|
|
||||||
{
|
|
||||||
llInstantMessage(kID, Substitutes(sMsg));
|
|
||||||
} else llRegionSayTo(kID, 0, Substitutes(sMsg));
|
|
||||||
}
|
|
||||||
|
|
||||||
integer string2Bool (string test)
|
integer string2Bool (string test)
|
||||||
{
|
{
|
||||||
|
@ -190,10 +245,10 @@ DisplayMenu(key id, integer channel, integer page, integer iTextBox)
|
||||||
|
|
||||||
if(llList2String(menuButtonsAll,0)=="colormenu" && llGetListLength(menuButtonsAll)==1){
|
if(llList2String(menuButtonsAll,0)=="colormenu" && llGetListLength(menuButtonsAll)==1){
|
||||||
menuButtonsAll = ["Dark Blue", "Blue", "Red", "Dark Red", "Green", "Dark Green", "Black", "White", ">custom<"];
|
menuButtonsAll = ["Dark Blue", "Blue", "Red", "Dark Red", "Green", "Dark Green", "Black", "White", ">custom<"];
|
||||||
}else if(llList2String(menuButtonsAll,0) == "numpadplz" && llGetListLength(menuButtonsAll) == 2)
|
}else if(llList2String(menuButtonsAll,0) == "numpadplz" && llGetListLength(menuButtonsAll) == 1)
|
||||||
{
|
{
|
||||||
iNumpad = 1;
|
iNumpad = 1;
|
||||||
if(llList2String(menuButtonsAll,1) == "rng")
|
if(g_sNumPadCode == "")
|
||||||
menuButtonsAll = NUMBER_PAD_END_RNG + NUMBER_PAD;
|
menuButtonsAll = NUMBER_PAD_END_RNG + NUMBER_PAD;
|
||||||
else menuButtonsAll = NUMBER_PAD_END_NO_RNG + NUMBER_PAD;
|
else menuButtonsAll = NUMBER_PAD_END_NO_RNG + NUMBER_PAD;
|
||||||
}
|
}
|
||||||
|
@ -220,11 +275,17 @@ DisplayMenu(key id, integer channel, integer page, integer iTextBox)
|
||||||
|
|
||||||
for(x=0;x<xe;x++)
|
for(x=0;x<xe;x++)
|
||||||
{
|
{
|
||||||
if(IsLikelyUUID(llList2String(menuButtonsAll,x))){
|
if(IsLikelyAvatarID(llList2String(menuButtonsAll,x))){
|
||||||
|
|
||||||
menuButtonsText += [(string)x + ". " + SLURL(llList2String(menuButtonsAll, x))];
|
menuButtonsText += [(string)x + ". " + SLURL(llList2String(menuButtonsAll, x))];
|
||||||
|
|
||||||
menuButtonsAll[x] = (string)x;
|
menuButtonsAll[x] = (string)x;
|
||||||
|
} else {
|
||||||
|
if(IsLikelyUUID(llList2String(menuButtonsAll, x)))
|
||||||
|
{
|
||||||
|
menuButtonsText += [(string)x + ". " + llKey2Name(llList2String(menuButtonsAll, x))];
|
||||||
|
menuButtonsAll[x] = (string)x;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lTitle[0] = sTitle;
|
lTitle[0] = sTitle;
|
||||||
|
@ -383,23 +444,27 @@ default
|
||||||
integer iReturn = 0;
|
integer iReturn = 0;
|
||||||
switch(message)
|
switch(message)
|
||||||
{
|
{
|
||||||
case "Cancel":
|
case "Random":
|
||||||
{
|
{
|
||||||
iReturn = 1;
|
g_sNumPadCode = (string)llRound(llFrand(0xFFFFFF));
|
||||||
message = "-1";
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "Submit":
|
case "C":
|
||||||
{
|
{
|
||||||
iReturn = 1;
|
|
||||||
message = g_sNumPadCode;
|
|
||||||
|
|
||||||
g_sNumPadCode = "";
|
g_sNumPadCode = "";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "RANDOM":
|
case "Confirm":
|
||||||
{
|
{
|
||||||
g_sNumPadCode = (string)llRound(llFrand(0xFFFFFF));
|
if(g_sNumPadCode == "")
|
||||||
|
{
|
||||||
|
iReturn = 1;
|
||||||
|
message = "-1";
|
||||||
|
}else {
|
||||||
|
iReturn = 1;
|
||||||
|
message = g_sNumPadCode;
|
||||||
|
}
|
||||||
|
g_sNumPadCode = "";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -472,12 +537,6 @@ default
|
||||||
menusActive = [channel, handle, llGetUnixTime(), 0] + menusActive;
|
menusActive = [channel, handle, llGetUnixTime(), 0] + menusActive;
|
||||||
menusDescription = [channel, id, message, senderNum, 0, " ", " ", " "]+menusDescription;
|
menusDescription = [channel, id, message, senderNum, 0, " ", " ", " "]+menusDescription;
|
||||||
llMessageLinked(LINK_SET, LINK_MENU_CHANNEL, (string)channel, message);
|
llMessageLinked(LINK_SET, LINK_MENU_CHANNEL, (string)channel, message);
|
||||||
} else if(num == NOTIFY)
|
|
||||||
{
|
|
||||||
Notify(id, message);
|
|
||||||
} else if(num == LINK_SIGNAL_RESET || num == END_GAME)
|
|
||||||
{
|
|
||||||
llResetScript();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -531,7 +590,7 @@ GetListenerChannel(string sIdent)
|
||||||
|
|
||||||
NumberPad(key kAv, string sText, string sIdent, string sExtra)
|
NumberPad(key kAv, string sText, string sIdent, string sExtra)
|
||||||
{
|
{
|
||||||
llMessageLinked(LINK_THIS, LINK_MENU_DISPLAY, llDumpList2String([sIdent, "TRUE", sText, "numpadplz~" + sSetor(RNG, "rng", "nrng"), "", sExtra, "NOUTIL", "", BACK, FORWARD, llDumpList2String(MENU_NAVIGATE_BUTTONS, "~")], "|"), kAv);
|
llMessageLinked(LINK_THIS, LINK_MENU_DISPLAY, llDumpList2String([sIdent, "TRUE", sText, "numpadplz", "", sExtra, "NOUTIL", "", BACK, FORWARD, llDumpList2String(MENU_NAVIGATE_BUTTONS, "~")], "|"), kAv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue