The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Dwachs on December 27, 2008, 03:08:37 pm

Title: [Patch] New underground view
Post by: Dwachs on December 27, 2008, 03:08:37 pm
Currently I am reworking the underground mode. The new mode has the following properties (features?)
== if switching to underground, the height of the tile under the cursor will be taken as underground-level
== everything under or on underground-level will be displayed as usual
== if the tile is above the underground-level, a currently black tile is displayed at the underground-level
== only tunnels that are on the underground-level are displayed, tunnels above / below the underground-level won't be displayed
== cursor movement on the displayed tiles not on the invisible landscape
-- it should be easier to develop multi-level underground editing with the new underground viewing mode

See the attached screenshots of the same spot of the map, in normal and in new underground mode.

Up to now, I modified the displaying routines. I plan to modify the tools such that 'overground' tools work on all the tiles that are overground, and tunnel tools on the underground-tools.

Any thoughts and comments are welcome.
Title: Re: New underground view
Post by: DirrrtyDirk on December 27, 2008, 03:51:50 pm
Have you talked to Kieron? I think he started reworking underground a while ago, too...
Title: Re: New underground view
Post by: VS on December 27, 2008, 06:32:26 pm
Is there some way to move up/down? I understand that taking the current tile as base is simple for lack of GUI coding, but... ;)

Nevertheless, good work!
Title: Re: New underground view
Post by: Dwachs on December 27, 2008, 06:54:45 pm
Is there some way to move up/down? I understand that taking the current tile as base is simple for lack of GUI coding, but... ;)

Nevertheless, good work!

thank you :)

it should be easily possible to add tools for moving the underground level up/down.
Title: Re: New underground view
Post by: isidoro on December 27, 2008, 07:30:55 pm
Very nice!  With such an approach, it would be easy to build several connected underground levels.  "Underground artificial slopes" would suffice.

An idea: the overground ramps look strange to me.  The grid can be present only at horizontal sides of tiles at the level chosen, to give 3D impression.
Title: Re: New underground view
Post by: jamespetts on December 27, 2008, 08:11:25 pm
Changing the cursor tile alignment in itself would be a huge improvement. I should be very interested to see this.
Title: Re: New underground view
Post by: prissi on December 27, 2008, 08:12:59 pm
Looks very much like locomotion. Is there a patch for testing?
Title: Re: New underground view
Post by: Dwachs on December 28, 2008, 10:40:53 am
An idea: the overground ramps look strange to me.  The grid can be present only at horizontal sides of tiles at the level chosen, to give 3D impression.

These overground ramps are drawn to indicate the border between overground and underground terrain. Since internally the z-coordinate of the slopes is the z-coordinate of the tile below, these slopes are  drawn naturally with my approach.

Changing the cursor tile alignment in itself would be a huge improvement. I should be very interested to see this.

The cursor alignment is changed, it will move on the drawn tiles, and not on the regular surface of the ground. The cursor behaviour in the current underground mode was one motivation to develop this patch.

A patch file will follow soon.
Title: Re: New underground view
Post by: Dwachs on December 29, 2008, 12:54:30 pm
Here is the patch file. Under Options -> Display one can toggle the underground-view and change the underground-level gradually.

Title: Re: New underground view
Post by: z9999 on December 29, 2008, 04:47:48 pm
Some impression.

- Number input box is a problem. Usually, water level is -2, but number input box can't select negative values.
- I want to use existing underground view, too. New underground view is useful in some cases but not always. It's a pain to select each level, and also I want to view all at once.

And one question. Is it intended that all level of monorail and elevated road and tracks will be hidden ?

Problem:
If I build a "High speed road tunnel" on snow, background slope tile was transparent.

[attachment deleted by admin]
Title: Re: New underground view
Post by: Dwachs on December 29, 2008, 07:25:49 pm
thank you for testing. You found the following bugs:
== no ground tiles are displayed for tunnel entries
== grid lines are shown inside the tunnel despite being not in underground-mode
== elevated (monorail) tracks are not correctly displayed in underground-mode
== number input can be adapted easily, my test games did have water at 0

An easy keyboard shortcut to increase/decrease underground-level can be implemented too. Would that suffice for your purposes?
Title: Re: New underground view
Post by: Lodovico on December 30, 2008, 07:26:33 pm
Go on, Dwachs. Your path is very usefull. I quite very often need to handle "multilevel tunnels".
Title: Re: [Patch] New underground view
Post by: Dwachs on December 31, 2008, 12:59:16 pm
Here is a new patch file. All issues indicated by z9999 are solved. The pak64-roadtunnel causes graphical glitches that are not due to my patch and appear in older versions already (tested in 2168).

Now, also a simple tool is implemented: increase / decrease the underground-level by special keys. The effect is only visible if underground-mode is active. One has to add the following lines to pakxx/config/menuconf.tab:
Code: [Select]
# WKZ_INC_UNDERGROUND_LEVEL = 20
# WKZ_DEC_UNDERGROUND_LEVEL = 21
simple_tool[20]=,HOME
simple_tool[21]=,END
this will increase / decrease the underground-level if the 'home' / 'end' keys are pressed. Ofcourse, different keys than 'home'/'end' can be defined.

edit: some more notes:
-- I ****umed '20' to be the maximal underground-level, I did not found an easy way to detect the maximal height in a map. One could add a visible indication what underground-level is currently chosen, for instance in the ticker etc.
-- Behaviour of tools and toolbars is similar as before. I did not touch it.
-- The standard image for grounds in underground-mode is black with gridlines for empty tiles and the sidewalk-image for tunnel ways. Here, one could modify the besch / pak-system to allow textures for the underground-tiles.
-- With this underground-mode, there is the possibility to add slopes in tunnels. Not implemented yet.
Title: Re: [Patch] New underground view
Post by: jamespetts on December 31, 2008, 01:06:33 pm
This looks very promising!
Title: Re: [Patch] New underground view
Post by: z9999 on December 31, 2008, 04:39:19 pm
Here is a new patch file. All issues indicated by z9999 are solved.

Thank you. It seems that everything is working properly.

Quote
Now, also a simple tool is implemented: increase / decrease the underground-level by special keys.

It's very useful, thank you.
Title: Re: [Patch] New underground view
Post by: Dwachs on January 05, 2009, 06:28:21 pm
@z9999: What is your reason that you want to use also the 'old' underground view? quick finding of all tunnels? Or is it enough to change the displayed underground level with the keyboard?
Title: Re: [Patch] New underground view
Post by: z9999 on January 05, 2009, 08:05:17 pm
I first thought it is difficult to positional awareness between each height.
But in fact it was not.
Other reasons are quick finding tunnels and for pleasure like "follow me" mode. These are not so important.

So, I will drop my demand. Changing level with the keyboard is enough.
Thank you.
Title: Re: [Patch] New underground view
Post by: VS on January 05, 2009, 08:36:43 pm
Well, seeing things below current level, maybe with black transparency, might be nice... but it is a very minor detail.
Title: Re: [Patch] New underground view
Post by: kierongreen on January 05, 2009, 08:45:22 pm
Have you talked to Kieron? I think he started reworking underground a while ago, too...
Haven't heard anything... I've really not had the time for anything to do with simutrans recently. I was planning on dealing with multilevel tunnels by reusing the artificial slope buttons. Got as far as some logic being there for detecting clicks on ends of tunnels. I don't think I'm going to make much progress soon though - at the moment I don't even have an internet connection at home.
Title: Re: [Patch] New underground view
Post by: Dwachs on January 06, 2009, 11:53:37 am
The next step for this patch would be to alter all the tools. In the way, that 'overground tool' work on the tiles that are normally shown, while underground-tools work on the underground tiles.

For multi-level tunnels I thought similarly about using the artificial slope tools: building a slope on a tunnel end gives an upward slope in the tunnel way. However, displaying will get complicated since an upward slope belongs programwise to the level below. And path-finding will be another difficulty I fear.

Any opinions on both issues?
Title: Re: [Patch] New underground view
Post by: jamespetts on January 06, 2009, 12:29:03 pm
Dwachs,

does altering the tools require work from coders or pakset authors or both?
Title: Re: [Patch] New underground view
Post by: z9999 on January 06, 2009, 12:38:44 pm
One question.

In current your patch, we can build a stop and set schedule on the middle level of way. (see first picture) This was impossible in original simutrans.
I don't know this is intended or not, but I like this very much.
Will this remain in the future ?


[attachment deleted by admin]
Title: Re: [Patch] New underground view
Post by: Dwachs on January 06, 2009, 12:55:49 pm
@james petts: altering the tools means only coder work. I did not look into it. But I think a lot of checks like 'is mouse position over/under ground' have to be added.

@z9999: If I understand your right, you have three levels of streets above each other, and now you can select the middle level, if you choose the underground level right? I hope this behavior can be recovered, since I altered also the computation of mouse position in underground mode.

In the original underground mode one can build tunnel ways only from already existing ways, this condition can be relaxed now I think.
Title: Re: [Patch] New underground view
Post by: isidoro on January 06, 2009, 05:08:34 pm
For the tools:  to simplify things, why not keeping the underground tools while in underground mode and not allow to build overground?

For the ramps:  why not marking them as if overground, or with a different color?

Title: Re: [Patch] New underground view
Post by: prissi on January 06, 2009, 10:19:20 pm
With some though, I do not think many tools require a change. Especially since most tools now take a 3d coordinate anyway. (Was one of the more recent changes.)

But I think it would better to enforce tunnels to be built in connection with overground ways.
Title: Re: [Patch] New underground view
Post by: jamespetts on January 06, 2009, 10:59:35 pm
With some though, I do not think many tools require a change. Especially since most tools now take a 3d coordinate anyway. (Was one of the more recent changes.)

But I think it would better to enforce tunnels to be built in connection with overground ways.

What about underground metro systems?
Title: Re: [Patch] New underground view
Post by: Dwachs on January 07, 2009, 08:38:01 am
But I think it would better to enforce tunnels to be built in connection with overground ways.
You mean automatically placing tunnel entries, overground street and underground way if the player wants to build from an overground tile to an underground tile?
Title: Re: [Patch] New underground view
Post by: jamespetts on January 22, 2009, 08:10:29 pm
Hmm, any more progress on getting the tools sorted out for this? It'd be good to put this in Simutrans-Experimental if the tools were fixed.
Title: Re: [Patch] New underground view
Post by: Dwachs on January 23, 2009, 06:21:43 am
Hi James, I did not work on that recently. Feel free to use this in your experimental build. You will have to translate the patch file (gib -> get ...). I will help sorting out bugs with respect to the tools.
Title: Development snapshot
Post by: Dwachs on January 30, 2009, 08:13:24 pm
Now, I the 'old' underground mode and the 'new' coexist friendly.

Pressing 'U' gives you the new mode, with the level where the landscape is cut according to cursor position. Pressing again 'U' toggles the 'old' mode. Another 'U' returns to normal mode.

The tools for changing the underground level are as described above.

Here is a windows binary, patch attached:
http://rapidshare.com/files/191721652/simutrans-ug.exe.html (http://rapidshare.com/files/191721652/simutrans-ug.exe.html)

Please test for bugs in displaying and in the build-tunnel tool. All other tools I did not touch/test, expect undocumented behaviour there ;)

I also ask for opinions about the toggling method. How should the different view modes be toggled?
Title: Re: [Patch] New underground view
Post by: gauthier on January 30, 2009, 09:16:20 pm
tell me when it's implemented in nightly builds ;) I'm looking forward using that :D
Title: Re: [Patch] New underground view
Post by: DirrrtyDirk on January 30, 2009, 10:50:34 pm
Why do you use rapidshare for the file instead of the simutrans-germany sites?

EDIT:
Oh and by the way: the file doesn't work here.

EDIT2:

Here's the (german) error message:
Title: Re: [Patch] New underground view
Post by: jamespetts on January 30, 2009, 10:58:38 pm
Aha, this looks like good progress! I shall have a look at that when I get time.
Title: Re: [Patch] New underground view
Post by: wernieman on January 30, 2009, 11:59:08 pm
I could make a Spezial Version on monday .....
Title: Re: [Patch] New underground view
Post by: Frank on January 31, 2009, 12:13:55 am
Why do you use rapidshare for the file instead of the simutrans-germany sites?

EDIT:
Oh and by the way: the file doesn't work here.

EDIT2:

Here's the (german) error message:


compile with debug dll?

if compile with MS VC++ 2005/2008 EE then require .net-Framework

and upload to patches.simutrans-germany.com (http://patches.simutrans-germany.com), this page required not javascript
Title: Re: [Patch] New underground view
Post by: z9999 on January 31, 2009, 05:29:06 am
Problem is, if I used way tools or station building tools under ground, this will affect on the ground and build on ground.
This is not due to your patch but the problem of original simutrans.
But as the result of allowing to use them, this problems often happen.
This is very annoying for beginners.
Title: Re: [Patch] New underground view
Post by: gerw on January 31, 2009, 07:18:05 am
Problem is, if I used way tools or station building tools under ground, this will affect on the ground and build on ground.
This is not due to your patch but the problem of original simutrans.
But as the result of allowing to use them, this problems often happen.
This is very annoying for beginners.
I think in a final version dwachs will forbid this. He didn't touched any tools (simwerkz) yet.
Title: Re: [Patch] New underground view
Post by: Dwachs on January 31, 2009, 11:10:22 am
yesterday evening, I was not able to reach *.simutrans-germany.com.

I compiled the exe with VS Express C++ etc. I think I used the 'Debug' configuration for compilation. Sorry for that. How should I compile under VS Express? Which setting generates a file that every windows user can start?

@z9999: yes, I did not touch the tools yet. This 'release' is just for testing the graphics. The only tools that should work right in all view modes is the 'build tunnel tool'.

@wernieman: thank you for your offer :)
Title: Re: [Patch] New underground view
Post by: Frank on January 31, 2009, 11:43:03 am
yesterday evening, I was not able to reach *.simutrans-germany.com.
...

subdomain not work, then directly links (http://forum.simutrans.com/index.php?topic=1264.msg12208#msg12208)
Title: Re: [Patch] New underground view
Post by: wernieman on February 01, 2009, 01:54:47 pm
I make a spezial run, but don' t test!!

See at http://patches.simutrans-germany.com (http://patches.simutrans-germany.com)
Title: Re: [Patch] New underground view
Post by: DirrrtyDirk on February 01, 2009, 03:04:28 pm
Ahhh this I can run! Thanks Werner!

I like this one-level UG view! Is it planned/possible that one can switch levels while in that view, or do we always have to change back to surface, reposition cursor and swith back to UG view?

For testing purposes the stepping of normal/new UG/ old UG view, toggled by "U" is ok - but in the long term think it might get annoying (especially on large maps, where switching can take a few seconds anyway).

But for now, nice start! Still wondering about Kieron's work on UG (slopes and all) - hope you'll be able to combine all that into one big new underground mode one day!
Title: Re: [Patch] New underground view
Post by: sojo on February 01, 2009, 06:14:44 pm
This patch is very usefull.

Is it possible to have at start the undergrund patch activated? So I have not to press U.
Title: Re: [Patch] New underground view
Post by: Dwachs on February 01, 2009, 07:30:51 pm
@wernieman: thank you very much!!!elf11

@Dirk: add this to your menuconf.tab:
Code: [Select]
# WKZ_INC_UNDERGROUND_LEVEL = 20
# WKZ_DEC_UNDERGROUND_LEVEL = 21
simple_tool[20]=,HOME
simple_tool[21]=,END
Then home/end raises/lowers the underground level (has only effect if the leveled mode is on)

@sojo: how would you control this? in the savegame? in a *.tab file?
Title: Re: [Patch] New underground view
Post by: DirrrtyDirk on February 01, 2009, 07:35:59 pm
Oohhh brilliant!  :D
Title: Re: [Patch] New underground view
Post by: Dwachs on February 01, 2009, 07:50:15 pm
Here is a new patch. Now, all tools should work correct in all underground views. That is, in underground view it is no longer possible to build something on invisible tiles. Have fun!

@wernieman: could you build a new special version with this patch? Thank you very matsch!
Title: Re: [Patch] New underground view
Post by: wernieman on February 01, 2009, 08:36:03 pm
at next time .. could you make a patchfile in the trunk direktory?

With this I must delete the "trunk/" in the file bevor I could run the scripts .....
Title: Re: [Patch] New underground view
Post by: gerw on February 01, 2009, 09:43:27 pm
With this I must delete the "trunk/" in the file bevor I could run the scripts .....

Just use 'patch -p1 < ...'??
Title: Re: [Patch] New underground view
Post by: wernieman on February 01, 2009, 09:52:49 pm
O.K. I must edit the Script ;o)
Title: Re: [Patch] New underground view
Post by: wernieman on February 01, 2009, 10:13:35 pm
O.K. I did it ..
Look at the patch-Server http://patches.simutrans-germany.com (http://patches.simutrans-germany.com)
Title: Re: [Patch] New underground view
Post by: Dwachs on February 02, 2009, 12:35:00 pm
Thank you! Now I am waiting for praises and .. bug reports  ;D
Title: Re: [Patch] New underground view
Post by: vilvoh on February 02, 2009, 12:41:07 pm
http://simutrans-escala-real.blogspot.com/2009/02/echa-un-vistazo-debajo-de-la-alfombra.html (http://simutrans-escala-real.blogspot.com/2009/02/echa-un-vistazo-debajo-de-la-alfombra.html)... ::)
Title: Re: [Patch] New underground view
Post by: Dwachs on February 02, 2009, 06:51:18 pm
where are the bugs  ???  :D
Title: Re: [Patch] New underground view
Post by: vilvoh on February 02, 2009, 10:08:54 pm
Nowhere. I've concentrated in praising and reporting.. ;)
Title: [Patch] New underground view - Update
Post by: Dwachs on February 07, 2009, 05:09:58 pm
Here is an updated version of the patch. It fixes a display bug and part of the marker bug, which was discovered by z9999 in the tunnel-slopes thread.
Title: Re: [Patch] New underground view
Post by: wernieman on February 08, 2009, 04:04:54 pm
I mak a compilerrun

Look at patches.simutrans-germany.com

Edit: The Filename is 2305 .. the Version is 2302 ..
Title: Re: [Patch] New underground view
Post by: Dwachs on February 09, 2009, 07:31:11 pm
New version against 2316.
Title: Re: [Patch] New underground view
Post by: TheMetalLord on February 11, 2009, 08:45:40 am
Where do I have to put this file, and what do I have to do to make it run probably?
Title: Re: [Patch] New underground view
Post by: Zeno on February 11, 2009, 08:51:31 am
This is a code file. To make it work you have to compile simutrans applying this patch.
****uming you won't do that, maybe you want to take a look at patches.simutrans-germany.com (http://patches.simutrans-germany.com), where you can find several compiled versions of the simutrans program. Beware, they are non-official (probably unstable) versions!
Title: Re: [Patch] New underground view
Post by: TheMetalLord on February 11, 2009, 09:20:05 am
Ok thank you!
I downloaded the sim-wingdi-undergound-view-slopes-2310.zip and the new Underground mode is working!
But how do I build the slopes?
I cant find them anywhere!
Title: Re: [Patch] New underground view
Post by: vilvoh on February 11, 2009, 09:23:20 am
go to http://forum.simutrans.com/index.php?topic=1089.msg13986#msg13986 (http://forum.simutrans.com/index.php?topic=1089.msg13986#msg13986) (It's a post from the previous page of this thread)

EDIT: To get the suitable solution, read next post from Dwachs.
Title: Re: [Patch] New underground view
Post by: Dwachs on February 11, 2009, 10:08:06 am
No, for underground slopes, you must look here

http://forum.simutrans.com/index.php?topic=1444.msg14421#msg14421 (http://forum.simutrans.com/index.php?topic=1444.msg14421#msg14421)

You have to modify the pak*/menuconf.tab
Title: Re: [Patch] New underground view
Post by: wernieman on February 11, 2009, 07:39:09 pm
Shout I make a Version with this PATCH?

Or should I whait for the next underground-sloop-patch?
Title: Re: [Patch] New underground view
Post by: Dwachs on February 11, 2009, 07:48:37 pm
You can wait for an update of the slope-patch. I updated my patch only since there appear some conflicts due to changes in trunk.
Title: Re: [Patch] New underground view
Post by: gerw on February 11, 2009, 08:38:16 pm
I think, I wouldn't make a new patch version as long as there are no new bug fixes or new features.
Title: Re: [Patch] New underground view
Post by: wernieman on February 12, 2009, 06:58:04 am
But the sloop patch did not work with the newest simutrans-versions ... ;o)
Title: Re: [Patch] New underground view
Post by: gerw on February 12, 2009, 10:19:19 am
You're kidding me.. :)
Title: Re: [Patch] New underground view
Post by: englehart on February 12, 2009, 10:31:15 am
wow :o

slopes now its possible yehey... hmmm gonna try that...
Title: Re: [Patch] New underground view
Post by: TheMetalLord on February 12, 2009, 11:27:35 am
wow :o

slopes now its possible yehey... hmmm gonna try that...

Off Topic!
This Thread is about the new Underground view not the slopes in tunnels.
Post here:  http://forum.simutrans.com/index.php?topic=1444
I did the same mistake!
Title: Re: [Patch] New underground view
Post by: Dwachs on February 22, 2009, 02:04:40 pm
Updated the patch according to prissi's request.

@wernieman: Could you please compile a new version?

@all others: Please test :)
Title: Re: [Patch] New underground view
Post by: wernieman on February 22, 2009, 02:46:31 pm
Compile: Yes

But at the moment is patches.simutrans-german.com offline ... so where I could but them?

Edit:
There will be a new Version on patches.simutrans-germany.com next week (I hope)
Sorry for the waiting, but there are personal reasons ...
Title: Re: [Patch] New underground view
Post by: Dwachs on February 22, 2009, 03:30:17 pm
Maybe use a free filesharer out there ?
Title: Re: [Patch] New underground view
Post by: Dwachs on February 28, 2009, 01:23:20 pm
updated to 2350
Title: Re: [Patch] New underground view
Post by: Dwachs on March 19, 2009, 12:57:34 pm
here is a updated and slightly reworked patch.

edit: patch removed
Title: Re: [Patch] New underground view
Post by: z9999 on March 19, 2009, 02:10:09 pm
Windows GDI, compiled with MinGW, GCC

I tried, but simutrans quit without any error dialog. (****ert)

How to reproduce:
1. Change to underground mode
2. Build road to slope
3. Build tunnel on slope

Result:
Quit without any error dialog

simu.log
Quote
Message: karte_t::interactive_event(event_t &ev):   calling a tool
Message: tunnelbauer_t::baue():   called on 42,53
Title: Re: [Patch] New underground view
Post by: z9999 on March 19, 2009, 06:46:20 pm
Another small problem.

In normal (overground) mode, when I build monorail track on vertical slope, it don't show.
But if I change to underground mode and change to normal mode again, it shows.
Title: Re: [Patch] New underground view
Post by: Dwachs on March 20, 2009, 04:08:58 pm
thanks for testing! I missed to apply changes to the tunnel building routines causing the ****ertion.

However, I could not reproduce your second report. Maybe the undergroundmode was on and the new built monorail was above the underground level, which makes it invisible?

Patch attached, but against 2381, since I dont have the possibility to update.
Title: Re: [Patch] New underground view
Post by: gerw on March 20, 2009, 04:44:04 pm
I can reproduce the monorail bug. Be sure to build elevated monorail tracks, not flat ones.
Title: Re: [Patch] New underground view
Post by: z9999 on March 21, 2009, 07:11:31 am
Crash when I remove a tunnel with romove tool in underground view.

I think monorail problem is some kind of initialize problem.
If I once changed to underground view and changend back to ground view. This problem don't happen.
Title: Re: [Patch] New underground view
Post by: Dwachs on March 22, 2009, 01:45:33 pm
new patch against 2381.

Hopefully the monorail-bug is gone. I could not reproduce it :(
Title: Re: [Patch] New underground view
Post by: z9999 on March 23, 2009, 10:37:10 am
I tried with both 2381 and 2391, monorail problem didn't happen.
Thank you.
Title: Re: [Patch] New underground view
Post by: Dwachs on March 25, 2009, 10:17:42 am
Since several revisions, tool number 20 is used for toggling tooltips. Hence the menuconf.tab-entry must be changed to
Code: [Select]
# WKZ_INC_UNDERGROUND_LEVEL = 21
# WKZ_DEC_UNDERGROUND_LEVEL = 22
simple_tool[21]=,HOME
simple_tool[22]=,END
this will increase / decrease the underground-level if the 'home' / 'end' keys are pressed. Ofcourse, different keys than 'home'/'end' can be defined.
Title: Re: [Patch] New underground view
Post by: sojo on April 03, 2009, 11:23:11 am
Will this patch go into the trunk?
Title: Re: [Patch] New underground view
Post by: prissi on April 03, 2009, 01:24:48 pm
Modified, yes, like some mouse interaction and so on. Otherwise it would not be in the considered category. However, there are some other stuff not finished, which must be finished before. I will not promise any date though
Title: Re: [Patch] New underground view
Post by: sojo on April 03, 2009, 07:08:29 pm
Ok. No problem.
Title: [Patch] New underground view - updated
Post by: Dwachs on May 12, 2009, 07:34:32 pm
Updated the patch :)

Do you have any suggestions on additional gui elements?

The underground view toggler can be activated by menuconf.tab
Code: [Select]
# WKZ_SHOW_UNDERGROUND=15
# WKZ_INC_UNDERGROUND_LEVEL = 21
# WKZ_DEC_UNDERGROUND_LEVEL = 22
simple_tool[15]=,U
simple_tool[21]=,HOME
simple_tool[22]=,END
Of course the decrease / increase level tool can be integrated in a single tool that takes an additional parameter. Suggestions / wishes?
Title: Re: [Patch] New underground view
Post by: z9999 on May 13, 2009, 02:04:59 am
Problems:
If I used way tools, powerline tool and bridge tool on under ground mode, this will affect on the ground and build on ground.
These tools should be removed from toolbars.

Another problem.
In normal (overground) mode, when I build monorail track on vertical slope, it don't show.
But if I change to underground mode and change to normal mode again, it shows.
Same as http://forum.simutrans.com/index.php?topic=1089.msg18145#msg18145

[EDIT]
Another problem:
On normal ground mode, we can see the cars on harbor tunnels.
But on underground mode, we can't see the ways and the cars on harbor tunnels.

[EDIT2]
Of course the decrease / increase level tool can be integrated in a single tool that takes an additional parameter. Suggestions / wishes?

I don't know which is better, but anyway, please use different text, containing "up" or "down", instead of "change underground level".
These text are shown in keyboard help window.

And one more thing. When it is on height-cut mode, I often forget that it is on height-cut mode now. Is there any good idea which to know it is not on normal overground mode ?

[EDIT3]
I can use terraforming tool on height-cut mode. But sometimes forbidden with this message, "Terraforming not possible here in underground view"
I'm not sure which is correct.
Title: Re: [Patch] New underground view
Post by: sojo on May 13, 2009, 07:39:29 am
Do you have any suggestions on additional gui elements?
Do you need buttons?
Title: Re: [Patch] New underground view
Post by: Dwachs on May 13, 2009, 10:27:27 am
Thank you for testing! I am almost blind for all these bugs. In particular, when they were fixed but came back after porting the patch. Modified patch file attached.
Problems:
If I used way tools, powerline tool and bridge tool on under ground mode, this will affect on the ground and build on ground.
These tools should be removed from toolbars.
I would rather opt for (and infact implemented) a correct check in all the routines.
Quote
Another problem.
In normal (overground) mode, when I build monorail track on vertical slope, it don't show.
fixed
Quote
Another problem:
On normal ground mode, we can see the cars on harbor tunnels.
But on underground mode, we can't see the ways and the cars on harbor tunnels.
These harbor tunnels spoil the logic in the display routines :( Why dont you build a bridge there? I see no easy fix to that problem.
Quote
I don't know which is better, but anyway, please use different text, containing "up" or "down", instead of "change underground level".
These text are shown in keyboard help window.
Do you refer to the in-game help? I did not touch this.
Quote
And one more thing. When it is on height-cut mode, I often forget that it is on height-cut mode now. Is there any good idea which to know it is not on normal overground mode ?
Ideally, simutrans should work in height-cut and in overground mode identical for the visible parts. So that it does not matter for playing which mode is currently active.
Quote
I can use terraforming tool on height-cut mode. But sometimes forbidden with this message, "Terraforming not possible here in underground view"
I'm not sure which is correct.
This is intended: terraforming is possible up to and including the height cut. So that one can build slopes to extend the underground area, and such that this new underground area is immediately available for building more underground structures without changing view modes.

If the tools should be integrated in a toolbar then yes :)

My question was, whether I should implement a different dialogue for the underground modes, which (maybe) pops up if one presses 'U' etc. This is also connected to z9999's question 'how to determine which mode is currently active'.

Are there suggestions how to design such a dialogue?
Title: Re: [Patch] New underground view
Post by: jamespetts on May 13, 2009, 11:00:12 am
As to the "harbour tunnel" issue, might I suggest that, when underground slopes are implemented, the building of any further harbour tunnels be disabled, as it would then be possible to tunnel under the water using a slope? It should still be possible, however, to load existing saved games containing them, so as not to break people's existing saved games. Harbour tunnels in their present form are an anomaly.
Title: Re: [Patch] New underground view
Post by: sojo on May 13, 2009, 11:05:16 am
I have painted some buttons some times ago.
Title: Re: [Patch] New underground view
Post by: gauthier on May 13, 2009, 11:06:33 am
Quote
As to the "harbour tunnel" issue, might I suggest that, when underground slopes are implemented, the building of any further harbour tunnels be disabled, as it would then be possible to tunnel under the water using a slope?
I have it already :)

I know Prissi will kill me but underground slopes could be implemented in the trunk now ?
Title: Re: [Patch] New underground view
Post by: z9999 on May 13, 2009, 11:28:20 am
Do you refer to the in-game help?

No, tooltips thing.
For example, wkz_change_city_size_t has 2 different text, "Grow city" and "Shrink city". Thus, each button can have each tooltips.
Code: [Select]
cl**** wkz_change_city_size_t : public werkzeug_t {
const char *get_tooltip(spieler_t *) { return translator::translate( atoi(default_param)>=0 ? "Grow city" : "Shrink city" ); }



Quote
My question was, whether I should implement a different dialogue for the underground modes, which (maybe) pops up if one presses 'U' etc.
Are there suggestions how to design such a dialogue?

Dialogue pop-up is the hell.
You can also use 3 toggle tooltips like wkz_show_name_t.

I like the idea to add a new mode "Toggle height-cut mode" instead of 3 toggle mode.
- "U" toggles underground mode just as old simutrans.
- "v", (for example), toggles height-cut mode.
But I'm not sure what prissi want to do.
Title: Re: [Patch] New underground view
Post by: jamespetts on May 13, 2009, 11:43:10 am
I like the buttons!
Title: Re: [Patch] New underground view
Post by: prissi on May 13, 2009, 12:50:02 pm
I am divided. Toggling three modes seem easier to a necomer, as it is used also for citybuildings and station names. Logically, a seperate mode will be more clean. I also dislike seperate commands for changing the height.

My Idea would be a small window opening (and closing it would retrun to normal mode) with two bars or even a scrollbar from lowest to highest height in the game. This could be moved by mousewheel or PAGTE_UP/PAGE_DOWN then when the mouse is over the dialoge. It would also give a visiual indication where one is.
Title: Re: [Patch] New underground view
Post by: jamespetts on May 13, 2009, 01:06:48 pm
I like Prissi's idea for the GUI - that seems as if it would be intuitive and easy to use both for new and experienced players.
Title: Re: [Patch] New underground view
Post by: z9999 on May 13, 2009, 01:09:17 pm
As for harbor tunnels, why you need to change old code ?
Current simutrans can show well harbor tunnels both on overground mode and underground mode.
What you did is only adding new height-cut mode isn't it ? Why these behavior should be changed on overground mode and underground mode.
Title: Re: [Patch] New underground view
Post by: Dwachs on May 13, 2009, 01:10:50 pm
what about this:
Title: Re: [Patch] New underground view
Post by: gerw on May 13, 2009, 01:10:56 pm
But then there should be a possibility to configure simutrans in such a way, that you can access the underground mode without the GUI. Therefore I totally agree with z9999:
Title: Re: [Patch] New underground view
Post by: Dwachs on May 13, 2009, 01:15:00 pm
What you did is only adding new height-cut mode isn't it ? Why these behavior should be changed on overground mode and underground mode.
If you look at the patch, it is not an addition to the already implemented modes, it is in fact a full replacement. And I dont feel like rewriting everything for these harbour tunnels :/


Title: Re: [Patch] New underground view
Post by: z9999 on May 13, 2009, 03:26:23 pm
"Under ground view" button on display setting window doesn't have 3 mode.
So, I can't change to underground mode by clicking this button.

One question. Overground mode and height-cut mode of height=20 is exactly the same ?
If so, why we need to toggle with overground mode and height-cut mode ?
If overground mode can change height level of view directly, we don't need height-cut mode, don't we ?
In that case, toggle overground mode and underground mode is enough.
Title: Re: [Patch] New underground view
Post by: Dwachs on May 13, 2009, 06:10:17 pm
yes you are right. Normal mode is equivalent to sliced mode with height level = +infinity ;)
Title: Re: [Patch] New underground view
Post by: z9999 on May 13, 2009, 06:34:40 pm
Thank you.
Then I like toggle 2 mode than toggle 3 mode like as attached image.
In this case, toggling height-cut view and underground mode keeps last used height value, so we can easily continue construction.
Toggling 3 mode really breaks the continuity of our though.
Title: Re: [Patch] New underground view
Post by: VS on May 13, 2009, 07:46:43 pm
Maybe you can make it (from player perspective) one continuous mode - from +∞ (full overground) through slices to -∞ (full underground).
Title: Re: [Patch] New underground view
Post by: Dwachs on May 14, 2009, 05:15:03 am
Maybe you can make it (from player perspective) one continuous mode - from +∞ (full overground) through slices to -∞ (full underground).
this will not work, since sliced mode shows underground structures only on one height, whereas full underground mode shows all underground structures.
Title: Re: [Patch] New underground view
Post by: Dwachs on May 14, 2009, 05:22:42 am
Then I like toggle 2 mode than toggle 3 mode like as attached image.
In this case, toggling height-cut view and underground mode keeps last used height value, so we can easily continue construction.
Toggling 3 mode really breaks the continuity of our though.

I dont know whether I understood you right. Do you mean something like this:

Toggling underground ('U') switches between overground and underground view (and does nothing to height-cut view).

Toggling height-cut switches between height cut view and overground or underground view, depending which of the latter two was active previously. If height-cut is activated by keyboard then the z-coordinate of the cursor is taken for the cut height otherwise the last used value.

I must say, this looks better to me than the now implemented 'cycling through all view'.

More comments?
Title: Re: [Patch] New underground view
Post by: VS on May 14, 2009, 08:20:12 am
Dwachs - just making sure, I did not mean program-wise, only the GUI. That would make it actually look like one mode, regardless of implementation...
Title: Re: [Patch] New underground view
Post by: prissi on May 14, 2009, 08:44:40 am
I want to play around with the underground mode a little bit myself, before submitting it. I never did so far really test the usability and so on.

Switching between normal view and sliced view is not a bad idea. This would only add commands for slicingup/down and turning off would be automatic. But there needs to be and additional interface as visual indication. Maybe in the lower right border just above the ticker line in slice mode there will be two arrows and a number. Not a real popup.

Title: Re: [Patch] New underground view
Post by: z9999 on May 14, 2009, 03:49:40 pm
Quote
== if switching to underground, the height of the tile under the cursor will be taken as underground-level

This works well with keyboard shortcut and very useful, I like this.
But if we clicked on toolbar button to toggle height-cut view, height will be the height of behind toolbar button. In many cases, this height not what we wanted to see, and also up and down height one by one is very heavy for large map.
This is frustration about current UI.
Title: Re: [Patch] New underground view
Post by: Dwachs on May 14, 2009, 05:33:35 pm
This works well with keyboard shortcut and very useful, I like this.
But if we clicked on toolbar button to toggle height-cut view, height will be the height of behind toolbar button. In many cases, this height not what we wanted to see, and also up and down height one by one is very heavy for large map.
This is frustration about current UI.

in this case one can use the last selected height or the height of the tile in the middle of the screen.

what do you mean is frustrating?
Title: Re: [Patch] New underground view
Post by: Dwachs on May 30, 2009, 12:05:41 pm
I updated and uploaded the patch:

http://simutrans-germany.com/~patches/upload/underground-2497.patch
Title: Re: [Patch] New underground view
Post by: Dwachs on June 15, 2009, 07:04:51 pm
New version of the patch:

http://simutrans-germany.com/~patches/upload/underground-2518.patch

I modified the toggling of the different view. Now there is only one tool that does the job: general_tool[34] or simple_tool[15].
Both are identic, except that general tools can have cursors etc, which a simple-tool (the original underground toggle) does not have.

Here is my modification of the pak64 menuconf.tab, which explains the use of the tools and its parameters. All tools (except with parameter K) can be realized with buttons in a toolbar. All tools (except C) can be toggled by keyboard only.
Code: [Select]
# ****ign a cursor image to the underground tool
general_tool[34]=,7,,

# ...
# add underground tools as invisible tools to the main toolbar
# 0) with parameter U .. toggles complete undergroundview (key U here)
toolbar[0][27]=general_tool[34],,U,U
# 1) with parameter I .. increases slice height with key HOME
toolbar[0][27]=general_tool[34],,HOME,I
# 2) with parameter D .. decreases slice height with key END
toolbar[0][28]=general_tool[34],,END,D
# 3) with parameter K .. toggles sliced view with height taken from tile under cursor (key ctrl-u)
toolbar[0][29]=general_tool[34],,^U,K
# 4) with parameter K .. toggles sliced view with height taken from tile under cursor by an extra mouse click (key ctrl-c)
toolbar[0][30]=general_tool[34],,^C,C
Title: Re: [Patch] New underground view
Post by: prissi on June 15, 2009, 07:10:19 pm
I will have a look at it today. Not sure, if the one tool idea survives though.
Title: Re: [Patch] New underground view
Post by: Dwachs on June 15, 2009, 07:17:11 pm
I re-uploaded the patch.

The patch needs several strings to be translated:

two error messages:
Code: [Select]
Terraforming not possible\nhere in underground view
Cannot built this station/building\nin underground mode here.
tooltips:
Code: [Select]
sliced underground mode
decrease underground view level
increase underground view level
Title: Re: [Patch] New underground view
Post by: prissi on June 15, 2009, 10:21:02 pm
Submitted, but there is still an error, if I lower the slice below sealevel by the manual tools (even though this might be useful, if harbourtunnels will be forbidden to built in next versions).
Title: Re: [Patch] New underground view
Post by: jamespetts on June 16, 2009, 12:22:31 am
Excellent - I am very glad to see this incorporated into the trunk. One or two questions and comments if I may:

1. Does this incorporate the underground slopes patch?

2. Is it possible to change the colour for the shading of the 3d cursor in pakset configuration files (rather than the code), and, if so, where?

3. Might I suggest that an option be added to be able to change heights by CTRL+scroll wheel instead of or as well as the HOME/END keys?

4. One somewhat unintuitive aspect of this feature is the fact that, at any given level of underground view, no lower layers are shown, even if there is nothing on top of them. Might I suggest that, in a future release, all layers under the surface of the ground are considered transparent so that it is possible to see multiple underground layers at once? This would be different from the old underground view, in that, whilst one would see all underground layers at or below the current view height level, one would not see the higher underground layers, if any. Nonetheless, such a feature, I think, would be more intuitive and ****ist with the design of underground networks.

Thank you all those who have worked on this excellent patch :-)
Title: Re: [Patch] New underground view
Post by: Isaac Eiland-Hall on June 16, 2009, 04:44:51 am
Does this imply that we will be able to tunnel under the ocean?
Title: Re: [Patch] New underground view
Post by: Dwachs on June 16, 2009, 05:12:28 am
Does this imply that we will be able to tunnel under the ocean?
No, not yet. But in some future maybe. There is a patch around, which needs updating.

2. Is it possible to change the colour for the shading of the 3d cursor in pakset configuration files (rather than the code), and, if so, where?
You can specify the cursor_overlay_color in simuconf.tab. Or what else do you mean?

Quote
3. Might I suggest that an option be added to be able to change heights by CTRL+scroll wheel instead of or as well as the HOME/END keys?
You can at least change HOME/End to other keys in menuconf.tab. I dont know whether ctrl+scroll will work or not, or is wanted or not.

Submitted, but there is still an error, if I lower the slice below sealevel by the manual tools (even though this might be useful, if harbourtunnels will be forbidden to built in next versions).
I corrected this, however a nice way to impose restrictions on the slice level is still missing...
Title: Re: [Patch] New underground view
Post by: jamespetts on June 16, 2009, 07:57:17 am
Dwachs,

thank you for the replies :-) The cursor_overlay_color setting: does that require numbers or words? I.e., ought one set cursor_overlay_color=1024 (etc.) or cursor_overlay_color=yellow?
Title: Re: [Patch] New underground view
Post by: Dwachs on June 16, 2009, 09:20:46 am
Look in here:

http://forum.simutrans.com/index.php?topic=1940.msg20840#msg20840
Title: Re: [Patch] New underground view
Post by: z9999 on June 16, 2009, 11:46:06 am
It is very nice to show height level on menu button. Thank you, I like this veru much.

BTW, does draw_after() could show images too ? For example, showing comp**** azimuth on WKZ_ROTATE90 button.
Title: Re: [Patch] New underground view
Post by: prissi on June 16, 2009, 01:34:09 pm
THis should be possible, if the required images are loaded. For instance if there is image 7,8,9,10 in simple tools, but only the first is used for the tool, then it could just display (icon+rotation) for the new image number. (They are registered consequtively.)
Title: Re: [Patch] New underground view
Post by: z9999 on June 16, 2009, 01:39:55 pm
Problem:
1. Toggle slice mode
2. Up/Down slice mode
3. Toggle slice mode
Result:
It will be full undeerground mode instead of overground mode.

[edit]
Another problems

1. Toggle on slice mode
2. Toggle on underground mode
3. Toggle off underground mode
Result:
It will be overground mode instead of slice mode

Toggle mode with "K" key doesn't toggle mode.
Title: Re: [Patch] New underground view
Post by: Dwachs on June 16, 2009, 02:16:01 pm
Yes you are right, this has to be modified for true toggling. I will look into that tonight.
Title: Re: [Patch] New underground view
Post by: z9999 on June 17, 2009, 05:00:14 pm
My patch for this.
http://simutrans-germany.com/files/upload/0008-slice-fixed.patch.txt

Code: [Select]
diff --git a/gui/colors.cc b/gui/colors.cc
index 949993c..1a63daa 100644
--- a/gui/colors.cc
+++ b/gui/colors.cc
@@ -22,44 +22,45 @@
 
 #include "../utils/simstring.h"
 
-#define MAX_BUTTONS (20)
+#define MAX_BUTTONS (21)
 
 // y coordinates
 #define GRID_MODE (0*13+6)
 #define UNDERGROUND (1*13+6)
-#define DAY_NIGHT (2*13+6)
-#define BRIGHTNESS (3*13+6)
-#define SCROLL_INVERS (4*13+6)
-#define SCROLL_SPEED (5*13+6)
+#define SLICE (2*13+6)
+#define DAY_NIGHT (3*13+6)
+#define BRIGHTNESS (4*13+6)
+#define SCROLL_INVERS (5*13+6)
+#define SCROLL_SPEED (6*13+6)
 
-#define SEPERATE1 (6*13+6)
+#define SEPERATE1 (7*13+6)
 
-#define USE_TRANSPARENCY (6*13+6+4)
-#define HIDE_TREES (7*13+6+4)
-#define HIDE_CITY_HOUSES (8*13+6+4)
+#define USE_TRANSPARENCY (7*13+6+4)
+#define HIDE_TREES (8*13+6+4)
+#define HIDE_CITY_HOUSES (9*13+6+4)
 
-#define SEPERATE2 (9*13+6+4)
+#define SEPERATE2 (10*13+6+4)
 
-#define USE_TRANSPARENCY_STATIONS (9*13+6+2*4)
-#define SHOW_STATION_COVERAGE (10*13+6+2*4)
-#define SHOW_STATION_SIGNS (11*13+6+2*4)
-#define SHOW_STATION_GOODS (12*13+6+2*4)
+#define USE_TRANSPARENCY_STATIONS (10*13+6+2*4)
+#define SHOW_STATION_COVERAGE (11*13+6+2*4)
+#define SHOW_STATION_SIGNS (12*13+6+2*4)
+#define SHOW_STATION_GOODS (13*13+6+2*4)
 
-#define SEPERATE3 (13*13+6+2*4)
+#define SEPERATE3 (14*13+6+2*4)
 
-#define CITY_WALKER (13*13+6+3*4)
-#define STOP_WALKER (14*13+6+3*4)
-#define DENS_TRAFFIC (15*13+6+3*4)
-#define CONVOI_TOOLTIPS (16*13+6+3*4)
+#define CITY_WALKER (14*13+6+3*4)
+#define STOP_WALKER (15*13+6+3*4)
+#define DENS_TRAFFIC (16*13+6+3*4)
+#define CONVOI_TOOLTIPS (17*13+6+3*4)
 
-#define SEPERATE4 (17*13+6+3*4)
+#define SEPERATE4 (18*13+6+3*4)
 
-#define FPS_DATA (17*13+6+4*4)
-#define IDLE_DATA (18*13+6+4*4)
-#define FRAME_DATA (19*13+6+4*4)
-#define LOOP_DATA (20*13+6+4*4)
+#define FPS_DATA (18*13+6+4*4)
+#define IDLE_DATA (19*13+6+4*4)
+#define FRAME_DATA (20*13+6+4*4)
+#define LOOP_DATA (21*13+6+4*4)
 
-#define BOTTOM (21*13+6+12+5*4)
+#define BOTTOM (22*13+6+12+5*4)
 
 // x coordinates
 #define RIGHT_WIDTH (220)
@@ -145,14 +146,6 @@ color_gui_t::color_gui_t(karte_t *welt) :
  buttons[16].set_typ(button_t::square_state);
  buttons[16].set_text("underground mode");
 
- inp_underground_level.set_pos(koord(NUMBER_INP, UNDERGROUND) );
- inp_underground_level.set_groesse( koord(50,12));
- inp_underground_level.set_value( grund_t::underground_level );
- inp_underground_level.set_limits(welt->get_grundw****er(), 20);
- add_komponente(&inp_underground_level);
- inp_underground_level.add_listener(this);
-
-
  buttons[17].set_pos( koord(10,GRID_MODE) );
  buttons[17].set_typ(button_t::square_state);
  buttons[17].set_text("show grid");
@@ -167,6 +160,17 @@ color_gui_t::color_gui_t(karte_t *welt) :
  buttons[19].set_text("show waiting bars");
  buttons[19].pressed = umgebung_t::show_names&1;
 
+ buttons[20].set_pos( koord(10,SLICE) );
+ buttons[20].set_typ(button_t::square_state);
+ buttons[20].set_text("sliced underground mode");
+
+ inp_underground_level.set_pos(koord(NUMBER_INP, SLICE) );
+ inp_underground_level.set_groesse( koord(50,12));
+ inp_underground_level.set_limits(welt->get_grundw****er(), 20);
+ inp_underground_level.set_value( grund_t::underground_level );
+ add_komponente(&inp_underground_level);
+ inp_underground_level.add_listener(this);
+
  // left/right for convoi tooltips
  buttons[0].set_pos( koord(10,CONVOI_TOOLTIPS) );
  buttons[0].set_typ(button_t::arrowleft);
@@ -226,8 +230,8 @@ color_gui_t::action_triggered( gui_action_creator_t *komp, value_t v)
  umgebung_t::station_coverage_show = umgebung_t::station_coverage_show==0 ? 0xFF : 0;
  } else if((buttons+16)==komp) {
  // see simwerkz.cc::wkz_show_underground_t::init
- grund_t::set_underground_mode(grund_t::underground_mode ^ grund_t::ugm_level, inp_underground_level.get_value());
- buttons[16].pressed = grund_t::underground_mode == grund_t::ugm_level;
+ grund_t::set_underground_mode(buttons[16].pressed ? grund_t::ugm_none : grund_t::ugm_all, inp_underground_level.get_value());
+ buttons[16].pressed = grund_t::underground_mode == grund_t::ugm_all;
  // calc new images
  welt->update_map();
  // renew toolbar
@@ -238,6 +242,14 @@ color_gui_t::action_triggered( gui_action_creator_t *komp, value_t v)
  umgebung_t::show_names ^= 1;
  } else if((buttons+19)==komp) {
  umgebung_t::show_names ^= 2;
+ } else if((buttons+20)==komp) {
+ // see simwerkz.cc::wkz_show_underground_t::init
+ grund_t::set_underground_mode(buttons[20].pressed ? grund_t::ugm_none : grund_t::ugm_level, inp_underground_level.get_value());
+ buttons[20].pressed = grund_t::underground_mode == grund_t::ugm_level;
+ // calc new images
+ welt->update_map();
+ // renew toolbar
+ werkzeug_t::update_toolbars(welt);
  } else if (komp == &inp_underground_level) {
  if(grund_t::underground_mode==grund_t::ugm_level) {
  grund_t::underground_level = inp_underground_level.get_value();
@@ -262,10 +274,11 @@ void color_gui_t::zeichnen(koord pos, koord gr)
  // can be changed also with keys ...
  buttons[11].pressed = umgebung_t::hide_trees;
  buttons[15].pressed = umgebung_t::station_coverage_show;
- buttons[16].pressed = grund_t::underground_mode == grund_t::ugm_level;
+ buttons[16].pressed = grund_t::underground_mode == grund_t::ugm_all;
  buttons[17].pressed = grund_t::show_grid;
  buttons[18].pressed = umgebung_t::show_names&1;
  buttons[19].pressed = (umgebung_t::show_names&2)!=0;
+ buttons[20].pressed = grund_t::underground_mode == grund_t::ugm_level;
 
  gui_frame_t::zeichnen(pos, gr);
 
diff --git a/gui/colors.h b/gui/colors.h
index dfcf525..ea3e917 100644
--- a/gui/colors.h
+++ b/gui/colors.h
@@ -13,7 +13,7 @@ cl**** color_gui_t : public gui_frame_t, private action_listener_t
 {
 private:
  karte_t *welt;
- button_t buttons[20];
+ button_t buttons[21];
  gui_numberinput_t brightness, scrollspeed, traffic_density, inp_underground_level;
 
 public:
diff --git a/simwerkz.cc b/simwerkz.cc
index 53b60e9..549e88a 100644
--- a/simwerkz.cc
+++ b/simwerkz.cc
@@ -3670,8 +3670,16 @@ bool wkz_show_underground_t::init( karte_t *welt, spieler_t * )
  switch(default_param[0]) {
  // toggle sliced view by toolbar - height taken from extra mouse click
  case 'C':
- needs_click = true;
- ok = false;
+ if(grund_t::underground_mode==grund_t::ugm_level) {
+ grund_t::set_underground_mode( grund_t::ugm_none, 0);
+ }
+ else if(grund_t::underground_mode==grund_t::ugm_none) {
+ needs_click = true;
+ ok = false;
+ }
+ else {
+ ok = false;
+ }
  break;
  // decrease slice level
  case 'D':
@@ -3696,18 +3704,22 @@ bool wkz_show_underground_t::init( karte_t *welt, spieler_t * )
  case 'K':
  if(grund_t::underground_mode==grund_t::ugm_level) {
  // switch to normal or full-underground
- grund_t::set_underground_mode( save_underground_level==127 ? grund_t::ugm_none : grund_t::ugm_all, 0);
+ grund_t::set_underground_mode( grund_t::ugm_none, 0);
+
  }
- else {
+ else if(grund_t::underground_mode==grund_t::ugm_none) {
  grund_t::set_underground_mode( grund_t::ugm_level, zpos.z);
  }
+ else {
+ ok = false;
+ }
  break;
 
  //  switch between full underground or normal/sliced view
  case 'U':
  if (grund_t::underground_mode==grund_t::ugm_all) {
  // switch back to normal or sliced view
- grund_t::set_underground_mode( grund_t::ugm_none, 0); // save_underground_level==127 ? grund_t::ugm_none : grund_t::ugm_level, save_underground_level);
+ grund_t::set_underground_mode( save_underground_level==127 ? grund_t::ugm_none : grund_t::ugm_level, save_underground_level);
  }
  else {
  grund_t::set_underground_mode( grund_t::ugm_all, 0);
--
1.6.3.2.1299.gee46c


Title: Re: [Patch] New underground view
Post by: jamespetts on June 17, 2009, 11:22:15 pm
Might I ask - is it possible to have an underground mode button in the menu bar? If it is, how would one go about setting that up in menuconf.tab?
Title: Re: [Patch] New underground view
Post by: prissi on June 18, 2009, 08:34:27 am
Looking at the sources of pak64 or simmenu.cc will tell you ...
Title: Re: [Patch] New underground view
Post by: jamespetts on June 18, 2009, 10:25:05 pm
I can't find any controls in the latest Pak64 nightly binary - has it made it there yet?
Title: Re: [Patch] New underground view
Post by: Dwachs on June 19, 2009, 05:32:42 am
Here I described all underground tools and how to use them in menuconf.tab:

http://forum.simutrans.com/index.php?topic=1089.msg24655#msg24655

The second parameter here:
Code: [Select]
toolbar[I][J]=general_tool[34],ICON_NUMBER,KEY,U
may hold an icon number (once an icon exists). So numbers I and J, ICON_NUMBER and KEY, are up to the menuconf.tab writers
Title: Re: [Patch] New underground view
Post by: Dwachs on June 19, 2009, 02:24:11 pm
My patch for this.
http://simutrans-germany.com/files/upload/0008-slice-fixed.patch.txt

why did you remove the possibility to trigger sliced mode when in full underground mode?
Title: Re: [Patch] New underground view
Post by: z9999 on June 19, 2009, 05:05:21 pm
You can change it if you don't like it.