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

improve lifecycle of TMPE tool #1188

Merged
merged 5 commits into from
Nov 11, 2021
Merged

improve lifecycle of TMPE tool #1188

merged 5 commits into from
Nov 11, 2021

Conversation

kianzarrin
Copy link
Collaborator

@kianzarrin kianzarrin commented Nov 8, 2021

UUI button is created when TMPE tool is created so we need this to be created on startup. also the Road selection panels need it. for this reason I ensure TMPE tool is created as soon as game is loaded.

Additionally there was a buggy recursion issue when TMPE tool is enabled for the first time outside of EnableTool(). I solved it by only creating the TMPE tool inside EnableTool() and making the function private.

This will not only get rid of hackish code in RoadSelectionPanels but also solve the issue that UUI button is not created in asset editor.

PS: I also had to change a transpiler. instead of modifying il instructions I called a function instead which is easier to maintain.

TMPE.zip

Ensure GetTrafficMangerTool is created after startup.
removed redundant code
enabling disabling TMPE does not change info view.
@kianzarrin kianzarrin self-assigned this Nov 8, 2021
Base automatically changed from disabletool-null-exception to master November 8, 2021 21:48
Copy link
Member

@krzychu124 krzychu124 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor improvement suggested

TLM/TLM/UI/ModUI.cs Outdated Show resolved Hide resolved
Copy link
Collaborator

@kvakvs kvakvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can work with this, this looks good

@krzychu124 krzychu124 self-requested a review November 9, 2021 21:47
@kianzarrin kianzarrin merged commit b703cc4 into master Nov 11, 2021
@kianzarrin kianzarrin deleted the uui-fix branch November 11, 2021 19:22
@originalfoo originalfoo added this to the 11.6.0 milestone Dec 23, 2021
@krzychu124 krzychu124 mentioned this pull request Jan 8, 2022
@originalfoo originalfoo modified the milestones: 11.6.0, 11.6.2 Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants