27#if SDL_VERSION_ATLEAST(2, 0, 14)
51static bool isUrl(
const std::string &link)
60#if SDL_VERSION_ATLEAST(2, 0, 14)
64 std::string filename = link.substr(11);
67 if (filename.find(
"..") == std::string::npos &&
endsWith(filename,
".png"))
70 if (SDL_OpenURL(fileUrl.c_str()) == -1)
82#if SDL_VERSION_ATLEAST(2, 0, 14)
84 confirmDialog->addActionListener(
this);
87 _(
"Opening of URLs requires SDL 2.0.14."),
true,
mParent);
93 std::istringstream stream(link);
110 if (actionEvent.getId() ==
"yes")
112#if SDL_VERSION_ATLEAST(2, 0, 14)
113 if (SDL_OpenURL(
mLink.c_str()) == -1)
static const std::string & getScreenshotDirectory()
const ItemInfo & get(int id) const
Defines a class for storing generic item infos.
std::unique_ptr< ItemPopup > mItemPopup
~ItemLinkHandler() override
void death(const gcn::Event &event) override
void handleLink(const std::string &link) override
void action(const gcn::ActionEvent &actionEvent) override
ItemLinkHandler(Window *parent=nullptr)
int getMouseY() const
Returns mouse y in pixels.
int getMouseX() const
Returns mouse x in pixels.
ItemDB * itemDb
Items info database.
Viewport * viewport
Viewport on the map.
bool startsWith(std::string_view str, std::string_view prefix)
Returns whether a string starts with a given prefix.
bool endsWith(std::string_view str, std::string_view suffix)
Returns whether a string ends with a given suffix.