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

Remove flawed TTL API #1495

Merged
merged 14 commits into from
Apr 9, 2022

Conversation

Elesbaan70
Copy link
Contributor

This is my solution to the problem of false and unmaintainable traffic light API, as discussed here: #967 (comment)

If this or some similar solution is not used, the ability to enhance traffic lights will always be hampered by the need to carry along a fundamentally defective API. It is probably impossible to maintain API compatibility with enhancements of any size, and so the time to nuke the API is now, when we believe that there are no other mods using it.

} else {
AddSelectedNode(HoveredNodeId);
if (ttlToolMode_ == TTLToolMode.ShowLights) {
SetToolMode(TTLToolMode.SelectNode);
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Note] I think TMPE policy is that using this is recommended. I don't care either way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was Visual Studio doing things I didn't ask it to. :-(

offsetScreenPos.x + (modeWidth / 2f) +
(7f * zoom * (numInfos + 1)) + (infoWidth * numInfos),
offsetScreenPos.y - (infoHeight / 2f),
offsetScreenPos.x + modeWidth / 2f +
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Note]
I think your auto code cleanup has been setup to do some extra stuff.
I also think its .editorConfig fault for not explicitly handling this situations and leaving it to the person's IDE settings.

Copy link
Collaborator

Choose a reason for hiding this comment

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

it just means there is more code to review.

Copy link
Collaborator

Choose a reason for hiding this comment

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

and increases chance of conflict.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I did not tell Visual Studio to do any of that, nor did I explicitly configure it to happen automatically. It's extremely frustrating. But I can go back and revert these if y'all believe it's worthwhile.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No I don't think its worth while.
But maybe you can play with .editorconfig not to do this. But I think that's outside of scope of this PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

image
for some reason you have to use text editor to modify values.

Copy link
Collaborator

@kianzarrin kianzarrin left a comment

Choose a reason for hiding this comment

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

LGTM. just renames.

@Elesbaan70 can you please test persistency?

@Elesbaan70
Copy link
Contributor Author

Elesbaan70 commented Mar 27, 2022

can you please test persistency?

I've done basic testing already, but I've decided to go back and do more. Did you have any specific areas of concern?

@originalfoo originalfoo added code cleanup Refactor code, remove old code, improve maintainability API API for external mods labels Mar 28, 2022
@originalfoo originalfoo added this to the 11.6.5.2 milestone Mar 28, 2022
@krzychu124 krzychu124 self-requested a review March 28, 2022 15:16
@originalfoo originalfoo changed the title Delete false api Remove flawed TTL API Mar 31, 2022
Copy link
Member

@originalfoo originalfoo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Elesbaan70
Copy link
Contributor Author

@Elesbaan70 can you please test persistency?

Persistency is forward- and backward-compatible. Reverting to stable does not work because of #1492 and the versioning issue that will be addressed by #1502. However, reverting to the master branch works fine.

@Elesbaan70
Copy link
Contributor Author

On another note, I'm not sure what I should think about the possibility that my first contribution might be nuking an entire API. LOL

@originalfoo
Copy link
Member

originalfoo commented Apr 4, 2022

@Elesbaan70 pls update to latest master branch

@originalfoo
Copy link
Member

Ugh, @Elesbaan70 I messed up your PR with recent merged PR - want me to send some commits to fix the merge conflicts?

@Elesbaan70
Copy link
Contributor Author

want me to send some commits to fix the merge conflicts?

If you already have it, sure. I suspect I can just do another merge and clean things up pretty easily, in any case.

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.

ok, just fix conflicts :)

@originalfoo
Copy link
Member

@Elesbaan70 I've done most of the conflicts from the IsStartNode PR so hopefully that will reduce amount of stuff you need to wade through.

@Elesbaan70
Copy link
Contributor Author

ok, just fix conflicts :)

Yep, I'll be on that this evening.

@Elesbaan70
Copy link
Contributor Author

@aubergine10 Thanks. I did end up reverting it, though. When I used a decent merge tool, it only found one conflict that it couldn't resolve automatically.

Copy link
Member

@originalfoo originalfoo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Elesbaan70
Copy link
Contributor Author

I highly recommend P4Merge for when merges get messy. https://www.perforce.com/downloads/visual-merge-tool

Watch out with the installer, though. It will try to install their whole version control client, so you have to uncheck everything except the P4Merge option.

@originalfoo
Copy link
Member

@Elesbaan70 pls merge this in to master (assuming you can now it's got 2+ approvals)

@Elesbaan70
Copy link
Contributor Author

I don't have write access

@krzychu124 krzychu124 merged commit aced446 into CitiesSkylinesMods:master Apr 9, 2022
@Elesbaan70 Elesbaan70 deleted the delete-false-api branch April 9, 2022 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API for external mods code cleanup Refactor code, remove old code, improve maintainability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants