Jump to content
Eternal Lands Official Forums
Roja

A button for the notepad

Recommended Posts

I was thinking, not many people know that the in game notepad exists. What if we make a button for it? The 4th & 7th icon can be used that are located in the gamebuttons.bmp file.

 

There is room for 2 more buttons on the interface, so this can be one of them.

Share this post


Link to post
Share on other sites

AFAIK, the notepad isn't ready yet. There are still bugs, and it lacks features like scrolling.

You're correct, Vegar. Most of the buttons on the notepad need propper alignment (ATM, they're just sitting on top of eachother).

Apart from that, the notepad is fully functional. Saving/reading the notes works great!

 

 

[EDIT]

Typos

Edited by Placid

Share this post


Link to post
Share on other sites

Apart from that, the notepad is fully functional. Saving/reading the notes works great!

I noticed a client crash bug just yesterday, I was going to trace it then report it. Anyway, if you create two records then deleted the first. When you access the remaining record, the client crashes. It's in the widget code but probably due to the memory reorg done when a record is deleted.

Share this post


Link to post
Share on other sites

Maybe someone could finish up the notepad, then add the button before the next client update?

 

(next client update will be before christmas)

Share this post


Link to post
Share on other sites

Maybe someone could finish up the notepad, then add the button before the next client update?

 

(next client update will be before christmas)

Not easy, it needs the widget it uses for text display rewritten, because my past attempts at making the notepad scroll were ugly hacks. Beyond that, to keep it from reparsing the buffer on each draw, the actual buffer code it uses might have to change.

Also, the buttons are unaligned, due to the fact the buttons themselves have changed since I wrote it. :confused:

 

However, the bug bluap reported is a new one, which shouldn't be caused by anything in the notepad. Could you possibly mention which widget function it's crashing in?

Share this post


Link to post
Share on other sites

However, the bug bluap reported is a new one, which shouldn't be caused by anything in the notepad. Could you possibly mention which widget function it's crashing in?

Program terminated with signal 11, Segmentation fault.
#0  0x080dd124 in get_edit_pos (x=58, y=11, str=0x0, maxchar=0, text_zoom=1)
at widgets.c:1657
1657					while (k < ncs && str[i+k] != '\0')
(gdb) where
#0  0x080dd124 in get_edit_pos (x=58, y=11, str=0x0, maxchar=0, text_zoom=1)
at widgets.c:1657
#1  0x080dd2bd in text_field_click (w=0xd868d68, mx=58, my=11, flags=67108864)
at widgets.c:1704
#2  0x080d8ddb in widget_handle_click (widget=0xd868d68, mx=58, my=11,
flags=67108864) at widgets.c:483
#3  0x0807c8a0 in click_in_window (win_id=13, x=113, y=97, flags=67108864)
at elwindows.c:1270
#4  0x080796b8 in click_in_windows (mx=113, my=97, flags=67108864)
at elwindows.c:133
#5  0x0808083f in HandleEvent (event=0xafb6e2b8) at events.c:208
#6  0x0809ef05 in start_rendering () at main.c:98
#7  0x0809f248 in main (argc=3, argv=0xafb6e384) at main.c:230
(gdb)

This from the latest CVS and built with debug. The crash is easily reproduced as described before. Happy bug hunting :(

 

Edit: Just in case I didn't make myself clear. Create two records, then delete the first. The client crashes when you access the remaining record. That is when you select the records tab and start to type new text into the text pane widget.

Edited by bluap

Share this post


Link to post
Share on other sites

Edit: Just in case I didn't make myself clear. Create two records, then delete the first. The client crashes when you access the remaining record. That is when you select the records tab and start to type new text into the text pane widget.

With all the bug fixing going on I thought I'd have a go at tracking this one down. I've found it and fixed it. It was in the notepad code, the text buffer being used by the text widget was lost during the reshuffle of the notes array. I fixed it by moving the text_message and the buttons into the notes array so the whole lot can be maintained at once. I have also fixed another bug where an empty note would sometimes not get displayed, this was a bug in widget.c. At this point I couldn't help but tidy up the button alignment problems too and add a couple of user messages related to too many notes and no available tabs. I've tested extensively and can't crash the client any more ;) I stopped short of attempting any new facilities such as scrolling or the proposed notepad button. I could have a stab at these too if requested.

 

Anyway, the notepad is now stable and usable and looks a bit better. I hope you are OK with me doing this crusadingknight :( Here's the patch.

Share this post


Link to post
Share on other sites

well, if it's not ready to be used yet, then IMO it probably shouldn't be enabled... so adding the buttons if -DNOTEPAD is set doesn't seem a bad idea to me (I'll do that if there's no objections)

and if CK is happy with bluap's patch, I'll stick that in as well :(

Share this post


Link to post
Share on other sites

I'm happy with it, as long as scrolling gets in there before -DNOTEPAD is removed. :(

The scrolling was always what got me, due to Wytter's insistence I add that functionality into the generic input field... I'd be pleased if someone else completed it, since I think I've thrown away several implementations so far as they became either hacks or unwieldy. There's probably still an ancient patch on berlios from one of my attempts, come to think of it, that I never got around to chasing all the bugs from, though I doubt it will apply to vanilla cvs after almost two years.

Share this post


Link to post
Share on other sites

well... I'll look into that, I have an idea how it could be done, but the problem is that being in a feature freeze means I shouldn't make too many changes (despite it being a -D, I think it's on by default... the other option is if it's okay by ent to get this working quickly, with feature changes okay as long as they're stable, and then have a test build from someone for a large-scale testing on windows)

Share this post


Link to post
Share on other sites

well... I'll look into that, I have an idea how it could be done, but the problem is that being in a feature freeze means I shouldn't make too many changes (despite it being a -D, I think it's on by default... the other option is if it's okay by ent to get this working quickly, with feature changes okay as long as they're stable, and then have a test build from someone for a large-scale testing on windows)

 

I never looked at the notepad code, or how it works. However, if it lacks features (like scrolling) it should be completed and activated after the update.

Share this post


Link to post
Share on other sites

I never looked at the notepad code, or how it works. However, if it lacks features (like scrolling) it should be completed and activated after the update.

That's fair enough but it was already included in the last release client (at least on Linux) so removing it for this release might be confusing and a little frustrating if people are using it. That's why I did the bug fix and layout improvements. However, as always, I note your signature :blush:

Share this post


Link to post
Share on other sites

What I meant was, there should not be a button for it until it works properly. Without a button, it's just an experimental and unofficial thing. With a button, it will confuse people if it doesn't work properly.

Share this post


Link to post
Share on other sites

I've just updated my patch on berilos, updating it for the compiler warning changes today. The change I made to widges.c is no longer need either as that code has since been fixed for a different bug.

 

IMHO, this patch should be considered for the new client release. Although the notepad is experimental, without this patch it can easily, in a repeatable way, crash the client. The button alignment also looks a mess. The patch changes are only to notepad.c and a couple more strings in translate.{c,h}.

Share this post


Link to post
Share on other sites

apart from fixing the two bugs listed above, adding some error information, and moving/resizing buttons, what, if anything, else is changed in this patch?

Share this post


Link to post
Share on other sites

apart from fixing the two bugs listed above, adding some error information, and moving/resizing buttons, what, if anything, else is changed in this patch?

Nothing, that's it. In fact, today, you already fixed and committed one of the bugs yourself - the one in widges.c.

Edited by bluap

Share this post


Link to post
Share on other sites

well, after having played with the patch in for a while, it's now commited... most people probably won't notice since the notepad isn't that well known, but hopefully ELC is a bit more stable now :(

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.

×