Class GameAreaDisplay
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.rendering.RenderComponent
com.deco2800.game.ui.UIComponent
com.deco2800.game.components.gamearea.GameAreaDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
Class that allows for overlaying the current map with displays and animation. Used for crafting, inventory, NPCs and
puase menu
-
Field Summary
FieldsFields inherited from class com.deco2800.game.ui.UIComponent
skin, stage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.com.badlogic.gdx.scenes.scene2d.Actor[]
Creates the appropriate image and label entries for key labelling as actors then returns them.void
Displays the first page of the catalogue menu and adds event handlers for buttonsvoid
Displays the second page of the catalogue menu and adds event handlers for buttons.void
Displays the items that the player has equipped.void
Displays the inventory UI.void
Displays each item in the inventory in the inventory storage blocks.void
void
dispose()
Called when the component is disposed.void
Disposes the crafting menu by deleting all the elements from the screen and also resets the boxes to make it like new when opened again.void
Disposes the inventory display group.void
Dispose the keybinding menu groupvoid
Disposes of the minimap when it is open and M is pressed.void
Method that disposes the pause menu by removing all the elements present on the screenvoid
Removes the elements of the player guide menu from the map.void
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draw the renderable.int
Returns the file path used for the playerGuideMenu backgroundvoid
Load the all assets required for displaying inventoryvoid
Opens an overlay crafting menu when 'Q' is pressed.void
Creates the keybinding menu.void
Loads all the required elements for the overlay when the pause button is pressed by the user.void
setPlayerGuideMenu
(String filePath) Loads the elements required to provide tutorials for the player when first using the crafting system.void
Toggles the skill tree displayvoid
Methods inherited from class com.deco2800.game.ui.UIComponent
getLayer, getZIndex
Methods inherited from class com.deco2800.game.rendering.RenderComponent
compareTo, render
Methods inherited from class com.deco2800.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.deco2800.game.rendering.Renderable
render
-
Field Details
-
minimapImage
public com.badlogic.gdx.scenes.scene2d.ui.Image minimapImage
-
-
Constructor Details
-
GameAreaDisplay
-
-
Method Details
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.- Overrides:
create
in classUIComponent
-
getGameAreaName
-
displayMinimap
public void displayMinimap() -
disposeMinimap
public void disposeMinimap()Disposes of the minimap when it is open and M is pressed. -
updateInventoryDisplay
public void updateInventoryDisplay() -
initialiseInventoryDisplay
public void initialiseInventoryDisplay()Load the all assets required for displaying inventory -
displayInventoryMenu
public void displayInventoryMenu()Displays the inventory UI. -
displayEquipables
public void displayEquipables()Displays the items that the player has equipped. -
displayItems
public void displayItems()Displays each item in the inventory in the inventory storage blocks. Implemented by Team 2. -
disposeInventoryMenu
public void disposeInventoryMenu()Disposes the inventory display group. -
openCraftingMenu
public void openCraftingMenu()Opens an overlay crafting menu when 'Q' is pressed. Creates assets based on users' inventory and creates button event handlers to test for user clicks. -
setPauseMenu
public void setPauseMenu()Loads all the required elements for the overlay when the pause button is pressed by the user. -
disposePauseMenu
public void disposePauseMenu()Method that disposes the pause menu by removing all the elements present on the screen -
setPlayerGuideMenu
Loads the elements required to provide tutorials for the player when first using the crafting system.- Parameters:
filePath
- the asset to be loaded and showed when the tutorial is active.
-
getPlayerGuideMenu
Returns the file path used for the playerGuideMenu background- Returns:
- Filepath of the playerGuideMeny background
-
disposePlayerGuideMenu
public void disposePlayerGuideMenu()Removes the elements of the player guide menu from the map. -
setKeyBindMenu
public void setKeyBindMenu()Creates the keybinding menu. Adds the background images, key images, key texts, and next button to navigate the menu. Utilises modulo technique to ensure page changing simply loops. -
disposeKeyBindMenu
public void disposeKeyBindMenu()Dispose the keybinding menu group -
createKeyBindings
public com.badlogic.gdx.scenes.scene2d.Actor[] createKeyBindings()Creates the appropriate image and label entries for key labelling as actors then returns them.- Returns:
- Actor[] Key images and label actors
-
displayCatOne
public void displayCatOne()Displays the first page of the catalogue menu and adds event handlers for buttons -
displayCatTwo
public void displayCatTwo()Displays the second page of the catalogue menu and adds event handlers for buttons. -
disposeCraftingMenu
public void disposeCraftingMenu()Disposes the crafting menu by deleting all the elements from the screen and also resets the boxes to make it like new when opened again. -
getFirstTime
public int getFirstTime() -
toggleSkillTree
public void toggleSkillTree()Toggles the skill tree display -
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Description copied from class:RenderComponent
Draw the renderable. Should be called only by the renderer, not manually.- Specified by:
draw
in classRenderComponent
- Parameters:
batch
- Batch to render to.
-
dispose
public void dispose()Description copied from class:Component
Called when the component is disposed. Dispose of any internal resources here.- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classRenderComponent
-