Page 1 of 3

Patch: New orders window

Posted: 20 Mar 2007 18:47
by skidd13
I'm a big friend of usability, so here are my 10 pence.

Move order and skip to order is in trunk now! :)

This patch changes the text buttons for the main actions to icon buttons (the cursor is also changed).

The grf should be placed in the data path. (NO newgrf!!)

Posted: 21 Mar 2007 10:19
by Connum
always wanted something like that, thanks! =)

Posted: 21 Mar 2007 11:01
by Wolf01
great,
always wanted something like that, thanks! =)
me too :D

Posted: 21 Mar 2007 12:03
by Mucht
Hey thats really a great improvement! Saves quite some time and click-work.

Posted: 21 Mar 2007 13:16
by skidd13
Good to hear that my idea is well recieved. :)
Mucht wrote:Saves quite some time and click-work.
That's why I started to code this.

I'm thinking over the button placement:
In the icon-button-bar should only be the most used buttons (only 3-4).
The text-button-bar should include the remaining buttons.
Goto and skip should really be in the icon-button-bar.
Now the question is which button(s) is needed often too?

Posted: 21 Mar 2007 18:23
by skidd13
Patch updated.
Now full functionality should be availible. Now it's only style (I hope).

Posted: 21 Mar 2007 20:38
by iNVERTED
How about drag&drop? ;)

Posted: 24 Mar 2007 01:11
by skidd13
iNVERTED wrote:How about drag&drop? ;)
I'm working on it. But it's a bit difficult, cause I need to replace bigger parts of the GUI!

Patch updated!

Posted: 24 Mar 2007 13:14
by skidd13
Last update contains a bug, current version too.
The crash appears when you move the first order down.
ATM I can't understand why the game crashes.

I draft a small image which contains the linked order list.

vO = v->orders
O1 = first order
O2 = 2nd order
O3 = 3rd order

Somehow "New move from 01 to 02" crashes the game. :(
Please can someone help me. Thanks

Posted: 24 Mar 2007 14:50
by nycom
Hello skidd13,

There was an infinite loop in the order list when you move the first order down

Replace these two lines

Code: Select all

SwapOrders(v->orders, one_past);
v->orders->next = moving_one->next;
by

Code: Select all

v->orders = moving_one->next;
If you want, here you can my diff, I create one command CMD_MOVE_ORDER and delete CMD_ORDER_MOVE_UP and CMD_MOVE_ORDER_DOWN.
If the bit 8 of param p2 of the cmdMoveOrder function is set to 1 so we move the selected order up else we move it down.

Posted: 24 Mar 2007 16:15
by skidd13
nycom wrote:Hello skidd13,
There was an infinite loop in the order list when you move the first order down.
Thanks a lot.
nycom wrote:I create one command CMD_MOVE_ORDER and delete CMD_ORDER_MOVE_UP and CMD_MOVE_ORDER_DOWN.
If the bit 8 of param p2 of the cmdMoveOrder function is set to 1 so we move the selected order up else we move it down.
I was on the way to merge the two commands, cause of the Drag and Drop functionality.

Patch Updated!

Posted: 26 Mar 2007 18:46
by skidd13
Another update!

FIXED:
- current order stay's selected
- shared orders sync crash

TODO:
Get Drag&Drop working + clean up code.

Posted: 04 Apr 2007 20:58
by bkLife
How do i install this magnificent patch?

Posted: 05 Apr 2007 11:03
by skidd13
bkLife wrote:How do i install this magnificent patch?
Hm, I read the question a 100 times...

Please search first!
There is a reason why in the development topic is a sticky called Howto apply a patch/diff file!
Or search in the manual (read point: 2 Source code)!

Posted: 30 Apr 2007 00:01
by skidd13
patch updated!

Posted: 02 May 2007 13:17
by doghousedean
Instead of programming a new feature you could always drag the orders arround like you could in TTDX!

[edit] thats strange, you could do it in the original TTDX, but not in OTTD! oh well keep up the good work..

Posted: 02 May 2007 17:17
by skidd13
doghousedean wrote:Instead of programming a new feature you could always drag the orders arround like you could in TTDX!

[edit] thats strange, you could do it in the original TTDX, but not in OTTD! oh well keep up the good work..
The function could itself handle drag and drop actions. But to tell the GUI to accept this is quite difficult (Cause lack of documentation and free time). I've tried it a few times but failed allway's. So I stick to this solution.

Patch updated. Missed a damned segfault last time. :evil:

Posted: 04 May 2007 10:53
by skidd13
I tried to implement drag and drop once again.
Somehow the event WE_DRAGDROP is never called.
I don't get the problem, can someone help to improve. Thanks.

Posted: 14 May 2007 10:09
by nzhook
Ok, this is not entirely for the GUI, but could you add the ability to select an existing orders window and copy/share it.

It would make converting between rail types quicker.

Additionally, if you get drag and drop working will we be able to drag from one order set to the other. (eg. move an order between vechs)


PS. Are the busess making money? You sure have a lot.

Posted: 14 May 2007 15:24
by skidd13
nzhook wrote:Ok, this is not entirely for the GUI, but could you add the ability to select an existing orders window and copy/share it.
Click on the vehicle does the job either.
nzhook wrote:Additionally, if you get drag and drop working will we be able to drag from one order set to the other. (eg. move an order between vechs)
Drag and drop is such a thing in OTTD, adding a button or changing it's behavior is quite simple, but I don't get this damned drag and drop working.
Draging a order between two vehicles would require more work than it's worth. IMO (ATM) :)
nzhook wrote:PS. Are the busess making money? You sure have a lot.
Why should they?! It's just for testing. :)