-
Notifications
You must be signed in to change notification settings - Fork 85
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
Integration of Vanilla and TMPE priority roads #542
Comments
please assign to me. |
I am trying to figure out how to get the selected road segment in my code. |
I cannot access it from the code:
any ideas? |
OK Its a private member so I need to use reflection |
OK got reflection to work. the variable I am looking for is NetAdjust.tempPath there are other similar variables there too but tempPath is the one we can most easily traverse. The game can store multiple paths for different roads (Segments cannot be part of 2 paths). I had no luck so far trying to find out where all these paths are stored. I can only get the active path. but maybe that is good enough depending on what we want to do. |
I would keep the multi-click for different outcomes TMPE has. Usually, much faster to use than selecting from a menu. |
@brunoais That's what I want too. I suspect that's how vast majority of people would like to use this tool in vast majority of situations. |
It's not very clear what the options are doing (unless you already know what they are doing). Instead of a drop down list, why not use icon buttons? Something like:
In case of a roundabout detection, a third icon could be added when applicable, for example: ⚪️. Clicking the roundabout button would apply special ruleset applicable to roundabouts. The buttons would have useful tooltips, for example (this just off top of my head, needs to be much more concise):
When panel opens, or route altered, scan the "smaller" side-roads linked to the route to see what most of them are using: If that's stop or yield show the associated button as selected, otherwise neither button is selected.
|
Note also: When adding yield or stop rules, the vanilla stop rule (Junctions tab of Traffic Routes info view) should also be applied. TM:PE will still take precedence but most segment prefabs will show additional on-map signage/decals when the vanilla stop flag is set. |
THanks @aubergine10 . you are right. I have to trash my work and use your approach. I need One more Sprite for #541 with the icon of go through blocked junction and/or no left turn. |
Could you elaborate on this? I assume that if user clicks one of the other three (yield, stop, roundabout) it would automatically apply relevant customisations for:
|
@aubergine10
it does exactly what #541 does but for the segments selected by the user. that means no left turns go through blocked junctions no zebra crossing on avenue, yield, etc ... and its according to the settings set it in the options. |
Are user's choices retained for the road? For example, if I click Yield button, it will set the existing smaller-roads to yield when entering the road, but what if I add new connecting roads, or alter the road route? |
No, but this is not the case in vanilla case either. the vanilla priority road option does not remember your last choice. this is how The vanilla works:
I am not planning to remember the last choice either. not in my first commit at least. EDIT: I don't even know where the computer stores selected segments (although I know it does remember the selection). I only know how to access a private variable that has the last selection. EDIT 2: The vanilla functionality is way too basic and stupid. I never use. |
Some of those textures already exist, so we should reuse existing ones if possible. |
Intended functionality:
tagging @aubergine10 things left to do:
|
Looking good! Roundabout buttonI would expect the roundabout button to only appear if the named road forms a closed loop. Enter blocked junction buttonDo we need the separate Enter blocked junction button? My assumption (and I think users will make the same assumption) would be that selecting either Yield, Stop, or Roundabout, would automatically add/remove the Enter blocked junction where applicable. Vanilla Stop signsWhen applying our Yield/Stop/Roundabout rules, I would expect the vanilla Stop sign (as seen on Junctions tab of Traffic Routes info view) to be applied at any segments that are given a TM:PE-styled Stop or Yield sign. This is to integrate with roads assets designed to adapt to yeilding/stopping traffic. A good example is the UK Roads Revived roads, which will show a "Give Way" sign and additional decals when vanilla Stop sign is placed. What if junction has traffic lights?My assumption is that any junctions with traffic lights will remain unaltered; they will not get Yield, Stop (or vanilla Stop) signs, and will retain their traffic light. However, I note that TM:PE timed traffic lights has some integration with TM:PE priority signs (if enabled in mod options) so that might need some extra thought? Vanilla priority road checkboxI agree that the vanilla "Priority road" checkbox should be removed. Note however, that vanilla game "remembers" the priority road setting - I just did a quick test and confirmed this. At a guess, it just checks to see if all applicable side roads have a vanilla Stop sign set. Or it could be setting an as-yet undiscovered flag somewhere (on the road segments perhaps)? Either way, you will have to track down code that sets default state to avoid exceptions once that checkbox has been removed from UI. If checkbox is removed from UI, disabling or unsubbing TM:PE from main menu should revive it. Display existing state if possible
I would expect it, if possible, to scan the road to see if applicable side roads are set to one of the configurations. That way I can click a road and see if anything needs updating (if icon is highlighted, I know all the side roads are already configured, otherwise I can choose what config to apply). Note: If vanilla sets an as-yet undiscovered 'Priority Road' flag somewhere, then we should ideally also set that flag should user choose either Yield, Stop or Roundabout. Without this, I have no way of knowing if the whole road is configured as I expect it to be and would end up re-applying rules each time "just in case". UI layoutIn terms of UI, it might be worth having a method that adds an extra panel (with the lighter grey background like that shown on Adjust Roads tab) and then put everything in to that. That way, all the functionality will be gathered together coherently and we can add extra stuff to it in future if applicable. Rough mockup of panel contents:
Tooltips of icons could be something like (just an initial draft):
On the Adjust Roads tab, the panel would be added below the existing vanilla panel. On the Road info popup, the panel would be added below the existing content. |
I am struggling to find a good sprite to use for the button responsible for quick-setup of priority road. any ideas? |
Make a temporary ugly sprite. Show it to us and we might be able to improve it. |
@kvakvs well now I am going to use this: |
I modified
Added Created |
This task is nearly complete.
The images bellow show the round about button in disabled(selection is not a round about), enabled (selection is a roundabout), active states(round about rules applied). clicking an active button again will undo traffic rules (undo is simplistic pending #568) |
Ok now that i've seen it on the real UI not just sprites. |
@kvakvs thanks for the feedback. |
I don't even play this game, nor use any mods, but just some feedback. Those icons DO NOT match at all. If I used this mod, I would unsubscribe to this if those icons were posted. |
And what would you make them look like @Goomig ? We're always open to suggestions :) |
Idk man they look really poppy |
They look to 'noticeable' |
I can make them smaller. Icon design is not my specialty. The game buttons have fewer states than my. when the game button is in active state it does not change face when mouse hovers or mouse is pressed. |
The UI stuff @kvakvs is working on should make button states easier. |
- remove buttons from the road adjust panel - hovering over button should show netadjust path - show mass edit overlay when we are in the road adjust mode but the panel is invisible. - hide RoadWoldInfoPanel in All traffic routes pannels but road adjust. (patch SetMode) - clicking road adjust panel should not hide road info view but modifying the path should. - openning netadjust -> the road info panel should show - TMPE normal view with green hover selecting roads.
I apologize for being a douche about the icons. They do look really nice, the only thing I would change is the gradient on the boxes. I'm getting a very nice Flat UI Feel. |
Currently when using the priority signs tool, holding shift highlights the road (or at least it should). if you Shift+click then it turns the whole highlighted road to priority road by requiring the connected roads to yield. It distinguishes between priority road and connected road by angle. This is done using
SegmentTraverser
class.The vanilla game also has a feature to create priority road. but its done slightly differently. It allows you to click on a road and choose a road segment. then puts stop signs on connecting roads.
As you can see in the pictures bellow there is a disconnect between Vanila and TMPE priority roads:




Each approach has advantages and disadvantages:
I suggest to integrate the TMPE and vanilla approaches. We can discuss what the final solution would look like. possible solutions are:
in approach 2 or 3 we can also add functionality for these closely related issues: closely related issues : shortcut to fix traffic rules where minor road joins a main avenue #541 Shortcut for fixing all round about rules in one click #539 .
other related issues #29 #7
The text was updated successfully, but these errors were encountered: