aboutsummaryrefslogtreecommitdiff
Commit message (Expand)AuthorAge
...
* Translated using Weblate (Ukrainian)Olexandr2017-06-03
* Translated using Weblate (Ukrainian)Fixer2017-06-03
* Translated using Weblate (Russian)weqqr2017-06-03
* Translated using Weblate (Russian)Andrew Zyabin2017-06-03
* Translated using Weblate (Russian)Sergey2017-06-03
* Translated using Weblate (Russian)Andrew Zyabin2017-06-03
* Translated using Weblate (Russian)anonymous2017-06-03
* Translated using Weblate (Russian)weqqr2017-06-03
* Translated using Weblate (Russian)Alex “XShell” Schekoldin2017-06-03
* Translated using Weblate (Russian)weqqr2017-06-03
* Translated using Weblate (Russian)Pavel Sokolov2017-06-03
* Translated using Weblate (Russian)weqqr2017-06-03
* Translated using Weblate (Russian)Sergey2017-06-03
* Translated using Weblate (Russian)weqqr2017-06-03
* Translated using Weblate (Russian)Sergey2017-06-03
* Translated using Weblate (Russian)weqqr2017-06-03
* Properly remove SAO when worldedges are overtaken (#5889)Loïc Blot2017-06-03
* Android: update build tools version + versionCode bump for releaseLoic Blot2017-06-03
* Remove unimplemented setting `movement_speed_descend` (#5892)red-0012017-06-03
* Tooltips: Unify the tooltip[] and list[] description tooltip display function...SmallJoker2017-06-03
* Mention data type for get/set_attribute in docs (#5884)Wuzzy2017-06-03
* Lua_api.txt: Various edits and Markdown syntax improvementsWuzzy2017-06-02
* Remove “inf” argument from shutdown command help (#5880)Wuzzy2017-06-02
* Document hardware coloring and soft node overlays (#5876)Dániel Juhász2017-06-02
* Do not shade inventory items with textures (#5869)Dániel Juhász2017-06-01
* Show singlenode mapgen to menu (#5868)Loïc Blot2017-06-01
* Fix dropdown menu selection (#5847)red-0012017-06-01
* Add more files and file types to `.gitignore` (#5859)red-0012017-05-31
* Nametag: remove colour codes before calculating alignment. (#5862)red-0012017-05-31
* Don't add damage flash while punch texture modifier is active (#5767)stujones112017-05-29
* guiVolumeChange: prevent wrong value position by using 1 label instead of 2 (...Loïc Blot2017-05-28
* Added missing levels to logging menu (#5836)Nathan Salapat2017-05-28
* Mapgen files: Update and correct copyright creditsparamat2017-05-26
* Time: Change old `u32` timestamps to 64-bit (#5818)SmallJoker2017-05-26
* Enhance ABM performance a little bit by removing two std::set copy (#5815)Loïc Blot2017-05-25
* Mgv6 mudflow: Remove decoration if 'dirt with grass' below flows away (#5798)Paramat2017-05-25
* Close formspec on client shutdown. (#5811)red-0012017-05-25
* Revert 1469424 and fix wrong char position when doing mouse selection on intl...Loïc Blot2017-05-24
* Add formspec escaping to subgame list in create world dialog (#5808)rubenwardy2017-05-24
* Minimal: Add river water nodes (#5809)Paramat2017-05-24
* Fix wrong return value in get_sky Lua call since ad9fcf859ec2347325830e09504a...Loic Blot2017-05-23
* Client crashfix: load meta after digging (#5801)Paramat2017-05-23
* LINT fix & check all files with clang-formatLoic Blot2017-05-22
* [CSM] Add send_chat_message and run_server_chatcommand API functions (#5747)Pierre-Adrien Langrognet2017-05-21
* Run updatepo.shLoic Blot2017-05-21
* Translated using Weblate (Ukrainian)Fixer2017-05-21
* Translated using Weblate (Russian)weqqr2017-05-21
* Translated using Weblate (Chinese (Simplified))Gaunthan Huang2017-05-21
* Translated using Weblate (Turkish)monolifed2017-05-21
* Translated using Weblate (Spanish)Michael Higuera2017-05-21
class="hl opt">(str)), m_default_color); } void EnrichedString::addAtEnd(const std::wstring &s, SColor initial_color) { SColor color(initial_color); bool use_default = (m_default_length == m_string.size() && color == m_default_color); m_colors.reserve(m_colors.size() + s.size()); size_t i = 0; while (i < s.length()) { if (s[i] != L'\x1b') { m_string += s[i]; m_colors.push_back(color); ++i; continue; } ++i; size_t start_index = i; size_t length; if (i == s.length()) { break; } if (s[i] == L'(') { ++i; ++start_index; while (i < s.length() && s[i] != L')') { if (s[i] == L'\\') { ++i; } ++i; } length = i - start_index; ++i; } else { ++i; length = 1; } std::wstring escape_sequence(s, start_index, length); std::vector<std::wstring> parts = split(escape_sequence, L'@'); if (parts[0] == L"c") { if (parts.size() < 2) { continue; } parseColorString(wide_to_utf8(parts[1]), color, true); // No longer use default color after first escape if (use_default) { m_default_length = m_string.size(); use_default = false; } } else if (parts[0] == L"b") { if (parts.size() < 2) { continue; } parseColorString(wide_to_utf8(parts[1]), m_background, true); m_has_background = true; } } // Update if no escape character was found if (use_default) m_default_length = m_string.size(); } void EnrichedString::addChar(const EnrichedString &source, size_t i) { m_string += source.m_string[i]; m_colors.push_back(source.m_colors[i]); } void EnrichedString::addCharNoColor(wchar_t c) { m_string += c; if (m_colors.empty()) { m_colors.emplace_back(m_default_color); } else { m_colors.push_back(m_colors[m_colors.size() - 1]); } } EnrichedString EnrichedString::operator+(const EnrichedString &other) const { EnrichedString result = *this; result += other; return result; } void EnrichedString::operator+=(const EnrichedString &other) { bool update_default_color = m_default_length == m_string.size(); m_string += other.m_string; m_colors.insert(m_colors.end(), other.m_colors.begin(), other.m_colors.end()); if (update_default_color) { m_default_length += other.m_default_length; updateDefaultColor(); } } EnrichedString EnrichedString::substr(size_t pos, size_t len) const { if (pos >= m_string.length()) return EnrichedString(); if (len == std::string::npos || pos + len > m_string.length()) len = m_string.length() - pos; EnrichedString str( m_string.substr(pos, len), std::vector<SColor>(m_colors.begin() + pos, m_colors.begin() + pos + len) ); str.m_has_background = m_has_background; str.m_background = m_background; if (pos < m_default_length) str.m_default_length = std::min(m_default_length - pos, str.size()); str.setDefaultColor(m_default_color); return str; } const wchar_t *EnrichedString::c_str() const { return m_string.c_str(); } const std::vector<SColor> &EnrichedString::getColors() const { return m_colors; } const std::wstring &EnrichedString::getString() const { return m_string; } void EnrichedString::updateDefaultColor() { sanity_check(m_default_length <= m_colors.size()); for (size_t i = 0; i < m_default_length; ++i) m_colors[i] = m_default_color; }