ManaPlus
|
#include <npcdialog.h>
Public Member Functions | |
NpcDialog (const BeingId npcId) | |
~NpcDialog () | |
void | postInit () |
void | action (const ActionEvent &event) |
void | addText (const std::string &string, const bool save) |
void | showNextButton () |
void | showCloseButton () |
void | nextDialog () |
void | closeDialog () |
int | getNumberOfElements () |
std::string | getElementAt (int i) |
const Image * | getImageAt (int i) |
void | choiceRequest () |
void | addChoice (const std::string &) |
void | parseListItems (const std::string &itemString) |
void | textRequest (const std::string &defaultText) |
bool | isInputFocused () const |
bool | isTextInputFocused () const |
void | integerRequest (const int defaultValue, const int min, const int max) |
void | itemRequest (const int size) |
void | itemIndexRequest (const int size) |
void | itemCraftRequest (const int size) |
void | move (const int amount) |
void | setVisible (Visible visible) |
void | optionChanged (const std::string &name) |
void | saveCamera () |
void | restoreCamera () |
void | refocus () |
void | showAvatar (const BeingTypeId avatarId) |
void | setAvatarDirection (const uint8_t direction) |
void | setAvatarAction (const int actionId) |
void | logic () |
void | clearRows () |
void | mousePressed (MouseEvent &event) |
int | isCloseState () const |
void | setSkin (const std::string &skin) |
void | addCraftItem (Item *const item, const int amount, const int slot) |
NpcInputStateT | getInputState () |
void | copyToClipboard (const int x, const int y) const |
Public Member Functions inherited from Window | |
Window (const std::string &caption, const Modal modal, Window *const parent, std::string skin) | |
~Window () | |
void | draw (Graphics *const graphics) |
void | safeDraw (Graphics *const graphics) |
void | setContentSize (int width, int height) |
void | setLocationRelativeTo (const Widget *const widget) |
void | setLocationHorisontallyRelativeTo (const Widget *const widget) |
void | setLocationRelativeTo (const ImagePosition::Type &position, int offsetX, int offsetY) |
void | setResizable (const bool resize) |
void | redraw () |
void | widgetResized (const Event &event) |
void | widgetMoved (const Event &event) |
void | widgetHidden (const Event &event) |
void | setCloseButton (const bool flag) |
bool | getCloseButton () const |
void | setAllowClose (const bool b) |
bool | getAlowClose () const |
bool | isResizable () const |
void | setMinWidth (const int width) |
int | getMinWidth () const |
void | setMinHeight (const int height) |
int | getMinHeight () const |
void | setMaxWidth (const int width) |
int | getMaxWidth () const |
void | setMaxHeight (const int height) |
int | getMaxHeight () const |
void | setShowTitle (bool flag) |
void | setStickyButton (const bool flag) |
void | setSticky (const bool sticky) |
bool | isSticky () const |
void | setStickyButtonLock (const bool sticky) |
bool | isStickyButtonLock () const |
void | setVisible (const Visible visible, const bool forceSticky) |
bool | isDefaultVisible () const |
void | setDefaultVisible (const bool save) |
bool | willSaveVisible () const |
void | setSaveVisible (const bool save) |
Window * | getParentWindow () const |
virtual void | scheduleDelete () |
void | mouseDragged (MouseEvent &event) |
void | mouseMoved (MouseEvent &event) |
void | mouseReleased (MouseEvent &event) |
void | mouseExited (MouseEvent &event) |
void | mouseEntered (MouseEvent &event) |
void | updateResizeHandler (MouseEvent &event) |
void | setWindowName (const std::string &name) |
const std::string & | getWindowName () const |
void | loadWindowState () |
void | saveWindowState () |
void | setDefaultSize (const int defaultX, const int defaultY, int defaultWidth, int defaultHeight) |
void | setDefaultSize () |
void | setDefaultSize (const int defaultWidth, const int defaultHeight, const ImagePosition::Type &position, const int offsetx, const int offsetY) |
virtual void | resetToDefaultSize () |
void | adjustPositionAfterResize (const int oldScreenWidth, const int oldScreenHeight) |
Layout & | getLayout () |
void | clearLayout () |
void | reflowLayout (int w, int h) |
LayoutCell & | place (const int x, const int y, Widget *const wg, const int w, const int h) |
ContainerPlacer | getPlacer (const int x, const int y) |
void | center () |
void | centerHorisontally () |
virtual void | close () |
void | setModal (const Modal modal) |
Rect | getWindowArea () const |
bool | isResizeAllowed (const MouseEvent &event) const |
void | setCaptionFont (Font *font) |
void | enableVisibleSound (bool b) |
bool | isWindowVisible () const |
void | setPadding (int padding) |
int | getPadding () const |
void | setTitleBarHeight (unsigned int height) |
unsigned int | getTitleBarHeight () const |
void | setCaption (const std::string &caption) |
const std::string & | getCaption () const |
void | setAlignment (Graphics::Alignment alignment) |
Graphics::Alignment | getAlignment () const |
void | setMovable (Move movable) |
bool | isMovable () const |
Rect | getChildrenArea () |
virtual void | resizeToContent () |
Public Member Functions inherited from BasicContainer2 | |
BasicContainer2 (const Widget2 *const widget) | |
~BasicContainer2 () | |
void | setOpaque (Opaque opaque) |
bool | isOpaque () const |
virtual void | add (Widget *const widget) |
void | addXY (Widget *const widget, const int x, const int y) |
Public Member Functions inherited from BasicContainer | |
BasicContainer (const Widget2 *const widget) | |
~BasicContainer () | |
void | showWidgetPart (Widget *const widget, const Rect &area) |
void | moveToTop (Widget *const widget) |
void | moveToBottom (Widget *const widget) |
void | focusNext () |
void | focusPrevious () |
void | setFocusHandler (FocusHandler *const focusHandler) |
void | setInternalFocusHandler (FocusHandler *const focusHandler) |
Widget * | getWidgetAt (int x, int y) |
void | death (const Event &event) |
Widget * | findFirstWidget (const std::set< Widget * > &list) |
void | add (Widget *const widget) |
virtual void | remove (Widget *const widget) |
virtual void | clear () |
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 |
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 () |
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 |
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 FocusHandler * | getInternalFocusHandler () |
void | setInternalFocusHandler (FocusHandler *const internalFocusHandler) |
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 () |
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 WidgetDeathListener | |
virtual | ~WidgetDeathListener () |
Public Member Functions inherited from MouseListener | |
virtual | ~MouseListener () |
virtual void | mouseClicked (MouseEvent &event) |
virtual void | mouseWheelMovedUp (MouseEvent &event) |
virtual void | mouseWheelMovedDown (MouseEvent &event) |
Public Member Functions inherited from WidgetListener | |
virtual | ~WidgetListener () |
virtual void | widgetShown (const Event &event) |
Public Member Functions inherited from ActionListener | |
virtual | ~ActionListener () |
Public Member Functions inherited from ExtendedListModel | |
ExtendedListModel () | |
Public Member Functions inherited from ListModel | |
ListModel () | |
virtual | ~ListModel () |
Public Member Functions inherited from ConfigListener | |
ConfigListener () | |
virtual | ~ConfigListener () |
Static Public Member Functions | |
static bool | isAnyInputFocused () |
static bool | isActive () |
static NpcDialog * | getActive () |
static void | closeAll () |
static void | destroyAll () |
static void | clearDialogs () |
Static Public Member Functions inherited from Window | |
static void | setWindowContainer (WindowContainer *const windowContainer) |
Static Public Member Functions inherited from Widget | |
static void | setGlobalFont (Font *const font) |
static Font * | getGloablFont () |
static void | cleanGlobalFont () |
static bool | widgetExists (const Widget *const widget) |
static void | distributeWindowResizeEvent () |
static Widget * | callPostInit (Widget *const widget) |
Static Public Attributes | |
static NpcDialogs | mNpcDialogs |
Private Types | |
typedef std::list< NpcDialog * > | DialogList |
Private Member Functions | |
void | buildLayout () |
void | placeNormalControls () |
void | placeMenuControls () |
void | placeSkinControls () |
void | placeTextInputControls () |
void | placeIntInputControls () |
void | placeItemInputControls () |
void | createSkinControls () |
void | deleteSkinControls () |
Static Private Member Functions | |
static void | restoreVirtuals () |
static std::string | complexItemToStr (const ComplexItem *const item) |
Private Attributes | |
BeingId | mNpcId |
int | mDefaultInt |
std::string | mDefaultString |
BrowserBox * | mTextBox |
ScrollArea * | mScrollArea |
std::string | mText |
std::string | mNewText |
StringVect | mItems |
std::vector< Image * > | mImages |
ExtendedListBox * | mItemList |
ScrollArea * | mListScrollArea |
Container * | mSkinContainer |
ScrollArea * | mSkinScrollArea |
ItemLinkHandler * | mItemLinkHandler |
TextField * | mTextField |
IntTextField * | mIntField |
Button * | mPlusButton |
Button * | mMinusButton |
Button * | mClearButton |
Button * | mButton |
Button * | mButton2 |
Button * | mButton3 |
Button * | mResetButton |
Inventory * | mInventory |
ComplexInventory * | mComplexInventory |
ItemContainer * | mItemContainer |
ScrollArea * | mItemScrollArea |
NpcInputStateT | mInputState |
NpcActionStateT | mActionState |
std::vector< Widget * > | mSkinControls |
std::string | mSkinName |
PlayerBox * | mPlayerBox |
Being * | mAvatarBeing |
const NpcDialogInfo * | mDialogInfo |
int | mLastNextTime |
int | mCameraMode |
int | mCameraX |
int | mCameraY |
bool | mShowAvatar |
bool | mLogInteraction |
Static Private Attributes | |
static DialogList | instances |
Additional Inherited Members | |
Data Fields inherited from Widget | |
Visible | mVisible |
Protected Types inherited from BasicContainer | |
typedef std::vector< Widget * > | WidgetList |
typedef WidgetList::iterator | WidgetListIterator |
typedef WidgetList::const_iterator | WidgetListConstIterator |
typedef WidgetList::reverse_iterator | WidgetListReverseIterator |
typedef WidgetList::const_reverse_iterator | WidgetListCReverseIterator |
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 Window | |
bool | canMove () const |
int | getOption (const std::string &name, const int def) const |
bool | getOptionBool (const std::string &name, const bool def) const |
void | setTitlePadding (const int p) |
int | getTitlePadding () const |
Protected Member Functions inherited from BasicContainer | |
virtual void | drawChildren (Graphics *const graphics) |
virtual void | safeDrawChildren (Graphics *const graphics) |
virtual void | logicChildren () |
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 WidgetDeathListener | |
WidgetDeathListener () | |
Protected Member Functions inherited from MouseListener | |
MouseListener () | |
Protected Member Functions inherited from WidgetListener | |
WidgetListener () | |
Protected Member Functions inherited from ActionListener | |
ActionListener () | |
Protected Attributes inherited from Window | |
std::string | mCaption |
Graphics::Alignment | mAlignment |
int | mPadding |
unsigned int | mTitleBarHeight |
Move | mMovable |
int | mDragOffsetX |
int | mDragOffsetY |
bool | mMoved |
Skin * | mSkin |
int | mDefaultX |
int | mDefaultY |
int | mDefaultWidth |
int | mDefaultHeight |
int | mCaptionOffsetX |
int | mCaptionOffsetY |
bool | mShowTitle |
bool | mLastRedraw |
Protected Attributes inherited from BasicContainer2 | |
Opaque | mOpaque |
Protected Attributes inherited from BasicContainer | |
WidgetList | mWidgets |
WidgetList | mLogicWidgets |
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 |
FocusHandler * | mFocusHandler |
FocusHandler * | mInternalFocusHandler |
Widget * | mParent |
Font * | mCurrentFont |
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 |
Widget * | mWindow |
Color | mForegroundColor2 |
Static Protected Attributes inherited from Widget | |
static Font * | mGlobalFont = 0 |
The npc dialog.
Definition at line 65 of file npcdialog.h.
|
private |
Definition at line 247 of file npcdialog.h.
|
explicit |
Constructor.
Definition at line 98 of file npcdialog.cpp.
References Widget::addActionListener(), buildLayout(), CAPTION_CLOSE, CAPTION_NEXT, CAPTION_SUBMIT, CAPTION_WAITING, Window::center(), config, Widget::getFont(), Font::getHeight(), Configuration::getIntValue(), Gui::getNpcFont(), Font::getWidth(), gui, instances, Window::loadWindowState(), ImagePosition::LOWER_LEFT, mButton, mIntField, mItemLinkHandler, mItemList, mItemScrollArea, mListScrollArea, mPlayerBox, mScrollArea, mSkinScrollArea, mTextBox, mTextField, Opaque_false, Widget::setActionEventId(), Window::setContentSize(), Window::setDefaultSize(), ListBox::setDistributeMousePressed(), BrowserBox::setEnableImages(), BrowserBox::setEnableKeys(), BrowserBox::setEnableTabs(), Widget::setFocusable(), Widget::setFont(), Widget::setHeight(), ScrollArea::setHorizontalScrollPolicy(), BrowserBox::setLinkHandler(), BrowserBox::setMaxRow(), Window::setMinHeight(), Window::setMinWidth(), BrowserBox::setOpaque(), BrowserBox::setProcessVars(), Window::setResizable(), ListBox::setRowHeight(), ScrollArea::setScrollPolicy(), Window::setStickyButtonLock(), ScrollArea::setVerticalScrollPolicy(), Widget::setVisible(), Widget::setWidth(), Window::setWindowName(), ListBox::setWrappingEnabled(), ScrollArea::SHOW_ALWAYS, ScrollArea::SHOW_NEVER, and Visible_true.
NpcDialog::~NpcDialog | ( | ) |
Definition at line 246 of file npcdialog.cpp.
References CHECKLISTENERS, Window::clearLayout(), config, delete2, deleteSkinControls(), FOR_EACH, PlayerBox::getBeing(), instances, mButton, mButton2, mButton3, mClearButton, mComplexInventory, mImages, mIntField, mInventory, mItemContainer, mItemLinkHandler, mItemList, mItemScrollArea, mListScrollArea, mMinusButton, mPlayerBox, mPlusButton, mResetButton, mScrollArea, mSkinScrollArea, mTextBox, mTextField, and Configuration::removeListeners().
|
virtual |
Called when receiving actions from the widgets.
Implements ActionListener.
Definition at line 319 of file npcdialog.cpp.
References addText(), ComplexInventory::addVirtualItem(), Inventory::addVirtualItem(), CAST_S32, CAST_U8, Inventory::clear(), BrowserBox::clearRows(), clearRows(), NpcActionState::CLOSE, closeDialog(), complexItemToStr(), cutInWindow, FOR_EACH, Item::getColor(), Item::getId(), PlayerInfo::getInventory(), Inventory::getItem(), ListBox::getSelected(), InventoryWindow::getSelectedItem(), Inventory::getSize(), Item::getTag(), TextField::getText(), IntTextField::getValue(), gui, CutInWindow::hide(), NpcActionState::INPUT, NpcInputState::INTEGER, Net::NpcHandler::integerInput(), inventoryWindow, NpcInputState::ITEM, NpcInputState::ITEM_CRAFT, NpcInputState::ITEM_INDEX, PacketLimiter::limitPackets(), NpcInputState::LIST, Net::NpcHandler::listInput(), mActionState, mComplexInventory, mDefaultInt, mDefaultString, mDialogInfo, mInputState, mIntField, mInventory, mItemList, mItems, mLogInteraction, mNewText, mNpcId, mTextBox, mTextField, NpcActionState::NEXT, nextDialog(), NpcInputState::NONE, npcHandler, PacketType::PACKET_NPC_INPUT, PacketType::PACKET_NPC_NEXT, Gui::resetClickCount(), restoreVirtuals(), TextField::setText(), IntTextField::setValue(), NpcInputState::STRING, Net::NpcHandler::stringInput(), strprintf(), toInt, Inventory::virtualRemove(), and NpcActionState::WAIT.
void NpcDialog::addChoice | ( | const std::string & | choice | ) |
void NpcDialog::addCraftItem | ( | Item *const | item, |
const int | amount, | ||
const int | slot | ||
) |
Definition at line 1382 of file npcdialog.cpp.
References ComplexInventory::addVirtualItem(), PlayerInfo::getInventory(), NpcInputState::ITEM_CRAFT, mComplexInventory, mInputState, and Inventory::virtualRemove().
Referenced by ItemAmountWindow::finish(), and InventoryWindow::moveItemToCraft().
void NpcDialog::addText | ( | const std::string & | string, |
const bool | save | ||
) |
Sets the text shows in the dialog.
string | The new text. Adds the text to the text shows in the dialog. Also adds a newline to the end. |
string | The text to add. |
Definition at line 291 of file npcdialog.cpp.
References BrowserBox::addRow(), buildLayout(), ScrollArea::getVerticalMaxScroll(), mActionState, mLogInteraction, mNewText, mScrollArea, mText, mTextBox, ScrollArea::setVerticalScrollAmount(), and NpcActionState::WAIT.
Referenced by action(), and Ea::NpcRecv::processNpcMessage().
|
private |
Definition at line 1052 of file npcdialog.cpp.
References CAPTION_CLOSE, CAPTION_NEXT, CAPTION_SUBMIT, CAPTION_WAITING, Window::clearLayout(), NpcActionState::CLOSE, Window::getLayout(), ScrollArea::getVerticalMaxScroll(), NpcActionState::INPUT, NpcInputState::INTEGER, NpcInputState::ITEM, NpcInputState::ITEM_CRAFT, NpcInputState::ITEM_INDEX, NpcInputState::LIST, mActionState, mButton, mDialogInfo, mInputState, mItemList, mScrollArea, NpcActionState::NEXT, NpcInputState::NONE, placeIntInputControls(), placeItemInputControls(), placeMenuControls(), placeNormalControls(), placeSkinControls(), placeTextInputControls(), Window::redraw(), LayoutType::SET, Button::setCaption(), LayoutCell::setRowHeight(), ListBox::setSelected(), ScrollArea::setVerticalScrollAmount(), NpcInputState::STRING, and NpcActionState::WAIT.
Referenced by addText(), choiceRequest(), integerRequest(), itemCraftRequest(), itemIndexRequest(), itemRequest(), logic(), NpcDialog(), showAvatar(), showCloseButton(), showNextButton(), and textRequest().
void NpcDialog::choiceRequest | ( | ) |
Makes this dialog request a choice selection from the user.
Definition at line 686 of file npcdialog.cpp.
References buildLayout(), FOR_EACH, NpcActionState::INPUT, NpcInputState::LIST, mActionState, mImages, mInputState, and mItems.
Referenced by Ea::NpcRecv::processNpcChoice().
|
static |
Definition at line 1217 of file npcdialog.cpp.
References mNpcDialogs.
Referenced by PlayerPostDeathListener::action(), and DialogsManager::closeDialogs().
void NpcDialog::clearRows | ( | ) |
Definition at line 1212 of file npcdialog.cpp.
References BrowserBox::clearRows(), and mTextBox.
Referenced by action(), and Ea::NpcRecv::processNpcCommand().
|
static |
Closes all instances.
Definition at line 866 of file npcdialog.cpp.
References FOR_EACH, and instances.
Referenced by DialogsManager::closeDialogs().
void NpcDialog::closeDialog | ( | ) |
Notifies the server that the client has performed a close action.
Definition at line 665 of file npcdialog.cpp.
References Net::NpcHandler::closeDialog(), mNpcId, npcHandler, and restoreCamera().
Referenced by action(), and Actions::closeMoveNpcDialog().
|
staticprivate |
Definition at line 1351 of file npcdialog.cpp.
References ComplexItem::getChilds(), Item::getInvIndex(), Item::getQuantity(), and strprintf().
Referenced by action().
void NpcDialog::copyToClipboard | ( | const int | x, |
const int | y | ||
) | const |
Definition at line 1245 of file npcdialog.cpp.
References BrowserBox::getTextAtPos(), mTextBox, sendBuffer(), x, and y.
|
private |
Definition at line 1275 of file npcdialog.cpp.
References BasicContainer2::add(), Widget::addActionListener(), BrowserBox::addRow(), Button::adjustSize(), AutoRelease_true, BUTTON_SKIN, NpcDialogMenuInfo::buttons, config, deleteSkinControls(), FOR_EACH, Theme::getImageFromTheme(), Configuration::getIntValue(), Gui::getNpcFont(), gui, NpcDialogMenuInfo::images, Actions::info(), Button::loadImageSet(), mDialogInfo, NpcDialogInfo::menu, mItemLinkHandler, mSkinContainer, Opaque_false, Opaque_true, Widget::setActionEventId(), Button::setCaption(), BrowserBox::setEnableKeys(), BrowserBox::setEnableTabs(), Widget::setFont(), Widget::setHeight(), Button::setImageHeight(), Button::setImageWidth(), BrowserBox::setLinkHandler(), BrowserBox::setMaxRow(), BrowserBox::setOpaque(), Widget::setPosition(), BrowserBox::setProcessVars(), Widget::setWidth(), splitToStringVector(), and NpcDialogMenuInfo::texts.
Referenced by placeSkinControls().
|
private |
Definition at line 1270 of file npcdialog.cpp.
References mSkinContainer, and Container::removeControls().
Referenced by createSkinControls(), and ~NpcDialog().
|
static |
Closes all instances and destroy also net handler dialogs.
|
static |
Returns the first active instance. Useful for pushing user interaction.
Definition at line 852 of file npcdialog.cpp.
References FOR_EACH, and instances.
Referenced by Actions::closeMoveNpcDialog(), Game::handleMove(), and InputManager::updateConditionMask().
|
virtual |
Returns the name of item number i of the choices list.
Implements ListModel.
Definition at line 676 of file npcdialog.cpp.
References mItems.
|
virtual |
Returns the image of item number i of the choices list.
Implements ExtendedListModel.
Definition at line 681 of file npcdialog.cpp.
References mImages.
|
inline |
Definition at line 237 of file npcdialog.h.
References mInputState.
Referenced by InventoryWindow::moveItemToCraft(), and PopupMenu::showPopup().
|
virtual |
void NpcDialog::integerRequest | ( | const int | defaultValue, |
const int | min, | ||
const int | max | ||
) |
Requests a interger from the user.
Definition at line 779 of file npcdialog.cpp.
References buildLayout(), NpcActionState::INPUT, NpcInputState::INTEGER, mActionState, mDefaultInt, mInputState, mIntField, IntTextField::setRange(), and IntTextField::setValue().
Referenced by Ea::NpcRecv::processNpcIntInput().
|
inlinestatic |
Returns true if any instances exist.
Definition at line 191 of file npcdialog.h.
References instances.
Referenced by PlayerInfo::isTalking().
|
static |
Definition at line 768 of file npcdialog.cpp.
References FOR_EACH, and instances.
Referenced by InputManager::updateConditionMask().
|
inline |
Definition at line 228 of file npcdialog.h.
References NpcActionState::CLOSE, and mActionState.
Referenced by Actions::closeMoveNpcDialog().
bool NpcDialog::isInputFocused | ( | ) | const |
Definition at line 762 of file npcdialog.cpp.
References Widget::isFocused(), mIntField, mItemList, and mTextField.
bool NpcDialog::isTextInputFocused | ( | ) | const |
Definition at line 757 of file npcdialog.cpp.
References Widget::isFocused(), and mTextField.
void NpcDialog::itemCraftRequest | ( | const int | size | ) |
Definition at line 807 of file npcdialog.cpp.
References buildLayout(), NpcActionState::INPUT, NpcInputState::ITEM_CRAFT, mActionState, mComplexInventory, mInputState, Inventory::resize(), and EmoteDB::size().
Referenced by Ea::NpcRecv::processNpcCommand().
void NpcDialog::itemIndexRequest | ( | const int | size | ) |
Definition at line 799 of file npcdialog.cpp.
References buildLayout(), NpcActionState::INPUT, NpcInputState::ITEM_INDEX, mActionState, mInputState, mInventory, Inventory::resize(), and EmoteDB::size().
Referenced by Ea::NpcRecv::processNpcCommand().
void NpcDialog::itemRequest | ( | const int | size | ) |
Definition at line 791 of file npcdialog.cpp.
References buildLayout(), NpcActionState::INPUT, NpcInputState::ITEM, mActionState, mInputState, mInventory, Inventory::resize(), and EmoteDB::size().
Referenced by Ea::NpcRecv::processNpcCommand().
|
virtual |
Called for all widgets in the gui each time Gui::logic is called. You can do logic stuff here like playing an animation.
Reimplemented from BasicContainer.
Definition at line 1191 of file npcdialog.cpp.
References BLOCK_END, BLOCK_START, buildLayout(), CAST_S32, Sprite::getHeight(), Window::getPadding(), Widget::getWidth(), Sprite::getWidth(), Being::logic(), BasicContainer::logic(), mAvatarBeing, mPlayerBox, mShowAvatar, CompoundSprite::mSprites, Widget::setHeight(), and Widget::setWidth().
|
virtual |
Starts window resizing when appropriate.
Reimplemented from Window.
Definition at line 1229 of file npcdialog.cpp.
References MouseEvent::getButton(), Event::getSource(), Viewport::mMouseX, Viewport::mMouseY, mNpcId, Window::mousePressed(), mTextBox, popupMenu, MouseButton::RIGHT, PopupMenu::showNpcDialogPopup(), and viewport.
void NpcDialog::move | ( | const int | amount | ) |
Definition at line 815 of file npcdialog.cpp.
References ListBox::getSelected(), IntTextField::getValue(), NpcActionState::INPUT, NpcInputState::INTEGER, NpcInputState::ITEM, NpcInputState::ITEM_CRAFT, NpcInputState::ITEM_INDEX, NpcInputState::LIST, mActionState, mInputState, mIntField, mItemList, NpcInputState::NONE, ListBox::setSelected(), IntTextField::setValue(), and NpcInputState::STRING.
void NpcDialog::nextDialog | ( | ) |
Notifies the server that client has performed a next action.
Definition at line 660 of file npcdialog.cpp.
References mNpcId, Net::NpcHandler::nextDialog(), and npcHandler.
Referenced by action().
|
virtual |
Called when an option changed. The config listener will have to be registered to the option name first.
Implements ConfigListener.
Definition at line 846 of file npcdialog.cpp.
References config, Configuration::getBoolValue(), and mLogInteraction.
void NpcDialog::parseListItems | ( | const std::string & | itemString | ) |
Fills the options list for an NPC dialog.
itemString | A string with the options separated with colons. |
Definition at line 706 of file npcdialog.cpp.
References Loader::getImage(), Configuration::getStringValue(), mImages, mItemList, mItems, pathJoin(), paths, Widget::requestFocus(), and ListBox::setSelected().
Referenced by Ea::NpcRecv::processNpcChoice().
|
private |
Definition at line 969 of file npcdialog.cpp.
References mButton, mClearButton, mIntField, mMinusButton, mPlayerBox, mPlusButton, mResetButton, mScrollArea, mShowAvatar, and Window::place().
Referenced by buildLayout().
|
private |
Definition at line 994 of file npcdialog.cpp.
References NpcInventoryInfo::cell, NpcInventoryInfo::columns, NpcDialogInfo::hideText, NpcDialogInfo::inventory, NpcInputState::ITEM_CRAFT, mButton, mButton3, mClearButton, mComplexInventory, mDialogInfo, mInputState, mInventory, mItemContainer, mItemScrollArea, mPlayerBox, mScrollArea, mShowAvatar, Window::place(), ItemContainer::setCellBackgroundImage(), ItemContainer::setInventory(), and ItemContainer::setMaxColumns().
Referenced by buildLayout().
|
private |
Definition at line 892 of file npcdialog.cpp.
References mButton, mButton2, mClearButton, mListScrollArea, mPlayerBox, mScrollArea, mShowAvatar, and Window::place().
Referenced by buildLayout().
|
private |
Definition at line 875 of file npcdialog.cpp.
References mButton, mClearButton, mPlayerBox, mScrollArea, mShowAvatar, and Window::place().
Referenced by buildLayout().
|
private |
Definition at line 913 of file npcdialog.cpp.
References createSkinControls(), NpcDialogInfo::hideText, mButton2, mDialogInfo, mPlayerBox, mScrollArea, mShowAvatar, mSkinScrollArea, and Window::place().
Referenced by buildLayout().
|
private |
Definition at line 948 of file npcdialog.cpp.
References mButton, mClearButton, mPlayerBox, mResetButton, mScrollArea, mShowAvatar, mTextField, and Window::place().
Referenced by buildLayout().
|
virtual |
Reimplemented from Window.
Definition at line 224 of file npcdialog.cpp.
References actorManager, Configuration::addListener(), config, Window::enableVisibleSound(), ActorManager::findBeing(), fromInt, NPCDB::getAvatarFor(), Being::getName(), Being::getSubType(), mNpcId, SoundManager::playGuiSound(), Window::postInit(), Widget::requestFocus(), Window::setCaption(), setVisible(), showAvatar(), SOUND_SHOW_WINDOW, soundManager, and Visible_true.
void NpcDialog::refocus | ( | ) |
Definition at line 741 of file npcdialog.cpp.
References mItemList, mItems, and ListBox::refocus().
Referenced by Actions::closeMoveNpcDialog().
void NpcDialog::restoreCamera | ( | ) |
Definition at line 1115 of file npcdialog.cpp.
References Settings::cameraMode, CAST_S32, mCameraMode, mCameraX, mCameraY, Viewport::setCameraRelativeX(), Viewport::setCameraRelativeY(), settings, Viewport::toggleCameraMode(), and viewport.
Referenced by closeDialog(), EAthena::NpcHandler::getNpc(), TmwAthena::NpcHandler::getNpc(), and Ea::NpcRecv::processNpcCommand().
|
staticprivate |
Definition at line 1344 of file npcdialog.cpp.
References PlayerInfo::getInventory(), and Inventory::restoreVirtuals().
Referenced by action().
void NpcDialog::saveCamera | ( | ) |
Definition at line 1105 of file npcdialog.cpp.
References Settings::cameraMode, CAST_S32, Viewport::getCameraRelativeX(), Viewport::getCameraRelativeY(), mCameraMode, mCameraX, mCameraY, settings, and viewport.
Referenced by EAthena::NpcHandler::getNpc(), and TmwAthena::NpcHandler::getNpc().
void NpcDialog::setAvatarAction | ( | const int | actionId | ) |
Definition at line 1184 of file npcdialog.cpp.
References PlayerBox::getBeing(), mPlayerBox, and Being::setAction().
Referenced by Ea::NpcRecv::processNpcCommand().
void NpcDialog::setAvatarDirection | ( | const uint8_t | direction | ) |
Definition at line 1177 of file npcdialog.cpp.
References PlayerBox::getBeing(), mPlayerBox, and Being::setDirection().
Referenced by Ea::NpcRecv::processNpcCommand().
void NpcDialog::setSkin | ( | const std::string & | skin | ) |
Definition at line 1251 of file npcdialog.cpp.
References NpcDialogDB::getDialog(), Logger::log(), logger, mDialogInfo, and mSkinName.
Referenced by EAthena::NpcRecv::processNpcSkin().
|
virtual |
Overloads window setVisible by Guichan to allow sticky window handling.
Reimplemented from Window.
Definition at line 838 of file npcdialog.cpp.
References Window::scheduleDelete(), Window::setVisible(), and Visible_false.
Referenced by postInit().
void NpcDialog::showAvatar | ( | const BeingTypeId | avatarId | ) |
Definition at line 1130 of file npcdialog.cpp.
References ActorType::Avatar, BeingId_zero, BeingTypeId_zero, buildLayout(), Being::createBeing(), delete2, AvatarDB::get(), Sprite::getHeight(), Sprite::getWidth(), Actions::info(), Being::logic(), mAvatarBeing, Window::mPadding, mPlayerBox, mShowAvatar, CompoundSprite::mSprites, Widget::setHeight(), PlayerBox::setPlayer(), and Widget::setWidth().
Referenced by postInit(), and Ea::NpcRecv::processNpcCommand().
void NpcDialog::showCloseButton | ( | ) |
When called, the widget will show a "Close" button and will close the dialog when clicked.
Definition at line 313 of file npcdialog.cpp.
References buildLayout(), NpcActionState::CLOSE, and mActionState.
Referenced by Ea::NpcRecv::processNpcClose().
void NpcDialog::showNextButton | ( | ) |
When called, the widget will show a "Next" button.
Definition at line 307 of file npcdialog.cpp.
References buildLayout(), mActionState, and NpcActionState::NEXT.
Referenced by Ea::NpcRecv::processNpcNext().
void NpcDialog::textRequest | ( | const std::string & | defaultText | ) |
Requests a text string from the user.
Definition at line 747 of file npcdialog.cpp.
References buildLayout(), NpcActionState::INPUT, mActionState, mDefaultString, mInputState, mTextField, TextField::setText(), and NpcInputState::STRING.
Referenced by Ea::NpcRecv::processNpcStrInput().
|
staticprivate |
Definition at line 248 of file npcdialog.h.
Referenced by closeAll(), getActive(), isActive(), isAnyInputFocused(), NpcDialog(), and ~NpcDialog().
|
private |
Definition at line 313 of file npcdialog.h.
Referenced by action(), addText(), buildLayout(), choiceRequest(), integerRequest(), isCloseState(), itemCraftRequest(), itemIndexRequest(), itemRequest(), move(), showCloseButton(), showNextButton(), and textRequest().
|
private |
Definition at line 317 of file npcdialog.h.
Referenced by logic(), and showAvatar().
|
private |
Definition at line 300 of file npcdialog.h.
Referenced by buildLayout(), NpcDialog(), placeIntInputControls(), placeItemInputControls(), placeMenuControls(), placeNormalControls(), placeTextInputControls(), and ~NpcDialog().
|
private |
Definition at line 301 of file npcdialog.h.
Referenced by placeMenuControls(), placeSkinControls(), and ~NpcDialog().
|
private |
Definition at line 302 of file npcdialog.h.
Referenced by placeItemInputControls(), and ~NpcDialog().
|
private |
Definition at line 320 of file npcdialog.h.
Referenced by restoreCamera(), and saveCamera().
|
private |
Definition at line 321 of file npcdialog.h.
Referenced by restoreCamera(), and saveCamera().
|
private |
Definition at line 322 of file npcdialog.h.
Referenced by restoreCamera(), and saveCamera().
|
private |
Definition at line 297 of file npcdialog.h.
Referenced by placeIntInputControls(), placeItemInputControls(), placeMenuControls(), placeNormalControls(), placeTextInputControls(), and ~NpcDialog().
|
private |
Definition at line 308 of file npcdialog.h.
Referenced by action(), addCraftItem(), itemCraftRequest(), placeItemInputControls(), and ~NpcDialog().
|
private |
Definition at line 274 of file npcdialog.h.
Referenced by action(), and integerRequest().
|
private |
Definition at line 275 of file npcdialog.h.
Referenced by action(), and textRequest().
|
private |
Definition at line 318 of file npcdialog.h.
Referenced by action(), buildLayout(), createSkinControls(), placeItemInputControls(), placeSkinControls(), and setSkin().
|
private |
Definition at line 285 of file npcdialog.h.
Referenced by addChoice(), choiceRequest(), getImageAt(), parseListItems(), and ~NpcDialog().
|
private |
Definition at line 312 of file npcdialog.h.
Referenced by action(), addCraftItem(), buildLayout(), choiceRequest(), getInputState(), integerRequest(), itemCraftRequest(), itemIndexRequest(), itemRequest(), move(), placeItemInputControls(), and textRequest().
|
private |
Definition at line 294 of file npcdialog.h.
Referenced by action(), integerRequest(), isInputFocused(), move(), NpcDialog(), placeIntInputControls(), and ~NpcDialog().
|
private |
Definition at line 307 of file npcdialog.h.
Referenced by action(), itemIndexRequest(), itemRequest(), placeItemInputControls(), and ~NpcDialog().
|
private |
Definition at line 309 of file npcdialog.h.
Referenced by placeItemInputControls(), and ~NpcDialog().
|
private |
Definition at line 290 of file npcdialog.h.
Referenced by createSkinControls(), NpcDialog(), and ~NpcDialog().
|
private |
Definition at line 286 of file npcdialog.h.
Referenced by action(), buildLayout(), isInputFocused(), move(), NpcDialog(), parseListItems(), refocus(), and ~NpcDialog().
|
private |
Definition at line 284 of file npcdialog.h.
Referenced by action(), addChoice(), choiceRequest(), getElementAt(), getNumberOfElements(), parseListItems(), and refocus().
|
private |
Definition at line 310 of file npcdialog.h.
Referenced by NpcDialog(), placeItemInputControls(), and ~NpcDialog().
|
private |
Definition at line 319 of file npcdialog.h.
|
private |
Definition at line 287 of file npcdialog.h.
Referenced by NpcDialog(), placeMenuControls(), and ~NpcDialog().
|
private |
Definition at line 324 of file npcdialog.h.
Referenced by action(), addText(), and optionChanged().
|
private |
Definition at line 296 of file npcdialog.h.
Referenced by placeIntInputControls(), and ~NpcDialog().
|
private |
Definition at line 281 of file npcdialog.h.
|
static |
Definition at line 242 of file npcdialog.h.
Referenced by clearDialogs(), EAthena::NpcHandler::closeDialog(), TmwAthena::NpcHandler::closeDialog(), EAthena::NpcHandler::getNpc(), TmwAthena::NpcHandler::getNpc(), and Ea::NpcRecv::processNpcCommand().
|
private |
Definition at line 272 of file npcdialog.h.
Referenced by action(), closeDialog(), mousePressed(), nextDialog(), and postInit().
|
private |
Definition at line 316 of file npcdialog.h.
Referenced by logic(), NpcDialog(), placeIntInputControls(), placeItemInputControls(), placeMenuControls(), placeNormalControls(), placeSkinControls(), placeTextInputControls(), setAvatarAction(), setAvatarDirection(), showAvatar(), and ~NpcDialog().
|
private |
Definition at line 295 of file npcdialog.h.
Referenced by placeIntInputControls(), and ~NpcDialog().
|
private |
Definition at line 305 of file npcdialog.h.
Referenced by placeIntInputControls(), placeTextInputControls(), and ~NpcDialog().
|
private |
Definition at line 279 of file npcdialog.h.
Referenced by addText(), buildLayout(), NpcDialog(), placeIntInputControls(), placeItemInputControls(), placeMenuControls(), placeNormalControls(), placeSkinControls(), placeTextInputControls(), and ~NpcDialog().
|
private |
Definition at line 323 of file npcdialog.h.
Referenced by logic(), placeIntInputControls(), placeItemInputControls(), placeMenuControls(), placeNormalControls(), placeSkinControls(), placeTextInputControls(), and showAvatar().
|
private |
Definition at line 288 of file npcdialog.h.
Referenced by createSkinControls(), and deleteSkinControls().
|
private |
Definition at line 314 of file npcdialog.h.
|
private |
Definition at line 315 of file npcdialog.h.
Referenced by setSkin().
|
private |
Definition at line 289 of file npcdialog.h.
Referenced by NpcDialog(), placeSkinControls(), and ~NpcDialog().
|
private |
Definition at line 280 of file npcdialog.h.
Referenced by addText().
|
private |
Definition at line 278 of file npcdialog.h.
Referenced by action(), addText(), clearRows(), copyToClipboard(), mousePressed(), NpcDialog(), and ~NpcDialog().
|
private |
Definition at line 293 of file npcdialog.h.
Referenced by action(), isInputFocused(), isTextInputFocused(), NpcDialog(), placeTextInputControls(), textRequest(), and ~NpcDialog().