-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport_presets.cfg
131 lines (114 loc) · 4.16 KB
/
export_presets.cfg
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
[preset.0]
name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="Export/index.html"
script_export_mode=1
script_encryption_key=""
[preset.0.options]
custom_template/debug=""
custom_template/release=""
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/export_icon=true
html/custom_html_shell=""
html/head_include="<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js\"></script>
<script>
engine.addInterface(\"jspdf\", jspdf);
function print(jsonString) {
const { jsPDF } = window.jspdf;
const doc = new jsPDF();
const data = JSON.parse(jsonString);
doc.addImage('./assets/HNU.png', 'png', 150, 0, 48, 32);
let currentY = 10;
doc.setFontSize(26);
doc.setFont(undefined, 'italic');
doc.text('Get your game on - Results', 10, currentY);
currentY += 10;
doc.setFont(undefined, 'bold');
doc.text(data.Name || '', 10, currentY);
doc.setFont(undefined, 'normal');
currentY += 10;
doc.setFontSize(20);
let specName = data.SelectedSpecialization.replace(\"_\", \" \");
doc.text(specName || '', 10, currentY);
currentY += 10;
doc.setFontSize(16);
doc.text(data.TotalTime || '', 10, currentY);
currentY += 10;
doc.text('Total Points: ' + data.TotalPoints || '', 10, currentY);
doc.text('Decorations found: ' + data.Decorations || '', 60, currentY);
currentY += 15;
if (!Array.isArray(data.Categories)) {
console.error('Data.Categories is not an array');
return;
}
var categoryCount = 0;
var currentX = 0;
data.Categories.forEach((category, index) => {
if (categoryCount >= 3) {
currentX = 100;
if (categoryCount == 3) {
currentY = 65;
}
}
console.log('Category.Items:', category.Items);
doc.setFontSize(16);
doc.setFont(undefined, 'bold');
doc.text(category.Title || '', currentX + 30, currentY);
doc.setFont(undefined, 'normal');
// Use addImage method to directly add images from URL
let fileName = category.Title.replace(\" \", \"_\");
doc.addImage('./assets/' + fileName + '.png', 'png', currentX + 10, currentY - 12, 16, 16);
currentY += 7;
categoryCount++;
category.Items.forEach((item, index) => {
doc.setFontSize(12);
doc.text((item.Title || '') + ': ' + (item.Text || ''), currentX + 30, currentY);
currentY += 7;
});
currentY += 7; // Bit more space between categories
});
currentY += 5;
doc.addImage('./assets/Art.png', 'png', 10, currentY - 12, 16, 16);
doc.setFontSize(16);
doc.setFont(undefined, 'bold');
doc.text('Art', 30, currentY);
doc.setFont(undefined, 'normal');
currentY += 7;
doc.setFontSize(12);
doc.text('8 pages uploaded.', 30, currentY);
doc.setFontSize(24);
doc.setFont(undefined, 'bold');
doc.text('Best: ' + data.BestName, 50, currentY + 20);
doc.setFont(undefined, 'normal');
doc.setFontSize(18);
doc.text('Points: ' + data.BestPoints, 50, currentY + 30);
// Use addImage method to directly add images from URL
let bestFileName = data.BestName.replace(\" \", \"_\");
doc.addImage('./assets/' + bestFileName + '.png', 'png', 10, currentY + 10, 24, 24);
doc.setFontSize(10);
doc.setTextColor(200, 200, 200); // Set text color to light gray
doc.text(data.Hash, 10, doc.internal.pageSize.getHeight() - 10);
const now = new Date();
const dateTimeString = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + '_' + now.getHours() + '-' + now.getMinutes() + '-' + now.getSeconds();
doc.save((data.Name || 'output') + '_' + dateTimeString + '.pdf');
}
</script>
"
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false
progressive_web_app/enabled=false
progressive_web_app/offline_page=""
progressive_web_app/display=1
progressive_web_app/orientation=0
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color( 0, 0, 0, 1 )