aboutsummaryrefslogtreecommitdiff
path: root/src/chat.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/chat.h
parente1b297a14baa8849711896677691a8d4fe855dcc (diff)
downloadhax-minetest-server-1805775f3d54043c3b1e75e47b9b85e3b12bab00.tar.gz
hax-minetest-server-1805775f3d54043c3b1e75e47b9b85e3b12bab00.zip
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 '')
-rw-r--r--src/chat.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/chat.h b/src/chat.h
index 0b98e4d3c..aabb0821e 100644
--- a/src/chat.h
+++ b/src/chat.h
@@ -57,6 +57,8 @@ struct ChatFormattedFragment
EnrichedString text;
// starting column
u32 column;
+ // web link is empty for most frags
+ std::string weblink;
// formatting
//u8 bold:1;
};
@@ -118,6 +120,7 @@ public:
std::vector<ChatFormattedLine>& destination) const;
void resize(u32 scrollback);
+
protected:
s32 getTopScrollPos() const;
s32 getBottomScrollPos() const;
@@ -138,6 +141,11 @@ private:
std::vector<ChatFormattedLine> m_formatted;
// Empty formatted line, for error returns
ChatFormattedLine m_empty_formatted_line;
+
+ // Enable clickable chat weblinks
+ bool m_cache_clickable_chat_weblinks;
+ // Color of clickable chat weblinks
+ irr::video::SColor m_cache_chat_weblink_color;
};
class ChatPrompt