Default inventory window not working (SOLVED)

Started by RootBound, Fri 09/06/2023 21:52:09

Previous topic - Next topic

RootBound

Hey all,

I started a game using the blank template. Made a GUI with an inventory window in it. Gave the player inventory items. They display correctly in the GUI window, but do not activate when clicked on.

I triple-checked all of the following conditions:

-"Override built-in inventory window click-handling" is set to FALSE.
-"Use selected inventory graphic as cursor" is set to TRUE.
-Parent GUI is set to "clickable"
-"Inventory window" GUI control is set to "enabled" and "clickable"
-There are no other invisible GUIs on top of the inventory window
-Inventory item width and height in the gui editor are the appropriate sizes for the sprites, which display exactly as intended.
-When I press ` for debugging and click on the window, it says "Mouse click over GUI 1"
-in Room_RepExec I placed a block that says
Code: ags
if(player.ActiveInventory != null"{
  Display("Huh.");
  }

This block of code never runs.

I'm just about tearing my hair out over this.

Any ideas would be appreciated.
J. They/them. Here are my most recent games:

RootBound

So thanks to some helpful advice to discord, I set the cursor mode to "interact" manually, which made the window functional. But isn't that mode supposed to activate automatically when the cursor is over a GUI? I never had to switch the curcor to interact manually in other games.  :confused:
J. They/them. Here are my most recent games:

Khris

To my knowledge AGS does not automatically change cursors, no. The original default game set the mouse mode to eModeInteract and changed the cursor to a pointer when you opened the inventory, IIRC.

Default inventory click handling requires the mouse mode to be eModeInteract to be able to pick an item, which is probably due to the fact that early was AGS was heavily modelled after the Sierra multi-cursor GUI.

Many templates override default inventory click handling, which is probably why you never had to switch the mode in your previous games.

RootBound

Thanks, Khris. Always good to know the context of why things work a certain way. I'll label this as solved.
J. They/them. Here are my most recent games:

SMF spam blocked by CleanTalk