Skip to content

Commit 0cc67ea

Browse files
committed
Completed translation string changes!
- Hopefully updated all of animated-java's translation strings to the new format
1 parent c6f64b7 commit 0cc67ea

File tree

16 files changed

+805
-476
lines changed

16 files changed

+805
-476
lines changed

debug_resourcepack/armor_stand.ajmodel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"meta": {
33
"format_version": "0.0",
4-
"creation_time": 1641692475,
4+
"creation_time": 1641758303,
55
"model_format": "animated_java/ajmodel",
66
"box_uv": false,
77
"settings": {
@@ -25,10 +25,10 @@
2525
"individualBoneTag": "aj.%projectName.bone.%boneName",
2626
"internalScoreboardObjective": "aj.i",
2727
"idScoreboardObjective": "aj.id",
28-
"exportMode": "mcb",
29-
"mcbFilePath": "",
28+
"exportMode": "vanilla",
29+
"mcbFilePath": "C:\\Users\\Snave\\AppData\\Roaming\\.minecraft\\saves\\Animated Java Dev\\datapacks\\Animated Java Development\\src\\armor_stand.mc",
3030
"mcbConfigPath": "",
31-
"dataPackPath": ""
31+
"dataPackPath": "C:\\Users\\Snave\\AppData\\Roaming\\.minecraft\\saves\\Animated Java Dev\\datapacks\\armor_stand"
3232
},
3333
"animatedJava_exporter_animationExporter": {
3434
"rootEntityType": "minecraft:marker",
@@ -50,7 +50,7 @@
5050
"exportMode": "mcb",
5151
"mcbFilePath": "C:\\Users\\Snave\\AppData\\Roaming\\.minecraft\\saves\\Animated Java Dev\\datapacks\\Animated Java Development\\src\\armor_stand.mc",
5252
"mcbConfigPath": "",
53-
"dataPackPath": ""
53+
"dataPackPath": "C:\\Users\\Snave\\AppData\\Roaming\\.minecraft\\saves\\Animated Java Dev\\datapacks\\armor_stand"
5454
}
5555
},
5656
"variants": {

src/animatedJava.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import events from './constants/events'
22
import { BuildModel } from './mainEntry'
3-
import { settings } from './settings'
43
import { store } from './util/store'
54
import { bus } from './util/bus'
65
import './bbmods/patchAction'
76
import { format as modelFormat } from './modelFormat'
87
import { tl } from './util/intl'
8+
import { settings } from './settings'
99
import { registerSettingRenderer } from './ui/dialogs/settings'
1010
import './ui/mods/boneConfig'
1111
import './compileLangMC'
@@ -17,7 +17,18 @@ import './util/minecraft/items'
1717
import './util/minecraft/entities'
1818
import { intl } from './util/intl'
1919
import { CustomError } from './util/customError'
20-
import { format } from './util/replace'
20+
21+
const errorMessages = [
22+
"Uh oh!",
23+
"Time to fire up the ol' debugger!",
24+
"Your armor stands are sad :(",
25+
"Ok, who pushed the big red button?",
26+
]
27+
28+
function getRandomErrorMessage() {
29+
const index = Math.round(Math.random() * (errorMessages.length-1))
30+
return errorMessages[index]
31+
}
2132

2233
function showUnknownErrorDialog(e: CustomError | any) {
2334
// console.log(e.options)
@@ -28,16 +39,17 @@ function showUnknownErrorDialog(e: CustomError | any) {
2839
new Dialog(
2940
Object.assign(
3041
{
31-
id: 'animatedJava.dialog.miscError',
32-
title: tl('animatedJava.dialog.miscError.title'),
42+
id: 'animatedJava.dialogs.miscError',
43+
title: tl('animatedJava.dialogs.errors.misc.title'),
3344
lines: [
34-
format(tl('animatedJava.dialog.miscError.body'), {
45+
tl('animatedJava.dialogs.errors.misc.body', {
3546
buildID: process.env.BUILD_ID,
3647
errorMessage: e.options ? e.options.message : e.message,
48+
randomErrorMessage: getRandomErrorMessage(),
3749
errorStack: e.stack,
3850
discordLink: process.env.DISCORD_LINK,
3951
githubLink: process.env.GITHUB_ISSUES_LINK,
40-
}),
52+
}, true),
4153
],
4254
width: 1024,
4355
height: 512,

src/animationRenderer.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { tl } from './util/intl'
1414
import { format, safeFunctionName } from './util/replace'
1515
import { isSceneBased } from './util/hasSceneAsParent'
1616
import { CustomError } from './util/customError'
17-
store.set('static_animation_uuid', '138747e7-2de0-4130-b900-9275ca0e6333')
17+
store.set('staticAnimationUuid', '138747e7-2de0-4130-b900-9275ca0e6333')
1818

1919
function setAnimatorTime(time) {
2020
Timeline.setTime(time, false)
@@ -159,7 +159,7 @@ const Cache = new (class {
159159
settings.watch('animatedJava.cacheMode', () => {
160160
this.initDiskCache()
161161
})
162-
settings.watch('animatedJava.use_cache', () => {
162+
settings.watch('animatedJava.useCache', () => {
163163
this.clear()
164164
})
165165
this.initDiskCache()
@@ -242,11 +242,11 @@ async function renderAnimation(options) {
242242

243243
if (options.generate_static_animation) {
244244
static_animation = new Animation({
245-
name: 'animatedJava.static_animation',
245+
name: 'animatedJava.staticSnimation',
246246
snapping: 20,
247247
length: 0,
248248
}).add(false)
249-
static_animation.uuid = store.get('static_animation_uuid')
249+
static_animation.uuid = store.get('staticAnimationUuid')
250250
}
251251

252252
const totalAnimationLength = Animator.animations.reduce(
@@ -255,7 +255,7 @@ async function renderAnimation(options) {
255255
)
256256
// Accumulated animation length
257257
let accAnimationLength = 0
258-
const tldMessage = tl('animatedJava.progress.animationRendering.text')
258+
const tldMessage = tl('animatedJava.progress.animationRendering')
259259
const progressUpdaterID = setInterval(() => {
260260
console.log(accAnimationLength, totalAnimationLength)
261261
Blockbench.setStatusBarText(
@@ -290,21 +290,21 @@ async function renderAnimation(options) {
290290
throw new CustomError('Invalid Snapping Value Error', {
291291
intentional: true,
292292
dialog: {
293-
id: 'animatedJava_exporter_animationExporter.popup.warning.invalidSnappingValue',
293+
id: 'animatedJava.invalidAnimationSnappingValue',
294294
title: tl(
295-
'animatedJava_exporter_animationExporter.popup.warning.invalidSnappingValue.title'
295+
'animatedJava.dialogs.errors.invalidAnimationSnappingValue.title'
296296
),
297-
lines: format(
297+
lines: [
298298
tl(
299-
'animatedJava_exporter_animationExporter.popup.warning.invalidSnappingValue.body'
299+
'animatedJava.dialogs.errors.invalidAnimationSnappingValue.body',
300+
{
301+
animationName: animation.name,
302+
snapping: animation.snapping,
303+
}
300304
),
301-
{
302-
animationName: animation.name,
303-
snapping: animation.snapping
304-
}
305-
)
306-
.split('\n')
307-
.map((line) => `<p>${line}</p>`),
305+
],
306+
width: 512 + 256,
307+
singleButton: true
308308
},
309309
})
310310
}
@@ -314,7 +314,10 @@ async function renderAnimation(options) {
314314
let maxDistance = -Infinity
315315
const frames = []
316316
animation.select()
317-
const animLength = animation.loop === 'loop' ? animation.length : animation.length + 0.05
317+
const animLength =
318+
animation.loop === 'loop'
319+
? animation.length
320+
: animation.length + 0.05
318321

319322
for (let i = 0; i <= animLength; i += 0.05) {
320323
accAnimationLength += 0.05

0 commit comments

Comments
 (0)