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

debug switches UI #1696

Merged
merged 9 commits into from
Nov 29, 2022
Merged

debug switches UI #1696

merged 9 commits into from
Nov 29, 2022

Conversation

kianzarrin
Copy link
Collaborator

@kianzarrin kianzarrin commented Nov 23, 2022

Debug switches are now handled by in game UI interface from the options panel and from the debug panel (code copied despawn panel).
They are not longer saved to XML since they can now be set using the UI interface.
changed debug switches to flags.
TrafficManager.zip

@kianzarrin kianzarrin added the Settings Road config, mod options, config xml label Nov 23, 2022
@kianzarrin kianzarrin added this to the 11.7.3.0 milestone Nov 23, 2022
@kianzarrin kianzarrin self-assigned this Nov 23, 2022
@kianzarrin
Copy link
Collaborator Author

image

/// <summary>
/// Indexes into Debug.Switches
/// </summary>
[Flags]
Copy link
Collaborator

@kvakvs kvakvs Nov 23, 2022

Choose a reason for hiding this comment

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

Why bit flags and not multiple boolean? Is there any need to pack all bits into 1 integer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it makes more sense this way. why to write extra code? why to have code duplication?
and we are not serializing anything anymore so there is no need for array.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Reason is that checking a processor-register wide boolean (64 bit) is faster than reading and masking a bit, with same result. Not important if all code for this is deleted in a Release build.

Copy link
Member

Choose a reason for hiding this comment

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

Yes that code won't run in Release build, at least it shouldn't

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am just trying to keep it simple.

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.

Quick review, testing in game...

TLM/TLM/State/GlobalConfig.cs Outdated Show resolved Hide resolved
TLM/TLM/UI/DebugSwitches/DebugSwitchPanel.cs Show resolved Hide resolved
@krzychu124
Copy link
Member

@kianzarrin build is failing because:
TLM\State\OptionsTabs\MaintenanceTab_ConfigGroup.cs(4,29): error CS0234: The type or namespace name 'DebugSwitches' does not exist in the namespace 'TrafficManager.UI' (are you missing an assembly reference?)

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.

Looks ok, fix build error :)

@kianzarrin kianzarrin merged commit b052664 into master Nov 29, 2022
@kianzarrin kianzarrin deleted the DebugSwitches branch November 29, 2022 00:35
@krzychu124 krzychu124 mentioned this pull request Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Settings Road config, mod options, config xml
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants