From aa3f63fd497558a02feb3ddbc44f31eac091f39b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Oct 2017 22:14:45 +0300 Subject: Remove most unused files. --- src/gui/widgets/attrs/attrdisplay.cpp | 67 ----------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 src/gui/widgets/attrs/attrdisplay.cpp (limited to 'src/gui/widgets/attrs/attrdisplay.cpp') diff --git a/src/gui/widgets/attrs/attrdisplay.cpp b/src/gui/widgets/attrs/attrdisplay.cpp deleted file mode 100644 index 3b91fef9d..000000000 --- a/src/gui/widgets/attrs/attrdisplay.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2017 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "gui/widgets/attrs/attrdisplay.h" - -#include "being/playerinfo.h" - -#include "gui/widgets/layouthelper.h" - -#include "utils/delete2.h" -#include "utils/stringutils.h" - -#include "debug.h" - -AttrDisplay::AttrDisplay(const Widget2 *const widget, - const AttributesT id, - const std::string &restrict name, - const std::string &restrict shortName) : - Container(widget), - mId(id), - mName(name), - mShortName(shortName), - mLayout(new LayoutHelper(this)), - mLabel(new Label(this, name)), - mValue(new Label(this, "1 ")) -{ - setSize(100, 32); - - setSelectable(false); - mLabel->setAlignment(Graphics::CENTER); - mValue->setAlignment(Graphics::CENTER); -} - -AttrDisplay::~AttrDisplay() -{ - delete2(mLayout); -} - -std::string AttrDisplay::update() -{ - const int base = PlayerInfo::getStatBase(mId); - const int bonus = PlayerInfo::getStatMod(mId); - std::string value = toString(base + bonus); - if (bonus != 0) - value.append(strprintf("=%d%+d", base, bonus)); - mValue->setCaption(value); - return mName; -} -- cgit v1.2.3-70-g09d2