summaryrefslogtreecommitdiff
path: root/src/sliceitoff/menu/settings.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-04-27 16:26:22 +0300
committerViljami Ilola <+@hix.fi>2024-04-27 16:26:22 +0300
commit9f8247dc4da89219b6eede08d58d96964391a077 (patch)
treea6f7dc46275a3988fc528072f5e70caba461fae0 /src/sliceitoff/menu/settings.py
parentd64c6b122eacd7b33bbda3a62093b492c786b1f9 (diff)
refactor menus and screen showing under menu subpkg
Diffstat (limited to 'src/sliceitoff/menu/settings.py')
-rw-r--r--src/sliceitoff/menu/settings.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/sliceitoff/menu/settings.py b/src/sliceitoff/menu/settings.py
new file mode 100644
index 0000000..2d3f594
--- /dev/null
+++ b/src/sliceitoff/menu/settings.py
@@ -0,0 +1,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()