1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 00:19:56 +00:00
openmw-tes3mp/apps/openmw/mwgui/dialogue.hpp

92 lines
2.3 KiB
C++
Raw Normal View History

2010-11-03 20:21:08 +00:00
#ifndef MWGUI_DIALOGE_H
#define MWGUI_DIALOGE_H
#include "window_base.hpp"
#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"
namespace MWGui
2010-11-03 20:21:08 +00:00
{
class WindowManager;
namespace Widgets
{
class MWList;
}
2010-11-03 20:21:08 +00:00
}
/*
This file contains the dialouge window
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
class DialogueWindow: public WindowBase, public ReferenceInterface
2010-11-03 20:21:08 +00:00
{
public:
DialogueWindow(MWBase::WindowManager& parWindowManager);
2010-11-03 20:21:08 +00:00
// Events
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);
void stopDialogue();
2012-03-19 17:30:52 +00:00
void setKeywords(std::list<std::string> keyWord);
void removeKeyword(std::string keyWord);
void addText(std::string text);
void addTitle(std::string text);
void askQuestion(std::string question);
void goodbye();
2012-11-05 22:16:37 +00:00
void onFrame();
// 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,
Service_CreateSpells = 0x04,
2012-10-17 16:03:02 +00:00
Service_Enchant = 0x08,
Service_Training = 0x10,
Service_Travel = 0x20
2012-09-22 22:36:20 +00:00
};
2010-11-03 20:21:08 +00:00
protected:
void onSelectTopic(std::string topic);
2010-11-03 20:21:08 +00:00
void onByeClicked(MyGUI::Widget* _sender);
void onHistoryClicked(MyGUI::Widget* _sender);
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
virtual void onReferenceUnavailable();
2010-11-03 20:21:08 +00:00
private:
void updateOptions();
/**
*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;
bool mEnabled;
DialogueHistory* mHistory;
Widgets::MWList* mTopicsList;
MyGUI::ProgressPtr mDispositionBar;
MyGUI::EditPtr mDispositionText;
2010-11-03 20:21:08 +00:00
};
}
#endif