Jump to content
Eternal Lands Official Forums
Drakos7

[patch] Scalable icons (bottom row)

Recommended Posts

Thinking about usability for those with poor eyesight, this lets one scale up the bottom icons to 42px.

 

Alternately, if you have good eyesight or always use your keyboard, you can ratchet down to 16px icons.

 

The option shows up in the HUD tab. The input text box will move accordingly. I would love some of you to make the necessary improvements on this a I feel some parts to be kludgy.

 

Patch: https://developer.berlios.de/patch/index.ph...6&group_id=1256

Screenie of 16px size: 20060612smallicons1fu.jpg

Share this post


Link to post
Share on other sites

Nice. This is very nice indeed.

 

And would be a perfect complement for my scalable interface patch hehe. I tried to patch it against my sources, and only had to correct a minor problem in elconfig.c. The two work nicely together as far as I can tell (still testing) but for now all is ok.

 

:hug:

Share this post


Link to post
Share on other sites

Thinking about usability for those with poor eyesight, this lets one scale up the bottom icons to 42px.

 

Alternately, if you have good eyesight or always use your keyboard, you can ratchet down to 16px icons.

What? No props to me? Ingrate.... :angry:

 

More seriously, great idea. ;)

Share this post


Link to post
Share on other sites

okay, props for 0ctane...

 

just lemme visit the

props.gif

 

 

ahh, here we go

Props.gif

Share this post


Link to post
Share on other sites

ok, bug that I am not sure how to correct. when you scale it down (to say 16px) then restart, if you scale back up, it only recognizes the top of the icons when you hoverover/click. The bottom X pixels show up like they should, but clicking falls through to the background and you move. Thoughts on where to change this?

Share this post


Link to post
Share on other sites

Ummm i have looked a bit, I dont know much about the hud code and dont know the exact cause of that small bug. But it seems that the problem is that the window height (i mean icons_window) is not recalculated properly.

 

If you go to the function display_icons_handler you can find this:

 

win->len_y=16+icon_size; /* This is m_bee's magic line */
if(mouse_in_window(win->window_id, mouse_x, mouse_y))
	{
		state=icon_cursor_x/icon_size;//Icons must be 32 pixels wide...
		if(state<icons_no)icon_list[state]->state|=0x01;//Set the state to be mouseover
		else state=-1;
	}

 

If you add that line the code works as expected, I think. Havent tested it much, though. Maybe you can dig a bit more in the source of the problem starting with that thingie. For now, even if that might not be the deffinitive solution, that works.

 

Cheers :angry:

Edited by m_bee

Share this post


Link to post
Share on other sites

That switch got it to work right. Thanks m_bee. Now I need the eyes of all the good buffer overflow people to scan it :pinch:

Share this post


Link to post
Share on other sites

That switch got it to work right. Thanks m_bee. Now I need the eyes of all the good buffer overflow people to scan it :pinch:

 

Well, wouldn't be cleaner to resize the necessary windows in the function to do the resize itself, rather than every time the icons are rendered?

 

EDIT: After checking over the patch once more, that line should work in change_icon_size() verbatim.

 

EDIT2: No buffer overflows, since there are no buffers :icon13:. However, you may want to update the comments on the following lines (as the comments no longer apply):

state=icon_cursor_x/icon_size;//Icons must be 32 pixels wide...

int id=mx/icon_size;//Icons are always 32 bit wide

Edited by crusadingknight

Share this post


Link to post
Share on other sites

Well, wouldn't be cleaner to resize the necessary windows in the function to do the resize itself, rather than every time the icons are rendered?

Yes, it would. And I thought about that after I wrote it up. I hope to try to get around to it at some point.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×