Moved C++ tools out
This commit is contained in:
@ -0,0 +1,46 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "VNSetDefaultFontEventParser.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
std::map<std::string, std::string> VNSetDefaultFontEventParser::getOptionalAttributes() {
|
||||
return {
|
||||
{ "font", "font_main" },
|
||||
{ "style", "" },
|
||||
{ "size", "" },
|
||||
{ "color", "" }
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<std::string> VNSetDefaultFontEventParser::getRequiredAttributes() {
|
||||
return {};
|
||||
}
|
||||
|
||||
int32_t VNSetDefaultFontEventParser::onParse(
|
||||
Xml *node,
|
||||
std::map<std::string, std::string> values,
|
||||
struct VNSetFont *out,
|
||||
std::string *error
|
||||
) {
|
||||
//Get the font
|
||||
out->font = values["font"];
|
||||
if(out->font.empty()) {
|
||||
*error = "Font is required.";
|
||||
return 1;
|
||||
}
|
||||
|
||||
//Get the style
|
||||
out->style = values["style"];
|
||||
|
||||
//Get the size
|
||||
out->fontSize = values["size"];
|
||||
|
||||
//Get the color
|
||||
out->color = values["color"];
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user