From 76c98ce0c8e78778f73d6a5728441897e134fb9e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 22 Apr 2013 12:16:20 +0300 Subject: Improve a bit look in character selection window. Add selection skin for playerbox. New theme file: playerboxselected.xml --- src/gui/widgets/playerbox.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/gui/widgets/playerbox.h') diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h index 61ad7dae4..f2b0a0616 100644 --- a/src/gui/widgets/playerbox.h +++ b/src/gui/widgets/playerbox.h @@ -46,9 +46,11 @@ class PlayerBox final : public Widget2, * Constructor. Takes the initial player character that this box should * display, which defaults to NULL. */ - PlayerBox(Being *const being, const std::string &skin = ""); + PlayerBox(Being *const being, const std::string &skin = "", + const std::string &selectedSkin = ""); - explicit PlayerBox(std::string skin = ""); + PlayerBox(const std::string &skin = "", + const std::string &selectedSkin = ""); A_DELETE_COPY(PlayerBox) @@ -57,7 +59,7 @@ class PlayerBox final : public Widget2, */ ~PlayerBox(); - void init(std::string skin); + void init(std::string name, std::string selectedName); /** * Sets a new player character to be displayed by this box. Setting the @@ -80,6 +82,9 @@ class PlayerBox final : public Widget2, Being *getBeing() A_WARN_UNUSED { return mBeing; } + void setSelected(bool b) + { mSelected = b; } + void mouseReleased(gcn::MouseEvent& event); private: @@ -87,10 +92,13 @@ class PlayerBox final : public Widget2, float mAlpha; ImageRect mBackground; + ImageRect mSelectedBackground; Skin *mSkin; - bool mDrawBackground; + Skin *mSelectedSkin; int mOffsetX; int mOffsetY; + bool mDrawBackground; + bool mSelected; }; #endif -- cgit v1.2.3-70-g09d2