add multiple checks for missing sprites to avoid ic hanging
This commit is contained in:
parent
a85fbf0ab3
commit
346a521907
18
gameview.py
18
gameview.py
@ -336,7 +336,12 @@ class AOCharMovie(QtGui.QLabel):
|
|||||||
AOpath+"characters/"+p_char+"/"+p_emote+".gif",
|
AOpath+"characters/"+p_char+"/"+p_emote+".gif",
|
||||||
AOpath+"characters/"+p_char+"/(a)"+p_emote+".gif"
|
AOpath+"characters/"+p_char+"/(a)"+p_emote+".gif"
|
||||||
)
|
)
|
||||||
alt_path = AOpath+"characters/"+p_char+"/"+p_emote+".png"
|
alt_path = test_path(
|
||||||
|
AOpath+"characters/"+p_char+"/"+emote_prefix+p_emote+".png",
|
||||||
|
AOpath+"characters/"+p_char+"/"+emote_prefix+"/"+p_emote+".png",
|
||||||
|
AOpath+"characters/"+p_char+"/"+p_emote+".png",
|
||||||
|
AOpath+"characters/"+p_char+"/(a)"+p_emote+".png"
|
||||||
|
)
|
||||||
apng_path = test_path(
|
apng_path = test_path(
|
||||||
AOpath+"characters/"+p_char+"/"+emote_prefix+p_emote+".apng",
|
AOpath+"characters/"+p_char+"/"+emote_prefix+p_emote+".apng",
|
||||||
AOpath+"characters/"+p_char+"/"+emote_prefix+"/"+p_emote+".apng",
|
AOpath+"characters/"+p_char+"/"+emote_prefix+"/"+p_emote+".apng",
|
||||||
@ -352,8 +357,6 @@ class AOCharMovie(QtGui.QLabel):
|
|||||||
placeholder_path = AO2XPpath+"themes/default/oldplaceholder.gif"
|
placeholder_path = AO2XPpath+"themes/default/oldplaceholder.gif"
|
||||||
gif_path = ""
|
gif_path = ""
|
||||||
|
|
||||||
print apng_path, emote_prefix+p_emote
|
|
||||||
|
|
||||||
if apng_path:
|
if apng_path:
|
||||||
gif_path = apng_path
|
gif_path = apng_path
|
||||||
self.use_pillow = 1
|
self.use_pillow = 1
|
||||||
@ -396,12 +399,19 @@ class AOCharMovie(QtGui.QLabel):
|
|||||||
gif_path = ""
|
gif_path = ""
|
||||||
self.use_pillow = 0
|
self.use_pillow = 0
|
||||||
|
|
||||||
#if gif_path == placeholder_path or
|
|
||||||
if gif_path == "":
|
if gif_path == "":
|
||||||
gif_path = self.prev_gif_path
|
gif_path = self.prev_gif_path
|
||||||
|
# Second check just in case
|
||||||
|
if gif_path == "":
|
||||||
|
if exists(placeholder_path):
|
||||||
|
gif_path = placeholder_path
|
||||||
|
else:
|
||||||
|
gif_path = ""
|
||||||
else:
|
else:
|
||||||
self.prev_gif_path = gif_path
|
self.prev_gif_path = gif_path
|
||||||
|
|
||||||
|
print "[debug]", p_char, emote_prefix, p_emote, "(!) path is null!" if gif_path == "" else gif_path
|
||||||
|
|
||||||
if not self.use_pillow:
|
if not self.use_pillow:
|
||||||
self.m_movie.stop()
|
self.m_movie.stop()
|
||||||
self.m_movie.setFileName(gif_path)
|
self.m_movie.setFileName(gif_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user