Add select dialog

This commit is contained in:
2025-01-20 15:02:36 +08:00
parent 7b7710b441
commit d88ae57320
3 changed files with 108 additions and 4 deletions

View File

@@ -1291,5 +1291,22 @@ let UI = {
title: title,
validator: validator
})
},
/**
* Show a select dialog
* @param title {string}
* @param options {string[]}
* @param initialIndex {number?}
* @returns {number | null} - The selected index. If the dialog is canceled, return null.
*/
showSelectDialog: (title, options, initialIndex) => {
return sendMessage({
method: 'UI',
function: 'showSelectDialog',
title: title,
options: options,
initialIndex: initialIndex
})
}
}