|
@@ -25,36 +25,42 @@ if __name__ == "__main__":
|
25
|
25
|
import util
|
26
|
26
|
t = util.getTarget()
|
27
|
27
|
|
|
28
|
+ # Loading fonts and graphics takes a while.
|
|
29
|
+ # So show a splash screen while the user waits.
|
28
|
30
|
splash = SplashScreen(t)
|
29
|
31
|
t.loop_start()
|
30
|
32
|
splash.draw()
|
31
|
33
|
t.loop_end()
|
32
|
34
|
|
|
35
|
+ # UbaBot is online
|
33
|
36
|
success = Manager(t)
|
34
|
37
|
success.add(ImageScreen(t, "drinka.gif", 0.2, 2, 20.0))
|
35
|
38
|
success.add(Solid(t, 1.0))
|
36
|
39
|
success.add(QRScreen(t, url, 30.0, "Drinks:", "tom-thumb", (255, 255, 255), (0, 0, 0)))
|
37
|
40
|
success.add(Solid(t, 1.0))
|
38
|
41
|
|
|
42
|
+ # UbaBot is offline
|
39
|
43
|
fail = Manager(t)
|
40
|
44
|
fail.add(ImageScreen(t, "attention.gif", 0.2, 2, 20.0, (0, 0, 0)))
|
41
|
|
- fail.add(ScrollText(t, "The UbaBot Cocktail machine is currently closed. Please come back later for more drinks!", "ib8x8u", 2))
|
|
45
|
+ fail.add(ScrollText(t, "The UbaBot Cocktail machine is currently closed. Please come back later for more drinks!", "lemon", 2, 75, camp_pink))
|
42
|
46
|
fail.add(Solid(t, 1.0))
|
43
|
47
|
fail.add(GameOfLife(t, 20, (0, 255, 0), (0, 0, 0), None, 2.0))
|
44
|
48
|
fail.add(Solid(t, 1.0))
|
45
|
49
|
|
|
50
|
+ # UbaBot status checker
|
46
|
51
|
d = CheckHTTP(url)
|
47
|
52
|
d.success(success)
|
48
|
53
|
d.fail(fail)
|
49
|
54
|
|
|
55
|
+ # Main "Menu"
|
50
|
56
|
m = Manager(t)
|
51
|
57
|
m.add(ScrollText(t, "#CCCAMP23", "lemon", 1, 75, camp_green))
|
52
|
58
|
m.add(Solid(t, 1.0))
|
53
|
59
|
m.add(ImageScreen(t, "Favicon.png", 0, 1, 10.0))
|
54
|
60
|
m.add(Solid(t, 1.0))
|
55
|
|
- m.add(ScrollText(t, "#CCCAMP23", "lemon", 1, 75, camp_pink))
|
|
61
|
+ m.add(d) # HTTP Check, either "success" or "fail"
|
56
|
62
|
m.add(Solid(t, 1.0))
|
57
|
|
- m.add(d)
|
|
63
|
+ m.add(ScrollText(t, "Your advertisement could appear here. Open a Pull Request on git.xythobuz.de/thomas/rgb-matrix-visualizer or send an e-mail to thomas@xythobuz.de", "iv18x16u", 2, 70, camp_green))
|
58
|
64
|
m.add(Solid(t, 1.0))
|
59
|
65
|
|
60
|
66
|
m.restart()
|