diff options
Diffstat (limited to 'utils/themeeditor/models/parsetreenode.cpp')
-rw-r--r-- | utils/themeeditor/models/parsetreenode.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp index 1349ba9ad6..8d1fcc7d1a 100644 --- a/utils/themeeditor/models/parsetreenode.cpp +++ b/utils/themeeditor/models/parsetreenode.cpp | |||
@@ -523,7 +523,7 @@ void ParseTreeNode::render(const RBRenderInfo& info) | |||
523 | return; | 523 | return; |
524 | } | 524 | } |
525 | 525 | ||
526 | rendered = new RBViewport(element, info); | 526 | rendered = new RBViewport(element, info, this); |
527 | 527 | ||
528 | for(int i = element->params_count; i < children.count(); i++) | 528 | for(int i = element->params_count; i < children.count(); i++) |
529 | children[i]->render(info, dynamic_cast<RBViewport*>(rendered)); | 529 | children[i]->render(info, dynamic_cast<RBViewport*>(rendered)); |
@@ -1057,3 +1057,33 @@ double ParseTreeNode::findConditionalTime(ParseTreeNode *conditional, | |||
1057 | conditional->children.count()).toInt(); | 1057 | conditional->children.count()).toInt(); |
1058 | return findBranchTime(conditional->children[child], info); | 1058 | return findBranchTime(conditional->children[child], info); |
1059 | } | 1059 | } |
1060 | |||
1061 | void ParseTreeNode::modParam(QVariant value, int index) | ||
1062 | { | ||
1063 | if(element) | ||
1064 | { | ||
1065 | if(index < 0 || index >= children.count()) | ||
1066 | return; | ||
1067 | children[index]->modParam(value); | ||
1068 | } | ||
1069 | else if(param) | ||
1070 | { | ||
1071 | if(value.type() == QVariant::Double) | ||
1072 | { | ||
1073 | param->type = skin_tag_parameter::DECIMAL; | ||
1074 | param->data.number = static_cast<int>(value.toDouble() * 10); | ||
1075 | } | ||
1076 | else if(value.type() == QVariant::String) | ||
1077 | { | ||
1078 | param->type = skin_tag_parameter::STRING; | ||
1079 | free(param->data.text); | ||
1080 | param->data.text = strdup(value.toString().toStdString().c_str()); | ||
1081 | } | ||
1082 | else if(value.type() == QVariant::Int) | ||
1083 | { | ||
1084 | param->type = skin_tag_parameter::INTEGER; | ||
1085 | param->data.number = value.toInt(); | ||
1086 | } | ||
1087 | |||
1088 | } | ||
1089 | } | ||