Hello!
So the dialogs associated with variables and such are called via `
Blockly.dialog` The custom-dialogs-demo changes what the dialogs look like using `setAlert`, `setConfirm`, and `setPrompt`, so then `Blockly.dialog.prompt` (for example) shows the custom dialog instead of the default one.
However, the "prompt for text/number with message" block using the `window.prompt` function, rather than `Blockly.dialog.prompt`, so it's not hitting the custom dialogs.
I think your best option for fixing this is to change your `initApi` method to specify your `CustomDialog` prompts rather than the `window.prompt`.
Here's an example:
```
function initApi(interpreter, globalObject) {
// Note that to use the `CustomDialog` as shown in the demo
// we need to make this async (i.e. take a callback)
wrapper = function(text, callback) {
CustomDialog.show(text, {
showInput: true,
showOkay: true,
onOkay: function() {
callback(CustomDialog.inputField.value);
},
showCancel: true,
onCancel: function() {
callback(null);
},
});
};
interpreter.setProperty(globalObject, 'prompt',
// Here we are calling `createAsyncFunction` instead of `createNativeFunction`
interpreter.createAsyncFunction(wrapper));
}
```
I think that should work how you want it to! But the `initApi` function may not be entirely correct, since I've never used the `CustomDialog` or async functions with the interpreter before. But hopefully it gives you a place to start =)
I hope that helps! If you have any further questions please reply!
--Beka