Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Drax on April 13, 2004, 06:18:13 PM
-
I have a little problem with my inventory buttons.
I had a lot of Items and if I wan't to scroll it's more then just uncomfortable. I always have to move my mouse after clicking one item onward, if I don't do, the buttons won't scroll the items.
So you can't click fast through it, an it semms to stuck every few clicks.
Lakeside does the GUI gfx in the game, but I think he only removed the standart gfx.
I'm asking because I can't find some scripting for the inventory anywere.
DraX
-
Sorry, DraX, I'm not sure a fully understand. What exactly would you like to achieve?
-
No Problem.
Fast clicking the buttons in my inventory isn't possible.
I always have to move my mouse a little bit before I can click again. So I can't do this multible clicking thing to get to the first Item if i've been at the last. :-\ Clear?
With a lot of Items it's very nerved to get from the left to right, because I can't click fast at the button. I always have to move the mouse or wait till the next click is noticed.
It would be nice if i can click fast and multible times and the invetory scrolls as fast as I click. The cream of the crop would be that I could hold the mouse down and the inventory scroll till I release.
-
Let me rephrase what DraX is asking for. ;)
He wants the engine to have a queue memory and log how many times you click the button and do the action. So when he clicks REALLY FAST (for example) 5 times on the inventory button then it does the action 5 times and not just once.
Hm... I can think of times where this might can in handy (especially in non-adventure games like a tetris ;)) but I don't think that it should be always enabled.
-
Is the Scrolling procedure so dead slow?
I mean It haven't to mermory all my clicks, but reacting on every click, whithout changeing mous position every time. I'm not intended to click on the button like a mashinegun ;)
It would be interesting if It is just in my Inventory. But I can't believe that. If anybody has the fancy to add a lot of items and trying to click as fast as he can to the end (right) and back to the beginning (left). It very hard and if you should do that a whole times (playing a adventure) it's realy distempering.
I hope its not just a mistake in my game
:-X
-
Oh, I understand now :) Well, the problem is, that two fast clicks actually trigger a double-click event, resulting in pauses in scrolling. You could probably explicitly handle double-click events in your buttons's script and convert them to normal presses.
If you have that many items, you might also consider redesigning the inventory, either to make it scoll the entire "row", not just one item a time, or create a multi-row inventory-
-
;D Ahhh, jear. That's the fault!
I think the Inventroy hasn't be redesigned. The actual number of Items is not to be exceeded.
While developing I use a cheat to get all Items :-X(it will be removed in the final version 8)) and then I got a lot of Items that wouldn't exist because of resulting by using two items together. If the doubleclick would be a normal, all would be fine!
Back to the problem.
Where can I script these Events for the buttons?
I'm asking because I can't find some scripting for the inventory anywere.
-
Create a new script, containing something like:
on "LeftDoubleClick" this.Press();
And attach the script to both scrolling buttons. In the inventory definition file add SCRIPT = "path\name.script" to both buttons.
I didn't test it but it might work :)
-
;D ;D ;D
Now It scroll's like a jung princes swimming in golden water ???
:) No, really. It's so mutch better.
ThX for your help
DraX
p.s. you should implement this in the next update. If you want to.
-
I was searching the posts because I have a problem concerning scripting with the inventory (yes I am using build 1.2.044).
How can I attach a script to the inventory definition?
When I add this line to the code:
SCRIPT = "interface\close.script"
I get this error message in wme.log:
Syntax error in INVENTORY_BOX definition
Error parsing INVENTORY_BOX file 'interface\inventory.def'
I am trying to create an inventory similar to Sierra games. Meaning it opens when you press the inventory button (or a hot key) and that it has some buttons included like look, use, drop, exit.
-
The inventory definition file has a WINDOW definition embedded inside. You'll have to attach the script to that window, not the inventory itself.
-
Emmm...yeah... I knew that... ::)
Thanks
going to find a place to hide from shame...
-
or create a multi-row inventory
This is exactly what I am looking for. :) But there is no mention anywhere else on the forums about multi-row inventories - and its not in the Help?
I have nine cells each 75px/75px. The grid is 3x3. No matter what size I define the "AREA" - it still only populates a single row? (the first three cells)
Does anybody have any code or even just instructions for creating mult-row inventories?
Many thanks,
Rev
-
The inventory in Fred is multi-row, you can check out the code.
-
But it's really given by the area only. WME will automatically make the inventory multi-row if multiple rows fit into the area. Can you post your inventory definition file?
-
McCoy: Thanks for your quick response. :)
Mnemonic: Thats what I thought - but it wasnt working... I must just be misunderstanding the AREA definition.
You see - this is my code definition (which now works fine). But if I change the AREA Width (currently 375) to anything less than 152 - I dont see anything. I am not sure why - because the cell is 75px - and even if you add 32px (spacing both sides of the cell) its only 107px ?
ITEM_WIDTH = 75
ITEM_HEIGHT = 75
SPACING = 16
SCROLL_BY = 3
HIDE_SELECTED = TRUE
AREA { 77, 115, 375, 375 }
EXCLUSIVE = TRUE
Anyway - I just increased the AREA to a figure way above what I actually need (space+cell+space+cell+space+cell+space = 289px - so in theory AREA { 77, 115, 289, 289 } should work fine) and it now works perfectly!
Thanks for the help again. ;D