FIRE-30873: Make resetting joints a double click

to make accidents less prevalent
meow-7.2.2
Angeldark Raymaker 2024-10-02 17:04:51 +01:00
parent 8a28615634
commit c115f575a1
3 changed files with 23 additions and 1 deletions

View File

@ -510,6 +510,12 @@ void FSFloaterPoser::onClickBrowsePoseCache()
void FSFloaterPoser::onPoseJointsReset()
{
// This is a double-click function: it needs to run twice within some amount of time to complete.
auto timeIntervalSinceLastClick = std::chrono::system_clock::now() - _timeLastClickedJointReset;
_timeLastClickedJointReset = std::chrono::system_clock::now();
if (timeIntervalSinceLastClick > _doubleClickInterval)
return;
LLVOAvatar *avatar = getUiSelectedAvatar();
if (!avatar)
return;

View File

@ -279,7 +279,23 @@ class FSFloaterPoser : public LLFloater
/// The smallest text embiggens the noble selection.
/// </summary>
void refreshTextEmbiggeningOnAllScrollLists();
/// <summary>
/// Applies the appropriate font-face (such as bold) to the text of the supplied list, to indicate use.
/// </summary>
/// <param name="listName">The name of the list to adjust text-face for.</param>
/// <param name="avatar">The avatar to whom the list is relevant.</param>
void addBoldToScrollList(std::string listName, LLVOAvatar *avatar);
/// <summary>
/// The time when the last click of a button was made.
/// </summary>
std::chrono::system_clock::time_point _timeLastClickedJointReset = std::chrono::system_clock::now();
/// <summary>
/// The constant time interval, in seconds, a user must click twice within to successfully double-click a button.
/// </summary>
std::chrono::duration<double> const _doubleClickInterval = std::chrono::duration<double>(0.3);
};
#endif

View File

@ -652,7 +652,7 @@ width="565">
image_overlay="Inv_TrashOpen"
image_unselected="Toolbar_Middle_Off"
name="refresh_avatars"
tool_tip="Reset all selected body parts to when you first started"
tool_tip="Double click to reset all selected body parts to when you first started posing"
width="20"
top_delta="0"
left_pad="1">