Reference Manual: (offline | online) Quickstart: (offline | online)

Customizing the Preferences Screen

Customizing the preferences screen is accomplished by modifying config.preferences, which is a dictionary mapping from vbox style to a list of preferences to be placed in that vbox. Modifying this dictionary and lists can move preferences around, and eliminate preferences entirely. It may be desirable to create new vbox styles, by using style.create .

Alternative, one can position preferences using config.preference_positions .

To create an entirely new preference, create it with _Preference, _SliderPreference, or _VolumePreference, and then add it to an appropriate list in config.preferences, with a command like library.preferences['prefs_left'].insert(3, MyNewPreference)

From Scratch

One can also write their own preference screen from scratch, as one of the game menu screens. The preferences screen can use the following variables and functions to update the preferences. Preferences take effect as soon as they are set.

Variable: _preferences.afm_time = 0

The number of seconds to delay after showing config.afm_characters (default 250) characters in auto-forward mode. A sensible range is between 1 and 40 seconds. If set to 0, auto-forward mode is disabled.

Joystick Preferences

There are three functions that help in customizing the joystick preferences screen.

Function: _joystick_select_binding( )

Generates a number of buttons, one for each possible joystick binding. Clicking on these buttons causes ui.interact to return a (label, key) pair, where label is a label indicating the type of binding being customized, and key is the keysym associated with it.

Skeleton code for the joystick screen looks like:

label joystick_screen:
   python hide:
       ui.vbox(xalign=0.5, yalign=0.5)
       _joystick_select_binding()
       ui.close()

       label, key = ui.interact()

       ui.text("Setting binding for " + label + ". Click to unset binding.", xalign=0.5, yalign=0.5)
       _joystick_get_binding()
       
       binding = ui.interact()

       _joystick_take_binding(binding, key)

    jump joystick_screen
Reference Manual: (offline | online) Quickstart: (offline | online)