user-event-id renamed to custom-event-id
This commit is contained in:
parent
3bc51f264d
commit
ff50528e09
|
@ -15,7 +15,7 @@ class Audio(GameChild):
|
||||||
def __init__(self, game):
|
def __init__(self, game):
|
||||||
GameChild.__init__(self, game)
|
GameChild.__init__(self, game)
|
||||||
self.load_fx()
|
self.load_fx()
|
||||||
self.subscribe_to(self.get_user_event_id(), self.mute)
|
self.subscribe_to(self.get_custom_event_id(), self.mute)
|
||||||
|
|
||||||
def load_fx(self):
|
def load_fx(self):
|
||||||
fx = {}
|
fx = {}
|
||||||
|
|
|
@ -101,7 +101,7 @@ class Configuration(RawConfigParser):
|
||||||
set_option(section, "capture-screen", "K_F9")
|
set_option(section, "capture-screen", "K_F9")
|
||||||
section = "event"
|
section = "event"
|
||||||
add_section(section)
|
add_section(section)
|
||||||
set_option(section, "user-event-id", "USEREVENT")
|
set_option(section, "custom-event-id", "USEREVENT")
|
||||||
set_option(section, "command-event-name", "command")
|
set_option(section, "command-event-name", "command")
|
||||||
|
|
||||||
def read(self, filenames):
|
def read(self, filenames):
|
||||||
|
|
|
@ -27,7 +27,7 @@ class Game(GameChild, Animation):
|
||||||
pygame.init()
|
pygame.init()
|
||||||
self.set_children()
|
self.set_children()
|
||||||
self.subscribe_to(QUIT, self.end)
|
self.subscribe_to(QUIT, self.end)
|
||||||
self.subscribe_to(self.get_user_event_id(), self.end)
|
self.subscribe_to(self.get_custom_event_id(), self.end)
|
||||||
self.clear_queue()
|
self.clear_queue()
|
||||||
self.delegate.enable()
|
self.delegate.enable()
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,9 @@ class GameChild:
|
||||||
def is_debug_mode(self):
|
def is_debug_mode(self):
|
||||||
return "-d" in argv
|
return "-d" in argv
|
||||||
|
|
||||||
def get_user_event_id(self):
|
def get_custom_event_id(self):
|
||||||
return globals()[self.get_configuration().get("event",
|
return globals()[self.get_configuration().get("event",
|
||||||
"user-event-id")]
|
"custom-event-id")]
|
||||||
|
|
||||||
def is_command(self, evt, cmd):
|
def is_command(self, evt, cmd):
|
||||||
name = self.get_configuration().get("event", "command-event-name")
|
name = self.get_configuration().get("event", "command-event-name")
|
||||||
|
|
|
@ -12,7 +12,7 @@ class ScreenGrabber(GameChild):
|
||||||
|
|
||||||
def __init__(self, game):
|
def __init__(self, game):
|
||||||
GameChild.__init__(self, game)
|
GameChild.__init__(self, game)
|
||||||
self.subscribe_to(self.get_user_event_id(), self.save_display)
|
self.subscribe_to(self.get_custom_event_id(), self.save_display)
|
||||||
|
|
||||||
def save_display(self, event):
|
def save_display(self, event):
|
||||||
if self.is_command(event, "capture-screen"):
|
if self.is_command(event, "capture-screen"):
|
||||||
|
|
Loading…
Reference in New Issue