mirror of
https://github.com/GTNewHorizons/waila.git
synced 2026-11-24 22:14:40 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ec45dc57c | ||
|
|
f998f9ebfe | ||
|
|
6d0f162453 |
No files matched your search
+1
-1
@@ -20,5 +20,5 @@ dependencies {
|
||||
runtimeOnlyNonPublishable(deobfCurse('thermal-expansion-69163:2388759'))
|
||||
runtimeOnlyNonPublishable(deobfCurse('thermal-dynamics-227443:2388756'))
|
||||
implementation(deobfCurse('cofh-core-69162:2388751'))
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.9.54:dev")
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.11.37:dev")
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderBar;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderProgressBar;
|
||||
import mcp.mobius.waila.overlay.tooltiprenderers.TTRenderStack;
|
||||
import mcp.mobius.waila.utils.ColorUtils;
|
||||
|
||||
public class HUDHandlerFurnace implements IWailaDataProvider {
|
||||
|
||||
@@ -69,8 +70,8 @@ public class HUDHandlerFurnace implements IWailaDataProvider {
|
||||
if (fuelProgress > 0) {
|
||||
String fuelBar = TTRenderBar.create(
|
||||
String.format("Fuel %ds / %ds", (maxFuelTime - fuelTime) / 20, maxFuelTime / 20),
|
||||
0xFFFF0000,
|
||||
0xFFCC0000,
|
||||
ColorUtils.fuelFurnaceBarTop.getColor(),
|
||||
ColorUtils.fuelFurnaceBarBottom.getColor(),
|
||||
1.0 - fuelProgress);
|
||||
currenttip.add(fuelBar);
|
||||
}
|
||||
@@ -78,8 +79,8 @@ public class HUDHandlerFurnace implements IWailaDataProvider {
|
||||
if (smeltProgress > 0) {
|
||||
String cookBar = TTRenderBar.create(
|
||||
String.format("Smelt %ds / %ds", smeltTime / 20, 200 / 20),
|
||||
0xFFFF8800,
|
||||
0xFFFFCC00,
|
||||
ColorUtils.progressBarTop.getColor(),
|
||||
ColorUtils.progressBarBottom.getColor(),
|
||||
smeltProgress);
|
||||
currenttip.add(cookBar);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class ProxyClient extends ProxyServer {
|
||||
ModuleRegistrar.instance().addConfig("General", "general.showents");
|
||||
ModuleRegistrar.instance().addConfig("General", "general.showhp");
|
||||
ModuleRegistrar.instance().addConfig("General", "general.showcrop");
|
||||
if (LoadedMods.NEI) ModuleRegistrar.instance().addConfig("General", "general.showsecondlangname");
|
||||
|
||||
ModuleRegistrar.instance().registerTooltipRenderer("waila.health", new TTRenderHealth());
|
||||
ModuleRegistrar.instance().registerTooltipRenderer("waila.stack", new TTRenderStack());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mcp.mobius.waila.handlers;
|
||||
|
||||
import static mcp.mobius.waila.api.SpecialChars.BLUE;
|
||||
import static mcp.mobius.waila.api.SpecialChars.GRAY;
|
||||
import static mcp.mobius.waila.api.SpecialChars.ITALIC;
|
||||
|
||||
import java.util.List;
|
||||
@@ -17,8 +18,10 @@ import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.handlers.nei.NEIHandler;
|
||||
import mcp.mobius.waila.overlay.DisplayUtil;
|
||||
import mcp.mobius.waila.utils.Constants;
|
||||
import mcp.mobius.waila.utils.LoadedMods;
|
||||
import mcp.mobius.waila.utils.ModIdentification;
|
||||
|
||||
public class HUDHandlerBlocks implements IWailaDataProvider {
|
||||
@@ -49,6 +52,11 @@ public class HUDHandlerBlocks implements IWailaDataProvider {
|
||||
|
||||
if (currenttip.isEmpty()) currenttip.add("< Unnamed >");
|
||||
else {
|
||||
if (LoadedMods.NEI && config.getConfig("general.showsecondlangname")) {
|
||||
String secondName = NEIHandler.getSecondLanguageName(itemStack);
|
||||
if (!secondName.isEmpty()) currenttip.add(GRAY + secondName);
|
||||
}
|
||||
|
||||
if (ConfigHandler.instance()
|
||||
.getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_METADATA, true)) {
|
||||
currenttip.add(
|
||||
|
||||
@@ -16,6 +16,7 @@ import codechicken.nei.api.API;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.util.ItemUntranslator;
|
||||
import mcp.mobius.waila.api.impl.ConfigHandler;
|
||||
import mcp.mobius.waila.cbcore.LangUtil;
|
||||
import mcp.mobius.waila.overlay.RayTracing;
|
||||
@@ -39,6 +40,10 @@ public class NEIHandler {
|
||||
API.addKeyBind(Constants.BIND_SCREEN_ENCH, Keyboard.KEY_I);
|
||||
}
|
||||
|
||||
public static String getSecondLanguageName(ItemStack stack) {
|
||||
return ItemUntranslator.getInstance().getItemStackDisplayName(stack);
|
||||
}
|
||||
|
||||
public static boolean firstInventory = true;
|
||||
|
||||
public static void openRecipeGUI(boolean recipe) {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class TTRenderStack implements IWailaTooltipRenderer {
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScaled(scale, scale, 1.0f);
|
||||
|
||||
DisplayUtil.renderStack(0, 0, stack);
|
||||
DisplayUtil.renderStack(0, -1, stack);
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package mcp.mobius.waila.utils;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.color.ColorResource;
|
||||
|
||||
public class ColorUtils {
|
||||
|
||||
private static final ColorResource.Factory color = new ColorResource.Factory("waila");
|
||||
|
||||
public static final ColorResource
|
||||
// spotless:off
|
||||
fuelFurnaceBarTop = color.argb("fuelFurnaceBarTop", "0xFFFF8800"),
|
||||
fuelFurnaceBarBottom = color.argb("fuelFurnaceBarBottom", "0xFFFFCC00"),
|
||||
progressBarTop = color.argb("progressBarTop", "0xFFFF0000"),
|
||||
progressBarBottom = color.argb("progressBarBottom", "0xFF8B0000");
|
||||
// spotless:on
|
||||
|
||||
}
|
||||
@@ -153,6 +153,7 @@ option.stevescarts.shifttoggle=Shift toggle
|
||||
option.general.showents=Show entities
|
||||
option.general.showhp=Show entities health
|
||||
option.general.showcrop=Show crop growth
|
||||
option.general.showsecondlangname=Show second language name (NEI)
|
||||
option.thaumcraft.aspects=Show aspects
|
||||
|
||||
nei.options.keys.showenchant=Show enchanting values
|
||||
@@ -147,4 +147,5 @@ option.stevescarts.colorblind=Режим цветокоррекции
|
||||
option.stevescarts.shifttoggle=Приседание показывает
|
||||
option.general.showhp=Показывать здоровье сущностей
|
||||
option.general.showcrop=Показывать рост растений
|
||||
option.general.showsecondlangname=Показывать название на втором языке (NEI)
|
||||
option.thaumcraft.aspects=Показывать аспекты
|
||||
Reference in new issue
Block a user