Jump to content
Eternal Lands Official Forums
Fedora

Manu & Spell window patch

Recommended Posts

@bluap

Am i reading what you've said in that thread right bluap? that "self lighting of the quartz" isn't working anyway?

Maybe until this issue can be fixed, apply the first of your two presented solutions to CVS?

You're right. I've committed the temporary workaround.

Share this post


Link to post
Share on other sites

Hi,

there is a bug in the manu recipes: they get lost on dis-/re-connects.

I talked to fedora and as she's busy with the emotes (great job!), we agreed on the following patch I wrote:

 

Index: manufacture.c
===================================================================
RCS file: /cvsroot/elc/elc/manufacture.c,v
retrieving revision 1.56
diff -u -r1.56 manufacture.c
--- manufacture.c	1 Oct 2009 18:37:50 -0000	1.56
+++ manufacture.c	3 Nov 2009 22:17:56 -0000
@@ -26,6 +26,7 @@
int manufacture_win= -1;
int recipe_win= -1;
int recipes_shown=0;
+int recipes_loaded=0;
int manufacture_menu_x=10;
int manufacture_menu_y=20;
int manufacture_menu_x_len=12*33+20;
@@ -38,6 +39,15 @@
	char fname[128];
	FILE *fp;

+	if (recipes_loaded) {
+		/*
+		 * save existing recipes instead of loading them if we are already logged in
+		 * this will take place when relogging after disconnection
+		 */
+		save_recipes();
+		return;
+	}
+
	memset (recipes, 0, sizeof (recipes));

	safe_snprintf(fname, sizeof(fname), "recipes_%s.dat",username_str);
@@ -50,6 +60,7 @@

	fread (recipes,sizeof(recipes),1, fp);
	fclose (fp);
+	recipes_loaded=1;
}

void save_recipes(){
@@ -350,6 +361,8 @@
		//copy the recipe
		for(i=36;i<36+6;i++) manu_recipe[i-36]=manufacture_list[i];		
		do_click_sound();
+		// save recipes to disk to avoid loss on disconnects/crashes
+		save_recipes();
	}
	return 0;
}

Edited by Sir_Odie

Share this post


Link to post
Share on other sites
Hi,

there is a bug in the manu recipes: they get lost on dis-/re-connects.

I talked to fedora and as she's busy with the emotes (great job!), we agreed on the following patch I wrote:

....

OK, commited to CVS. Thanks Sir_Odie. :icon4:

Share this post


Link to post
Share on other sites

Having used the new manu recipes feature for a while, I have some suggestions to put forward. These are mainly due to the fact that I keep overwriting recipes by mistake.

  1. When you save a recipe, it is saved in the next free slot rather than the selected slot. It would not be possible to overwrite an existing recipe. To remove or replace a recipe, you would delete it from the list (possibly using a context menu option).
  2. When you click to show the recipe list, only slots with a saved recipe are shown. This would limit the size of the window if not all slots are used.
  3. If the list of recipes does not fit on screen, move it up until it does or the maximum number of recipes can be shown.

If slots are deleted, it may be useful to shuffle the recipes up the list. Otherwise, a new recipe would be inserted into where the last one was deleted. It may also be useful to have a "move up" and "move down" option on any context menu.

 

These are just suggestion, hope that's OK. :)

Edited for typos.

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.

×