Trying to make an Inventory Bar

Started by Rex Mundane, Tue 26/01/2010 02:54:22

Previous topic - Next topic

Rex Mundane

I'm having a hard time trying to create an inventory bar at the bottom of the screen, and I have no idea why. Have the GUI and the inventory window set up, I think, but for some reason I can't seem to interact with it, or rather can't in the way I think.

Interface is set up using the BASS module from here such that left clicking on the item should make it the active inventory item to use and right clicking will look at it. Right clicking does what it's supposed to, but left clicking does not.

Here's where I'm getting confounded really, I've tried debugging and setting a break-point in On_Mouse_Click in the GlobalScript file, and the damn thing it that, while the break does stop the debugger while clicking around the room, it does nothing when clicking on the inventory bar. In fact, having commented everything out of the On_Mouse_Click function, I can still right click on the item and look at it, but not select it.

I'm sure I know what command to use (player.ActiveInventory=the item I'm clicking on in the inventory window, I think) but mainly, due to an inability to understand how I'm managing to right-click and look at things in my inventory when, as far as I can tell, clicking at all shouldn't do anything, I have no idea where to put it.


Khris

There's a setting in general settings/inventory that can be used to set default or custom behaviour when the player clicks on an inventory item.
Default behaviour: interact chooses the inv item as active item
Custom behaviour: on_mouse_click is called with eMouseLeftInv/RightInv as button parameter.

It's probably better to post problems with a template/module in the thread where it was published; don't do that now though. Wait for Dualnames or PM him.

Dualnames

I've sent you a pm, and to those that are using the module, I've stated in the readme and the module script that Bass requires HandleInventoryClick property set to true to work. I've uploaded a new version, but the one before probably worked too.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Rex Mundane

Got the PM, yes, and that did end up fixing things. Knew it had to be like one little thing that I didn't know to look for, many thankings.

Dualnames

Quote from: magma42 on Tue 26/01/2010 20:42:32
Got the PM, yes, and that did end up fixing things. Knew it had to be like one little thing that I didn't know to look for, many thankings.

Glad to have helped. If you find anything else, I'm on stand-by mode. ;)

Cheers!
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk