Patch: New orders window

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Patch: New orders window

Post 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!!)
Attachments
New Dehli Xpress, 27th Oct 2364.png
New Dehli Xpress, 27th Oct 2364.png (42.56 KiB) Viewed 7879 times
order_gui_icons_r10783.patch
(26.54 KiB) Downloaded 168 times
cur_n_ico.grf
(1.57 KiB) Downloaded 165 times
Last edited by skidd13 on 04 Aug 2007 23:39, edited 46 times in total.
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
Connum
Engineer
Engineer
Posts: 127
Joined: 25 Dec 2006 17:05

Post by Connum »

always wanted something like that, thanks! =)
English is not my native language, so please excuse me if I sometimes might appear a bit harsh or if I make a spelling or grammar mistake!
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

great,
always wanted something like that, thanks! =)
me too :D
Mucht
Engineer
Engineer
Posts: 57
Joined: 17 Jan 2005 13:11
Contact:

Post by Mucht »

Hey thats really a great improvement! Saves quite some time and click-work.
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post 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?
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

Patch updated.
Now full functionality should be availible. Now it's only style (I hope).
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
iNVERTED
Route Supervisor
Route Supervisor
Posts: 387
Joined: 24 Apr 2005 21:21
Location: Torquay, England
Contact:

Post by iNVERTED »

How about drag&drop? ;)
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post 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!
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post 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
Attachments
move_order.png
move_order.png (29.2 KiB) Viewed 11410 times
Last edited by skidd13 on 24 Mar 2007 16:11, edited 1 time in total.
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
nycom
Engineer
Engineer
Posts: 62
Joined: 14 Nov 2005 13:14
Location: Paris, France

Post 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.
Attachments
move_order_9417.diff
(26.8 KiB) Downloaded 267 times
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post 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!
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

Another update!

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

TODO:
Get Drag&Drop working + clean up code.
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
bkLife
Engineer
Engineer
Posts: 48
Joined: 11 Jun 2005 22:32
Location: Oslo - Norway
Contact:

Post by bkLife »

How do i install this magnificent patch?
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post 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)!
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

patch updated!
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
doghousedean
Traffic Manager
Traffic Manager
Posts: 141
Joined: 30 Apr 2007 10:26

Post 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..
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post 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:
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post 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.
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
nzhook
Engineer
Engineer
Posts: 115
Joined: 02 Jul 2004 13:15
Location: NZ
Contact:

Post 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.
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post 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. :)
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 28 guests