WidgetManager

This page talks about the WidgetManager class

WidgetManager:

The WidgetManager class manages a list of Widget objects and a list of MainMenu widgets. It also has a WidgetLoading object that is used to load widgets from a file.

Fields

  • widgets: The list of widgets.

  • MainMenuWidgets: The list of MainMenu widgets.

  • widgetLoading: The WidgetLoading object used to load widgets from a file.

Methods

  • addWidget(Widget widget): Adds a widget to the list of widgets.

  • addMainMenuWidget(Widget widget): Adds a widget to the list of MainMenu widgets.

  • setWidgetLoading(WidgetLoading widgetLoading): Sets the widgetLoading object.

  • removeWidget(Widget widget): Removes a widget from the list of widgets.

  • removeMainMenuWidget(Widget widget): Removes a widget from the list of MainMenu widgets.

  • getWidgets(): Returns the list of all widgets.

  • getMainMenuWidgets(): Returns the list of all MainMenu widgets.

  • getOtherWidgets(Widget SelectedWidget): Returns a list of all widgets except for the specified widget.

  • saveWidgets(File file): Saves the state of all widgets to the given file using NBT tags.

  • loadWigdets(File file): Loads widgets from the given file using NBT tags and returns a list of loaded widgets.

  • loadMainMenuWigdets(File file): Loads MainMenu widgets from the given file using NBT tags and returns a list of loaded MainMenu widgets.