Page 2 of 6

Re: NewGRF GUI Window

Posted: 28 Dec 2007 22:46
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?

Re: NewGRF GUI Window

Posted: 28 Dec 2007 23:05
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.

Re: NewGRF GUI Window

Posted: 08 Mar 2008 23:49
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!

Re: NewGRF GUI Window

Posted: 09 Mar 2008 06:14
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.

Re: NewGRF GUI Window

Posted: 09 Mar 2008 17:31
by cmoiromain
here you go :roll:

Re: NewGRF GUI Window

Posted: 10 Mar 2008 16:36
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.

Re: NewGRF GUI Window

Posted: 10 Mar 2008 19:19
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.

Re: NewGRF GUI Window

Posted: 12 Mar 2008 08:35
by fabca2
cmoiromain wrote: IIRC in PHP >> means "bigger than".
no,

DaleStan is totally right.
> is greater.
>> is the right-shift operator.

Re: NewGRF GUI Window

Posted: 16 Apr 2008 16:12
by Roest
reviving another corpse

Re: NewGRF GUI Window

Posted: 28 Apr 2008 09:08
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.

Re: NewGRF GUI Window

Posted: 29 Apr 2008 10:54
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

Re: NewGRF GUI Window

Posted: 29 Apr 2008 13:13
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!

Re: NewGRF GUI Window

Posted: 29 Apr 2008 13:18
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.

Re: NewGRF GUI Window

Posted: 29 Apr 2008 16:33
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!

Re: NewGRF GUI Window

Posted: 29 Apr 2008 17:37
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

Re: NewGRF GUI Window

Posted: 30 Apr 2008 07:59
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

Re: NewGRF GUI Window

Posted: 17 May 2008 11:40
by Roest
updated to r13135

Re: NewGRF GUI Window

Posted: 04 Jun 2008 17:00
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

Re: NewGRF GUI Window

Posted: 18 Jun 2008 22:06
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

Re: NewGRF GUI Window

Posted: 26 Jun 2008 10:38
by Tiberius
checked against r13638 and seems working fine.