Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Set speed limit calls when holding mouse button while changing speed limit #388

Closed
krzychu124 opened this issue Jun 22, 2019 · 7 comments
Labels
confirmed Represents confirmed issue or bug enhancement Improve existing feature invalid Not a valid issue LABS TM:PE LABS branch performance Make it faster! SPEED LIMITS Feature: Speed limits STABLE TM:PE STABLE branch
Milestone

Comments

@krzychu124
Copy link
Member

Description

Speed limits tool - multiple set speed limit of lane calls if user holds mouse button while changing speed limit.

Noticeable only in debug build log.

Reproduction Steps

Add more steps as nessecary.

  1. Open speed limits tool
  2. Select any speed limit
  3. Try to change speed limit of lane by 'click and hold' mouse button.

The longer you hold mouse button the more updates will be triggered.

Mod List

Please list the mods enabled when you noticed the bug.

  • TM:PE [STABLE]

Output Log

Log fragment

[Debug] @ 2859127769 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2859636774 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2859644023 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2859656160 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2859662617 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2860226599 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2860233278 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2860247125 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2860253805 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2860843788 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2860851551 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2860864291 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2860870559 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2861411122 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2861419469 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2861432819 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2861439275 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2861988519 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2861995261 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2862009132 SpeedLimitManager: Setting speed limit of lane 95423 to 40
[Debug] @ 2862015323 SpeedLimitManager: Setting speed limit of lane 138206 to 40
[Debug] @ 2862482250 SpeedLimitManager: Setting speed limit of lane 95423 to 40
@krzychu124 krzychu124 added BUG Defect detected medium priority Issue with medium priority of work confirmed Represents confirmed issue or bug LABS TM:PE LABS branch STABLE TM:PE STABLE branch labels Jun 22, 2019
@originalfoo
Copy link
Member

Is this something to do with the fact that it's designed to allow "dragging" a speed down a road? I think that feature was added about a year or two ago prior to some shortcuts being added for similar effect.

@kvakvs
Copy link
Collaborator

kvakvs commented Jun 22, 2019

We can probably improve this by not setting and not logging if the value is already the same. For this we need to propagate success boolean from the deepest setSpeedLimit function, because it happens over multiple lanes per segment.

@originalfoo
Copy link
Member

btw: Does the code check if new speed is different to current speed before taking any action?

@originalfoo
Copy link
Member

Just been reading the old wiki, which states:

To apply the selected speed limit to multiple (nearby) road segments, hold the mouse button down and then move it over the road segments you want to apply the speed limit to.

So it's definitely a "feature" rather than a "bug".

@kvakvs
Copy link
Collaborator

kvakvs commented Jun 22, 2019

It should not log "changed speed limit" if it was actually set to the same value. Then it will work as intended.

@krzychu124 krzychu124 added invalid Not a valid issue and removed BUG Defect detected medium priority Issue with medium priority of work labels Jun 22, 2019
@originalfoo originalfoo added the enhancement Improve existing feature label Jun 22, 2019
@originalfoo
Copy link
Member

Could we also despam it based on either mouse move delta or skip every n frames?

@originalfoo originalfoo added performance Make it faster! SPEED LIMITS Feature: Speed limits labels Aug 12, 2019
@originalfoo
Copy link
Member

This feature was removed by #709

@originalfoo originalfoo added this to the 11.1.1 milestone Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Represents confirmed issue or bug enhancement Improve existing feature invalid Not a valid issue LABS TM:PE LABS branch performance Make it faster! SPEED LIMITS Feature: Speed limits STABLE TM:PE STABLE branch
Projects
None yet
Development

No branches or pull requests

3 participants