Search in sources :

Example 6 with ITheme

use of betterquesting.api.client.themes.ITheme in project BetterQuesting by Funwayguy.

the class ThemeRegistry method getTexture.

public IGuiTexture getTexture(ResourceLocation key) {
    if (key == null) {
        return NULL_TEXTURE;
    }
    IGuiTexture tex = null;
    // TODO: Remove this when fully converted...
    ITheme legTheme = betterquesting.client.themes.ThemeRegistry.INSTANCE.getCurrentTheme();
    if (legTheme != null && (activeTheme == null || !activeTheme.getID().equals(legTheme.getThemeID()))) {
        activeTheme = new LegacyThemeWrapper(legTheme);
    }
    if (activeTheme != null) {
        tex = activeTheme.getTexture(key);
    }
    tex = tex != null ? tex : defTextures.get(key);
    return tex == null ? NULL_TEXTURE : tex;
}
Also used : ITheme(betterquesting.api.client.themes.ITheme) IGuiTexture(betterquesting.api2.client.gui.resources.textures.IGuiTexture)

Aggregations

ITheme (betterquesting.api.client.themes.ITheme)6 IGuiColor (betterquesting.api2.client.gui.resources.colors.IGuiColor)2 IGuiLine (betterquesting.api2.client.gui.resources.lines.IGuiLine)2 IGuiTexture (betterquesting.api2.client.gui.resources.textures.IGuiTexture)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 IThemeLoader (betterquesting.api.client.themes.IThemeLoader)1 BigItemStack (betterquesting.api.utils.BigItemStack)1 IPanelButton (betterquesting.api2.client.gui.controls.IPanelButton)1 PanelButton (betterquesting.api2.client.gui.controls.PanelButton)1 PanelButtonStorage (betterquesting.api2.client.gui.controls.PanelButtonStorage)1 CanvasEmpty (betterquesting.api2.client.gui.panels.CanvasEmpty)1 CanvasTextured (betterquesting.api2.client.gui.panels.CanvasTextured)1 PanelVScrollBar (betterquesting.api2.client.gui.panels.bars.PanelVScrollBar)1 PanelGeneric (betterquesting.api2.client.gui.panels.content.PanelGeneric)1 PanelLine (betterquesting.api2.client.gui.panels.content.PanelLine)1 PanelTextBox (betterquesting.api2.client.gui.panels.content.PanelTextBox)1 CanvasScrolling (betterquesting.api2.client.gui.panels.lists.CanvasScrolling)1 GuiColorSequence (betterquesting.api2.client.gui.resources.colors.GuiColorSequence)1 GuiLineSequence (betterquesting.api2.client.gui.resources.lines.GuiLineSequence)1 GuiTextureColored (betterquesting.api2.client.gui.resources.textures.GuiTextureColored)1