# ui_shared_code function library

Dependencies: alter_effect, ds, lib_2da, lib_2daq, lib_anon, lib_array, lib_class, lib_cre, lib_data, lib_eff, lib_fn, lib_ids, lib_ietool, lib_ini, lib_kit, lib_script, lib_sfo, lib_spl, lib_splconv, lib_ssl, lib_struct, lib_sugar, lib_tools, lib_ui, lib_vtable, resolve_spell, ui_add_subraces, ui_bonus_spells, ui_deolvynize, ui_detect_class_kit, ui_dual_class_kits, ui_externalize_hlas, ui_externalize_proficiencies, ui_extra_spells, ui_on_open, ui_spell_system, ui_system_call, ui_virtual_class

Functions used which are flagged as internal: ui_bonus_spells_setup

## Description

A few UI-editing functions used by multiple other SFO-LUA functions.

## Public functions

detect_chargen_status()=() action

Install the detect_chargen_status LUA functions in m_dw_shr.lua (these functions are used by other SFO functions (and elsewhere in ToF) to detect whether a given menu is being called as part of chargen)

hide_this_displayed_ability(string:s)=() action

Mark a specific ability (or space-separated list of abilities) to be hidden on the character sheet. Abilities are identified by their enginst.2da ID.

shared_color_changes()=() action

Installs the LUA function 'dwUpdateColors' into m_dw_shr.lua (this function is used to force the starting colors during CHARGEN, e.g. for subrace or portrait-match purposes)

ui_stress_test()=() action

Run a bunch of SFO-LUA's core UI edits and report when each is installed. For use in testing SFO-LUA on different UI mods.

## Internal functions

These should not be called from outside the library itself.

add_dwHideAbility()=() patch

hide_displayed_ability_setup()=() action

Do the required setup for LUA hiding of abilities, via the m_dw_haf.lua function library and the m_dw_had.lua LUA data file. These resources are used to hide certain abilities from the character sheet.