Okay! I am trying to test my Inventory GUI for the MAGS July 2017, and I can't seem to get the inventory item active.
Here are the snippets code for the Inventory GUI.
function show_inventory_window ()
{
gInventory.Visible = true;
// switch to the Use cursor (to select items with)
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
function btnInvOK_Click(GUIControl *control, MouseButton button) {
// They pressed the OK button, close the GUI
gInventory.Visible = false;
mouse.UseDefaultGraphic();
}
function btnInvSelect_Click(GUIControl *control, MouseButton button) {
// They pressed SELECT, so switch to the Get cursor
mouse.Mode = eModeInteract;
// But, override the appearance to look like the arrow
mouse.UseModeGraphic(eModePointer);
}
function iCrowbar_Interact()
{
player.ActiveInventory = iCrowbar;
}
function iScissors_Interact()
{
player.ActiveInventory = iScissors;
}
function iDiscToy_Interact()
{
player.ActiveInventory = iDiscToy;
}
function iCrowbar_Look()
{
player.Say("This crowbar looks quite sturdy.");
}
function iScissors_Look()
{
player.Say("They're not TOO sharp, but they could cut some string easily.");
}
function iDiscToy_Look()
{
player.Say("This plush toy was used in a historical play.");
player.Say("The owner probably forgot to pick it up afterwards.");
player.Say("I'll just hold onto it till the owner asks for it.");
}
So, basically the code from a default Sierra stuff, with a few things done my style.
The Eye Icon is as usual as well.
But when I use the Inventory thing, no matter how many times I click the arrow on the inventory item, it WON'T pick up the item!
Honestly, this never gave me hassle in last month's MAGS! The Inventory, which HASN'T given me problems before, is NOW what's giving me problems.
[Add-on] I HAD put code with the Inventory Items (like "Interact" and "Look"), but it still doesn't work.
[Add-on 2] I elaborated more on the code. Again, no matter how many times I click the arrow on the inventory item, it won't pick up. What could I be missing?
You don't need to addfunction iScissors_Interact() {
player.ActiveInventory = iScissors;
}
for each item, this is the default behavior anyway.
(Even if you had to do that, you'd do it globally so it works for every item.)
The most likely cause is you turned on "Override built-in inventory click handling" in General settings -> Inventory
Just set it back to "False".
It is set to false. And it still doesn't work.
I clicked the arrow on an inventory item, and no matter how many times, it doesn't activate the inventory. In fact, I can't even use the "Look Cursor" to have the character describe the item.
Quote from: DBoyWheeler on Fri 14/07/2017 00:23:59
I clicked the arrow on an inventory item, and no matter how many times, it doesn't activate the inventory. In fact, I can't even use the "Look Cursor" to have the character describe the item.
A random guess in another direction - maybe you forgot to setup item width and height properties for inventory window, and click detection box is too small.
Found what was going on... My inventory window was pushed too far to the back (I was trying to make a frame for it, but needed the inventory window further to the front for inventory to work).
So you had an invisible GUI on top of it that was catching your clicks?