Skip to content

hkb_editor.gui.dialogs.find_object_dialog

find_dialog

Bases: DpgItem

A filterable table of items with optional selection.

The workhorse behind all the select_* dialogs. Items are pulled from item_getter every time the filter changes and rendered through item_to_row. Supports single and multi selection (ctrl/shift click), an optional right-click context menu and an optional Okay/Cancel row.

Parameters:

Name Type Description Default
item_getter callable

Called as item_getter(filter); may return a generator.

required
columns list of str

Table column labels.

required
item_to_row callable

Turns one item into a cell tuple (or a single string).

str
context_menu_func callable

Called with the right-clicked item to populate a context menu.

None
okay_callback callable

Called as callback(tag, item_or_items, user_data). Omit to hide the button row and make this a pure search window.

None
allow_clear bool

Add a Clear button that reports None as the selection.

False
item_limit int

Max rows to render; derived from the column count if omitted.

None
initial_filter str

Filter to apply right away.

''
show_index bool

Prepend a running index column.

False
title str

Window title bar label.

'Find...'
filter_help str

Help text shown in a tooltip behind a '?' button.

None
on_filter_help_click callable

Called when the '?' button is clicked.

None
on_result_callback callable

Called with the full match list after every filter update.

None
select_color RGBA

Row highlight color.

muted_green
multiple bool

Allow selecting more than one row.

False
modal bool

Make the window modal.

False
hide_on_close bool

Hide instead of delete when closed, so the dialog can be reopened.

False
tag int or str

Explicit tag; auto-generated if 0.

0
user_data any

Passed through to the callbacks.

None

refresh

refresh() -> None

Re-run the current filter.

search_objects_dialog

Bases: find_dialog

A non-modal object search window with pin/jump context actions.

Hides instead of closing so it can be reopened cheaply.

Parameters:

Name Type Description Default
behavior HavokBehavior

Behavior to query.

required
pin_callback callable

Called as callback(tag, object_id, user_data) from the context menu.

None
jump_callback callable

Called as callback(tag, object_id, user_data) from the context menu.

None
result_callback callable

Called as callback(tag, records, user_data) after each search.

None
See
required

select_animation

Bases: _select_indexed

Pick one or more animation names by index.

select_event

Bases: _select_indexed

Pick one or more behavior events by index.

select_object

Bases: find_dialog

Pick one or more records, optionally restricted to a type.

Parameters:

Name Type Description Default
behavior HavokBehavior

Behavior to query.

required
target_type_id str or None

Restrict candidates to this type; None allows any object.

required
on_pointer_selected callable

Called as callback(tag, record_or_records, user_data).

required
include_derived bool

Also accept subtypes of target_type_id.

True
See
required

select_variable

Bases: _select_indexed

Pick one or more behavior variables by index.

Ko-fi donations