|
75 | 75 | struct FloatConstantDef { |
76 | 76 | String name; |
77 | 77 | float value = 0; |
78 | | - String desc; |
| 78 | + const char *desc_key; |
79 | 79 | }; |
80 | 80 |
|
81 | 81 | static FloatConstantDef float_constant_defs[] = { |
82 | | - { "E", Math_E, TTR("E constant (2.718282). Represents the base of the natural logarithm.") }, |
83 | | - { "Epsilon", CMP_EPSILON, TTR("Epsilon constant (0.00001). Smallest possible scalar number.") }, |
84 | | - { "Phi", 1.618034f, TTR("Phi constant (1.618034). Golden ratio.") }, |
85 | | - { "Pi/4", Math_PI / 4, TTR("Pi/4 constant (0.785398) or 45 degrees.") }, |
86 | | - { "Pi/2", Math_PI / 2, TTR("Pi/2 constant (1.570796) or 90 degrees.") }, |
87 | | - { "Pi", Math_PI, TTR("Pi constant (3.141593) or 180 degrees.") }, |
88 | | - { "Tau", Math_TAU, TTR("Tau constant (6.283185) or 360 degrees.") }, |
89 | | - { "Sqrt2", Math_SQRT2, TTR("Sqrt2 constant (1.414214). Square root of 2.") } |
| 82 | + { "E", Math_E, TTRC("E constant (2.718282). Represents the base of the natural logarithm.") }, |
| 83 | + { "Epsilon", CMP_EPSILON, TTRC("Epsilon constant (0.00001). Smallest possible scalar number.") }, |
| 84 | + { "Phi", 1.618034f, TTRC("Phi constant (1.618034). Golden ratio.") }, |
| 85 | + { "Pi/4", Math_PI / 4, TTRC("Pi/4 constant (0.785398) or 45 degrees.") }, |
| 86 | + { "Pi/2", Math_PI / 2, TTRC("Pi/2 constant (1.570796) or 90 degrees.") }, |
| 87 | + { "Pi", Math_PI, TTRC("Pi constant (3.141593) or 180 degrees.") }, |
| 88 | + { "Tau", Math_TAU, TTRC("Tau constant (6.283185) or 360 degrees.") }, |
| 89 | + { "Sqrt2", Math_SQRT2, TTRC("Sqrt2 constant (1.414214). Square root of 2.") } |
90 | 90 | }; |
91 | 91 |
|
92 | 92 | const int MAX_FLOAT_CONST_DEFS = sizeof(float_constant_defs) / sizeof(FloatConstantDef); |
@@ -7198,7 +7198,7 @@ VisualShaderEditor::VisualShaderEditor() { |
7198 | 7198 | // CONSTANTS |
7199 | 7199 |
|
7200 | 7200 | for (int i = 0; i < MAX_FLOAT_CONST_DEFS; i++) { |
7201 | | - add_options.push_back(AddOption(float_constant_defs[i].name, "Scalar/Constants", "VisualShaderNodeFloatConstant", float_constant_defs[i].desc, { float_constant_defs[i].value }, VisualShaderNode::PORT_TYPE_SCALAR)); |
| 7201 | + add_options.push_back(AddOption(float_constant_defs[i].name, "Scalar/Constants", "VisualShaderNodeFloatConstant", TTRGET(float_constant_defs[i].desc_key), { float_constant_defs[i].value }, VisualShaderNode::PORT_TYPE_SCALAR)); |
7202 | 7202 | } |
7203 | 7203 | // FUNCTIONS |
7204 | 7204 |
|
|
0 commit comments