-
Notifications
You must be signed in to change notification settings - Fork 0
/
pop_ups.py
56 lines (42 loc) · 1.73 KB
/
pop_ups.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Embedded file name: scripts/client/tutorial/gui/Scaleform/pop_ups.py
from gui.Scaleform.framework.entities.abstract.AbstractWindowView import AbstractWindowView
from tutorial.control import TutorialProxyHolder
from tutorial.data.events import ClickEvent
from tutorial.gui import GUI_EFFECT_NAME
from tutorial.gui.Scaleform.meta.TutorialDialogMeta import TutorialDialogMeta
from tutorial.logger import LOG_ERROR
class TutorialPopUp(AbstractWindowView, TutorialProxyHolder):
def __init__(self, content):
super(TutorialPopUp, self).__init__()
self._content = content
def _onMouseClicked(self, targetKey):
if targetKey in self._content:
targetID = self._content[targetKey]
if len(targetID):
self._gui.onGUIInput(ClickEvent(targetID))
else:
LOG_ERROR('ID of target is empty', targetKey)
else:
LOG_ERROR('Target not found in data', targetKey)
class TutorialDialog(TutorialPopUp, TutorialDialogMeta):
def _populate(self):
super(TutorialDialog, self)._populate()
self.as_setContentS(self._content.copy())
def _stop(self):
self._content.clear()
self._gui.effects.stop(GUI_EFFECT_NAME.SHOW_DIALOG, effectID=self.uniqueName)
def submit(self):
self._onMouseClicked('submitID')
self._stop()
def cancel(self):
self._onMouseClicked('cancelID')
self._stop()
def onWindowClose(self):
self.cancel()
class TutorialWindow(TutorialPopUp):
def _stop(self):
self._content.clear()
self._gui.effects.stop(GUI_EFFECT_NAME.SHOW_WINDOW, effectID=self.uniqueName)
def onWindowClose(self):
self._onMouseClicked('closeID')
self._stop()