Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
yunzlp committed Jul 23, 2024
2 parents 0a04a37 + 5774235 commit ed3fc2c
Show file tree
Hide file tree
Showing 27 changed files with 94 additions and 9 deletions.
4 changes: 3 additions & 1 deletion language/zh/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
"Example 2: Listing Emitter Names":"示例2:列出发射器名称",
"Example 2: Negative Length":"示例2:负长度",
"Example 2: Negative Offset & Stride":"示例 2:负偏移量和负偏移量跨步",
"Example 2: Optimised Removal of the Same Variable in Many Items":"示例 2:在多个项中优化删除相同变量",
"Example 2: Playing a sound on an emitter (similar to audio_play_sound_on)":"示例 2:在发射器上播放声音 (类似于 audio_play_sound_on)",
"Example 2: Pretty Print":"示例2:美化输出",
"Example 2: Progressively Drawing a Line":"示例 2:逐步绘制一条线",
Expand Down Expand Up @@ -741,7 +742,8 @@
"Variable":"变量",
"Variable Functions":"变量函数",
"Variable Name":"变量名",
"Variables And Variable Scope":"变量和变量范围",
"Variables And Variable Scope":"变量及其作用域",
"Variables And Variables Scope":"变量及其作用域",
"Vectors":"向量",
"Version & Account Details":"版本和账户详细信息",
"Version Name{} (version Number)":"版本名称{}(版本号)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@
"The syntax for {}DS lists{} is:":"{}DS lists{} (数据结构列表) 语法为:",
"The syntax for {}DS maps{} is:":"{}DS maps{} (数据结构映射) 语法为:",
"The syntax for {}DS Grids{} is:":"{}DS网格{}的语法为:",
"This accessor is essentially a wrapper for the functions {}{}struct_get{}{}{} and {}{}struct_set{}{}, and {}{}variable_global_get{}{} and {}{}variable_global_set{}{} if you access {}The Global Struct{} using the {}global{} keyword.{}":"这个访问器本质上是 {}{}struct_get{}{}{} 和 {}{}struct_set{}{} 的包装器,以及 {}{}variable_global_get{}{} 和 {}{}variable_global_set{}{},如果你使用 {19}global{20} 关键字访问 {}全局结构体{} 的话。{}",
"This accessor is essentially a wrapper for the functions {}{}{}variable_struct_get(){}{} and {}{}variable_struct_set(){}{}, and you would use it much like the accessor for a DS map. For example, if you have created a struct and want to retrieve a value from a variable called \"my_health\" then you\u0027d do:{}":"此访问器实质上是函数{}{}{}variable_struct_get(){}{}和{}{}variable_struct_set(){}{}的包装程序,您可以使用它,就像DS map的访问器一样。例如,如果您创建了一个结构,并希望从名为\"my_health\"的变量中检索一个值,则可以执行以下操作:{}",
"This accessor is essentially a wrapper for the functions {}{}{}variable_struct_get(){}{} and {}{}variable_struct_set(){}{}, and {}{}variable_global_get{}{} and {}{}variable_global_set{}{} if you access {}The Global Struct{} using the {}global{} keyword.{}":"如果您使用{19}global{20}关键字访问{17}全局结构{18},则该访问器本质上是函数{}{}{}variable_struct_get(){}{}和{}{}variable_struct_set(){}{}以及{}{}variable_global_get{}{}和{}{}variable_global_set{}{}的包装器。{}",
"This accessor is only used when the {}Copy on Write option{} is enabled.":"此访问器仅在启用{}写时复制选项{}时使用。",
"To set a variable in a struct then you would do the following":"要在结构中设置一个变量,你需要做以下工作",
"Using chained accessors for things not only means you can write more compact code, it will also permit you to use iteration (for example, using a {}{}for{}{} loop) and other techniques to access your data in a cleaner and more intuitive manner.":"对事物使用链接访问器不仅意味着您可以编写更紧凑的代码,还允许您使用迭代(例如,使用{}{}for{}{}循环)和其他技术以更干净、更直观的方式访问数据。",
"You can chain multiple accessors together in this way and they can be of multiple types to get access to the information stored in each part of the nested structure. Here are some more examples:":"您可以通过这种方式将多个访问器链接在一起,它们可以是多种类型的,以访问存储在嵌套结构每个部分中的信息。以下是更多示例:",
"achieves the same results as doing this:":"获得与以下操作相同的结果:",
"{}Accessors{}":"{}访问器{}",
"{}Arrays [@ ]{}{}Arrays [@ ]{}":"{}Arrays [@ ]{}{}Arrays [@ ]{} 数组",
"{}DS Grids [# ]{}{}DS Grids [# ]{}":"{}DS Grids [# ]{}{}DS Grids [# ]{} 网格",
"{}DS Lists [| ]{}{}DS Lists [| ]{}":"{}DS Lists [| ]{}{}DS Lists [| ]{} 列表",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"Here the static variable {}number{} belongs to {}item{} and the static variable {}types{} belongs to {}weapon{}.":"这里,静态变量{}number{}属于{}item{},静态变量{}types{}属于{}weapon{}。",
"Here the static variable \"{}my_health{}\" is being changed and printed to the compiler output {}before{} being initialised. While that looks wrong, it is perfectly fine because static variables are initialised {}before {}any function code is executed. Note that if there are multiple static variables in a function, the order in which they were defined will be kept when they are initialised at the top.":"这里,在初始化{}之前,静态变量 \"{0}my_health{1}\" 被更改并打印到编译器输出{}。虽然这看起来是错误的,但它完全没有问题,因为静态变量是在{}任何函数代码执行之前{}初始化的。请注意,如果函数中有多个静态变量,则在顶部初始化它们时,它们的定义顺序将保持不变。",
"Here the static variable \"{}my_health{}\" is being changed and printed to the compiler output {}before{} being initialized. While that looks wrong, it is perfectly fine because static variables are initialized {}before {}any function code is executed. Note that if there are multiple static variables in a function, the order in which they were defined will be kept when they are initialized at the top.":"在这里,静态变量\"{}my_health{}\"在{}被初始化之前被改变并打印到编译器输出{}。虽然这看起来不对,但这是很好的,因为静态变量在执行{}任何函数代码之前就被初始化{}。注意,如果一个函数中有多个静态变量,当它们在顶部被初始化时,它们被定义的顺序将被保留。",
"However, it is not recommended to do this, and {}Feather{} will show a GM2043 warning if you try to access a static variable before its initialisation line.":"然而,不建议这样做,如果你在静态变量的初始化行之前尝试访问它,{}Feather{} 会显示一个 GM2043 警告。",
"If you didn\u0027t use the {}static{} keyword here the output would simply be {}0{} for every iteration of the loop, since the variable {}num{} will be getting defined as {}0{} every time the function is called before being returned.":"如果您没有在此处使用{}static{}关键字,则循环每次迭代的输出将仅为{}0{},因为变量{}num{}每次都会被定义为{}0{}返回函数之前调用该函数的时间。",
"If you didn\u0027t use the {}static{} keyword here then the output would simply be {}0{} for every iteration of the loop, since the variable {}num{} will be getting defined as {}0{} every time the function is called before being returned. Note that a static variable can only be changed inside the original function, and returning it will simply give you a copy of its value - essentially the shared static variable can only be changed by the function that contains it.":"如果此处没有使用{}static{}关键字,则循环的每次迭代的输出都将是{}0{},因为在返回之前,每次调用函数时,变量{}num{}都将被定义为{}0{}。请注意,静态变量只能在原始函数内部进行更改,返回它将简单地为您提供其值的副本-实际上,共享的静态变量只能由包含它的函数进行更改。",
"In the above example, the constructor function {}{}Vector2{}{} can be used to create a struct, and the struct will have some variables, one of which is the method variable {}{}Add{}{}. Since this variable has been defined as static, the function it contains will only be initialized {}once {}the first time the {}Vector2{} function is called, and all further structs created with this constructor will reference the function {}Add{} that was created initially, instead of creating a new function for each struct (for more information on structs and the {}constructor{} keyword please see {}here{}).":"在上面的示例中,构造函数{}{}Vector2{}{}可以用来创建结构,并且该结构将有一些变量,其中一个是方法变量{}{}Add{}{}。由于此变量已被定义为静态变量,因此它包含的函数仅在首次调用{}Vector2{}时初始化{}一次{},使用此构造函数创建的所有其他结构将引用最初创建的函数{}Add{},而不是为每个结构创建一个新函数(有关结构和{}构造函数{}的更多信息,请参阅{}此处{})。",
Expand All @@ -38,8 +39,12 @@
"The first value is from the parent constructor, and the second is from the child constructor. This shows that the child\u0027s static variable {}value{} was not initialised until the parent constructor was finished.":"第一个值来自父构造函数,第二个值来自子构造函数。这表明子对象的静态变量{}value{}直到父构造函数完成后才初始化。",
"The first value is from the parent constructor, and the second is from the child constructor. This shows that the child\u0027s static variable {}value{} was not initialized until the parent constructor was finished, and that in each constructor the static variable was initialized before the {}show_debug_message(){} call.":"第一个值来自父构造函数,第二个值来自子构造函数。这表明在父构造函数完成之前未初始化孩子的静态变量{}值{},并且在每个构造函数中,在{}show_debug_message(){}调用之前已初始化静态变量。",
"The output will be:":"输出将为:",
"This also means you cannot have conditionally defined static variables, as they will always exist throughout the function body. For example, if you have a static variable initialised inside an {}if{} condition block, it will be initialised at the top regardless of the condition\u0027s result.":"这也意味着你不能有条件地定义静态变量,因为它们在整个函数体中始终存在。例如,如果你在 {}if{} 条件块中初始化一个静态变量,那么无论条件的结果如何,它都会在顶部被初始化。",
"This mean it\u0027s possible to access a static variable before the line where it\u0027s defined, as it would have already been initialised, even in the first call:":"这意味着即使在定义静态变量的那一行之前,也可以访问该静态变量,因为它已经被初始化,即使在第一次调用时也是如此:",
"This means that no matter how many structs you create from a constructor, they will all {}share the same value{} for each static variable they have.":"这意味着无论从构造函数创建多少个结构,它们都将为它们拥有的每个静态变量共享相同的值{}。",
"To create a static variable you need to define it using the {}static{} keyword, as shown in this simple example:":"要创建静态变量,您需要使用{}static{}关键字定义它,如以下简单示例所示:",
"When a function is called, its static variables are initialised first, before the rest of the function body is executed.":"当调用一个函数时,其静态变量首先被初始化,然后才执行函数体的其余部分。",
"When using inheritance with constructors, any static variables in the child constructor will only be initialised once the parent constructor function has been completely executed. See the following example:":"当在构造函数中使用继承时,子构造函数中的任何静态变量只有在父构造函数完全执行完后才会被初始化。请参见以下示例:",
"When using inheritance with constructors, any static variables in the child constructor will only be initialised once the parent constructor has been executed, so the child constructor\u0027s static variables will not override the parent\u0027s static variables. See the following example:":"当将继承与构造函数一起使用时,子构造函数中的任何静态变量仅在父构造函数执行后才会被初始化,因此子构造函数的静态变量不会覆盖父构造函数的静态变量。请参阅以下示例:",
"When using inheritance with constructors, any static variables in the child constructor will only be initialised once the parent constructor has been executed. See the following example:":"当使用构造函数的继承时,子构造函数中的任何静态变量只有在父构造函数执行后才会初始化。请参见以下示例:",
"When using inheritance with constructors, any static variables in the child constructor will only be initialized once the parent constructor has been executed, so the child constructor\u0027s static variables will not override the parent\u0027s static variables. See the following example:":"当使用构造函数的继承性时,子构造函数中的任何静态变量只有在父构造函数被执行后才会被初始化,所以子构造函数的静态变量不会覆盖父构造函数的静态变量。请看下面的例子。",
Expand Down
Loading

0 comments on commit ed3fc2c

Please sign in to comment.