~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gui/widgets/itemcontainer.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-09-17 10:35:51 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130917103551-az7p3nz9jgxwqjfn
Tags: 1.3.9.15-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "gui/widgets/itemcontainer.h"
24
24
 
25
25
#include "dragdrop.h"
26
 
#include "dropshortcut.h"
27
26
#include "inventory.h"
28
27
#include "item.h"
29
28
#include "itemshortcut.h"
30
 
#include "playerinfo.h"
 
29
 
 
30
#include "being/playerinfo.h"
31
31
 
32
32
#include "gui/chatwindow.h"
33
33
#include "gui/gui.h"
34
34
#include "gui/itempopup.h"
35
 
#include "gui/outfitwindow.h"
36
35
#include "gui/shopwindow.h"
37
36
#include "gui/shortcutwindow.h"
38
 
#include "gui/sdlinput.h"
39
37
#include "gui/viewport.h"
40
38
 
41
39
#include "net/net.h"
47
45
#include "resources/image.h"
48
46
 
49
47
#include <guichan/font.hpp>
50
 
#include <guichan/mouseinput.hpp>
51
48
#include <guichan/selectionlistener.hpp>
52
49
 
 
50
#include <algorithm>
 
51
 
53
52
#include "debug.h"
54
53
 
55
 
 
56
54
namespace
57
55
{
58
56
    class ItemIdPair final
165
163
    gcn::WidgetListener(),
166
164
    mInventory(inventory),
167
165
    mSelImg(Theme::getImageFromThemeXml("item_selection.xml", "")),
 
166
    mProtectedImg(Theme::getImageFromTheme("lock.png")),
168
167
    mName(),
169
168
    mItemPopup(new ItemPopup),
170
169
    mShowMatrix(nullptr),
210
209
        mSelImg->decRef();
211
210
        mSelImg = nullptr;
212
211
    }
 
212
    if (mProtectedImg)
 
213
    {
 
214
        mProtectedImg->decRef();
 
215
        mProtectedImg = nullptr;
 
216
    }
 
217
 
213
218
    if (Theme::instance())
214
219
        Theme::instance()->unload(mSkin);
215
220
 
277
282
                image->setAlpha(1.0f);  // ensure the image if fully drawn...
278
283
                g->drawImage(image, itemX + mPaddingItemX,
279
284
                    itemY + mPaddingItemY);
 
285
                if (mProtectedImg && PlayerInfo::isItemProtected(
 
286
                    item->getId()))
 
287
                {
 
288
                    g->drawImage(mProtectedImg, itemX + mPaddingItemX,
 
289
                        itemY + mPaddingItemY);
 
290
                }
280
291
            }
281
292
        }
282
293
    }