mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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.
This commit is contained in:
parent
e1b297a14b
commit
1805775f3d
8 changed files with 242 additions and 30 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue