////////////////////////////////////////////////////////////////////////////// // This file is part of the Journey MMORPG client // // Copyright © 2015-2016 Daniel Allendorf // // // // This program is free software: you can redistribute it and/or modify // // it under the terms of the GNU Affero General Public License as // // published by the Free Software Foundation, either version 3 of the // // License, or (at your option) 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 Affero General Public License for more details. // // // // You should have received a copy of the GNU Affero General Public License // // along with this program. If not, see . // ////////////////////////////////////////////////////////////////////////////// #pragma once #include "UIState.h" #include "Components/EquipTooltip.h" #include "Components/ItemTooltip.h" #include "Components/MapTooltip.h" #include "Components/SkillTooltip.h" #include "Components/TextTooltip.h" #include "../Template/EnumMap.h" #include "../Template/Optional.h" #include #include namespace jrc { class UIStateGame : public UIState { public: explicit UIStateGame(bool cash_shop = false); void draw(float inter, Point cursor) const override; void update() override; void doubleclick(Point pos) override; void rightclick(Point pos) override; void send_key(KeyType::Id type, int32_t action, bool pressed, bool escape) override; Cursor::State send_cursor(Cursor::State mst, Point pos) override; void send_scroll(Point pos, double yoffset) override; void send_close() override; void cancel_drag() override; void drag_icon(Icon* icon) override; void clear_tooltip(Tooltip::Parent parent) override; void show_equip(Tooltip::Parent parent, int16_t slot) override; void show_item(Tooltip::Parent parent, int32_t itemid) override; void show_skill(Tooltip::Parent parent, int32_t skill_id, int32_t level, int32_t masterlevel, int64_t expiration) override; void show_text(Tooltip::Parent parent, const std::string& text) override; void show_map(Tooltip::Parent parent, const std::string& title, const std::string& description, int32_t mapid, bool bolded, bool portal) override; Iterator pre_add(UIElement::Type type, bool toggled, bool focused) override; void remove(UIElement::Type type) override; UIElement* get(UIElement::Type type) override; UIElement* get_front(const std::list& types) override; UIElement* get_front(Point pos) override; private: void clear_cursors(bool clicked, Point pos, UIElement::Type except); void drop_icon(const Icon& icon, Point pos); template void emplace(Args&&...args); EnumMap elements; std::list elementorder; UIElement::Type focused; UIElement::Type cursor_captured; EquipTooltip eqtooltip; ItemTooltip ittooltip; SkillTooltip sktooltip; TextTooltip txttooltip; MapTooltip mtooltip; Optional tooltip; Tooltip::Parent tooltipparent; Optional draggedicon; bool cash_shop; int16_t view_width; int16_t view_height; }; }