Skip to content

Commit

Permalink
fixes some gui localisation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Thutmose committed Oct 10, 2022
1 parent afb694e commit c307f14
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
28 changes: 16 additions & 12 deletions src/main/java/pokecube/core/client/gui/helper/GuardEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void addOrRemove(Consumer<AbstractWidget> remover)
this.location.visible = false;
this.timeperiod.visible = false;
this.variation.visible = false;

remover.accept(this.delete);
remover.accept(this.confirm);
remover.accept(this.moveUp);
Expand Down Expand Up @@ -217,9 +217,12 @@ public void moveUpClicked(final Button b)
this.reOrder(-1);
}

private BlockPos posFromText(final String text)
private BlockPos posFromText(String text)
{
if (text.isEmpty()) return null;
text = text.replace("(", "").replace(")", "");
text = text.replace(",", "");
while (text.contains(" ")) text = text.replace(" ", " ");
final String[] args = text.split(" ");
if (args.length == 3) try
{
Expand All @@ -231,14 +234,14 @@ private BlockPos posFromText(final String text)
catch (final NumberFormatException e)
{
// Send status message about not working here.
final Component mess = TComponent.translatable("traineredit.info.pos.formaterror");
this.parent.getMinecraft().player.displayClientMessage(mess, true);
final Component mess = TComponent.translatable("pokecube.route.info.pos.formatinfo");
this.parent.getMinecraft().player.displayClientMessage(mess, false);
}
else if (args.length != 0)
{
// Send status message about not working here.
final Component mess = TComponent.translatable("traineredit.info.pos.formatinfo");
this.parent.getMinecraft().player.displayClientMessage(mess, true);
final Component mess = TComponent.translatable("pokecube.route.info.pos.formatinfo");
this.parent.getMinecraft().player.displayClientMessage(mess, false);
}
return null;
}
Expand Down Expand Up @@ -313,9 +316,10 @@ public void reOrder(final int dir)
this.function.apply(data);
}

public TimePeriod timeFromText(final String text)
public TimePeriod timeFromText(String text)
{
if (text.isEmpty()) return null;
text = text.replace("(", "").replace(")", "");
final String[] args = text.split(" ");
if (args.length == 2) try
{
Expand All @@ -326,14 +330,14 @@ public TimePeriod timeFromText(final String text)
catch (final NumberFormatException e)
{
// Send status message about not working here.
final Component mess = TComponent.translatable("traineredit.info.time.formaterror");
this.parent.getMinecraft().player.displayClientMessage(mess, true);
final Component mess = TComponent.translatable("pokecube.route.info.time.formaterror");
this.parent.getMinecraft().player.displayClientMessage(mess, false);
}
else if (args.length != 0)
{
// Send status message about not working here.
final Component mess = TComponent.translatable("traineredit.info.time.formatinfo");
this.parent.getMinecraft().player.displayClientMessage(mess, true);
final Component mess = TComponent.translatable("pokecube.route.info.time.formatinfo");
this.parent.getMinecraft().player.displayClientMessage(mess, false);
}
return null;
}
Expand All @@ -349,7 +353,7 @@ public void update()
}
catch (final NumberFormatException e)
{
final Component mess = TComponent.translatable("traineredit.info.dist.formatinfo");
final Component mess = TComponent.translatable("pokecube.route.info.dist.formaterror");
this.parent.getMinecraft().player.displayClientMessage(mess, false);
return;
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/pokecube/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@
"pokecube.gui.move.up.desc": "Move Up",
"pokecube.gui.move.down.desc": "Move Down",

"pokecube.route.info.dist.formaterror": "§cError with distance format!",
"pokecube.route.info.time.formaterror": "§cTime period is in ticks!",
"pokecube.route.info.time.formatinfo": "§cError, Wrong format; Correct time format is: (startick endtick)",
"pokecube.route.info.pos.formatinfo": "§cError, Wrong format; Correct location format is: (x y z)",

"_comment": "Pokemob Gui",

"pokemob.stance.guard": "Guarding",
Expand Down
18 changes: 9 additions & 9 deletions src/main/resources/assets/pokecube_adventures/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@
"traineredit.set.look": "Look Angle set to %s.",
"traineredit.set.levels": "Set levelling mode to %s.",

"traineredit.title.Pokémob": "Edit Pokémob",
"traineredit.title.pokemob": "Edit Pokémob",
"traineredit.title.message": "Event Messages and Actions",
"traineredit.title.aipage": "AI Settings",
"traineredit.title.rewards": "Defeat Rewards",
"traineredit.title.trades": "Edit Trades",
"traineredit.title.routes": "Edit Routes",

"traineredit.info.Pokémob": "Pokémob",
"traineredit.info.pokemob": "Pokémob",
"traineredit.info.moves": "Moves",
"traineredit.info.level": "Level",
"traineredit.info.evs": "EVs",
Expand All @@ -181,7 +181,7 @@

"traineredit.button.home": "Back",
"traineredit.button.delete": "Delete",
"traineredit.button.newPokémob": "Add New",
"traineredit.button.newpokemob": "Add New",
"traineredit.button.rewards": "Rewards",
"traineredit.button.trades": "Trades",
"traineredit.button.routes": "Routes",
Expand Down Expand Up @@ -211,14 +211,14 @@
"traineredit.button.leader": "Leader",
"traineredit.button.trader": "Trader",

"gui.jei.Pokémobs": "Pokémob Evolution",
"gui.jei.Pokémobs.interact": "Pokémob Interactions",
"gui.jei.Pokémobs.moves": "Pokémob Move Recipes",
"gui.jei.pokemobs": "Pokémob Evolution",
"gui.jei.pokemobs.interact": "Pokémob Interactions",
"gui.jei.pokemobs.moves": "Pokémob Move Recipes",

"gui.jei.Pokémob.gender.male": "Male",
"gui.jei.Pokémob.gender.female": "Female",
"gui.jei.pokemob.gender.male": "Male",
"gui.jei.pokemob.gender.female": "Female",

"gui.jei.Pokémob.nogender": "If not %s",
"gui.jei.pokemob.nogender": "If not %s",

"gui.jei.cloner.need_egg": "Also Requires an additional Egg in the Egg input slot",

Expand Down

0 comments on commit c307f14

Please sign in to comment.