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

Add shave config to editor, and update all color pickers #47

Merged
merged 5 commits into from
May 15, 2024

Conversation

tomkennedy22
Copy link
Contributor

This PR adds face shave as a configurable option in the editor, and changes all color pickers on the editor to resemble other newly updated ZenGM color pickers (with components stolen from other repo :D )

Items for thought:

  • I took your existing ColorPicker and Sketch, but changed some elements to fit with FacesJS use of NextUI
  • Should there be default swatches in the ColorPicker?
  • I disabled alpha values for everything but Head Face Shave. Seems like the right thing to do, but some people might like making a transparent person for fun?
  • Added two attributes to the types for color configs - allowAlpha (boolean) and colorFormat (hex / rgba)

@tomkennedy22
Copy link
Contributor Author

This is to solve for #43

Copy link
Member

@dumbmatter dumbmatter left a comment

Choose a reason for hiding this comment

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

Thanks, just a few review comments, this mostly looks good!

Should there be default swatches in the ColorPicker?

I think what you did (using the gallery feature colors) was a good idea.

I disabled alpha values for everything but Head Face Shave. Seems like the right thing to do, but some people might like making a transparent person for fun?

Also agree with what you did here.

public/editor/stateStore.ts Outdated Show resolved Hide resolved
public/editor/stateStore.ts Outdated Show resolved Hide resolved
public/editor/Sketch.tsx Outdated Show resolved Hide resolved
public/editor/FeatureGallery.tsx Outdated Show resolved Hide resolved
public/editor/Sketch.tsx Show resolved Hide resolved
@@ -255,28 +258,36 @@ const FeatureSelector = ({
// @ts-expect-error TS doesnt like conditional array vs string
hasMultipleColors ? selectedVal[colorIndex] : selectedVal;

let presetColors = hasMultipleColors
? gallerySectionConfig.renderOptions.valuesToRender.map(
(colorList: string[]) => colorList[colorIndex],
Copy link
Member

Choose a reason for hiding this comment

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

I'll fix this when I merge in a minute, but there's no need for this type annotation, TypeScript already knows it's string[]

@dumbmatter dumbmatter merged commit 7dca119 into zengm-games:master May 15, 2024
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.

2 participants