59 virtual std::string
update();
83 std::string
update()
override;
88 void action(
const gcn::ActionEvent &event)
override;
148 int attributesFirstRow = 2;
156 attributesFirstRow = 3;
170 attributesFirstRow = 3;
180 mAttrScroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
181 mAttrScroll->setVerticalScrollPolicy(ScrollArea::SHOW_AUTO);
187 mDAttrScroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
188 mDAttrScroll->setVerticalScrollPolicy(ScrollArea::SHOW_AUTO);
228 switch(
event.getInt(
"id"))
245 event.getInt(
"newValue")).c_str()));
251 _(
"Character points: %d"),
252 event.getInt(
"newValue")));
259 _(
"Correction points: %d"),
260 event.getInt(
"newValue")));
267 event.getInt(
"newValue")));
274 int id =
event.getInt(
"id");
287 auto it =
mAttrs.find(
id);
290 it->second->update();
306 attr.second->update();
312 auto it =
mAttrs.find(
id);
324 const std::string &description)
399 float progress = ((float) value) / max;
433 mLabel->setAlignment(Graphics::CENTER);
434 mValue->setAlignment(Graphics::CENTER);
448 mValue->setCaption(value);
521 event.getSource() ==
mDec)
534 else if (event.getSource() ==
mInc)
virtual std::string update()
AttrDisplay(int id, const std::string &name)
ChangeDisplay(int id, const std::string &name)
void setPointsNeeded(int needed)
void action(const gcn::ActionEvent &event) override
std::string update() override
LayoutCell & place(int x, int y, gcn::Widget *wg, int w=1, int h=1)
Adds a widget to the container and sets it at given cell.
DerDisplay(int id, const std::string &name)
void listen(Event::Channel channel)
void setRowHeight(int n, int h)
LayoutCell & setPadding(int p)
Sets the padding around the cell content.
@ AUTO_SET
Uses the share as the new size.
virtual bool canUseMagicBar() const =0
Tells whether the protocol is using the MP status bar.
virtual void decreaseAttribute(int attr)=0
virtual void increaseAttribute(int attr)=0
virtual bool canUseMagic()=0
void setProgress(float progress)
Sets the current progress.
void setText(const std::string &text)
Sets the text shown on the progress bar.
void setProgressPalette(int progressPalette)
Change the ProgressPalette for this ProgressBar to follow or -1 to disable this and manage color manu...
void registerWindowForReset(Window *window)
Enables the Reset Windows button.
static void updateMPBar(ProgressBar *bar, bool showMax=false)
void event(Event::Channel channel, const Event &event) override
std::map< int, AttrDisplay * > mAttrs
gcn::Label * mCorrectionPointsLabel
void setPointsNeeded(int id, int needed)
static void updateHPBar(ProgressBar *bar, bool showMax=false)
gcn::Label * mCharacterPointsLabel
static void updateProgressBar(ProgressBar *bar, int value, int max, bool percent)
gcn::Label * mJobLvlLabel
gcn::Label * mLvlLabel
Status Part.
ScrollArea * mDAttrScroll
VertContainer * mAttrCont
VertContainer * mDAttrCont
void addAttribute(int id, const std::string &name, bool modifiable, const std::string &description)
static void updateXPBar(ProgressBar *bar, bool percent=true)
static std::string formatCurrency(int value)
Formats the given number in the correct currency format.
void add(gcn::Widget *widget) override
void setMinHeight(int height)
Sets the minimum height of the window.
Layout & getLayout()
Gets the layout handler for this window.
void setWindowName(const std::string &name)
Sets the name of the window.
void setResizable(bool resize)
Sets whether or not the window can be resized.
void setSaveVisible(bool save)
Sets whether the window will save it's visibility.
LayoutCell & place(int x, int y, gcn::Widget *, int w=1, int h=1)
Adds a widget to the window and sets it at given cell.
void setCloseButton(bool flag)
Sets whether or not the window has a close button.
void setDefaultSize()
Set the default win pos and size to the current ones.
void loadWindowState()
Reads the position (and the size for resizable windows) in the configuration based on the given strin...
void setMinWidth(int width)
Sets the minimum width of the window.
LocalPlayer * local_player
ServerType getNetworkType()
GameHandler * getGameHandler()
PlayerHandler * getPlayerHandler()
int getStatBase(int id)
Returns the base value of the given stat.
void setStatBase(int id, int value, bool notify)
Changes the base value of the given stat.
void setAttribute(int id, int value, bool notify)
Changes the value of the given attribute.
int getAttribute(int id)
Returns the value of the given attribute.
int getStatMod(int id)
Returns the modifier for the given stat.
std::pair< int, int > getStatExperience(int id)
Returns the experience of the given stat.
std::string strprintf(char const *format,...)
A safe version of sprintf that returns a std::string of the result.
std::string toString(const T &arg)
Converts the given value to a string using std::stringstream.
WindowContainer * windowContainer