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

64 lines
1.6 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"
2010-11-03 20:21:08 +00:00
#include <boost/array.hpp>
namespace MWGui
2010-11-03 20:21:08 +00:00
{
class WindowManager;
2010-11-03 20:21:08 +00:00
}
/*
This file contains the dialouge window
Layout is defined by resources/mygui/openmw_dialogue_window_layout.xml.
*/
namespace MWGui
{
2012-03-22 14:10:29 +00:00
class DialogueHistory;
2010-11-03 20:21:08 +00:00
class DialogueWindow: public WindowBase
2010-11-03 20:21:08 +00:00
{
public:
DialogueWindow(WindowManager& parWindowManager);
2010-11-03 20:21:08 +00:00
void open();
// 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;
void startDialogue(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);
2010-11-03 20:21:08 +00:00
protected:
2012-03-22 14:28:06 +00:00
void onSelectTopic(MyGUI::ListBox* _sender, size_t _index);
2010-11-03 20:21:08 +00:00
void onByeClicked(MyGUI::Widget* _sender);
void onHistoryClicked(MyGUI::Widget* _sender);
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-03-22 14:10:29 +00:00
DialogueHistory* history;
2012-03-22 14:28:06 +00:00
MyGUI::ListBox* topicsList;
MyGUI::ProgressPtr pDispositionBar;
MyGUI::EditPtr pDispositionText;
std::map<std::string,std::string> pTopicsText;// this map links keyword and "real" text.
2010-11-03 20:21:08 +00:00
};
}
#endif