V3 merge pt 2 / 2

This commit is contained in:
Shyotl
2012-04-13 23:24:39 -05:00
parent e1d243272f
commit 59fdf3b6e1
6 changed files with 169 additions and 39 deletions

View File

@@ -44,6 +44,7 @@
#include "lldir.h"
#include "llmultigesture.h"
#include "llvfile.h"
#include "lltrans.h"
// newview
#include "llagent.h" // todo: remove
@@ -862,7 +863,7 @@ void LLPreviewGesture::initDefaultGesture()
item = addStep( STEP_ANIMATION );
LLGestureStepAnimation* anim = (LLGestureStepAnimation*)item->getUserdata();
anim->mAnimAssetID = ANIM_AGENT_HELLO;
anim->mAnimName = "Wave";
anim->mAnimName = LLTrans::getString("Wave");
updateLabel(item);
item = addStep( STEP_WAIT );
@@ -872,7 +873,7 @@ void LLPreviewGesture::initDefaultGesture()
item = addStep( STEP_CHAT );
LLGestureStepChat* chat_step = (LLGestureStepChat*)item->getUserdata();
chat_step->mChatText = "Hello, avatar!";
chat_step->mChatText = LLTrans::getString("HelloAvatar");
updateLabel(item);
// Start with item list selected
@@ -1084,7 +1085,7 @@ void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture)
// Create an enabled item with this step
LLSD row;
row["columns"][0]["value"] = new_step->getLabel();
row["columns"][0]["value"] = getLabel( new_step->getLabel());
row["columns"][0]["font"] = "SANSSERIF_SMALL";
LLScrollListItem* item = mStepList->addElement(row);
item->setUserdata(new_step);
@@ -1400,7 +1401,7 @@ void LLPreviewGesture::updateLabel(LLScrollListItem* item)
LLScrollListCell* cell = item->getColumn(0);
LLScrollListText* text_cell = (LLScrollListText*)cell;
std::string label = step->getLabel();
std::string label = getLabel( step->getLabel());
text_cell->setText(label);
}
@@ -1662,7 +1663,7 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type )
// Create an enabled item with this step
LLSD row;
row["columns"][0]["value"] = step->getLabel();
row["columns"][0]["value"] = getLabel(step->getLabel());
row["columns"][0]["font"] = "SANSSERIF_SMALL";
LLScrollListItem* step_item = mStepList->addElement(row);
step_item->setUserdata(step);
@@ -1676,6 +1677,63 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type )
return step_item;
}
// static
std::string LLPreviewGesture::getLabel(std::vector<std::string> labels)
{
std::vector<std::string> v_labels = labels ;
std::string result("");
if( v_labels.size() != 2)
{
return result;
}
if(v_labels[0]=="Chat")
{
result=LLTrans::getString("Chat Message");
}
else if(v_labels[0]=="Sound")
{
result=LLTrans::getString("Sound");
}
else if(v_labels[0]=="Wait")
{
result=LLTrans::getString("Wait");
}
else if(v_labels[0]=="AnimFlagStop")
{
result=LLTrans::getString("AnimFlagStop");
}
else if(v_labels[0]=="AnimFlagStart")
{
result=LLTrans::getString("AnimFlagStart");
}
// lets localize action value
std::string action = v_labels[1];
if ("None" == action)
{
action = LLTrans::getString("GestureActionNone");
}
else if ("until animations are done" == action)
{
//action = LLFloaterReg::getInstance("preview_gesture")->getChild<LLCheckBoxCtrl>("wait_anim_check")->getLabel();
//Worst. Thing. Ever. We are in a static function. Find any existing gesture preview and grab the label from its 'wait_anim_check' element.
for(preview_map_t::iterator it = LLPreview::sInstances.begin(); it != LLPreview::sInstances.end();++it)
{
LLPreviewGesture* pPreview = dynamic_cast<LLPreviewGesture*>(it->second);
if(pPreview)
{
pPreview->getChild<LLCheckBoxCtrl>("wait_anim_check")->getLabel();
break;
}
}
}
result.append(action);
return result;
}
// static
void LLPreviewGesture::onClickUp(void* data)
{