Public Member Functions | Private Attributes
Setup_Players Class Reference

#include <setup_players.h>

Inheritance diagram for Setup_Players:
SetupTabScroll SetupTab Container ActionListener WidgetListener BasicContainer2 BasicContainer Widget WidgetDeathListener Widget2

Public Member Functions

 Setup_Players (const Widget2 *const widget)
 ~Setup_Players ()
void apply ()
void externalUpdated ()
- Public Member Functions inherited from SetupTabScroll
 SetupTabScroll (const Widget2 *const widget)
 ~SetupTabScroll ()
void addControl (SetupItem *const widget)
void addControl (SetupItem *const widget, const std::string &event)
VertContainergetContainer () const
void apply ()
void cancel ()
void externalUpdated ()
void externalUnloaded ()
void action (const ActionEvent &event)
int getPreferredFirstItemSize () const
void widgetResized (const Event &event)
void reread (const std::string &name)
void clear ()
const std::set< SetupItem * > & getAllItems () const
- Public Member Functions inherited from SetupTab
const std::string & getName () const
- Public Member Functions inherited from Container
 Container (const Widget2 *const widget)
 ~Container ()
bool safeRemove (Widget *const widget)
void removeControls ()
- 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)
void draw (Graphics *const graphics)
void safeDraw (Graphics *const graphics)
- 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)
Rect getChildrenArea ()
void focusNext ()
void focusPrevious ()
void logic ()
void setFocusHandler (FocusHandler *const focusHandler)
void setInternalFocusHandler (FocusHandler *const focusHandler)
WidgetgetWidgetAt (int x, int y)
void death (const Event &event)
WidgetfindFirstWidget (const std::set< Widget * > &list)
void add (Widget *const widget)
virtual void remove (Widget *const widget)
- 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
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 ()
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
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 FocusHandlergetInternalFocusHandler ()
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 ()
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 WidgetDeathListener
virtual ~WidgetDeathListener ()
- Public Member Functions inherited from ActionListener
virtual ~ActionListener ()
- Public Member Functions inherited from WidgetListener
virtual ~WidgetListener ()
virtual void widgetMoved (const Event &event)
virtual void widgetHidden (const Event &event)
virtual void widgetShown (const Event &event)

Private Attributes


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 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 SetupTabScroll
void removeItems ()
- Protected Member Functions inherited from SetupTab
 SetupTab (const Widget2 *const widget)
void setName (const std::string &name)
- 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 ActionListener
 ActionListener ()
- Protected Member Functions inherited from WidgetListener
 WidgetListener ()
- Protected Attributes inherited from SetupTabScroll
std::map< std::string, SetupItem * > mItems
std::set< SetupItem * > mAllItems
int mPreferredFirstItemSize
- 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
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
Color mForegroundColor2
- Static Protected Attributes inherited from Widget
static FontmGlobalFont = 0

Detailed Description

Definition at line 30 of file setup_players.h.

Constructor & Destructor Documentation

◆ Setup_Players()

Setup_Players::Setup_Players ( const Widget2 *const  widget)

Definition at line 76 of file setup_players.cpp.

76  :
77  SetupTabScroll(widget),
81 {
82  // TRANSLATORS: settings tab name
83  setName(_("Players"));
85  LayoutHelper h(this);
86  ContainerPlacer place = h.getPlacer(0, 0);
87  place(0, 0, mScroll, 10, 10);
89  // TRANSLATORS: settings option
90  new SetupItemCheckBox(_("Show gender"), "",
91  "showgender", this, "showgenderEvent",
94  // TRANSLATORS: settings option
95  new SetupItemCheckBox(_("Show level"), "",
96  "showlevel", this, "showlevelEvent",
99  // TRANSLATORS: settings option
100  new SetupItemCheckBox(_("Show own name"), "",
101  "showownname", this, "showownnameEvent",
104  // TRANSLATORS: settings option
105  new SetupItemCheckBox(_("Enable extended mouse targeting"), "",
106  "extMouseTargeting", this, "extMouseTargetingEvent",
109  // TRANSLATORS: settings option
110  new SetupItemCheckBox(_("Target dead players"), "",
111  "targetDeadPlayers", this, "targetDeadPlayersEvent",
116  // TRANSLATORS: settings option
117  new SetupItemDropDown(_("Show player names"), "",
118  "visiblenames", this, "visiblenamesEvent",
119  mVisibleNamesList, 150,
124  // TRANSLATORS: settings option
125  new SetupItemDropDown(_("Show player names at"), "",
126  "visiblenamespos", this, "visiblenamesposEvent",
130  // TRANSLATORS: settings option
131  new SetupItemCheckBox(_("Auto move names"), "",
132  "moveNames", this, "moveNamesEvent",
136  // TRANSLATORS: settings option
137  new SetupItemDropDown(_("Badges"), "",
138  "showBadges", this, "showBadgesEvent", mBadgesList, 150,
141  // TRANSLATORS: settings option
142  new SetupItemCheckBox(_("Secure trades"), "",
143  "securetrades", this, "securetradesEvent",
146  // TRANSLATORS: settings option
147  new SetupItemTextField(_("Unsecure chars in names"), "",
148  "unsecureChars", this, "unsecureCharsEvent",
151  // TRANSLATORS: settings option
152  new SetupItemCheckBox(_("Show statuses"), "",
153  "showPlayersStatus", this, "showPlayersStatusEvent",
156  // TRANSLATORS: settings option
157  new SetupItemCheckBox(_("Show ip addresses on screenshots"), "",
158  "showip", this, "showipEvent",
161  // TRANSLATORS: settings option
162  new SetupItemCheckBox(_("Allow self heal with mouse click"), "",
163  "selfMouseHeal", this, "selfMouseHealEvent",
166  // TRANSLATORS: settings option
167  new SetupItemCheckBox(_("Group friends in who is online window"), "",
168  "groupFriends", this, "groupFriendsEvent",
171  // TRANSLATORS: settings option
172  new SetupItemCheckBox(_("Hide erased players nicks"), "",
173  "hideErased", this, "hideErasedEvent",
176  // TRANSLATORS: settings option
177  new SetupItemCheckBox(_("Collect players id and seen log"),
178  "", "enableIdCollecting", this, "enableIdCollectingEvent",
181  // TRANSLATORS: settings option
182  new SetupItemCheckBox(_("Use special diagonal speed in players moving"),
183  "", "useDiagonalSpeed", this, "useDiagonalSpeedEvent",
186  // TRANSLATORS: settings option
187  new SetupItemCheckBox(_("Log players actions (for GM)"),
188  "", "logPlayerActions", this, "logPlayerActionsEvent",
191  // TRANSLATORS: settings option
192  new SetupItemCheckBox(_("Create screenshots for each complete trades"),
193  "", "tradescreenshot", this, "tradescreenshotEvent",
196  // TRANSLATORS: settings option
197  new SetupItemCheckBox(_("Emulate right mouse button by long mouse click"
198  " (useful for touch interfaces)"),
199  "", "longmouseclick", this, "longmouseclickEvent",
202  // TRANSLATORS: settings option
203  new SetupItemCheckBox(_("Enable remote commands"),
204  "", "enableRemoteCommands", this, "enableRemoteCommandsEvent",
205  "1",
208  // TRANSLATORS: settings option
209  new SetupItemCheckBox(_("Allow move character by mouse"),
210  "", "allowMoveByMouse", this, "allowMoveByMouseEvent",
213  setDimension(Rect(0, 0, 550, 350));
214 }
void fillFromArray(const char *const *const arr, const std::size_t size)
Definition: namesmodel.cpp:52
Definition: rect.h:74
SetupTabScroll(const Widget2 *const widget)
ScrollArea * mScroll
void setName(const std::string &name)
Definition: setuptab.h:68
NamesModel * mVisibleNamesPosList
Definition: setup_players.h:46
NamesModel * mVisibleNamesList
Definition: setup_players.h:45
NamesModel * mBadgesList
Definition: setup_players.h:44
void setDimension(const Rect &dimension)
Definition: widget.cpp:169
#define _(s)
Definition: gettext.h:35
const bool MainConfig_true
Definition: mainconfig.h:30
const bool MainConfig_false
Definition: mainconfig.h:30
static const char *const visibleNamesList[]
static const int topDownListSize
static const int visibleNamesListSize
static const char *const topDownList[]
static const char *const badgesList[]
static const int badgesListSize
const bool UseBase64_false
Definition: usebase64.h:30

References _, badgesList, badgesListSize, NamesModel::fillFromArray(), LayoutHelper::getPlacer(), MainConfig_false, MainConfig_true, mBadgesList, SetupTabScroll::mScroll, mVisibleNamesList, mVisibleNamesPosList, Widget::setDimension(), SetupTab::setName(), topDownList, topDownListSize, UseBase64_false, visibleNamesList, and visibleNamesListSize.

◆ ~Setup_Players()

Setup_Players::~Setup_Players ( )

Definition at line 216 of file setup_players.cpp.

217 {
221 }
#define delete2(var)
Definition: delete2.h:25

References delete2, mBadgesList, mVisibleNamesList, and mVisibleNamesPosList.

Member Function Documentation

◆ apply()

void Setup_Players::apply ( )

Called when the Apply button is pressed in the setup window.

Implements SetupTab.

Definition at line 228 of file setup_players.cpp.

229 {
232  "enableRemoteCommands", 1) != 0);
233 }
std::string getValue(const std::string &key, const std::string &deflt) const
bool enableRemoteCommands
Definition: settings.h:162
Configuration serverConfig
Settings settings
Definition: settings.cpp:32

References SetupTabScroll::apply(), Settings::enableRemoteCommands, ConfigurationObject::getValue(), serverConfig, and settings.

◆ externalUpdated()

void Setup_Players::externalUpdated ( )

Reimplemented from SetupTab.

Definition at line 223 of file setup_players.cpp.

224 {
225  reread("enableRemoteCommands");
226 }
void reread(const std::string &name)

References SetupTabScroll::reread().

Field Documentation

◆ mBadgesList

NamesModel* Setup_Players::mBadgesList

Definition at line 44 of file setup_players.h.

Referenced by Setup_Players(), and ~Setup_Players().

◆ mVisibleNamesList

NamesModel* Setup_Players::mVisibleNamesList

Definition at line 45 of file setup_players.h.

Referenced by Setup_Players(), and ~Setup_Players().

◆ mVisibleNamesPosList

NamesModel* Setup_Players::mVisibleNamesPosList

Definition at line 46 of file setup_players.h.

Referenced by Setup_Players(), and ~Setup_Players().

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