FIRE-9237: Added option to show teleport coordinates and date/time of teleport in the teleport history

master
Ansariel 2013-02-14 13:02:46 +01:00
parent fd993f10d8
commit d829faef75
6 changed files with 233 additions and 16 deletions

View File

@ -19880,9 +19880,31 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<integer>0</integer>
<key>Backup</key>
<integer>0</integer>
</map>
<key>FSTeleportHistoryShowPosition</key>
<map>
<key>Comment</key>
<string>Shows the local position within a region in the teleport history.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSTeleportHistoryShowDate</key>
<map>
<key>Comment</key>
<string>Shows the exact date and time in the teleport history.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -57,7 +57,10 @@ static const std::string COLLAPSED_BY_USER = "collapsed_by_user";
class LLTeleportHistoryFlatItem : public LLPanel
{
public:
LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name, const std::string &hl);
// <FS:Ansariel> Extended TP history
//LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name, const std::string &hl);
LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name, const LLDate& date, const LLVector3& local_pos, const std::string &hl);
// </FS:Ansariel>
virtual ~LLTeleportHistoryFlatItem();
virtual BOOL postBuild();
@ -71,6 +74,11 @@ public:
void setHighlightedText(const std::string& text);
void updateTitle();
// <FS:Ansariel> Extended TP history
void setDate(const LLDate& date);
void setLocalPos(const LLVector3& local_pos);
// </FS:Ansariel>
/*virtual*/ void setValue(const LLSD& value);
void onMouseEnter(S32 x, S32 y, MASK mask);
@ -93,6 +101,14 @@ private:
std::string mRegionName;
std::string mHighlight;
LLRootHandle<LLTeleportHistoryFlatItem> mItemHandle;
// <FS:Ansariel> Extended TP history
LLVector3 mLocalPos;
LLDate mDate;
LLTextBox* mDateBox;
LLTextBox* mLocalPosBox;
// </FS:Ansariel>
};
////////////////////////////////////////////////////////////////////////////////
@ -123,11 +139,18 @@ private:
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name, const std::string &hl)
// <FS:Ansariel> Extended TP history
//LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name, const std::string &hl)
LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name, const LLDate& date, const LLVector3& local_pos, const std::string &hl)
// </FS:Ansariel>
: LLPanel(),
mIndex(index),
mContextMenu(context_menu),
mRegionName(region_name),
// <FS:Ansariel> Extended TP history
mDate(date),
mLocalPos(local_pos),
// </FS:Ansariel>
mHighlight(hl)
{
buildFromFile( "panel_teleport_history_item.xml");
@ -142,6 +165,11 @@ BOOL LLTeleportHistoryFlatItem::postBuild()
{
mTitle = getChild<LLTextBox>("region");
// <FS:Ansariel> Extended TP history
mDateBox = getChild<LLTextBox>("date");
mLocalPosBox = getChild<LLTextBox>("position");
// </FS:Ansariel>
mProfileBtn = getChild<LLButton>("profile_btn");
mProfileBtn->setClickedCallback(boost::bind(&LLTeleportHistoryFlatItem::onProfileBtnClick, this));
@ -181,6 +209,18 @@ void LLTeleportHistoryFlatItem::setRegionName(const std::string& name)
mRegionName = name;
}
// <FS:Ansariel> Extended TP history
void LLTeleportHistoryFlatItem::setDate(const LLDate& date)
{
mDate = date;
}
void LLTeleportHistoryFlatItem::setLocalPos(const LLVector3& local_pos)
{
mLocalPos.set(local_pos);
}
// </FS:Ansariel>
void LLTeleportHistoryFlatItem::updateTitle()
{
static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", LLColor4U(255, 255, 255));
@ -190,6 +230,25 @@ void LLTeleportHistoryFlatItem::updateTitle()
LLStyle::Params().color(sFgColor),
mRegionName,
mHighlight);
// <FS:Ansariel> Extended TP history
LLTextUtil::textboxSetHighlightedVal(
mLocalPosBox,
LLStyle::Params().color(sFgColor),
llformat("%.0f, %.0f, %.0f", mLocalPos.mV[VX], mLocalPos.mV[VY], mLocalPos.mV[VZ]),
mHighlight);
LLSD args;
args["datetime"] = mDate.secondsSinceEpoch();
std::string date = getString("DateFmt");
LLStringUtil::format(date, args);
LLTextUtil::textboxSetHighlightedVal(
mDateBox,
LLStyle::Params().color(sFgColor),
date,
mHighlight);
// </FS:Ansariel>
}
void LLTeleportHistoryFlatItem::onMouseEnter(S32 x, S32 y, MASK mask)
@ -252,6 +311,12 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem (
const S32 cur_item_index,
const std::string &hl)
{
// <FS:Ansariel> Extended TP history
LLVector3 local_pos((F32)fmod(persistent_item.mGlobalPos.mdV[VX], (F64)REGION_WIDTH_METERS),
(F32)fmod(persistent_item.mGlobalPos.mdV[VY], (F64)REGION_WIDTH_METERS),
(F32)persistent_item.mGlobalPos.mdV[VZ]);
// </FS:Ansariel>
LLTeleportHistoryFlatItem* item = NULL;
if ( cur_item_index < (S32) mItems.size() )
{
@ -260,6 +325,10 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem (
{
item->setIndex(cur_item_index);
item->setRegionName(persistent_item.mTitle);
// <FS:Ansariel> Extended TP history
item->setDate(persistent_item.mDate);
item->setLocalPos(local_pos);
// </FS:Ansariel>
item->setHighlightedText(hl);
item->setVisible(TRUE);
item->updateTitle();
@ -276,6 +345,10 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem (
item = new LLTeleportHistoryFlatItem(cur_item_index,
context_menu,
persistent_item.mTitle,
// <FS:Ansariel> Extended TP history
persistent_item.mDate,
local_pos,
// </FS:Ansariel>
hl);
mItems.push_back(item->getItemHandle());
}

View File

@ -37,6 +37,11 @@
<check_box name="FSUseStandaloneTeleportHistoryFloater" label="Eigenes Fenster für Teleport-Liste verwenden" tool_tip="Falls aktiviert, wird bei Verwendung des Shortcuts für die Teleport-Liste diese in einem eigenen Fenster geöffnet."/>
<check_box name="FSUseStandalonePlaceDetailsFloater" label="Eigene Fenster für Landmarken, Ortsdetails und Teleport-Listen-Details verwenden" tool_tip="Falls aktiviert, werden Landmarken, Ortsdetails und Details zu Einträgen in der Teleport-Liste in eigenen Fenstern geöffnet."/>
<check_box name="FSUseStandaloneBlocklistFloater" label="Eigenes Fenster für die Liste ignorierter Einwohner &amp; Objekte verwenden" tool_tip="Falls aktiviert, wird die Liste der ignorierten Einwohner und Objekte in einem eigenen Fenster geöffnet."/>
<text name="ExtendedTeleportHistoryLabel" width="155">
Teleport-Liste erweitern um:
</text>
<check_box name="FSTeleportHistoryShowPosition" label="Position" tool_tip="Falls aktiviert, wird die Teleport-Liste um die Position innerhalb der teleportierten Region erweitert."/>
<check_box name="FSTeleportHistoryShowDate" label="Datum" tool_tip="Falls aktiviert, wird die Teleport-Liste um Datum und Uhrzeit der Teleports erweitert."/>
<text name="ScriptDialogsPerObjectLabel">
Skriptdialoge pro Objekt:
</text>

View File

@ -1,5 +1,18 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
<text name="region" value="..."/>
<panel.string name="DateFmt">
[day,datetime,local].[mthnum,datetime,local].[year,datetime,local], [hour,datetime,local]:[min,datetime,local]
</panel.string>
<layout_stack name="ls_item">
<layout_panel name="lp_region" width="170">
<text name="region" value="..." width="170"/>
</layout_panel>
<layout_panel name="lp_position">
<text name="position" value="0, 0, 0"/>
</layout_panel>
<layout_panel name="lp_date" width="100">
<text name="date" value="01.01.2000 12:00" width="100"/>
</layout_panel>
</layout_stack>
<button name="profile_btn" tool_tip="Objektinfo anzeigen"/>
</panel>

View File

@ -39,7 +39,7 @@
layout="topleft"
left="10"
name="UI Size:"
top_pad="10"
top_pad="8"
width="200">
UI Scaling (may have side effects):
</text>
@ -61,7 +61,7 @@
<text
type="string"
left="5"
top_pad="7"
top_pad="5"
length="1"
follows="left|top"
height="12"
@ -80,7 +80,7 @@
left_delta="10"
name="ShowHoverTips"
tool_tip="Set this to show hover tips on avatars and some other things - set this one first (CTRL+SHIFT+T)"
top_pad="12"
top_pad="5"
width="256" />
<check_box
control_name="ShowAllObjectHoverTip"
@ -113,7 +113,7 @@
layout="topleft"
left="275"
name="tooltip_textbox"
top_pad="-76"
top_pad="-70"
width="200">
Hovertip Trigger Delays:
</text>
@ -133,7 +133,7 @@
min_val="0"
name="ToolTipDelay_slider"
tool_tip="Delay after that tooltips for user interface elements such as buttons are shown. (Default: 0.7)"
top_pad="8"
top_pad="1"
width="200" />
<text
type="string"
@ -213,9 +213,9 @@
name="FSAdvancedTooltips"
label="Show extended information in hovertips (classic Phoenix style)"
layout="topleft"
top_pad="4"
top_pad="5"
left="15"
height="20"
height="16"
width="350" />
<check_box
@ -223,8 +223,8 @@
name="FSShowGroupTitleInTooltip"
label="Show avatar group titles in hovertips"
layout="topleft"
top_pad="0"
height="20"
top_pad="2"
height="16"
width="350" />
<check_box
@ -236,7 +236,7 @@
left="5"
name="UsePieMenu"
tool_tip="Use the classic V1.x circular menu instead of the rectangular context menus when right clicking on land, avatars, objects or attachments."
top_pad="8"
top_pad="5"
width="256" />
<check_box
@ -304,6 +304,40 @@
width="270"
tool_tip="If enabled, the list of blocked/muted residents and objects will open in a separate window."/>
<text
type="string"
left="5"
top_pad="2"
width="140"
follows="left|top"
height="16"
layout="topleft"
name="ExtendedTeleportHistoryLabel">
Extend teleport history by:
</text>
<check_box
top_delta="0"
control_name="FSTeleportHistoryShowPosition"
follows="left|top"
height="16"
name="FSTeleportHistoryShowPosition"
label="Position"
left_pad="5"
width="75"
tool_tip="If enabled, the local coordinates within the region will be shown in the teleport history."/>
<check_box
top_delta="0"
control_name="FSTeleportHistoryShowDate"
follows="left|top"
height="16"
name="FSTeleportHistoryShowDate"
label="Date"
left_pad="5"
width="75"
tool_tip="If enabled, the date and time of the teleport will be shown in the teleport history."/>
<text
type="string"
left="5"

View File

@ -7,6 +7,9 @@
name="teleport_history_item"
top="0"
width="380">
<panel.string name="DateFmt">
[mthnum,datetime,local]/[day,datetime,local]/[year,datetime,local], [hour12,datetime,local]:[min,datetime,local] [ampm,datetime,local]
</panel.string>
<icon
follows="top|right|left"
height="20"
@ -36,18 +39,85 @@
name="landmark_icon"
top="0"
width="16" />
<layout_stack
name="ls_item"
layout="topleft"
follows="all"
top="0"
left="21"
width="335"
height="25"
border_size="0"
orientation="horizontal">
<layout_panel
name="lp_region"
auto_resize="true"
height="25"
width="150"
layout="topleft"
visible="true"
follows="top|left|right">
<text
follows="left|right"
height="20"
layout="topleft"
left_pad="5"
parse_urls="false"
use_ellipses="true"
name="region"
text_color="White"
top="4"
value="..."
width="330" />
width="150" />
</layout_panel>
<layout_panel
visibility_control="FSTeleportHistoryShowPosition"
name="lp_position"
auto_resize="false"
height="25"
width="80"
layout="topleft"
follows="top|left|right">
<text
follows="left|right"
height="20"
layout="topleft"
parse_urls="false"
use_ellipses="true"
name="position"
text_color="White"
top="4"
value="0, 0, 0"
width="80" />
</layout_panel>
<layout_panel
visibility_control="FSTeleportHistoryShowDate"
name="lp_date"
auto_resize="false"
height="25"
width="120"
layout="topleft"
follows="top|left|right">
<text
follows="left|right"
height="20"
layout="topleft"
parse_urls="false"
use_ellipses="true"
name="date"
text_color="White"
top="4"
value="01/01/2000 12:00PM"
width="120" />
</layout_panel>
</layout_stack>
<button
follows="right"
height="20"