Class GameAreaDisplay

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, Renderable, Comparable<Renderable>

public class GameAreaDisplay extends UIComponent
Class that allows for overlaying the current map with displays and animation. Used for crafting, inventory, NPCs and puase menu
  • Field Details

    • minimapImage

      public com.badlogic.gdx.scenes.scene2d.ui.Image minimapImage
  • Constructor Details

    • GameAreaDisplay

      public GameAreaDisplay(String gameAreaName)
  • 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 class UIComponent
    • getGameAreaName

      public String 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

      public void setPlayerGuideMenu(String filePath)
      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

      public String 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 class RenderComponent
      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 interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent