38 #include "crab/GameParam.h" 39 #include "crab/image/ImageManager.h" 40 #include "crab/input/hotkey.h" 41 #include "crab/music/MusicManager.h" 42 #include "crab/text/TextManager.h" 43 #include "crab/ui/Caption.h" 44 #include "crab/ui/element.h" 45 #include "crab/ui/HoverInfo.h" 49 namespace pyrodactyl {
59 ImageKey _normal, _select, _hover;
62 return _normal == img._normal && _select == img._select && _hover == img._hover; }
71 void load(rapidxml::xml_node<char> *node,
const bool &echo =
true) {
72 if (nodeValid(node)) {
73 loadImgKey(_normal,
"img_b", node, echo);
74 loadImgKey(_select,
"img_s", node, echo);
75 loadImgKey(_hover,
"img_h", node, echo);
79 void saveState(rapidxml::xml_document<> &doc, rapidxml::xml_node<char> *root) {
80 root->append_attribute(doc.allocate_attribute(
"img_b",
g_engine->_stringPool->get(_normal)));
81 root->append_attribute(doc.allocate_attribute(
"img_s",
g_engine->_stringPool->get(_select)));
82 root->append_attribute(doc.allocate_attribute(
"img_h",
g_engine->_stringPool->get(_hover)));
88 bool _visible, _mousePressed;
91 bool _hoverMouse, _hoverKey, _hoverPrev;
100 pyrodactyl::music::ChunkKey _seClick, _seHover;
115 void setUI(
Rect *parent =
nullptr);
117 void load(rapidxml::xml_node<char> *node,
const bool &echo =
true);
118 void init(
const Button &ref,
const int &xOffset = 0,
const int &yOffset = 0);
132 void draw(
const int &xOffset = 0,
const int &yOffset = 0,
Rect *clip =
nullptr);
134 ButtonAction handleEvents(
const Common::Event &event,
const int &xOffset = 0,
const int &yOffset = 0);
137 void imageCaptionOnlyDraw(
const int &xOffset = 0,
const int &yOffset = 0,
Rect *clip =
nullptr);
138 void hoverInfoOnlyDraw(
const int &xOffset = 0,
const int &yOffset = 0,
Rect *clip =
nullptr);
145 #endif // CRAB_BUTTON_H Definition: Rectangle.h:42
Definition: moveeffect.h:37
Definition: HoverInfo.h:41