ManaPlus
src
gui
popups
itempopup.h
Go to the documentation of this file.
1
/*
2
* The ManaPlus Client
3
* Copyright (C) 2008 The Legend of Mazzeroth Development Team
4
* Copyright (C) 2008-2009 The Mana World Development Team
5
* Copyright (C) 2009-2010 The Mana Developers
6
* Copyright (C) 2011-2019 The ManaPlus Developers
7
* Copyright (C) 2019-2021 Andrei Karas
8
*
9
* This file is part of The ManaPlus Client.
10
*
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* any later version.
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
20
*
21
* You should have received a copy of the GNU General Public License
22
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
*/
24
25
#ifndef GUI_POPUPS_ITEMPOPUP_H
26
#define GUI_POPUPS_ITEMPOPUP_H
27
28
#include "
enums/resources/item/itemdbtype.h
"
29
30
#include "
enums/simpletypes/itemcolor.h
"
31
32
#include "
gui/widgets/popup.h
"
33
34
class
Icon
;
35
class
Item
;
36
class
ItemInfo
;
37
class
Label
;
38
class
TextBox
;
39
40
struct
ItemOptionsList
;
41
45
class
ItemPopup
final
:
public
Popup
46
{
47
public
:
51
ItemPopup
();
52
53
A_DELETE_COPY
(
ItemPopup
)
54
55
58
~ItemPopup
()
override
final
;
59
60
void
postInit
()
override
final
;
61
65
void
setItem
(
const
ItemInfo
&item,
66
const
ItemColor
color,
67
const
bool
showImage,
68
int
id
,
69
const
int
*
const
cards,
70
const
ItemOptionsList
*
const
options);
71
72
void
setItem
(
const
Item
*
const
item,
73
const
bool
showImage);
74
75
void
mouseMoved
(
MouseEvent
&event)
override
final
;
76
77
void
resetPopup
();
78
79
private
:
80
std::string
getCardsString
(
const
int
*
const
cards);
81
82
static
std::string
getOptionsString
(
const
ItemOptionsList
*
const
83
options);
84
85
Label
*
mItemName
A_NONNULLPOINTER
;
86
TextBox
*
mItemDesc
A_NONNULLPOINTER
;
87
TextBox
*
mItemEffect
A_NONNULLPOINTER
;
88
TextBox
*
mItemWeight
A_NONNULLPOINTER
;
89
TextBox
*
mItemCards
A_NONNULLPOINTER
;
90
TextBox
*
mItemOptions
A_NONNULLPOINTER
;
91
ItemDbTypeT
mItemType
;
92
Icon
*
mIcon
A_NONNULLPOINTER
;
93
std::string
mLastName
;
94
std::string
mCardsStr
;
95
std::string
mItemOptionsStr
;
96
int
mLastId
;
97
ItemColor
mLastColor
;
98
99
void
setLabelColor
(
Label
*label,
100
const
ItemDbTypeT
type)
const
A_NONNULL
(2);
101
};
102
103
extern
ItemPopup
*
itemPopup
;
104
105
#endif
// GUI_POPUPS_ITEMPOPUP_H
Icon
Definition:
icon.h:41
ItemInfo
Definition:
iteminfo.h:54
ItemPopup
Definition:
itempopup.h:46
ItemPopup::mIcon
Icon * mIcon
Definition:
itempopup.h:92
ItemPopup::~ItemPopup
~ItemPopup()
Definition:
itempopup.cpp:138
ItemPopup::setItem
void setItem(const ItemInfo &item, const ItemColor color, const bool showImage, int id, const int *const cards, const ItemOptionsList *const options)
Definition:
itempopup.cpp:189
ItemPopup::ItemPopup
ItemPopup()
Definition:
itempopup.cpp:66
ItemPopup::mLastName
std::string mLastName
Definition:
itempopup.h:93
ItemPopup::mItemCards
TextBox * mItemCards
Definition:
itempopup.h:89
ItemPopup::mItemName
Label * mItemName
Definition:
itempopup.h:85
ItemPopup::getOptionsString
static std::string getOptionsString(const ItemOptionsList *const options)
Definition:
itempopup.cpp:379
ItemPopup::postInit
void postInit()
Definition:
itempopup.cpp:124
ItemPopup::setLabelColor
void setLabelColor(Label *label, const ItemDbTypeT type) const
Definition:
itempopup.cpp:421
ItemPopup::resetPopup
void resetPopup()
Definition:
itempopup.cpp:464
ItemPopup::mItemType
ItemDbTypeT mItemType
Definition:
itempopup.h:91
ItemPopup::mItemDesc
TextBox * mItemDesc
Definition:
itempopup.h:86
ItemPopup::mLastColor
ItemColor mLastColor
Definition:
itempopup.h:97
ItemPopup::mLastId
int mLastId
Definition:
itempopup.h:96
ItemPopup::getCardsString
std::string getCardsString(const int *const cards)
Definition:
itempopup.cpp:330
ItemPopup::mItemWeight
TextBox * mItemWeight
Definition:
itempopup.h:88
ItemPopup::mouseMoved
void mouseMoved(MouseEvent &event)
Definition:
itempopup.cpp:455
ItemPopup::mCardsStr
std::string mCardsStr
Definition:
itempopup.h:94
ItemPopup::mItemOptionsStr
std::string mItemOptionsStr
Definition:
itempopup.h:95
ItemPopup::mItemEffect
TextBox * mItemEffect
Definition:
itempopup.h:87
ItemPopup::mItemOptions
TextBox * mItemOptions
Definition:
itempopup.h:90
Item
Definition:
item.h:50
Label
Definition:
label.h:91
MouseEvent
Definition:
mouseevent.h:81
Popup
Definition:
popup.h:52
TextBox
Definition:
textbox.h:89
itemcolor.h
ItemColor
uint16_t ItemColor
Definition:
itemcolor.h:30
itemdbtype.h
ItemDbTypeT
ItemDbType ::T ItemDbTypeT
Definition:
itemdbtype.h:49
itemPopup
ItemPopup * itemPopup
Definition:
itempopup.cpp:64
A_NONNULL
#define A_NONNULL(...)
Definition:
localconsts.h:168
A_NONNULLPOINTER
#define A_NONNULLPOINTER
Definition:
localconsts.h:266
final
#define final
Definition:
localconsts.h:46
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition:
localconsts.h:53
popup.h
ItemOptionsList
Definition:
itemoptionslist.h:34
Generated on Wed Mar 17 2021 19:19:06 for ManaPlus by
1.9.1