Travel GUI

actorid
gugus 12 years ago
parent 4f5c4bf89a
commit 85d9357e3a

@ -16,7 +16,7 @@ namespace MWGui
{
TradeWindow::TradeWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_trade_window.layout", parWindowManager)
, ReferenceInterface(NULL) // no drag&drop
, ContainerBase(NULL) // no drag&drop
, mCurrentBalance(0)
{
MyGUI::ScrollView* itemView;

@ -20,7 +20,7 @@ namespace MWGui
namespace MWGui
{
class TradeWindow : public ReferenceInterface, public WindowBase
class TradeWindow : public ContainerBase, public WindowBase
{
public:
TradeWindow(MWBase::WindowManager& parWindowManager);

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

@ -20,7 +20,7 @@ namespace MWGui
namespace MWGui
{
class TravelWindow : public ContainerBase, public WindowBase
class TravelWindow : public ReferenceInterface, public WindowBase
{
public:
TravelWindow(MWBase::WindowManager& parWindowManager);
@ -35,8 +35,6 @@ namespace MWGui
MyGUI::ScrollView* mDestinationsView;
MWWorld::Ptr mActor;
std::map<MyGUI::Widget*, std::string> mDestinationsWidgetMap;
void onCancelButtonClicked(MyGUI::Widget* _sender);

@ -376,6 +376,7 @@ void WindowManager::updateVisible()
break;
case GM_Travel:
mTravelWindow->setVisible(true);
break;
case GM_SpellCreation:
mSpellCreationDialog->setVisible(true);
break;

@ -78,6 +78,7 @@ set(MYGUI_FILES
openmw_spellcreation_dialog.layout
openmw_edit_effect.layout
openmw_enchanting_dialog.layout
openmw_travel_window.layout
smallbars.png
VeraMono.ttf
markers.png

Loading…
Cancel
Save