Commit bf81484d7fa32e4e3769a45fafff29d69d2609da

Authored by DarkGod
2 parents 1ce5617b 818eb45e

Merge branch 'master' into newphantasm

Showing 90 changed files with 1164 additions and 667 deletions

Too many changes to show.

To preserve performance only 90 of 90+ files are displayed.

... ... @@ -7,6 +7,10 @@ divx2pass.log
7 7 game/addons/**
8 8 game/dlcs/**
9 9 obj/**
  10 +/lib64
  11 +/t-engine64
  12 +/tmp
  13 +/diff.diff
10 14 out.avi
11 15 out.ogv
12 16 te4_log_web.txt
... ... @@ -23,3 +27,13 @@ steam_appid.txt
23 27 oprofile_data/
24 28 game/modules/tome/data/gfx/ts-gfx*
25 29 game/engines/default/modules/boot/data/gfx/ts-gfx*
  30 +debug-recompile.sh
  31 +profiling-recompile.sh
  32 +recompile.sh
  33 +*.exe
  34 +*.dll
  35 +/*.so
  36 +te4_log.txt
  37 +debug.log
  38 +/.idea/
  39 +/*.log
\ No newline at end of file
... ...
... ... @@ -26,6 +26,9 @@ newPackage{ id = "basic", name = "Basic", weight = 1,
26 26 bignews = {font="/data/font/VeraMono.ttf", normal=30},
27 27 resources_normal = {font="/data/font/Vera.ttf", bold=true, normal=12},
28 28 resources_small = {font="/data/font/Vera.ttf", bold=true, normal=10},
  29 + classic = {font="/data/font/Vera.ttf", normal=12, small=10, big=14},
  30 + classic_mono = {font="/data/font/VeraMono.ttf", normal=12, small=10, big=14},
  31 + insular = {font="/data/font/INSULA__.ttf", normal=14, small=12, big=16},
29 32 }
30 33
31 34 newPackage{ id = "web", name = "Web", weight = 10,
... ... @@ -39,6 +42,9 @@ newPackage{ id = "web", name = "Web", weight = 10,
39 42 bignews = {font="/data/font/DroidSansMono.ttf", normal=30},
40 43 resources_normal = {font="/data/font/DroidSans.ttf", bold=true, normal=12},
41 44 resources_small = {font="/data/font/DroidSans.ttf", bold=true, normal=10},
  45 + classic = {font="/data/font/USENET_.ttf", normal=16, small=14, big=18},
  46 + classic_mono = {font="/data/font/SVBasicManual.ttf", normal=14, small=10, big=16},
  47 + insular = {font="/data/font/INSULA__.ttf", normal=14, small=12, big=16},
42 48 }
43 49
44 50 newPackage{ id = "fantasy", name = "Fantasy", weight = 100,
... ... @@ -51,4 +57,22 @@ newPackage{ id = "fantasy", name = "Fantasy", weight = 100,
51 57 bignews = {font="/data/font/Salsa-Regular.ttf", normal=30},
52 58 resources_normal = {font="/data/font/Salsa-Regular.ttf", normal=14},
53 59 resources_small = {font="/data/font/Salsa-Regular.ttf", normal=12},
  60 + classic = {font="/data/font/USENET_.ttf", normal=16, small=14, big=18},
  61 + classic_mono = {font="/data/font/SVBasicManual.ttf", normal=14, small=10, big=16},
  62 + insular = {font="/data/font/INSULA__.ttf", normal=14, small=12, big=16},
  63 +}
  64 +
  65 +
  66 +newPackage{ id = "chinese", name = "Chinese", weight = 100,
  67 + small = {font="/data/font/WenQuanYiMicroHei.ttf", normal=12, small=10, big=14},
  68 + default = {font="/data/font/WenQuanYiMicroHei.ttf", normal=16, small=12, big=18},
  69 + bold = {font="/data/font/WenQuanYiMicroHei.ttf", normal=16, small=12, big=18},
  70 + mono = {font="/data/font/WenQuanYiMicroHeiMono.ttf", normal=16, small=12, big=18},
  71 + mono_small = {font="/data/font/WenQuanYiMicroHeiMono.ttf", normal=14, small=10, big=16},
  72 + flyer = {font="/data/font/WenQuanYiMicroHei.ttf", normal=14, small=12, big=16},
  73 + bignews = {font="/data/font/WenQuanYiMicroHei.ttf", normal=30},
  74 + resources_normal = {font="/data/font/WenQuanYiMicroHei.ttf", normal=16},
  75 + resources_small = {font="/data/font/WenQuanYiMicroHei.ttf", normal=14},
  76 + classic = {font="/data/font/WenQuanYiMicroHei.ttf", normal=16, small=14, big=18},
  77 + classic_mono = {font="/data/font/WenQuanYiMicroHeiMono.ttf", normal=14, small=10, big=16},
54 78 }
... ...
... ... @@ -21,109 +21,109 @@ defineAction{
21 21 default = { "uni:<", "uni:>" },
22 22 type = "CHANGE_LEVEL",
23 23 group = "actions",
24   - name = "Go to next/previous level",
  24 + name = _t"Go to next/previous level",
25 25 }
26 26
27 27 defineAction{
28 28 default = { "sym:=p:false:false:false:false", "sym:=g:false:true:false:false" },
29 29 type = "LEVELUP",
30 30 group = "actions",
31   - name = "Levelup window",
  31 + name = _t"Levelup window",
32 32 }
33 33 defineAction{
34 34 default = { "sym:=m:false:false:false:false" },
35 35 type = "USE_TALENTS",
36 36 group = "actions",
37   - name = "Use talents",
  37 + name = _t"Use talents",
38 38 }
39 39
40 40 defineAction{
41 41 default = { "sym:=j:false:false:false:false", "sym:_q:true:false:false:false" },
42 42 type = "SHOW_QUESTS",
43 43 group = "actions",
44   - name = "Show quests",
  44 + name = _t"Show quests",
45 45 }
46 46
47 47 defineAction{
48 48 default = { "sym:=r:false:false:false:false", "sym:=r:false:true:false:false" },
49 49 type = "REST",
50 50 group = "actions",
51   - name = "Rest for a while",
  51 + name = _t"Rest for a while",
52 52 }
53 53
54 54 defineAction{
55 55 default = { "sym:_s:true:false:false:false" },
56 56 type = "SAVE_GAME",
57 57 group = "actions",
58   - name = "Save game",
  58 + name = _t"Save game",
59 59 }
60 60
61 61 defineAction{
62 62 default = { "sym:_x:true:false:false:false" },
63 63 type = "QUIT_GAME",
64 64 group = "actions",
65   - name = "Quit game",
  65 + name = _t"Quit game",
66 66 }
67 67
68 68 defineAction{
69 69 default = { "sym:_t:false:true:false:false" },
70 70 type = "TACTICAL_DISPLAY",
71 71 group = "actions",
72   - name = "Tactical display on/off",
  72 + name = _t"Tactical display on/off",
73 73 }
74 74
75 75 defineAction{
76 76 default = { "sym:=l:false:false:false:false" },
77 77 type = "LOOK_AROUND",
78 78 group = "actions",
79   - name = "Look around",
  79 + name = _t"Look around",
80 80 }
81 81
82 82 defineAction{
83 83 default = { "sym:_HOME:true:false:false:false"},
84 84 type = "CENTER_ON_PLAYER",
85 85 group = "actions",
86   - name = "Center the view on the player",
  86 + name = _t"Center the view on the player",
87 87 }
88 88
89 89 defineAction{
90 90 default = { "sym:_TAB:false:false:false:false" },
91 91 type = "TOGGLE_MINIMAP",
92 92 group = "actions",
93   - name = "Toggle minimap",
  93 + name = _t"Toggle minimap",
94 94 }
95 95
96 96 defineAction{
97 97 default = { "sym:=t:true:false:false:false" },
98 98 type = "SHOW_TIME",
99 99 group = "actions",
100   - name = "Show game calendar",
  100 + name = _t"Show game calendar",
101 101 }
102 102
103 103 defineAction{
104 104 default = { "sym:=c:false:false:false:false", "sym:=c:false:true:false:false" },
105 105 type = "SHOW_CHARACTER_SHEET",
106 106 group = "actions",
107   - name = "Show character sheet",
  107 + name = _t"Show character sheet",
108 108 }
109 109
110 110 defineAction{
111 111 default = { "sym:_s:false:false:true:false" },
112 112 type = "SWITCH_GFX",
113 113 group = "actions",
114   - name = "Switch graphical modes",
  114 + name = _t"Switch graphical modes",
115 115 }
116 116
117 117 defineAction{
118 118 default = { "sym:_RETURN:false:false:false:false", "sym:_KP_ENTER:false:false:false:false" },
119 119 type = "ACCEPT",
120 120 group = "actions",
121   - name = "Accept action",
  121 + name = _t"Accept action",
122 122 }
123 123
124 124 defineAction{
125 125 default = { "sym:_ESCAPE:false:false:false:false" },
126 126 type = "EXIT",
127 127 group = "actions",
128   - name = "Exit menu",
  128 + name = _t"Exit menu",
129 129 }
... ...
... ... @@ -21,19 +21,19 @@ defineAction{
21 21 default = { "sym:_SPACE:false:false:false:false" },
22 22 type = "USERCHAT_TALK",
23 23 group = "user chat",
24   - name = "Talk to people",
  24 + name = _t"Talk to people",
25 25 }
26 26
27 27 defineAction{
28 28 default = { "sym:_SPACE:true:false:false:false" },
29 29 type = "USERCHAT_SHOW_TALK",
30 30 group = "user chat",
31   - name = "Display chat log",
  31 + name = _t"Display chat log",
32 32 }
33 33
34 34 defineAction{
35 35 default = { "sym:_SPACE:false:true:false:false" },
36 36 type = "USERCHAT_SWITCH_CHANNEL",
37 37 group = "user chat",
38   - name = "Cycle chat channels",
  38 + name = _t"Cycle chat channels",
39 39 }
... ...
... ... @@ -21,7 +21,7 @@ defineAction{
21 21 default = { "sym:_l:true:false:false:false" },
22 22 type = "LUA_CONSOLE",
23 23 group = "debug",
24   - name = "Show Lua console",
  24 + name = _t"Show Lua console",
25 25 only_on_cheat = true,
26 26 }
27 27
... ... @@ -29,6 +29,6 @@ defineAction{
29 29 default = { "sym:_a:true:false:false:false" },
30 30 type = "DEBUG_MODE",
31 31 group = "debug",
32   - name = "Debug Mode",
  32 + name = _t"Debug Mode",
33 33 only_on_cheat = true,
34 34 }
... ...
... ... @@ -22,73 +22,73 @@ defineAction{
22 22 default = { "sym:_1:false:false:false:false" },
23 23 type = "HOTKEY_1",
24 24 group = "hotkeys",
25   - name = "Hotkey 1",
  25 + name = _t"Hotkey 1",
26 26 }
27 27 defineAction{
28 28 default = { "sym:_2:false:false:false:false" },
29 29 type = "HOTKEY_2",
30 30 group = "hotkeys",
31   - name = "Hotkey 2",
  31 + name = _t"Hotkey 2",
32 32 }
33 33 defineAction{
34 34 default = { "sym:_3:false:false:false:false" },
35 35 type = "HOTKEY_3",
36 36 group = "hotkeys",
37   - name = "Hotkey 3",
  37 + name = _t"Hotkey 3",
38 38 }
39 39 defineAction{
40 40 default = { "sym:_4:false:false:false:false" },
41 41 type = "HOTKEY_4",
42 42 group = "hotkeys",
43   - name = "Hotkey 4",
  43 + name = _t"Hotkey 4",
44 44 }
45 45 defineAction{
46 46 default = { "sym:_5:false:false:false:false" },
47 47 type = "HOTKEY_5",
48 48 group = "hotkeys",
49   - name = "Hotkey 5",
  49 + name = _t"Hotkey 5",
50 50 }
51 51 defineAction{
52 52 default = { "sym:_6:false:false:false:false" },
53 53 type = "HOTKEY_6",
54 54 group = "hotkeys",
55   - name = "Hotkey 6",
  55 + name = _t"Hotkey 6",
56 56 }
57 57 defineAction{
58 58 default = { "sym:_7:false:false:false:false" },
59 59 type = "HOTKEY_7",
60 60 group = "hotkeys",
61   - name = "Hotkey 7",
  61 + name = _t"Hotkey 7",
62 62 }
63 63 defineAction{
64 64 default = { "sym:_8:false:false:false:false" },
65 65 type = "HOTKEY_8",
66 66 group = "hotkeys",
67   - name = "Hotkey 8",
  67 + name = _t"Hotkey 8",
68 68 }
69 69 defineAction{
70 70 default = { "sym:_9:false:false:false:false" },
71 71 type = "HOTKEY_9",
72 72 group = "hotkeys",
73   - name = "Hotkey 9",
  73 + name = _t"Hotkey 9",
74 74 }
75 75 defineAction{
76 76 default = { "sym:_0:false:false:false:false" },
77 77 type = "HOTKEY_10",
78 78 group = "hotkeys",
79   - name = "Hotkey 10",
  79 + name = _t"Hotkey 10",
80 80 }
81 81 defineAction{
82 82 default = { "sym:_MINUS:false:false:false:false" },
83 83 type = "HOTKEY_11",
84 84 group = "hotkeys",
85   - name = "Hotkey 11",
  85 + name = _t"Hotkey 11",
86 86 }
87 87 defineAction{
88 88 default = { "sym:_EQUALS:false:false:false:false" },
89 89 type = "HOTKEY_12",
90 90 group = "hotkeys",
91   - name = "Hotkey 12",
  91 + name = _t"Hotkey 12",
92 92 }
93 93
94 94 -- Ctrl + Hotkeys
... ... @@ -96,73 +96,73 @@ defineAction{
96 96 default = { "sym:_1:true:false:false:false" },
97 97 type = "HOTKEY_SECOND_1",
98 98 group = "hotkeys",
99   - name = "Secondary Hotkey 1",
  99 + name = _t"Secondary Hotkey 1",
100 100 }
101 101 defineAction{
102 102 default = { "sym:_2:true:false:false:false" },
103 103 type = "HOTKEY_SECOND_2",
104 104 group = "hotkeys",
105   - name = "Secondary Hotkey 2",
  105 + name = _t"Secondary Hotkey 2",
106 106 }
107 107 defineAction{
108 108 default = { "sym:_3:true:false:false:false" },
109 109 type = "HOTKEY_SECOND_3",
110 110 group = "hotkeys",
111   - name = "Secondary Hotkey 3",
  111 + name = _t"Secondary Hotkey 3",
112 112 }
113 113 defineAction{
114 114 default = { "sym:_4:true:false:false:false" },
115 115 type = "HOTKEY_SECOND_4",
116 116 group = "hotkeys",
117   - name = "Secondary Hotkey 4",
  117 + name = _t"Secondary Hotkey 4",
118 118 }
119 119 defineAction{
120 120 default = { "sym:_5:true:false:false:false" },
121 121 type = "HOTKEY_SECOND_5",
122 122 group = "hotkeys",
123   - name = "Secondary Hotkey 5",
  123 + name = _t"Secondary Hotkey 5",
124 124 }
125 125 defineAction{
126 126 default = { "sym:_6:true:false:false:false" },
127 127 type = "HOTKEY_SECOND_6",
128 128 group = "hotkeys",
129   - name = "Secondary Hotkey 6",
  129 + name = _t"Secondary Hotkey 6",
130 130 }
131 131 defineAction{
132 132 default = { "sym:_7:true:false:false:false" },
133 133 type = "HOTKEY_SECOND_7",
134 134 group = "hotkeys",
135   - name = "Secondary Hotkey 7",
  135 + name = _t"Secondary Hotkey 7",
136 136 }
137 137 defineAction{
138 138 default = { "sym:_8:true:false:false:false" },
139 139 type = "HOTKEY_SECOND_8",
140 140 group = "hotkeys",
141   - name = "Secondary Hotkey 8",
  141 + name = _t"Secondary Hotkey 8",
142 142 }
143 143 defineAction{
144 144 default = { "sym:_9:true:false:false:false" },
145 145 type = "HOTKEY_SECOND_9",
146 146 group = "hotkeys",
147   - name = "Secondary Hotkey 9",
  147 + name = _t"Secondary Hotkey 9",
148 148 }
149 149 defineAction{
150 150 default = { "sym:_0:true:false:false:false" },
151 151 type = "HOTKEY_SECOND_10",
152 152 group = "hotkeys",
153   - name = "Secondary Hotkey 10",
  153 + name = _t"Secondary Hotkey 10",
154 154 }
155 155 defineAction{
156 156 default = { "sym:_MINUS:true:false:false:false" },
157 157 type = "HOTKEY_SECOND_11",
158 158 group = "hotkeys",
159   - name = "Secondary Hotkey 11",
  159 + name = _t"Secondary Hotkey 11",
160 160 }
161 161 defineAction{
162 162 default = { "sym:_EQUALS:true:false:false:false" },
163 163 type = "HOTKEY_SECOND_12",
164 164 group = "hotkeys",
165   - name = "Secondary Hotkey 12",
  165 + name = _t"Secondary Hotkey 12",
166 166 }
167 167
168 168 -- Shift + Hotkeys
... ... @@ -170,73 +170,73 @@ defineAction{
170 170 default = { "sym:_1:false:true:false:false" },
171 171 type = "HOTKEY_THIRD_1",
172 172 group = "hotkeys",
173   - name = "Third Hotkey 1",
  173 + name = _t"Third Hotkey 1",
174 174 }
175 175 defineAction{
176 176 default = { "sym:_2:false:true:false:false" },
177 177 type = "HOTKEY_THIRD_2",
178 178 group = "hotkeys",
179   - name = "Third Hotkey 2",
  179 + name = _t"Third Hotkey 2",
180 180 }
181 181 defineAction{
182 182 default = { "sym:_3:false:true:false:false" },
183 183 type = "HOTKEY_THIRD_3",
184 184 group = "hotkeys",
185   - name = "Third Hotkey 3",
  185 + name = _t"Third Hotkey 3",
186 186 }
187 187 defineAction{
188 188 default = { "sym:_4:false:true:false:false" },
189 189 type = "HOTKEY_THIRD_4",
190 190 group = "hotkeys",
191   - name = "Third Hotkey 4",
  191 + name = _t"Third Hotkey 4",
192 192 }
193 193 defineAction{
194 194 default = { "sym:_5:false:true:false:false" },
195 195 type = "HOTKEY_THIRD_5",
196 196 group = "hotkeys",
197   - name = "Third Hotkey 5",
  197 + name = _t"Third Hotkey 5",
198 198 }
199 199 defineAction{
200 200 default = { "sym:_6:false:true:false:false" },
201 201 type = "HOTKEY_THIRD_6",
202 202 group = "hotkeys",
203   - name = "Third Hotkey 6",
  203 + name = _t"Third Hotkey 6",
204 204 }
205 205 defineAction{
206 206 default = { "sym:_7:false:true:false:false" },
207 207 type = "HOTKEY_THIRD_7",
208 208 group = "hotkeys",
209   - name = "Third Hotkey 7",
  209 + name = _t"Third Hotkey 7",
210 210 }
211 211 defineAction{
212 212 default = { "sym:_8:false:true:false:false" },
213 213 type = "HOTKEY_THIRD_8",
214 214 group = "hotkeys",
215   - name = "Third Hotkey 8",
  215 + name = _t"Third Hotkey 8",
216 216 }
217 217 defineAction{
218 218 default = { "sym:_9:false:true:false:false" },
219 219 type = "HOTKEY_THIRD_9",
220 220 group = "hotkeys",
221   - name = "Third Hotkey 9",
  221 + name = _t"Third Hotkey 9",
222 222 }
223 223 defineAction{
224 224 default = { "sym:_0:false:true:false:false" },
225 225 type = "HOTKEY_THIRD_10",
226 226 group = "hotkeys",
227   - name = "Third Hotkey 10",
  227 + name = _t"Third Hotkey 10",
228 228 }
229 229 defineAction{
230 230 default = { "sym:_MINUS:false:true:false:false" },
231 231 type = "HOTKEY_THIRD_11",
232 232 group = "hotkeys",
233   - name = "Third Hotkey 11",
  233 + name = _t"Third Hotkey 11",
234 234 }
235 235 defineAction{
236 236 default = { "sym:_EQUALS:false:true:false:false" },
237 237 type = "HOTKEY_THIRD_12",
238 238 group = "hotkeys",
239   - name = "Third Hotkey 12",
  239 + name = _t"Third Hotkey 12",
240 240 }
241 241
242 242 -- Alt + Hotkeys
... ... @@ -244,73 +244,73 @@ defineAction{
244 244 default = { "sym:_1:false:false:true:false" },
245 245 type = "HOTKEY_FOURTH_1",
246 246 group = "hotkeys",
247   - name = "Fourth Hotkey 1",
  247 + name = _t"Fourth Hotkey 1",
248 248 }
249 249 defineAction{
250 250 default = { "sym:_2:false:false:true:false" },
251 251 type = "HOTKEY_FOURTH_2",
252 252 group = "hotkeys",
253   - name = "Fourth Hotkey 2",
  253 + name = _t"Fourth Hotkey 2",
254 254 }
255 255 defineAction{
256 256 default = { "sym:_3:false:false:true:false" },
257 257 type = "HOTKEY_FOURTH_3",
258 258 group = "hotkeys",
259   - name = "Fourth Hotkey 3",
  259 + name = _t"Fourth Hotkey 3",
260 260 }
261 261 defineAction{
262 262 default = { "sym:_4:false:false:true:false" },
263 263 type = "HOTKEY_FOURTH_4",
264 264 group = "hotkeys",
265   - name = "Fourth Hotkey 4",
  265 + name = _t"Fourth Hotkey 4",
266 266 }
267 267 defineAction{
268 268 default = { "sym:_5:false:false:true:false" },
269 269 type = "HOTKEY_FOURTH_5",
270 270 group = "hotkeys",
271   - name = "Fourth Hotkey 5",
  271 + name = _t"Fourth Hotkey 5",
272 272 }
273 273 defineAction{
274 274 default = { "sym:_6:false:false:true:false" },
275 275 type = "HOTKEY_FOURTH_6",
276 276 group = "hotkeys",
277   - name = "Fourth Hotkey 6",
  277 + name = _t"Fourth Hotkey 6",
278 278 }
279 279 defineAction{
280 280 default = { "sym:_7:false:false:true:false" },
281 281 type = "HOTKEY_FOURTH_7",
282 282 group = "hotkeys",
283   - name = "Fourth Hotkey 7",
  283 + name = _t"Fourth Hotkey 7",
284 284 }
285 285 defineAction{
286 286 default = { "sym:_8:false:false:true:false" },
287 287 type = "HOTKEY_FOURTH_8",
288 288 group = "hotkeys",
289   - name = "Fourth Hotkey 8",
  289 + name = _t"Fourth Hotkey 8",
290 290 }
291 291 defineAction{
292 292 default = { "sym:_9:false:false:true:false" },
293 293 type = "HOTKEY_FOURTH_9",
294 294 group = "hotkeys",
295   - name = "Fourth Hotkey 9",
  295 + name = _t"Fourth Hotkey 9",
296 296 }
297 297 defineAction{
298 298 default = { "sym:_0:false:false:true:false" },
299 299 type = "HOTKEY_FOURTH_10",
300 300 group = "hotkeys",
301   - name = "Fourth Hotkey 10",
  301 + name = _t"Fourth Hotkey 10",
302 302 }
303 303 defineAction{
304 304 default = { "sym:_MINUS:false:false:true:false" },
305 305 type = "HOTKEY_FOURTH_11",
306 306 group = "hotkeys",
307   - name = "Fourth Hotkey 11",
  307 + name = _t"Fourth Hotkey 11",
308 308 }
309 309 defineAction{
310 310 default = { "sym:_EQUALS:false:false:true:false" },
311 311 type = "HOTKEY_FOURTH_12",
312 312 group = "hotkeys",
313   - name = "Fourth Hotkey 12",
  313 + name = _t"Fourth Hotkey 12",
314 314 }
315 315
316 316 -- Alt + Shift + Hotkeys
... ... @@ -318,86 +318,86 @@ defineAction{
318 318 default = { "sym:_1:false:true:true:false" },
319 319 type = "HOTKEY_FIFTH_1",
320 320 group = "hotkeys",
321   - name = "Fifth Hotkey 1",
  321 + name = _t"Fifth Hotkey 1",
322 322 }
323 323 defineAction{
324 324 default = { "sym:_2:false:true:true:false" },
325 325 type = "HOTKEY_FIFTH_2",
326 326 group = "hotkeys",
327   - name = "Fifth Hotkey 2",
  327 + name = _t"Fifth Hotkey 2",
328 328 }
329 329 defineAction{
330 330 default = { "sym:_3:false:true:true:false" },
331 331 type = "HOTKEY_FIFTH_3",
332 332 group = "hotkeys",
333   - name = "Fifth Hotkey 3",
  333 + name = _t"Fifth Hotkey 3",
334 334 }
335 335 defineAction{
336 336 default = { "sym:_4:false:true:true:false" },
337 337 type = "HOTKEY_FIFTH_4",
338 338 group = "hotkeys",
339   - name = "Fifth Hotkey 4",
  339 + name = _t"Fifth Hotkey 4",
340 340 }
341 341 defineAction{
342 342 default = { "sym:_5:false:true:true:false" },
343 343 type = "HOTKEY_FIFTH_5",
344 344 group = "hotkeys",
345   - name = "Fifth Hotkey 5",
  345 + name = _t"Fifth Hotkey 5",
346 346 }
347 347 defineAction{
348 348 default = { "sym:_6:false:true:true:false" },
349 349 type = "HOTKEY_FIFTH_6",
350 350 group = "hotkeys",
351   - name = "Fifth Hotkey 6",
  351 + name = _t"Fifth Hotkey 6",
352 352 }
353 353 defineAction{
354 354 default = { "sym:_7:false:true:true:false" },
355 355 type = "HOTKEY_FIFTH_7",
356 356 group = "hotkeys",
357   - name = "Fifth Hotkey 7",
  357 + name = _t"Fifth Hotkey 7",
358 358 }
359 359 defineAction{
360 360 default = { "sym:_8:false:true:true:false" },
361 361 type = "HOTKEY_FIFTH_8",
362 362 group = "hotkeys",
363   - name = "Fifth Hotkey 8",
  363 + name = _t"Fifth Hotkey 8",
364 364 }
365 365 defineAction{
366 366 default = { "sym:_9:false:true:true:false" },
367 367 type = "HOTKEY_FIFTH_9",
368 368 group = "hotkeys",
369   - name = "Fifth Hotkey 9",
  369 + name = _t"Fifth Hotkey 9",
370 370 }
371 371 defineAction{
372 372 default = { "sym:_0:false:true:true:false" },
373 373 type = "HOTKEY_FIFTH_10",
374 374 group = "hotkeys",
375   - name = "Fifth Hotkey 10",
  375 + name = _t"Fifth Hotkey 10",
376 376 }
377 377 defineAction{
378 378 default = { "sym:_MINUS:false:true:true:false" },
379 379 type = "HOTKEY_FIFTH_11",
380 380 group = "hotkeys",
381   - name = "Fifth Hotkey 11",
  381 + name = _t"Fifth Hotkey 11",
382 382 }
383 383 defineAction{
384 384 default = { "sym:_EQUALS:false:true:true:false" },
385 385 type = "HOTKEY_FIFTH_12",
386 386 group = "hotkeys",
387   - name = "Fifth Hotkey 12",
  387 + name = _t"Fifth Hotkey 12",
388 388 }
389 389
390 390 defineAction{
391 391 default = { "sym:_PAGEUP:false:false:false:false" },
392 392 type = "HOTKEY_PREV_PAGE",
393 393 group = "hotkeys",
394   - name = "Previous Hotkey Page",
  394 + name = _t"Previous Hotkey Page",
395 395 }
396 396 defineAction{
397 397 default = { "sym:_PAGEDOWN:false:false:false:false" },
398 398 type = "HOTKEY_NEXT_PAGE",
399 399 group = "hotkeys",
400   - name = "Next Hotkey Page",
  400 + name = _t"Next Hotkey Page",
401 401 }
402 402
403 403 defineAction{
... ... @@ -406,7 +406,7 @@ defineAction{
406 406 updown = true,
407 407 single_key = true,
408 408 group = "hotkeys",
409   - name = "Quick switch to Hotkey Page 2",
  409 + name = _t"Quick switch to Hotkey Page 2",
410 410 }
411 411 defineAction{
412 412 default = { "sym:_LSHIFT:false:false:false:false" },
... ... @@ -414,5 +414,5 @@ defineAction{
414 414 updown = true,
415 415 single_key = true,
416 416 group = "hotkeys",
417   - name = "Quick switch to Hotkey Page 3",
  417 + name = _t"Quick switch to Hotkey Page 3",
418 418 }
... ...
... ... @@ -21,33 +21,33 @@ defineAction{
21 21 default = { "sym:_TAB:true:false:false:false" },
22 22 type = "TOGGLE_NPC_LIST",
23 23 group = "actions",
24   - name = "Toggle list of seen creatures",
  24 + name = _t"Toggle list of seen creatures",
25 25 }
26 26
27 27 defineAction{
28 28 default = { "sym:=h:false:false:false:false", "sym:=m:true:false:false:false" },
29 29 type = "SHOW_MESSAGE_LOG",
30 30 group = "actions",
31   - name = "Show message log",
  31 + name = _t"Show message log",
32 32 }
33 33
34 34 defineAction{
35 35 default = { "sym:_PRINTSCREEN:false:false:false:false" },
36 36 type = "SCREENSHOT",
37 37 group = "actions",
38   - name = "Take a screenshot",
  38 + name = _t"Take a screenshot",
39 39 }
40 40
41 41 defineAction{
42 42 default = { "sym:_TAB:false:false:false:false" },
43 43 type = "SHOW_MAP",
44 44 group = "actions",
45   - name = "Show map",
  45 + name = _t"Show map",
46 46 }
47 47
48 48 defineAction{
49 49 default = { "sym:_CAPSLOCK:false:false:false:false" },
50 50 type = "SCROLL_MAP",
51 51 group = "actions",
52   - name = "Scroll map mode",
  52 + name = _t"Scroll map mode",
53 53 }
... ...
... ... @@ -21,51 +21,51 @@ defineAction{
21 21 default = { "sym:=i:false:false:false:false", },
22 22 type = "SHOW_INVENTORY",
23 23 group = "inventory",
24   - name = "Show inventory",
  24 + name = _t"Show inventory",
25 25 }
26 26 defineAction{
27 27 default = { "sym:=e:false:false:false:false", },
28 28 type = "SHOW_EQUIPMENT",
29 29 group = "inventory",
30   - name = "Show equipment",
  30 + name = _t"Show equipment",
31 31 }
32 32
33 33 defineAction{
34 34 default = { "sym:=g:false:false:false:false" },
35 35 type = "PICKUP_FLOOR",
36 36 group = "inventory",
37   - name = "Pickup items",
  37 + name = _t"Pickup items",
38 38 }
39 39 defineAction{
40 40 default = { "sym:=d:false:false:false:false" },
41 41 type = "DROP_FLOOR",
42 42 group = "inventory",
43   - name = "Drop items",
  43 + name = _t"Drop items",
44 44 }
45 45
46 46 defineAction{
47 47 default = { "sym:=w:false:false:false:false", },
48 48 type = "WEAR_ITEM",
49 49 group = "inventory",
50   - name = "Wield/wear items",
  50 + name = _t"Wield/wear items",
51 51 }
52 52 defineAction{
53 53 default = { "sym:=t:false:false:false:false", },
54 54 type = "TAKEOFF_ITEM",
55 55 group = "inventory",
56   - name = "Takeoff items",
  56 + name = _t"Takeoff items",
57 57 }
58 58
59 59 defineAction{
60 60 default = { "sym:=u:false:false:false:false", },
61 61 type = "USE_ITEM",
62 62 group = "inventory",
63   - name = "Use items",
  63 + name = _t"Use items",
64 64 }
65 65
66 66 defineAction{
67 67 default = { "sym:=q:false:false:false:false", },
68 68 type = "QUICK_SWITCH_WEAPON",
69 69 group = "inventory",
70   - name = "Quick switch weapons set",
  70 + name = _t"Quick switch weapons set",
71 71 }
... ...
... ... @@ -22,56 +22,56 @@ defineAction{
22 22 default = { "sym:_LEFT:false:false:false:false", "sym:_KP_4:false:false:false:false" },
23 23 type = "MOVE_LEFT",
24 24 group = "movement",
25   - name = "Move left",
  25 + name = _t"Move left",
26 26 }
27 27 defineAction{
28 28 default = { "sym:_RIGHT:false:false:false:false", "sym:_KP_6:false:false:false:false" },
29 29 type = "MOVE_RIGHT",
30 30 group = "movement",
31   - name = "Move right",
  31 + name = _t"Move right",
32 32 }
33 33 defineAction{
34 34 default = { "sym:_UP:false:false:false:false", "sym:_KP_8:false:false:false:false" },
35 35 type = "MOVE_UP",
36 36 group = "movement",
37   - name = "Move up",
  37 + name = _t"Move up",
38 38 }
39 39 defineAction{
40 40 default = { "sym:_DOWN:false:false:false:false", "sym:_KP_2:false:false:false:false" },
41 41 type = "MOVE_DOWN",
42 42 group = "movement",
43   - name = "Move down",
  43 + name = _t"Move down",
44 44 }
45 45 defineAction{
46 46 default = { "sym:_KP_7:false:false:false:false" },
47 47 type = "MOVE_LEFT_UP",
48 48 group = "movement",
49   - name = "Move diagonally left and up",
  49 + name = _t"Move diagonally left and up",
50 50 }
51 51 defineAction{
52 52 default = { "sym:_KP_9:false:false:false:false" },
53 53 type = "MOVE_RIGHT_UP",
54 54 group = "movement",
55   - name = "Move diagonally right and up",
  55 + name = _t"Move diagonally right and up",
56 56 }
57 57 defineAction{
58 58 default = { "sym:_KP_1:false:false:false:false" },
59 59 type = "MOVE_LEFT_DOWN",
60 60 group = "movement",
61   - name = "Move diagonally left and down",
  61 + name = _t"Move diagonally left and down",
62 62 }
63 63 defineAction{
64 64 default = { "sym:_KP_3:false:false:false:false" },
65 65 type = "MOVE_RIGHT_DOWN",
66 66 group = "movement",
67   - name = "Move diagonally right and down",
  67 + name = _t"Move diagonally right and down",
68 68 }
69 69
70 70 defineAction{
71 71 default = { "sym:_KP_5:false:false:false:false" },
72 72 type = "MOVE_STAY",
73 73 group = "movement",
74   - name = "Stay for a turn",
  74 + name = _t"Stay for a turn",
75 75 }
76 76
77 77 -- Running
... ... @@ -79,59 +79,85 @@ defineAction{
79 79 default = { "sym:=.:false:false:false:false" },
80 80 type = "RUN",
81 81 group = "movement",
82   - name = "Run",
  82 + name = _t"Run",
83 83 }
84 84 defineAction{
85 85 default = { "sym:_LEFT:false:true:false:false", "sym:_KP_4:false:true:false:false" },
86 86 type = "RUN_LEFT",
87 87 group = "movement",
88   - name = "Run left",
  88 + name = _t"Run left",
89 89 }
90 90 defineAction{
91 91 default = { "sym:_RIGHT:false:true:false:false", "sym:_KP_6:false:true:false:false" },
92 92 type = "RUN_RIGHT",
93 93 group = "movement",
94   - name = "Run right",
  94 + name = _t"Run right",
95 95 }
96 96 defineAction{
97 97 default = { "sym:_UP:false:true:false:false", "sym:_KP_8:false:true:false:false" },
98 98 type = "RUN_UP",
99 99 group = "movement",
100   - name = "Run up",
  100 + name = _t"Run up",
101 101 }
102 102 defineAction{
103 103 default = { "sym:_DOWN:false:true:false:false", "sym:_KP_2:false:true:false:false" },
104 104 type = "RUN_DOWN",
105 105 group = "movement",
106   - name = "Run down",
  106 + name = _t"Run down",
107 107 }
108 108 defineAction{
109 109 default = { "sym:_KP_7:false:true:false:false" },
110 110 type = "RUN_LEFT_UP",
111 111 group = "movement",
112   - name = "Run diagonally left and up",
  112 + name = _t"Run diagonally left and up",
113 113 }
114 114 defineAction{
115 115 default = { "sym:_KP_9:false:true:false:false" },
116 116 type = "RUN_RIGHT_UP",
117 117 group = "movement",
118   - name = "Run diagonally right and up",
  118 + name = _t"Run diagonally right and up",
119 119 }
120 120 defineAction{
121 121 default = { "sym:_KP_1:false:true:false:false" },
122 122 type = "RUN_LEFT_DOWN",
123 123 group = "movement",
124   - name = "Run diagonally left and down",
  124 + name = _t"Run diagonally left and down",
125 125 }
126 126 defineAction{
127 127 default = { "sym:_KP_3:false:true:false:false" },
128 128 type = "RUN_RIGHT_DOWN",
129 129 group = "movement",
130   - name = "Run diagonally right and down",
  130 + name = _t"Run diagonally right and down",
131 131 }
132 132 defineAction{
133 133 default = { "sym:_z:false:false:false:false" },
134 134 type = "RUN_AUTO",
135 135 group = "movement",
136   - name = "Auto-explore",
  136 + name = _t"Auto-explore",
  137 +}
  138 +
  139 +-- Character movements with classic WASD
  140 +defineAction{
  141 + default = { "sym:_a:false:false:false:false", "sym:_LEFT:false:false:false:false" },
  142 + type = "MOVE_WASD_LEFT", updown=true,
  143 + group = _t"movement",
  144 + name = _t"Move left (WASD directions)",
  145 +}
  146 +defineAction{
  147 + default = { "sym:_d:false:false:false:false", "sym:_RIGHT:false:false:false:false" },
  148 + type = "MOVE_WASD_RIGHT", updown=true,
  149 + group = _t"movement",
  150 + name = _t"Move right (WASD directions)",
  151 +}
  152 +defineAction{
  153 + default = { "sym:_w:false:false:false:false", "sym:_UP:false:false:false:false" },
  154 + type = "MOVE_WASD_UP", updown=true,
  155 + group = _t"movement",
  156 + name = _t"Move up (WASD directions)",
  157 +}
  158 +defineAction{
  159 + default = { "sym:_s:false:false:false:false", "sym:_DOWN:false:false:false:false" },
  160 + type = "MOVE_WASD_DOWN", updown=true,
  161 + group = _t"movement",
  162 + name = _t"Move down (WASD directions)",
137 163 }
... ...
... ... @@ -21,7 +21,7 @@ defineAction{
21 21 default = { "sym:_y:true:false:false:false" },
22 22 type = "MTXN_PURCHASE",
23 23 group = "microtransactions - cosmetic",
24   - name = "List purchasable",
  24 + name = _t"List purchasable",
25 25 check = function() return profile:canMTXN() end,
26 26 }
27 27
... ... @@ -29,6 +29,6 @@ defineAction{
29 29 default = { "sym:_y:false:false:true:false" },
30 30 type = "MTXN_USE",
31 31 group = "microtransactions - cosmetic",
32   - name = "Use purchased",
  32 + name = _t"Use purchased",
33 33 check = function() return profile:canMTXN() end,
34 34 }
... ...
... ... @@ -611,3 +611,7 @@ function _M:him_her() return string.him_her(self) end
611 611 --- he/she/self formatting
612 612 -- @return string.his_her_self(self)
613 613 function _M:his_her_self() return string.his_her_self(self) end
  614 +
  615 +function _M:getName()
  616 + return _t(self.name)
  617 +end
\ No newline at end of file
... ...
... ... @@ -108,7 +108,7 @@ function _M:display()
108 108
109 109 local x, y = 0, 0
110 110 for i, a in ipairs(l) do
111   - self.surface:drawColorStringBlended(self.font, ("%s (%d)#WHITE#; distance [%s]"):format(a.name, a.nb, table.concat(a.dist, ",")), x, y, a.color[1], a.color[2], a.color[3])
  111 + self.surface:drawColorStringBlended(self.font, ("%s (%d)#WHITE#; distance [%s]"):tformat(a.name, a.nb, table.concat(a.dist, ",")), x, y, a.color[1], a.color[2], a.color[3])
112 112 y = y + self.font_h
113 113 if y + self.font_h >= self.h then y = 0 x = x + math.floor(self.w / self.nb_cols) end
114 114 end
... ...
... ... @@ -66,7 +66,7 @@ function _M:newBirthDescriptor(t)
66 66 assert(t.type, "no birth type")
67 67 t.short_name = t.short_name or t.name
68 68 t.short_name = t.short_name:upper():gsub("[ ]", "_")
69   - t.display_name = t.display_name or t.name
  69 + t.display_name = t.display_name or _t(t.name, "birth descriptor name")
70 70 assert(t.desc, "no birth description")
71 71 if type(t.desc) == "table" then t.desc = table.concat(t.desc, "\n") end
72 72 t.desc = t.desc:gsub("\n\t+", "\n")
... ... @@ -103,7 +103,7 @@ function _M:init(title, actor, order, at_end, quickbirth, w, h)
103 103 self.order = order
104 104 if order.get_name then
105 105 self.at_end = function()
106   - game:registerDialog(require('engine.dialogs.GetText').new("Enter your character's name", "Name", 2, 25, function(text)
  106 + game:registerDialog(require('engine.dialogs.GetText').new(_t"Enter your character's name", _t"Name", 2, 25, function(text)
107 107 game:setPlayerName(text)
108 108 at_end()
109 109 end, function()
... ... @@ -114,22 +114,22 @@ function _M:init(title, actor, order, at_end, quickbirth, w, h)
114 114 self.at_end = at_end
115 115 end
116 116
117   - Dialog.init(self, title and title or ("Character Creation: "..actor.name), w or 600, h or 400)
  117 + Dialog.init(self, title and title or ("Character Creation: %s"):tformat(actor:getName()), w or 600, h or 400)
118 118
119 119 self.descriptors = {}
120 120 self.descriptors_by_type = {}
121 121
122   - self.c_tut = Textzone.new{width=math.floor(self.iw / 2 - 10), height=1, auto_height=true, no_color_bleed=true, text=[[
  122 + self.c_tut = Textzone.new{width=math.floor(self.iw / 2 - 10), height=1, auto_height=true, no_color_bleed=true, text=_t[[
123 123 Keyboard: #00FF00#up key/down key#FFFFFF# to select an option; #00FF00#Enter#FFFFFF# to accept; #00FF00#Backspace#FFFFFF# to go back.
124 124 Mouse: #00FF00#Left click#FFFFFF# to accept; #00FF00#right click#FFFFFF# to go back.
125 125 ]]}
126 126
127   - self.c_random = Button.new{text="Random", width=math.floor(self.iw / 2 - 40), fct=function() self:randomSelect() end}
128   - self.c_desc = Textzone.new{width=math.floor(self.iw / 2 - 10), height=self.ih - self.c_tut.h - 20, scrollbar=true, no_color_bleed=true, text=""}
  127 + self.c_random = Button.new{text=_t"Random", width=math.floor(self.iw / 2 - 40), fct=function() self:randomSelect() end}
  128 + self.c_desc = Textzone.new{width=math.floor(self.iw / 2 - 10), height=self.ih - self.c_tut.h - 20, scrollbar=true, no_color_bleed=true, text=_t""}
129 129
130 130 self.c_list = ListColumns.new{width=math.floor(self.iw / 2 - 10), height=self.ih - 10 - self.c_random.h, scrollbar=true, all_clicks=true, columns={
131   - {name="", width=8, display_prop="char"},
132   - {name="", width=92, display_prop="display_name"},
  131 + {name=_t"", width=8, display_prop="char"},
  132 + {name=_t"", width=92, display_prop="display_name"},
133 133 }, list={}, fct=function(item, sel, button, event)
134 134 self.sel = sel
135 135 if (event == "key" or event == "button") and button == "left" then self:next()
... ... @@ -178,12 +178,12 @@ function _M:on_register()
178 178 self.do_quickbirth = true
179 179 self:quickBirth()
180 180 else
181   - self:yesnoPopup("Quick Birth", "Do you want to recreate the same character?", function(ret)
  181 + self:yesnoPopup(_t"Quick Birth", _t"Do you want to recreate the same character?", function(ret)
182 182 if ret then
183 183 self.do_quickbirth = true
184 184 self:quickBirth()
185 185 end
186   - end, "Recreate", "New character")
  186 + end, _t"Recreate", _t"New character")
187 187 end
188 188 end
189 189 end
... ...
... ... @@ -67,7 +67,7 @@ end
67 67 function _M:getTimeDate(turn, dstr)
68 68 local doy, year = self:getDayOfYear(turn)
69 69 local hour, min = self:getTimeOfDay(turn)
70   - return (dstr or self.datestring):format(tostring(self:getDayOfMonth(doy)):ordinal(), self:getMonthName(doy), tostring(year):ordinal(), hour, min)
  70 + return (dstr or self.datestring):tformat(tostring(self:getDayOfMonth(doy)):ordinal(), self:getMonthName(doy), tostring(year):ordinal(), hour, min)
71 71 end
72 72
73 73 --- Get what day of the year it is based on turn
... ...
... ... @@ -127,7 +127,7 @@ end
127 127 --- Replace some keywords in the given text
128 128 -- @string text @playername@, @npcname@, @playerdescriptor.(.-)@
129 129 function _M:replace(text)
130   - text = text:gsub("@playername@", self.player.name):gsub("@npcname@", self.npc.name)
131   - text = text:gsub("@playerdescriptor.(.-)@", function(what) return self.player.descriptor["fake_"..what] or self.player.descriptor[what] end)
  130 + text = text:noun_sub("@playername@", self.player:getName()):noun_sub("@npcname@", self.npc.getName and self.npc:getName() or _t(self.npc.name, "entity name"))
  131 + text = text:gsub("@playerdescriptor.(.-)@", function(what) return _t(self.player.descriptor["fake_"..what] or self.player.descriptor[what]) end)
132 132 return text
133 133 end
... ...
... ... @@ -19,6 +19,7 @@
19 19
20 20 require "engine.class"
21 21 require "engine.Dialog"
  22 +local FontPackage = require "engine.FontPackage"
22 23
23 24 --- Debug Console
24 25 -- @classmod engine.DebugConsole
... ... @@ -133,7 +134,7 @@ function _M:init()
133 134 self.blink_period = 20
134 135 self.blink = self.blink_period
135 136 local w, h = core.display.size()
136   - engine.Dialog.init(self, "Lua Console", w, h, 0, 0, nil, core.display.newFont("/data/font/DroidSansMono.ttf", 12))
  137 + engine.Dialog.init(self, _t"Lua Console", w, h, 0, 0, nil, core.display.newFont(FontPackage:getFont("mono"), 12))
137 138 game:onTickEnd(function() self.key:unicodeInput(true) end)
138 139 self:keyCommands{
139 140 _RETURN = function()
... ...
... ... @@ -110,11 +110,11 @@ function _M:yesnoPopup(title, text, fct, yes_text, no_text)
110 110 d.drawDialog = function(self, s)
111 111 s:drawColorStringCentered(self.font, text, 2, 2, self.iw - 2, 25 - 2)
112 112 if d.sel == 0 then
113   - s:drawColorStringCentered(self.font, yes_text or "Yes", 2, 25, self.iw / 2 - 2, 50 - 2, 0, 255, 255)
114   - s:drawColorStringCentered(self.font, no_text or "No", 2 + self.iw / 2, 25, self.iw / 2 - 2, 50 - 2, 255, 255, 255)
  113 + s:drawColorStringCentered(self.font, yes_text or _t"Yes", 2, 25, self.iw / 2 - 2, 50 - 2, 0, 255, 255)
  114 + s:drawColorStringCentered(self.font, no_text or _t"No", 2 + self.iw / 2, 25, self.iw / 2 - 2, 50 - 2, 255, 255, 255)
115 115 else
116   - s:drawColorStringCentered(self.font, yes_text or "Yes", 2, 25, self.iw / 2 - 2, 50 - 2, 255, 255, 255)
117   - s:drawColorStringCentered(self.font, no_text or "No", 2 + self.iw / 2, 25, self.iw / 2 - 2, 50 - 2, 0, 255, 255)
  116 + s:drawColorStringCentered(self.font, yes_text or _t"Yes", 2, 25, self.iw / 2 - 2, 50 - 2, 255, 255, 255)
  117 + s:drawColorStringCentered(self.font, no_text or _t"No", 2 + self.iw / 2, 25, self.iw / 2 - 2, 50 - 2, 0, 255, 255)
118 118 end
119 119 self.changed = false
120 120 end
... ... @@ -157,11 +157,11 @@ function _M:yesnoLongPopup(title, text, w, fct, yes_text, no_text)
157 157 end
158 158
159 159 if d.sel == 0 then
160   - s:drawColorStringCentered(self.font, yes_text or "Yes", 2, 10 + h, self.iw / 2 - 2, 50 - 2, 0, 255, 255)
161   - s:drawColorStringCentered(self.font, no_text or "No", 2 + self.iw / 2, 10 + h, self.iw / 2 - 2, 50 - 2, 255, 255, 255)
  160 + s:drawColorStringCentered(self.font, yes_text or _t"Yes", 2, 10 + h, self.iw / 2 - 2, 50 - 2, 0, 255, 255)
  161 + s:drawColorStringCentered(self.font, no_text or _t"No", 2 + self.iw / 2, 10 + h, self.iw / 2 - 2, 50 - 2, 255, 255, 255)
162 162 else
163   - s:drawColorStringCentered(self.font, yes_text or "Yes", 2, 10 + h, self.iw / 2 - 2, 50 - 2, 255, 255, 255)
164   - s:drawColorStringCentered(self.font, no_text or "No", 2 + self.iw / 2, 10 + h, self.iw / 2 - 2, 50 - 2, 0, 255, 255)
  163 + s:drawColorStringCentered(self.font, yes_text or _t"Yes", 2, 10 + h, self.iw / 2 - 2, 50 - 2, 255, 255, 255)
  164 + s:drawColorStringCentered(self.font, no_text or _t"No", 2 + self.iw / 2, 10 + h, self.iw / 2 - 2, 50 - 2, 0, 255, 255)
165 165 end
166 166 self.changed = false
167 167 end
... ...
... ... @@ -19,6 +19,7 @@
19 19
20 20 require "engine.class"
21 21 local Base = require "engine.ui.Base"
  22 +local FontPackage = require "engine.FontPackage"
22 23
23 24 --- Emotes for actors
24 25 -- @classmod engine.Emote
... ... @@ -38,12 +39,14 @@ function _M:init(text, dur, color, font)
38 39 self.color = color or colors.BLACK
39 40 self.use_font = font
40 41
41   - Base.init(self, {font = self.use_font or {"/data/font/DroidSans-Bold.ttf", 16}})
  42 + -- I18N emote font.
  43 + Base.init(self, {font = self.use_font or {FontPackage:getFont("bold"), 16}})
42 44 end
43 45
44 46 --- on loaded
45 47 function _M:loaded()
46   - Base.init(self, {font = self.use_font or {"/data/font/DroidSans-Bold.ttf", 16}})
  48 + -- I18N emote font.
  49 + Base.init(self, {font = self.use_font or {FontPackage:getFont("bold"), 16}})
47 50 end
48 51
49 52 --- Serialization
... ...
... ... @@ -36,6 +36,8 @@ _M.factions = {}
36 36 function _M:add(t)
37 37 assert(t.name, "no faction name")
38 38 t.short_name = t.short_name or t.name:lower():gsub(" ", "-")
  39 + -- I18N faction
  40 + t.name = _t(t.name)
39 41 if self.factions[t.short_name] then print("[FACTION] tried to redefine", t.name) return t.short_name end
40 42
41 43 local r = {}
... ...
... ... @@ -48,20 +48,31 @@ end
48 48
49 49 --- Default font id, "default"
50 50 local cur_id = "default"
  51 +
  52 +--- Forced id, usuly only needed by some translations
  53 +local forced_id = nil
  54 +
51 55 --- Set default font to use
52 56 -- @string id if it can't find it, then the font will be "basic"
53 57 function _M:setDefaultId(id)
  58 + if forced_id then id = forced_id end
54 59 if not packages[id] then id = "basic" end
55 60 cur_id = id
56 61 end
57 62
  63 +--- Force all fonts to use this package, no matter what is actually requested
  64 +function _M:forceId(id)
  65 + cur_id = id
  66 + forced_id = id
  67 +end
  68 +
58 69 --- Resolves a font
59 70 -- @string name
60 71 -- @string orname
61 72 -- @return font object
62 73 -- @return size
63   -function _M:resolveFont(name, orname)
64   - local font = packages[cur_id]
  74 +function _M:resolveFont(name, orname, package_id)
  75 + local font = packages[package_id or cur_id]
65 76 local size = cur_size
66 77 if not font[name] then name = orname end
67 78 if not font[name] then name = "default" end
... ... @@ -75,16 +86,16 @@ end
75 86 -- @string orname
76 87 -- @return font
77 88 -- @return size
78   -function _M:getFont(name, orname)
79   - local font, size = self:resolveFont(name, orname)
  89 +function _M:getFont(name, orname, package_id)
  90 + local font, size = self:resolveFont(name, orname, package_id)
80 91 return font.font, math.ceil(font[size] * config.settings.font_scale / 100)
81 92 end
82 93
83 94 --- Get by name.
84 95 -- @string name
85 96 -- @param[type=?boolean] force make a font bold no matter what
86   -function _M:get(name, force)
87   - local font, size = self:resolveFont(name)
  97 +function _M:get(name, force, package_id)
  98 + local font, size = self:resolveFont(name, nil, package_id)
88 99 local f = core.display.newFont(font.font, math.ceil(font[size] * config.settings.font_scale / 100), font.bold or force)
89 100 if font.bold then f:setStyle("bold") end
90 101 return f
... ...
... ... @@ -317,35 +317,71 @@ end
317 317 --- Run all registered tick end functions
318 318 -- Usually just let the engine call it
319 319 function _M:onTickEndExecute()
320   - if self.on_tick_end and #self.on_tick_end > 0 then
321   - local fs = self.on_tick_end
322   - self.on_tick_end = {}
  320 + local set = self.on_tick_end_custom or self.on_tick_end
  321 + if not set then return end
  322 +
  323 + if #set.fcts > 0 then
  324 + local fs = set.fcts
  325 + set.fcts = {}
  326 + set.names = {}
323 327 for i = 1, #fs do fs[i]() end
324 328 end
325   - self.on_tick_end_names = nil
326 329 end
327 330
328 331 --- Register things to do on tick end
329 332 -- @func f function to do on tick end
330 333 -- @string name callback to reference the function
331 334 function _M:onTickEnd(f, name)
332   - self.on_tick_end = self.on_tick_end or {}
  335 + local set = self.on_tick_end_custom or self.on_tick_end
  336 + if not set then self.on_tick_end = { fcts={}, names={} } set = self.on_tick_end end
333 337
334 338 if name then
335   - self.on_tick_end_names = self.on_tick_end_names or {}
336   - if self.on_tick_end_names[name] then return end
337   - self.on_tick_end_names[name] = f
  339 + if set.names[name] then return end
  340 + set.names[name] = f
338 341 end
339 342
340   - self.on_tick_end[#self.on_tick_end+1] = f
  343 + set.fcts[#set.fcts+1] = f
341 344 core.game.requestNextTick()
342 345 end
343 346
344 347 --- Returns a registered function to do on tick end by name
345 348 -- @string name callback to reference the function
346 349 function _M:onTickEndGet(name)
347   - if not self.on_tick_end_names then return end
348   - return self.on_tick_end_names[name]
  350 + local set = self.on_tick_end_custom or self.on_tick_end
  351 + if not set then return end
  352 + return set.names[name]
  353 +end
  354 +
  355 +--- Returns true if at laest one on tick end is planned
  356 +function _M:onTickEndExists()
  357 + local set = self.on_tick_end_custom or self.on_tick_end
  358 + if not set then return end
  359 + return #set.fcts > 0
  360 +end
  361 +
  362 +--- Cancels all on tick end factions
  363 +function _M:onTickEndCancelAll()
  364 + local set = self.on_tick_end_custom or self.on_tick_end
  365 + if not set then return end
  366 + set.fcts = {}
  367 + set.names = {}
  368 +end
  369 +
  370 +--- Capture all calls to onTickEnd into a custom table
  371 +-- @param set The table to contain all the calls. If set is nil the capture mode ends
  372 +function _M:onTickEndCapture(set)
  373 + if set then set.fcts = {} set.names = {} end
  374 + self.on_tick_end_custom = set
  375