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
Color picker update - built-in mod colors and a user palette #13072
Conversation
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.
You should not have separate commits for fixing the commits you want merged. You can squash commits and amend (to amend to previous commits, use git rebase -i
). Every commit is added when a PR is merged and the fix-ups would just be noise.
Aside from tabs/spaces, StyleCop actually complains about a number of things in the Travis continuous integration test.
Judging from all the StyleCop errors and the StyleCop fix-up commit, it appears that you may not have StyleCop/your code editor configured correctly.
You can run make check
from the command line in the top directory of your OpenRA clone to find StyleCop format errors.
StyleCop errors from travis-ci log:
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L27: [SA1512] A single-line comment must not be followed by a blank line. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L38: [SA1512] A single-line comment must not be followed by a blank line. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L80: [SA1515] A single-line comment must be preceded by a blank line or another single-line comment, or must be the first item in its scope. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L88: [SA1508] A closing curly bracket must not be preceded by a blank line.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L27: [SA1005] The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L37: [SA1005] The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L38: [SA1005] The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L80: [SA1005] The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L81: [SA1005] The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L84: [SA1005] The comment must start with a single space. To ignore this error when commenting out a line of code, begin the comment with '////' rather than '//'.
OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L67: [SP2000] Invalid spacing at the end of the line.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L97: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L97: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L98: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L98: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L99: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L99: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L100: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L100: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L101: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L101: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L102: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L102: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L103: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L103: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L104: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L104: [SA1001] Invalid spacing around the comma.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L69: [SP2000] Invalid spacing at the end of the line.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L93: [SP2000] Invalid spacing at the end of the line.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L123: [SP2000] Invalid spacing at the end of the line.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L191: [SP2000] Invalid spacing at the end of the line.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L205: [SP2000] Invalid spacing at the end of the line.
OpenRA.Mods.Common/Widgets/Logic/ColorPickerLogic.cs:L225: [SP2000] Invalid spacing at the end of the line.
Thanks for contributing.
|
||
readonly string[] reservedModuleNames = { "Metadata", "Folders", "MapFolders", "Packages", "Rules", | ||
readonly string[] reservedModuleNames = { "Metadata", "Folders", "MapFolders", "Packages", "Rules", |
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.
Please don't include tab to space changes. They are not even style fixes, but are comparison noise (extra changes to review).
|
||
if (yaml.ContainsKey("TeamColorPresets")) | ||
TeamColorPresets = FieldLoader.GetValue<string[]>("TeamColorPresets", yaml["TeamColorPresets"].Value); | ||
} |
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.
Same here for tab -> spaces.
@@ -149,7 +149,8 @@ public class PlayerSettings | |||
public string Name = "Newbie"; | |||
public HSLColor Color = new HSLColor(75, 255, 180); | |||
public string LastServer = "localhost:1234"; | |||
} | |||
public string[] CustomColors; | |||
} |
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.
Same here for tab -> spaces.
int maxCustomColors = 10; | ||
|
||
var clearCustomPaletteButton = widget.GetOrNull<ButtonWidget>("CLEAR_CUSTOM_BUTTON"); | ||
if (clearCustomPaletteButton != null) |
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.
Here is a reason to use tabs; the indentation for if
here does not lined up with the rest.
|
||
public Action OnClick = () => { }; | ||
|
||
//protected bool CtrlPressed = false; |
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.
Why do you have commented-out code?
If you are unsure about adding code then ask.
If you want to include the commented-out stuff, you can put it in a separate commit here or in a separate branch.
{ | ||
presetColors = defaultColorPresets.ToList(); | ||
} | ||
|
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.
The spaces on empty line 123 should be removed.
}; | ||
|
||
widget.AddChild(newSwatch); | ||
|
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.
The spaces on empty line 191 should be removed.
int startY = 158; | ||
|
||
addSwatchesAction(presetColors, startX, startY, "COLORPRESET", false); | ||
|
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.
The spaces on empty line 205 should be removed.
i++; | ||
} | ||
} | ||
|
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.
The spaces on empty line 225 should be removed.
|
||
if (mi.Event == MouseInputEvent.Down && !TakeMouseFocus(mi)) | ||
return false; | ||
|
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.
The spaces on empty line 67 should be removed.
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.
Thanks for the comprehensive comments. I'll sort these out and give it another go.
return false; | ||
} | ||
|
||
} |
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.
I missed OpenRA.Mods.Common/Widgets/ColorPaletteSwatchWidget.cs:L88: [SA1508] A closing curly bracket must not be preceded by a blank line.
Line 87 should be deleted.
…penRA into color-picker-update
Any progress here @drogoganor? It looks like you're having some issues with rebasing, feel free to drop in to the IRC channel if you need some help. I will have some comments and requests on the UI, but lets get the current set of issues out of the way first. |
Hi,
Yes I am actually struggling with rebasing, I am not skilled enough with
git.
I wasn't sure if my current situation could be fixed? In any case I
might drop into IRC and ask about it.
Cheers,
David
…On 17/04/2017 8:37 PM, Paul Chote wrote:
Any progress here @drogoganor <https://github.com/drogoganor>?
It looks like you're having some issues with rebasing, feel free to
drop in to the IRC channel if you need some help.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13072 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkFAfIC3hnwecFbQNtVvb5iR1mWAgMNks5rw0DmgaJpZM4M2Z8O>.
|
Yeah, it's actually quite simple to fix if you know how. |
This will fix #10591. |
@drogoganor are you still interested in working on this feature? |
Hi, I'm afraid I'll have to ask you to put it on the future milestone.
I've been really busy lately and it seems it won't let up. Sorry.
…On 13/05/2017 10:59 PM, Paul Chote wrote:
@drogoganor <https://github.com/drogoganor> are you still interested
in working on this feature?
If not, we can move it to the future milestone for someone else to
pick up when they have time and interest.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13072 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABkFAVIOz6MhYWtshcO2t7aaYnWN2MQNks5r5akbgaJpZM4M2Z8O>.
|
No problem. Just let us know if you want to work on this again. |
Hi,
I had a go at updating the color picker. Now it has:
A set of preset color swatches for RA1 and TD, (defined in mod.yaml: TeamColorPresets: C4B060, 4494E4, ....)
A user-defined palette defined in settings.yaml (Player: CustomColors: 3B99CA, A33BCA, ....)
This is my first time contributing to this project so hopefully I have done it correctly and haven't broken any rules.
I'd also like to know what preset colors were available in d2k, TS, and RA2 so I can add them into the mod.yaml for each of these mods. Does anyone happen to know?
Cheers