omegaHeroNotifications.py (1888B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\omega\upsell\omegaHeroNotifications.py 2 import datetime 3 import eveui 4 import gametime 5 import trinity 6 import uthread2 7 from carbon.client.script.environment.AudioUtil import PlaySound 8 from carbonui import Align, uiconst 9 from carbonui.text.styles import TextHeadline 10 from carbonui.primitives.sprite import StreamingVideoSprite 11 from carbonui.uianimations import animations 12 from eve.client.script.ui.heronotification.animation import garble_reveal_label 13 from eve.client.script.ui.heronotification.golden import GoldenPositionContainerAutoSize 14 15 def omega_hero_notification(parent, text): 16 PlaySound('fanfare_low_priority_play') 17 container = GoldenPositionContainerAutoSize(parent=parent, alignMode=Align.CENTER, state=uiconst.UI_DISABLED) 18 secBeforeFadeOut = 3.9 19 video = StreamingVideoSprite(parent=container, align=Align.CENTER, pos=(0, 0, 900, 900), videoPath='res:/video/omega/omega_activated.webm', spriteEffect=trinity.TR2_SFX_COPY, blendMode=trinity.TR2_SBM_ADD) 20 21 def play_video(): 22 video.Play() 23 while not video.isFinished and not video.destroyed: 24 eveui.wait_for_next_frame() 25 26 def show_label(): 27 label = TextHeadline(parent=container, align=Align.CENTER, maxLines=1, opacity=0.0) 28 then = gametime.GetWallclockTime() 29 garble_reveal_label(label=label, text=text, step_duration=datetime.timedelta(milliseconds=15), time_offset=datetime.timedelta(milliseconds=2000)) 30 duration = gametime.GetSecondsSinceWallclockTime(then) 31 time_offset = max(0, secBeforeFadeOut - duration) 32 uthread2.sleep(time_offset) 33 animations.FadeOut(label, duration=0.25) 34 35 video_thread = uthread2.start_tasklet(play_video) 36 label_thread = uthread2.start_tasklet(show_label) 37 label_thread.get() 38 video_thread.get()