ManaPlus
Public Member Functions | Private Attributes
EmoteShortcutContainer Class Reference

#include <emoteshortcutcontainer.h>

Inheritance diagram for EmoteShortcutContainer:
ShortcutContainer Widget WidgetListener MouseListener Widget2

Public Member Functions

 EmoteShortcutContainer (Widget2 *const widget)
 
 ~EmoteShortcutContainer ()
 
void draw (Graphics *graphics)
 
void safeDraw (Graphics *graphics)
 
void mouseDragged (MouseEvent &event)
 
void mousePressed (MouseEvent &event)
 
void mouseReleased (MouseEvent &event)
 
void mouseMoved (MouseEvent &event)
 
void mouseExited (MouseEvent &event)
 
void widgetHidden (const Event &event)
 
void setWidget2 (const Widget2 *const widget)
 
- Public Member Functions inherited from ShortcutContainer
 ~ShortcutContainer ()
 
void widgetResized (const Event &event)
 
void widgetMoved (const Event &event)
 
void mouseDragged (MouseEvent &event)
 
void mousePressed (MouseEvent &event)
 
void mouseReleased (MouseEvent &event)
 
int getMaxItems () const
 
int getBoxWidth () const
 
int getBoxHeight () const
 
void drawBackground (Graphics *const g)
 
void safeDrawBackground (Graphics *const g)
 
- Public Member Functions inherited from Widget
 Widget (const Widget2 *const widget)
 
 ~Widget ()
 
virtual void drawFrame (Graphics *graphics)
 
virtual void safeDrawFrame (Graphics *graphics)
 
void setFrameSize (const unsigned int frameSize)
 
unsigned int getFrameSize () const
 
virtual void logic ()
 
WidgetgetParent () const
 
void setWidth (const int width)
 
int getWidth () const
 
void setHeight (const int height)
 
int getHeight () const
 
void setSize (const int width, const int height)
 
void setX (const int x)
 
int getX () const
 
void setY (const int y)
 
int getY () const
 
void setPosition (const int x, const int y)
 
void setDimension (const Rect &dimension)
 
const RectgetDimension () const
 
void setFocusable (const bool focusable)
 
bool isFocusable () const
 
virtual bool isFocused () const
 
void setEnabled (const bool enabled)
 
bool isEnabled () const
 
void setVisible (Visible visible)
 
bool isVisible () const
 
void setBaseColor (const Color &color)
 
const ColorgetBaseColor () const
 
void setForegroundColor (const Color &color)
 
const ColorgetForegroundColor () const
 
void setBackgroundColor (const Color &color)
 
const ColorgetBackgroundColor () const
 
virtual void requestFocus ()
 
virtual void requestMoveToTop ()
 
virtual void requestMoveToBottom ()
 
virtual void setFocusHandler (FocusHandler *const focusHandler)
 
FocusHandlergetFocusHandler ()
 
void addActionListener (ActionListener *const actionListener)
 
void removeActionListener (ActionListener *const actionListener)
 
void addDeathListener (WidgetDeathListener *const deathListener)
 
void removeDeathListener (WidgetDeathListener *const deathListener)
 
void addMouseListener (MouseListener *const mouseListener)
 
void removeMouseListener (MouseListener *const mouseListener)
 
void addKeyListener (KeyListener *const keyListener)
 
void removeKeyListener (KeyListener *const keyListener)
 
void addFocusListener (FocusListener *const focusListener)
 
void removeFocusListener (FocusListener *const focusListener)
 
void addWidgetListener (WidgetListener *const widgetListener)
 
void removeWidgetListener (WidgetListener *const widgetListener)
 
void setActionEventId (const std::string &actionEventId)
 
const std::string & getActionEventId () const
 
virtual void getAbsolutePosition (int &x, int &y) const
 
virtual void setParent (Widget *parent)
 
FontgetFont () const
 
void setFont (Font *const font)
 
virtual void fontChanged ()
 
bool isTabInEnabled () const
 
void setTabInEnabled (const bool enabled)
 
bool isTabOutEnabled () const
 
void setTabOutEnabled (const bool enabled)
 
void requestModalFocus ()
 
virtual void requestModalMouseInputFocus ()
 
virtual void releaseModalFocus ()
 
virtual void releaseModalMouseInputFocus ()
 
virtual bool isModalFocused () const
 
virtual bool isModalMouseInputFocused () const
 
virtual WidgetgetWidgetAt (int x, int y)
 
const std::list< MouseListener * > & getMouseListeners () const A_CONST
 
const std::list< KeyListener * > & getKeyListeners () const A_CONST
 
const std::list< FocusListener * > & getFocusListeners () const A_CONST
 
virtual Rect getChildrenArea ()
 
virtual FocusHandlergetInternalFocusHandler ()
 
void setInternalFocusHandler (FocusHandler *const internalFocusHandler)
 
virtual void moveToTop (Widget *widget)
 
virtual void moveToBottom (Widget *widget)
 
virtual void focusNext ()
 
virtual void focusPrevious ()
 
virtual void showWidgetPart (Widget *const widget, const Rect &area)
 
void setId (const std::string &id)
 
const std::string & getId () const
 
virtual void showPart (const Rect &rectangle)
 
bool isAllowLogic () const
 
void setMouseConsume (const bool b)
 
bool isMouseConsume () const
 
void setRedraw (const bool b)
 
virtual bool isSelectable () const
 
void setSelectable (const bool selectable)
 
void windowResized ()
 
virtual void postInit ()
 
- Public Member Functions inherited from Widget2
virtual ~Widget2 ()
 
const ColorgetThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE
 
const ColorgetThemeCharColor (const signed char c, bool &valid) const A_INLINE
 
void setPalette (int palette)
 
void checkPalette ()
 
void setForegroundColor2 (const Color &color)
 
WidgetgetWindow () const
 
virtual void setWindow (Widget *const window)
 
- Public Member Functions inherited from WidgetListener
virtual ~WidgetListener ()
 
virtual void widgetShown (const Event &event)
 
- Public Member Functions inherited from MouseListener
virtual ~MouseListener ()
 
virtual void mouseEntered (MouseEvent &event)
 
virtual void mouseClicked (MouseEvent &event)
 
virtual void mouseWheelMovedUp (MouseEvent &event)
 
virtual void mouseWheelMovedDown (MouseEvent &event)
 

Private Attributes

std::vector< const EmoteSprite * > mEmoteImg
 
bool mEmoteClicked
 
unsigned char mEmoteMoved
 

Additional Inherited Members

- Static Public Member Functions inherited from Widget
static void setGlobalFont (Font *const font)
 
static FontgetGloablFont ()
 
static void cleanGlobalFont ()
 
static bool widgetExists (const Widget *const widget)
 
static void distributeWindowResizeEvent ()
 
static WidgetcallPostInit (Widget *const widget)
 
- Data Fields inherited from Widget
Visible mVisible
 
- Protected Types inherited from Widget
typedef std::list< MouseListener * > MouseListenerList
 
typedef MouseListenerList::iterator MouseListenerIterator
 
typedef std::list< KeyListener * > KeyListenerList
 
typedef KeyListenerList::iterator KeyListenerIterator
 
typedef std::list< ActionListener * > ActionListenerList
 
typedef ActionListenerList::iterator ActionListenerIterator
 
typedef std::list< WidgetDeathListener * > WidgetDeathListenerList
 
typedef WidgetDeathListenerList::iterator WidgetDeathListenerIterator
 
typedef std::list< FocusListener * > FocusListenerList
 
typedef FocusListenerList::iterator FocusListenerIterator
 
typedef std::list< WidgetListener * > WidgetListenerList
 
typedef WidgetListenerList::iterator WidgetListenerIterator
 
- Protected Member Functions inherited from ShortcutContainer
 ShortcutContainer (Widget2 *const widget)
 
int getIndexFromGrid (const int pointX, const int pointY) const
 
- Protected Member Functions inherited from Widget
void distributeActionEvent ()
 
void distributeResizedEvent ()
 
void distributeMovedEvent ()
 
void distributeHiddenEvent ()
 
void distributeShownEvent ()
 
- Protected Member Functions inherited from Widget2
 Widget2 (const Widget2 *const widget)
 
- Protected Member Functions inherited from WidgetListener
 WidgetListener ()
 
- Protected Member Functions inherited from MouseListener
 MouseListener ()
 
- Protected Attributes inherited from ShortcutContainer
ImagemBackgroundImg
 
unsigned mMaxItems
 
int mBoxWidth
 
int mBoxHeight
 
int mGridWidth
 
int mGridHeight
 
ImageCollectionmVertexes
 
- Protected Attributes inherited from Widget
MouseListenerList mMouseListeners
 
KeyListenerList mKeyListeners
 
ActionListenerList mActionListeners
 
WidgetDeathListenerList mDeathListeners
 
FocusListenerList mFocusListeners
 
WidgetListenerList mWidgetListeners
 
Color mForegroundColor
 
Color mBackgroundColor
 
Color mBaseColor
 
Rect mDimension
 
std::string mActionEventId
 
std::string mId
 
FocusHandlermFocusHandler
 
FocusHandlermInternalFocusHandler
 
WidgetmParent
 
FontmCurrentFont
 
unsigned int mFrameSize
 
bool mFocusable
 
bool mTabIn
 
bool mTabOut
 
bool mEnabled
 
bool mAllowLogic
 
bool mMouseConsume
 
bool mRedraw
 
bool mSelectable
 
- Protected Attributes inherited from Widget2
int mPaletteOffset
 
WidgetmWindow
 
Color mForegroundColor2
 
- Static Protected Attributes inherited from ShortcutContainer
static float mAlpha = 1.0
 
- Static Protected Attributes inherited from Widget
static FontmGlobalFont = 0
 

Detailed Description

An emote shortcut container. Used to quickly use emoticons.

Definition at line 34 of file emoteshortcutcontainer.h.

Constructor & Destructor Documentation

◆ EmoteShortcutContainer()

EmoteShortcutContainer::EmoteShortcutContainer ( Widget2 *const  widget)
explicit

Constructor. Initializes the graphic.

Definition at line 53 of file emoteshortcutcontainer.cpp.

References EmoteDB::getLast(), EmoteDB::getSprite(), Settings::guiAlpha, MAX_ITEMS, ShortcutContainer::mBackgroundImg, mEmoteImg, ShortcutContainer::mMaxItems, Image::setAlpha(), settings, and EmoteSprite::sprite.

54  :
55  ShortcutContainer(widget),
56  mEmoteImg(),
57  mEmoteClicked(false),
58  mEmoteMoved(0)
59 {
60  if (mBackgroundImg != nullptr)
62 
63  // Setup emote sprites
64  for (int i = 0; i <= EmoteDB::getLast(); i++)
65  {
66  const EmoteSprite *const sprite = EmoteDB::getSprite(i, true);
67  if ((sprite != nullptr) && (sprite->sprite != nullptr))
68  mEmoteImg.push_back(sprite);
69  }
70 
72 }
ShortcutContainer(Widget2 *const widget)
const int & getLast() A_CONST
Definition: emotedb.cpp:300
Settings settings
Definition: settings.cpp:31
virtual void setAlpha(const float alpha)
Definition: image.cpp:285
const EmoteSprite * getSprite(const int id, const bool allowNull)
Definition: emotedb.cpp:291
static const int MAX_ITEMS
std::vector< const EmoteSprite * > mEmoteImg
float guiAlpha
Definition: settings.h:129
const AnimatedSprite * sprite
Definition: emotesprite.h:41

◆ ~EmoteShortcutContainer()

EmoteShortcutContainer::~EmoteShortcutContainer ( )

Destructor.

Definition at line 74 of file emoteshortcutcontainer.cpp.

75 {
76 }

Member Function Documentation

◆ draw()

void EmoteShortcutContainer::draw ( Graphics graphics)
virtual

Draws the items.

Implements Widget.

Definition at line 86 of file emoteshortcutcontainer.cpp.

References BLOCK_END, BLOCK_START, CAST_U32, ShortcutContainer::drawBackground(), Font::drawString(), InputAction::EMOTE_1, emoteShortcut, ServerCommandType::font, Widget::getFont(), InputManager::getKeyValueString(), Settings::guiAlpha, inputManager, ShortcutContainer::mAlpha, ShortcutContainer::mBackgroundImg, ShortcutContainer::mBoxHeight, ShortcutContainer::mBoxWidth, mEmoteImg, Widget::mForegroundColor, Widget2::mForegroundColor2, ShortcutContainer::mGridWidth, ShortcutContainer::mMaxItems, restrict, Image::setAlpha(), and settings.

87 {
88  if (emoteShortcut == nullptr)
89  return;
90 
91  BLOCK_START("EmoteShortcutContainer::draw")
92  if (settings.guiAlpha != mAlpha)
93  {
94  if (mBackgroundImg != nullptr)
95  mBackgroundImg->setAlpha(mAlpha);
96  mAlpha = settings.guiAlpha;
97  }
98 
99  Font *const font = getFont();
100  drawBackground(graphics);
101 
102  unsigned sz = CAST_U32(mEmoteImg.size());
103  if (sz > mMaxItems)
104  sz = mMaxItems;
105  for (unsigned i = 0; i < sz; i++)
106  {
107  const EmoteSprite *restrict const emoteImg = mEmoteImg[i];
108  if (emoteImg != nullptr)
109  {
110  const AnimatedSprite *restrict const sprite = emoteImg->sprite;
111  if (sprite != nullptr)
112  {
113  sprite->draw(graphics,
114  (i % mGridWidth) * mBoxWidth + 2,
115  (i / mGridWidth) * mBoxHeight + 10);
116  }
117  }
118  }
119  for (unsigned i = 0; i < mMaxItems; i++)
120  {
121  const int emoteX = (i % mGridWidth) * mBoxWidth;
122  const int emoteY = (i / mGridWidth) * mBoxHeight;
123 
124  // Draw emote keyboard shortcut.
125  const std::string key = inputManager.getKeyValueString(
127 
128  font->drawString(graphics,
131  key,
132  emoteX + 2, emoteY + 2);
133  }
134 
135  BLOCK_END("EmoteShortcutContainer::draw")
136 }
#define CAST_U32
Definition: cast.h:30
Font * getFont() const
Definition: widget.cpp:330
Definition: font.h:88
#define BLOCK_START(name)
Definition: perfomance.h:78
if(!vert) return
#define BLOCK_END(name)
Definition: perfomance.h:79
Color mForegroundColor
Definition: widget.h:1085
Settings settings
Definition: settings.cpp:31
virtual void setAlpha(const float alpha)
Definition: image.cpp:285
std::string getKeyValueString(const InputActionT index) const
void drawString(Graphics *const graphics, Color col, const Color &col2, const std::string &text, const int x, const int y)
Definition: font.cpp:253
void drawBackground(Graphics *const g)
EmoteShortcut * emoteShortcut
Color mForegroundColor2
Definition: widget2.h:112
#define restrict
Definition: localconsts.h:176
InputManager inputManager
std::vector< const EmoteSprite * > mEmoteImg
float guiAlpha
Definition: settings.h:129

◆ mouseDragged()

void EmoteShortcutContainer::mouseDragged ( MouseEvent event)
virtual

Handles mouse when dragged.

Reimplemented from MouseListener.

Definition at line 190 of file emoteshortcutcontainer.cpp.

192 {
193 }

◆ mouseExited()

void EmoteShortcutContainer::mouseExited ( MouseEvent event)
virtual

Called when the mouse has exited the widget area.

Parameters
eventDescribes the event.

Reimplemented from MouseListener.

Definition at line 285 of file emoteshortcutcontainer.cpp.

References Widget::setVisible(), textPopup, and Visible_false.

287 {
288  if (textPopup != nullptr)
290 }
void setVisible(Visible visible)
Definition: widget.cpp:224
const bool Visible_false
Definition: visible.h:29
TextPopup * textPopup
Definition: textpopup.cpp:32

◆ mouseMoved()

void EmoteShortcutContainer::mouseMoved ( MouseEvent event)
virtual

Called when the mouse has moved in the widget area and no mouse button has been pressed (i.e no widget is being dragged).

Parameters
eventDescribes the event.

Reimplemented from MouseListener.

Definition at line 265 of file emoteshortcutcontainer.cpp.

References CAST_SIZE, emoteShortcut, ShortcutContainer::getIndexFromGrid(), mEmoteImg, Viewport::mMouseX, Viewport::mMouseY, restrict, Widget::setVisible(), TextPopup::show(), strprintf(), textPopup, viewport, and Visible_false.

266 {
267  if ((emoteShortcut == nullptr) || (textPopup == nullptr))
268  return;
269 
270  const int index = getIndexFromGrid(event.getX(), event.getY());
271 
272  if (index == -1)
273  return;
274 
276 
277  if (CAST_SIZE(index) < mEmoteImg.size() && (mEmoteImg[index] != nullptr))
278  {
279  const EmoteSprite *restrict const sprite = mEmoteImg[index];
281  strprintf("%s, %d", sprite->name.c_str(), sprite->id));
282  }
283 }
void show(const int x, const int y, const std::string &str1)
Definition: textpopup.h:56
void setVisible(Visible visible)
Definition: widget.cpp:224
int mMouseX
Definition: viewport.h:153
int getIndexFromGrid(const int pointX, const int pointY) const
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
const bool Visible_false
Definition: visible.h:29
int mMouseY
Definition: viewport.h:154
EmoteShortcut * emoteShortcut
#define restrict
Definition: localconsts.h:176
#define CAST_SIZE
Definition: cast.h:33
int getX() const
Definition: mouseevent.h:126
std::vector< const EmoteSprite * > mEmoteImg
TextPopup * textPopup
Definition: textpopup.cpp:32
Viewport * viewport
Definition: viewport.cpp:35

◆ mousePressed()

void EmoteShortcutContainer::mousePressed ( MouseEvent event)
virtual

Handles mouse when pressed.

Reimplemented from MouseListener.

Definition at line 195 of file emoteshortcutcontainer.cpp.

References emoteShortcut, EmoteShortcut::getEmote(), ShortcutContainer::getIndexFromGrid(), EmoteShortcut::isEmoteSelected(), MouseButton::LEFT, mEmoteClicked, popupMenu, MouseButton::RIGHT, EmoteShortcut::setEmote(), EmoteShortcut::setEmoteSelected(), and PopupMenu::showEmoteType().

196 {
197  if (event.isConsumed())
198  return;
199 
200  if (event.getButton() == MouseButton::LEFT)
201  {
202  if (emoteShortcut == nullptr)
203  return;
204 
205  const int index = getIndexFromGrid(event.getX(), event.getY());
206 
207  if (index == -1)
208  return;
209 
210  event.consume();
211  // Stores the selected emote if there is one.
213  {
214  emoteShortcut->setEmote(index);
216  }
217  else if (emoteShortcut->getEmote(index) != 0u)
218  {
219  mEmoteClicked = true;
220  }
221  }
222  else if (event.getButton() == MouseButton::RIGHT)
223  {
224  if (popupMenu != nullptr)
225  {
226  event.consume();
228  }
229  }
230 }
MouseButtonT getButton() const
Definition: mouseevent.h:115
int getIndexFromGrid(const int pointX, const int pointY) const
void setEmoteSelected(const unsigned char emoteId)
Definition: emoteshortcut.h:97
PopupMenu * popupMenu
Definition: popupmenu.cpp:102
unsigned char getEmote(const size_t index) const
Definition: emoteshortcut.h:59
void showEmoteType()
Definition: popupmenu.cpp:1214
bool isEmoteSelected() const
bool isConsumed() const
void setEmote(const size_t index)
Definition: emoteshortcut.h:79
EmoteShortcut * emoteShortcut
int getX() const
Definition: mouseevent.h:126

◆ mouseReleased()

void EmoteShortcutContainer::mouseReleased ( MouseEvent event)
virtual

Handles mouse release.

Reimplemented from MouseListener.

Definition at line 232 of file emoteshortcutcontainer.cpp.

References emoteShortcut, EmoteShortcut::getEmote(), ShortcutContainer::getIndexFromGrid(), EmoteShortcut::isEmoteSelected(), MouseButton::LEFT, mEmoteClicked, mEmoteMoved, EmoteShortcut::setEmotes(), EmoteShortcut::setEmoteSelected(), and EmoteShortcut::useEmote().

234 {
235  if (emoteShortcut == nullptr)
236  return;
237 
238  if (event.getButton() == MouseButton::LEFT)
239  {
240  const int index = getIndexFromGrid(event.getX(), event.getY());
241 
244 
245  if (index == -1)
246  {
247  mEmoteMoved = 0;
248  return;
249  }
250 
251  if (mEmoteMoved != 0u)
252  {
254  mEmoteMoved = 0;
255  }
256  else if ((emoteShortcut->getEmote(index) != 0u) && mEmoteClicked)
257  {
258  emoteShortcut->useEmote(index + 1);
259  }
260 
261  mEmoteClicked = false;
262  }
263 }
MouseButtonT getButton() const
Definition: mouseevent.h:115
int getIndexFromGrid(const int pointX, const int pointY) const
void setEmoteSelected(const unsigned char emoteId)
Definition: emoteshortcut.h:97
unsigned char getEmote(const size_t index) const
Definition: emoteshortcut.h:59
bool isEmoteSelected() const
EmoteShortcut * emoteShortcut
void useEmote(const size_t index) const
int getX() const
Definition: mouseevent.h:126
void setEmotes(const size_t index, const unsigned char emoteId)
Definition: emoteshortcut.h:88

◆ safeDraw()

void EmoteShortcutContainer::safeDraw ( Graphics graphics)
virtual

Implements Widget.

Definition at line 138 of file emoteshortcutcontainer.cpp.

References BLOCK_END, BLOCK_START, CAST_U32, Font::drawString(), InputAction::EMOTE_1, emoteShortcut, ServerCommandType::font, Widget::getFont(), InputManager::getKeyValueString(), Settings::guiAlpha, inputManager, ShortcutContainer::mAlpha, ShortcutContainer::mBackgroundImg, ShortcutContainer::mBoxHeight, ShortcutContainer::mBoxWidth, mEmoteImg, Widget::mForegroundColor, Widget2::mForegroundColor2, ShortcutContainer::mGridWidth, ShortcutContainer::mMaxItems, restrict, ShortcutContainer::safeDrawBackground(), Image::setAlpha(), and settings.

139 {
140  if (emoteShortcut == nullptr)
141  return;
142 
143  BLOCK_START("EmoteShortcutContainer::draw")
144  if (settings.guiAlpha != mAlpha)
145  {
146  if (mBackgroundImg != nullptr)
147  mBackgroundImg->setAlpha(mAlpha);
148  mAlpha = settings.guiAlpha;
149  }
150 
151  Font *const font = getFont();
152  safeDrawBackground(graphics);
153 
154  unsigned sz = CAST_U32(mEmoteImg.size());
155  if (sz > mMaxItems)
156  sz = mMaxItems;
157  for (unsigned i = 0; i < sz; i++)
158  {
159  const EmoteSprite *restrict const emoteImg = mEmoteImg[i];
160  if (emoteImg != nullptr)
161  {
162  const AnimatedSprite *restrict const sprite = emoteImg->sprite;
163  if (sprite != nullptr)
164  {
165  sprite->draw(graphics,
166  (i % mGridWidth) * mBoxWidth + 2,
167  (i / mGridWidth) * mBoxHeight + 10);
168  }
169  }
170  }
171  for (unsigned i = 0; i < mMaxItems; i++)
172  {
173  const int emoteX = (i % mGridWidth) * mBoxWidth;
174  const int emoteY = (i / mGridWidth) * mBoxHeight;
175 
176  // Draw emote keyboard shortcut.
177  const std::string key = inputManager.getKeyValueString(
179 
180  font->drawString(graphics,
183  key,
184  emoteX + 2, emoteY + 2);
185  }
186 
187  BLOCK_END("EmoteShortcutContainer::draw")
188 }
#define CAST_U32
Definition: cast.h:30
Font * getFont() const
Definition: widget.cpp:330
Definition: font.h:88
#define BLOCK_START(name)
Definition: perfomance.h:78
if(!vert) return
#define BLOCK_END(name)
Definition: perfomance.h:79
Color mForegroundColor
Definition: widget.h:1085
Settings settings
Definition: settings.cpp:31
virtual void setAlpha(const float alpha)
Definition: image.cpp:285
std::string getKeyValueString(const InputActionT index) const
void drawString(Graphics *const graphics, Color col, const Color &col2, const std::string &text, const int x, const int y)
Definition: font.cpp:253
EmoteShortcut * emoteShortcut
Color mForegroundColor2
Definition: widget2.h:112
void safeDrawBackground(Graphics *const g)
#define restrict
Definition: localconsts.h:176
InputManager inputManager
std::vector< const EmoteSprite * > mEmoteImg
float guiAlpha
Definition: settings.h:129

◆ setWidget2()

void EmoteShortcutContainer::setWidget2 ( const Widget2 *const  widget)
virtual

Reimplemented from Widget2.

Definition at line 78 of file emoteshortcutcontainer.cpp.

References Widget2::getThemeColor(), Widget::mForegroundColor, Widget2::mForegroundColor2, Widget2::setWidget2(), ThemeColorId::TEXT, and ThemeColorId::TEXT_OUTLINE.

80 {
81  Widget2::setWidget2(widget);
84 }
virtual void setWidget2(const Widget2 *const widget)
Definition: widget2.h:63
Color mForegroundColor
Definition: widget.h:1085
Color mForegroundColor2
Definition: widget2.h:112
const Color & getThemeColor(const ThemeColorIdT type, const unsigned int alpha) const A_INLINE
Definition: widget2.h:44

◆ widgetHidden()

void EmoteShortcutContainer::widgetHidden ( const Event event)
virtual

Invoked when a widget is hidden, i.e it's set to be not visible.

Parameters
eventDescribes the event.

Reimplemented from WidgetListener.

Definition at line 292 of file emoteshortcutcontainer.cpp.

References Widget::setVisible(), textPopup, and Visible_false.

294 {
295  if (textPopup != nullptr)
297 }
void setVisible(Visible visible)
Definition: widget.cpp:224
const bool Visible_false
Definition: visible.h:29
TextPopup * textPopup
Definition: textpopup.cpp:32

Field Documentation

◆ mEmoteClicked

bool EmoteShortcutContainer::mEmoteClicked
private

Definition at line 88 of file emoteshortcutcontainer.h.

Referenced by mousePressed(), and mouseReleased().

◆ mEmoteImg

std::vector<const EmoteSprite*> EmoteShortcutContainer::mEmoteImg
private

Definition at line 86 of file emoteshortcutcontainer.h.

Referenced by draw(), EmoteShortcutContainer(), mouseMoved(), and safeDraw().

◆ mEmoteMoved

unsigned char EmoteShortcutContainer::mEmoteMoved
private

Definition at line 89 of file emoteshortcutcontainer.h.

Referenced by mouseReleased().


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