mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-18 02:45:21 +02:00
Add ability to override item images using meta (#12614)
This commit is contained in:
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include "hex.h"
|
||||
#include "porting.h"
|
||||
#include "translation.h"
|
||||
#include "strfnd.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
@@ -897,3 +898,15 @@ void safe_print_string(std::ostream &os, const std::string &str)
|
||||
}
|
||||
os.setf(flags);
|
||||
}
|
||||
|
||||
|
||||
v3f str_to_v3f(const std::string &str)
|
||||
{
|
||||
v3f value;
|
||||
Strfnd f(str);
|
||||
f.next("(");
|
||||
value.X = stof(f.next(","));
|
||||
value.Y = stof(f.next(","));
|
||||
value.Z = stof(f.next(")"));
|
||||
return value;
|
||||
}
|
||||
|
@@ -765,3 +765,11 @@ std::string sanitizeDirName(const std::string &str, const std::string &optional_
|
||||
* brackets (e.g. "a\x1eb" -> "a<1e>b").
|
||||
*/
|
||||
void safe_print_string(std::ostream &os, const std::string &str);
|
||||
|
||||
/**
|
||||
* Parses a string of form `(1, 2, 3)` to a v3f
|
||||
*
|
||||
* @param str String
|
||||
* @return
|
||||
*/
|
||||
v3f str_to_v3f(const std::string &str);
|
||||
|
Reference in New Issue
Block a user