6
6
debug = logger .debug
7
7
info = logger .info
8
8
warn = logger .warn
9
+
10
+ import talkshowUtils
11
+ def loadImage (path ):
12
+ newpath = talkshowUtils .getRelativePath (path )
13
+ return pyglet .image .load (newpath )
14
+
9
15
10
16
class CommandBar (object ):
11
17
@@ -59,7 +65,7 @@ def __init__(self, screen, orientation=0):
59
65
increaseY = int (self .style .warning .height ) + self .imagePadding [0 ] + self .imagePadding [2 ]
60
66
61
67
# create the warning button properties
62
- self .warningImage = pyglet . image . load (self .style .warning .background_image [5 :- 2 ])
68
+ self .warningImage = loadImage (self .style .warning .background_image [5 :- 2 ])
63
69
self .warningHeight = int (self .style .warning .height )
64
70
self .warningWidth = int (self .style .warning .width )
65
71
self .warningX = x
@@ -70,7 +76,7 @@ def __init__(self, screen, orientation=0):
70
76
y = y + increaseY
71
77
72
78
# create the home button properties
73
- self .homeImage = pyglet . image . load (self .style .home .background_image [5 :- 2 ])
79
+ self .homeImage = loadImage (self .style .home .background_image [5 :- 2 ])
74
80
self .homeHeight = int (self .style .home .height )
75
81
self .homeWidth = int (self .style .home .width )
76
82
self .homeX = x
@@ -81,7 +87,7 @@ def __init__(self, screen, orientation=0):
81
87
y = y + increaseY
82
88
83
89
# create the back button properties
84
- self .backImage = pyglet . image . load (self .style .back .background_image [5 :- 2 ])
90
+ self .backImage = loadImage (self .style .back .background_image [5 :- 2 ])
85
91
self .backHeight = int (self .style .back .height )
86
92
self .backWidth = int (self .style .back .width )
87
93
self .backX = x
@@ -92,7 +98,7 @@ def __init__(self, screen, orientation=0):
92
98
y = y + increaseY
93
99
94
100
# create the shutDown button properties
95
- self .shutDownImage = pyglet . image . load (self .style .shutDown .background_image [5 :- 2 ])
101
+ self .shutDownImage = loadImage (self .style .shutDown .background_image [5 :- 2 ])
96
102
self .shutDownHeight = int (self .style .shutDown .height )
97
103
self .shutDownWidth = int (self .style .shutDown .width )
98
104
self .shutDownX = x
@@ -103,7 +109,7 @@ def __init__(self, screen, orientation=0):
103
109
y = y + increaseY
104
110
105
111
# create the settings button properties
106
- self .settingsImage = pyglet . image . load (self .style .settings .background_image [5 :- 2 ])
112
+ self .settingsImage = loadImage (self .style .settings .background_image [5 :- 2 ])
107
113
self .settingsHeight = int (self .style .settings .height )
108
114
self .settingsWidth = int (self .style .settings .width )
109
115
self .settingsX = x
@@ -129,7 +135,7 @@ def __init__(self, screen, orientation=0):
129
135
increaseY = int (self .style .volumeDown .height ) + self .imagePadding [0 ] + self .imagePadding [2 ]
130
136
131
137
# create the volumeDown button properties
132
- self .volumeDownImage = pyglet . image . load (self .style .volumeDown .background_image [5 :- 2 ])
138
+ self .volumeDownImage = loadImage (self .style .volumeDown .background_image [5 :- 2 ])
133
139
self .volumeDownHeight = int (self .style .volumeDown .height )
134
140
self .volumeDownWidth = int (self .style .volumeDown .width )
135
141
self .volumeDownX = x
@@ -140,7 +146,7 @@ def __init__(self, screen, orientation=0):
140
146
y = y + increaseY
141
147
142
148
# create the volumeUp button properties
143
- self .volumeUpImage = pyglet . image . load (self .style .volumeUp .background_image [5 :- 2 ])
149
+ self .volumeUpImage = loadImage (self .style .volumeUp .background_image [5 :- 2 ])
144
150
self .volumeUpHeight = int (self .style .volumeUp .height )
145
151
self .volumeUpWidth = int (self .style .volumeUp .width )
146
152
self .volumeUpX = x
@@ -161,7 +167,7 @@ def __init__(self, screen, orientation=0):
161
167
162
168
163
169
# create the playPrevious button properties
164
- self .playPreviousImage = pyglet . image . load (self .style .playPrevious .background_image [5 :- 2 ])
170
+ self .playPreviousImage = loadImage (self .style .playPrevious .background_image [5 :- 2 ])
165
171
self .playPreviousHeight = int (self .style .playPrevious .height )
166
172
self .playPreviousWidth = int (self .style .playPrevious .width )
167
173
self .playPreviousX = x
@@ -172,7 +178,7 @@ def __init__(self, screen, orientation=0):
172
178
y = y + increaseY
173
179
174
180
# create the play button properties
175
- self .playImage = pyglet . image . load (self .style .play .background_image [5 :- 2 ])
181
+ self .playImage = loadImage (self .style .play .background_image [5 :- 2 ])
176
182
self .playHeight = int (self .style .play .height )
177
183
self .playWidth = int (self .style .play .width )
178
184
self .playX = x
@@ -183,7 +189,7 @@ def __init__(self, screen, orientation=0):
183
189
y = y + increaseY
184
190
185
191
# create the playNext button properties
186
- self .playNextImage = pyglet . image . load (self .style .playNext .background_image [5 :- 2 ])
192
+ self .playNextImage = loadImage (self .style .playNext .background_image [5 :- 2 ])
187
193
self .playNextHeight = int (self .style .playNext .height )
188
194
self .playNextWidth = int (self .style .playNext .width )
189
195
self .playNextX = x
0 commit comments