wm_tweaks.py set title less often
Only set the title once when a song is loaded, using a default argument if no title is provided.
This commit is contained in:
parent
db939b57a5
commit
101e833690
|
@ -6,22 +6,22 @@ lib_find_id = libsaria.collection.lib_find_id
|
|||
lib_get_attr = libsaria.collection.lib_get_attr
|
||||
invite = libsaria.event.invite
|
||||
|
||||
def reset(*args):
|
||||
ocarina.set_window_icon("images/ocarina.png")
|
||||
ocarina.set_window_title(ocarina.__vers__)
|
||||
|
||||
def tweak_icon(file):
|
||||
if file != None:
|
||||
ocarina.set_window_icon(file)
|
||||
else:
|
||||
ocarina.set_window_icon("images/ocarina.png")
|
||||
|
||||
def tweak_title(filepath):
|
||||
if filepath != None:
|
||||
id = lib_find_id(filepath)
|
||||
title = lib_get_attr(id, "title")
|
||||
ocarina.set_window_title(title)
|
||||
else:
|
||||
title = ocarina.__vers__
|
||||
ocarina.set_window_title(title)
|
||||
|
||||
def start():
|
||||
invite("PRELOAD", reset)
|
||||
invite("POSTLOAD", tweak_title)
|
||||
invite("POSTGETART", tweak_icon)
|
||||
|
||||
|
|
Loading…
Reference in New Issue