ManaPlus
|
#include <playerbox.h>
Public Member Functions | |
PlayerBox (Widget2 *const widget, Being *const being, const std::string &skin, const std::string &selectedSkin) | |
PlayerBox (Widget2 *const widget, const std::string &skin, const std::string &selectedSkin) | |
~PlayerBox () | |
void | init (std::string name, std::string selectedName) |
void | setPlayer (Being *being) |
void | draw (Graphics *const graphics) |
void | safeDraw (Graphics *const graphics) |
void | drawFrame (Graphics *const graphics) |
void | safeDrawFrame (Graphics *const graphics) |
Being * | getBeing () |
void | setSelected (bool b) |
void | mouseReleased (MouseEvent &event) |
Public Member Functions inherited from Widget | |
Widget (const Widget2 *const widget) | |
~Widget () | |
void | setFrameSize (const unsigned int frameSize) |
unsigned int | getFrameSize () const |
virtual void | logic () |
Widget * | getParent () 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 Rect & | getDimension () 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 Color & | getBaseColor () const |
void | setForegroundColor (const Color &color) |
const Color & | getForegroundColor () const |
void | setBackgroundColor (const Color &color) |
const Color & | getBackgroundColor () const |
virtual void | requestFocus () |
virtual void | requestMoveToTop () |
virtual void | requestMoveToBottom () |
virtual void | setFocusHandler (FocusHandler *const focusHandler) |
FocusHandler * | getFocusHandler () |
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) |
Font * | getFont () 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 Widget * | getWidgetAt (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 FocusHandler * | getInternalFocusHandler () |
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 Color & | getThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE |
const Color & | getThemeCharColor (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) |
Widget * | getWindow () const |
virtual void | setWindow (Widget *const window) |
Public Member Functions inherited from MouseListener | |
virtual | ~MouseListener () |
virtual void | mouseEntered (MouseEvent &event) |
virtual void | mouseExited (MouseEvent &event) |
virtual void | mousePressed (MouseEvent &event) |
virtual void | mouseClicked (MouseEvent &event) |
virtual void | mouseWheelMovedUp (MouseEvent &event) |
virtual void | mouseWheelMovedDown (MouseEvent &event) |
virtual void | mouseMoved (MouseEvent &event) |
virtual void | mouseDragged (MouseEvent &event) |
Private Attributes | |
Being * | mBeing |
float | mAlpha |
ImageRect | mBackground |
ImageRect | mSelectedBackground |
Skin * | mSkin |
Skin * | mSelectedSkin |
int | mOffsetX |
int | mOffsetY |
bool | mDrawBackground |
bool | mSelected |
A box showing a player character.
Definition at line 43 of file playerbox.h.
PlayerBox::PlayerBox | ( | Widget2 *const | widget, |
Being *const | being, | ||
const std::string & | skin, | ||
const std::string & | selectedSkin | ||
) |
Constructor. Takes the initial player character that this box should display, which defaults to NULL
.
Definition at line 39 of file playerbox.cpp.
References init().
PlayerBox::PlayerBox | ( | Widget2 *const | widget, |
const std::string & | skin, | ||
const std::string & | selectedSkin | ||
) |
PlayerBox::~PlayerBox | ( | ) |
Destructor.
Definition at line 78 of file playerbox.cpp.
References gui, mBackground, mBeing, mSelectedBackground, Gui::removeDragged(), and Theme::unloadRect().
|
virtual |
Draws the scroll area.
Implements Widget.
Definition at line 127 of file playerbox.cpp.
References BLOCK_END, BLOCK_START, Being::drawBasic(), ImageRect::grid, Settings::guiAlpha, Rect::height, mAlpha, mBackground, mBeing, Widget::mDimension, Widget::mFrameSize, mOffsetX, mOffsetY, settings, Rect::width, x, and y.
Referenced by safeDraw().
|
virtual |
Draws the background and border of the scroll area.
Reimplemented from Widget.
Definition at line 155 of file playerbox.cpp.
References BLOCK_END, BLOCK_START, Graphics::drawImageRect(), Rect::height, mBackground, Widget::mDimension, mDrawBackground, Widget::mFrameSize, mSelected, mSelectedBackground, and Rect::width.
|
inline |
Definition at line 92 of file playerbox.h.
References mBeing.
Referenced by NpcDialog::setAvatarAction(), NpcDialog::setAvatarDirection(), and NpcDialog::~NpcDialog().
void PlayerBox::init | ( | std::string | name, |
std::string | selectedName | ||
) |
Definition at line 88 of file playerbox.cpp.
References Widget::addMouseListener(), Skin::getOption(), ImageRect::grid, Theme::loadSkinRect(), Widget::mAllowLogic, mapTileSize, mBackground, mDrawBackground, Widget::mFrameSize, mOffsetX, mOffsetY, mSelectedBackground, mSelectedSkin, mSkin, Widget::setFrameSize(), and theme.
Referenced by PlayerBox().
|
virtual |
Called when a mouse button has been released on the widget area.
event | Describes the event. |
Reimplemented from MouseListener.
Definition at line 189 of file playerbox.cpp.
References Widget::distributeActionEvent(), MouseEvent::getButton(), MouseButton::LEFT, and Widget::mActionEventId.
|
virtual |
|
virtual |
Reimplemented from Widget.
Definition at line 172 of file playerbox.cpp.
References BLOCK_END, BLOCK_START, Graphics::drawImageRect(), Rect::height, mBackground, Widget::mDimension, mDrawBackground, Widget::mFrameSize, mSelected, mSelectedBackground, and Rect::width.
|
inline |
Sets a new player character to be displayed by this box. Setting the player to NULL
causes the box not to draw any character.
Definition at line 74 of file playerbox.h.
References mBeing.
Referenced by EquipmentWindow::EquipmentWindow(), EquipmentWindow::setBeing(), CharacterDisplay::setCharacter(), and NpcDialog::showAvatar().
|
inline |
Definition at line 95 of file playerbox.h.
References mSelected.
Referenced by CharacterDisplay::setSelect().
|
private |
Definition at line 102 of file playerbox.h.
Referenced by draw().
|
private |
Definition at line 103 of file playerbox.h.
Referenced by draw(), drawFrame(), init(), safeDrawFrame(), and ~PlayerBox().
|
private |
Definition at line 101 of file playerbox.h.
Referenced by draw(), getBeing(), setPlayer(), and ~PlayerBox().
|
private |
Definition at line 109 of file playerbox.h.
Referenced by drawFrame(), init(), and safeDrawFrame().
|
private |
Definition at line 107 of file playerbox.h.
|
private |
Definition at line 108 of file playerbox.h.
|
private |
Definition at line 110 of file playerbox.h.
Referenced by drawFrame(), safeDrawFrame(), and setSelected().
|
private |
Definition at line 104 of file playerbox.h.
Referenced by drawFrame(), init(), safeDrawFrame(), and ~PlayerBox().
|
private |
Definition at line 106 of file playerbox.h.
Referenced by init().
|
private |
Definition at line 105 of file playerbox.h.
Referenced by init().