Combine Marking from Minimap with Radar Mark

Color people right from the Radar!
Mark button on Radar now uses Red.

Removes "Radar.Mark" and its associated code
Thanks for the help on linux, Router!
This commit is contained in:
Liru Færs
2020-01-08 15:54:43 -05:00
parent 5ee5ba473b
commit 83b384ab97
5 changed files with 22 additions and 20 deletions

View File

@@ -134,8 +134,9 @@ namespace
}
} //namespace
const LLColor4* mm_getMarkerColor(const LLUUID& id);
LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string& name, const LLVector3d& position) :
mID(id), mName(name), mPosition(position), mMarked(false), mFocused(false),
mID(id), mName(name), mPosition(position), mMarked(mm_getMarkerColor(id)), mFocused(false),
mStats(),
mActivityType(ACTIVITY_NEW), mActivityTimer(),
mIsInList(false), mAge(-1), mTime(time(NULL))
@@ -348,7 +349,14 @@ void track_av(const LLUUID& id)
}
static void cmd_profile(const LLAvatarListEntry* entry);
static void cmd_toggle_mark(LLAvatarListEntry* entry);
static void cmd_toggle_mark(LLAvatarListEntry* entry)
{
bool mark = !entry->isMarked();
void mm_setcolor(LLUUID key, LLColor4 col);
void mm_clearMark(const LLUUID & id);
mark ? mm_setcolor(entry->getID(), LLColor4::red) : mm_clearMark(entry->getID());
entry->setMarked(mark);
}
static void cmd_ar(const LLAvatarListEntry* entry);
static void cmd_teleport(const LLAvatarListEntry* entry);
@@ -364,15 +372,6 @@ namespace
}
};
class RadarMark : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLFloaterAvatarList::instance().doCommand(cmd_toggle_mark);
return true;
}
};
class RadarFocus : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -415,7 +414,6 @@ void addMenu(view_listener_t* menu, const std::string& name);
void add_radar_listeners()
{
addMenu(new RadarTrack, "Radar.Track");
addMenu(new RadarMark, "Radar.Mark");
addMenu(new RadarFocus, "Radar.Focus");
addMenu(new RadarFocusPrev, "Radar.FocusPrev");
addMenu(new RadarFocusNext, "Radar.FocusNext");
@@ -779,7 +777,7 @@ void LLFloaterAvatarList::refreshAvatarList()
if (entry->isMarked())
{
mark.value = "X";
mark.color = LLColor4::blue;
mark.color = *mm_getMarkerColor(av_id);
mark.font_style = "BOLD";
}
element.columns.add(mark);
@@ -1449,7 +1447,6 @@ void send_estate_message(const std::string request, const std::vector<std::strin
static void cmd_append_names(const LLAvatarListEntry* entry, std::string &str, std::string &sep)
{ if(!str.empty())str.append(sep);str.append(entry->getName()); }
static void cmd_toggle_mark(LLAvatarListEntry* entry) { entry->toggleMark(); }
static void cmd_ar(const LLAvatarListEntry* entry) { LLFloaterReporter::showFromObject(entry->getID()); }
static void cmd_profile(const LLAvatarListEntry* entry) { LLAvatarActions::showProfile(entry->getID()); }
static void cmd_teleport(const LLAvatarListEntry* entry) { gAgent.teleportViaLocation(entry->getPosition()); }

View File

@@ -124,7 +124,7 @@ enum ACTIVITY_TYPE
bool isInList() const { return mIsInList; }
void toggleMark() { mMarked = !mMarked; }
void setMarked(bool marked) { mMarked = marked; }
struct uuidMatch
{

View File

@@ -1508,8 +1508,13 @@ bool LLScaleMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
//moymod - minimap color shit
void markMassAgents(const LLColor4& color)
{
auto radar = LLFloaterAvatarList::getInstance();
for (const auto& id : LFIDBearer::getActiveSelectedIDs())
{
mm_setcolor(id, color);
if (auto entry = radar ? radar->getAvatarEntry(id) : nullptr)
entry->setMarked(true);
}
}
bool mmsetred::handleEvent(LLPointer<LLEvent>, const LLSD&)
@@ -1539,8 +1544,13 @@ bool mmsetcustom::handleEvent(LLPointer<LLEvent>, const LLSD&)
}
bool mmsetunmark::handleEvent(LLPointer<LLEvent>, const LLSD&)
{
auto radar = LLFloaterAvatarList::getInstance();
for (const auto& id : LFIDBearer::getActiveSelectedIDs())
{
mm_clearMark(id);
if (auto entry = radar ? radar->getAvatarEntry(id) : nullptr)
entry->setMarked(false);
}
return true;
}
bool mmenableunmark::handleEvent(LLPointer<LLEvent>, const LLSD& userdata)

View File

@@ -210,10 +210,6 @@
</menu_item_call>
</menu>
<menu label="Hide Columns" name="Hide Columns" create_jump_keys="true">
<menu_item_check label="Mark" name="Mark">
<on_click function="ToggleControl" userdata="RadarColumnMarkHidden"/>
<on_check control="RadarColumnMarkHidden"/>
</menu_item_check>
<menu_item_check label="Position" name="Position">
<on_click function="ToggleControl" userdata="RadarColumnPositionHidden"/>
<on_check control="RadarColumnPositionHidden"/>

View File

@@ -24,7 +24,6 @@
<menu_item_call label="Enfocar Siguiente" name="Focus Next"/>
<menu_item_call label="Enfocar Anterior" name="Focus Previous"/>
<menu_item_separator/>
<menu_item_call label="Marcar/Desmarcar" name="Mark/Unmark"/>
<menu_item_call label="Enfocar Siguiente Marcado" name="Focus Next Marked"/>
<menu_item_call label="Enfocar Anterior Marcado" name="Focus Previous Marked"/>
</menu>