Got an idea for OpenTTD? Post it here!
Moderator: OpenTTD Developers
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 11 Nov 2005 18:51
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 ?
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 11 Nov 2005 20:25
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
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 11 Nov 2005 21:01
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)
Attachments
tooltip_r3165.patch
Difference file (2.71 KiB) Downloaded 111 times
Sample image measure_test_1.png (28.21 KiB) Viewed 2416 times
belugas
OpenTTD Developer
Posts: 1507 Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:
Post
by belugas » 11 Nov 2005 21:16
Very good job you've done there, MeusH!
I just can't wait to get home and try this
Darkvater
Tycoon
Posts: 3053 Joined: 24 Feb 2003 18:45
Location: Hong Kong
Post
by Darkvater » 11 Nov 2005 22:39
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"; ?>
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 11 Nov 2005 23:05
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
Attachments
measure_test_3.png (51.53 KiB) Viewed 2362 times
measure_test_2.png (17.79 KiB) Viewed 2362 times
Wolf01
Tycoon
Posts: 2016 Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:
Post
by Wolf01 » 12 Nov 2005 10:37
you may also show the cost, so you haven't to use the shift to know how you spend
Shooshpanchick
Engineer
Posts: 8 Joined: 15 Nov 2004 22:58
Contact:
Post
by Shooshpanchick » 12 Nov 2005 11:38
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 :)
nicfer
Director
Posts: 529 Joined: 03 May 2005 20:50
Location: Somewhere in a country called Argentina
Post
by nicfer » 12 Nov 2005 12:29
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
Sorry for my english I am argentinian
TTO don't crashes in Windows XP; XP crashes TTO
Formerly known as UnderBuilder.
MyMiniCity
webfreakz.nl
Director
Posts: 627 Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:
Post
by webfreakz.nl » 12 Nov 2005 12:47
MeusH wrote: Here you have some more pics
That's great!
How far is the patch coming?
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 12 Nov 2005 14:06
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?
webfreakz.nl
Director
Posts: 627 Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:
Post
by webfreakz.nl » 12 Nov 2005 14:18
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
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 12 Nov 2005 15:12
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)?
webfreakz.nl
Director
Posts: 627 Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:
Post
by webfreakz.nl » 12 Nov 2005 15:16
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
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 12 Nov 2005 15:44
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
Attachments
measure_test_5.png (80.51 KiB) Viewed 2265 times
measure_test_4.png (33.18 KiB) Viewed 2265 times
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 12 Nov 2005 16:56
Here is the diff
It is still against r3163 because there are some linking problems due to newstation support and new files to the trunk
Attachments
tooltip3_r3165.patch
(5.13 KiB) Downloaded 101 times
belugas
OpenTTD Developer
Posts: 1507 Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:
Post
by belugas » 12 Nov 2005 17:34
MeusH wrote: Here is the diff
It is still against r3163 because there are some linking problems due to newstation support and new files to the trunk
Add station_newgrf.h and station_newgrf.c in your project.
I'm using MSV6, and it compiled without problems
Attachments
ToolTipFrench.patch
And why not already a french translation... (909 Bytes) Downloaded 103 times
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 12 Nov 2005 17:45
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
belugas
OpenTTD Developer
Posts: 1507 Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:
Post
by belugas » 12 Nov 2005 17:58
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...
Attachments
OpenTTD_DSP.patch
(3.68 KiB) Downloaded 106 times
MeusH
Tycoon
Posts: 4349 Joined: 25 Oct 2004 15:39
Location: Mississauga
Post
by MeusH » 12 Nov 2005 23:14
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.
Users browsing this forum: Google [Bot] and 5 guests