Crossfire Server, Trunk
MessageManager Class Reference

#include <MessageManager.h>

+ Inheritance diagram for MessageManager:
+ Collaboration diagram for MessageManager:

Public Member Functions

virtual AssetWrapperchild (int child) override
 
virtual int childIndex (AssetWrapper *child) override
 
virtual int childrenCount () const override
 
virtual QString displayName () const override
 
MessageFilefindMessage (const QString &path)
 
void loadMessages ()
 
 MessageManager (AssetWrapper *parent)
 
QList< MessageFile * > & messages ()
 
const QList< MessageFile * > & messages () const
 
QList< QuestConditionScript * > postConditions () const
 
QList< QuestConditionScript * > preConditions () const
 
void saveMessages ()
 
virtual PossibleUse uses (const AssetWrapper *asset, std::string &) const override
 
virtual ~MessageManager ()
 
- Public Member Functions inherited from AssetWrapper
 AssetWrapper (AssetWrapper *parent, const QString &panelName="empty")
 
virtual bool canDrag () const
 
virtual bool canDrop (const QMimeData *, int) const
 
virtual QIcon displayIcon () const
 
virtual QString displayPanelName () const
 
AssetWrapperdisplayParent () const
 
virtual void drag (QMimeData *) const
 
virtual void drop (const QMimeData *, int)
 
virtual void fillMenu (QMenu *)
 
void markModified (ChangeType change, int extra=0)
 
AssetWrapperself ()
 
void setDisplayParent (AssetWrapper *parent)
 
virtual ~AssetWrapper () override
 

Private Member Functions

void findPrePost (const QString directory, QList< QuestConditionScript * > &list)
 
void loadDirectory (const QString &directory)
 
QString loadScriptComment (const QString &path) const
 

Private Attributes

QList< MessageFile * > myMessages
 
QList< QuestConditionScript * > myPostConditions
 
QList< QuestConditionScript * > myPreConditions
 

Additional Inherited Members

- Public Types inherited from AssetWrapper
enum  ChangeType {
  AssetUpdated, BeforeChildAdd, AfterChildAdd, BeforeChildRemove,
  AfterChildRemove, BeforeLayoutChange, AfterLayoutChange
}
 
enum  PossibleUse { Uses, ChildrenMayUse, DoesntUse }
 
- Public Slots inherited from AssetWrapper
virtual void removeChild (AssetWrapper *)
 
- Signals inherited from AssetWrapper
void dataModified (AssetWrapper *asset, AssetWrapper::ChangeType type, int extra)
 
void modified ()
 
- Static Public Member Functions inherited from AssetWrapper
static bool compareByDisplayName (const AssetWrapper *left, const AssetWrapper *right)
 
- Static Public Attributes inherited from AssetWrapper
static const char * tipProperty = "_cre_internal"
 
- Protected Member Functions inherited from AssetWrapper
virtual void wasModified (AssetWrapper *asset, ChangeType type, int extra)
 
- Protected Attributes inherited from AssetWrapper
QString myPanelName
 
AssetWrappermyParent
 
- Properties inherited from AssetWrapper
QString displayName
 
AssetWrapper self
 

Detailed Description

Manage NPC dialogs.

Definition at line 25 of file MessageManager.h.

Constructor & Destructor Documentation

◆ MessageManager()

MessageManager::MessageManager ( AssetWrapper parent)

Definition at line 23 of file MessageManager.cpp.

References AssetWrapper::tipProperty.

◆ ~MessageManager()

MessageManager::~MessageManager ( )
virtual

Definition at line 27 of file MessageManager.cpp.

References myMessages, myPostConditions, and myPreConditions.

Member Function Documentation

◆ child()

virtual AssetWrapper* MessageManager::child ( int  child)
inlineoverridevirtual

Reimplemented from AssetWrapper.

Definition at line 34 of file MessageManager.h.

References child(), and myMessages.

Referenced by child(), and childIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ childIndex()

virtual int MessageManager::childIndex ( AssetWrapper child)
inlineoverridevirtual

Reimplemented from AssetWrapper.

Definition at line 35 of file MessageManager.h.

References child(), and myMessages.

+ Here is the call graph for this function:

◆ childrenCount()

virtual int MessageManager::childrenCount ( ) const
inlineoverridevirtual

Reimplemented from AssetWrapper.

Definition at line 33 of file MessageManager.h.

References myMessages.

◆ displayName()

virtual QString MessageManager::displayName ( ) const
inlineoverridevirtual

Implements AssetWrapper.

Definition at line 31 of file MessageManager.h.

◆ findMessage()

MessageFile * MessageManager::findMessage ( const QString &  path)

Get the dialog from a file path.

Parameters
pathpath to get the dialog from.
Returns
dialog, null if no dialog at this path.

Definition at line 61 of file MessageManager.cpp.

References mad_mage_user::file, myMessages, and python_init::path.

Referenced by CREMapInformationManager::checkEvent(), and CREMapInformationManager::loadCache().

+ Here is the caller graph for this function:

◆ findPrePost()

void MessageManager::findPrePost ( const QString  directory,
QList< QuestConditionScript * > &  list 
)
private

Definition at line 134 of file MessageManager.cpp.

References Settings::datadir, mad_mage_user::file, guildoracle::list, loadScriptComment(), Settings::mapdir, and settings.

Referenced by loadMessages().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadDirectory()

void MessageManager::loadDirectory ( const QString &  directory)
private

Definition at line 72 of file MessageManager.cpp.

References Settings::datadir, mad_mage_user::file, Settings::mapdir, diamondslots::message, messages(), myMessages, python_init::path, and settings.

Referenced by loadMessages().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadMessages()

void MessageManager::loadMessages ( )

Load all messages from the 'maps' directory.

Definition at line 34 of file MessageManager.cpp.

References findPrePost(), loadDirectory(), myPostConditions, and myPreConditions.

Referenced by CREMainWindow::CREMainWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadScriptComment()

QString MessageManager::loadScriptComment ( const QString &  path) const
private

Definition at line 111 of file MessageManager.cpp.

References mad_mage_user::file, is_valid_types_gen::line, and python_init::path.

Referenced by findPrePost().

+ Here is the caller graph for this function:

◆ messages() [1/2]

const QList< MessageFile * > & MessageManager::messages ( )

Get all known NPC dialogs.

Returns
NPC dialogs.

Definition at line 51 of file MessageManager.cpp.

References myMessages.

Referenced by CREResourcesWindow::addMessage(), loadDirectory(), and CREMessagePanel::updateItem().

+ Here is the caller graph for this function:

◆ messages() [2/2]

const QList<MessageFile*>& MessageManager::messages ( ) const

Get all known NPC dialogs.

Returns
NPC dialogs.

◆ postConditions()

QList< QuestConditionScript * > MessageManager::postConditions ( ) const

Get all dialog post-conditions.

Returns
post-conditions.

Definition at line 106 of file MessageManager.cpp.

References myPostConditions.

Referenced by CREPrePostSingleConditionDelegate::createEditor().

+ Here is the caller graph for this function:

◆ preConditions()

QList< QuestConditionScript * > MessageManager::preConditions ( ) const

Get all dialog pre-conditions.

Returns
pre-conditions.

Definition at line 101 of file MessageManager.cpp.

References myPreConditions.

Referenced by CREPrePostSingleConditionDelegate::createEditor().

+ Here is the caller graph for this function:

◆ saveMessages()

void MessageManager::saveMessages ( )

Save all messages.

Definition at line 43 of file MessageManager.cpp.

References mad_mage_user::file, and myMessages.

Referenced by CREMainWindow::onSaveMessages().

+ Here is the caller graph for this function:

◆ uses()

AssetWrapper::PossibleUse MessageManager::uses ( const AssetWrapper asset,
std::string &   
) const
overridevirtual

Reimplemented from AssetWrapper.

Definition at line 144 of file MessageManager.cpp.

References AssetWrapper::ChildrenMayUse, and AssetWrapper::DoesntUse.

Field Documentation

◆ myMessages

QList<MessageFile*> MessageManager::myMessages
private

◆ myPostConditions

QList<QuestConditionScript*> MessageManager::myPostConditions
private

Definition at line 75 of file MessageManager.h.

Referenced by loadMessages(), postConditions(), and ~MessageManager().

◆ myPreConditions

QList<QuestConditionScript*> MessageManager::myPreConditions
private

Definition at line 74 of file MessageManager.h.

Referenced by loadMessages(), preConditions(), and ~MessageManager().


The documentation for this class was generated from the following files: