Make new images safe.
authorSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 19:54:15 +0000 (21:54 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 19:54:15 +0000 (21:54 +0200)
koperkapel/scenes/menu.py

index b5d7815ebf36532bac8c50dd355a4a088917404e..956a4b109da76ba160fa4f60adc9d929e63d986c 100644 (file)
@@ -4,6 +4,7 @@ from pgzero.constants import keys
 from pgzero.loaders import images
 from ..actors.navigator import ActorNavigator
 from ..actors.orientatedsurf import OrientatedSurfActor, SelectableSurfActor
+from ..util import safepath
 from .base import Scene, ChangeSceneEvent, WorldEvent, QuitEvent
 
 
@@ -19,7 +20,7 @@ class MenuScene(Scene):
     def _init_bg(self):
         self.actors.default.clear()
         self.actors.default.add(OrientatedSurfActor(
-            images.load("splash/background")))
+            images.load(safepath("splash/background"))))
 
     def _init_buttons(self):
         self._nav = ActorNavigator()
@@ -39,8 +40,8 @@ class MenuScene(Scene):
 
     def _build_button(self, name, action):
         actor = SelectableSurfActor(
-            images.load("splash/%s" % (name,)),
-            images.load("splash/%s_selected" % (name,)))
+            images.load(safepath("splash/%s" % (name,))),
+            images.load(safepath("splash/%s_selected" % (name,))))
         actor.action = action
         return actor