NewGRF GUI 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

Jupix
Chief Executive
Chief Executive
Posts: 683
Joined: 19 Feb 2005 09:08
Location: Finland
Contact:

Re: NewGRF GUI Window

Post by Jupix »

lordazamath wrote:How is wiki.openttd.org readable for even 640*480. I tried this just..Wanted to show manual to someone...He couldn't read it...
What, the page refused to load on a low resolution?
#################
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: NewGRF GUI Window

Post by Rubidium »

lordazamath wrote:How is wiki.openttd.org readable for even 640*480. I tried this just..Wanted to show manual to someone...He couldn't read it...
With links/lynx it is; otherwise you are free to 'fix' it.
User avatar
cmoiromain
Chief Executive
Chief Executive
Posts: 655
Joined: 15 Jan 2007 21:45
Location: FRANCE
Contact:

Re: NewGRF GUI Window

Post by cmoiromain »

I wanted to bring back this topic, the number of GRF files becoming larger every day, with the new industries and the graphic replacement projects going on. This feature would really be useful, despite the fact that the window is too large. And, as it was already said, maybe the patch could switch back to normal behaviour when resolution is too small. I have no idea how C++ works, but I guess that would do the trick:

Code: Select all

if ($screen_height >> 480 && $screen_width >> 640)
    {
    //paste your patch here
    }
else
    {
    //paste original code here
    }
That's PHP coding, but I believe C++ looks the same...


And another request, maybe to add a way of adding sub folders to the list of available GRFs, once again because organising them all would make life easier (for example a directory containing all the ECS vectors, another containing all the UKRS files (train, roads, industries...), one containing the newGFX files, and so on)

I am conscious that trunk does not take in new features until v0.6 is out, but I hope this will make it soon afterwards!
Last edited by cmoiromain on 09 Mar 2008 17:30, edited 1 time in total.
I am little, ugly, and nasty. How do you do?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: NewGRF GUI Window

Post by DaleStan »

cmoiromain wrote:

Code: Select all

if (height >> 480 && width >> 640)
That's PHP coding, but I believe C++ looks the same...
I don't think that's quite what you meant. C++ or PHP.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
cmoiromain
Chief Executive
Chief Executive
Posts: 655
Joined: 15 Jan 2007 21:45
Location: FRANCE
Contact:

Re: NewGRF GUI Window

Post by cmoiromain »

here you go :roll:
I am little, ugly, and nasty. How do you do?
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: NewGRF GUI Window

Post by DaleStan »

That's not what I meant. In most languages (including C, C++, C#, Java, Perl, and Python) >> is the right-shift operator. Right shifting by values equal to or larger than the width of the left-hand operand is discouraged. 641-bit wide integers are rather larger than most current processors are comfortable handling.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
cmoiromain
Chief Executive
Chief Executive
Posts: 655
Joined: 15 Jan 2007 21:45
Location: FRANCE
Contact:

Re: NewGRF GUI Window

Post by cmoiromain »

for me that literally means "If the screen height is more than 480 pixels and the screen width is more than 640, then put the patch (draw the new window). If any of the height or width is smaller, then use the original behaviour. IIRC in PHP >> means "bigger than". But then maybe I'm wrong, I haven't coded for more than a year...

But anyway this is not the matter, the topic was about a new GRF selection window.
I am little, ugly, and nasty. How do you do?
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Re: NewGRF GUI Window

Post by fabca2 »

cmoiromain wrote: IIRC in PHP >> means "bigger than".
no,

DaleStan is totally right.
> is greater.
>> is the right-shift operator.
User avatar
Roest
Traffic Manager
Traffic Manager
Posts: 215
Joined: 03 Apr 2008 08:18

Re: NewGRF GUI Window

Post by Roest »

reviving another corpse
Attachments
newgrf_gui_r12735.diff
(27.85 KiB) Downloaded 179 times
yorick
Engineer
Engineer
Posts: 80
Joined: 23 Mar 2008 08:53

Re: NewGRF GUI Window

Post by yorick »

It might be better to filter out the ones that you can't apply (same grfid as one already in), so you can get a nice overview.
User avatar
Roest
Traffic Manager
Traffic Manager
Posts: 215
Joined: 03 Apr 2008 08:18

Re: NewGRF GUI Window

Post by Roest »

added a button to toggle between all grfs and unselected ones
fixed some truncation
changed the strings in english.txt so it works with all languages
Attachments
newgrf_gui_r12914.patch
(28.69 KiB) Downloaded 231 times
screen1.png
screen1.png (383.99 KiB) Viewed 1691 times
screen2.png
screen2.png (383.91 KiB) Viewed 1659 times
User avatar
rbenevid
Traffic Manager
Traffic Manager
Posts: 192
Joined: 14 Oct 2004 20:08
Location: Brazil

Re: NewGRF GUI Window

Post by rbenevid »

Does it support low resolutions? 320x240? Not that I need it, it's that I think the devs won't accept this patch in the trunk if it doesn't support it. And this patch is too good to not go into the trunk!

Thank you!
User avatar
Roest
Traffic Manager
Traffic Manager
Posts: 215
Joined: 03 Apr 2008 08:18

Re: NewGRF GUI Window

Post by Roest »

rbenevid wrote:Does it support low resolutions? 320x240? Not that I need it, it's that I think the devs won't accept this patch in the trunk if it doesn't support it. And this patch is too good to not go into the trunk!

Thank you!
No it doesn't and i doubt it ever will. The solution will probably be a switch between this and the original windows for low resolutions. But then, having two different newgrf windows is also disliked by the devs.
Trond
Tycoon
Tycoon
Posts: 973
Joined: 25 Jan 2008 07:32
Location: Gamle Ørnenuten

Re: NewGRF GUI Window

Post by Trond »

Just tested this and it works like a charm on high resolution, wich is probably what most people use these days :) Good Job Roest!
..: Trond :.. because you deserve it! Image

The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell

MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: NewGRF GUI Window

Post by Wolf01 »

I was playing with paint some days ago trying to figure out a grf window to start a my own patch, but I think I won't code anything
If you like, this is what I was thinking: http://wolf01.game-host.org/OTTD_relate ... estyle.png
User avatar
Roest
Traffic Manager
Traffic Manager
Posts: 215
Joined: 03 Apr 2008 08:18

Re: NewGRF GUI Window

Post by Roest »

ctrl-clicking the "toggle show mode" button now toggles between grf names and filenames
the right list of selected grfs can now be sorted using drag&drop
Attachments
newgrf_gui_r12929.patch
(31.93 KiB) Downloaded 235 times
screen3.png
screen3.png (459.17 KiB) Viewed 1703 times
User avatar
Roest
Traffic Manager
Traffic Manager
Posts: 215
Joined: 03 Apr 2008 08:18

Re: NewGRF GUI Window

Post by Roest »

updated to r13135
Attachments
7_newgrf_gui_r13135.patch
(33.77 KiB) Downloaded 201 times
Tiberius
Engineer
Engineer
Posts: 86
Joined: 17 Sep 2004 03:15

Re: NewGRF GUI Window

Post by Tiberius »

update for r13377 :D
edit[0]: now it's horizontally resizable!
edit[1]: tweaked left pane scroll bars, fixed 'warning symbol' display
edit[2]: removed unused configuration variable
Last edited by Tiberius on 26 Jun 2008 10:37, edited 2 times in total.
I may implement/fix/tweak/eat/ditch it soon (or in distant future, if at all, so don't hold your breath).
If anyone want to be the one please implement it for us all 8)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NewGRF GUI Window

Post by planetmaker »

Is there a chance for an update? It compiles, but I it crashes when I choose "apply" in the newgrf window. Messages in the console (applied to r13571).

Code: Select all

openttd(930,0xa000d000) malloc: *** vm_allocate(size=8421376) failed (error code=3)
openttd(930,0xa000d000) malloc: *** error: can't allocate region
openttd(930,0xa000d000) malloc: *** set a breakpoint in szone_error to debug
openttd(930,0xa000d000) malloc: *** vm_allocate(size=8421376) failed (error code=3)
openttd(930,0xa000d000) malloc: *** error: can't allocate region
openttd(930,0xa000d000) malloc: *** set a breakpoint in szone_error to debug
Thanks
Tiberius
Engineer
Engineer
Posts: 86
Joined: 17 Sep 2004 03:15

Re: NewGRF GUI Window

Post by Tiberius »

checked against r13638 and seems working fine.
I may implement/fix/tweak/eat/ditch it soon (or in distant future, if at all, so don't hold your breath).
If anyone want to be the one please implement it for us all 8)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 7 guests