Merge remote-tracking branch 'pret/master' into RHH/pr/sync/pretmerge_20221030
# Conflicts: # src/data/bard_music/moves.h # src/data/bard_music/pokemon.h
This commit is contained in:
commit
e4a439aa46
578 files changed
+31627
-25653
No files matched your search
@@ -1,6 +1,6 @@
|
||||
CXX ?= g++
|
||||
|
||||
CXXFLAGS := -Wall -std=c++11 -O2
|
||||
CXXFLAGS := -Wall -std=c++17 -O2
|
||||
|
||||
INCLUDES := -I .
|
||||
|
||||
|
||||
+2440
-3020
File diff suppressed because it is too large.
Load diff
@@ -7,6 +7,9 @@
|
||||
#include <string>
|
||||
using std::string; using std::to_string;
|
||||
|
||||
#include <algorithm>
|
||||
using std::replace_if;
|
||||
|
||||
#include <inja.hpp>
|
||||
using namespace inja;
|
||||
using json = nlohmann::json;
|
||||
@@ -33,6 +36,7 @@ int main(int argc, char *argv[])
|
||||
string outputFilepath = argv[3];
|
||||
|
||||
Environment env;
|
||||
env.set_trim_blocks(true);
|
||||
|
||||
// Add custom command callbacks.
|
||||
env.add_callback("doNotModifyHeader", 0, [jsonfilepath, templateFilepath](Arguments& args) {
|
||||
@@ -96,6 +100,21 @@ int main(int argc, char *argv[])
|
||||
return args.at(0)->empty();
|
||||
});
|
||||
|
||||
env.add_callback("isEmptyString", 1, [](Arguments& args) {
|
||||
return args.at(0)->get<string>().empty();
|
||||
});
|
||||
|
||||
env.add_callback("cleanString", 1, [](Arguments& args) {
|
||||
string badChars = ".'{} \n\t-\u00e9";
|
||||
string str = args.at(0)->get<string>();
|
||||
for (uint i = 0; i < str.length(); i++) {
|
||||
if (badChars.find(str[i]) != std::string::npos) {
|
||||
str[i] = '_';
|
||||
}
|
||||
}
|
||||
return str;
|
||||
});
|
||||
|
||||
try
|
||||
{
|
||||
env.write_with_json_file(templateFilepath, jsonfilepath, outputFilepath);
|
||||
|
||||
+10436
-9146
File diff suppressed because it is too large.
Load diff
@@ -191,7 +191,7 @@ string generate_map_events_text(Json map_data) {
|
||||
<< warp_event["x"].int_value() << ", "
|
||||
<< warp_event["y"].int_value() << ", "
|
||||
<< warp_event["elevation"].int_value() << ", "
|
||||
<< warp_event["dest_warp_id"].int_value() << ", "
|
||||
<< warp_event["dest_warp_id"].string_value() << ", "
|
||||
<< warp_event["dest_map"].string_value() << "\n";
|
||||
}
|
||||
text << "\n";
|
||||
|
||||
Reference in new issue
Block a user