Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

AbstractSetting: Add "formatter" parameter #470

Open
Baitinq wants to merge 2 commits into
lambda-client:masterlambda-client/lambda-legacy:masterfrom
Baitinq:formatterBaitinq/lambda:formatterCopy head branch name to clipboard
Open

AbstractSetting: Add "formatter" parameter #470
Baitinq wants to merge 2 commits into
lambda-client:masterlambda-client/lambda-legacy:masterfrom
Baitinq:formatterBaitinq/lambda:formatterCopy head branch name to clipboard

Conversation

@Baitinq
Copy link
Copy Markdown
Contributor

@Baitinq Baitinq commented Jan 20, 2023

This patch adds a new "formatter: (T) -> String" parameter to the
AbstractSetting abstract class. This allows for formatter functions to
be passed to settings for them to display their value in a more user
friendly way :)

A possible usage of this would be to replace the unit parameter, as it
simply concatenates the unit string to the setting value, which is a bit
misleading IMO.

P.S. This PR also includes an actual usage of this new parameter in the AntiDisconnect module

This patch adds a new "formatter: (T) -> String" parameter to the
AbstractSetting abstract class. This allows for formatter functions to
be passed to settings for them to display their value in a more user
friendly way :)

A possible usage of this would be to replace the unit parameter, as it
simply concatenates the unit string to the setting value, which is a bit
misleading IMO.
We now show "$x presses" by using the newly added setting formatter
@Baitinq Baitinq changed the title Formatter AbstractSetting: Add "formatter" variable Jan 20, 2023
@Baitinq Baitinq changed the title AbstractSetting: Add "formatter" variable AbstractSetting: Add "formatter" parameter Jan 20, 2023
@Avanatiker
Copy link
Copy Markdown
Member

this is very similar to the unit parameter which is only suffix. yours can be any format. so if you want you can add some default formattings like "x ticks" or "x blocks" and remove unit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.