Search in sources :

Example 1 with PaneParams

use of com.minecolonies.blockout.PaneParams in project minecolonies by Minecolonies.

the class ButtonImage method loadHighlightInfo.

/**
     * Loads the parameters for the hover image.
     *
     * @param params PaneParams provided in the xml.
     */
private void loadHighlightInfo(final PaneParams params) {
    final String path = params.getStringAttribute("highlight", null);
    if (path != null) {
        imageHighlight = new ResourceLocation(path);
        loadImageHighlightDimensions();
    }
    PaneParams.SizePair size = params.getSizePairAttribute("highlightoffset", null, null);
    if (size != null) {
        highlightOffsetX = size.getX();
        highlightOffsetY = size.getY();
    }
    size = params.getSizePairAttribute("highlightsize", null, null);
    if (size != null) {
        highlightWidth = size.getX();
        highlightHeight = size.getY();
    }
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) PaneParams(com.minecolonies.blockout.PaneParams)

Example 2 with PaneParams

use of com.minecolonies.blockout.PaneParams in project minecolonies by Minecolonies.

the class Window method loadParams.

/**
     * Load the xml parameters.
     *
     * @param params xml parameters.
     */
public void loadParams(@NotNull final PaneParams params) {
    final String inherit = params.getStringAttribute("inherit", null);
    if (inherit != null) {
        Loader.createFromXMLFile(new ResourceLocation(inherit), this);
    }
    final PaneParams.SizePair size = params.getSizePairAttribute("size", null, null);
    if (size == null) {
        final int w = params.getIntegerAttribute("width", width);
        final int h = params.getIntegerAttribute("height", height);
        setSize(w, h);
    } else {
        setSize(size.getX(), size.getY());
    }
    lightbox = params.getBooleanAttribute("lightbox", lightbox);
    windowPausesGame = params.getBooleanAttribute("pause", windowPausesGame);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) PaneParams(com.minecolonies.blockout.PaneParams)

Example 3 with PaneParams

use of com.minecolonies.blockout.PaneParams in project minecolonies by Minecolonies.

the class ButtonImage method loadDisabledInfo.

/**
     * Loads the parameters for the disabled image.
     *
     * @param params PaneParams provided in the xml.
     */
private void loadDisabledInfo(final PaneParams params) {
    final String path = params.getStringAttribute("disabled", null);
    if (path != null) {
        imageDisabled = new ResourceLocation(path);
        loadImageDisabledDimensions();
    }
    PaneParams.SizePair size = params.getSizePairAttribute("disabledoffset", null, null);
    if (size != null) {
        disabledOffsetX = size.getX();
        disabledOffsetY = size.getY();
    }
    size = params.getSizePairAttribute("disabledsize", null, null);
    if (size != null) {
        disabledWidth = size.getX();
        disabledHeight = size.getY();
    }
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) PaneParams(com.minecolonies.blockout.PaneParams)

Example 4 with PaneParams

use of com.minecolonies.blockout.PaneParams in project minecolonies by Minecolonies.

the class ButtonImage method loadImageInfo.

/**
     * Loads the parameters for the normal image.
     *
     * @param params PaneParams provided in the xml.
     */
private void loadImageInfo(final PaneParams params) {
    final String path = params.getStringAttribute("source", null);
    if (path != null) {
        image = new ResourceLocation(path);
        loadImageDimensions();
    }
    PaneParams.SizePair size = params.getSizePairAttribute("imageoffset", null, null);
    if (size != null) {
        imageOffsetX = size.getX();
        imageOffsetY = size.getY();
    }
    size = params.getSizePairAttribute("imagesize", null, null);
    if (size != null) {
        imageWidth = size.getX();
        imageHeight = size.getY();
    }
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) PaneParams(com.minecolonies.blockout.PaneParams)

Aggregations

PaneParams (com.minecolonies.blockout.PaneParams)4 ResourceLocation (net.minecraft.util.ResourceLocation)4