Closed Kln95130 closed 3 years ago
Update:
On a hunch, I modified the io.showdropdown function as such, and issue number 2 is fixed. Not sure exactly why, but the fix is basically going along with the behavior of the dropdown menu.
The changed part is to use "i +1" in the value of the option elements instead of "i": s += '<option value="' + (i + 1) + '">';
function showDropDown(title, options, fn) {
const opts = {article:DEFINITE, capital:true}
io.input(title, options, false, fn, function(options) {
let s = '<select id="menu-select" class="custom-select" style="width:400px;" ';
s += 'onchange=\"io.menuResponse($(\'#menu-select\').find(\':selected\').val())\">';
s += '<option value="-1">-- Select one --</option>';
for (let i = 0; i < options.length; i++) {
s += '<option value="' + (i + 1) + '">';
s += (typeof options[i] === 'string' ? options[i] : lang.getName(options[i], opts))
s += '</option>';
}
msg(s + "</select>");
//$('#menu-select').selectmenu();
$('#menu-select').focus();
})
}
I'll keep looking for the "Examine" out of nowhere
Issue 1's cause found: the "Examine" is added by the item-links library.
I solved the issue by adding an "onCreation" function to TOPIC, which removes the "examine" verb from the verblist (which caused the issue)
const TOPIC = function(fromStart) {
...
onCreation: function(o) {
o.verbFunctions.push(function(o, verbList) {
verbList.shift()
});
},
Thanks for that. I have uploaded to GitHub a new version (but not a release version yet). Issue 2, you were spot on. Issue 1 was that the link library was adding "Examine" as a clickable verb; I added and option in the library to stop that, and showDropDown and showMenu use that.
Hello. I encounter the following issues with the current version (0.4) of the framework, regarding "talk to" with topics.
I am trying to test the following code:
When opening the dropdown menu, I have an "Examine" that is pasted after the topic alias.
The topic responses are displaced. When clicking on "How are you?", nothing happens. When I select "Nice Weather today", I get the "Fine, thank you." answer. If I select "Nevermind", I get the "Quite." answer, and so on.
These issues are specific to the dropdown, so I think it's something related to how it is built by the library. I will investigate a little further. If I find something, I will update this ticket.