|
|
@ -23,8 +23,7 @@ namespace MWGui
|
|
|
|
const int TravelWindow::sLineHeight = 18;
|
|
|
|
const int TravelWindow::sLineHeight = 18;
|
|
|
|
|
|
|
|
|
|
|
|
TravelWindow::TravelWindow(MWBase::WindowManager& parWindowManager) :
|
|
|
|
TravelWindow::TravelWindow(MWBase::WindowManager& parWindowManager) :
|
|
|
|
WindowBase("openmw_spell_buying_window.layout", parWindowManager)
|
|
|
|
WindowBase("openmw_travel_window.layout", parWindowManager)
|
|
|
|
, ContainerBase(NULL) // no drag&drop
|
|
|
|
|
|
|
|
, mCurrentY(0)
|
|
|
|
, mCurrentY(0)
|
|
|
|
, mLastPos(0)
|
|
|
|
, mLastPos(0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -33,8 +32,8 @@ namespace MWGui
|
|
|
|
getWidget(mCancelButton, "CancelButton");
|
|
|
|
getWidget(mCancelButton, "CancelButton");
|
|
|
|
getWidget(mPlayerGold, "PlayerGold");
|
|
|
|
getWidget(mPlayerGold, "PlayerGold");
|
|
|
|
getWidget(mSelect, "Select");
|
|
|
|
getWidget(mSelect, "Select");
|
|
|
|
getWidget(mDestinations, "Spells");
|
|
|
|
getWidget(mDestinations, "Travel");
|
|
|
|
getWidget(mDestinationsView, "SpellsView");
|
|
|
|
getWidget(mDestinationsView, "DestinationsView");
|
|
|
|
|
|
|
|
|
|
|
|
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TravelWindow::onCancelButtonClicked);
|
|
|
|
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TravelWindow::onCancelButtonClicked);
|
|
|
|
|
|
|
|
|
|
|
@ -61,8 +60,8 @@ namespace MWGui
|
|
|
|
toAdd->setCaptionWithReplacing(travelId+" - "+boost::lexical_cast<std::string>(price)+"#{sgp}");
|
|
|
|
toAdd->setCaptionWithReplacing(travelId+" - "+boost::lexical_cast<std::string>(price)+"#{sgp}");
|
|
|
|
toAdd->setSize(toAdd->getTextSize().width,sLineHeight);
|
|
|
|
toAdd->setSize(toAdd->getTextSize().width,sLineHeight);
|
|
|
|
toAdd->eventMouseWheel += MyGUI::newDelegate(this, &TravelWindow::onMouseWheel);
|
|
|
|
toAdd->eventMouseWheel += MyGUI::newDelegate(this, &TravelWindow::onMouseWheel);
|
|
|
|
toAdd->setUserString("ToolTipType", "Spell");
|
|
|
|
//toAdd->setUserString("ToolTipType", "Spell");
|
|
|
|
toAdd->setUserString("Spell", travelId);
|
|
|
|
toAdd->setUserString("Destination", travelId);
|
|
|
|
toAdd->eventMouseButtonClick += MyGUI::newDelegate(this, &TravelWindow::onTravelButtonClick);
|
|
|
|
toAdd->eventMouseButtonClick += MyGUI::newDelegate(this, &TravelWindow::onTravelButtonClick);
|
|
|
|
mDestinationsWidgetMap.insert(std::make_pair (toAdd, travelId));
|
|
|
|
mDestinationsWidgetMap.insert(std::make_pair (toAdd, travelId));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -111,12 +110,13 @@ namespace MWGui
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
updateLabels();
|
|
|
|
updateLabels();
|
|
|
|
mPtr.get<ESM::NPC>()->base->mTransport[0].
|
|
|
|
//mPtr.get<ESM::NPC>()->base->mTransport[0].
|
|
|
|
mDestinationsView->setCanvasSize (MyGUI::IntSize(mDestinationsView->getWidth(), std::max(mDestinationsView->getHeight(), mCurrentY)));
|
|
|
|
mDestinationsView->setCanvasSize (MyGUI::IntSize(mDestinationsView->getWidth(), std::max(mDestinationsView->getHeight(), mCurrentY)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TravelWindow::onTravelButtonClick(MyGUI::Widget* _sender)
|
|
|
|
void TravelWindow::onTravelButtonClick(MyGUI::Widget* _sender)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
std::cout << "traveling to:" << _sender->getUserString("Destination");
|
|
|
|
/*int price = *_sender->getUserData<int>();
|
|
|
|
/*int price = *_sender->getUserData<int>();
|
|
|
|
|
|
|
|
|
|
|
|
if (mWindowManager.getInventoryWindow()->getPlayerGold()>=price)
|
|
|
|
if (mWindowManager.getInventoryWindow()->getPlayerGold()>=price)
|
|
|
|