Skip to content

Commit aae4281

Browse files
committed
#2696 Viewer crashes on gestures : add checkbox 'Play all infinitely'
1 parent 5590735 commit aae4281

File tree

3 files changed

+61
-6
lines changed

3 files changed

+61
-6
lines changed

indra/newview/llfloatergesture.cpp

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
#include "llagent.h"
3838
#include "llappearancemgr.h"
39+
#include "llcheckboxctrl.h"
3940
#include "llclipboard.h"
4041
#include "llgesturemgr.h"
4142
#include "llkeyboard.h"
@@ -208,9 +209,12 @@ bool LLFloaterGesture::postBuild()
208209
getChild<LLUICtrl>("new_gesture_btn")->setCommitCallback(boost::bind(&LLFloaterGesture::onClickNew, this));
209210
getChild<LLButton>("del_btn")->setClickedCallback(boost::bind(&LLFloaterGesture::onDeleteSelected, this));
210211

211-
getChildView("play_btn")->setVisible( true);
212-
getChildView("stop_btn")->setVisible( false);
212+
getChildView("play_btn")->setVisible(true);
213+
getChildView("stop_btn")->setVisible(false);
213214
setDefaultBtn("play_btn");
215+
216+
mPlayAllInfinitely = getChild<LLCheckBoxCtrl>("play_all_infinitely");
217+
214218
mGestureFolderID = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE);
215219

216220
uuid_vec_t folders;
@@ -237,6 +241,47 @@ bool LLFloaterGesture::postBuild()
237241
return true;
238242
}
239243

244+
void LLFloaterGesture::draw()
245+
{
246+
LLFloater::draw();
247+
248+
static LLCachedControl<bool> sQAMode(gSavedSettings, "QAMode", false);
249+
if (!sQAMode)
250+
{
251+
mPlayAllInfinitely->setVisible(false);
252+
}
253+
else
254+
{
255+
if (!mPlayAllInfinitely->getVisible())
256+
{
257+
mPlayAllInfinitely->setValue(false);
258+
mPlayAllInfinitely->setVisible(true);
259+
}
260+
else if (mPlayAllInfinitely->getValue().asBoolean())
261+
{
262+
static U8 frame_nr = 0;
263+
if (++frame_nr > 3)
264+
{
265+
frame_nr = 0;
266+
}
267+
else if (frame_nr == 1)
268+
{
269+
onClickPlay();
270+
}
271+
else if (frame_nr == 3)
272+
{
273+
LLScrollListItem* prev_item = mGestureList->getFirstSelected();
274+
mGestureList->selectNextItem();
275+
LLScrollListItem* next_item = mGestureList->getFirstSelected();
276+
if (next_item == prev_item)
277+
{
278+
mGestureList->selectFirstItem();
279+
}
280+
mGestureList->scrollToShowSelected();
281+
}
282+
}
283+
}
284+
}
240285

241286
void LLFloaterGesture::refreshAll()
242287
{

indra/newview/llfloatergesture.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class LLView;
4040
class LLButton;
4141
class LLLineEditor;
4242
class LLComboBox;
43+
class LLCheckBoxCtrl;
4344
class LLViewerGesture;
4445
class LLGestureOptions;
4546
class LLScrollListCtrl;
@@ -57,20 +58,22 @@ class LLFloaterGesture
5758
virtual ~LLFloaterGesture();
5859

5960
virtual bool postBuild();
60-
virtual void done ();
61+
virtual void draw();
62+
virtual void done();
6163
void refreshAll();
6264
/**
6365
* @brief Add new scrolllistitem into gesture_list.
6466
* @param item_id inventory id of gesture
6567
* @param gesture can be NULL , if item was not loaded yet
6668
*/
67-
void addGesture(const LLUUID& item_id, LLMultiGesture* gesture, LLCtrlListInterface * list);
69+
void addGesture(const LLUUID& item_id, LLMultiGesture* gesture, LLCtrlListInterface* list);
6870

6971
protected:
7072
// Reads from the gesture manager's list of active gestures
7173
// and puts them in this list.
7274
void buildGestureList();
7375
void playGesture(LLUUID item_id);
76+
7477
private:
7578
void addToCurrentOutFit();
7679
/**
@@ -102,7 +105,7 @@ class LLFloaterGesture
102105
LLUUID mSelectedID;
103106
LLUUID mGestureFolderID;
104107
LLScrollListCtrl* mGestureList;
105-
108+
LLCheckBoxCtrl* mPlayAllInfinitely;
106109
LLFloaterGestureObserver* mObserver;
107110
};
108111

indra/newview/skins/default/xui/en/floater_gesture.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
label="Places"
1313
layout="topleft"
1414
min_height="350"
15-
min_width="240"
15+
min_width="313"
1616
width="313">
1717
<floater.string
1818
name="loading">
@@ -144,4 +144,11 @@
144144
name="stop_btn"
145145
top_delta="0"
146146
width="83" />
147+
<check_box
148+
name="play_all_infinitely"
149+
label="Play all infinitely"
150+
follows="bottom|right"
151+
left_pad="5"
152+
height="15"
153+
width="100"/>
147154
</floater>

0 commit comments

Comments
 (0)