Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Manual XML will reload when user language changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ephys committed Jan 17, 2015
1 parent 0b7c786 commit c04a34a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/main/java/tsteelworks/client/core/TSClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class TSClientProxy extends TSCommonProxy {
public void preInit() {
super.preInit();

readManuals();
TSClientProxy.readManuals();
}

@Override
Expand Down Expand Up @@ -73,8 +73,6 @@ public static BookData getManualFromStack(ItemStack stack) {
}

private void initManualIcons() {
ResourceLocation res = new ResourceLocation("tsteelworks:manuals/deeptankbuild1.png");

// Blocks
MantleClientRegistry.registerManualIcon("highovenbook", new ItemStack(TSContent.bookManual, 1, 0));
MantleClientRegistry.registerManualIcon("highoven", new ItemStack(TSContent.highoven));
Expand Down Expand Up @@ -187,7 +185,7 @@ private void addRenderMappings() {
}
}

private void readManuals() {
public static void readManuals() {
// TODO: is there an event that would allow us to reload if the user changes their language ?
String currentLanguage = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/tsteelworks/client/core/TSEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class TSEventHandler {
@SubscribeEvent
public void reloadTextures(TextureStitchEvent.Post event) {
public void reloadResources(TextureStitchEvent.Post event) {
if (TSContent.steamFluid != null)
TSContent.steamFluid.setIcons(ModsData.Fluids.steamBlock.getIcon(0,0), ModsData.Fluids.steamBlock.getIcon(2, 0));

Expand All @@ -16,5 +16,7 @@ public void reloadTextures(TextureStitchEvent.Post event) {

if (TSContent.liquidCementFluid != null)
TSContent.liquidCementFluid.setIcons(ModsData.Fluids.liquidCement.getIcon(0,0), ModsData.Fluids.liquidCement.getIcon(2, 0));

TSClientProxy.readManuals();
}
}
2 changes: 1 addition & 1 deletion src/main/java/tsteelworks/client/gui/DeepTankGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected void drawFluidStackTooltip(FluidStack liquid, int x, int z) {
List<String> tooltips = new ArrayList<>();

tooltips.add(liquid.getFluid().getLocalizedName(liquid));
tooltips.add(EnumChatFormatting.LIGHT_PURPLE + "mB: " + liquid.amount);
tooltips.add(EnumChatFormatting.LIGHT_PURPLE + StatCollector.translateToLocal("quantity.mb") + ": " + liquid.amount);

drawHoveringText(tooltips, x, z, fontRendererObj);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ public void updateTool(ToolCore tool, ItemStack stack, World world, Entity entit
if (tags.hasKey("Vacuous"))
EntityHelper.drawItemsToEntity((EntityLivingBase) entity, tags.getInteger("Vacuous") + 1);
}
}
}
3 changes: 2 additions & 1 deletion src/main/resources/assets/tsteelworks/lang/fr_FR.lang
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gui.button.prev=<

item.tsteelworks.Materials.ScorchedBrick.name=Briques Roussies
item.tsteelworks.Materials.LimestoneBrick.name=Briques de Calcaire
item.tsteelworks.manual.highoven.name=Les Travaux de l'Acier et Vous
item.tsteelworks.manual.highoven.name=La Sidérurgie et Vous
item.tsteelworks.helmetSteel.name=Casque en Acier
item.tsteelworks.chestplateSteel.name=Plastron en Acier
item.tsteelworks.leggingsSteel.name=Jambières en Acier
Expand Down Expand Up @@ -124,6 +124,7 @@ material.limestonebrick.tooltip1=La pierre avec une touche de chaux
manual.steelworks.tooltip1=By: La Société des Bricoleurs

modifier.tool.vacuous=Vide
modifier.toolstation.vacuous=Vide

fluid.water=Eau
iron.molten=Fer Fondu
Expand Down

1 comment on commit c04a34a

@Adaptivity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are implemented TODO or what?

Please sign in to comment.