diff options
| -rwxr-xr-x | indra/newview/lllocationinputctrl.cpp | 25 | ||||
| -rwxr-xr-x | indra/newview/lllocationinputctrl.h | 1 | ||||
| -rwxr-xr-x | indra/newview/lltoastnotifypanel.cpp | 8 | ||||
| -rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 13 | 
4 files changed, 45 insertions, 2 deletions
| diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 8d21fda8f9..53b2ca2b74 100755 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -64,6 +64,9 @@  #include "llurllineeditorctrl.h"  #include "llagentui.h" +#include "llmenuoptionpathfindingrebakenavmesh.h" +#include "llpathfindingmanager.h" +  //============================================================================  /*   * "ADD LANDMARK" BUTTON UPDATING LOGIC @@ -1194,6 +1197,18 @@ bool LLLocationInputCtrl::onLocationContextMenuItemEnabled(const LLSD& userdata)  	return false;  } +void LLLocationInputCtrl::callbackRebakeRegion(const LLSD& notification, const LLSD& response) +{ +	S32 option = LLNotificationsUtil::getSelectedOption(notification, response); +	if (option == 0) // OK +	{ +		if (LLPathfindingManager::getInstance() != NULL) +		{ +			LLMenuOptionPathfindingRebakeNavmesh::getInstance()->sendRequestRebakeNavmesh(); +		} +	} +} +  void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon)  {  	switch (icon) @@ -1211,6 +1226,16 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon)  		LLNotificationsUtil::add("NoBuild");  		break;  	case PATHFINDING_DIRTY_ICON: +		if (LLPathfindingManager::getInstance() != NULL) +		{ +			LLMenuOptionPathfindingRebakeNavmesh *rebakeInstance = LLMenuOptionPathfindingRebakeNavmesh::getInstance(); +			if (rebakeInstance && rebakeInstance->canRebakeRegion() && (rebakeInstance->getMode() == LLMenuOptionPathfindingRebakeNavmesh::kRebakeNavMesh_Available)) +			{ +				LLNotificationsUtil::add("PathfindingDirtyRebake", LLSD(), LLSD(), +										 boost::bind(&LLLocationInputCtrl::callbackRebakeRegion, this, _1, _2)); +				break; +			} +		}  		LLNotificationsUtil::add("PathfindingDirty");  		break;  	case PATHFINDING_DISABLED_ICON: diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index cd6fd24077..da71bab6c1 100755 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -166,6 +166,7 @@ private:  	// callbacks  	bool					onLocationContextMenuItemEnabled(const LLSD& userdata);  	void 					onLocationContextMenuItemClicked(const LLSD& userdata); +	void					callbackRebakeRegion(const LLSD& notification, const LLSD& response);  	void					onParcelIconClick(EParcelIcon icon);  	void                    createNavMeshStatusListenerForCurrentRegion(); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 98ed2f0fc4..1a8ade5b10 100755 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -103,7 +103,7 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt  		p.image_color_disabled(LLUIColorTable::instance().getColor("ButtonCautionImageColor"));  	}  	// for the scriptdialog buttons we use fixed button size. This  is a limit! -	if (!mIsScriptDialog && font->getWidth(form_element["text"].asString()) > BUTTON_WIDTH) +	if (!mIsScriptDialog && font->getWidth(form_element["text"].asString()) > (BUTTON_WIDTH-2*HPAD))  	{  		p.rect.width = 1;  		p.auto_resize = true; @@ -160,7 +160,11 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vector<index_button_pair  		}  		LLButton* btn = it->second;  		LLRect btn_rect(btn->getRect()); -		if (left + btn_rect.getWidth() > max_width)// whether there is still some place for button+h_pad in the mControlPanel +		if (buttons.size() == 1) // for the one-button forms, center that button +		{ +			left = (max_width - btn_rect.getWidth()) / 2; +		} +		else if (left + btn_rect.getWidth() > max_width)// whether there is still some place for button+h_pad in the mControlPanel  		{  			// looks like we need to add button to the next row  			left = 0; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index f8e346afb9..6b75a2083d 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6908,6 +6908,19 @@ This area has building disabled. You can't build or rez objects here.    </notification>    <notification +   icon="notify.tga" +   name="PathfindingDirtyRebake" +   persist="true" +   type="notify"> +   <unique/> +   The region has pending pathfinding changes.  If you have build rights, you may rebake the region by clicking on the “Rebake region” button. +   <usetemplate +     name="okbutton" +     yestext="Rebake region" +   /> +  </notification> + +  <notification       icon="notify.tga"       name="DynamicPathfindingDisabled"       persist="true" | 
