17
17
"Content-Transfer-Encoding: 8bit\n"
19
19
#: ../../source/label.rst:5
20
# e071ff9f6a0a47f5ba9a06d25e73b60d
20
# 63cb8f20bf2b47ea9cf3bb516b8d1a7e
21
21
msgid "Labels & Control Flow"
24
24
#: ../../source/label.rst:8
25
# 8291e165333649f2bbf42fac49a0e182
25
# 780c1b2c0d1047048c720b74953cd473
26
26
msgid "Label Statement"
29
29
#: ../../source/label.rst:10
30
# a144aeeb56d745ec9a50b3e2bce68b1c
30
# 37a2354676344fe7843e86a925567783
31
31
msgid "Label statements allow the given name to be assigned to a program point. They exist solely to be called or jumped to, whether by script code or the Ren'Py config. ::"
34
34
#: ../../source/label.rst:21
35
# 27a9a0fb43f6451b825ef4a56f0ee2f5
35
# 7507330ad90d48158986d2bf9d163f1c
36
36
msgid "A label statement may have a block associated with it. In that case, control enters the block whenever the label statement is reached, and proceeds with the statement after the label statement whenever the end of the block is reached."
39
39
#: ../../source/label.rst:25
40
# ec7c2ee6278d4649974fcad367f7aea6
40
# 2c055310e29243f987649a180f5336d8
41
41
msgid "The label statement may take an optional list of parameters. These parameters are processed as described in PEP 3102, with two exceptions:"
44
44
#: ../../source/label.rst:28
45
# 94c43027a5a14aaeab8418055431380c
45
# 601b06fefbeb4fee9e410f37c2e2eadf
46
46
msgid "The values of default parameters are evaluated at call time."
49
49
#: ../../source/label.rst:29
50
# 861931371d124b0484480760813340bd
50
# a1713c7ff6e54a49af46814223fdcd33
51
51
msgid "The variables are dynamically, rather than lexically, scoped."
54
54
#: ../../source/label.rst:34
55
# d29ba6410c744ea988920e101a5bae6c
55
# ed4e79b3359c43eeacb22f3b380ca63d
56
56
msgid "Jump Statement"
59
59
#: ../../source/label.rst:36
60
# ab9d51a2d25d4d1c9a20e6a1fc1c4055
60
# b9872493822e46c4bd8136f89f251283
61
61
msgid "The jump statement is used to transfer control to the given label."
64
64
#: ../../source/label.rst:38
65
# 8d41422914fc4b66b33e4dec10169acf
65
# 4a58b919ef3c4125937b9a7c11dd308e
66
66
msgid "If the ``expression`` keyword is present, the expression following it is evaluated, and the string so computed is used as the label name of the statement to jump to. If the ``expression`` keyword is not present, the label name of the statement to jump to must be explicitly given."
69
69
#: ../../source/label.rst:43
70
# 26c9275155bd4d43a03390dff78e0275
70
# 4fae927d05c545ddac291ad10356891d
71
71
msgid "Unlike call, jump does not push the next statement onto a stack. As a result, there's no way to return to where you've jumped from. ::"
74
74
#: ../../source/label.rst:55
75
# cff881a944834e0bb3e138e35fbbf90d
75
# 6693a634a4e4422ca7684e9670c5216f
76
76
msgid "Call Statement"
79
79
#: ../../source/label.rst:57
80
# eb7fdd7ab0af4da38cd07505ce3b4927
80
# b8ff8e0ec92f4496bcfa5eb6e027aab8
81
81
msgid "The call statement is used to transfer control to the given label. It also pushes the next statement onto the call stack, allowing the return statement to return control to the statement following the call."
84
84
#: ../../source/label.rst:61
85
# dbc3f85c768d49f59f61ae2d01470d09
85
# f42b391be7934b82b3591042474e39fd
86
86
msgid "If the ``expression`` keyword is present, the expression following it is evaluated, and the string so computed is used as the name of the label to call. If the ``expression`` keyword is not present, the name of the statement to call must be explicitly given."
89
89
#: ../../source/label.rst:66
90
# 319e1bc3d2fa473f822072caebeac4c2
90
# db1087f2f2a74a7d9bae3a7fb1a6cfe8
91
91
msgid "If the optional from clause is present, it has the effect of including a label statement with the given name as the statement immediately following the call statement. An explicit label helps to ensure that saved games with return stacks can return to the proper place when loaded on a changed script. ::"
94
94
#: ../../source/label.rst:88
95
# 0b316e2623ce44a3bfe8c414b6805254
95
# a40a26ac46ea473aa7ffa641f5bd3435
96
96
msgid "The call statement may take arguments, which are processed as described in PEP 3102."
99
99
#: ../../source/label.rst:91
100
# 27e6980f25ad415e8ef3c05e52b8edb9
100
# 400071cdb9bc4962be89e2978e57bdb7
101
101
msgid "When using a call expression with an arguments list, the ``pass`` keyword must be inserted between the expression and the arguments list. Otherwise, the arguments list will be parsed as part of the expression, not as part of the call."
104
104
#: ../../source/label.rst:99
105
# c6962b3389a14a71a0e2f3c24ced48e2
105
# f932037f88564975a9222eb55d8f1a99
106
106
msgid "Return Statement"
109
109
#: ../../source/label.rst:101
110
# daa90e4e13f94b8fbc500449ac79f9de
110
# 58347ecb92824bc58eda0622d9ffc00f
111
111
msgid "The return statement pops the top statement off of the call stack, and transfers control to it. If the call stack is empty, the return statement restarts Ren'Py, returning control to the main menu."
114
114
#: ../../source/label.rst:105
115
# 8e904e0d7e484318bfc64de934ca9f06
115
# 015600078e754e5298412993adfed55a
116
116
msgid "If the optional expression is given to return, it is evaluated, and it's result is stored in the _return variable. This variable is dynamically scoped to each context."
119
119
#: ../../source/label.rst:110
120
# 885c97f5438c4a9f98726e9bf67e1a76
120
# 0aa96017e3e14f8fa0c1c56b0be9aaab
121
121
msgid "Special Labels"
124
124
#: ../../source/label.rst:112
125
# 2f725dcffe8243fb803d697ad4a49ae0
125
# f45016f34a4040b3aead1565e2b2a7aa
126
126
msgid "The following labels are used by Ren'Py:"
129
129
#: ../../source/label.rst:115
130
# d466d33c65d3424b82c90e649153d102
130
# 1dedcf70f9174e0bab9c3618049a0d0b
131
131
msgid "``start``"
134
134
#: ../../source/label.rst:115
135
# 5ed791ef3f034e3790f5623ee32ef6b2
135
# 67e43168d68f4ec9a420ecbe005bf784
136
136
msgid "By default, Ren'Py jumps to this label when the game starts."
139
139
#: ../../source/label.rst:119
140
# c93ecb48a0494f0781cad4ba696269f2
140
# 1993ed2ce7cc4cca9d18c3f199969d07
144
144
#: ../../source/label.rst:118
145
# 772e364ac96940dda8c744909723cba3
145
# 3511cead4cca4afc8b1b4bc3e4b0e301
146
146
msgid "If it exists, this label is called in a new context when the user quits the game."
149
149
#: ../../source/label.rst:123
150
# 636209b06fd94d97998072c9db409717
150
# fff0baf8bd33462eafd9d3d8eb52ca49
151
151
msgid "``after_load``"
154
154
#: ../../source/label.rst:122
155
# 6f122a0a0ee94a428e89af2dcfba6d12
155
# b302b15caf964284940285e6095401f0
156
156
msgid "If it exists, this label is called when a game is loaded. It can be use to fix data when the game is updated."
159
159
#: ../../source/label.rst:127
160
# 9bc6b7c637e54b0393111e6a23f60aa8
160
# cdac121f7bdf450aac121f992b73e8ae
161
161
msgid "``splashscreen``"
164
164
#: ../../source/label.rst:126
165
# 11bb8b95637649808b895bc2fd74a104
165
# eab03b1f0240447db7c36180d3059e25
166
166
msgid "If it exists, this label is called when the game is first run, before showing the main menu."
169
169
#: ../../source/label.rst:132
170
# 6513ca41e65146bfa34f6ce08c26a8f4
170
# ad327a89933d4cf0967ff9a9972e664a
171
171
msgid "``before_main_menu``"
174
174
#: ../../source/label.rst:130
175
# 6f1529c4f61b4d16ac60305e1e26bb05
175
# 1bedc0a0a5f64a559eeaee02371c80a5
176
176
msgid "If it exists, this label is called before the main menu. It is used in rare cases to set up the main menu, for example by starting a movie playing in the background."
179
179
#: ../../source/label.rst:141
180
# c4e2e6757f124dbf8a7d34d2abe3b064
180
# c120b77424cf4d1ea09cbb33c2eb51e2
181
181
msgid "``main_menu``"
184
184
#: ../../source/label.rst:135
185
# 0937609dc4094223877f7f3c33f192e1
185
# 1d49e0b59d834c5f9369f434855f5a90
186
186
msgid "If it exists, this label is called instead of the main menu. If it returns, Ren'Py will start the game at the ``start`` label. For example, the following code will immediately start the game without displaying the main menu. ::"
189
189
#: ../../source/label.rst:145
190
# 5a0691c796644d9c949fc17ac1ce8285
190
# 18fa43d301684829a827da33309f7044
191
191
msgid "``after_warp``"
194
194
#: ../../source/label.rst:144
195
# 99e7131d5af640d7a405d5a9a341c10b
195
# 87855f6a90ad4375958b6c5d8e865d05
196
196
msgid "If it is existed, this label is called after a warp but before the warped-to statement executes. please see :ref:`Warping to a line <warping_to_a_line>`"
199
199
#: ../../source/label.rst:148
200
# 5b67651826964a0dbbdb28b5ee679ea1
200
# ec07363335474fa4854a17f07a65b8e8
201
201
msgid "Labels & Control Flow Functions"
204
204
#: ../../source/inc/label:5
205
# c439445d93aa41a69b94c8fb015197a4
205
# 2bf55fc43e6c48d4a4c37e25a0b7bde3
206
206
msgid "This code creates a new context, and starts executing code from that label in the new context. Rollback is disabled in the new context. (Actually, it will just bring you back to the real context.)"
209
209
#: ../../source/inc/label:10
210
210
#: ../../source/inc/label:41
211
# 54f1641285104229a322c642981724a0
212
# e7526cf7caf5478381c4d78070e5ee2a
211
# 0afe7453564849c2b3bc1976b3210b24
212
# ab8285980ee24ab48dec113218b65f85
213
213
msgid "Use this to begin a second interaction with the user while inside an interaction."
216
216
#: ../../source/inc/label:15
217
# aa08a4b698b040a0b3066c929e054024
217
# 3a37fc2fcd9f47f185adb41e1ffa752d
218
218
msgid "Returns the set of all labels defined in the program, including labels defined for internal use in the libraries."
221
221
#: ../../source/inc/label:20
222
# 36f78881113b4eadbac4fd9cd75747f3
222
# 1c7aa83ba05c492dae3ac7a13539cb50
223
223
msgid "Returns true if name is a valid label in the program, or false otherwise."
226
226
#: ../../source/inc/label:25
227
# 765e7f14e2934b59924a47b44288597d
227
# de9072896e0748359900c846f8e8189b
228
228
msgid "This pushes the current context, and invokes the given python function in a new context. When that function returns or raises an exception, it removes the new context, and restores the current context."
231
231
#: ../../source/inc/label:30
232
# baf00ecddd2f40939090e8ab8af25eae
232
# 16e18cd994ff47d3877325bcbffce78f
233
233
msgid "Additional arguments and keyword arguments are passed to the callable."
236
236
#: ../../source/inc/label:33
237
# bb2cba6c75f34638a82a92223667bc54
237
# 64d9c65f028f47248b31690c64d25a01
238
238
msgid "Please note that the context so created cannot execute renpy code. So exceptions that change the flow of renpy code (like the one created by renpy.jump) cause this context to terminate, and are handled by the next higher context."
241
241
#: ../../source/inc/label:38
242
# 486452a1247747dba8a38e598b3fd19a
242
# 691813d6006747d696a74c9a636564ad
243
243
msgid "If you want to execute renpy code from the function, you can call it with renpy.call_in_new_context."
246
246
#: ../../source/inc/label:46
247
# 49a4af90a806423fb9f94ef76045c2eb
247
# f65f58c63732472a9823d881859f86b8
248
248
msgid "Causes control to leave the current context, and then to be transferred in the parent context to the given label."
251
251
#: ../../source/inc/label:51
252
# f31ca76eedf3412e84ba99c749734466
252
# f2fdc6ede6a24a01a5f7a4b628777bdc
253
253
msgid "Returns true if the named label has executed at least once on the current user's system, and false otherwise. This can be used to unlock scene galleries, for example."