New funtionalities - UQdeco2800/2022-studio-2 GitHub Wiki

Introduction

This wiki page gives a summary of the feature optimisations made in sprint 4.

Multiple drop-down menus handling

The previous inventory display functions were not well-structure. Multiple drop-down menu can be shown in the inventory. In this sprint, this problem is fixed by restructuring the display function.

Now drop-down menu buttons have their own group and is cleared whenever the item buttons are clicked. This will ensure maximum 1 drop-down menu will be displayed on the screen;

    private Group dropdownGroup = new Group();

Multiple pop-up screen handling

In the previous sprints, multiple pop-up screens can be opened and pauses the game unintentionally. To resolve this, I have implemented a flag to check if a menu is currently opened and stop other menus from opening.

  private static Enum currentMenu = MenuTypes.NONE;
  public enum MenuTypes{
    INVENTORY,
    CRAFTING,
    MINIMAP,
    PAUSEMENU,
    NONE
  }

By default, the flag will be set to none. The menus can only be opened/closed if the flag state equals NONE or the type of the menu itself.

Back to Inventory Page

Author

  • Li-Sung Ou
  • GitHub: @PeterOu8
  • Discord: Secret Agent Randy Beans#6754
  • Slack: Li-Sung Ou
⚠️ **GitHub.com Fallback** ⚠️