// static void LLFloaterGesture::onClickInventory(void* data) { LLFloaterGesture* self = (LLFloaterGesture*)data; LLCtrlListInterface *list = self->childGetListInterface("gesture_list"); if (!list) return; const LLUUID& item_id = list->getCurrentID(); LLInventoryView* inv = LLInventoryView::showAgentInventory(); if (!inv) return; inv->getPanel()->setSelection(item_id, TRUE); }
void fire(const LLUUID &inv_item) { if(mFloater) { mFloater->addGesture(inv_item,NULL,mFloater->getChild<LLScrollListCtrl>("gesture_list")); // EXP-1909 (Pasted gesture displayed twice) // The problem is that addGesture is called here for the second time for the same item (which is copied) // First time addGesture is called from LLFloaterGestureObserver::changed(), which is a callback for inventory // change. So we need to refresh the gesture list to avoid duplicates. mFloater->refreshAll(); } }
void fire(const LLUUID &inv_item) { if(mFloater) { mFloater->addGesture(inv_item,NULL,mFloater->getChild<LLScrollListCtrl>("gesture_list")); } }
// static void LLFloaterGesture::onClickPlay(void* data) { LLFloaterGesture* self = (LLFloaterGesture*)data; LLCtrlListInterface *list = self->childGetListInterface("gesture_list"); if (!list) return; const LLUUID& item_id = list->getCurrentID(); if (gGestureManager.isGesturePlaying(item_id)) { gGestureManager.stopGesture(item_id); } else { gGestureManager.playGesture(item_id); } }
// static void LLFloaterGesture::onClickEdit(void* data) { LLFloaterGesture* self = (LLFloaterGesture*)data; LLCtrlListInterface *list = self->childGetListInterface("gesture_list"); if (!list) return; const LLUUID& item_id = list->getCurrentID(); LLInventoryItem* item = gInventory.getItem(item_id); if (!item) return; std::string title("Gesture: "); title.append(item->getName()); LLPreviewGesture* previewp = LLPreviewGesture::show(title, item_id, LLUUID::null); if (!previewp->getHost()) { previewp->setRect(gFloaterView->findNeighboringPosition(self, previewp)); } }
// static void LLFloaterGesture::onCommitList(LLUICtrl* ctrl, void* data) { LLFloaterGesture* self = (LLFloaterGesture*)data; const LLUUID& item_id = self->childGetValue("gesture_list").asUUID(); self->mSelectedID = item_id; if (gGestureManager.isGesturePlaying(item_id)) { self->childSetVisible("play_btn", false); self->childSetVisible("stop_btn", true); } else { self->childSetVisible("play_btn", true); self->childSetVisible("stop_btn", false); } }
// static void LLFloaterGesture::show() { if (sInstance) { sInstance->open(); /*Flawfinder: ignore*/ return; } LLFloaterGesture *self = new LLFloaterGesture(); // Builds and adds to gFloaterView LLUICtrlFactory::getInstance()->buildFloater(self, "floater_gesture.xml"); // Fix up rectangle LLRect rect = gSavedSettings.getRect("FloaterGestureRect2"); self->reshape(rect.getWidth(), rect.getHeight()); self->setRect(rect); self->buildGestureList(); self->childSetFocus("gesture_list"); LLCtrlListInterface *list = self->childGetListInterface("gesture_list"); if (list) { const BOOL ascending = TRUE; list->sortByColumn(std::string("name"), ascending); list->selectFirstItem(); } self->mSelectedID = LLUUID::null; // Update button labels onCommitList(NULL, self); self->open(); /*Flawfinder: ignore*/ }