Search in sources :

Example 1 with TranslationSystemImpl

use of org.terasology.i18n.TranslationSystemImpl in project Terasology by MovingBlocks.

the class ClientViewDistanceSystem method initialise.

@Override
public void initialise() {
    propertyChangeListener = evt -> {
        if (evt.getPropertyName().equals(RenderingConfig.VIEW_DISTANCE)) {
            onChangeViewDistanceChange();
        }
    };
    config.getRendering().subscribe(propertyChangeListener);
    translationSystem = new TranslationSystemImpl(context);
}
Also used : TranslationSystemImpl(org.terasology.i18n.TranslationSystemImpl)

Example 2 with TranslationSystemImpl

use of org.terasology.i18n.TranslationSystemImpl in project Terasology by MovingBlocks.

the class ContextMenuUtilsTest method setupInput.

@BeforeClass
public static void setupInput() {
    context.put(InputSystem.class, new InputSystem());
    context.put(TranslationSystem.class, new TranslationSystemImpl(context));
    context.put(CanvasRenderer.class, new HeadlessCanvasRenderer());
    context.put(NUIManager.class, new NUIManagerInternal(context.get(CanvasRenderer.class), context));
    File file = new File(ContextMenuUtilsTest.class.getClassLoader().getResource("contextMenuBuilderInput.ui").getFile());
    String content = null;
    try {
        content = Files.toString(file, Charsets.UTF_8);
    } catch (IOException e) {
        fail("Could not load input file");
    }
    inputTree = JsonTreeConverter.serialize(new JsonParser().parse(content));
}
Also used : TranslationSystemImpl(org.terasology.i18n.TranslationSystemImpl) InputSystem(org.terasology.input.InputSystem) IOException(java.io.IOException) File(java.io.File) HeadlessCanvasRenderer(org.terasology.engine.subsystem.headless.renderer.HeadlessCanvasRenderer) NUIManagerInternal(org.terasology.rendering.nui.internal.NUIManagerInternal) JsonParser(com.google.gson.JsonParser) BeforeClass(org.junit.BeforeClass)

Aggregations

TranslationSystemImpl (org.terasology.i18n.TranslationSystemImpl)2 JsonParser (com.google.gson.JsonParser)1 File (java.io.File)1 IOException (java.io.IOException)1 BeforeClass (org.junit.BeforeClass)1 HeadlessCanvasRenderer (org.terasology.engine.subsystem.headless.renderer.HeadlessCanvasRenderer)1 InputSystem (org.terasology.input.InputSystem)1 NUIManagerInternal (org.terasology.rendering.nui.internal.NUIManagerInternal)1