mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 03:39:14 +00:00
ac0c1ea986
Conflicts: apps/openmw/mwgui/dialogue.cpp
94 lines
2.4 KiB
C++
94 lines
2.4 KiB
C++
#ifndef MWGUI_DIALOGE_H
|
|
#define MWGUI_DIALOGE_H
|
|
|
|
#include "window_base.hpp"
|
|
#include "referenceinterface.hpp"
|
|
#include <boost/array.hpp>
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
namespace MWGui
|
|
{
|
|
class WindowManager;
|
|
|
|
namespace Widgets
|
|
{
|
|
class MWList;
|
|
}
|
|
}
|
|
|
|
/*
|
|
This file contains the dialouge window
|
|
Layout is defined by resources/mygui/openmw_dialogue_window.layout.
|
|
*/
|
|
|
|
namespace MWGui
|
|
{
|
|
class DialogueHistory;
|
|
|
|
class DialogueWindow: public WindowBase, public ReferenceInterface
|
|
{
|
|
public:
|
|
DialogueWindow(MWBase::WindowManager& parWindowManager);
|
|
|
|
// Events
|
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
|
|
|
/** Event : Dialog finished, OK button clicked.\n
|
|
signature : void method()\n
|
|
*/
|
|
EventHandle_Void eventBye;
|
|
|
|
void startDialogue(MWWorld::Ptr actor, std::string npcName);
|
|
void stopDialogue();
|
|
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 setServices(int services) { mServices = services; }
|
|
|
|
enum Services
|
|
{
|
|
Service_Trade = 0x01,
|
|
Service_BuySpells = 0x02,
|
|
Service_CreateSpells = 0x04,
|
|
Service_Enchant = 0x08
|
|
};
|
|
|
|
protected:
|
|
void onSelectTopic(std::string topic);
|
|
void onByeClicked(MyGUI::Widget* _sender);
|
|
void onHistoryClicked(MyGUI::Widget* _sender);
|
|
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
|
void onWindowResize(MyGUI::Window* _sender);
|
|
|
|
virtual void onReferenceUnavailable();
|
|
|
|
private:
|
|
void updateOptions();
|
|
/**
|
|
*Helper function that add topic keyword in blue in a text.
|
|
*/
|
|
std::string parseText(std::string text);
|
|
|
|
// various service button visibilities, depending if the npc/creature talked to has these services
|
|
bool mShowTrade;
|
|
bool mShowSpells;
|
|
|
|
int mServices;
|
|
|
|
bool mEnabled;
|
|
|
|
DialogueHistory* mHistory;
|
|
Widgets::MWList* mTopicsList;
|
|
MyGUI::ProgressPtr mDispositionBar;
|
|
MyGUI::EditPtr mDispositionText;
|
|
};
|
|
}
|
|
#endif
|