Page 2 of 4

Posted: 11 Nov 2005 18:51
by MeusH
Shooshpanchick's idea worked, thank you.

Now, I'm very confused with String_IDs.

I'd like to use string but seems String_ID is required to draw a tooltip.
Take a look at this line:

Code: Select all

WP(w,tooltips_d).string_id = string_id;
It draws a tooltip with set string_id which is processed against language test, resulting different hints in different languages.

Is there other WP(w,tooltips_d)'s property than string_id?

Posted: 11 Nov 2005 20:25
by MeusH
Good news: I'm making good progress :) Image and diff really soon.


Now, absolute[0] x and y are displayed instead of relative[1] TileX and TileY[2].

[0] - Count from tile(0,0)
[1] - Count from selection start
[2] - TILE_SIZE=16; TileX = x/TILE_SIZE

Posted: 11 Nov 2005 21:01
by MeusH
Features: Relative values work, result is tile difference +1

Need to be fixed: Showing length (only x or only y) doesn't work

Future: Showing maximum height difference in the selected area (Bjarni)

Posted: 11 Nov 2005 21:16
by belugas
Very good job you've done there, MeusH!
I just can't wait to get home and try this :D

Posted: 11 Nov 2005 22:39
by Darkvater
webfreakz.nl wrote: <?
$str = 'Text' .$int. 'Other text' .$int2;
?>
[/code]
(Yes i do how to program in PHP rather than in C !!)
I'd say you guys can't program PHP. It is actually:

Code: Select all

<? $str = "Text $int Other text $int2"; ?>

Posted: 11 Nov 2005 23:05
by MeusH
Darkvater wrote:I'd say you guys can't program PHP. It is actually:

Code: Select all

<? $str = "Text $int Other text $int2"; ?>
On the other hand, sometimes your method won't work.

Code: Select all

<? $file = $_GET['number'] . '.txt'; ?>
^ adding strings

Here you have some more pics

Posted: 12 Nov 2005 10:37
by Wolf01
you may also show the cost, so you haven't to use the shift to know how you spend

Posted: 12 Nov 2005 11:38
by Shooshpanchick
MeusH wrote:other hand, sometimes your method won't work.

Code: Select all

<? $file = $_GET['number'] . '.txt'; ?>
^ adding strings

Code: Select all

<? $file = "{$_GET['number']}.txt"; ?>
Your patch should definitely be in next integrated nightly :)

Posted: 12 Nov 2005 12:29
by nicfer
Wolf01 wrote:you may also show the cost, so you haven't to use the shift to know how you spend
Today I have the same idea :lol:

Posted: 12 Nov 2005 12:47
by webfreakz.nl
MeusH wrote:Here you have some more pics
That's great!

How far is the patch coming? :)

Posted: 12 Nov 2005 14:06
by MeusH
webfreakz.nl wrote:How far is the patch coming? :)
I'm experiencing big problems with measuring height difference :(
Why

Code: Select all

int heightdiff;
heightdiff = TileHeight(TileVirtXY(10, 10)) - TileHeight(TileVirtXY(5,5));
is heightdiff always 0, even if there are different heights on tile 5,5 and 10,10?
Image

Posted: 12 Nov 2005 14:18
by webfreakz.nl
MeusH wrote:
webfreakz.nl wrote:How far is the patch coming? :)
I'm experiencing big problems with measuring height difference :(
Why

Code: Select all

int heightdiff;
heightdiff = TileHeight(TileVirtXY(10, 10)) - TileHeight(TileVirtXY(5,5));
is heightdiff always 0, even if there are different heights on tile 5,5 and 10,10?
Uhm, I was thinking of using the function 'drag&drop' which is used when you place a station or something like that? That function also has to count how many tiles it needs or else your station is bigger than you want it to! So with this, you can easily make the image ( or yours ) in the starting-post :)

I could also be very wrong in using this function, just let me know ;)

Posted: 12 Nov 2005 15:12
by MeusH
webfreakz.nl wrote:
MeusH wrote:
webfreakz.nl wrote:How far is the patch coming? :)
I'm experiencing big problems with measuring height difference :(
Why

Code: Select all

int heightdiff;
heightdiff = TileHeight(TileVirtXY(10, 10)) - TileHeight(TileVirtXY(5,5));
is heightdiff always 0, even if there are different heights on tile 5,5 and 10,10?
Uhm, I was thinking of using the function 'drag&drop' which is used when you place a station or something like that?
I'm using more global function, which is being called by all dragging buttons
webfreakz.nl wrote:So with this, you can easily make the image ( or yours ) in the starting-post :)
What? (or mine)?

Posted: 12 Nov 2005 15:16
by webfreakz.nl
MeusH wrote:
webfreakz.nl wrote:So with this, you can easily make the image ( or yours ) in the starting-post :)
What? (or mine)?
This one:

http://www.tt-forums.net/viewtopic.php?p=372933#372933

:)

Posted: 12 Nov 2005 15:44
by MeusH
Hehe, anyway, I've made a good progress:

Code: Select all

FindLandscapeHeight(&start_ti, sx, sy);
FindLandscapeHeight(&end_ti, x, y);

heightdiff = (end_ti.z * 50 / 8) - (start_ti.z * 50 / 8);
TileIndex.z was a proper tile height. Take a look at the attached screenies

Posted: 12 Nov 2005 16:56
by MeusH
Here is the diff :P
It is still against r3163 because there are some linking problems due to newstation support and new files to the trunk 8)

Posted: 12 Nov 2005 17:34
by belugas
MeusH wrote:Here is the diff :P
It is still against r3163 because there are some linking problems due to newstation support and new files to the trunk 8)
Add station_newgrf.h and station_newgrf.c in your project.
I'm using MSV6, and it compiled without problems

Posted: 12 Nov 2005 17:45
by MeusH
I've downloaded .dsw and .dsp from the trunk but seems something doesn't work.

Anyway, there are some things to do:
* must
+ nice to have to


* Show the tooltip after pressing some key. It can't be ctrl, because diagonal selection uses it. It may be alt or shift

* Make it work with tunnels

* Show height difference for bridges, too

+ Show query cost

+ Move the tooltip so it won't be behind huge cursor (like rail cursor)

+ {} (new line sign) working in tooltip

Posted: 12 Nov 2005 17:58
by belugas
You can try this diff. It is from the project I have updated.
There are some stuff I don't know where the do come from, but I can compile with it, no prob...

Posted: 12 Nov 2005 23:14
by MeusH
I've managed to make it working with tunnels. However, it shows length of docks (2), too.

I'll duplicate the toolkit showing function so I can move my toolkit away from the mouse cursor, then go to rail (tracks+signals) and hotkey check.