Skip to reading
Replace the Built-in Screens

Options controller - part 3 of 4

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
Code example
func select_language(element_id: String, code: String) -> void:
    var list: PCAListBox = control(element_id) as PCAListBox
    if not is_instance_valid(list):
        return
    list.selected_ids.clear()
    list.selected_ids.append(code)
    list.refresh()
Code example
func selected_language(element_id: String, fallback: String) -> String:
    var list: PCAListBox = control(element_id) as PCAListBox
    if not is_instance_valid(list) or list.selected_ids.is_empty():
        return fallback
    return list.selected_ids[0]

Language selections are List Box item IDs. The voice item auto is a GUI convenience; it is converted to an empty voice-language override when applying.

Continue with the next part in the same options_tools record. Do not add another extends line.

Page 74 of 88Permalink
Go to page