Mana
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members

The sell dialog. More...

#include <selldialog.h>

Inheritance diagram for SellDialog:
Window

Public Member Functions

 SellDialog (int npcId)
 
 ~SellDialog () override
 
void reset ()
 Resets the dialog, clearing inventory.
 
void addItem (const Item *item, int price)
 Adds an item to the inventory.
 
void action (const gcn::ActionEvent &event) override
 Called when receiving actions from the widgets.
 
void valueChanged (const gcn::SelectionEvent &event) override
 Updates labels according to selected item.
 
void mouseClicked (gcn::MouseEvent &mouseEvent) override
 Allows for quick-selling by extending double-click events.
 
void setMoney (int amount)
 Gives Player's Money amount.
 
void setVisible (bool visible) override
 Sets the visibility of this window.
 
- Public Member Functions inherited from Window
 Window (const std::string &caption="Window", bool modal=false, Window *parent=nullptr)
 Constructor.
 
 Window (SkinType skinType, const std::string &caption="Window", bool modal=false, Window *parent=nullptr)
 Constructor that allows customizing the SkinType used by the window.
 
 ~Window () override
 Destructor.
 
void draw (gcn::Graphics *graphics) override
 Draws the window contents.
 
void drawFrame (gcn::Graphics *graphics) override
 Draws the window frame.
 
void setContentSize (int width, int height)
 Sets the size of this window.
 
void setMinimumContentSize (int width, int height)
 Sets the minimum size of the window content.
 
void setLocationRelativeTo (gcn::Widget *widget)
 Sets the location relative to the given widget.
 
void setResizable (bool resize)
 Sets whether or not the window can be resized.
 
void redraw ()
 
void widgetResized (const gcn::Event &event) override
 Called whenever the widget changes size.
 
void widgetHidden (const gcn::Event &event) override
 Called whenever the widget is hidden.
 
void setCloseButton (bool flag)
 Sets whether or not the window has a close button.
 
bool isResizable () const
 Returns whether the window can be resized.
 
void setMinWidth (int width)
 Sets the minimum width of the window.
 
int getMinWidth () const
 
void setMinHeight (int height)
 Sets the minimum height of the window.
 
int getMinHeight () const
 
void setMaxWidth (int width)
 Sets the maximum width of the window.
 
int getMaxWidth () const
 
void setMaxHeight (int height)
 Sets the minimum height of the window.
 
int getMaxHeight () const
 
void setShowTitle (bool flag)
 Sets flag to show a title or not.
 
void setStickyButton (bool flag)
 Sets whether or not the window has a sticky button.
 
void setSticky (bool sticky)
 Sets whether the window is sticky.
 
bool isSticky () const
 Returns whether the window is sticky.
 
void setVisible (bool visible, bool forceSticky)
 Overloads window setVisible by Guichan to allow sticky window handling, or not, if you force the sticky state.
 
bool isDefaultVisible () const
 Returns whether the window is visible by default.
 
void setDefaultVisible (bool save)
 Sets whether the window is visible by default.
 
bool willSaveVisible () const
 Returns whether the window will save it's visibility.
 
void setSaveVisible (bool save)
 Sets whether the window will save it's visibility.
 
WindowgetParentWindow () const
 Returns the parent window.
 
void scheduleDelete ()
 Schedule this window for deletion.
 
void mousePressed (gcn::MouseEvent &event) override
 Starts window resizing when appropriate.
 
void mouseDragged (gcn::MouseEvent &event) override
 Implements window resizing and makes sure the window is not dragged/resized outside of the screen.
 
void mouseMoved (gcn::MouseEvent &event) override
 Implements custom cursor image changing context, based on mouse relative position.
 
void mouseReleased (gcn::MouseEvent &event) override
 When the mouse button has been let go, this ensures that the mouse custom cursor is restored back to it's standard image.
 
void mouseExited (gcn::MouseEvent &event) override
 When the mouse leaves the window this ensures that the custom cursor is restored back to it's standard image.
 
void setWindowName (const std::string &name)
 Sets the name of the window.
 
const std::string & getWindowName () const
 Returns the name of the window.
 
void loadWindowState ()
 Reads the position (and the size for resizable windows) in the configuration based on the given string.
 
void saveWindowState () const
 Saves the window state so that when the window is reloaded, it'll maintain its previous state and location.
 
void setDefaultSize (int defaultX, int defaultY, int defaultWidth, int defaultHeight)
 Set the default win pos and size.
 
void setDefaultSize ()
 Set the default win pos and size to the current ones.
 
void setDefaultSize (int defaultWidth, int defaultHeight, WindowAlignment alignment, int offsetx=0, int offsetY=0)
 Set the default win pos and size.
 
virtual void resetToDefaultSize ()
 Reset the win pos and size to default.
 
void adjustPositionAfterResize (int oldScreenWidth, int oldScreenHeight)
 Adjusts the window position after the application window has been resized.
 
LayoutgetLayout ()
 Gets the layout handler for this window.
 
void clearLayout ()
 Clears the window's layout (useful for redesigning the window).
 
void reflowLayout (int w=0, int h=0)
 Computes the position of the widgets according to the current layout.
 
LayoutCellplace (int x, int y, gcn::Widget *, int w=1, int h=1)
 Adds a widget to the window and sets it at given cell.
 
ContainerPlacer getPlacer (int x, int y)
 Returns a proxy for adding widgets in an inner table of the layout.
 
void center ()
 Positions the window in the center of it's parent.
 
virtual void close ()
 Overrideable functionality for when the window is to close.
 
const SkingetSkin () const
 Returns the Skin used by this window.
 

Static Public Member Functions

static void closeAll ()
 Closes all instances.
 
- Static Public Member Functions inherited from Window
static void setWindowContainer (WindowContainer *windowContainer)
 Sets the window container to be used by new windows.
 
static int getGuiAlpha ()
 Gets the alpha value used by the window, in a Guichan usable format.
 

Private Types

using DialogList = std::list< SellDialog * >
 

Private Member Functions

void updateButtonsAndLabels ()
 Updates the state of buttons and labels.
 

Private Attributes

int mNpcId
 
gcn::Button * mSellButton
 
gcn::Button * mQuitButton
 
gcn::Button * mAddMaxButton
 
gcn::Button * mIncreaseButton
 
gcn::Button * mDecreaseButton
 
ShopListBoxmShopItemList
 
gcn::ScrollArea * mScrollArea
 
gcn::Label * mMoneyLabel
 
gcn::Label * mQuantityLabel
 
gcn::Slider * mSlider
 
ShopItemsmShopItems
 
int mPlayerMoney = 0
 
int mMaxItems = 0
 
int mAmountItems = 0
 

Static Private Attributes

static DialogList instances
 

Additional Inherited Members

- Static Protected Attributes inherited from Window
static int mouseResize = 0
 Active resize handles.
 

Detailed Description

The sell dialog.

Definition at line 38 of file selldialog.h.

Member Typedef Documentation

◆ DialogList

using SellDialog::DialogList = std::list<SellDialog *>
private

Definition at line 88 of file selldialog.h.

Constructor & Destructor Documentation

◆ SellDialog()

SellDialog::SellDialog ( int  npcId)

Definition at line 49 of file selldialog.cpp.

◆ ~SellDialog()

SellDialog::~SellDialog ( )
override

Definition at line 119 of file selldialog.cpp.

Member Function Documentation

◆ action()

void SellDialog::action ( const gcn::ActionEvent &  event)
override

Called when receiving actions from the widgets.

Definition at line 151 of file selldialog.cpp.

◆ addItem()

void SellDialog::addItem ( const Item item,
int  price 
)

Adds an item to the inventory.

Definition at line 140 of file selldialog.cpp.

◆ closeAll()

void SellDialog::closeAll ( )
static

Closes all instances.

Definition at line 315 of file selldialog.cpp.

◆ mouseClicked()

void SellDialog::mouseClicked ( gcn::MouseEvent &  mouseEvent)
override

Allows for quick-selling by extending double-click events.

Definition at line 250 of file selldialog.cpp.

◆ reset()

void SellDialog::reset ( )

Resets the dialog, clearing inventory.

Definition at line 129 of file selldialog.cpp.

◆ setMoney()

void SellDialog::setMoney ( int  amount)

Gives Player's Money amount.

Definition at line 259 of file selldialog.cpp.

◆ setVisible()

void SellDialog::setVisible ( bool  visible)
overridevirtual

Sets the visibility of this window.

Reimplemented from Window.

Definition at line 301 of file selldialog.cpp.

◆ updateButtonsAndLabels()

void SellDialog::updateButtonsAndLabels ( )
private

Updates the state of buttons and labels.

Definition at line 267 of file selldialog.cpp.

◆ valueChanged()

void SellDialog::valueChanged ( const gcn::SelectionEvent &  event)
override

Updates labels according to selected item.

See also
SelectionListener::selectionChanged

Definition at line 240 of file selldialog.cpp.

Member Data Documentation

◆ instances

SellDialog::DialogList SellDialog::instances
staticprivate

Definition at line 89 of file selldialog.h.

◆ mAddMaxButton

gcn::Button* SellDialog::mAddMaxButton
private

Definition at line 100 of file selldialog.h.

◆ mAmountItems

int SellDialog::mAmountItems = 0
private

Definition at line 113 of file selldialog.h.

◆ mDecreaseButton

gcn::Button* SellDialog::mDecreaseButton
private

Definition at line 102 of file selldialog.h.

◆ mIncreaseButton

gcn::Button* SellDialog::mIncreaseButton
private

Definition at line 101 of file selldialog.h.

◆ mMaxItems

int SellDialog::mMaxItems = 0
private

Definition at line 112 of file selldialog.h.

◆ mMoneyLabel

gcn::Label* SellDialog::mMoneyLabel
private

Definition at line 105 of file selldialog.h.

◆ mNpcId

int SellDialog::mNpcId
private

Definition at line 96 of file selldialog.h.

◆ mPlayerMoney

int SellDialog::mPlayerMoney = 0
private

Definition at line 110 of file selldialog.h.

◆ mQuantityLabel

gcn::Label* SellDialog::mQuantityLabel
private

Definition at line 106 of file selldialog.h.

◆ mQuitButton

gcn::Button* SellDialog::mQuitButton
private

Definition at line 99 of file selldialog.h.

◆ mScrollArea

gcn::ScrollArea* SellDialog::mScrollArea
private

Definition at line 104 of file selldialog.h.

◆ mSellButton

gcn::Button* SellDialog::mSellButton
private

Definition at line 98 of file selldialog.h.

◆ mShopItemList

ShopListBox* SellDialog::mShopItemList
private

Definition at line 103 of file selldialog.h.

◆ mShopItems

ShopItems* SellDialog::mShopItems
private

Definition at line 109 of file selldialog.h.

◆ mSlider

gcn::Slider* SellDialog::mSlider
private

Definition at line 107 of file selldialog.h.


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