Saving Gump Positions,

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
tetzlaff
Posts: 38
Joined: Thu May 14, 2020 1:34 pm

Saving Gump Positions,

Post by tetzlaff »

Hi everyone,

Almost all of the patches I made were applied. I had took a break for a while to see what would develop from them. The last 2 unapplied patches are related to saving the gump positions. I would like to get some feedback or suggestions for how gump positions should be saved, what they should be saved for, and what to do if the gumps are moved "off screen".

Thanks

Brian
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Saving Gump Positions,

Post by drcode »

I played around a bit with the original U7 to see what they were doing. It looks like you can pretty much drag a gump offscreen, although I think there's always one pixel visible. They do save/restore gump positions (but I only experimented with the NPC paperdoll gumps). It did look a couple times like I was able to drag a gump completely offscreen, but then it seemed to bounce back.

So I'd say you're correct to just save/restore NPC gumps (didn't check whether you're doing stats too, but that would be good). My preference would be not to bother checking for 'offscreen' when the user's dragging a gump, but only when you restore a gump's position. That way, the user couldn't lose a gump permanently when the screen is resized. Also I wouldn't bother saving/restoring these positions in the savegames.

Finally, sorry to take so long to get to the patches you submitted.
tetzlaff
Posts: 38
Joined: Thu May 14, 2020 1:34 pm

Re: Saving Gump Positions,

Post by tetzlaff »

DrCode,

I loaded the original Ultima 7 to do some tests too. I noticed something interesting.

1) open player gump
2) open stat gump
3) move stat gump
4) close stat gump
5) close player gump

When the player's gump is opened again, it appears were the stat gump was moved to.

Otherwise if between 4 and 5 the player's gump is moved, the next time it is opened to where it was last moved...

Also the player's backpack is always opened offset to the player's gump. The backpack always adjusts to be "fully on screen".

Brian
Locked