beginnings of trade window layout.

actorid
scrawl 13 years ago
parent 0dc5e5919b
commit 5da4da820e

@ -637,7 +637,7 @@ namespace MWDialogue
//initialise the GUI
MWBase::Environment::get().getInputManager()->setGuiMode(MWGui::GM_Dialogue);
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
win->startDialogue(MWWorld::Class::get (actor).getName (actor));
win->startDialogue(actor, MWWorld::Class::get (actor).getName (actor));
//setup the list of topics known by the actor. Topics who are also on the knownTopics list will be added to the GUI
updateTopics();

@ -1,11 +1,4 @@
#include "dialogue.hpp"
#include "dialogue_history.hpp"
#include "window_manager.hpp"
#include "widgets.hpp"
#include "list.hpp"
#include "components/esm_store/store.hpp"
#include "../mwbase/environment.hpp"
#include "../mwdialogue/dialoguemanager.hpp"
#include <assert.h>
#include <iostream>
@ -14,6 +7,17 @@
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <components/esm_store/store.hpp>
#include "../mwbase/environment.hpp"
#include "../mwdialogue/dialoguemanager.hpp"
#include "dialogue_history.hpp"
#include "window_manager.hpp"
#include "widgets.hpp"
#include "list.hpp"
#include "tradewindow.hpp"
using namespace MWGui;
using namespace Widgets;
@ -59,9 +63,7 @@ DialogueWindow::DialogueWindow(WindowManager& parWindowManager)
//Topics list
getWidget(topicsList, "TopicsList");
//topicsList->eventListSelectAccept += MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
topicsList->eventItemSelected += MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
//topicsList->eventListChangePosition += MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
MyGUI::ButtonPtr byeButton;
getWidget(byeButton, "ByeButton");
@ -117,6 +119,9 @@ void DialogueWindow::open()
history->eraseText(0,history->getTextLength());
updateOptions();
setVisible(true);
// hide all sub-dialogues of the dialog window (trade window, persuasion, etc)
mWindowManager.getTradeWindow()->setVisible(false);
}
void DialogueWindow::onByeClicked(MyGUI::Widget* _sender)
@ -128,12 +133,20 @@ void DialogueWindow::onSelectTopic(std::string topic)
{
if (!mEnabled) return;
MWBase::Environment::get().getDialogueManager()->keywordSelected(lower_string(topic));
if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sBarter")->str)
{
/// \todo check if the player is allowed to trade with this actor (e.g. faction rank high enough)?
mWindowManager.getTradeWindow()->startTrade(mActor);
}
else
MWBase::Environment::get().getDialogueManager()->keywordSelected(lower_string(topic));
}
void DialogueWindow::startDialogue(std::string npcName)
void DialogueWindow::startDialogue(MWWorld::Ptr actor, std::string npcName)
{
mEnabled = true;
mActor = actor;
topicsList->setEnabled(true);
static_cast<MyGUI::Window*>(mMainWidget)->setCaption(npcName);
adjustWindowCaption();

@ -4,6 +4,8 @@
#include "window_base.hpp"
#include <boost/array.hpp>
#include "../mwworld/ptr.hpp"
namespace MWGui
{
class WindowManager;
@ -38,7 +40,7 @@ namespace MWGui
*/
EventHandle_Void eventBye;
void startDialogue(std::string npcName);
void startDialogue(MWWorld::Ptr actor, std::string npcName);
void stopDialogue();
void setKeywords(std::list<std::string> keyWord);
void removeKeyword(std::string keyWord);
@ -70,6 +72,8 @@ namespace MWGui
bool mEnabled;
MWWorld::Ptr mActor; // actor being talked to
DialogueHistory* history;
Widgets::MWList* topicsList;
MyGUI::ProgressPtr pDispositionBar;

@ -7,4 +7,9 @@ namespace MWGui
ContainerBase(NULL) // no drag&drop
{
}
void TradeWindow::startTrade(MWWorld::Ptr actor)
{
ContainerBase::openContainer(actor);
}
}

@ -4,6 +4,8 @@
#include "container.hpp"
#include "window_base.hpp"
#include "../mwworld/ptr.hpp"
namespace MyGUI
{
class Gui;
@ -23,6 +25,8 @@ namespace MWGui
public:
TradeWindow(WindowManager& parWindowManager);
void startTrade(MWWorld::Ptr actor);
//virtual void Update();
//virtual void notifyContentChanged();

@ -15,6 +15,7 @@
#include "hud.hpp"
#include "mainmenu.hpp"
#include "countdialog.hpp"
#include "tradewindow.hpp"
#include "../mwmechanics/mechanicsmanager.hpp"
#include "../mwinput/inputmanager.hpp"
@ -48,6 +49,7 @@ WindowManager::WindowManager(
, mBookWindow(NULL)
, mScrollWindow(NULL)
, mCountDialog(NULL)
, mTradeWindow(NULL)
, mCharGen(NULL)
, playerClass()
, playerName()
@ -114,6 +116,7 @@ WindowManager::WindowManager(
mScrollWindow = new ScrollWindow(*this);
mBookWindow = new BookWindow(*this);
mCountDialog = new CountDialog(*this);
mTradeWindow = new TradeWindow(*this);
// The HUD is always on
hud->setVisible(true);
@ -153,6 +156,7 @@ WindowManager::~WindowManager()
delete mDragAndDrop;
delete mBookWindow;
delete mScrollWindow;
delete mTradeWindow;
cleanupGarbage();
}

@ -136,6 +136,7 @@ namespace MWGui
MWGui::BookWindow* getBookWindow() {return mBookWindow;}
MWGui::ScrollWindow* getScrollWindow() {return mScrollWindow;}
MWGui::CountDialog* getCountDialog() {return mCountDialog;}
MWGui::TradeWindow* getTradeWindow() {return mTradeWindow;}
MyGUI::Gui* getGui() const { return gui; }

@ -56,6 +56,7 @@ configure_file("${SDIR}/openmw_scroll_layout.xml" "${DDIR}/openmw_scroll_layout.
configure_file("${SDIR}/openmw_scroll_skin.xml" "${DDIR}/openmw_scroll_skin.xml" COPYONLY)
configure_file("${SDIR}/openmw_book_layout.xml" "${DDIR}/openmw_book_layout.xml" COPYONLY)
configure_file("${SDIR}/openmw_count_window_layout.xml" "${DDIR}/openmw_count_window_layout.xml" COPYONLY)
configure_file("${SDIR}/openmw_trade_window_layout.xml" "${DDIR}/openmw_trade_window_layout.xml" COPYONLY)
configure_file("${SDIR}/atlas1.cfg" "${DDIR}/atlas1.cfg" COPYONLY)
configure_file("${SDIR}/smallbars.png" "${DDIR}/smallbars.png" COPYONLY)
configure_file("${SDIR}/transparent.png" "${DDIR}/transparent.png" COPYONLY)

Loading…
Cancel
Save