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

DropDownOption #1512

Merged
merged 17 commits into from
Apr 11, 2022
Merged

DropDownOption #1512

merged 17 commits into from
Apr 11, 2022

Conversation

kianzarrin
Copy link
Collaborator

@kianzarrin kianzarrin commented Apr 4, 2022

fixes: #1510 . No functional changes.

  • Moved some shared code to the base class.
  • defined generic DropDownOption that can handle any integer enum (maybe I should assert).
  • defined KeyAttribute that allows us to put the translations directly on the enum members.
  • All drop drowns use the new DropDownOption.

@kianzarrin kianzarrin added code cleanup Refactor code, remove old code, improve maintainability Settings Road config, mod options, config xml Blocking Another issue depends on this issue. labels Apr 4, 2022
@kianzarrin kianzarrin self-assigned this Apr 4, 2022
@originalfoo originalfoo added this to the 11.6.5.2 milestone Apr 4, 2022
@kianzarrin kianzarrin marked this pull request as ready for review April 4, 2022 15:57
@kianzarrin
Copy link
Collaborator Author

I am yet to test this.

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Apr 4, 2022

test works. but what is the deal with the tooltip?
image
EDIT: fixed

@kianzarrin
Copy link
Collaborator Author

fixed it.
image

@originalfoo
Copy link
Member

originalfoo commented Apr 4, 2022

@kianzarrin Could you also take a look at the tooltip for sliders at some point (out of scope for this PR): Should show current slider value but CO UI is very unreliable at updating the tooltip. Alternative would be custom slider component eg. something like Quistar's Tree Anarchy mod?

TLM/TLM/Enum/RecklessDrivers.cs Outdated Show resolved Hide resolved
TLM/TLM/UI/Helpers/SerializableUIOptionBase.cs Outdated Show resolved Hide resolved
TLM/TLM/Manager/Impl/OptionsManager.cs Outdated Show resolved Hide resolved
@kianzarrin kianzarrin force-pushed the 1510-SerializableUIOptionBase branch from 3fed3d9 to c7dc874 Compare April 4, 2022 17:46
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.

Also noticed 2 drop-downs not yet converted in GeneralTab_LocalisationGroup.cs:

  • language
  • road sign theme

TLM/TLM/Manager/Impl/OptionsManager.cs Outdated Show resolved Hide resolved
TLM/TLM/State/Options.cs Outdated Show resolved Hide resolved
TLM/TMPE.API/Traffic/Enums/KeyAttribute.cs Outdated Show resolved Hide resolved
@kianzarrin
Copy link
Collaborator Author

@aubergine10 Also noticed 2 drop-downs not yet converted in GeneralTab_LocalisationGroup.cs

They where not covered by OptionsManager so fixing them does not contribute toward #363.

they don't have enum so they may need special code so lets deal with them in another PR.

@originalfoo
Copy link
Member

SliderOption has an extraneous ReadOnly getter/setter (line 79) that can likely be removed as that's now included in SerializableUIOptionBase.

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 👍

Built from source as DEBUG and RELEASE. Tested from main menu, and in-game.

@originalfoo
Copy link
Member

bumping for great justice

@kianzarrin kianzarrin merged commit 465e5d2 into master Apr 11, 2022
@kianzarrin kianzarrin deleted the 1510-SerializableUIOptionBase branch April 11, 2022 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocking Another issue depends on this issue. code cleanup Refactor code, remove old code, improve maintainability Settings Road config, mod options, config xml
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use SerializableUIOptionBase for all options.
4 participants