Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes in Townhall GUI #2865

Merged
merged 2 commits into from
Sep 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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