If you're having trouble or run into any bugs with the code, post a comment here! I will try to get back to you within a few days. Be sure to check the Controller Support Expansion section on my website too for documentation.
Comprehensive set of features to improve controller support in Ren'Py. · By
If you're having trouble or run into any bugs with the code, post a comment here! I will try to get back to you within a few days. Be sure to check the Controller Support Expansion section on my website too for documentation.
So I finally got around to testing this out! Unfortunately, I immediately ran into a crash:
I'm sorry, but an uncaught exception occurred. While running game code: File "game/script/system/plugins/controller_support/controller_config.rpy", line 313, in script init 999 python in pad_config: File "game/script/system/plugins/controller_support/controller_config.rpy", line 313, in script init 999 python in pad_config: File "game/script/system/plugins/controller_support/controller_config.rpy", line 316, in <module> FOCUS_MANAGERS = [FocusManager(x) for x in RESTORE_FOCUS_SCREENS] File "game/script/system/plugins/controller_support/controller_config.rpy", line 316, in <lambda> FOCUS_MANAGERS = [FocusManager(x) for x in RESTORE_FOCUS_SCREENS] File "game/script/system/plugins/controller_support/controller_config.rpy", line 316, in <listcomp> FOCUS_MANAGERS = [FocusManager(x) for x in RESTORE_FOCUS_SCREENS] File "game/script/system/plugins/controller_support/controller_functions.rpy", line 339, in __init__ self.is_showing = renpy.get_screen(self.screen) Exception: Unknown layer 'game_menu'.
I'm using a custom layer for my in-game menus (including the main menu), and that seems to be causing a problem.
Ooh I see! Yes I had not accounted for that. For now, can you see if this change to the FocusManager class in controller_functions.rpy will fix it?
def __init__(self, screen, layer=None): if isinstance(screen, tuple): self.screen = screen[0] self.layer = screen[1] else: self.screen = screen self.layer = layer self.is_showing = renpy.get_screen(self.screen) self.displayable_lookup = dict() self.refresh_triggered = False super(FocusManager, self).__init__()
And then adjust `RESTORE_FOCUS_SCREENS` to be a list of pairs like ("game_menu", "MY_GAME_MENU_LAYER") e.g.
define pad_config.RESTORE_FOCUS_SCREENS = [ ("main_menu", "my_menu_layer"), ("game_menu", "my_menu_layer"), "controller_remap" ]
I'll run some more tests and such, but try that for now. That, or if you're not using a game_menu screen/standalone like the template does, just remove "game_menu" from RESTORE_FOCUS_SCREENS altogether.
Sadly, that didn't change anything. It still throws the same error (just with different line numbers, due to the few that were added).
I can only get the game to boot up by removing the "main_menu" AND "game_menu" part from RESTORE_FOCUS_SCREENS.
It also works if I remove [layer "game_menu"] from my "main_menu" screen and do:
define pad_config.RESTORE_FOCUS_SCREENS = [ ("main_menu", "game_menu"), "controller_remap" ]
So it seems like it doesn't really care what I put in the tuple?
If your layer is called `game_menu`, renpy.get_screen is interpreted first as a tag and then as a screen, so regardless it wouldn't work with a screen *and* a layer called game_menu. So, I recommend either changing the tag name or the screen name so they're different if you want to use the save-and-restore focus features for the in-game menu screen. Otherwise, it's fine to just not have that screen in the RESTORE_FOCUS_SCREENS.
Hi, was looking at the demo template. Turning on self voicing when any of the custom preference screens open gave this if it detects mouse currently being used. Didn't happen when using keyboard/roller though.
I'm sorry, but an uncaught exception occurred. While running game code: TypeError: 'dict_values' object is not subscriptable