summaryrefslogtreecommitdiff
path: root/src/sliceitoff/menu/settings.py
blob: 2d3f594e682c77b2a3cfbfc6bb1b00100a86cf75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
""" menu.settings - Settings dialog """
from enum import IntEnum

from sliceitoff.sfx import sfx
from sliceitoff.screens import settings_screen
from .menu import Menu


class SettingsItems(IntEnum):
    """ Items in the menu. Should match settings_screen """
    SFX = 0
    MUSIC = 1
    BACK = 2

class SettingsMenu(Menu):
    """ Settings menu """
    def __init__(self):
        super().__init__(settings_screen, len(SettingsItems))

    def do_selection(self):
        """ Custom actions for menu entries """
        match self.selection:
            case SettingsItems.BACK:
                self.do_fadeout()
            case SettingsItems.SFX:
                sfx.sfx_up()
            case SettingsItems.MUSIC:
                sfx.music_up()