Skip to content

Commit

Permalink
I'm dumb, now officially (#2865)
Browse files Browse the repository at this point in the history
Fixes in Townhall GUI
  • Loading branch information
Nightenom authored and Raycoms committed Sep 9, 2018
1 parent 7f0fb1e commit 44e7eab
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ public final class TranslationConstants
public static final String CMCG_HAPPINESS_TOOLS = "com.minecolonies.coremod.gui.happiness.tools";
@NonNls
public static final String COM_MINECOLONIES_COREMOD_MOURN = "com.minecolonies.coremod.mourning";
@NonNls
public static final String CMC_GUI_TOWNHALL_BUILDING_LEVEL = "com.minecolonies.coremod.gui.townHall.buildingLevel";

private TranslationConstants()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,6 @@ public final class WindowConstants
public static final String FIELDS_MODIFIER = "farmsLevel";
public static final String TOOLS_MODIFIER = "toolsLevel";

/**
* Citizen view constants.
*/

/**
* The label to find the inventory button.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.jetbrains.annotations.NotNull;

import static com.minecolonies.api.util.constant.WindowConstants.*;
import static com.minecolonies.api.util.constant.TranslationConstants.CMC_GUI_TOWNHALL_BUILDING_LEVEL;

/**
* Manage windows associated with Buildings.
Expand Down Expand Up @@ -91,7 +92,16 @@ public void onUpdate()

if (title != null)
{
title.setLabelText(LanguageHandler.format(getBuildingName()) + " " + buildingView.getBuildingLevel());
if (switchView.getID().equals(GUI_LIST_BUTTON_SWITCH + PAGE_ACTIONS))
{
// Townhall does not need level in colony name
title.setLabelText(getBuildingName());
findPaneOfTypeByID(LEVEL_LABEL, Label.class).setLabelText(LanguageHandler.format(CMC_GUI_TOWNHALL_BUILDING_LEVEL) + ": " + buildingView.getBuildingLevel());
}
else
{
title.setLabelText(LanguageHandler.format(getBuildingName()) + " " + buildingView.getBuildingLevel());
}
}

updateButtonBuild(buildingView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
xsi:noNamespaceSchemaLocation="file:../../../../java/com/minecolonies/blockout/blockOut.xsd">

<switch id="switchpageActions" size="100% 100%">
<view>
<view id="pageActions">
<label size="148 11" color="green" pos="25 24"
label="$(com.minecolonies.coremod.gui.townHall.currTownHallName)"/>
<label size="148 11" id="name" color="black" pos="25 35"/>
<label size="135 11" id="level" color="black" pos="38 69"/>

<button id="build" size="120 19" pos="38 84"
label="$(com.minecolonies.coremod.gui.townHall.build)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</list>

<label id="totalCitizens" size="148 11" pos="25 61" color="black"/>
<list id="citizen-stats" size="148 150" pos="25 83">
<list id="citizen-stats" size="148 136" pos="25 83">
<box size="100% 11" linewidth="0">
<label id="citizensAmount" size="100% 11" color="black"/>
</box>
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/minecolonies/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -794,3 +794,5 @@ com.minecolonies.coremod.progress.not_enough_jobs=§6 Building more citizen huts
com.minecolonies.coremod.gui.townHall.printProgress=Print help messages:
com.minecolonies.coremod.gui.townHall.on=On
com.minecolonies.coremod.gui.townHall.off=Off

com.minecolonies.coremod.gui.townHall.buildingLevel=Building level

0 comments on commit 44e7eab

Please sign in to comment.