fix word highlighting where substitutions are used
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
#include "replay.hpp"
|
#include "replay.hpp"
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
#include <boost/algorithm/string/replace.hpp>
|
||||||
|
|
||||||
short monsters_faces[190] = {
|
short monsters_faces[190] = {
|
||||||
0,1,2,3,4,5,6,7,8,9,
|
0,1,2,3,4,5,6,7,8,9,
|
||||||
@@ -995,6 +996,13 @@ void place_talk_str(std::string str_to_place,std::string str_to_place2,short col
|
|||||||
// First determine the offsets of clickable words.
|
// First determine the offsets of clickable words.
|
||||||
// The added spaces ensure that end-of-word boundaries are found
|
// The added spaces ensure that end-of-word boundaries are found
|
||||||
std::string str = str_to_place + " |" + str_to_place2 + " ";
|
std::string str = str_to_place + " |" + str_to_place2 + " ";
|
||||||
|
|
||||||
|
// TODO use a font where we don't need this
|
||||||
|
extern std::map<std::string,std::string> substitutions;
|
||||||
|
for(auto it : substitutions){
|
||||||
|
boost::replace_all(str, it.first, it.second);
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<hilite_t> hilites;
|
std::vector<hilite_t> hilites;
|
||||||
std::vector<int> nodes;
|
std::vector<int> nodes;
|
||||||
int wordStart = 0, wordEnd = 0;
|
int wordStart = 0, wordEnd = 0;
|
||||||
|
Reference in New Issue
Block a user