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 setSkin (const Widget2 *const widget, Skin *const skin)
 
- 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
 
virtual void setWidget2 (const Widget2 *const widget)
 
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
 
SkinmSkin
 
unsigned mMaxItems
 
int mBoxWidth
 
int mBoxHeight
 
int mGridWidth
 
int mGridHeight
 
int mImageOffsetX
 
int mImageOffsetY
 
int mTextOffsetX
 
int mTextOffsetY
 
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:286
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::mImageOffsetX, ShortcutContainer::mImageOffsetY, ShortcutContainer::mMaxItems, ShortcutContainer::mTextOffsetX, ShortcutContainer::mTextOffsetY, 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,
115  (i / mGridWidth) * mBoxHeight + mImageOffsetY);
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 + mTextOffsetX,
133  emoteY + mTextOffsetY);
134  }
135 
136  BLOCK_END("EmoteShortcutContainer::draw")
137 }
#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:286
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:164
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 192 of file emoteshortcutcontainer.cpp.

194 {
195 }

◆ 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 287 of file emoteshortcutcontainer.cpp.

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

289 {
290  if (textPopup != nullptr)
292 }
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 267 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.

268 {
269  if ((emoteShortcut == nullptr) || (textPopup == nullptr))
270  return;
271 
272  const int index = getIndexFromGrid(event.getX(), event.getY());
273 
274  if (index == -1)
275  return;
276 
278 
279  if (CAST_SIZE(index) < mEmoteImg.size() && (mEmoteImg[index] != nullptr))
280  {
281  const EmoteSprite *restrict const sprite = mEmoteImg[index];
283  strprintf("%s, %d", sprite->name.c_str(), sprite->id));
284  }
285 }
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:164
#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 197 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().

198 {
199  if (event.isConsumed())
200  return;
201 
202  if (event.getButton() == MouseButton::LEFT)
203  {
204  if (emoteShortcut == nullptr)
205  return;
206 
207  const int index = getIndexFromGrid(event.getX(), event.getY());
208 
209  if (index == -1)
210  return;
211 
212  event.consume();
213  // Stores the selected emote if there is one.
215  {
216  emoteShortcut->setEmote(index);
218  }
219  else if (emoteShortcut->getEmote(index) != 0U)
220  {
221  mEmoteClicked = true;
222  }
223  }
224  else if (event.getButton() == MouseButton::RIGHT)
225  {
226  if (popupMenu != nullptr)
227  {
228  event.consume();
230  }
231  }
232 }
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 234 of file emoteshortcutcontainer.cpp.

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

236 {
237  if (emoteShortcut == nullptr)
238  return;
239 
240  if (event.getButton() == MouseButton::LEFT)
241  {
242  const int index = getIndexFromGrid(event.getX(), event.getY());
243 
246 
247  if (index == -1)
248  {
249  mEmoteMoved = 0;
250  return;
251  }
252 
253  if (mEmoteMoved != 0U)
254  {
256  mEmoteMoved = 0;
257  }
258  else if ((emoteShortcut->getEmote(index) != 0U) && mEmoteClicked)
259  {
260  emoteShortcut->useEmote(index + 1);
261  }
262 
263  mEmoteClicked = false;
264  }
265 }
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 139 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::mImageOffsetX, ShortcutContainer::mImageOffsetY, ShortcutContainer::mMaxItems, ShortcutContainer::mTextOffsetX, ShortcutContainer::mTextOffsetY, restrict, ShortcutContainer::safeDrawBackground(), Image::setAlpha(), and settings.

140 {
141  if (emoteShortcut == nullptr)
142  return;
143 
144  BLOCK_START("EmoteShortcutContainer::draw")
145  if (settings.guiAlpha != mAlpha)
146  {
147  if (mBackgroundImg != nullptr)
148  mBackgroundImg->setAlpha(mAlpha);
149  mAlpha = settings.guiAlpha;
150  }
151 
152  Font *const font = getFont();
153  safeDrawBackground(graphics);
154 
155  unsigned sz = CAST_U32(mEmoteImg.size());
156  if (sz > mMaxItems)
157  sz = mMaxItems;
158  for (unsigned i = 0; i < sz; i++)
159  {
160  const EmoteSprite *restrict const emoteImg = mEmoteImg[i];
161  if (emoteImg != nullptr)
162  {
163  const AnimatedSprite *restrict const sprite = emoteImg->sprite;
164  if (sprite != nullptr)
165  {
166  sprite->draw(graphics,
168  (i / mGridWidth) * mBoxHeight + mImageOffsetY);
169  }
170  }
171  }
172  for (unsigned i = 0; i < mMaxItems; i++)
173  {
174  const int emoteX = (i % mGridWidth) * mBoxWidth;
175  const int emoteY = (i / mGridWidth) * mBoxHeight;
176 
177  // Draw emote keyboard shortcut.
178  const std::string key = inputManager.getKeyValueString(
180 
181  font->drawString(graphics,
184  key,
185  emoteX + mTextOffsetX,
186  emoteY + mTextOffsetY);
187  }
188 
189  BLOCK_END("EmoteShortcutContainer::draw")
190 }
#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:286
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:164
InputManager inputManager
std::vector< const EmoteSprite * > mEmoteImg
float guiAlpha
Definition: settings.h:129

◆ setSkin()

void EmoteShortcutContainer::setSkin ( const Widget2 *const  widget,
Skin *const  skin 
)
virtual

Reimplemented from ShortcutContainer.

Definition at line 78 of file emoteshortcutcontainer.cpp.

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

80 {
81  ShortcutContainer::setSkin(widget, skin);
84 }
Color mForegroundColor
Definition: widget.h:1085
virtual void setSkin(const Widget2 *const widget, Skin *const skin)
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 294 of file emoteshortcutcontainer.cpp.

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

296 {
297  if (textPopup != nullptr)
299 }
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: