Hook up nav bar For Sale icon to buy land functionality.

master
James Cook 2009-11-25 11:51:49 -08:00
parent 446702d762
commit ef46d4077c
4 changed files with 20 additions and 7 deletions

View File

@ -243,6 +243,8 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
addChild(mAddLandmarkBtn);
LLButton::Params for_sale_button = p.for_sale_button;
for_sale_button.click_callback.function(
boost::bind(&LLLocationInputCtrl::onForSaleButtonClicked, this));
mForSaleBtn = LLUICtrlFactory::create<LLButton>( for_sale_button );
// *TODO: Make clickable?
addChild(mForSaleBtn);
@ -474,6 +476,11 @@ void LLLocationInputCtrl::onInfoButtonClicked()
LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "agent"));
}
void LLLocationInputCtrl::onForSaleButtonClicked()
{
handle_buy_land();
}
void LLLocationInputCtrl::onAddLandmarkButtonClicked()
{
LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos();

View File

@ -132,6 +132,7 @@ private:
void onLocationPrearrange(const LLSD& data);
void onTextEditorRightClicked(S32 x, S32 y, MASK mask);
void onLandmarkLoaded(LLLandmark* lm);
void onForSaleButtonClicked();
void onAddLandmarkButtonClicked();
void onAgentParcelChange();
// callbacks

View File

@ -5628,12 +5628,7 @@ class LLShowFloater : public view_listener_t
}
else if (floater_name == "buy land")
{
if (LLViewerParcelMgr::getInstance()->selectionEmpty())
{
LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
}
LLViewerParcelMgr::getInstance()->startBuyLand();
handle_buy_land();
}
else if (floater_name == "script errors")
{
@ -5843,7 +5838,15 @@ BOOL enable_buy_land(void*)
LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false);
}
void handle_buy_land()
{
LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance();
if (vpm->selectionEmpty())
{
vpm->selectParcelAt(gAgent.getPositionGlobal());
}
vpm->startBuyLand();
}
class LLObjectAttachToAvatar : public view_listener_t
{

View File

@ -102,6 +102,8 @@ void handle_take_copy();
void handle_look_at_selection(const LLSD& param);
void handle_zoom_to_object(LLUUID object_id);
void handle_buy_land();
// Takes avatar UUID, or if no UUID passed, uses last selected object
void handle_avatar_freeze(const LLSD& avatar_id);