-
Notifications
You must be signed in to change notification settings - Fork 119
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 a color picker to mod-settings menu, and make it possible to check the color and alpha #896
base: main
Are you sure you want to change the base?
Add a color picker to mod-settings menu, and make it possible to check the color and alpha #896
Conversation
Just noticed that all sliders show "RuiButton" on the top left corner when you hover over them. No idea why that happens |
The color string should be with 4 int between 0-255, like "91 255 31 255". I noticed your "1.0 0.5 5 0.0",the defualt value supposed to int, and reset, then it should work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can confirm that both sliders work properly. Didn't review code though, besides the bugs i mentioned before
Titanfall.2.2024-10-18.13-15-54.mp4
I forgot to consider situation when user may use float by accident, now it goes with a clamp function which make them into integers. Also I got some fix. It's supposed to be more friendly. |
Use Color struct instead table. Modified the strings used by ThrowInvalidValue.
@@ -130,6 +130,13 @@ | |||
"Path": "ui/ns_slider.nut", | |||
"RunOn": "UI" | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation looks weird, tabs vs spaces issue I assume
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Various formatting issues in this file. Notably the {} after functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
- replaces spaces with tab - add reset logic to colorVGUI
I noticed the modsettings menu is not friendly to color string like "255 255 255 255". So I add a ImagePanel and a ColorPicker which helps.
The mod-settings menu now is able to check the color and edit through a color picker. And the change in the color picker is written to ConVar once each slider/textField gets modified.
Code review:
Add 2 categories: "color", "alpha". The hud elements will show if the ConVarData has right type.
Testing:
If you want to test it, just call the two functions above like:
The ImagePanel will show the convar color auto.