forked from Mirrors/openclonk
Add user action evaluator: Value to string
parent
de699080dc
commit
04a7426e4f
|
@ -202,6 +202,7 @@ func Definition(def)
|
|||
AddEvaluator("Integer", nil, "$Variable$", "$VariableHelp$", "integer_variable", [def, def.EvalVariable, C4V_Int], { VariableName={Function="string_constant",Value=""} }, variable_delegate);
|
||||
// String evaluators
|
||||
AddEvaluator("String", nil, ["$Constant$", ""], "$ConstantHelp$", "string_constant", [def, def.EvalConstant], { Value="" }, { Type="string", Name="$Value$" });
|
||||
AddEvaluator("String", nil, ["$ValueToString$", ""], "$ValueToStringHelp$", "value_to_string", [def, def.EvalStr_ValueToString], { }, new Evaluator.Any { });
|
||||
AddEvaluator("String", nil, "$Variable$", "$VariableHelp$", "integer_variable", [def, def.EvalVariable, C4V_String], { VariableName={Function="string_constant",Value=""} }, variable_delegate);
|
||||
// Position evaluators
|
||||
AddEvaluator("Position", nil, ["$ConstantPositionAbsolute$", ""], "$ConstantPositionAbsoluteHelp$", "position_constant", [def, def.EvalConstant], def.GetDefaultPosition, { Type="point", Name="$Position$", Relative=false, Color=0xff2000 });
|
||||
|
@ -811,6 +812,11 @@ private func EvalInt_Distance(proplist props, proplist context)
|
|||
return Distance(pA[0], pA[1], pB[0], pB[1]);
|
||||
}
|
||||
|
||||
private func EvalStr_ValueToString(proplist props, proplist context)
|
||||
{
|
||||
return Format("%v", EvaluateValue("Any", props.Value, context));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Context instance */
|
||||
|
|
|
@ -190,3 +190,5 @@ Variable=Variable
|
|||
VariableHelp=Benutzerdefinierte Variable, in die zuvor mit der Aktion 'Variable setzen' ein Wert gespeichert wurde. Werte sollten beim Abruf den gleichen Datentyp (zum Beispiel Zahl oder Text) besitzen wie zur Zeit der Speicherung.
|
||||
Distance=Entfernung
|
||||
DistanceHelp=Berechnet die Entfernung zwischen zwei Punkten A und B.
|
||||
ValueToString=Wert zu Text
|
||||
ValueToStringHelp=Konvertiert einen beliebigen Wert zu Text
|
||||
|
|
|
@ -190,3 +190,5 @@ Variable=Variable
|
|||
VariableHelp=User-defined variable, into which a value was previously stored using the 'Set variable' action. Values should be queried using the same data type (e.g. Integer or Text) as they were stored.
|
||||
Distance=Distance
|
||||
DistanceHelp=Calculates the distance between two positions A and B.
|
||||
ValueToString=Value to string
|
||||
ValueToStringHelp=Konverts a value of another type to a string
|
||||
|
|
Loading…
Reference in New Issue