-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathTranslator.tscn
349 lines (304 loc) · 10.1 KB
/
Translator.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
[gd_scene load_steps=11 format=2]
[ext_resource path="res://Translator.gd" type="Script" id=1]
[ext_resource path="res://output_btns.tres" type="ButtonGroup" id=2]
[ext_resource path="res://fonts/noto_sans_ui_bold.tres" type="DynamicFontData" id=3]
[ext_resource path="res://fonts/noto_sans_ui_regular.tres" type="DynamicFontData" id=4]
[ext_resource path="res://fonts/hack_regular.tres" type="DynamicFontData" id=5]
[sub_resource type="DynamicFont" id=1]
size = 14
font_data = ExtResource( 4 )
[sub_resource type="Theme" id=2]
default_font = SubResource( 1 )
[sub_resource type="DynamicFont" id=3]
size = 14
font_data = ExtResource( 3 )
[sub_resource type="DynamicFont" id=4]
size = 14
font_data = ExtResource( 5 )
[sub_resource type="GDScript" id=5]
script/source = "extends AcceptDialog
func _ready():
call_deferred(\"popup_centered\")
"
[node name="UI" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = SubResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Editor" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 4.0
margin_right = -4.0
margin_bottom = -4.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
bug_report_popup = NodePath("../BugReport")
about_popup = NodePath("../AcceptDialog")
paste_bug = NodePath("../PasteBug")
[node name="Controls" type="HBoxContainer" parent="Editor"]
margin_right = 1016.0
margin_bottom = 40.0
[node name="CSharp" type="CheckButton" parent="Editor/Controls"]
margin_right = 150.0
margin_bottom = 40.0
pressed = true
text = "Output C#"
[node name="Docs" type="CheckButton" parent="Editor/Controls"]
margin_left = 154.0
margin_right = 291.0
margin_bottom = 40.0
text = "For Docs"
[node name="EscapeXML" type="CheckButton" parent="Editor/Controls"]
margin_left = 295.0
margin_right = 454.0
margin_bottom = 40.0
text = "Escape XML"
[node name="GDScript" type="CheckButton" parent="Editor/Controls"]
visible = false
margin_left = 163.0
margin_right = 354.0
margin_bottom = 40.0
group = ExtResource( 2 )
text = "Output GDScript"
[node name="Indention" type="SpinBox" parent="Editor/Controls"]
margin_left = 458.0
margin_right = 532.0
margin_bottom = 40.0
max_value = 10.0
suffix = "Tabs"
[node name="BeDumb" type="CheckButton" parent="Editor/Controls"]
visible = false
margin_left = 536.0
margin_right = 678.0
margin_bottom = 40.0
group = ExtResource( 2 )
text = "Be Dumb"
[node name="Regenerate" type="Button" parent="Editor/Controls"]
margin_left = 536.0
margin_right = 626.0
margin_bottom = 40.0
text = "Regenerate"
[node name="ReportBug" type="Button" parent="Editor/Controls"]
margin_left = 630.0
margin_right = 718.0
margin_bottom = 40.0
text = "Report Bug"
[node name="Paste" type="Button" parent="Editor/Controls"]
margin_left = 722.0
margin_right = 865.0
margin_bottom = 40.0
text = "Paste doesn't work?"
[node name="About" type="Button" parent="Editor/Controls"]
margin_left = 869.0
margin_right = 921.0
margin_bottom = 40.0
text = "About"
[node name="HSplitContainer" type="HSplitContainer" parent="Editor"]
margin_top = 44.0
margin_right = 1016.0
margin_bottom = 592.0
size_flags_horizontal = 3
size_flags_vertical = 3
split_offset = 447
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Source" type="VBoxContainer" parent="Editor/HSplitContainer"]
margin_right = 494.0
margin_bottom = 548.0
[node name="Label" type="Label" parent="Editor/HSplitContainer/Source"]
margin_right = 494.0
margin_bottom = 20.0
custom_fonts/font = SubResource( 3 )
text = "Source"
align = 1
valign = 1
[node name="Source" type="TextEdit" parent="Editor/HSplitContainer/Source"]
margin_top = 24.0
margin_right = 494.0
margin_bottom = 548.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_fonts/font = SubResource( 4 )
custom_colors/safe_line_number_color = Color( 0.921569, 0.580392, 0.2, 1 )
custom_constants/line_spacing = 6
text = "class_name Example, \"res://path.png\"
extends Node
var aes = AESContext.new()
func _ready():
var key = \"My secret key!!!\" # Key must be either 16 or 32 bytes.
var data = \"My secret text!!\" # Data size must be multiple of 16 bytes, apply padding if needed.
var test := 1
# Encrypt ECB
aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8())
var encrypted = aes.update(data.to_utf8())
aes.finish()
# Decrypt ECB
aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8())
var decrypted = aes.update(encrypted)
aes.finish()
# Check ECB
assert(decrypted == data.to_utf8())
var iv = \"My secret iv!!!!\" # IV must be of exactly 16 bytes.
# Encrypt CBC
aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8(), iv.to_utf8())
encrypted = aes.update(data.to_utf8())
aes.finish()
# Decrypt CBC
aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8(), iv.to_utf8())
decrypted = aes.update(encrypted)
aes.finish()
# Check CBC
assert(decrypted == data.to_utf8())
if x:
print(\"x is true\")
elif x == 1:
print(\"x is 1\");
else:
print(\"x is not...\")
"
highlight_current_line = true
syntax_highlighting = true
show_line_numbers = true
draw_tabs = true
draw_spaces = true
breakpoint_gutter = true
fold_gutter = true
highlight_all_occurrences = true
smooth_scrolling = true
wrap_enabled = true
caret_blink = true
caret_blink_speed = 0.5
[node name="VSplitContainer" type="VSplitContainer" parent="Editor/HSplitContainer"]
margin_left = 506.0
margin_right = 1016.0
margin_bottom = 548.0
split_offset = 300
[node name="Output" type="VBoxContainer" parent="Editor/HSplitContainer/VSplitContainer"]
margin_right = 510.0
margin_bottom = 324.0
[node name="Label" type="Label" parent="Editor/HSplitContainer/VSplitContainer/Output"]
margin_right = 510.0
margin_bottom = 20.0
custom_fonts/font = SubResource( 3 )
text = "Output"
align = 1
valign = 1
[node name="Output" type="TextEdit" parent="Editor/HSplitContainer/VSplitContainer/Output"]
margin_top = 24.0
margin_right = 510.0
margin_bottom = 324.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_fonts/font = SubResource( 4 )
custom_constants/line_spacing = 6
readonly = true
syntax_highlighting = true
show_line_numbers = true
draw_tabs = true
draw_spaces = true
smooth_scrolling = true
caret_blink = true
caret_blink_speed = 0.5
[node name="Warnings" type="VBoxContainer" parent="Editor/HSplitContainer/VSplitContainer"]
margin_top = 336.0
margin_right = 510.0
margin_bottom = 548.0
[node name="Label" type="Label" parent="Editor/HSplitContainer/VSplitContainer/Warnings"]
margin_right = 510.0
margin_bottom = 20.0
custom_fonts/font = SubResource( 3 )
text = "Warnings"
align = 1
valign = 1
[node name="Warnings" type="TextEdit" parent="Editor/HSplitContainer/VSplitContainer/Warnings"]
margin_top = 24.0
margin_right = 510.0
margin_bottom = 212.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_fonts/font = SubResource( 4 )
custom_constants/line_spacing = 6
readonly = true
syntax_highlighting = true
smooth_scrolling = true
caret_blink = true
caret_blink_speed = 0.5
[node name="AcceptDialog" type="AcceptDialog" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -312.0
margin_top = -139.0
margin_right = 312.0
margin_bottom = 139.0
popup_exclusive = true
window_title = "Attention"
dialog_text = "This tool was written to ease the code documentation process in Godot. It translates GDScript to C# and can be used to escape XML Characters.
However, there are likely bugs in this tool leading to wrong C# code or not completly idiomatic C# code. You should proofread the output and fix it. As this tool is still in development feel free to open issues with the input, output, and desired output.
Again:
PROOFREAD THE CODE! Don't blame me for wrong C# Code in your PRs.
Current Version: %s
Developed by Johannes Witt (HaSa1002)
Source Code is in the Public Domain and available on GitHub
"
dialog_autowrap = true
script = SubResource( 5 )
[node name="BugReport" type="AcceptDialog" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -312.0
margin_top = -139.0
margin_right = 312.0
margin_bottom = 126.0
popup_exclusive = true
window_title = "Bug Report"
dialog_text = "The bug reports sometimes don't open correctly.
Did your browser opened a new tab?
If not you can copy the link to the clipboard.
The link contains your used version, the source code, the output, and the warnings. Please don't forget to fill out the \"Expected Output\".
Thank You <3
GitHub Issues: %s
Version: %s"
dialog_autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PasteBug" type="AcceptDialog" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -214.0
margin_top = -132.5
margin_right = 214.0
margin_bottom = 132.5
popup_exclusive = true
window_title = "Paste Bug Workaround"
dialog_text = "Because of security reasons, it is in some browsers not possible to access the clipboard in Godot. You have two options:
1) Use a chromium based browser (Chrome, Chromium, Edge, Opera)
2) Navigate to Edit -> Paste and then press Ctrl + V"
dialog_autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="toggled" from="Editor/Controls/CSharp" to="Editor" method="_on_Control_Button_toggled"]
[connection signal="toggled" from="Editor/Controls/Docs" to="Editor" method="_on_Control_Button_toggled"]
[connection signal="toggled" from="Editor/Controls/EscapeXML" to="Editor" method="_on_Control_Button_toggled"]
[connection signal="toggled" from="Editor/Controls/GDScript" to="Editor" method="_on_Control_Button_toggled"]
[connection signal="value_changed" from="Editor/Controls/Indention" to="Editor" method="_on_Indention_value_changed"]
[connection signal="toggled" from="Editor/Controls/BeDumb" to="Editor" method="_on_Control_Button_toggled"]
[connection signal="pressed" from="Editor/Controls/Regenerate" to="Editor" method="_on_Regenerate_pressed"]
[connection signal="pressed" from="Editor/Controls/ReportBug" to="Editor" method="_on_ReportBug_pressed"]
[connection signal="pressed" from="Editor/Controls/Paste" to="Editor" method="_on_Paste_pressed"]
[connection signal="pressed" from="Editor/Controls/About" to="Editor" method="_on_About_pressed"]
[connection signal="text_changed" from="Editor/HSplitContainer/Source/Source" to="Editor" method="_on_Source_text_changed"]