Added commandline for Fake Away Status.

Users can turn on and off the fake away status by typing a command.
Can be placed inside gesture to be performed together with going away.
This commit is contained in:
Lirusaito
2012-02-08 00:35:42 -05:00
parent c294456e2a
commit fec75d9436
6 changed files with 27 additions and 0 deletions

View File

@@ -620,5 +620,16 @@
<key>Value</key> <key>Value</key>
<string>tp2</string> <string>tp2</string>
</map> </map>
<key>SinguCmdLineAway</key>
<map>
<key>Comment</key>
<string>Toggle Fake Away Status.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>/away</string>
</map>
</map> </map>
</llsd> </llsd>

View File

@@ -71,6 +71,7 @@ LLPrefsAscentSys::LLPrefsAscentSys()
childSetCommitCallback("AscentCmdLineOfferTp", onCommitCmdLine, this); childSetCommitCallback("AscentCmdLineOfferTp", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineMapTo", onCommitCmdLine, this); childSetCommitCallback("AscentCmdLineMapTo", onCommitCmdLine, this);
childSetCommitCallback("AscentCmdLineTP2", onCommitCmdLine, this); childSetCommitCallback("AscentCmdLineTP2", onCommitCmdLine, this);
childSetCommitCallback("SinguCmdLineAway", onCommitCmdLine, this);
refreshValues(); refreshValues();
refresh(); refresh();
@@ -169,6 +170,7 @@ void LLPrefsAscentSys::onCommitCmdLine(LLUICtrl* ctrl, void* user_data)
self->childSetEnabled("AscentCmdLineMapTo", enabled); self->childSetEnabled("AscentCmdLineMapTo", enabled);
self->childSetEnabled("map_to_keep_pos", enabled); self->childSetEnabled("map_to_keep_pos", enabled);
self->childSetEnabled("AscentCmdLineTP2", enabled); self->childSetEnabled("AscentCmdLineTP2", enabled);
self->childSetEnabled("SinguCmdLineAway", enabled);
} }
gSavedSettings.setString("AscentCmdLinePos", self->childGetValue("AscentCmdLinePos")); gSavedSettings.setString("AscentCmdLinePos", self->childGetValue("AscentCmdLinePos"));
@@ -184,6 +186,7 @@ void LLPrefsAscentSys::onCommitCmdLine(LLUICtrl* ctrl, void* user_data)
gSavedSettings.setString("AscentCmdLineOfferTp", self->childGetValue("AscentCmdLineOfferTp")); gSavedSettings.setString("AscentCmdLineOfferTp", self->childGetValue("AscentCmdLineOfferTp"));
gSavedSettings.setString("AscentCmdLineMapTo", self->childGetValue("AscentCmdLineMapTo")); gSavedSettings.setString("AscentCmdLineMapTo", self->childGetValue("AscentCmdLineMapTo"));
gSavedSettings.setString("AscentCmdLineTP2", self->childGetValue("AscentCmdLineTP2")); gSavedSettings.setString("AscentCmdLineTP2", self->childGetValue("AscentCmdLineTP2"));
gSavedSettings.setString("SinguCmdLineAway", self->childGetValue("SinguCmdLineAway"));
} }
void LLPrefsAscentSys::refreshValues() void LLPrefsAscentSys::refreshValues()
@@ -225,6 +228,7 @@ void LLPrefsAscentSys::refreshValues()
mCmdLineMapTo = gSavedSettings.getString("AscentCmdLineMapTo"); mCmdLineMapTo = gSavedSettings.getString("AscentCmdLineMapTo");
mCmdMapToKeepPos = gSavedSettings.getBOOL("AscentMapToKeepPos"); mCmdMapToKeepPos = gSavedSettings.getBOOL("AscentMapToKeepPos");
mCmdLineTP2 = gSavedSettings.getString("AscentCmdLineTP2"); mCmdLineTP2 = gSavedSettings.getString("AscentCmdLineTP2");
mCmdLineAway = gSavedSettings.getString("SinguCmdLineAway");
//Security ---------------------------------------------------------------------------- //Security ----------------------------------------------------------------------------
mBroadcastViewerEffects = gSavedSettings.getBOOL("BroadcastViewerEffects"); mBroadcastViewerEffects = gSavedSettings.getBOOL("BroadcastViewerEffects");
@@ -276,6 +280,7 @@ void LLPrefsAscentSys::refresh()
childSetEnabled("AscentCmdLineMapTo", mCmdLine); childSetEnabled("AscentCmdLineMapTo", mCmdLine);
childSetEnabled("map_to_keep_pos", mCmdLine); childSetEnabled("map_to_keep_pos", mCmdLine);
childSetEnabled("AscentCmdLineTP2", mCmdLine); childSetEnabled("AscentCmdLineTP2", mCmdLine);
childSetEnabled("SinguCmdLineAway", mCmdLine);
childSetValue("AscentCmdLinePos", mCmdLinePos); childSetValue("AscentCmdLinePos", mCmdLinePos);
childSetValue("AscentCmdLineGround", mCmdLineGround); childSetValue("AscentCmdLineGround", mCmdLineGround);
@@ -290,6 +295,7 @@ void LLPrefsAscentSys::refresh()
childSetValue("AscentCmdLineOfferTp", mCmdLineOfferTp); childSetValue("AscentCmdLineOfferTp", mCmdLineOfferTp);
childSetValue("AscentCmdLineMapTo", mCmdLineMapTo); childSetValue("AscentCmdLineMapTo", mCmdLineMapTo);
childSetValue("AscentCmdLineTP2", mCmdLineTP2); childSetValue("AscentCmdLineTP2", mCmdLineTP2);
childSetValue("SinguCmdLineAway", mCmdLineAway);
} }
void LLPrefsAscentSys::cancel() void LLPrefsAscentSys::cancel()
@@ -330,6 +336,7 @@ void LLPrefsAscentSys::cancel()
gSavedSettings.setString("AscentCmdLineMapTo", mCmdLineMapTo); gSavedSettings.setString("AscentCmdLineMapTo", mCmdLineMapTo);
gSavedSettings.setBOOL("AscentMapToKeepPos", mCmdMapToKeepPos); gSavedSettings.setBOOL("AscentMapToKeepPos", mCmdMapToKeepPos);
gSavedSettings.setString("AscentCmdLineTP2", mCmdLineTP2); gSavedSettings.setString("AscentCmdLineTP2", mCmdLineTP2);
gSavedSettings.setString("SinguCmdLineAway", mCmdLineAway);
//Security ---------------------------------------------------------------------------- //Security ----------------------------------------------------------------------------
gSavedSettings.setBOOL("BroadcastViewerEffects", mBroadcastViewerEffects); gSavedSettings.setBOOL("BroadcastViewerEffects", mBroadcastViewerEffects);

View File

@@ -88,6 +88,7 @@ protected:
std::string mCmdLineMapTo; std::string mCmdLineMapTo;
BOOL mCmdMapToKeepPos; BOOL mCmdMapToKeepPos;
std::string mCmdLineTP2; std::string mCmdLineTP2;
std::string mCmdLineAway;
//Security ---------------------------------------------------------------------------- //Security ----------------------------------------------------------------------------
BOOL mBroadcastViewerEffects; BOOL mBroadcastViewerEffects;

View File

@@ -55,6 +55,7 @@
#include "llfloateravatarlist.h" #include "llfloateravatarlist.h"
#include "llviewerobjectlist.h" #include "llviewerobjectlist.h"
#include "llviewertexteditor.h" #include "llviewertexteditor.h"
#include "llviewermenu.h"
#include "llvoavatar.h" #include "llvoavatar.h"
#include "lltooldraganddrop.h" #include "lltooldraganddrop.h"
#include "llinventorymodel.h" #include "llinventorymodel.h"
@@ -398,6 +399,10 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
cmdline_tp2name(name); cmdline_tp2name(name);
} }
return false; return false;
}else if(command == utf8str_tolower(gSavedSettings.getString("SinguCmdLineAway")))
{
handle_fake_away_status(NULL);
return false;
}else if(command == "typingstop") }else if(command == "typingstop")
{ {
std::string text; std::string text;

View File

@@ -99,6 +99,7 @@ bool toggle_build_mode();
void handle_object_build(void*); void handle_object_build(void*);
void handle_save_snapshot(void *); void handle_save_snapshot(void *);
void handle_toggle_flycam(); void handle_toggle_flycam();
void handle_fake_away_status(void*);
bool handle_sit_or_stand(); bool handle_sit_or_stand();
bool handle_give_money_dialog(); bool handle_give_money_dialog();

View File

@@ -74,6 +74,8 @@
<check_box bottom_delta="-24" follows="top" initial_value="false" label="Use same position between sims" name="map_to_keep_pos" control_name="AscentMapToKeepPos"/> <check_box bottom_delta="-24" follows="top" initial_value="false" label="Use same position between sims" name="map_to_keep_pos" control_name="AscentMapToKeepPos"/>
<text bottom_delta="-18" follows="top" height="16" name="cmd_line_text_13">Teleport to avatar (usage: cmd name)</text> <text bottom_delta="-18" follows="top" height="16" name="cmd_line_text_13">Teleport to avatar (usage: cmd name)</text>
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-20" follows="top" height="20" max_length="256" tool_tip="The syntax of this command allows partial names and is not case sensitive. Better results if used while the Radar is open." name="AscentCmdLineTP2" width="200"/> <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-20" follows="top" height="20" max_length="256" tool_tip="The syntax of this command allows partial names and is not case sensitive. Better results if used while the Radar is open." name="AscentCmdLineTP2" width="200"/>
<text bottom_delta="-18" follows="top" height="16" name="cmd_line_text_14">Toggle Fake Away Status (usage: cmd)</text>
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="-20" follows="top" height="20" max_length="256" name="SinguCmdLineAway" width="200"/>
</panel> </panel>
<panel border="true" left="1" bottom="-408" height="408" width="500" label="Security" name="Security"> <panel border="true" left="1" bottom="-408" height="408" width="500" label="Security" name="Security">