-
Notifications
You must be signed in to change notification settings - Fork 0
/
pop_ups.py
93 lines (73 loc) · 3.45 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# 2015.11.18 11:58:32 Støední Evropa (bìžný èas)
# 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
from gui.Scaleform.locale.BATTLE_TUTORIAL import BATTLE_TUTORIAL
from helpers import i18n
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 _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 TutorialQueueDialog(TutorialDialog):
def _populate(self):
super(TutorialQueueDialog, self)._populate()
data = self._content
pointcuts = data['timePointcuts']
firstPntCut = pointcuts[0]
lastPntCut = pointcuts[len(pointcuts) - 1]
self.as_setContentS({'title': data['title'],
'message': data['message'],
'playerTimeTextStart': data['playerTimeTextStart'],
'playerTimeTextEnd': data['playerTimeTextEnd'],
'avgTimeText': data['avgTimeText'],
'updatePeriod': 60,
'timePointcuts': {'firstPointcut': {'value': firstPntCut,
'text': i18n.makeString(BATTLE_TUTORIAL.LABELS_LESS_N_MINUTES, minutes=firstPntCut)},
'lastPointcut': {'value': lastPntCut,
'text': i18n.makeString(BATTLE_TUTORIAL.LABELS_MORE_N_MINUTES, minutes=lastPntCut)},
'betweenPointcutsTextAlias': BATTLE_TUTORIAL.LABELS_MINUTES}})
def as_updateContentS(self, data):
return super(TutorialQueueDialog, self).as_updateContentS({'avgTimeText': data['avgTimeText']})
class TutorialGreetingDialog(TutorialDialog):
def _populate(self):
super(TutorialGreetingDialog, self)._populate()
data = self._content
self.as_setContentS({'message': data['message'],
'imageUrl': data['imageUrl'],
'timeNoteValue': data['timeNoteValue'],
'bonuses': data['bonuses']})
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()
# okay decompyling c:\Users\PC\wotsources\files\originals\res\scripts\client\tutorial\gui\scaleform\pop_ups.pyc
# decompiled 1 files: 1 okay, 0 failed, 0 verify failed
# 2015.11.18 11:58:32 Støední Evropa (bìžný èas)