Merge branch 'master' of github.com:Beeks/Ascent

This commit is contained in:
Beeks
2010-09-16 22:09:16 -04:00

View File

@@ -207,9 +207,10 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
std::istringstream i(revised_text); std::istringstream i(revised_text);
std::string command; std::string command;
i >> command; i >> command;
command = utf8str_tolower(command);
if(command != "") if(command != "")
{ {
if(command == gSavedSettings.getString("AscentCmdLinePos")) if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLinePos")))
{ {
F32 x,y,z; F32 x,y,z;
if (i >> x) if (i >> x)
@@ -232,7 +233,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
} }
} }
} }
else if(command == gSavedSettings.getString("AscentCmdLineDrawDistance")) else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineDrawDistance")))
{ {
int drawDist; int drawDist;
if(i >> drawDist) if(i >> drawDist)
@@ -245,12 +246,12 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
return false; return false;
} }
} }
else if(command == gSavedSettings.getString("AscentCmdTeleportToCam")) else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdTeleportToCam")))
{ {
gAgent.teleportViaLocation(gAgent.getCameraPositionGlobal()); gAgent.teleportViaLocation(gAgent.getCameraPositionGlobal());
return false; return false;
} }
else if(command == gSavedSettings.getString("AscentCmdLineKeyToName")) else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineKeyToName")))
{ {
LLUUID targetKey; LLUUID targetKey;
if(i >> targetKey) if(i >> targetKey)
@@ -263,7 +264,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
} }
return false; return false;
} }
else if(command == gSavedSettings.getString("AscentCmdLineOfferTp")) else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineOfferTp")))
{ {
std::string avatarKey; std::string avatarKey;
// llinfos << "CMD DEBUG 0 " << command << " " << avatarName << llendl; // llinfos << "CMD DEBUG 0 " << command << " " << avatarName << llendl;
@@ -299,7 +300,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
} }
} }
else if(command == gSavedSettings.getString("AscentCmdLineGround")) else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineGround")))
{ {
LLVector3 agentPos = gAgent.getPositionAgent(); LLVector3 agentPos = gAgent.getPositionAgent();
U64 agentRegion = gAgent.getRegion()->getHandle(); U64 agentRegion = gAgent.getRegion()->getHandle();
@@ -308,7 +309,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
pos_global += LLVector3d((F64)targetPos.mV[0],(F64)targetPos.mV[1],(F64)targetPos.mV[2]); pos_global += LLVector3d((F64)targetPos.mV[0],(F64)targetPos.mV[1],(F64)targetPos.mV[2]);
gAgent.teleportViaLocation(pos_global); gAgent.teleportViaLocation(pos_global);
return false; return false;
}else if(command == gSavedSettings.getString("AscentCmdLineHeight")) }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineHeight")))
{ {
F32 z; F32 z;
if(i >> z) if(i >> z)
@@ -321,17 +322,17 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
gAgent.teleportViaLocation(pos_global); gAgent.teleportViaLocation(pos_global);
return false; return false;
} }
}else if(command == gSavedSettings.getString("AscentCmdLineTeleportHome")) }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineTeleportHome")))
{ {
gAgent.teleportHome(); gAgent.teleportHome();
return false; return false;
}else if(command == gSavedSettings.getString("AscentCmdLineRezPlatform")) }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineRezPlatform")))
{ {
F32 width; F32 width;
if (i >> width) cmdline_rezplat(false, width); if (i >> width) cmdline_rezplat(false, width);
else cmdline_rezplat(); else cmdline_rezplat();
return false; return false;
}else if(command == gSavedSettings.getString("AscentCmdLineMapTo")) }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineMapTo")))
{ {
if (revised_text.length() > command.length() + 1) //Typing this command with no argument was causing a crash. -Madgeek if (revised_text.length() > command.length() + 1) //Typing this command with no argument was causing a crash. -Madgeek
{ {
@@ -353,7 +354,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
LLURLDispatcher::dispatch(url, NULL, true); LLURLDispatcher::dispatch(url, NULL, true);
} }
return false; return false;
}else if(command == gSavedSettings.getString("AscentCmdLineCalc"))//Cryogenic Blitz }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineCalc")))//Cryogenic Blitz
{ {
bool success; bool success;
F32 result = 0.f; F32 result = 0.f;
@@ -382,7 +383,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
cmdline_printchat(out); cmdline_printchat(out);
return false; return false;
} }
}else if(command == gSavedSettings.getString("AscentCmdLineTP2")) }else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineTP2")))
{ {
if (revised_text.length() > command.length() + 1) //Typing this command with no argument was causing a crash. -Madgeek if (revised_text.length() > command.length() + 1) //Typing this command with no argument was causing a crash. -Madgeek
{ {
@@ -390,11 +391,6 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
cmdline_tp2name(name); cmdline_tp2name(name);
} }
return false; return false;
}else if (revised_text == "xyzzy")
{
//Zwag: I wonder how many people will actually get this?
cmdline_printchat("Nothing happens.");
return false;
}else if(command == "typingstop") }else if(command == "typingstop")
{ {
std::string text; std::string text;
@@ -403,7 +399,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
gChatBar->sendChatFromViewer(text, CHAT_TYPE_STOP, FALSE); gChatBar->sendChatFromViewer(text, CHAT_TYPE_STOP, FALSE);
} }
} }
else if(command == gSavedSettings.getString("AscentCmdLineClearChat")) else if(command == utf8str_tolower(gSavedSettings.getString("AscentCmdLineClearChat")))
{ {
LLFloaterChat* chat = LLFloaterChat::getInstance(LLSD()); LLFloaterChat* chat = LLFloaterChat::getInstance(LLSD());
if(chat) if(chat)
@@ -414,33 +410,6 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
history_editor_with_mute->clear(); history_editor_with_mute->clear();
return false; return false;
} }
}else if(command == "zdrop")
{
cmdline_printchat("lolZ");
std::string lolfolder;
if(i >> lolfolder)
{
cmdline_printchat("lolfolder");
std::stack<LLViewerInventoryItem*> lolstack;
LLDynamicArray<LLPointer<LLViewerInventoryItem> > lolinv = findInventoryInFolder(lolfolder);
for(LLDynamicArray<LLPointer<LLViewerInventoryItem> >::iterator it = lolinv.begin(); it != lolinv.end(); ++it)
{
LLViewerInventoryItem* item = *it;
lolstack.push(item);
}
if(lolstack.size())
{
cmdline_printchat("lolstack.size()");
std::string loldest;
if(i >> loldest)
{
cmdline_printchat("loldest");
LLUUID sdest = LLUUID(loldest);
new JCZface(lolstack, sdest, 2.5f);
}
}else cmdline_printchat("no size");
}
}else if(command == "invrepair") }else if(command == "invrepair")
{ {
invrepair(); invrepair();