-
Notifications
You must be signed in to change notification settings - Fork 1
/
musicviewer_four_nowplaying.rpy
71 lines (62 loc) · 2.75 KB
/
musicviewer_four_nowplaying.rpy
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
init:
python in musicviewer_four:
from musicviewer_four_metalookup import metalookup
class NowPlayingManager():
def __init__(self):
self.prev_nowplaying = None
def __call__(self):
if not renpy.store.persistent.musicviewer_four_nowplaying_off:
nowplaying = renpy.music.get_playing()
if (nowplaying and (nowplaying != self.prev_nowplaying)) or (renpy.store.persistent.musicviewer_four_nowplaying_alwayson and not renpy.get_screen("musicviewer_four_nowplaying")):
renpy.show_screen("musicviewer_four_nowplaying",nowplaying, metalookup(nowplaying))
self.prev_nowplaying = nowplaying
elif renpy.get_screen("musicviewer_four_nowplaying"):
renpy.hide_screen("musicviewer_four_nowplaying")
self.prev_nowplaying = None
renpy.store.config.start_interact_callbacks.append(NowPlayingManager())
transform musicviewer_four_nowplaying_tf:
anchor (1.0, 0.0)
align (1.0, 0.0)
alpha 0.0 zoom 0.8
on show:
ease 1.2 alpha 0.8 zoom 1.0
on hide:
ease 0.8 alpha 0.0 zoom 1.1
on replace:
ease 1.0 alpha 0.8 zoom 1.0
on replaced:
ease 0.8 alpha 0.0 zoom 1.1
zoom 0.8
screen musicviewer_four_nowplaying(nowplaying, meta):
frame:
at musicviewer_four_nowplaying_tf
background Frame(renpy.display.im.FactorScale("image/ui/musicviewer_four_nowplaying_bg.png",2), 136, 20, 20, 136, tile=True)
padding (140, 0, 0, 130)
has vbox
if nowplaying is None:
text "- None -"
else: # Is metadata dict
if 'title' in meta:
if meta['title'] == nowplaying:
text nowplaying
else:
text meta['title']
if renpy.store.persistent.musicviewer_four_nowplaying_show_filenames:
text nowplaying:
size 26
else:
text nowplaying
if 'artist' in meta:
text meta['artist']:
xanchor 1.0
xalign 1.0
size 26
color "#ddd"
if 'album' in meta:
text meta['album']:
xanchor 1.0
xalign 1.0
size 24
color "#ddd"
if not persistent.musicviewer_four_nowplaying_alwayson:
timer 6.0 action Hide("musicviewer_four_nowplaying")