aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiChatConsole.h
diff options
context:
space:
mode:
authorpecksin <78765996+pecksin@users.noreply.github.com>2021-06-20 11:20:24 -0400
committerGitHub <noreply@github.com>2021-06-20 17:20:24 +0200
commit1805775f3d54043c3b1e75e47b9b85e3b12bab00 (patch)
tree64037a771d4e7022fbae593d3ae775774fbba177 /src/gui/guiChatConsole.h
parente1b297a14baa8849711896677691a8d4fe855dcc (diff)
downloadminetest-1805775f3d54043c3b1e75e47b9b85e3b12bab00.tar.xz
Make chat web links clickable (#11092)
If enabled in minetest.conf, provides colored, clickable (middle-mouse or ctrl-left-mouse) weblinks in chat output, to open the OS' default web browser.
Diffstat (limited to 'src/gui/guiChatConsole.h')
-rw-r--r--src/gui/guiChatConsole.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/guiChatConsole.h b/src/gui/guiChatConsole.h
index 1152f2b2d..32628f0d8 100644
--- a/src/gui/guiChatConsole.h
+++ b/src/gui/guiChatConsole.h
@@ -84,6 +84,9 @@ private:
void drawText();
void drawPrompt();
+ // If clicked fragment has a web url, send it to the system default web browser
+ void middleClick(s32 col, s32 row);
+
private:
ChatBackend* m_chat_backend;
Client* m_client;
@@ -126,4 +129,9 @@ private:
// font
gui::IGUIFont *m_font = nullptr;
v2u32 m_fontsize;
+
+ // Enable clickable chat weblinks
+ bool m_cache_clickable_chat_weblinks;
+ // Track if a ctrl key is currently held down
+ bool m_is_ctrl_down;
};