summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/@GlobalScope.xml4
-rw-r--r--doc/classes/Array.xml10
-rw-r--r--doc/classes/Color.xml10
-rw-r--r--doc/classes/Dictionary.xml2
-rw-r--r--doc/classes/Directory.xml2
-rw-r--r--doc/classes/LineEdit.xml6
-rw-r--r--doc/classes/Object.xml4
-rw-r--r--doc/classes/TextEdit.xml2
-rw-r--r--doc/classes/VisualShaderNode.xml6
-rw-r--r--doc/classes/VisualShaderNodeBooleanConstant.xml4
-rw-r--r--doc/classes/VisualShaderNodeBooleanUniform.xml2
-rw-r--r--doc/classes/VisualShaderNodeColorConstant.xml4
-rw-r--r--doc/classes/VisualShaderNodeColorFunc.xml19
-rw-r--r--doc/classes/VisualShaderNodeColorOp.xml63
-rw-r--r--doc/classes/VisualShaderNodeColorUniform.xml2
-rw-r--r--doc/classes/VisualShaderNodeCompare.xml27
-rw-r--r--doc/classes/int.xml14
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs49
-rw-r--r--scene/resources/visual_shader_nodes.cpp10
-rw-r--r--scene/resources/visual_shader_nodes.h10
20 files changed, 208 insertions, 42 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index a131f1f8c8..73f0f1bd41 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -1167,10 +1167,10 @@
Since [constant OK] has value 0, and all other failure codes are positive integers, it can also be used in boolean checks, e.g.:
[codeblock]
var err = method_that_returns_error()
- if (err != OK):
+ if err != OK:
print("Failure!)
# Or, equivalent:
- if (err):
+ if err:
print("Still failing!)
[/codeblock]
</constant>
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index c192cee1fe..60c744f398 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -8,11 +8,11 @@
[b]Example:[/b]
[codeblock]
var array = ["One", 2, 3, "Four"]
- print(array[0]) # One
- print(array[2]) # 3
- print(array[-1]) # Four
+ print(array[0]) # One.
+ print(array[2]) # 3.
+ print(array[-1]) # Four.
array[2] = "Three"
- print(array[-2]) # Three
+ print(array[-2]) # Three.
[/codeblock]
Arrays are always passed by reference.
</description>
@@ -342,7 +342,7 @@
var my_items = [[5, "Potato"], [9, "Rice"], [4, "Tomato"]]
my_items.sort_custom(MyCustomSorter, "sort_ascending")
- print(my_items) # Prints [[4, Tomato], [5, Potato], [9, Rice]]
+ print(my_items) # Prints [[4, Tomato], [5, Potato], [9, Rice]].
[/codeblock]
</description>
</method>
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index 1d4225542a..8820cb5c27 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -18,11 +18,11 @@
<description>
Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. See also [method @GDScript.ColorN].
[codeblock]
- # Each of the following creates the same color RGBA(178, 217, 10, 255)
- var c1 = Color("#ffb2d90a") # ARGB format with "#"
- var c2 = Color("ffb2d90a") # ARGB format
- var c3 = Color("#b2d90a") # RGB format with "#"
- var c4 = Color("b2d90a") # RGB format
+ # Each of the following creates the same color RGBA(178, 217, 10, 255).
+ var c1 = Color("#ffb2d90a") # ARGB format with "#".
+ var c2 = Color("ffb2d90a") # ARGB format.
+ var c3 = Color("#b2d90a") # RGB format with "#".
+ var c4 = Color("b2d90a") # RGB format.
[/codeblock]
</description>
</method>
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index facf2d1025..29547a67f4 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -32,7 +32,7 @@
To add a key to an existing dictionary, access it like an existing key and assign to it:
[codeblock]
var points_dir = {"White": 50, "Yellow": 75, "Orange": 100}
- var points_dir["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value.
+ var points_dir["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value.
[/codeblock]
Finally, dictionaries can contain different types of keys and values in the same dictionary:
[codeblock]
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml
index 91256359fb..883f3049e3 100644
--- a/doc/classes/Directory.xml
+++ b/doc/classes/Directory.xml
@@ -13,7 +13,7 @@
if dir.open(path) == OK:
dir.list_dir_begin()
var file_name = dir.get_next()
- while (file_name != ""):
+ while file_name != "":
if dir.current_is_dir():
print("Found directory: " + file_name)
else:
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index 8463db9cd5..324f6db9b8 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -78,9 +78,9 @@
Selects characters inside [LineEdit] between [code]from[/code] and [code]to[/code]. By default, [code]from[/code] is at the beginning and [code]to[/code] at the end.
[codeblock]
text = "Welcome"
- select() # Will select "Welcome"
- select(4) # Will select "ome"
- select(2, 5) # Will select "lco"
+ select() # Will select "Welcome".
+ select(4) # Will select "ome".
+ select(2, 5) # Will select "lco".
[/codeblock]
</description>
</method>
diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml
index d063bd81e7..1cf6dfb83f 100644
--- a/doc/classes/Object.xml
+++ b/doc/classes/Object.xml
@@ -12,8 +12,8 @@
Property membership can be tested directly in GDScript using [code]in[/code]:
[codeblock]
var n = Node2D.new()
- print("position" in n) # Prints "True".
- print("other_property" in n) # Prints "False".
+ print("position" in n) # Prints "True".
+ print("other_property" in n) # Prints "False".
[/codeblock]
Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification].
</description>
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index 3deed63ae7..6724c3bceb 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -315,7 +315,7 @@
[codeblock]
var result = search(key, flags, line, column)
if result.size() &gt; 0:
- # result found
+ # Result found.
var res_line = result[TextEdit.SEARCH_RESULT_LINE]
var res_column = result[TextEdit.SEARCH_RESULT_COLUMN]
[/codeblock]
diff --git a/doc/classes/VisualShaderNode.xml b/doc/classes/VisualShaderNode.xml
index 9f7e4573ff..185c5dab90 100644
--- a/doc/classes/VisualShaderNode.xml
+++ b/doc/classes/VisualShaderNode.xml
@@ -11,6 +11,7 @@
<return type="Array">
</return>
<description>
+ Returns an [Array] containing default values for all of the input ports of the node in the form [code][index0, value0, index1, value1, ...][/code].
</description>
</method>
<method name="get_input_port_default_value" qualifiers="const">
@@ -19,6 +20,7 @@
<argument index="0" name="port" type="int">
</argument>
<description>
+ Returns the default value of the input [code]port[/code].
</description>
</method>
<method name="set_default_input_values">
@@ -27,6 +29,7 @@
<argument index="0" name="values" type="Array">
</argument>
<description>
+ Sets the default input ports values using an [Array] of the form [code][index0, value0, index1, value1, ...][/code]. For example: [code][0, Vector3(0, 0, 0), 1, Vector3(0, 0, 0)][/code].
</description>
</method>
<method name="set_input_port_default_value">
@@ -37,16 +40,19 @@
<argument index="1" name="value" type="Variant">
</argument>
<description>
+ Sets the default value for the selected input [code]port[/code].
</description>
</method>
</methods>
<members>
<member name="output_port_for_preview" type="int" setter="set_output_port_for_preview" getter="get_output_port_for_preview" default="-1">
+ Sets the output port index which will be showed for preview. If set to [code]-1[/code] no port will be open for preview.
</member>
</members>
<signals>
<signal name="editor_refresh_request">
<description>
+ Emitted when the node requests an editor refresh. Currently called only in setter of [member VisualShaderNodeTexture.source], [VisualShaderNodeTexture], and [VisualShaderNodeCubeMap] (and their derivatives).
</description>
</signal>
</signals>
diff --git a/doc/classes/VisualShaderNodeBooleanConstant.xml b/doc/classes/VisualShaderNodeBooleanConstant.xml
index b46905cfea..aba2f63961 100644
--- a/doc/classes/VisualShaderNodeBooleanConstant.xml
+++ b/doc/classes/VisualShaderNodeBooleanConstant.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeBooleanConstant" inherits="VisualShaderNode" category="Core" version="3.2">
<brief_description>
+ A boolean constant to be used within the visual shader graph.
</brief_description>
<description>
+ Has only one output port and no inputs.
+ Translated to [code]bool[/code] in the shader language.
</description>
<tutorials>
</tutorials>
@@ -10,6 +13,7 @@
</methods>
<members>
<member name="constant" type="bool" setter="set_constant" getter="get_constant" default="false">
+ A boolean constant which represents a state of this node.
</member>
</members>
<constants>
diff --git a/doc/classes/VisualShaderNodeBooleanUniform.xml b/doc/classes/VisualShaderNodeBooleanUniform.xml
index 518c7ba3b8..f00f2031c7 100644
--- a/doc/classes/VisualShaderNodeBooleanUniform.xml
+++ b/doc/classes/VisualShaderNodeBooleanUniform.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeBooleanUniform" inherits="VisualShaderNodeUniform" category="Core" version="3.2">
<brief_description>
+ A boolean uniform to be used within the visual shader graph.
</brief_description>
<description>
+ Translated to [code]uniform bool[/code] in the shader language.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeColorConstant.xml b/doc/classes/VisualShaderNodeColorConstant.xml
index 282966a9ca..333bfccf99 100644
--- a/doc/classes/VisualShaderNodeColorConstant.xml
+++ b/doc/classes/VisualShaderNodeColorConstant.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeColorConstant" inherits="VisualShaderNode" category="Core" version="3.2">
<brief_description>
+ A [Color] constant to be used within the visual shader graph.
</brief_description>
<description>
+ Has two output ports representing RGB and alpha channels of [Color].
+ Translated to [code]vec3 rgb[/code] and [code]float alpha[/code] in the shader language.
</description>
<tutorials>
</tutorials>
@@ -10,6 +13,7 @@
</methods>
<members>
<member name="constant" type="Color" setter="set_constant" getter="get_constant" default="Color( 1, 1, 1, 1 )">
+ A [Color] constant which represents a state of this node.
</member>
</members>
<constants>
diff --git a/doc/classes/VisualShaderNodeColorFunc.xml b/doc/classes/VisualShaderNodeColorFunc.xml
index b37a669ee9..9e8e13245b 100644
--- a/doc/classes/VisualShaderNodeColorFunc.xml
+++ b/doc/classes/VisualShaderNodeColorFunc.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeColorFunc" inherits="VisualShaderNode" category="Core" version="3.2">
<brief_description>
+ A [Color] function to be used within the visual shader graph.
</brief_description>
<description>
+ Accept a [Color] to the input port and transform it according to [member function].
</description>
<tutorials>
</tutorials>
@@ -10,12 +12,29 @@
</methods>
<members>
<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeColorFunc.Function" default="0">
+ A function to be applied to the input color. See [enum Function] for options.
</member>
</members>
<constants>
<constant name="FUNC_GRAYSCALE" value="0" enum="Function">
+ Converts the color to grayscale using the following formula:
+ [codeblock]
+ vec3 c = input;
+ float max1 = max(c.r, c.g);
+ float max2 = max(max1, c.b);
+ float max3 = max(max1, max2);
+ return vec3(max3, max3, max3);
+ [/codeblock]
</constant>
<constant name="FUNC_SEPIA" value="1" enum="Function">
+ Applies sepia tone effect using the following formula:
+ [codeblock]
+ vec3 c = input;
+ float r = (c.r * 0.393) + (c.g * 0.769) + (c.b * 0.189);
+ float g = (c.r * 0.349) + (c.g * 0.686) + (c.b * 0.168);
+ float b = (c.r * 0.272) + (c.g * 0.534) + (c.b * 0.131);
+ return vec3(r, g, b);
+ [/codeblock]
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeColorOp.xml b/doc/classes/VisualShaderNodeColorOp.xml
index 77c5361f4d..414de2ed5a 100644
--- a/doc/classes/VisualShaderNodeColorOp.xml
+++ b/doc/classes/VisualShaderNodeColorOp.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeColorOp" inherits="VisualShaderNode" category="Core" version="3.2">
<brief_description>
+ A [Color] operator to be used within the visual shader graph.
</brief_description>
<description>
+ Applies [member operator] to two color inputs.
</description>
<tutorials>
</tutorials>
@@ -10,26 +12,87 @@
</methods>
<members>
<member name="operator" type="int" setter="set_operator" getter="get_operator" enum="VisualShaderNodeColorOp.Operator" default="0">
+ An operator to be applied to the inputs. See [enum Operator] for options.
</member>
</members>
<constants>
<constant name="OP_SCREEN" value="0" enum="Operator">
+ Produce a screen effect with the following formula:
+ [codeblock]
+ result = vec3(1.0) - (vec3(1.0) - a) * (vec3(1.0) - b);
+ [/codeblock]
</constant>
<constant name="OP_DIFFERENCE" value="1" enum="Operator">
+ Produce a difference effect with the following formula:
+ [codeblock]
+ result = abs(a - b);
+ [/codeblock]
</constant>
<constant name="OP_DARKEN" value="2" enum="Operator">
+ Produce a darken effect with the following formula:
+ [codeblock]
+ result = min(a, b);
+ [/codeblock]
</constant>
<constant name="OP_LIGHTEN" value="3" enum="Operator">
+ Produce a lighten effect with the following formula:
+ [codeblock]
+ result = max(a, b);
+ [/codeblock]
</constant>
<constant name="OP_OVERLAY" value="4" enum="Operator">
+ Produce an overlay effect with the following formula:
+ [codeblock]
+ for (int i = 0; i &lt; 3; i++) {
+ float base = a[i];
+ float blend = b[i];
+ if (base &lt; 0.5) {
+ result[i] = 2.0 * base * blend;
+ } else {
+ result[i] = 1.0 - 2.0 * (1.0 - blend) * (1.0 - base);
+ }
+ }
+ [/codeblock]
</constant>
<constant name="OP_DODGE" value="5" enum="Operator">
+ Produce a dodge effect with the following formula:
+ [codeblock]
+ result = a / (vec3(1.0) - b);
+ [/codeblock]
</constant>
<constant name="OP_BURN" value="6" enum="Operator">
+ Produce a burn effect with the following formula:
+ [codeblock]
+ result = vec3(1.0) - (vec3(1.0) - a) / b;
+ [/codeblock]
</constant>
<constant name="OP_SOFT_LIGHT" value="7" enum="Operator">
+ Produce a soft light effect with the following formula:
+ [codeblock]
+ for (int i = 0; i &lt; 3; i++) {
+ float base = a[i];
+ float blend = b[i];
+ if (base &lt; 0.5) {
+ result[i] = base * (blend + 0.5);
+ } else {
+ result[i] = 1.0 - (1.0 - base) * (1.0 - (blend - 0.5));
+ }
+ }
+ [/codeblock]
</constant>
<constant name="OP_HARD_LIGHT" value="8" enum="Operator">
+ Produce a hard light effect with the following formula:
+ [codeblock]
+ for (int i = 0; i &lt; 3; i++) {
+ float base = a[i];
+ float blend = b[i];
+ if (base &lt; 0.5) {
+ result[i] = base * (2.0 * blend);
+ } else {
+ result[i] = 1.0 - (1.0 - base) * (1.0 - 2.0 * (blend - 0.5));
+ }
+ }
+ [/codeblock]
</constant>
</constants>
</class>
diff --git a/doc/classes/VisualShaderNodeColorUniform.xml b/doc/classes/VisualShaderNodeColorUniform.xml
index ec61729782..7d07aa0051 100644
--- a/doc/classes/VisualShaderNodeColorUniform.xml
+++ b/doc/classes/VisualShaderNodeColorUniform.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeColorUniform" inherits="VisualShaderNodeUniform" category="Core" version="3.2">
<brief_description>
+ A [Color] uniform to be used within the visual shader graph.
</brief_description>
<description>
+ Translated to [code]uniform vec4[/code] in the shader language.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/VisualShaderNodeCompare.xml b/doc/classes/VisualShaderNodeCompare.xml
index 7edad5294d..3eaa1399b1 100644
--- a/doc/classes/VisualShaderNodeCompare.xml
+++ b/doc/classes/VisualShaderNodeCompare.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeCompare" inherits="VisualShaderNode" category="Core" version="3.2">
<brief_description>
+ A comparison function for common types within the visual shader graph.
</brief_description>
<description>
+ Compares [code]a[/code] and [code]b[/code] of [member type] by [member function]. Returns a boolean scalar. Translates to [code]if[/code] instruction in shader code.
</description>
<tutorials>
</tutorials>
@@ -10,36 +12,51 @@
</methods>
<members>
<member name="condition" type="int" setter="set_condition" getter="get_condition" enum="VisualShaderNodeCompare.Condition" default="0">
+ Extra condition which is applied if [member type] is set to [constant CTYPE_VECTOR].
</member>
<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeCompare.Function" default="0">
+ A comparison function. See [enum Function] for options.
</member>
- <member name="type" type="int" setter="set_comparsion_type" getter="get_comparsion_type" enum="VisualShaderNodeCompare.ComparsionType" default="0">
+ <member name="type" type="int" setter="set_comparison_type" getter="get_comparison_type" enum="VisualShaderNodeCompare.ComparisonType" default="0">
+ The type to be used in the comparison. See [enum ComparisonType] for options.
</member>
</members>
<constants>
- <constant name="CTYPE_SCALAR" value="0" enum="ComparsionType">
+ <constant name="CTYPE_SCALAR" value="0" enum="ComparisonType">
+ A floating-point scalar.
</constant>
- <constant name="CTYPE_VECTOR" value="1" enum="ComparsionType">
+ <constant name="CTYPE_VECTOR" value="1" enum="ComparisonType">
+ A 3D vector type.
</constant>
- <constant name="CTYPE_BOOLEAN" value="2" enum="ComparsionType">
+ <constant name="CTYPE_BOOLEAN" value="2" enum="ComparisonType">
+ A boolean type.
</constant>
- <constant name="CTYPE_TRANSFORM" value="3" enum="ComparsionType">
+ <constant name="CTYPE_TRANSFORM" value="3" enum="ComparisonType">
+ A transform ([code]mat4[/code]) type.
</constant>
<constant name="FUNC_EQUAL" value="0" enum="Function">
+ Comparison for equality ([code]a == b[/code]).
</constant>
<constant name="FUNC_NOT_EQUAL" value="1" enum="Function">
+ Comparison for inequality ([code]a != b[/code]).
</constant>
<constant name="FUNC_GREATER_THAN" value="2" enum="Function">
+ Comparison for greater than ([code]a &gt; b[/code]). Cannot be used if [member type] set to [constant CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM].
</constant>
<constant name="FUNC_GREATER_THAN_EQUAL" value="3" enum="Function">
+ Comparison for greater than or equal ([code]a &gt;= b[/code]). Cannot be used if [member type] set to [constant CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM].
</constant>
<constant name="FUNC_LESS_THAN" value="4" enum="Function">
+ Comparison for less than ([code]a &lt; b[/code]). Cannot be used if [member type] set to [constant CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM].
</constant>
<constant name="FUNC_LESS_THAN_EQUAL" value="5" enum="Function">
+ Comparison for less than or equal ([code]a &lt; b[/code]). Cannot be used if [member type] set to [constant CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM].
</constant>
<constant name="COND_ALL" value="0" enum="Condition">
+ The result will be true if all of component in vector satisfy the comparison condition.
</constant>
<constant name="COND_ANY" value="1" enum="Condition">
+ The result will be true if any of component in vector satisfy the comparison condition.
</constant>
</constants>
</class>
diff --git a/doc/classes/int.xml b/doc/classes/int.xml
index dad0f0d8c0..39017f7119 100644
--- a/doc/classes/int.xml
+++ b/doc/classes/int.xml
@@ -8,16 +8,16 @@
It can take values in the interval [code][-2^63, 2^63 - 1][/code], i.e. [code][-9223372036854775808, 9223372036854775807][/code]. Exceeding those bounds will wrap around.
[int] is a [Variant] type, and will thus be used when assigning an integer value to a [Variant]. It can also be enforced with the [code]: int[/code] type hint.
[codeblock]
- var my_variant = 0 # int, value 0
- my_variant += 4.2 # float, value 4.2
- var my_int: int = 1 # int, value 1
- my_int = 4.2 # int, value 4, the right value is implicitly cast to int
- my_int = int("6.7") # int, value 6, the String is explicitly cast with [method int]
+ var my_variant = 0 # int, value 0.
+ my_variant += 4.2 # float, value 4.2.
+ var my_int: int = 1 # int, value 1.
+ my_int = 4.2 # int, value 4, the right value is implicitly cast to int.
+ my_int = int("6.7") # int, value 6, the String is explicitly cast with int.
var max_int = 9223372036854775807
- print(max_int) # 9223372036854775807, OK
+ print(max_int) # 9223372036854775807, OK.
max_int += 1
- print(max_int) # -9223372036854775808, we overflowed and wrapped around
+ print(max_int) # -9223372036854775808, we overflowed and wrapped around.
[/codeblock]
</description>
<tutorials>
diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
index 96cafba87f..3e2a8c22a9 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs
@@ -17,6 +17,43 @@ namespace GodotTools.Export
{
public class ExportPlugin : EditorExportPlugin
{
+ [Flags]
+ enum I18NCodesets
+ {
+ None = 0,
+ CJK = 1,
+ MidEast = 2,
+ Other = 4,
+ Rare = 8,
+ West = 16,
+ All = CJK | MidEast | Other | Rare | West
+ }
+
+ private void AddI18NAssemblies(Godot.Collections.Dictionary<string, string> assemblies, string platform)
+ {
+ var codesets = (I18NCodesets) ProjectSettings.GetSetting("mono/export/i18n_codesets");
+
+ if (codesets == I18NCodesets.None)
+ return;
+
+ string bclDir = DeterminePlatformBclDir(platform) ?? typeof(object).Assembly.Location.GetBaseDir();
+
+ void AddI18NAssembly(string name) => assemblies.Add(name, Path.Combine(bclDir, $"{name}.dll"));
+
+ AddI18NAssembly("I18N");
+
+ if ((codesets & I18NCodesets.CJK) != 0)
+ AddI18NAssembly("I18N.CJK");
+ if ((codesets & I18NCodesets.MidEast) != 0)
+ AddI18NAssembly("I18N.MidEast");
+ if ((codesets & I18NCodesets.Other) != 0)
+ AddI18NAssembly("I18N.Other");
+ if ((codesets & I18NCodesets.Rare) != 0)
+ AddI18NAssembly("I18N.Rare");
+ if ((codesets & I18NCodesets.West) != 0)
+ AddI18NAssembly("I18N.West");
+ }
+
public void RegisterExportSettings()
{
// TODO: These would be better as export preset options, but that doesn't seem to be supported yet
@@ -24,6 +61,16 @@ namespace GodotTools.Export
GlobalDef("mono/export/include_scripts_content", false);
GlobalDef("mono/export/export_assemblies_inside_pck", true);
+ GlobalDef("mono/export/i18n_codesets", I18NCodesets.All);
+
+ ProjectSettings.AddPropertyInfo(new Godot.Collections.Dictionary
+ {
+ ["type"] = Variant.Type.Int,
+ ["name"] = "mono/export/i18n_codesets",
+ ["hint"] = PropertyHint.Flags,
+ ["hint_string"] = "CJK,MidEast,Other,Rare,West"
+ });
+
GlobalDef("mono/export/aot/enabled", false);
GlobalDef("mono/export/aot/full_aot", false);
@@ -145,6 +192,8 @@ namespace GodotTools.Export
var initialDependencies = dependencies.Duplicate();
internal_GetExportedAssemblyDependencies(initialDependencies, buildConfig, DeterminePlatformBclDir(platform), dependencies);
+ AddI18NAssemblies(dependencies, platform);
+
string outputDataDir = null;
if (PlatformHasTemplateDir(platform))
diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp
index f46fba3b5b..225274a5fe 100644
--- a/scene/resources/visual_shader_nodes.cpp
+++ b/scene/resources/visual_shader_nodes.cpp
@@ -3929,7 +3929,7 @@ String VisualShaderNodeCompare::generate_code(Shader::Mode p_mode, VisualShader:
return code;
}
-void VisualShaderNodeCompare::set_comparsion_type(ComparsionType p_type) {
+void VisualShaderNodeCompare::set_comparison_type(ComparisonType p_type) {
ctype = p_type;
@@ -3954,7 +3954,7 @@ void VisualShaderNodeCompare::set_comparsion_type(ComparsionType p_type) {
emit_changed();
}
-VisualShaderNodeCompare::ComparsionType VisualShaderNodeCompare::get_comparsion_type() const {
+VisualShaderNodeCompare::ComparisonType VisualShaderNodeCompare::get_comparison_type() const {
return ctype;
}
@@ -3992,8 +3992,8 @@ Vector<StringName> VisualShaderNodeCompare::get_editable_properties() const {
void VisualShaderNodeCompare::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_comparsion_type", "type"), &VisualShaderNodeCompare::set_comparsion_type);
- ClassDB::bind_method(D_METHOD("get_comparsion_type"), &VisualShaderNodeCompare::get_comparsion_type);
+ ClassDB::bind_method(D_METHOD("set_comparison_type", "type"), &VisualShaderNodeCompare::set_comparison_type);
+ ClassDB::bind_method(D_METHOD("get_comparison_type"), &VisualShaderNodeCompare::get_comparison_type);
ClassDB::bind_method(D_METHOD("set_function", "func"), &VisualShaderNodeCompare::set_function);
ClassDB::bind_method(D_METHOD("get_function"), &VisualShaderNodeCompare::get_function);
@@ -4001,7 +4001,7 @@ void VisualShaderNodeCompare::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_condition", "condition"), &VisualShaderNodeCompare::set_condition);
ClassDB::bind_method(D_METHOD("get_condition"), &VisualShaderNodeCompare::get_condition);
- ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, "Scalar,Vector,Boolean,Transform"), "set_comparsion_type", "get_comparsion_type");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, "Scalar,Vector,Boolean,Transform"), "set_comparison_type", "get_comparison_type");
ADD_PROPERTY(PropertyInfo(Variant::INT, "function", PROPERTY_HINT_ENUM, "a == b,a != b,a > b,a >= b,a < b,a <= b"), "set_function", "get_function");
ADD_PROPERTY(PropertyInfo(Variant::INT, "condition", PROPERTY_HINT_ENUM, "All,Any"), "set_condition", "get_condition");
diff --git a/scene/resources/visual_shader_nodes.h b/scene/resources/visual_shader_nodes.h
index 0f428088e0..cca37273d9 100644
--- a/scene/resources/visual_shader_nodes.h
+++ b/scene/resources/visual_shader_nodes.h
@@ -1635,7 +1635,7 @@ class VisualShaderNodeCompare : public VisualShaderNode {
GDCLASS(VisualShaderNodeCompare, VisualShaderNode);
public:
- enum ComparsionType {
+ enum ComparisonType {
CTYPE_SCALAR,
CTYPE_VECTOR,
CTYPE_BOOLEAN,
@@ -1657,7 +1657,7 @@ public:
};
protected:
- ComparsionType ctype;
+ ComparisonType ctype;
Function func;
Condition condition;
@@ -1677,8 +1677,8 @@ public:
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const; //if no output is connected, the output var passed will be empty. if no input is connected and input is NIL, the input var passed will be empty
- void set_comparsion_type(ComparsionType p_type);
- ComparsionType get_comparsion_type() const;
+ void set_comparison_type(ComparisonType p_type);
+ ComparisonType get_comparison_type() const;
void set_function(Function p_func);
Function get_function() const;
@@ -1692,7 +1692,7 @@ public:
VisualShaderNodeCompare();
};
-VARIANT_ENUM_CAST(VisualShaderNodeCompare::ComparsionType)
+VARIANT_ENUM_CAST(VisualShaderNodeCompare::ComparisonType)
VARIANT_ENUM_CAST(VisualShaderNodeCompare::Function)
VARIANT_ENUM_CAST(VisualShaderNodeCompare::Condition)