blank resource path; undefined icon
This commit is contained in:
parent
157e6fde4d
commit
9a00514637
|
@ -25,6 +25,7 @@ class Display(GameChild):
|
|||
self.dimensions = config["dimensions"]
|
||||
self.caption = config["caption"]
|
||||
self.windowed_flag = config["windowed-flag"]
|
||||
self.icon_path = self.get_resource("display", "icon-path")
|
||||
self.mouse_visibility = self.get_configuration("mouse", "visible")
|
||||
|
||||
def align_window(self):
|
||||
|
@ -48,9 +49,9 @@ class Display(GameChild):
|
|||
display.set_caption(self.caption)
|
||||
|
||||
def set_icon(self):
|
||||
if self.get_configuration().has_option("display", "icon-path"):
|
||||
path = self.get_resource("display", "icon-path")
|
||||
display.set_icon(image.load(path).convert_alpha())
|
||||
if self.icon_path:
|
||||
print self.icon_path
|
||||
display.set_icon(image.load(self.icon_path).convert_alpha())
|
||||
|
||||
def set_mouse_visibility(self, visibility=None):
|
||||
if visibility is None:
|
||||
|
|
|
@ -50,12 +50,13 @@ class GameChild:
|
|||
def get_resource(self, section, option):
|
||||
config = self.get_configuration()
|
||||
rel_path = config.get(section, option)
|
||||
for root in config.get("setup", "resource-search-path"):
|
||||
if self.is_shared_mode() and not self.is_absolute_path(root):
|
||||
continue
|
||||
path = join(root, rel_path)
|
||||
if exists(path):
|
||||
return path
|
||||
if rel_path:
|
||||
for root in config.get("setup", "resource-search-path"):
|
||||
if self.is_shared_mode() and not self.is_absolute_path(root):
|
||||
continue
|
||||
path = join(root, rel_path)
|
||||
if exists(path):
|
||||
return path
|
||||
self.print_debug("Couldn't find resource: {0}, {1}".\
|
||||
format(section, option))
|
||||
|
||||
|
|
Loading…
Reference in New Issue