Commit | Line | Data |
---|---|---|
7ac52030 FC |
1 | from logging import info |
2 | from direct.showbase.DirectObject import DirectObject | |
3 | from ya2.utils.cursor import MouseCursor | |
4 | ||
5 | ||
6 | class BasePage(DirectObject): | |
7 | ||
8 | def __init__(self, menu, running_functional_tests): | |
9 | super().__init__() | |
10 | self._menu = menu | |
11 | self._enforced_resolution = '' | |
12 | self._cursor = MouseCursor( | |
13 | 'assets/images/buttons/arrowUpLeft.dds', (.04, 1, .04), (.5, .5, .5, 1), | |
14 | (.01, .01), running_functional_tests) | |
15 | ||
16 | def enforce_resolution(self, resolution): | |
17 | self._enforced_resolution = resolution | |
18 | info('enforced resolution: ' + resolution) | |
19 | ||
20 | def on_back(self): | |
21 | self._option_file.store() | |
22 | self._menu.set_page('main') | |
23 | self.destroy() | |
24 | ||
25 | def destroy(self): | |
26 | [wdg.destroy() for wdg in self._widgets] | |
27 | self._cursor.destroy() | |
28 | self.ignore('enforce_resolution') | |
29 | self._menu = None |