Refactoring the MineColonies Townhall Statistics

in #utopian-io9 years ago (edited)

image.png

Image Source

This was my first development contribution to the above-stated project. It basically was an assignment from @raycoms to refactor the townhall statistics that instead of displaying the citizens's occupation statically (each of the worker roles are in a switch statement), the count of workers per job will be dynamically generated.

Here's a screenshot of the implementation prior to the refactor.

Pre-Refactor

image.png

And here are the townhall statistics after refactor.

Post-Refactor

image.png

Pull Request

Here's the link to the merged PR.

https://github.com/Minecolonies/minecolonies/pull/1946

Modified Codes

And here are some screenshots of the codes modified.

  • src/main/java/com/minecolonies/coremod/client/gui/WindowTownHall.java

screenshot-utopian.io-2018-01-08-09-23-44-365.png

  • src/main/resources/assets/minecolonies/gui/windowtownhall.xml

screenshot-github.com-2018-01-08-09-25-08-034.png

  • src/main/resources/assets/minecolonies/lang/en_ca.lang
  • src/main/resources/assets/minecolonies/lang/en_uk.lang
  • src/main/resources/assets/minecolonies/lang/en_us.lang

screenshot-github.com-2018-01-08-09-26-57-836.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @eastmael I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

How can i see..

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.098
BTC 62553.97
ETH 1769.55
USDT 1.00
SBD 0.38