Skip to content

Commit 270bb89

Browse files
committed
Fixed #59
emptyValue translation string was being translated before translations were loaded.
1 parent e49583e commit 270bb89

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed

src/bbmods/faceTint.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { format as modelFormat } from '../modelFormat'
22
import { bus } from '../util/bus'
33
import * as EVENTS from '../constants/events'
44

5-
const originalFaceTintCondition = BarItems.face_tint.condition
6-
const originalFaceTintSliderCondition = BarItems.slider_face_tint.condition
5+
// const originalFaceTintCondition = BarItems.face_tint.condition
6+
// const originalFaceTintSliderCondition = BarItems.slider_face_tint.condition
77
BarItems.face_tint.condition = () =>
88
!Project.box_uv &&
99
(Format.id === 'java_block' || Format.id === modelFormat.id) &&
@@ -17,8 +17,3 @@ BarItems.slider_face_tint.condition = () =>
1717
Cube.selected.length &&
1818
UVEditor.selected_faces[0] &&
1919
Cube.selected[0].faces[UVEditor.selected_faces[0]]
20-
21-
bus.on(EVENTS.LIFECYCLE.CLEANUP, () => {
22-
BarItem.face_tint.condition = originalFaceTintCondition
23-
BarItem.slider_face_tint.condition = originalFaceTintSliderCondition
24-
})

src/modelFormat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ const format = new ModelFormat({
310310
centered_grid: true,
311311
animation_files: true,
312312
animated_textures: true,
313-
icon: 'fa-cube',
313+
icon: 'icon-armor_stand',
314314
codec,
315315
onDeactivation() {
316316
settingsByUUID.set(Project.uuid, settings.toObject())

src/settings.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { getModelPath } from './util/minecraft/resourcepack'
77
import { Items } from './util/minecraft/items'
88
import { tl } from './util/intl'
99

10-
const genericEmptyErrorText = tl(
11-
'animatedJava.settings.generic.errors.emptyValue'
12-
)
10+
function genericEmptyErrorText() {
11+
return tl('animatedJava.settings.generic.errors.emptyValue')
12+
}
1313
export let ForeignSettingTranslationKeys = {}
1414
const UNASSIGNED = Symbol('UNASSIGNED_CACHE')
1515
export const DefaultSettings = {
@@ -33,7 +33,7 @@ export const DefaultSettings = {
3333
}
3434
} else {
3535
d.isValid = false
36-
d.error = genericEmptyErrorText
36+
d.error = genericEmptyErrorText()
3737
}
3838
return d
3939
},
@@ -105,7 +105,7 @@ export const DefaultSettings = {
105105
}
106106
} else {
107107
d.isValid = false
108-
d.error = tl('animatedJava.settings.generic.emptyValue')
108+
d.error = genericEmptyErrorText()
109109
}
110110
return d
111111
},
@@ -146,9 +146,7 @@ export const DefaultSettings = {
146146
}
147147
} else {
148148
d.isValid = false
149-
d.error = tl(
150-
'animatedJava.settings.generic.errors.emptyValue'
151-
)
149+
d.error = genericEmptyErrorText()
152150
}
153151
return d
154152
},
@@ -185,16 +183,15 @@ export const DefaultSettings = {
185183
if (`${rigItem}.json` !== b.base) {
186184
d.isValid = false
187185
d.error = tl(
188-
'animatedJava.settings.predicateFilePath.errors.notEqualToRigItem',{
189-
rigItem
186+
'animatedJava.settings.predicateFilePath.errors.notEqualToRigItem',
187+
{
188+
rigItem,
190189
}
191190
)
192191
}
193192
} else {
194193
d.isValid = false
195-
d.error = tl(
196-
'animatedJava.settings.generic.errors.emptyValue'
197-
)
194+
d.error = genericEmptyErrorText()
198195
}
199196
return d
200197
},
@@ -526,7 +523,9 @@ class Settings {
526523

527524
registerPluginSettings(exporterId, exporterSettingsKey, settings) {
528525
DefaultSettings[exporterSettingsKey] = settings
529-
ForeignSettingTranslationKeys[exporterSettingsKey] = `${exporterId}.title`
526+
ForeignSettingTranslationKeys[
527+
exporterSettingsKey
528+
] = `${exporterId}.title`
530529
this.update(
531530
{
532531
[exporterSettingsKey]: settings,

0 commit comments

Comments
 (0)