Customizing inventory menu...

Started by BerserkerTails, Wed 19/11/2003 06:29:45

Previous topic - Next topic

BerserkerTails

I know you guys probably get asked this ALOT, but how do I customize the inventory menu? Is there any specific way? Specifically, I'd like to change the look of it (More to the look of my main GUI) and add an interact (HAND) button in there.

Thanks in advance!
I make music.

Ishmael

#1
There's a build-in custom inv GUI in the newest version at least. Just look in the global script for show_inventory_window fuction and edit it a bit (by the instructions give there) to get the custom inv to be displayed, and edit it.

And as for the hand, you probably mean "USE" as the interact mode sets the objects as currently used inv item by default. So you need to tick the "Handle inventory clicks in script" in the general settings and put some extra code to the on_mouse_click global script function:

if (button == LEFTINV) {
if (GetCursorMode() == 1) { // LOOK mode
RunInventoryInteraction(GetInvAt(mouse.x, mouse.y), MODE_LOOK);
} else if (GetCursorMode() == 2) { // INTERACT mode
RunInventoryInteraction(GetInvAt(mouse.x, mouse.y), MODE_INTERACT);
} else if (GetCursorMode() == 6) { // The pointer mode
SetActiveInventory(GetInvAt(mouse.x, mouse.y));
SetCursorMode(MODE_USEINV);
}

preferably before the other if (button ==... lines, after the if (IsGamePaused()) condition. Then just creat a new button to the inv GUI for the interact mode, and set the Left click option of all those three buttons to "Set Cursor Mode", and set the "Mode to set" for them to:
look - 1
interact - 2
use - 6
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

BerserkerTails

I got it, using your help, and also figuring alot out on my own... Now, onward with my game!
I make music.

SMF spam blocked by CleanTalk