Skip to content

Commit

Permalink
Finished working on context box UI (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abishtu committed Oct 14, 2022
1 parent 23b72c5 commit 0454d2d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
Binary file modified source/core/assets/images/context_box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion source/core/src/main/com/deco2800/game/GdxGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ private Screen newScreen(ScreenType screenType) {
case MAIN_MENU:
return new MainMenuScreen(this);
case GAME_STORY:

return new StoryScreen(this);
case MAIN_GAME:
return new MainGameScreen(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class AtlantisGameArea extends GameArea {
"images/city_tile.png",
// "images/box_boy_leaf.png",
// "images/box_boy.png",
// "images/Base_Highlight.png",
"images/Base_Highlight.png",
// "images/box_boy_highlight.png",
"images/tree.png",
"images/iso_grass_1.png",
Expand Down Expand Up @@ -170,7 +170,7 @@ public class AtlantisGameArea extends GameArea {
"images/spellbox-zeus.png",
"images/spell-btn-unclickable.png",
"images/spell-btn.png",
"images/health bar_6.png",
"images/health bar_6.png"
};

/* TODO: remove unused textures wasting precious resources */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class TutorialGameArea extends GameArea {
"images/Ocean.png",
"images/Sand.png",
"images/Grass.png",
"images/sand_starfish.png",
"images/sand_shell.png",
"images/box_boy_leaf.png",
"images/box_boy.png",
"images/Base_Highlight.png",
Expand Down Expand Up @@ -95,6 +97,7 @@ public class TutorialGameArea extends GameArea {
"images/hoplite.png",
"images/spearman.png",
"images/simpleman.png",
"test/files/cityMinimap.png"
};

public TutorialGameArea(AtlantisTerrainFactory terrainFactory, DialogueBoxDisplay display) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected void draw(SpriteBatch batch) {
case TOWNHALL -> buildingName = "Town Hall";
case WALL, CONNECTOR_EW, CONNECTOR_NS -> buildingName = "Wall";
case GATE_EW, GATE_NS -> buildingName = "Gate";
case TREBUCHET -> buildingName = "Canon (" + buildingInfo.getType() + ")";
case TREBUCHET -> buildingName = "Canon (" + buildingInfo.getLevel() + ")";
case LIBRARY -> buildingName = "Library";
case FARM -> buildingName = "Farm";
case BLACKSMITH -> buildingName = "Blacksmith";
Expand Down Expand Up @@ -118,15 +118,14 @@ protected void draw(SpriteBatch batch) {
inventoryLabel.setPosition(184f, 68f);
inventoryLabel.setSize(208f, 85f);
inventoryLabel.setWrap(true);
buildingImage.setPosition(183f, 166f);
buildingImage.setSize(209f, 96f);
buildingImage.setPosition(183f, 60f);
buildingImage.setSize(209f, 209f);

contextBoxItems.addActor(contextBoxSprite);
contextBoxItems.addActor(buildingNameLabel);
contextBoxItems.addActor(statsLabel);
contextBoxItems.addActor(attributesLabel);
contextBoxItems.addActor(buildingImage);
contextBoxItems.addActor(inventoryLabel);
} else {
contextBoxItems.remove();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@ public static Entity createTownHall() {
MapComponent mp = new MapComponent();
mp.display();
mp.setDisplayColour(Color.BROWN);
townHall.addComponent(new TextureRenderComponent("images/base.png"))
townHall.addComponent(new TextureRenderComponent("images/level 1 town hall.png"))
.addComponent(new BuildingActions(config.type, config.level))
.addComponent(new CombatStatsComponent(config.health, config.baseAttack, config.baseDefence))
.addComponent(new ResourceStatsComponent(stats.wood, stats.stone, stats.metal))
.addComponent(new BaseComponent())
.addComponent(new HighlightedTextureRenderComponent("images/Base_Highlight.png"))
.addComponent(new HighlightedTextureRenderComponent("images/level_1_town_hall_Highlight.png"))
.addComponent(new BuildingUIDataComponent())
.addComponent(mp)
.addComponent(new TextureScaler(leftPoint, maxX, maxY))
.addComponent(new SelectionCollider())
Expand Down

0 comments on commit 0454d2d

Please sign in to comment.