Emergency 20 Dokumentation  4.2.0
em5::WarblerFeedWindow Class Reference

The warbler feed window was introduced in EMERGENCY 2017 and hence is only available in this version and above. More...

#include <WarblerFeedWindow.h>

Inheritance diagram for em5::WarblerFeedWindow:
qsf::GuiDocument

Classes

struct  WarblerTweet
 

Public Types

enum  Flag {
  SHOW_NEW_TWEETS_AUTOMATICALLY = 1<<0, SHOW_WARBLER_FEED_BUTTON_ON_NEW_TWEET = 1<<1, PLAY_AUDIO_ON_NEW_TWEET = 1<<2, PAUSE_GAME_ON_SHOW_WINDOW = 1<<3,
  SHOW_COMMENT_ICON = 1<<4, SHOW_SHARE_ICON = 1<<5, SHOW_LIKE_ICON = 1<<6, BLOCK_INPUT = 1<<7,
  EDITABLE_TEXT = 1<<8
}
 
typedef qsf::BitFlagSet< uint16, FlagFlags
 
typedef std::vector< WarblerTweetWarblerTweets
 

Public Member Functions

 WarblerFeedWindow (qsf::GuiContext &guiContext)
 
virtual ~WarblerFeedWindow ()
 
bool isEnabled () const
 Return whether or not the warbler feed window is enabled. More...
 
void setEnabled (bool enabled)
 Enable/disable warbler feed window; e.g. inside medieval events it doesn't make much sense. More...
 
Flags getFlags () const
 Return the flags. More...
 
void setFlags (Flags flags)
 Set the flags. More...
 
void addWarblerTweet (const std::string &text, uint64 cameraEntityId, const std::string &rmlTitleAsString="")
 Add warbler tweet to the warbler feed. More...
 
int addFixedImageWarblerTweet (const std::string &text, const std::string &imageLocalFilename, const std::string &rmlTitleAsString="")
 Add warbler tweet with a fixed image to the warbler feed. More...
 
int addExternalWarblerTweet (const std::string &text, Ogre::Image &ogreImage, const std::string &rmlTitleAsString="")
 Add external warbler tweet to the warbler feed. More...
 
void clear ()
 Remove all warbler tweets. More...
 
const WarblerTweetsgetWarblerTweets () const
 Return all warbler tweets. More...
 
virtual void processEvent (const std::string &eventKey, Rocket::Core::Event &event) override
 
- Public Member Functions inherited from qsf::GuiDocument
 GuiDocument (GuiContext &guiContext)
 Constructor. More...
 
 GuiDocument (GuiContext &guiContext, Rocket::Core::ElementDocument &rocketCoreElementDocument)
 Constructor. More...
 
virtual ~GuiDocument ()
 Destructor. More...
 
GuiContextgetGuiContext () const
 Return the document's owning GUI context. More...
 
Rocket::Core::ElementDocument * getRocketCoreElementDocument () const
 Return the document's libRocket document. More...
 
bool loadByFilename (const std::string &filename)
 Load the document from an RML file. More...
 
void unload ()
 Use this method if you want to change a documents .rml file at runtime. More...
 
void show ()
 Show the document. More...
 
void showFocused ()
 Show the document focused. More...
 
void showModal ()
 Show the document modal. More...
 
void hide ()
 Hide the document. More...
 
bool isVisible () const
 Check if the document is currently visible. More...
 
void setVisible (bool visible)
 Show/hide the document. More...
 
void pullToFront ()
 Pull the document to the front. More...
 
Rocket::Core::Element * findElementById (const std::string &elementId) const
 Find an element inside the document by its case-sensitive ID. More...
 
void registerNewButton (const std::string &buttonId, const std::string &event, const std::string &eventKey)
 Register a new button. More...
 
virtual void toggleVisibility ()
 Toggle visibility. More...
 
virtual void processViewportDimensionsChanged (int width, int height)
 

Static Public Member Functions

static bool shouldWarblerFeedWindowBeEnabled ()
 
static bool isWarblerFeedWindowEnabled ()
 
static void clearWarblerFeed ()
 
- Static Public Member Functions inherited from qsf::GuiDocument
static Rocket::Core::EventListener * createEventListener (const std::string &eventKey)
 Create an event listener. More...
 
static GuiDocumentgetGuiDocumentByRocketCoreElement (Rocket::Core::Element *element)
 Return a QSF GUI document instance by using a given libRocket element instance. More...
 

Public Attributes

boost::signals2::signal< void(const std::string &, int)> WarblerTextChanged
 Called when an editable tweet text has changed. More...
 

Additional Inherited Members

- Protected Member Functions inherited from qsf::GuiDocument
void createEmptyDocument ()
 

Detailed Description

The warbler feed window was introduced in EMERGENCY 2017 and hence is only available in this version and above.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
SHOW_NEW_TWEETS_AUTOMATICALLY 

Show new tweets automatically.

SHOW_WARBLER_FEED_BUTTON_ON_NEW_TWEET 

Show the warbler feed button inside the menu bar as soon as a new tweet arrives.

PLAY_AUDIO_ON_NEW_TWEET 

Play an audio effect as soon as a new tweet arrives.

PAUSE_GAME_ON_SHOW_WINDOW 

Pause the game as soon as the warbler feed window gets shown.

SHOW_COMMENT_ICON 

Show comment icon.

SHOW_SHARE_ICON 

Show share icon.

SHOW_LIKE_ICON 

Show like icon.

BLOCK_INPUT 

Block input if the warbler feed is visible.

EDITABLE_TEXT 

The feed text is editable (no special display formating when active)

Constructor & Destructor Documentation

em5::WarblerFeedWindow::WarblerFeedWindow ( qsf::GuiContext guiContext)
explicit
virtual em5::WarblerFeedWindow::~WarblerFeedWindow ( )
virtual

Member Function Documentation

int em5::WarblerFeedWindow::addExternalWarblerTweet ( const std::string &  text,
Ogre::Image &  ogreImage,
const std::string &  rmlTitleAsString = "" 
)

Add external warbler tweet to the warbler feed.

Parameters
[in]textWarbler tweet text
[in]ogreImageOGRE image containing the warbler tweet screenshot
[in]rmlTitleAsStringOptional RML title as string, if empty string it's generated automatically
Returns
Index of the adder warbler tweet
int em5::WarblerFeedWindow::addFixedImageWarblerTweet ( const std::string &  text,
const std::string &  imageLocalFilename,
const std::string &  rmlTitleAsString = "" 
)

Add warbler tweet with a fixed image to the warbler feed.

Parameters
[in]textWarbler tweet text
[in]imageLocalFilenameLocal file name of the image to use, e.g. "em5/gui/warbler/arsonist.dds"
[in]rmlTitleAsStringOptional RML title as string, if empty string it's generated automatically
Returns
Index of the adder warbler tweet
void em5::WarblerFeedWindow::addWarblerTweet ( const std::string &  text,
uint64  cameraEntityId,
const std::string &  rmlTitleAsString = "" 
)

Add warbler tweet to the warbler feed.

Parameters
[in]textWarbler tweet text
[in]cameraEntityIdID of the camera entity to use for screenshot generation
[in]rmlTitleAsStringOptional RML title as string, if empty string it's generated automatically
void em5::WarblerFeedWindow::clear ( )

Remove all warbler tweets.

static void em5::WarblerFeedWindow::clearWarblerFeed ( )
static
WarblerFeedWindow::Flags em5::WarblerFeedWindow::getFlags ( ) const
inline

Return the flags.

const WarblerFeedWindow::WarblerTweets & em5::WarblerFeedWindow::getWarblerTweets ( ) const
inline

Return all warbler tweets.

bool em5::WarblerFeedWindow::isEnabled ( ) const
inline

Return whether or not the warbler feed window is enabled.

static bool em5::WarblerFeedWindow::isWarblerFeedWindowEnabled ( )
static
virtual void em5::WarblerFeedWindow::processEvent ( const std::string &  eventKey,
Rocket::Core::Event &  event 
)
overridevirtual

Reimplemented from qsf::GuiDocument.

void em5::WarblerFeedWindow::setEnabled ( bool  enabled)

Enable/disable warbler feed window; e.g. inside medieval events it doesn't make much sense.

void em5::WarblerFeedWindow::setFlags ( Flags  flags)
inline

Set the flags.

static bool em5::WarblerFeedWindow::shouldWarblerFeedWindowBeEnabled ( )
static

Member Data Documentation

boost::signals2::signal<void(const std::string&, int)> em5::WarblerFeedWindow::WarblerTextChanged

Called when an editable tweet text has changed.

Note
  • Recommended slot signature: void onWarblerTextChanged(const std::string& text, int warblerId)

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