Random cleanup lines here and there before I refactor the AO entirely

This commit is contained in:
Lirusaito
2019-01-10 17:44:13 -05:00
parent da2a9a5bf5
commit 0c585aca39
2 changed files with 18 additions and 40 deletions

View File

@@ -303,13 +303,13 @@ BOOL LLFloaterAO::postBuild()
getChild<LLComboBox>("gsits")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("gsits")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1));
getChild<LLComboBox>("crouchs")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("crouchs")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1));
getChild<LLComboBox>("cwalks")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("cwalks")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1));
getChild<LLComboBox>("falls")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("falls")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
getChild<LLComboBox>("hovers")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("hovers")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
getChild<LLComboBox>("flys")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("flys")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
getChild<LLComboBox>("flyslows")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("flyslows")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
getChild<LLComboBox>("flyups")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("flyups")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
getChild<LLComboBox>("flydowns")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("flydowns")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
getChild<LLComboBox>("lands")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit,_1)); getChild<LLComboBox>("lands")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
getChild<LLComboBox>("typings")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1)); getChild<LLComboBox>("typings")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
getChild<LLComboBox>("floats")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1)); getChild<LLComboBox>("floats")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
getChild<LLComboBox>("swims")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1)); getChild<LLComboBox>("swims")->setCommitCallback(boost::bind(&LLFloaterAO::onComboBoxCommit, _1));
@@ -717,8 +717,7 @@ void LLFloaterAO::run()
} }
else else
{ {
if (state == STATE_AGENT_SIT) gAgent.sendAnimationRequest(GetAnimIDFromState(state), (gSavedSettings.getBOOL("AOEnabled") && gSavedSettings.getBOOL("AOSitsEnabled")) ? ANIM_REQUEST_START : ANIM_REQUEST_STOP); gAgent.sendAnimationRequest(GetAnimIDFromState(state), (gSavedSettings.getBOOL("AOEnabled") && (state != STATE_AGENT_SIT || gSavedSettings.getBOOL("AOSitsEnabled"))) ? ANIM_REQUEST_START : ANIM_REQUEST_STOP);
else gAgent.sendAnimationRequest(GetAnimIDFromState(state), gSavedSettings.getBOOL("AOEnabled") ? ANIM_REQUEST_START : ANIM_REQUEST_STOP);
} }
} }
@@ -938,12 +937,8 @@ BOOL LLFloaterAO::startMotion(const LLUUID& id, F32 time_offset, BOOL stand)
{ {
if (id.notNull()) if (id.notNull())
{ {
BOOL sitting = FALSE; if (gAgentAvatarp && gAgentAvatarp->isSitting())
if (gAgentAvatarp) return FALSE;
{
sitting = gAgentAvatarp->isSitting();
}
if (sitting) return FALSE;
gAgent.sendAnimationRequest(id, ANIM_REQUEST_START); gAgent.sendAnimationRequest(id, ANIM_REQUEST_START);
return TRUE; return TRUE;
} }
@@ -1502,23 +1497,11 @@ BOOL LLFloaterAO::SetDefault(void* userdata, LLUUID ao_id, std::string defaultan
class ObjectNameMatches : public LLInventoryCollectFunctor class ObjectNameMatches : public LLInventoryCollectFunctor
{ {
public: public:
ObjectNameMatches(std::string name) ObjectNameMatches(std::string name) : sName(name) {}
{
sName = name;
}
virtual ~ObjectNameMatches() {} virtual ~ObjectNameMatches() {}
virtual bool operator()(LLInventoryCategory* cat, virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item)
LLInventoryItem* item)
{ {
if(item) return item && item->getParentUUID() == LLFloaterAO::invfolderid && item->getName() == sName;
{
if (item->getParentUUID() == LLFloaterAO::invfolderid)
{
return (item->getName() == sName);
}
return false;
}
return false;
} }
private: private:
std::string sName; std::string sName;
@@ -1526,16 +1509,11 @@ private:
const LLUUID& LLFloaterAO::getAssetIDByName(const std::string& name) const LLUUID& LLFloaterAO::getAssetIDByName(const std::string& name)
{ {
if (name.empty() || !(LLInventoryModelBackgroundFetch::instance().isEverythingFetched())) return LLUUID::null; if (name.empty() || !LLInventoryModelBackgroundFetch::instance().isEverythingFetched()) return LLUUID::null;
LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryCategory::cat_array_t cats;
LLViewerInventoryItem::item_array_t items; LLViewerInventoryItem::item_array_t items;
ObjectNameMatches objectnamematches(name); gInventory.collectDescendentsIf(LLUUID::null,cats,items,FALSE, ObjectNameMatches(name));
gInventory.collectDescendentsIf(LLUUID::null,cats,items,FALSE,objectnamematches);
if (items.size()) return items.size() ? items[0]->getAssetUUID() : LLUUID::null;
{
return items[0]->getAssetUUID();
}
return LLUUID::null;
}; };

View File

@@ -75,14 +75,14 @@ public:
static void run(); static void run();
static void updateLayout(LLFloaterAO* floater); static void updateLayout(LLFloaterAO* floater);
static BOOL loadAnims(); //static BOOL loadAnims();
static void typing(bool start); static void typing(bool start);
static int flyToSwimState(const int state); static int flyToSwimState(const int state);
static int swimToFlyState(const int state); static int swimToFlyState(const int state);
static int getAnimationState(); static int getAnimationState();
static void setAnimationState(int state); static void setAnimationState(int state);
static void setStates(const LLUUID& id, BOOL start); //static void setStates(const LLUUID& id, BOOL start);
static LLUUID getCurrentStandId(); static LLUUID getCurrentStandId();
static void setCurrentStandId(const LLUUID& id); static void setCurrentStandId(const LLUUID& id);