-
Notifications
You must be signed in to change notification settings - Fork 88
Vehicle Restrictions tool - lane highlight and better UI panel #721
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
Vehicle Restrictions tool - lane highlight and better UI panel #721
Conversation
|
Looking good so far! |
|
A simple color effect maybe is possible? |
|
Just done a quick in-game test and it's looking good. Still need to test a few more things but so far no issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far I've only found one issue with this PR, but it's a bit cumbersome to explain...
When a segment is selected, the vehicle restriction icons appear. (EDIT: this is not the problem heh)
If, while selecting a segment, the mouse is over the position of where one of those icons are going to appear upon segment selection, then upon segment becoming selected and icon appearing, the icon also registers the click and toggles itself.
In the image above, my mouse was over the position where the taxi icon would appear, so upon selecting the segment the taxi icon was toggled.
So segment selection should wait for mouse-up before enabling toggling of restrictions.
|
EDIT: Will create separate issue for this, it should be dealt with in separate PR.
|
kvakvs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is looking good. One minor refactoring suggested.
@aubergine10 What about consistency with the rest of the tools. Should I do this all over?
@aubergine10 When a tool is not selected but overlay for that tool is turned on in the options, icons of that tool are always rendered but a bit smaller than usual. If I make non-hovered Icons smaller how do you distinguish them with other icons from other tools? This requires a bit of decision making and consistency consideration so maybe create an issue about this? |
|
Maybe as separate PR for the visual tweaks? I suspect there will already be quite a bit of variance between the tools and some of them won't really be applicable. EDIT:
Yes, good idea. I'll create an issue. |
|
Created #739 to track ideas for hovered vs. unhovered overlay icon disambiguation. |
|
@aubergine10 I introduce the accidental click problem and then I fixed it. Also properly commented and documented relavent code so that it does not happen again and created issue #740 |
originalfoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested in-game, couldn't find any way to break it :)
LGTM 👍
Note: Did find one issue with tool, but unrelated to this PR: #741
|
Can you please remove the change request @aubergine so that I can merge this? |
|
testing... |
krzychu124
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting error sometimes when clicking with shift
Error 456.5295541: GUI Error: System.InvalidOperationException: HashSet have been modified while it was iterated over
at System.Collections.Generic.HashSet`1+Enumerator[System.UInt16].CheckState () [0x00000] in <filename unknown>:0
at System.Collections.Generic.HashSet`1+Enumerator[System.UInt16].MoveNext () [0x00000] in <filename unknown>:0
at TrafficManager.UI.SubTools.VehicleRestrictionsTool.ShowSigns (Boolean viewOnly) [0x00000] in <filename unknown>:0
at TrafficManager.UI.SubTools.VehicleRestrictionsTool.ShowGUIOverlay (ToolMode toolMode, Boolean viewOnly) [0x00000] in <filename unknown>:0
at TrafficManager.UI.TrafficManagerTool.OnToolGUI (UnityEngine.Event e) [0x00000] in <filename unknown>:0
at CSUtil.Commons.Log.LogToFile(System.String log, LogLevel level)
at CSUtil.Commons.Log.Error(System.String s)
at TrafficManager.UI.TrafficManagerTool.OnToolGUI(UnityEngine.Event e)
at ToolBase.OnGUI()|
Hrm, upon checking the logs I was also getting that error - nothing shown on screen though: Debug 1,165.2730200: NetService.PublishSegmentChanges(25862) called.
Debug 1,165.2753957: NetService.PublishSegmentChanges(36318) called.
Debug 1,165.2762314: NetService.PublishSegmentChanges(8990) called.
Error 1,165.2771216: GUI Error: System.InvalidOperationException: HashSet have been modified while it was iterated over
at System.Collections.Generic.HashSet`1+Enumerator[System.UInt16].CheckState () [0x00000] in <filename unknown>:0
at System.Collections.Generic.HashSet`1+Enumerator[System.UInt16].MoveNext () [0x00000] in <filename unknown>:0
at TrafficManager.UI.SubTools.VehicleRestrictionsTool.ShowSigns (Boolean viewOnly) [0x00000] in <filename unknown>:0
at TrafficManager.UI.SubTools.VehicleRestrictionsTool.ShowGUIOverlay (ToolMode toolMode, Boolean viewOnly) [0x00000] in <filename unknown>:0
at TrafficManager.UI.TrafficManagerTool.OnToolGUI (UnityEngine.Event e) [0x00000] in <filename unknown>:0
at CSUtil.Commons.Log.LogToFile(System.String log, LogLevel level)
at CSUtil.Commons.Log.Error(System.String s)
at TrafficManager.UI.TrafficManagerTool.OnToolGUI(UnityEngine.Event e)
at ToolBase.OnGUI()The |
originalfoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See error in log (comment above)
|
@aubergine10 I am out of ideas. This happens on master as well its not a bug that I have introduce. Lets create issue about this. |
originalfoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
The hidden error will be tackled at later date via #744




Fixes #681
GUI panel changes:
Fixes #657
Fixes #667
EDIT: I have merged #709 branch with this so that I can use some shared code. This review will be in draft state until #709 is merged with trunk.