Sorry, I've been away from the PC with my project for the past 2 days or so. I'll get you the screen shots you asked in the other post when I have the time.
As you probably already know, I'm working on a menu system that looks similar to Persona 3 or 4 or most console JRPGs. Today, I just tried to deal with the issue of showing the item image and description automatically and the fact that to show them without much hassle, you have to click the item once to get it selected (and once more to get it deselected). I tried to simulate clicks to get it done (onSelect and onDeselect, and on Start), which worked in part (although it's turned a little bit more confusing than I though, lol). Still, got it to work perfectly whenever I tab left and right, but somehow I can't get the thing to autoclick the first slot when the menu starts...
So, here I am half defeated, lol.
Anyways, is there a way to get AC to autoselect the first item in the inventory? Or a way to get it to show the currently selected description and image without having to click the item? (what methods could I call from my script that would have the same effect as when you click the item slot?)...
Also, more related to your forums that anything else... is there a way to post code so that it shows, well, nice? I don't see an insert code snippet button in the forum toolbar... and I kind'a wanted to show you the code, but without the snippet thing I feel it just becomes rather tough to read...
Anyway, I know AC wasn't made originally for the stuff I'm trying it to do, so I'm sorry for all the bombarding of questions...
Comments
I have tried to get a good format option for code, but haven't found one that plays well with the existing toolbar.
The number of inventory items in an inventory box element can be found with:
myInventoryBox.items.Count;
The GetOffset() function returns the number of slots that the first item is from the first slot. If you use a Button element to shift the items left or right, you're changing the offset value. The item that appears in a given slot index is calculated as:
myInventoryBox.items [slotIndex + offset];
The MouseState parameter is AC's own method of tracking mouse states. To simulate a single left-click, you want MouseState.SingleClick.
AC.KickStarter.runtimeInventory
You can then read its localItems variable to get a list of the items the player is carried.
Since you're making use of inventory properties, at least some custom scripting will be required - as properties are designed to be accessed through scripts.
Regarding the showing of these properties, it would be useful to have an "OnHoverOverElement" event, which you can listen for when the mouse hovers over your inventory box. I can see if such an event can be added in the next release. (For more on events and how they are useful, see this tutorial).
Click functionality can be disabled completely if you set the Inventory box type to Custom Script. This'll mean AC does nothing when you click on the box, but you can make use of the OnMenuElementClick event to control what happens through script (this event already exists).