Author Topic: [patch] Viewport  (Read 5595 times)

0 Members and 1 Guest are viewing this topic.

knightly

  • Guest
[patch] Viewport
« on: February 25, 2010, 04:22:17 PM »
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).
http://files.simutrans.us/files/get/5pGFAgk8gE/viewport-test.zip

Testing, comments and bug reports are welcome :D
« Last Edit: February 25, 2010, 07:27:27 PM by Knightly »

Offline z9999+

Re: [patch] Viewport
« Reply #1 on: February 25, 2010, 04:35:37 PM »
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

  • Guest
Re: [patch] Viewport
« Reply #2 on: February 25, 2010, 04:41:32 PM »
@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)?

Offline z9999+

Re: [patch] Viewport
« Reply #3 on: February 25, 2010, 05:40:47 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

  • Guest
Re: [patch] Viewport
« Reply #4 on: February 25, 2010, 05:52:51 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.

Offline smu42

Re: [patch] Viewport
« Reply #5 on: February 27, 2010, 06:46:35 PM »
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.


Quote
Personally, I prefer 256 x 128 for minimum size.

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


knightly

  • Guest
Re: [patch] Viewport
« Reply #6 on: February 28, 2010, 09:53:42 AM »
This is a very nice patch!

Thanks :)

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 ...

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

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

Offline smu42

Re: [patch] Viewport
« Reply #7 on: February 28, 2010, 08:46:12 PM »
Quote
Quote from: smu42 on Yesterday at 07:46:35 PM
Quote
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?

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).


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

This could be a good compromise.