Page MenuHomeWildfire Games

Add a steps param to sliders
Changes PlannedPublic

Authored by elexis on May 2 2017, 8:30 PM.

Details

Reviewers
wraitii
vladislavbelov
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Added steps, where steps=0 means no steps. steps divides MaxValue - MinValue on steps + 1 point.

Test Plan
  1. Add steps="5" i.e. to sound sliders
  2. Test, that it works the same for steps="0"

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
source/gui/CSlider.cpp
147 ↗(On Diff #3075)

Yep.

elexis added inline comments.Dec 5 2017, 10:53 PM
binaries/data/mods/public/gui/options/options.js
36

If we had a stepWidth and a warning if ((maxValue - minValue) / stepWidth) % 1 != 0 then we don't need two arguments, nor doing the math to find out the stepWidth.

I don't see a use case for 0.124 or 0.3333333 stepWidth. At least the latter case should be solvable somehow.

@vladislavbelov are you planning changes to this?

elexis requested changes to this revision.Nov 21 2018, 9:32 AM

The JSON syntax should be tuned for people who modify the options file, not for the C++ code.

"min": 20, "max": 100, "steps": 79 is ugly and relies on the user doing the math, once for every option entry, and again each time the min or max or interval size is changed, relies on the options.json modder doing the math correctly every single time,
whereas it could just be "min": 20, "max": 100, "stepSize": 1, one not having to do any math at the cost of 1-4 lines of code?

The C++ code should be able to understand what the user wants and behave safely, i.e. have the slider value always fixed to one of the values in min + i * width, even if max != min + i * width for any natural number i.
Like if a user passes "min": 0, "max": 6.5, "stepSize": 1 then the possible slider values would be 1, 2, ..., 6.

We really really need this slider setting feature, as the current slider steps make no sense with existing values already and more sliders going to be added for the gamesetup too.

This revision now requires changes to proceed.Nov 21 2018, 9:32 AM
Stan added a subscriber: Stan.Nov 21 2018, 9:40 AM

We really need this feature for the GUI.Scale options. I think there is already a differential but if Not I can submit a patch

In D406#66462, @Stan wrote:

We really need this feature for the GUI.Scale options. I think there is already a differential but if Not I can submit a patch

The patch for UI scale is uploaded but abandoned, should be reclaimed and receive an ugly workaround (message box that if not clicked after 7 seconds will reset the UI scale)

In D406#66464, @elexis wrote:
In D406#66462, @Stan wrote:

We really need this feature for the GUI.Scale options. I think there is already a differential but if Not I can submit a patch

The patch for UI scale is uploaded but abandoned, should be reclaimed and receive an ugly workaround (message box that if not clicked after 7 seconds will reset the UI scale)

Not a workaround solution requires improvements in the our option page logic. Because we shouldn't change visible scale while a user is dragging the slider.

In D406#66457, @elexis wrote:

The JSON syntax should be tuned for people who modify the options file, not for the C++ code.

"min": 20, "max": 100, "steps": 79 is ugly and relies on the user doing the math, once for every option entry, and again each time the min or max or interval size is changed, relies on the options.json modder doing the math correctly every single time,
whereas it could just be "min": 20, "max": 100, "stepSize": 1, one not having to do any math at the cost of 1-4 lines of code?

The C++ code should be able to understand what the user wants and behave safely, i.e. have the slider value always fixed to one of the values in min + i * width, even if max != min + i * width for any natural number i.
Like if a user passes "min": 0, "max": 6.5, "stepSize": 1 then the possible slider values would be 1, 2, ..., 6.

We really really need this slider setting feature, as the current slider steps make no sense with existing values already and more sliders going to be added for the gamesetup too.

The problem is that we will have errors of a C++/JS number conversion and saving. We have to solve it first.

In D406#66464, @elexis wrote:
In D406#66462, @Stan wrote:

We really need this feature for the GUI.Scale options. I think there is already a differential but if Not I can submit a patch

The patch for UI scale is uploaded but abandoned, should be reclaimed and receive an ugly workaround (message box that if not clicked after 7 seconds will reset the UI scale)

Not a workaround solution requires improvements in the our option page logic. Because we shouldn't change visible scale while a user is dragging the slider.

There are no scale changes, the scale is given by options.json. The position of the slider can have one of the determined positions and acts as usual. Just the method of passing the interval width is different.
The slider position should remain fixed until it switches to the next closest value.

The problem is that we will have errors of a C++/JS number conversion and saving. We have to solve it first.

We can convert a JS::Number <-> double well, so is it about some epsilon / rounding phenomenon?
Getting min + i * width rounded as wished shouldn't be so hard to accomplish, regardless which implementation is introducing the epsilon.

In D406#66518, @elexis wrote:

We can convert a JS::Number <-> double well, so is it about some epsilon / rounding phenomenon?
Getting min + i * width rounded as wished shouldn't be so hard to accomplish, regardless which implementation is introducing the epsilon.

You can check it by returning a fixed number, like 4.5. JS may get from C++ the 4.499999 value. And for JS these values are different.

In D406#66518, @elexis wrote:

We can convert a JS::Number <-> double well, so is it about some epsilon / rounding phenomenon?
Getting min + i * width rounded as wished shouldn't be so hard to accomplish, regardless which implementation is introducing the epsilon.

You can check it by returning a fixed number, like 4.5. JS may get from C++ the 4.499999 value. And for JS these values are different.

Don't see a reason why an epsilon issue could not be fixed.
You mean stepWidth = 5 given in options.json will become 4.999, so that the slider position wills be 0, 4.99999.., 9.9999...
Then min and max can also be 4.9999 and the current patch is as affected by epsilon as the change that I request, where is the issue?

In D406#66520, @elexis wrote:

Don't see a reason why an epsilon issue could not be fixed.
You mean stepWidth = 5 given in options.json will become 4.999,

Sort of.

so that the slider position wills be 0, 4.99999.., 9.9999...

No, the slider position will be correct in C++ (with an epsilon correction), but the double > JS::Number conversion loses precision.

Then min and max can also be 4.9999 and the current patch is as affected by epsilon as the change that I request, where is the issue?

Min, max can't be 4.999, the problem is only for the return to JS value.

double > JS::Number conversion loses precision

But we already do that conversion and that conversion is not really related to this patch or the adapted one?

Imarok added a subscriber: Imarok.Nov 22 2018, 8:21 AM

the double > JS::Number conversion loses precision.

I think that is why we have FixedPoint number type in C++. (I guess it's mainly use in simulation)

That's the options.json diff I would recommend

The uploaded patch introduces more members that don't really seem needed and mostly depends on the decision we take for D2241.
We can remove the members there and in this patch for consistency, can make the GetSetting reference returning calls local static variables to avoid members, or introduce many members to avoid static locals and GetSetting in Draw calls.

Stan added a comment.Sep 20 2019, 8:12 PM

I feel like the const change could be taken out.

source/gui/CSlider.cpp
151 ↗(On Diff #3075)

static_cast<int> ?

Stan added a comment.Jan 16 2020, 10:43 AM

Needs to be rebased.

source/gui/CSlider.h
58 ↗(On Diff #3075)

What about m_FreeValue, and m_FreeStep? To denote that the user isn't bound by step limitation?

elexis commandeered this revision.Jan 24 2020, 3:39 AM
elexis edited reviewers, added: vladislavbelov; removed: elexis.

From 2017-12-06-QuakeNet-#0ad-dev.log:

20:14 < temple> stepWidth sounds easier

From 2019-08-14-QuakeNet-#0ad-dev.log:

17:19 < Freagarach> That is much more logical indeed, I thought the "steps" was the number at which each step changes the value. Not until you second line I understood it correctly.
20:14 < Vladislav> elexis: you might commandeer it and suggest your version :)

This revision now requires review to proceed.Jan 24 2020, 3:39 AM
elexis updated this revision to Diff 11172.Jan 24 2020, 3:42 AM

First proof of concept with stepWidth

elexis planned changes to this revision.Jan 24 2020, 3:42 AM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 240| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Sliders/Ceasefire.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Sliders/Ceasefire.js
|  37|  37| 		let value = g_GameAttributes.settings.Ceasefire;
|  38|  38| 		this.sprintfValue.minutes = value;
|  39|  39| 		this.setSelectedValue(
|  40|    |-				value,
|    |  40|+			value,
|  41|  41| 			value == 0 ?
|  42|  42| 				this.NoCeasefireCaption :
|  43|  43| 				sprintf(this.CeasefireCaption(value), this.sprintfValue));
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1648/display/redirect

nani added a subscriber: nani.Jan 24 2020, 1:46 PM
nani added inline comments.
source/gui/ObjectTypes/CSlider.cpp
84–85

What if stepSize is 0? Ideally it should then displace a width of 1 pixel screen in slider coordinates?

103–104

Should it update (send event) if the value remains the same ?

So the main problem with this feature has been and still is the fact that rounding is messed up.

When using this iteration of the patch (Diff 4 11172 23435 First proof of concept with stepWidth) plus removing the toFixed(2) from options.js`, there will be rounding issues if stepSize < 1.

Then I changed it to store m_StepSize and m_StepCount instead of m_StepSize and m_Value`.
This was much more successful and it gets 14 out of 15 decimal places right.
So it seems better while still completely wrong.

So perhaps it would be reasonable to store the number of relevant digits if one cant get the rounding right otherwise.
Or one stores a global epsilon for sliders somewhere, estimating the rounding error (that seems to be less with the stepCount*stepWidth data model).
But that approach also lacks with regards to duplication avoidance, since the conversion between min/max value and stepcount/size is logically duplicated once per slider script handler.

Also the patch still needs to center the button on the mouseposition, not left-align it.

source/gui/ObjectTypes/CSlider.cpp
84–85

m_StepSize is the distance between two adjacent values, so it must (will have to) be != 0

103–104

yes

C++ m_Value rounding errors (with Diff 4 11172 23435 First proof of concept with stepWidth):

vs

JS / m_StepCount * m_StepSize Rounding errors with

:

Stan added a comment.Jan 25 2020, 4:46 PM

I assume you can't use a fixed?

elexis updated this revision to Diff 11178.Jan 25 2020, 9:15 PM
  • Round to significant decimal places determined by stepSize using log10, thus avoiding any hardcoded rounding decimal places
  • Center button over mouse position instead of left align
  • Add slider value to options.js, similar to the gamesetup one from rP23430/D2571

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/231/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Sliders/Ceasefire.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/Single/Sliders/Ceasefire.js
|  37|  37| 		let value = g_GameAttributes.settings.Ceasefire;
|  38|  38| 		this.sprintfValue.minutes = value;
|  39|  39| 		this.setSelectedValue(
|  40|    |-				value,
|    |  40|+			value,
|  41|  41| 			value == 0 ?
|  42|  42| 				this.NoCeasefireCaption :
|  43|  43| 				sprintf(this.CeasefireCaption(value), this.sprintfValue));
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 244| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1653/display/redirect

elexis updated this revision to Diff 11179.Jan 25 2020, 9:33 PM

Fix float vs double comparison, headers

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/232/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1136/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 244| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1654/display/redirect

elexis updated this revision to Diff 11180.Jan 25 2020, 9:45 PM

1.d -> static_cast<double>(1)

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 244| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1655/display/redirect

elexis updated this revision to Diff 11181.Jan 26 2020, 12:57 AM

Add a +/- m_MinValue to the rounding equation so that it works for min=1.25, max=1.75, stepSize=0.1 too.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 244| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1656/display/redirect

elexis updated this revision to Diff 11182.Jan 26 2020, 1:10 AM

Add step_size == 0 LOGERROR

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 244| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1657/display/redirect

elexis updated this revision to Diff 11184.Jan 26 2020, 3:36 PM

Fix missing m_MinValue -/+ for the case 0.25...0.75 with stepSize = 0.1.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 244| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1659/display/redirect

elexis updated this revision to Diff 11192.Jan 26 2020, 11:32 PM

Screw the log10 formula because it will not yield correct values if the stepSize isn't of the form 0.0...01, for example 0.25.
Use fixed count of at most 10 decimal places.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 244| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1665/display/redirect

elexis updated this revision to Diff 11193.Jan 27 2020, 12:25 AM

Remove hardcoding of number of places, avoid duplication by using a default of 1, specify it in options.json otherwise.

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 245| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1666/display/redirect

elexis updated this revision to Diff 11203.Jan 28 2020, 12:17 PM

Surrender rounding in C++ and do it in JS using Math.round(foo * 10^n) / 10^n.
See also https://www.w3schools.com/js/js_numbers.asp

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 247| »   »   »   let·value·=·optionType.guiToValue(control,·option);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1670/display/redirect

elexis updated this revision to Diff 11204.Jan 28 2020, 12:27 PM
  • gui.rnc diff
  • m_StepSize == 0 -> m_StepSize <= 0
  • options.json test removal
  • back from 0.0 to 0.0f

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/gui/ObjectTypes/CSlider.h
|  25| class·CSlider·:·public·IGUIObject,·public·IGUIButtonBehavior
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCSlider:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 247| »   »   »   let·value·=·optionType.guiToValue(control,·option);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 102| 102| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105|    |-					if (isActive)
|    | 105|+				if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 103| 103| 						playerDescription = translate("%(playerName)s (%(civ)s, %(state)s)");
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 106|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 104| 104| 				else
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107|    |-						playerDescription = translate("%(playerName)s");
|    | 107|+					playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 105| 105| 					if (isActive)
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108|    |-					else
|    | 108|+				else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 106| 106| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109|    |-						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
|    | 109|+				// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110| 110| 						playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/common/gamedescription.js
| 107| 107| 						playerDescription = translate("%(playerName)s");
| 108| 108| 					else
| 109| 109| 						// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu
| 110|    |-						playerDescription = translate("%(playerName)s (%(state)s)");
|    | 110|+					playerDescription = translate("%(playerName)s (%(state)s)");
| 111| 111| 			}
| 112| 112| 		}
| 113| 113| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1671/display/redirect

wraitii accepted this revision.Jun 6 2020, 3:14 PM

This is functional everywhere I've tested. I agree with the rounding approach, though it might make more sense to use integer on the C++ side then, but it's ok. Code seems generally good.

binaries/data/mods/mod/gui/gui.rng
413

This seems inconsistent with step_size being used everywhere else.

binaries/data/mods/public/gui/options/options.js
157

Can't you use 1/step_size rather?

source/gui/ObjectTypes/CSlider.cpp
141

const float is rather inconsistent with the rest of the C++ codebase and seems to bring little.

This revision is now accepted and ready to land.Jun 6 2020, 3:14 PM
elexis planned changes to this revision.Jun 6 2020, 10:14 PM

This is functional everywhere I've tested.

This applies to most versions uploaded, it was Vladislav who had provided me input values where the UI would show undesired non-rounded values (0.24999999 etc).
I don't know if the most recent version worked for *all* possible user input.
There were multiple patch designs as well.
I didn't commit the patch because I was still unsatisfied with it.
I don't recollect what it was, not unlikely more than one aspect. For example one big thing is that value representation is impossible for all user input, and the other is the complexity of having both rounding and step_size instead of only one of the two going on, and doing half the code in JS and the other half in C++, I don't recollect what else right now.

D406 occurs in the following irclogs and it was discussed in some of them:
2020-01/2020-01-16-QuakeNet-#0ad-dev.log
2020-01/2020-01-22-QuakeNet-#0ad-dev.log
2020-01/2020-01-24-QuakeNet-#0ad-dev.log
2020-01/2020-01-25-QuakeNet-#0ad-dev.log
2020-01/2020-01-26-QuakeNet-#0ad-dev.log
2020-01/2020-01-27-QuakeNet-#0ad-dev.log
2020-01/2020-01-28-QuakeNet-#0ad-dev.log

I would have to work on this issue again to know what it should be, so I can't endorse the patch even if it might incidentally turn out to be acceptable unimprovable mess.
If someone was to chose the best variant of the variants uploaded, there could be an argument given for the chosen variant being the optimal one.
If the patch was correct, then it would mean that the code behaves correctly for every user input that can be entered, etc.
If the patch was clean, then there would its complexity would be irreducible and there was no duplication, i.e. there would be no other patch that comes with less complexity and duplication that does the same.
etc.