Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu May 23, 2013 2:20 pm

All times are UTC




Post new topic Reply to topic  [ 68 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Sun May 31, 2009 8:13 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Jun 28, 2006 6:25 pm
Posts: 293
Location: Florida
Thanks for that up-to-date binary. With that, i'll be glad to test it (something tells me i'm gonna love this). :wink:


Top
 Profile  
 
PostPosted: Wed Jun 03, 2009 7:35 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
Another update. I implemented all of Hirundo's suggestions and updated the code to trunk.

v0.63: Update to current trunk. Coding style corrected, including trailing whitespaces (I bet I'm missing something :D). Statements to check current rating changed to a better solution that is already used in other parts of OpenTTD code. TownRatingColour implemented as a member of the Town class. Unified some duplicated code.

CommanderZ: I intend to do that, but only when I'm completely sure that I'm not missing something. I want to get this as good as I can :)

Hirundo: I followed your suggestions and inspected closely every line of the diff, and I think I got every coding style error. The first versions of the patch sticked to the colours in that enum, but I had to either include colours that broke the intuitive red-yellow-green progression (I tried blue, gold, silver...) or to use fewer colours and let half of the ratings sharing colours. Finally I decided to include more colours: I'm pretty sure that the results look good now, but I'm still not happy with the way I implemented it. Thank you for checking my patch!

SirXavius: Thank you, I hope you like it.

Here is an updated binary for windows. Since the behaviour of the patch hasn't been altered, the only "visible" change is the version bump.

Edit: Deleted, see the first post for an updated binary.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Last edited by Terkhen on Wed Jun 24, 2009 2:33 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Jun 03, 2009 3:36 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Sun Jan 27, 2008 1:02 pm
Posts: 298
Since you seem to have little success in eradicating the whitespace (no offence intended at all, I know from experience how hard it can be) I shall present you the Whitespace Detector (r). It is butt-ugly and coded in around five minutes. e.g. there isn't even a check to see whether the file you try to open actually exists. However, for me it does the job of detecting trailing spaces / tabs nicely. Feel free to do or do not use it. Source code (Actionscript) is available upon request.


Attachments:
whitespace.zip [25.08 KiB]
Downloaded 59 times

_________________
Create your own NewGRF? Check out this tutorial!
Top
 Profile  
 
PostPosted: Wed Jun 03, 2009 8:38 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
None taken, I'm glad that you are helping me. I thought that Notepad++'s trim trailing whitespaces command would do the job, but it seems like it didn't.

The whitespace detector wasn't able to detect any trailing whitespaces, even in files that I know for sure that had them (like the release of the patch for stable 0.7, which I removed until I have time to prepare a new one for 0.7.1). I think it may be because I'm in windows right now: I'll give it another try later in ubuntu.

Edit: It didn't worked in ubuntu. Perhaps I'm doing something wrong?. I open the whitespace remover with firefox (tried with explorer too), put the route of the file at the <file> field and press load. When I put a wrong route on purpose, there's no output. When I put the correct route, I get a "no whitespaces found" message.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Thu Jun 04, 2009 8:28 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Sun Jan 27, 2008 1:02 pm
Posts: 298
Did you enter the correct line-ending in the top right box? For anything vaguely related to unix, including your patch file, %0A (=\n) is usually a better choice than windows's %0D%0A (=\r\n)

_________________
Create your own NewGRF? Check out this tutorial!


Top
 Profile  
 
PostPosted: Thu Jun 04, 2009 8:57 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
That was my mistake: the whitespace remover worked perfectly. I uploaded a version free of trailing whitespaces in the first post. Thank you for your patience and help again, Hirundo.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Thu Jun 04, 2009 7:05 pm 
Offline
Engineer
Engineer

Joined: Thu Mar 19, 2009 4:52 pm
Posts: 55
Location: Bad Schwartau
Hi,

this is a great patch, but now I couldn't hide the population of a town. Is it possible to add an option "Show town names colored to the rating" which also dye the name (whether the population appears)?

Sincerely
xZise


Top
 Profile  
 
PostPosted: Thu Jun 04, 2009 7:52 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
The original behaviour of the patch was to show both strings coloured (hence the outdated name of the patch that I'll correct some day). It added a new setting (show ratings in town sign or something like that) instead of modifying the already existent setting for population. This behaviour was abandoned in favor of the present one because of four motives.

- I think that there's already too much advanced settings, and showing population and ratings can be joined in the same option because they do mostly the same (show extra info about the town).

- Since station signs are coloured too, the coloured town name generated confusion. More important: if transparency is set, is impossible to tell apart the town name and stations with the same color than the town rating.

- The colours made the town name a bit more unreadable.

- The code is more undestandable now, and easier to mantain.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Thu Jun 04, 2009 10:53 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Jun 28, 2006 6:25 pm
Posts: 293
Location: Florida
I love this patch! I can immediately see my standing with each town, esp. when i'm bulldozing their trees!! :twisted:

Now let us pray to the gods of Trunk Inclusion that they may find favor with your sacrifice....

(Anyone bring the incense? And where's the virgin??!) :P


Top
 Profile  
 
PostPosted: Fri Jun 05, 2009 7:04 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
The patch has not been submitted to flyspray for dev revision, as I still need to reimplement some quick hacks I did and add comments to my code to make it cleaner. When I'm sure that the patch is clean and correctly implemented, it will be submitted. Then we will know if this patch can be added to trunk or not.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Wed Jun 24, 2009 2:29 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
Another new version has arrived. Check the first post for the diff file and a win32 build.

v0.64: Update to current trunk. Critical parts of the patch have been remade to be both faster and easier to read.

Right now what I had in mind for this patch is almost finished, and there's a single problem to be solved (unless we find another one, of course). As you may know, right now the colour scheme uses colours that are not part of the TextColour enum. Without using custom colours, the colour scheme would be reduced to something like Red, Orange, Yellow, White and Green; losing information for some rating levels and it would look worse. But the changes to the code needed to show these extra colors are kind of ugly and some hacks are needed. There's two options: I could take the new colours out and submit it to flyspray in a cleaner state, or try to undo the hacks and implement my changes in a well designed way (which would require to rewrite string functions that are used a lot through all of OpenTTD's code). Personally I prefer the simpler approach (patches should stay as simple as possible) but I want to check your feedback before taking it. Of course if I end making a version with a reduced color scheme, the old patch would stay somewhere for everybody who prefers it.

Edit: This is the patch for v0.64. Note that this is the last patch with a different colour for each rating


Attachments:
rating_town_label_v0.64_r16727.diff [10.41 KiB]
Downloaded 63 times

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.
Top
 Profile  
 
PostPosted: Fri Jul 03, 2009 5:16 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
Another new version. The patch was renamed because the last name wasn't very correct. As always, diff and binary in the first post.

v0.7: Patch renamed, and almost completely remade. The patch uses only standard colours, and because of that now the code is way more simple. Added comments and fixed a situation in which the correct ratings weren't shown.

As you can see, this version reduces the number of colours to make the patch more simple. I don't think that anybody will miss the last version, since there was no feedback about the planned changes and I posted different files by mistake and it seems that nobody noticed. Anyways the old version can be found in my previous post. I'd like to ask for a final review of the code, because this is the version I'm going to submit to flyspray.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Tue Aug 04, 2009 5:12 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
Updated patch and binary at the first post. No new features.

v0.71: Update to current trunk. Fixed an incorrect string.

To avoid quintuple posting, I will not announce future updates to this patch.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Sat Aug 08, 2009 10:40 am 
Offline
Engineer
Engineer

Joined: Thu Mar 19, 2009 4:52 pm
Posts: 55
Location: Bad Schwartau
Hi,
the germans textstring for this Patch:
Code:
STR_CONFIG_SETTING_POPULATION_IN_LABEL                          :{LTBLUE}Zeige die die Haltung von Städten in ihrem Namensschild: {ORANGE}{STRING}


Sincerely
xZise


Top
 Profile  
 
PostPosted: Sun Aug 09, 2009 9:54 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
Thank you, xSize. I am not including translations in my patches (besides english) to keep them as clean and trunk-friendly as I can, but german-speaking testers of this patch could find it useful if it was made as an additional diff file.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Sat Jan 02, 2010 9:32 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Dec 21, 2004 5:35 am
Posts: 137
Location: St. Petersburg, Russia
Check this out
Just patch against trunk


Attachments:
rating_town_label_r18684.patch [7.17 KiB]
Downloaded 49 times

_________________
OpenTTD Hard Game Pack
Top
 Profile  
 
PostPosted: Sat Jan 02, 2010 11:26 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
First post updated with a patch against current trunk (r18684).

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Tue Aug 10, 2010 8:45 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Jun 25, 2009 4:42 pm
Posts: 2241
Location: Suffolk, UK
Bump Question: why is this not in trunk yet?

_________________
AroAI - A really feeble attempt at an AI

  • Unix *is* user-friendly. It is not ignorant-friendly and idiot-friendly.
  • Duct tape is like the force. It has a light side, a dark side, and it holds the universe together... -- Carl Zwanzig
  • I am always doing that which I cannot do, in order that I may learn how to do it. -- Pablo Picasso
  • Time LINE...? Ehh, time isn't made out of LINES. It is made out of circles. That is why clocks are round! -- Caboose, RvB


Top
 Profile  
 
PostPosted: Tue Aug 10, 2010 9:23 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
Read the full thread to see all the tried options to show the town rating. The final solution is no good either: it is confusing because colours are already used for stations. There are not enough "standard" colours to show all ratings and as a result you lose some information. People with colour blindness can't distinguish some town rating colour / background combinations.

Showing changes in town rating via a text effect (as already done for costs/profits) is not good either. Knowing that the rating has changed (which requires paying attention to the town while building) is not that useful.

In short: suggestions will be helpful to finish this feature, bumps without content will not.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Tue Aug 10, 2010 9:49 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Jun 25, 2009 4:42 pm
Posts: 2241
Location: Suffolk, UK
perhaps have the option to turn it off, or off by default
and people with colour blindness can't distinguish between half of what's in OTTD

_________________
AroAI - A really feeble attempt at an AI

  • Unix *is* user-friendly. It is not ignorant-friendly and idiot-friendly.
  • Duct tape is like the force. It has a light side, a dark side, and it holds the universe together... -- Carl Zwanzig
  • I am always doing that which I cannot do, in order that I may learn how to do it. -- Pablo Picasso
  • Time LINE...? Ehh, time isn't made out of LINES. It is made out of circles. That is why clocks are round! -- Caboose, RvB


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 68 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000-2013 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2013.
Hosted by Zernebok Hosting.