I don't think the left click even from the window's script is the problem. Your code will add the item to my inventory, but I already have the item in the inventory.
Let's say item1 is a book. The player has the book in the inventory at the beginning of the game.
And there is an icon in the upper left corner of the screen, which is a window entity with a pic of the book.
The player can use the book either by clicking on the book in the inventory and then use it on various entities in the room, or by clicking on the upper left icon of the book.
The code for the window's script is
on "LeftClick"
{
Game.SelectedItem = "book";
}
So when the player clicks on the icon(on the window entity), the game knows that you have selected an inventory item: the book.
My problem is this: if the player uses the book from the inventory, there are no problems - the captions work as expected from the gameloop script.
However, if the player uses the book by clicking on the upper left icon(the window entity), it can still use the book item, but there are no captions displayed (example: use book with item).
And I don't understand why the standard floating caption (as defined in gameloop script) only works when i select the item from the inventory, not when i select it via the icon.