# ModalUiHandler | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# Class ModalUiHandler`Abstract`

A basic abstract class to act as a holder and processor for UI elements.

#### Hierarchy (View Summary)

- default
  - ModalUiHandler
    - FormModalUiHandler
    - default
    - default
    - default

- Defined in src/ui/modal-ui-handler.ts:12

##### Index

### Constructors

constructor

### Properties

active
buttonBgs
buttonContainers
buttonLabels
cursor
modalBg
modalContainer
mode
titleText

### Methods

addInteractionHoverEffect
clear
destroy
getButtonLabels
getButtonTopMargin
getCursor
getHeight
getMargin
getModalTitle
getTextColor
getUi
getWidth
processInput
setCursor
setMouseCursorStyle
setup
show
updateContainer

## Constructors

### constructor

- new ModalUiHandler(mode?: null | Mode ): ModalUiHandler

  #### Parameters

  - mode: null | Mode = null

  #### Returns ModalUiHandler

  Overrides default.constructor

  - Defined in src/ui/modal-ui-handler.ts:20

## Properties

### active

active: boolean = false

Inherited from default.active

- Defined in src/ui/ui-handler.ts:13

### `Protected` buttonBgs

buttonBgs: NineSlice[]

- Defined in src/ui/modal-ui-handler.ts:17

### `Protected` buttonContainers

buttonContainers: Container[]

- Defined in src/ui/modal-ui-handler.ts:16

### `Protected` buttonLabels

buttonLabels: Text[]

- Defined in src/ui/modal-ui-handler.ts:18

### `Protected` cursor

cursor: number = 0

Inherited from default.cursor

- Defined in src/ui/ui-handler.ts:12

### `Protected` modalBg

modalBg: NineSlice

- Defined in src/ui/modal-ui-handler.ts:14

### `Protected` modalContainer

modalContainer: Container

- Defined in src/ui/modal-ui-handler.ts:13

### `Protected` mode

mode: null | number

Inherited from default.mode

- Defined in src/ui/ui-handler.ts:11

### `Protected` titleText

titleText: Text

- Defined in src/ui/modal-ui-handler.ts:15

## Methods

### `Protected` addInteractionHoverEffect

- addInteractionHoverEffect(gameObject: Sprite | Image | NineSlice): void

  Adds a hover effect to a game object which changes the cursor to a `pointer` and tints it slighly

  #### Parameters

  - gameObject: Sprite | Image | NineSlice

    the game object to add hover events/effects to

  #### Returns void

  - Defined in src/ui/modal-ui-handler.ts:186

### clear

- clear(): void

  #### Returns void

  Overrides default.clear

  - Defined in src/ui/modal-ui-handler.ts:175

### destroy

- destroy(): void

  To be implemented by individual handlers when necessary to free memory Called when BattleScene is reset

  #### Returns void

  Inherited from default.destroy

  - Defined in src/ui/ui-handler.ts:69

### `Abstract` getButtonLabels

- getButtonLabels(config?: ModalConfig ): string[]

  #### Parameters

  - `Optional` config: ModalConfig

  #### Returns string[]

  - Defined in src/ui/modal-ui-handler.ts:36

### getButtonTopMargin

- getButtonTopMargin(): number

  #### Returns number

  - Defined in src/ui/modal-ui-handler.ts:38

### getCursor

- getCursor(): number

  #### Returns number

  Inherited from default.getCursor

  - Defined in src/ui/ui-handler.ts:40

### `Abstract` getHeight

- getHeight(config?: ModalConfig ): number

  #### Parameters

  - `Optional` config: ModalConfig

  #### Returns number

  - Defined in src/ui/modal-ui-handler.ts:32

### `Abstract` getMargin

- getMargin(config?: ModalConfig ): [number, number, number, number]

  #### Parameters

  - `Optional` config: ModalConfig

  #### Returns [number, number, number, number]

  - Defined in src/ui/modal-ui-handler.ts:34

### `Abstract` getModalTitle

- getModalTitle(config?: ModalConfig ): string

  #### Parameters

  - `Optional` config: ModalConfig

  #### Returns string

  - Defined in src/ui/modal-ui-handler.ts:28

### getTextColor

- getTextColor(style: TextStyle , shadow?: boolean): string

  #### Parameters

  - style: TextStyle
  - shadow: boolean = false

  #### Returns string

  Inherited from default.getTextColor

  - Defined in src/ui/ui-handler.ts:36

### getUi

- getUi(): default

  #### Returns default

  Inherited from default.getUi

  - Defined in src/ui/ui-handler.ts:32

### `Abstract` getWidth

- getWidth(config?: ModalConfig ): number

  #### Parameters

  - `Optional` config: ModalConfig

  #### Returns number

  - Defined in src/ui/modal-ui-handler.ts:30

### processInput

- processInput(_button: Button ): boolean

  #### Parameters

  - _button: Button

  #### Returns boolean

  Overrides default.processInput

  - Defined in src/ui/modal-ui-handler.ts:171

### setCursor

- setCursor(cursor: number): boolean

  #### Parameters

  - cursor: number

  #### Returns boolean

  Inherited from default.setCursor

  - Defined in src/ui/ui-handler.ts:44

### `Protected` setMouseCursorStyle

- setMouseCursorStyle(cursorStyle: "default" | "pointer"): void

  Changes the style of the mouse cursor.

  #### Parameters

  - cursorStyle: "default" | "pointer"

    cursor style to apply

  #### Returns void

  #### See

  https://developer.mozilla.org/en-US/docs/Web/CSS/cursor

  Inherited from default.setMouseCursorStyle

  - Defined in src/ui/ui-handler.ts:58

### setup

- setup(): void

  #### Returns void

  Overrides default.setup

  - Defined in src/ui/modal-ui-handler.ts:42

### show

- show(args: any[]): boolean

  #### Parameters

  - args: any[]

  #### Returns boolean

  Overrides default.show

  - Defined in src/ui/modal-ui-handler.ts:98

### updateContainer

- updateContainer(config?: ModalConfig ): void

  #### Parameters

  - `Optional` config: ModalConfig

  #### Returns void

  - Defined in src/ui/modal-ui-handler.ts:147