Austin's new Gumps
Posted: Thu Jan 04, 2007 3:23 pm
I've been around long enough to see 3 different ways of doing gumps. And old enough to admit I am mostly out of my depth with gumps in general. Doing gumps is the slowest part of my coding and the most dreaded.
First there was the data and layout arrays and lots of ingenious ways to plug values into the arrays and a real headscratcher to follow. My shard is based on the WoD scripts and that's how Dundee and Drocket coded.
Then we had the first version of GFGumps where you could basically assign any legit variable xxx (number, array, dictionary etc) to a button eg xxx := Button.... - a dictionary was darned handy when using attributes instead of skillids. All in all it was very easy to code in because you had full control over the array you were building up on the left side of the expression and that made it really easy to analyse the gump return.
Now we have the third version which has some plusses and minuses for me. It's not hard to code in, but I really do have problems with the GFAddButton command because it goes back to the first method of creating gumps and wants an integer as the return value of the button press. (gumps.inc does a CInt() on the value you assign)
eg GFButtonAdd(gump, x, y, pic1, pic2, closeoption, returnvalueifpressed);
I admit I'm a newbie on the newest gump system and only really worked on one script. It's really easy to convert ancient gump code to this new system, but not so easy to convert from the first version of GFGumps to this new version.
Why? Because I am removing all instances of SKILLID from my code. That means the second gump system is the easiest for me. The third way works too, but I have to convert from the ATTRIBUTE_ID to a unique gumpbutton integer without using skillids. Is using an array with all the skill attributes in it and simply using the index the best way to do it?
I need to understand all this now before I go and take too big a bite. I am committed to re-writing my gumps to have consistent code that's more modern, but right now I would be grateful of any advice by those who have adopted the new gump system.
First there was the data and layout arrays and lots of ingenious ways to plug values into the arrays and a real headscratcher to follow. My shard is based on the WoD scripts and that's how Dundee and Drocket coded.
Then we had the first version of GFGumps where you could basically assign any legit variable xxx (number, array, dictionary etc) to a button eg xxx := Button.... - a dictionary was darned handy when using attributes instead of skillids. All in all it was very easy to code in because you had full control over the array you were building up on the left side of the expression and that made it really easy to analyse the gump return.
Now we have the third version which has some plusses and minuses for me. It's not hard to code in, but I really do have problems with the GFAddButton command because it goes back to the first method of creating gumps and wants an integer as the return value of the button press. (gumps.inc does a CInt() on the value you assign)
eg GFButtonAdd(gump, x, y, pic1, pic2, closeoption, returnvalueifpressed);
I admit I'm a newbie on the newest gump system and only really worked on one script. It's really easy to convert ancient gump code to this new system, but not so easy to convert from the first version of GFGumps to this new version.
Why? Because I am removing all instances of SKILLID from my code. That means the second gump system is the easiest for me. The third way works too, but I have to convert from the ATTRIBUTE_ID to a unique gumpbutton integer without using skillids. Is using an array with all the skill attributes in it and simply using the index the best way to do it?
I need to understand all this now before I go and take too big a bite. I am committed to re-writing my gumps to have consistent code that's more modern, but right now I would be grateful of any advice by those who have adopted the new gump system.