1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/apps/openmw/mwgui/dialogue.hpp

83 lines
2.2 KiB
C++
Raw Normal View History

2010-11-03 21:21:08 +01:00
#ifndef MWGUI_DIALOGE_H
#define MWGUI_DIALOGE_H
#include "window_base.hpp"
2010-11-03 21:21:08 +01:00
#include <boost/array.hpp>
2012-05-17 17:15:44 +02:00
#include "../mwworld/ptr.hpp"
namespace MWGui
2010-11-03 21:21:08 +01:00
{
class WindowManager;
namespace Widgets
{
class MWList;
}
2010-11-03 21:21:08 +01:00
}
/*
This file contains the dialouge window
Layout is defined by resources/mygui/openmw_dialogue_window_layout.xml.
*/
namespace MWGui
{
2012-03-22 15:10:29 +01:00
class DialogueHistory;
2010-11-03 21:21:08 +01:00
class DialogueWindow: public WindowBase
2010-11-03 21:21:08 +01:00
{
public:
DialogueWindow(WindowManager& parWindowManager);
2010-11-03 21:21:08 +01:00
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
2010-11-03 21:21:08 +01:00
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventBye;
2012-05-17 17:15:44 +02:00
void startDialogue(MWWorld::Ptr actor, std::string npcName);
void stopDialogue();
2012-03-19 18:30:52 +01: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();
// various service button visibilities, depending if the npc/creature talked to has these services
// make sure to call these before setKeywords()
void setShowTrade(bool show) { mShowTrade = show; }
2010-11-03 21:21:08 +01:00
protected:
void onSelectTopic(std::string topic);
2010-11-03 21:21:08 +01:00
void onByeClicked(MyGUI::Widget* _sender);
void onHistoryClicked(MyGUI::Widget* _sender);
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
2012-05-10 11:19:22 +02:00
void onWindowResize(MyGUI::Window* _sender);
2010-11-03 21:21:08 +01:00
private:
void updateOptions();
/**
*Helper function that add topic keyword in blue in a text.
*/
std::string parseText(std::string text);
2010-11-03 21:21:08 +01:00
// various service button visibilities, depending if the npc/creature talked to has these services
bool mShowTrade;
bool mEnabled;
2012-05-17 17:15:44 +02:00
MWWorld::Ptr mActor; // actor being talked to
2012-03-22 15:10:29 +01:00
DialogueHistory* history;
Widgets::MWList* topicsList;
MyGUI::ProgressPtr pDispositionBar;
MyGUI::EditPtr pDispositionText;
std::map<std::string,std::string> pTopicsText;// this map links keyword and "real" text.
2010-11-03 21:21:08 +01:00
};
}
#endif