Jump to content
Eternal Lands Official Forums
Warlove_Bagpipe

Map marks

Recommended Posts

Hi

I just had an idea how to improve map marks to make them more useable. I wrote a simple patch which makes that yours map marks are displayed in main game window. They are clickable and if you click such name you're going to marked location. This patch is not final version but just presentation of idea. If such functionality will be approved then I start to code proper version of this feature (including new window and game option for this feature).

 

The patch can be found here.

I'm waitting for approval or decline :confused:.

 

--

Regards

OnyXa

Share this post


Link to post
Share on other sites

Makes auto-walk-to things much easier I'm afraid. There was a '#goto name' that send you to the coordinates of the mark 'name'. But that was removed (read about it somewhere on the forums), had to do something with easier automation orso.

Share this post


Link to post
Share on other sites

Yes that is true, but I like navigating with the maps just the way it is. I would use such a new feature, not sure if it has a positive effect on game play. (more 'automation' can be boring)

Share this post


Link to post
Share on other sites

I don't get what

+	int i;
+	mouse_over_location = -1;
+	for(i=0;i<max_mark;i++) {
+		if ( marks[i].x > 0 ) {
+			if(	mx>win->len_x - hud_x - 128 && 
+					mx<win->len_x - hud_x &&
+					my>win->len_y - hud_y - 20 - (i*12) &&
+					my<win->len_y - hud_y - 20 - ((i-1)*12) ){
+				mouse_over_location = i;
+				elwin_mouse = CURSOR_USE;
+				return 1;
+			}
+		}
+	}
+

is trying to achieve.

 

As far as I can tell this just sets mouse_over_location to 0, changes the cursor and returns out of a for loop prematurely if the mouse is in the game window.

 

There is absolutely no need for this to be in a for loop - as it stands it would just waste processor cycles and do who knows what with that for loop not terminating correctly.

 

edit: oh I get it, you want to grab any click within 24 squares of a mapmark and head to the mapmark?

 

If this is your intention then why not just test for mouse_over_location>-1 in the click handler rather than yet another (unnecessary) for loop?

Share this post


Link to post
Share on other sites

First off all sorry for delayed response but topic tracking not sent me an notification mail (strange?).

As I wrote code and design is prototype (and is made temporary) and after eventually approval I try to improve it (thanks Labrat).

In my opinion such feature could be useful because it eliminate annoying(for me :icon13:) mouse click to show and hide map.

Edited by knufasz

Share this post


Link to post
Share on other sites

OK proper patch is ready and can be downloaded from here.

Map mark window is available after pressing CTRL+r.

I've added two files mapmarsk.h and mapmarks.c and I wonder that I should move all code handling map marks there?

Share this post


Link to post
Share on other sites

This patch is looking nice and working well. A few comments if I may. :P

 

1) How about using a resizeable window? The new ground bag code is an example.

2) Did you consider using the automatic scroll bar? I might make your code sightly more simple but could incur a loading penalty as you would draw more strings than needed.

3) How about making the mouse wheel scroll when you are over the window body?

4) How about using the mark filter for the window content?

5) The text for some marks extends beyond the right of the window.

6) Your patch should not include make.conf

 

I'd suggest you keep the existing mark code where it is for now as the feature #defs might get tricky.

 

Edit: Just noticed that with a lot of marks, the last few are not displayed in the window. I have the last nine missing from 59. Could be a scroll bar issue, I have not checked.

Edited by bluap

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.

×