mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-10-25 20:22:19 +00:00
Localizaton of elements and gui adjustements (#96)
This commit is contained in:
1 parent
c067e59981
commit
abbe4c1017
12 files changed
+160
-41
No files matched your search
+8
-6
@@ -66,11 +66,8 @@ public class GUIDislocatorInhibitor extends GuiContainer implements INEIGuiHandl
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("tile.draconicevolution:dislocatorInhibitor.name"),
|
||||
7,
|
||||
5,
|
||||
0x222222);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.dislocatorInhibitor.main.title"), 7, 5, 0x222222);
|
||||
drawGuiText();
|
||||
drawGreyOutSlots();
|
||||
drawButtonIcons();
|
||||
@@ -200,7 +197,12 @@ public class GUIDislocatorInhibitor extends GuiContainer implements INEIGuiHandl
|
||||
25,
|
||||
0x000000,
|
||||
false);
|
||||
fontRendererObj.drawString(String.valueOf(range), range < 10 ? 78 : 75, 25, 0x000000, false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", range),
|
||||
range < 10 ? 78 : 75,
|
||||
25,
|
||||
0x000000,
|
||||
false);
|
||||
}
|
||||
|
||||
private void drawButtonIcons() {
|
||||
|
||||
@@ -52,13 +52,18 @@ public class GUIDissEnchanter extends GuiContainer {
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("tile.draconicevolution:dissEnchanter.name"),
|
||||
StatCollector.translateToLocal("gui.de.dissEnchanter.main.title"),
|
||||
88,
|
||||
4,
|
||||
0x00FFFF);
|
||||
|
||||
fontRendererObj.drawString("Item", 5, 40, 0x0000ff);
|
||||
fontRendererObj.drawString("Damage: " + (40 - tile.bookPower) + "%", 5, 49, 0x0000ff);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.dissEnchanter.itemDamage1"), 5, 40, 0x0000ff);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector
|
||||
.translateToLocalFormatted("gui.de.dissEnchanter.itemDamage2", (40 - tile.bookPower) + "%"),
|
||||
5,
|
||||
49,
|
||||
0x0000ff);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,6 +99,7 @@ public class GUIDissEnchanter extends GuiContainer {
|
||||
if (flag && player.experienceLevel < tile.dissenchantCost && !player.capabilities.isCreativeMode) flag = false;
|
||||
((GuiButtonAHeight) buttonList.get(0)).enabled = flag;
|
||||
((GuiButtonAHeight) buttonList.get(0)).packedFGColour = cachRecipeValid ? 0x000000 : 0xdf0000;
|
||||
((GuiButtonAHeight) buttonList.get(0)).displayString = "Cost: " + tile.dissenchantCost;
|
||||
((GuiButtonAHeight) buttonList.get(0)).displayString = StatCollector
|
||||
.translateToLocalFormatted("gui.de.dissEnchanter.cost", tile.dissenchantCost);
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawString(tile.getInventoryName(), 4, 4, 0x222222);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.draconiumChest.main.title"), 4, 4, 0x222222);
|
||||
// fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("button.de.chestAutoFeed.txt"), 4, 180,
|
||||
// 0x00FFFF);
|
||||
|
||||
|
||||
@@ -83,7 +83,11 @@ public class GUIEnergyInfuser extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawStringWithShadow("Energy Infuser", 49, -9, 0x00FFFF);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("gui.de.energyInfuser.main.title"),
|
||||
49,
|
||||
-9,
|
||||
0x00FFFF);
|
||||
|
||||
// bindTexture(texture);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class GUIFlowGate extends GuiScreen {
|
||||
|
||||
drawDefaultBackground();
|
||||
ResourceHandler.bindResource("textures/gui/ToolConfig.png");
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 197, 88);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 198, 89);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("gui.de.flowGate.name"),
|
||||
guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGate.name")) / 2),
|
||||
|
||||
@@ -76,7 +76,7 @@ public class GUIGenerator extends GuiContainer {
|
||||
18 - (int) (fuel * 13)); // Power bar
|
||||
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("tile.draconicevolution:generator.name"),
|
||||
StatCollector.translateToLocal("gui.de.generator.main.title"),
|
||||
guiLeft + 64,
|
||||
guiTop,
|
||||
0x00FFFF);
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -82,7 +83,11 @@ public class GUIGrinder extends GuiContainer {
|
||||
18 - (int) (fuel * 13)); // Power bar
|
||||
if (tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 100, guiTop + 37, xSize, 66, 13, 13);
|
||||
|
||||
fontRendererObj.drawStringWithShadow("Grinder", guiLeft + 71, guiTop, 0x00FFFF);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("gui.de.grinder.main.title"),
|
||||
guiLeft + 71,
|
||||
guiTop,
|
||||
0x00FFFF);
|
||||
|
||||
int x = X - guiLeft;
|
||||
int y = Y - guiTop;
|
||||
|
||||
+7
-2
@@ -86,7 +86,8 @@ public class GUIParticleGenerator extends GuiScreen {
|
||||
@Override
|
||||
public void drawLabel(FontRenderer fontRenderer, int x, int y) {
|
||||
fontRenderer.drawString(label, x, y, 0x000000);
|
||||
fontRenderer.drawString(String.valueOf(value), x, y + 10, 0x000000);
|
||||
fontRenderer
|
||||
.drawString(StatCollector.translateToLocalFormatted("gui.de.numbers", value), x, y + 10, 0x000000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +142,11 @@ public class GUIParticleGenerator extends GuiScreen {
|
||||
public void drawLabel(FontRenderer fontRenderer, int x, int y) {
|
||||
float roundedValue = Math.round(value * scale) / scale;
|
||||
fontRenderer.drawString(label, x, y, 0x000000);
|
||||
fontRenderer.drawString(String.valueOf(roundedValue), x, y + 10, 0x000000);
|
||||
fontRenderer.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", roundedValue),
|
||||
x,
|
||||
y + 10,
|
||||
0x000000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -75,7 +76,7 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
public void drawScreen(int x, int y, float partialTicks) {
|
||||
super.drawScreen(x, y, partialTicks);
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
lines.add("Camouflage");
|
||||
lines.add(StatCollector.translateToLocal("gui.de.playerDetector.camouflage"));
|
||||
if ((x - guiLeft > 142 && x - guiLeft < 160) && (y - guiTop > 19 && y - guiTop < 37)
|
||||
&& container.shouldShowInventory()) {
|
||||
drawHoveringText(lines, x, y, fontRendererObj);
|
||||
@@ -88,15 +89,30 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
super.initGui();
|
||||
buttonList.clear();
|
||||
if (!isInEditMode) {
|
||||
String mode = isInWhitelistMode ? "White List" : "Black List";
|
||||
String mode = isInWhitelistMode ? StatCollector.translateToLocal("gui.de.playerDetector.whiteList")
|
||||
: StatCollector.translateToLocal("gui.de.playerDetector.blackList");
|
||||
int center = width / 2;
|
||||
buttonList.add(new GuiButton(0, center - 20 - 20, guiTop + 20, 20, 20, "+"));
|
||||
buttonList.add(new GuiButton(1, center + 20, guiTop + 20, 20, 20, "-"));
|
||||
buttonList.add(new GuiButton(3, center - 40, guiTop + 45, 60, 20, mode));
|
||||
buttonList.add(new GuiButton(4, center + 20, guiTop + 45, 20, 20, "!"));
|
||||
buttonList.add(new GuiButton(6, center - 40, guiTop + 70, 80, 20, "Invert Output"));
|
||||
buttonList.add(
|
||||
new GuiButton(
|
||||
6,
|
||||
center - 40,
|
||||
guiTop + 70,
|
||||
80,
|
||||
20,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.invertOutput")));
|
||||
} else {
|
||||
buttonList.add(new GuiButton(5, guiLeft - 40, guiTop + ySize - 20, 40, 20, "Back"));
|
||||
buttonList.add(
|
||||
new GuiButton(
|
||||
5,
|
||||
guiLeft - 40,
|
||||
guiTop + ySize - 20,
|
||||
40,
|
||||
20,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.back")));
|
||||
}
|
||||
|
||||
selectedNameText = new GuiTextField(fontRendererObj, 4, -12, 168, 12);
|
||||
@@ -186,7 +202,12 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
private void drawGuiText() {
|
||||
if (isInEditMode) {
|
||||
if (selectedMameIndex != -1) {
|
||||
drawCenteredString(fontRendererObj, "Press Enter to save", xSize / 2, -22, 0xFF0000);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.pressEnter"),
|
||||
xSize / 2,
|
||||
-22,
|
||||
0xFF0000);
|
||||
}
|
||||
for (int row = 0; row < 21; row++) {
|
||||
for (int column = 0; column < 2; column++) {
|
||||
@@ -200,11 +221,31 @@ public class GUIPlayerDetector extends GuiContainer {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
drawCenteredString(fontRendererObj, "Advanced Player Detector", xSize / 2, 5, 0x00FFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.main.title"),
|
||||
xSize / 2,
|
||||
5,
|
||||
0x00FFFF);
|
||||
|
||||
fontRendererObj.drawString("Range:", 73, 21, 0x000000, false);
|
||||
fontRendererObj.drawString("Output Inverted: " + isOutputInverted, 33, 97, 0x000000, false);
|
||||
fontRendererObj.drawString(String.valueOf(range), range < 10 ? 85 : 82, 31, 0x000000, false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocal("gui.de.playerDetector.range") + ":",
|
||||
73,
|
||||
21,
|
||||
0x000000,
|
||||
false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.playerDetector.outputInvert", isOutputInverted),
|
||||
33,
|
||||
97,
|
||||
0x000000,
|
||||
false);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", range),
|
||||
range < 10 ? 85 : 82,
|
||||
31,
|
||||
0x000000,
|
||||
false);
|
||||
}
|
||||
selectedNameText.drawTextBox();
|
||||
}
|
||||
|
||||
@@ -86,7 +86,12 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
drawCenteredString(fontRendererObj, tile.getBlockType().getLocalizedName(), xSize / 2, -9, 0x00FFFF);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.upgradeModifier.main.title"),
|
||||
xSize / 2,
|
||||
-9,
|
||||
0x00FFFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -238,13 +243,25 @@ public class GUIUpgradeModifier extends GuiContainer {
|
||||
0x00ff00);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.cap.txt"), guiLeft + 4, guiTop + 16, 0x000000);
|
||||
fontRendererObj.drawString(">" + coreSlots, guiLeft + 4, guiTop + 25, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", ">" + coreSlots),
|
||||
guiLeft + 4,
|
||||
guiTop + 25,
|
||||
0x000000);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.installed.txt"), guiLeft + 4, guiTop + 37, 0x000000);
|
||||
fontRendererObj.drawString(">" + usedSlots, guiLeft + 4, guiTop + 46, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", ">" + usedSlots),
|
||||
guiLeft + 4,
|
||||
guiTop + 46,
|
||||
0x000000);
|
||||
fontRendererObj
|
||||
.drawString(StatCollector.translateToLocal("gui.de.free.txt"), guiLeft + 4, guiTop + 58, 0x000000);
|
||||
fontRendererObj.drawString(">" + (coreSlots - usedSlots), guiLeft + 4, guiTop + 67, 0x000000);
|
||||
fontRendererObj.drawString(
|
||||
StatCollector.translateToLocalFormatted("gui.de.numbers", ">" + (coreSlots - usedSlots)),
|
||||
guiLeft + 4,
|
||||
guiTop + 67,
|
||||
0x000000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+20
-11
@@ -6,6 +6,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -53,23 +54,32 @@ public class GUIWeatherController extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.charges") + ": " + charges, 90, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
drawCenteredString(fontRendererObj, "Weather Controller", xSize / 2, -15, 0x2a4ed0);
|
||||
drawCenteredString(
|
||||
fontRendererObj,
|
||||
StatCollector.translateToLocal("gui.de.weatherController.main.title"),
|
||||
xSize / 2,
|
||||
-15,
|
||||
0x2a4ed0);
|
||||
}
|
||||
|
||||
public static final String RAIN_ON_TEXT = "Turn rain on";
|
||||
public static final String RAIN_OFF_TEXT = "Turn rain off";
|
||||
public static final String STORM_TEXT = "Thunder Storm";
|
||||
public static final String RAIN_ON_TEXT = "gui.de.rain.on";
|
||||
public static final String RAIN_OFF_TEXT = "gui.de.rain.off";
|
||||
public static final String STORM_TEXT = "gui.de.rain.storm";
|
||||
public static String text;
|
||||
|
||||
private String getModeText(int mode) {
|
||||
if (mode == 0) return StatCollector.translateToLocal(RAIN_OFF_TEXT);
|
||||
else if (mode == 1) return StatCollector.translateToLocal(RAIN_ON_TEXT);
|
||||
else return StatCollector.translateToLocal(STORM_TEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
buttonList.clear();
|
||||
if (tileWC.mode == 0) text = RAIN_OFF_TEXT;
|
||||
else if (tileWC.mode == 1) text = RAIN_ON_TEXT;
|
||||
else text = STORM_TEXT;
|
||||
text = getModeText(tileWC.mode);
|
||||
// ID
|
||||
buttonList.add(new GuiButton(0, guiLeft + 85, guiTop, 85, 20, text));
|
||||
}
|
||||
@@ -78,9 +88,8 @@ public class GUIWeatherController extends GuiContainer {
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if (button.id == 0) {
|
||||
DraconicEvolution.network.sendToServer(new ButtonPacket((byte) 0, true));
|
||||
if (button.displayString.equals(STORM_TEXT)) button.displayString = RAIN_OFF_TEXT;
|
||||
else if (button.displayString.equals(RAIN_OFF_TEXT)) button.displayString = RAIN_ON_TEXT;
|
||||
else button.displayString = STORM_TEXT;
|
||||
tileWC.mode = (tileWC.mode + 1) % 3;
|
||||
button.displayString = getModeText(tileWC.mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -547,6 +547,36 @@ button.de.rotate.txt=Rotate
|
||||
button.de.numeric.txt=Numeric:
|
||||
|
||||
//Gui ----------------------------------------------------------------------------------------------------------------------------------------
|
||||
gui.de.numbers=%s
|
||||
|
||||
gui.de.charges=Charges
|
||||
gui.de.rain.on=Turn rain on
|
||||
gui.de.rain.off=Turn rain off
|
||||
gui.de.rain.storm=Thunder Storm
|
||||
|
||||
gui.de.weatherController.main.title=Weather Controller
|
||||
gui.de.playerDetector.main.title=Advanced Player Detector
|
||||
gui.de.grinder.main.title=Grinder
|
||||
gui.de.energyInfuser.main.title=Energy Infuser
|
||||
gui.de.generator.main.title=Generator
|
||||
gui.de.dissEnchanter.main.title=Disenchanter
|
||||
gui.de.draconiumChest.main.title=Draconic Chest
|
||||
gui.de.upgradeModifier.main.title=Upgrade Modifier
|
||||
gui.de.dislocatorInhibitor.main.title=Dislocator Inhibitor
|
||||
|
||||
gui.de.playerDetector.whiteList=White List
|
||||
gui.de.playerDetector.blackList=Black List
|
||||
gui.de.playerDetector.camouflage=Camouflage
|
||||
gui.de.playerDetector.invertOutput=Invert Output
|
||||
gui.de.playerDetector.back=Back
|
||||
gui.de.playerDetector.pressEnter=Press Enter to save
|
||||
gui.de.playerDetector.range=Range
|
||||
gui.de.playerDetector.outputInvert=Output Inverted: %s
|
||||
|
||||
gui.de.dissEnchanter.itemDamage1=Item
|
||||
gui.de.dissEnchanter.itemDamage2=Damage: %s
|
||||
gui.de.dissEnchanter.cost=Cost: %s
|
||||
|
||||
gui.de.flowGate.name=Flow Control
|
||||
gui.de.flowGatePartialSignal.name=The actual flow will vary between the two given values depending on the strength of the redstone signal being supplied to the block.
|
||||
gui.de.flowGateCurrentFlow.name=Flow
|
||||
|
||||
Reference in new issue
Block a user