-
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
Cache LHT
and RHT
shortcut values?
#1274
Comments
I don't agree with this. we don't need to cache LHT. as far as I can tell it is not used in critical part of the code. In asset editor ppl change LHT/RHT to test their city but it can happen in game too. Obviously previous TMPE rules will not work well but new rules should. We don't need to maintain multiple code paths for asset/map editor VS game (ppl might want their roads in game too). |
Ok, I agree about no need to cache. But if there's change between LHT/RHT are there adverse effects if user doesn't manually clear down the customisations? If we start seeing proliferation of TMPE customised assets/maps in workshop, and user has their traffic on other side of road, what's going to happen? |
I suspect it will not work out very well! in any case this is another issue. |
Pls create another issue that describes the LHT/RHT issue in better detail. At the very least we need to make asset/map creators aware of the potential issues should user play with traffic driving on other side. |
maybe it should be part of the persistency issue? |
yup, if possible that would be awesome! |
In
Shorcuts.cs
we have the following:TMPE/TLM/TLM/Util/Shortcuts.cs
Lines 197 to 198 in 83a7ca3
After PR #1273 is merged (assuming it is), the entire codebase will be using those shortcuts, rather than the cumbersome:
However, it seems we're going to be calling
LHT
andRHT
huge numbers of times, particularly when overlays are active ...I think?Would there be any merit to caching the value?
The value can be changed in-game via mods - currently TM:PE is completely unaware of such change.... To keep the cached value fresh, we could maybe detect changes to
.m_invertTraffic
. Benefit here is that TM:PE will now know if user or a mod changes which side traffic drives on in-game.That could further develop in to handling such change:
The text was updated successfully, but these errors were encountered: