2010-11-03 20:21:08 +00:00
|
|
|
#ifndef MWGUI_DIALOGE_H
|
|
|
|
#define MWGUI_DIALOGE_H
|
|
|
|
|
2010-11-06 10:47:46 +00:00
|
|
|
#include "window_base.hpp"
|
2012-05-26 23:14:33 +00:00
|
|
|
#include "referenceinterface.hpp"
|
2010-11-03 20:21:08 +00:00
|
|
|
#include <boost/array.hpp>
|
|
|
|
|
2012-05-17 15:15:44 +00:00
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2011-02-21 19:36:35 +00:00
|
|
|
namespace MWGui
|
2010-11-03 20:21:08 +00:00
|
|
|
{
|
2011-02-21 19:36:35 +00:00
|
|
|
class WindowManager;
|
2012-05-04 21:53:50 +00:00
|
|
|
|
|
|
|
namespace Widgets
|
|
|
|
{
|
|
|
|
class MWList;
|
|
|
|
}
|
2010-11-03 20:21:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
This file contains the dialouge window
|
2012-07-03 09:34:20 +00:00
|
|
|
Layout is defined by resources/mygui/openmw_dialogue_window.layout.
|
2010-11-03 20:21:08 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
2012-03-22 14:10:29 +00:00
|
|
|
class DialogueHistory;
|
2010-11-03 20:21:08 +00:00
|
|
|
|
2012-05-26 23:14:33 +00:00
|
|
|
class DialogueWindow: public WindowBase, public ReferenceInterface
|
2010-11-03 20:21:08 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-08-12 16:11:09 +00:00
|
|
|
DialogueWindow(MWBase::WindowManager& parWindowManager);
|
2010-11-03 20:21:08 +00:00
|
|
|
|
|
|
|
// Events
|
2012-04-23 13:29:15 +00:00
|
|
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
2010-11-03 20:21:08 +00:00
|
|
|
|
|
|
|
/** Event : Dialog finished, OK button clicked.\n
|
|
|
|
signature : void method()\n
|
|
|
|
*/
|
|
|
|
EventHandle_Void eventBye;
|
|
|
|
|
2012-05-17 15:15:44 +00:00
|
|
|
void startDialogue(MWWorld::Ptr actor, std::string npcName);
|
2012-01-27 13:50:13 +00:00
|
|
|
void stopDialogue();
|
2012-03-19 17:30:52 +00:00
|
|
|
void setKeywords(std::list<std::string> keyWord);
|
2012-01-27 13:50:13 +00:00
|
|
|
void removeKeyword(std::string keyWord);
|
|
|
|
void addText(std::string text);
|
2012-03-16 16:30:59 +00:00
|
|
|
void addTitle(std::string text);
|
|
|
|
void askQuestion(std::string question);
|
2012-05-11 05:18:41 +00:00
|
|
|
void goodbye();
|
2012-01-27 13:50:13 +00:00
|
|
|
|
2012-05-17 12:54:03 +00:00
|
|
|
// make sure to call these before setKeywords()
|
2012-09-22 22:36:20 +00:00
|
|
|
void setServices(int services) { mServices = services; }
|
|
|
|
|
|
|
|
enum Services
|
|
|
|
{
|
|
|
|
Service_Trade = 0x01,
|
|
|
|
Service_BuySpells = 0x02,
|
2012-09-27 06:47:47 +00:00
|
|
|
Service_CreateSpells = 0x04,
|
2012-10-17 16:03:02 +00:00
|
|
|
Service_Enchant = 0x08,
|
2012-10-17 16:17:53 +00:00
|
|
|
Service_Training = 0x10,
|
|
|
|
Service_Travel = 0x20
|
2012-09-22 22:36:20 +00:00
|
|
|
};
|
2012-05-17 12:54:03 +00:00
|
|
|
|
2010-11-03 20:21:08 +00:00
|
|
|
protected:
|
2012-05-04 21:53:50 +00:00
|
|
|
void onSelectTopic(std::string topic);
|
2010-11-03 20:21:08 +00:00
|
|
|
void onByeClicked(MyGUI::Widget* _sender);
|
|
|
|
void onHistoryClicked(MyGUI::Widget* _sender);
|
2012-04-29 22:57:41 +00:00
|
|
|
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
2012-05-10 09:19:22 +00:00
|
|
|
void onWindowResize(MyGUI::Window* _sender);
|
2010-11-03 20:21:08 +00:00
|
|
|
|
2012-05-26 23:14:33 +00:00
|
|
|
virtual void onReferenceUnavailable();
|
|
|
|
|
2010-11-03 20:21:08 +00:00
|
|
|
private:
|
|
|
|
void updateOptions();
|
2012-01-27 13:50:13 +00:00
|
|
|
/**
|
|
|
|
*Helper function that add topic keyword in blue in a text.
|
|
|
|
*/
|
|
|
|
std::string parseText(std::string text);
|
2010-11-03 20:21:08 +00:00
|
|
|
|
2012-09-22 22:36:20 +00:00
|
|
|
int mServices;
|
|
|
|
|
2012-05-11 05:18:41 +00:00
|
|
|
bool mEnabled;
|
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
DialogueHistory* mHistory;
|
|
|
|
Widgets::MWList* mTopicsList;
|
|
|
|
MyGUI::ProgressPtr mDispositionBar;
|
|
|
|
MyGUI::EditPtr mDispositionText;
|
2010-11-03 20:21:08 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|