News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

[patch] Viewport

Started by knightly, February 25, 2010, 04:22:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knightly

The attached patch modifies main view so that it can be reused as viewports -- viewports in which you can manipulate objects as in main view.

The following key combinations apply to both main view and viewports :
1) Ctrl-Right-Click on a tile  :  Opens a new viewport, centred on that tile
2) Shift-Right-Click on a tile  :  The current viewport (or main view) will follow any convoy on that tile
3) Ctrl+Shift-Right-Click on a tile  :  Check if a convoy is on that tile; if yes, open a new viewport and follow that convoy

You can also spawn a new viewport by Ctrl-Right-Clicking on any "old", static viewport.

There are 2 buttons in the upper left corner of the viewport. The first one will recenter the main view. The second one toggles between rezooming and fixed scale. The button images are not good -- those are drawn by me for the sake of testing only. (If this patch can go into the trunk, I hope that some master Simutrans painter can draw better ones. ;) )

The viewports are also visible in the minimap. The main view is still shown with a yellow bounding box, while other viewports are shown with light purple bounding boxes.

I have compiled an unofficial Windows GDI version for those who want to test without dealing with the code, but please bear in mind that there may be bugs. Also included in the zip file is a .pak file which contains the button images which are required to load Simutrans without error (please place it in your pakset folder).
us (site down, do not visit) ]/files/get/5pGFAgk8gE/viewport-test.zip]http://files.[ simutrans [dot] us (site down, do not visit) ]/files/get/5pGFAgk8gE/viewport-test.zip

Testing, comments and bug reports are welcome :D

z9999+

Maybe, this viewport size is good for most of players.
But I want half height size of minimum viewport size for my small screen.
Current one is too big for me.

knightly

@z9999+

Thank you very much for testing, and you are really fast ;)! There is no problem with changing the default size or minimum size. Just want to make sure, are you asking to change minimum size to 128 x 128 (original minimum size is 256 x 256)?

z9999+

Quote from: Knightly on February 25, 2010, 04:41:32 PM
Just want to make sure, are you asking to change minimum size to 128 x 128 (original minimum size is 256 x 256)?

Personally, I prefer 256 x 128 for minimum size.

Since I don't want to bother many players, it doesn't need auto resizing for such a small size.
I can manually resize it, if it is possible.

knightly

Quote from: z9999+ on February 25, 2010, 05:40:47 PM
Personally, I prefer 256 x 128 for minimum size.

No problem. :) I will note it down. BTW, you can use the "downward triangle button" in the title bar to convert the viewport frame to its minimum size.

smu42

This is a very nice patch!

However, I noticed that the mini-map is slower when scrolling within the mini-map (right mouse button). Even when no viewports are used.

This is a comparison between your upload and 102.2.1 with pak128 on a fast machine.


QuotePersonally, I prefer 256 x 128 for minimum size.

I would prefer 128x256 but that's not very important.


knightly

Quote from: smu42 on February 27, 2010, 06:46:35 PM
This is a very nice patch!

Thanks :)

Quote from: smu42 on February 27, 2010, 06:46:35 PM
However, I noticed that the mini-map is slower when scrolling within the mini-map (right mouse button). Even when no viewports are used.

Do you mean scrolling is slower? I did change the dragging-related part of the code, but only to remove the "shaking mouse pointer" problem during right-dragging. I haven't modified the scroll multiplier (which currently is x2). And during testing, I did not notice any slow-down. This is strange ...

Quote from: smu42 on February 27, 2010, 06:46:35 PM
I would prefer 128x256 but that's not very important.

Then, should I use 128 x 128 as the minimum size? :::)

smu42

QuoteQuote from: smu42 on Yesterday at 07:46:35 PM
QuoteHowever, I noticed that the mini-map is slower when scrolling within the mini-map (right mouse button). Even when no viewports are used.

Do you mean scrolling is slower?

Sorry, my "bug report" might not be related to your patch.

The scrolling in the minimap is less responsive (laggy) when using the "isometric view", but this happens in 102.2.1 too. However, this is only measurable in a full map (I guess many lines or many vehicles).


QuoteThen, should I use 128 x 128 as the minimum size?

This could be a good compromise.