def set_surface_map_and_right_coordinates(self):
        """Reference/create maps of surfaces and coordinates.

        Those are nested dictionaries needed to obtain the
        surfaces needed for the OptionTray as well as
        correctly determining the position of each value
        within its rect so the suitable value can be picked
        when the widget is clicked (actually, when the
        mouse is released over it).

        In this method we also update the 'image' attribute
        and create a new rect for the widget from the new
        surface in that attribute.
        """
        ### create a tuple from the options where each item
        ### is converted into a string
        options_tuple = tuple(map(str, self.options))

        ### using the tuple as a key, try retrieving the
        ### needed dicts;
        ###
        ### the first one associates text styles (settings)
        ### to the respective surface map for that styles;
        ###
        ### the second one associates the text styles
        ### (settings) to the right positions of each option
        ### in the option tray surface

        try:

            styles_to_surface_map = OPTIONS_TO_STYLE_DATA[options_tuple]

            styles_to_right_coordinates = RIGHT_COORDINATES_MAP[options_tuple]

        ### if the first dict doesn't exist, the second one
        ### doesn't exist either, so we create and store
        ### new ones, also referencing them locally

        except KeyError:

            styles_to_surface_map = OPTIONS_TO_STYLE_DATA[options_tuple] = {}

            styles_to_right_coordinates = RIGHT_COORDINATES_MAP[options_tuple] = {}

        ### try retrieving both the surface map and right
        ### coordinates tuple needed, creating them if they
        ### don't exist; they must then be referenced in
        ### specific attributes

        ## put together a custom key used to retrieve
        ## the surface map; it consists of a tuple
        ## holding 02 other tuples representing the text
        ## settings for normal and selected text

        styles_key = settings_to_hashable_repr(
            {
                "selected_foreground_color": (
                    self.selected_text_settings["foreground_color"]
                ),
                "selected_background_color": (
                    self.selected_text_settings["background_color"]
                ),
                **self.normal_text_settings,
            }
        )

        ## put together a custom key used to retrieve the
        ## right coordinates tuple; this one just need the
        ## text settings that affect the size of the text
        ## surfaces; we can ignore the settings which only
        ## affect appearance;

        right_key = settings_to_hashable_repr(
            {"font_path": self.font_path, "font_height": self.font_height}
        )

        ## iterate over the gathered data, retrieving and
        ## referencing the collections, creating and storing
        ## them when they don't exist already

        for attr_name, key, a_map, creation_method in (
            ("surface_map", styles_key, styles_to_surface_map, self.create_surface_map),
            (
                "right_coordinates",
                right_key,
                styles_to_right_coordinates,
                self.create_right_coordinates,
            ),
        ):

            ## try retrieving the needed collection
            try:
                needed_collection = a_map[key]

            ## if a key error is raised, it means the
            ## collection must be created, so we do so by
            ## calling the appropriate method and storing
            ## the created collection in the corresponding
            ## dictionary for when it is needed again

            except KeyError:

                needed_collection = creation_method()
                a_map[key] = needed_collection

            ## finally, we reference the collection in a
            ## dedicated attribute
            setattr(self, attr_name, needed_collection)

        ### assign the image surf
        self.update_image()

        ### also create a rect from it
        self.rect = self.image.get_rect()
Reference/create maps of surfaces and coordinates.

        Those are nested dictionaries needed to obtain the
        surfaces needed for the OptionTray as well as
        correctly determining the position of each value
        within its rect so the suitable value can be picked
        when the widget is clicked (actually, when the
        mouse is released over it).

        In this method we also update the 'image' attribute
        and create a new rect for the widget from the new
        surface in that attribute.
        
nodezator/widget/optiontray/main.py