added toolbar button for radar, made option to disable lookat completely, changed groundsit hotkey and made it allow standing as well

This commit is contained in:
Hazim Gazov
2010-04-05 13:31:42 -03:00
parent 0b7b99d2d1
commit a5ba51d715
8 changed files with 49 additions and 24 deletions

View File

@@ -12681,5 +12681,16 @@
<integer>473</integer> <integer>473</integer>
</array> </array>
</map> </map>
<key>RadarListBtnState</key>
<map>
<key>Comment</key>
<string />
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map> </map>
</llsd> </llsd>

View File

@@ -73,12 +73,9 @@ BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVecto
{ {
if (object && target_type != LOOKAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAt")) if (object && target_type != LOOKAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAt"))
{ {
if ((object->getPositionGlobal() - gAgent.getPositionGlobal()).magVec() > 20.0) target_type = LOOKAT_TARGET_NONE;
{ object = mAvatarObject;
target_type = LOOKAT_TARGET_NONE; position.clearVec();
object = mAvatarObject;
position.clearVec();
}
} }
if(object && object->isAttachment()) if(object && object->isAttachment())
@@ -114,12 +111,9 @@ BOOL LLAgent::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVec
if (object && target_type != POINTAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAt")) if (object && target_type != POINTAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAt"))
{ {
if ((object->getPositionGlobal() - gAgent.getPositionGlobal()).magVec() > 20.0) target_type = POINTAT_TARGET_NONE;
{ object = NULL;
target_type = POINTAT_TARGET_NONE; position.clearVec();
object = NULL;
position.clearVec();
}
} }
if(!mPointAt || mPointAt->isDead()) if(!mPointAt || mPointAt->isDead())

View File

@@ -53,6 +53,7 @@
#include "llfloaterchatterbox.h" #include "llfloaterchatterbox.h"
#include "llfloaterfriends.h" #include "llfloaterfriends.h"
#include "llfloatersnapshot.h" #include "llfloatersnapshot.h"
#include "llfloateravatarlist.h"
#include "lltoolmgr.h" #include "lltoolmgr.h"
#include "llui.h" #include "llui.h"
#include "llviewermenu.h" #include "llviewermenu.h"
@@ -128,8 +129,8 @@ BOOL LLToolBar::postBuild()
childSetAction("appearance_btn", onClickAppearance, this); childSetAction("appearance_btn", onClickAppearance, this);
childSetControlName("appearance_btn", ""); childSetControlName("appearance_btn", "");
childSetAction("fly_btn", onClickFly, this); childSetAction("radar_list_btn", onClickRadarList, this);
childSetControlName("fly_btn", "FlyBtnState"); childSetControlName("radar_list_btn", "RadarListBtnState");
childSetAction("sit_btn", onClickSit, this); childSetAction("sit_btn", onClickSit, this);
childSetControlName("sit_btn", "SitBtnState"); childSetControlName("sit_btn", "SitBtnState");
@@ -449,6 +450,17 @@ void LLToolBar::onClickAppearance(void*)
} }
} }
// static
void LLToolBar::onClickRadarList(void*)
{
LLFloaterAvatarList::toggle(0);
bool vis = false;
if(LLFloaterAvatarList::getInstance())
{
vis = (bool)LLFloaterAvatarList::getInstance()->getVisible();
}
}
// static // static
void LLToolBar::onClickFly(void*) void LLToolBar::onClickFly(void*)

View File

@@ -82,6 +82,7 @@ public:
static void onClickRadar(void* data); static void onClickRadar(void* data);
static void onClickMap(void* data); static void onClickMap(void* data);
static void onClickInventory(void* data); static void onClickInventory(void* data);
static void onClickRadarList(void* data);
static F32 sInventoryAutoOpenTime; static F32 sInventoryAutoOpenTime;

View File

@@ -4906,9 +4906,16 @@ class LLWorldSitOnGround : public view_listener_t
{ {
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{ {
if (gAgent.getAvatarObject() && !gAgent.getAvatarObject()->mIsSitting) if (gAgent.getAvatarObject())
{ {
gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); if(!gAgent.getAvatarObject()->mIsSitting)
{
gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
}
else
{
gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
}
} }
return true; return true;
} }
@@ -4918,7 +4925,7 @@ class LLWorldEnableSitOnGround : public view_listener_t
{ {
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{ {
bool new_value = (gAgent.getAvatarObject() && !gAgent.getAvatarObject()->mIsSitting); bool new_value = (gAgent.getAvatarObject());
gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
return true; return true;
} }

View File

@@ -449,7 +449,7 @@
<on_check function="World.CheckAlwaysRun" userdata="" /> <on_check function="World.CheckAlwaysRun" userdata="" />
</menu_item_check> </menu_item_check>
<menu_item_call bottom="-67" enabled="true" height="19" label="Sit on Ground" left="0" <menu_item_call bottom="-67" enabled="true" height="19" label="Sit on Ground" left="0"
mouse_opaque="true" name="Sit on Ground" shortcut="control|alt|shift|S" width="185"> mouse_opaque="true" name="Sit on Ground" shortcut="control|alt|S" width="185">
<on_click function="World.SitOnGround" userdata="" /> <on_click function="World.SitOnGround" userdata="" />
<on_enable function="World.EnableSitOnGround" userdata="" /> <on_enable function="World.EnableSitOnGround" userdata="" />
</menu_item_call> </menu_item_call>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel top="20" left="10" height="400" width="517" follows="left|top|right|bottom" <panel top="20" left="10" height="400" width="517" follows="left|top|right|bottom"
border="true" label="The Features Are Inert" name="inert" enabled="true" mouse_opaque="true"> border="true" label="Inert Prefs" name="inert" enabled="true" mouse_opaque="true">
<tab_container label="Inertia" bottom="0" height="408" width="500" left="0" <tab_container label="Inertia" bottom="0" height="408" width="500" left="0"
name="Inert Prefs" tab_min_width="90" tab_position="top"> name="Inert Prefs" tab_min_width="90" tab_position="top">
<panel border="true" left="1" bottom="-408" height="408" width="500" mouse_opaque="true" <panel border="true" left="1" bottom="-408" height="408" width="500" mouse_opaque="true"
@@ -114,7 +114,7 @@
width="400" /> width="400" />
<check_box bottom_delta="-20" control_name="PrivateLookAt" enabled="true" <check_box bottom_delta="-20" control_name="PrivateLookAt" enabled="true"
follows="left|top" font="SansSerifSmall" height="16" initial_value="false" follows="left|top" font="SansSerifSmall" height="16" initial_value="false"
label="Do not look at or point to objects beyond 20m (defeats ShowLookAt)" left="10" label="Do not look at or point to objects (defeats ShowLookAt)" left="10"
mouse_opaque="true" name="private_look_at_check" radio_style="false" mouse_opaque="true" name="private_look_at_check" radio_style="false"
width="400" /> width="400" />
<check_box bottom_delta="-20" control_name="RevokePermsOnStandUp" enabled="true" <check_box bottom_delta="-20" control_name="RevokePermsOnStandUp" enabled="true"

View File

@@ -18,13 +18,13 @@
list_position="above" list_position="above"
width="50" follows="left|right" user_resize="false"/> width="50" follows="left|right" user_resize="false"/>
<icon image_name="spacer24.tga" width="2" height="2" follows="left|right" auto_resize="false" color="0,0,0,0"/> <icon image_name="spacer24.tga" width="2" height="2" follows="left|right" auto_resize="false" color="0,0,0,0"/>
<button bottom="0" font="SansSerif" height="24" label="Fly" <button bottom="0" font="SansSerif" height="24" label="Radar"
image_overlay="icn_toolbar_fly.tga" image_overlay_alignment="left" image_overlay="icn_toolbar_radar.tga" image_overlay_alignment="left"
image_selected="toolbar_btn_selected.tga" image_selected="toolbar_btn_selected.tga"
image_unselected="toolbar_btn_enabled.tga" image_unselected="toolbar_btn_enabled.tga"
image_disabled="toolbar_btn_disabled.tga" scale_image="true" image_disabled="toolbar_btn_disabled.tga" scale_image="true"
label_selected="Stop Flying" left="0" name="fly_btn" label_selected="Radar" left="0" name="radar_list_btn"
tool_tip="Start flying. Use E/C or PgUp/PgDn to fly up and down." tool_tip="View a list of nearby avatars."
width="50" follows="left|right" user_resize="false"/> width="50" follows="left|right" user_resize="false"/>
<button bottom="0" font="SansSerif" height="24" label="Snapshot" left="0" <button bottom="0" font="SansSerif" height="24" label="Snapshot" left="0"
image_overlay="icn_toolbar_snapshot.tga" image_overlay_alignment="left" image_overlay="icn_toolbar_snapshot.tga" image_overlay_alignment="left"