Page MenuHomeWildfire Games

Loading Tips update
ClosedPublic

Authored by Silier on Mar 11 2018, 12:22 PM.

Details

Reviewers
s0600204
Nescio
Imarok
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22137: Remove and Update some outdated tips and refactor tip displaying
Trac Tickets
#4428
Summary

removing and updating some outdated tips and refactoring tip displaying

Test Plan

check that I did not remove something what should be there

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6782
Build 11154: Vulcan BuildJenkins
Build 11153: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Nescio added inline comments.Jan 13 2019, 6:52 PM
binaries/data/mods/public/gui/text/tips/quinquereme.txt
1

Replace with "QUINQUEREME"

binaries/data/mods/public/gui/text/tips/scout_towers.txt
6

Actually the attack does not increase, only the number of arrows does, up to a certain maximum.

binaries/data/mods/public/gui/text/tips/territory_decay.txt
2

There shouldn't be a white line here.

binaries/data/mods/public/gui/text/tips/triremes.txt
4

"Hellenic factions" is ill-defined; replace it by listing all factions that have triremes. (Kushites?)

binaries/data/mods/public/gui/text/tips/war_elephants.txt
4

Check if the last part is true.

Also, I'd appreciate it if the hyphens could be replaced with bullets ("•" instead of "-").

Nescio added inline comments.Jan 13 2019, 7:11 PM
binaries/data/mods/public/gui/text/tips/army_camp.txt
9

Actually there is only one empty line, not two, I just checked, so there is no need to remove them.

binaries/data/mods/public/gui/text/tips/celtic_war_barge.txt
2

Remove the "

binaries/data/mods/public/gui/text/tips/embassies.txt
2

Remove the "

6

Remove the "

binaries/data/mods/public/gui/text/tips/temples.txt
8

Remove the "

binaries/data/mods/public/gui/text/tips/viriato.txt
4

Remove the '

4

B.C → BC

8

Remove the "

8

Has the GT aura that allows ...

Silier updated this revision to Diff 7347.Jan 14 2019, 8:22 PM

fix manual comments (checking comments later)

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

Link to build: https://jenkins.wildfiregames.com/job/differential/969/

Silier marked an inline comment as done.Jan 15 2019, 9:12 AM
Silier added inline comments.
binaries/data/mods/public/gui/text/tips/temples.txt
10

may be better wounded ?

Nescio added inline comments.Jan 15 2019, 10:33 AM
binaries/data/mods/public/gui/text/tips/temples.txt
10

Yes, wounded is better.

Any updates?

Silier updated this revision to Diff 7533.Mar 10 2019, 11:03 AM

should be everything

In D1377#70084, @Nescio wrote:

Also, I'd appreciate it if the hyphens could be replaced with bullets ("•" instead of "-").

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

Link to build: https://jenkins.wildfiregames.com/job/differential/1086/display/redirect

Silier updated this revision to Diff 7535.Mar 10 2019, 12:46 PM

dots :)

Nescio accepted this revision.Mar 10 2019, 1:00 PM
Nescio requested changes to this revision.Mar 10 2019, 1:06 PM

Bullets ought to be used only for itemization. When used as hyphens, hyphens should remain hyphens, of course:

  • citizen-soldier
  • non-food
  • trireme-class
  • ethnically-themed
  • high-yield
  • free-standing
This revision now requires changes to proceed.Mar 10 2019, 1:06 PM
Silier added a comment.EditedMar 10 2019, 1:17 PM

oh sorry, I did not meant to do that :) I just used replacement

Silier updated this revision to Diff 7536.Mar 10 2019, 1:27 PM

remove wrong dots

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

Link to build: https://jenkins.wildfiregames.com/job/differential/1088/display/redirect

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

Link to build: https://jenkins.wildfiregames.com/job/differential/1089/display/redirect

Nescio accepted this revision.Mar 10 2019, 2:11 PM
Imarok accepted this revision.Mar 13 2019, 12:54 PM
Imarok added a subscriber: Imarok.

Taking my two comments aside that looks pretty good. (Also it was accepted by others already...)

No need to upload a new version. If we can resolve my two inlines, I'll commit this in the coming days if nobody objects.

binaries/data/mods/public/gui/text/tips/gathering.txt
11

Shouldn't that be citizen-soldier?

binaries/data/mods/public/gui/text/tips/viriato.txt
7–8

Is that the case currently?
If not, what is the reasoning behind leaving it here?

Silier added inline comments.Mar 13 2019, 1:17 PM
binaries/data/mods/public/gui/text/tips/gathering.txt
11

ah, right. Somehow managed to skip.

binaries/data/mods/public/gui/text/tips/viriato.txt
7–8

correct he cannot yet switch

Is it really better to modify every line to use that `•? Translators will have to edit it again. They might do so once, but what if we like to chose a different styling, for example an actual texture?
Alternatives would be keeping the "-" and replacing it if the line begins with that character (sounds like keeping ballast);
or deleting the - and prepending an arbitrary symbol to every line but the first.
XML would be an alternative but had the disadvantage that one can't use the same GUI object structure for every tooltip.
JSON would be an alternative, but I don't see where the txt format is worse than JSON for the loading tips.

In D1377#72768, @elexis wrote:

Is it really better to modify every line to use that `•? Translators will have to edit it again. They might do so once, but what if we like to chose a different styling, for example an actual texture?
Alternatives would be keeping the "-" and replacing it if the line begins with that character (sounds like keeping ballast);
or deleting the - and prepending an arbitrary symbol to every line but the first.

Doesn't sound like a good alternative, as some language might want to e.g. add the symbol at the end of the line...

XML would be an alternative but had the disadvantage that one can't use the same GUI object structure for every tooltip.
JSON would be an alternative, but I don't see where the txt format is worse than JSON for the loading tips.

So yes I think (and it seems like you do too) it is best to modify each line.

binaries/data/mods/public/gui/text/tips/viriato.txt
7–8

So shouldn't we remove that line?
(I mean the other not implemented tips got removed.)

Doesn't sound like a good alternative, as some language might want to e.g. add the symbol at the end of the line...

sprintf(translate("%(symbol)s %(text)s"))

elexis added a comment.EditedMar 13 2019, 6:58 PM

So yes I think (and it seems like you do too) it is best to modify each line.

The difference is that in the one case every line has to be changed and every translation of every line has to be redone everytime one changes the style, as opposed to every line having to be touched only one and then never again if one wants to change the style (but only the one line style definition).

If the textfiles had not contained styling to begin with, this proposed replacement or dash removal would have been unneeded.

In D1377#72771, @elexis wrote:

Doesn't sound like a good alternative, as some language might want to e.g. add the symbol at the end of the line...

sprintf(translate("%(symbol)s %(text)s"))

Ok, that could work, but what if someone wants to use two lines as heading out of some reason?
I think we shouldn't overcomplicate this issue...

Ok, that could work, but what if someone wants to use two lines as heading out of some reason?
I think we shouldn't overcomplicate this issue...

Then let's don't.
Is there a case to use two lines as a heading, or two lines to the same bullet, and if there is, why doesn't it use one long line and relies on the textwrapping?
If someone comes up with some more desires for this format, they can use JSON, or straight XML.
If one wants to argue with freedom to edit, XML would probably be better in the long term, since it could also specify the image to be shown and other arbitrary sprites.

It's not only the total number of changes each time one wants to change the style, but it also requires translators to get that uncommon character right, for every string, for every translation.
And every language that wants to change the style (like using a different character or different character position, or different whitespace, or two characters) they have to change it consistently in every translated string.

So the choice is between editing every line once and then never again for the purpose of restyling, or editing everyline once and again each time for the purpose of styling.
If we gonna make 100 people edit the translations, we might save some time in the future by picking the alternative with less retranslation in the future.

It's not much effort to ctrl+f those characters.
Either way, not a big defect if we will never again change that format and if all of the translators get the symbol right.

Reasons why I requested bullets:

  • These loading tips are simple txt files, not markdown or something
  • The gui/manual/intro.txt file also uses bullets for itemization
  • The game properly displays many (most?) Unicode symbols, therefore there is no point in limiting ourselves to ascii
  • Let's keep hypens for hyphenation and use bullets for itemization; if in the future a different symbol is preferred then people can do a simple find-and-replace
  • A bullet looks visually better than a hyphen, especially on the folding lines of that parchment background; it's also clearer on high-resolution screens
  • This patch already changes practically all loading tips; including bullets here means translators will have to update the tooltips only once; doing it in a separate patch means they'll have to go over everything twice
In D1377#72775, @Nescio wrote:

Reasons why I requested bullets:

  • These loading tips are simple txt files, not markdown or something
  • The gui/manual/intro.txt file also uses bullets for itemization
  • The game properly displays many (most?) Unicode symbols, therefore there is no point in limiting ourselves to ascii
  • Let's keep hypens for hyphenation and use bullets for itemization; if in the future a different symbol is preferred then people can do a simple find-and-replace
  • A bullet looks visually better than a hyphen, especially on the folding lines of that parchment background; it's also clearer on high-resolution screens

The alternative was not not using bullets, but adding the bullets in a single line of JS code instead of hundreds of lines of loading tips.

  • This patch already changes practically all loading tips; including bullets here means translators will have to update the tooltips only once; doing it in a separate patch means they'll have to go over everything twice

Noone said we should delete the dash in one commit and then and the bullet in a second commit.
The alternative was to delete the dash in one commit, and add the original content changes in the same commit, and add that one line of JS to prepend the bullet point to every line but the first using sprintf(translate("• %(description)s")).

doing it in a separate patch means they'll have to go over everything twice

Developers and translators will have to go through everything again if deciding to change the bullet point in english or in the translated language.
But if the bullet point is only defined in one line of JS, one only has to change one string in JS or one translation.

The simplicity would remain the same, arguably it would lose a degree of freedom, such as using hyphens in one file and bullet points in another, or messing up the format in the translations.

  • The gui/manual/intro.txt file also uses bullets for itemization

I see, but noone said one can't revise that file.

As mentioned it's only a detail and won't affect anything if noone will ever change the bullet point, if all languages use the bullet point and if no translator does a bullet point consistency mistake while translating.

If I understand correctly, you want to have additional code to insert an itemization symbol? Quite frankly, that sounds like a lot of extra work. Besides, it's outside the scope of this patch.

Furthermore, what if a mod wants to use loading tips for something other than a bullet point list?

In D1377#72777, @Nescio wrote:

If I understand correctly, you want

I don't really want anything other than than a full use of our imagination to explore consequences of patches and alternatives to the first implementation.
Using the patch as is has the clear advantage that there aren't any hidden rules to the txt format and that people who are unfamiliar with JS can use the txt file as is.

to have additional code to insert an itemization symbol? Quite frankly, that sounds like a lot of extra work.

It's a lot of extra work if one has to learn JavaScript for that.
But for the ones who are familiar with that already, it's a one or two line change to be written in 2 minutes.
I've already posted the statement.

Besides, it's outside the scope of this patch.

Not really, if we decide to change every line of every file, then it's the task to determine how every line of every file should be changed optimally.

Furthermore, what if a mod wants to use loading tips for something other than a bullet point list?

Granted (though I seriously wonder whether it wouldn't be preferable to use XML in the long term).

Actually, I need to restrict my grants, because the *txt files already hardcode a specific format that is different from arbitrary text:

			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
			Engine.GetGUIObjectByName("tipText").caption = tipText.join("\n");
			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";

So the code already hardcodes that the first line, and the first line only, to be the caption, displayed in a different GUI Object with a different syle.
Secondly it hardcodes the image filename, so a loading tooltip can't chose to use no image or more than one image, or an image in a different location, etc.
If we want to argue with freedom, the current format doesn't provide it.

It would only be changing this:

Engine.GetGUIObjectByName("tipText").caption = tipText.join("\n");

to

Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => sprintf("• %(tiptext)s", { "text": text })).join("\n");

that's not a lot of work at all (in particular in comparison to changing every line in every file and making every translator copy&paste that bullet symbol for every translation).

Imarok requested changes to this revision.Mar 14 2019, 4:34 PM
In D1377#72778, @elexis wrote:

It would only be changing this:

Engine.GetGUIObjectByName("tipText").caption = tipText.join("\n");

to

Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => sprintf("• %(tiptext)s", { "text": text })).join("\n");

that's not a lot of work at all (in particular in comparison to changing every line in every file and making every translator copy&paste that bullet symbol for every translation).

Taken. Please do that change @Angen. But don't forget to translate "• %(tiptext)s".

This revision now requires changes to proceed.Mar 14 2019, 4:34 PM
Silier updated this revision to Diff 7537.Mar 14 2019, 7:00 PM
Silier edited the summary of this revision. (Show Details)

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  26|  26| 
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|    |-			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|    |  29|+		let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text) 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|    |-			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|    |  30|+		Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text) 
|  33|  33| 					return "";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|    |-			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|    |  31|+		Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text) 
|  33|  33| 					return "";
|  34|  34| 				return sprintf("• %(tiptext)s", { "tiptext": text });
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|    |-				if (!text) 
|    |  32|+			if (!text) 
|  33|  33| 					return "";
|  34|  34| 				return sprintf("• %(tiptext)s", { "tiptext": text });
|  35|  35| 			}).join("\n\n");
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|    |-				if (!text) 
|    |  32|+				if (!text)
|  33|  33| 					return "";
|  34|  34| 				return sprintf("• %(tiptext)s", { "tiptext": text });
|  35|  35| 			}).join("\n\n");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text) 
|  33|    |-					return "";
|    |  33|+				return "";
|  34|  34| 				return sprintf("• %(tiptext)s", { "tiptext": text });
|  35|  35| 			}).join("\n\n");
|  36|  36| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text) 
|  33|  33| 					return "";
|  34|    |-				return sprintf("• %(tiptext)s", { "tiptext": text });
|    |  34|+			return sprintf("• %(tiptext)s", { "tiptext": text });
|  35|  35| 			}).join("\n\n");
|  36|  36| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  37|  37| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  32|  32| 				if (!text) 
|  33|  33| 					return "";
|  34|  34| 				return sprintf("• %(tiptext)s", { "tiptext": text });
|  35|    |-			}).join("\n\n");
|    |  35|+		}).join("\n\n");
|  36|  36| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  37|  37| 	}
|  38|  38| 	else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  33|  33| 					return "";
|  34|  34| 				return sprintf("• %(tiptext)s", { "tiptext": text });
|  35|  35| 			}).join("\n\n");
|  36|    |-			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    |  36|+		Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  37|  37| 	}
|  38|  38| 	else
|  39|  39| 		error("Failed to find any matching tips for the loading screen.");

binaries/data/mods/public/gui/loading/loading.js
|  48| »   »   switch·(data.attribs.mapType)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1090/display/redirect

elexis added a comment.EditedMar 14 2019, 8:17 PM
In D1377#72779, @Imarok wrote:

Taken. Please do that change @Angen. But don't forget to translate "• %(tiptext)s".

(The hangup was implementing the JS diff?)
(As mentioned, I don't want to lobby for one or the other implementation, more than I want the decision to become as far-sighted and well argued as achievable)

If we use the sprintf approach, adding a translation comment above the translate(sprintf line would probably be advisable:

// Translation: A bullet point of the loading screen tooltip or something like that
return sprintf("• %(tiptext)s", { "tiptext": text });

(Can be inserted when committing I guess)

(Also if you change the format and someone is willing to spend the time, he could browse if some of the popular mods use this format and notify them if so. I guess we have a positive here https://github.com/JustusAvramenko/ and a negative there https://github.com/0ADMods/millenniumad/tree/master/gui)

Notice that the mods have to change all lines to use bullet points or no hyphen too, unless they nuke all 0ad tooltips.

Silier updated this revision to Diff 7538.Mar 14 2019, 9:28 PM

forgot to translate :)

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  26|  26| 
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|    |-			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|    |  29|+		let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|    |-			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|    |  30|+		Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|    |-			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|    |  31|+		Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|    |-				if (!text)
|    |  32|+			if (!text)
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return translate(sprintf("• %(tiptext)s", { "tiptext": text }));
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|    |-					return "";
|    |  33|+				return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return translate(sprintf("• %(tiptext)s", { "tiptext": text }));
|  36|  36| 			}).join("\n\n");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|  34|    |-				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|    |  34|+			// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return translate(sprintf("• %(tiptext)s", { "tiptext": text }));
|  36|  36| 			}).join("\n\n");
|  37|  37| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|    |-				return translate(sprintf("• %(tiptext)s", { "tiptext": text }));
|    |  35|+			return translate(sprintf("• %(tiptext)s", { "tiptext": text }));
|  36|  36| 			}).join("\n\n");
|  37|  37| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  38|  38| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return translate(sprintf("• %(tiptext)s", { "tiptext": text }));
|  36|    |-			}).join("\n\n");
|    |  36|+		}).join("\n\n");
|  37|  37| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  38|  38| 	}
|  39|  39| 	else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return translate(sprintf("• %(tiptext)s", { "tiptext": text }));
|  36|  36| 			}).join("\n\n");
|  37|    |-			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    |  37|+		Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  38|  38| 	}
|  39|  39| 	else
|  40|  40| 		error("Failed to find any matching tips for the loading screen.");

binaries/data/mods/public/gui/loading/loading.js
|  49| »   »   switch·(data.attribs.mapType)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1091/display/redirect

translate(sprintf -> sprintf(translate

Silier updated this revision to Diff 7556.Mar 17 2019, 11:15 AM

fix translate

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  26|  26| 
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|    |-			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|    |  29|+		let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|    |-			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|    |  30|+		Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|    |-			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|    |  31|+		Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|    |-				if (!text)
|    |  32|+			if (!text)
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|    |-					return "";
|    |  33|+				return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|  36| 			}).join("\n\n");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|  34|    |-				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|    |  34|+			// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|  36| 			}).join("\n\n");
|  37|  37| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|    |-				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|    |  35|+			return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|  36| 			}).join("\n\n");
|  37|  37| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  38|  38| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|    |-			}).join("\n\n");
|    |  36|+		}).join("\n\n");
|  37|  37| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  38|  38| 	}
|  39|  39| 	else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|  36| 			}).join("\n\n");
|  37|    |-			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    |  37|+		Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  38|  38| 	}
|  39|  39| 	else
|  40|  40| 		error("Failed to find any matching tips for the loading screen.");

binaries/data/mods/public/gui/loading/loading.js
|  49| »   »   switch·(data.attribs.mapType)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1098/display/redirect

Silier updated this revision to Diff 7558.Mar 17 2019, 11:20 AM

forgot 2 comments, sorry

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  26|  26| 
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|    |-			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|    |  29|+		let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|    |-			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|    |  30|+		Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|    |-			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|    |  31|+		Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|    |-				if (!text)
|    |  32|+			if (!text)
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|    |-					return "";
|    |  33|+				return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|  36| 			}).join("\n\n");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|  34|    |-				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|    |  34|+			// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|  36| 			}).join("\n\n");
|  37|  37| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  32|  32| 				if (!text)
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|    |-				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|    |  35|+			return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|  36| 			}).join("\n\n");
|  37|  37| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  38|  38| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  33|  33| 					return "";
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|    |-			}).join("\n\n");
|    |  36|+		}).join("\n\n");
|  37|  37| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  38|  38| 	}
|  39|  39| 	else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  34|  34| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  35|  35| 				return sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  36|  36| 			}).join("\n\n");
|  37|    |-			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    |  37|+		Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  38|  38| 	}
|  39|  39| 	else
|  40|  40| 		error("Failed to find any matching tips for the loading screen.");

binaries/data/mods/public/gui/loading/loading.js
|  49| »   »   switch·(data.attribs.mapType)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1099/display/redirect

Imarok added inline comments.Mar 20 2019, 11:27 AM
binaries/data/mods/public/gui/loading/loading.js
32–35 ↗(On Diff #7558)

What about text && sprintf(translate("• %(tiptext)s"), { "tiptext": text })?

Silier updated this revision to Diff 7601.Mar 20 2019, 2:55 PM

simplify map function

just still dont get this javascript features somehow, there is return text && sprintf("..."), and aside from that the result of this expresion should be true, but it is replaced string

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  26|  26| 
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|    |-			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|    |  29|+		let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  27|  27| 	if (tipFile)
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|    |-			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|    |  30|+		Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  33|  33| 				return text && sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  28|  28| 	{
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|    |-			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|    |  31|+		Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  33|  33| 				return text && sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  34|  34| 			}).join("\n\n");
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  29|  29| 			let tipText = Engine.TranslateLines(Engine.ReadFile(g_TipsTextPath + tipFile + ".txt")).split("\n");
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|    |-				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|    |  32|+			// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  33|  33| 				return text && sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  34|  34| 			}).join("\n\n");
|  35|  35| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  30|  30| 			Engine.GetGUIObjectByName("tipTitle").caption = tipText.shift();
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  33|    |-				return text && sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|    |  33|+			return text && sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  34|  34| 			}).join("\n\n");
|  35|  35| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  36|  36| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  31|  31| 			Engine.GetGUIObjectByName("tipText").caption = tipText.map(text => {
|  32|  32| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  33|  33| 				return text && sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  34|    |-			}).join("\n\n");
|    |  34|+		}).join("\n\n");
|  35|  35| 			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  36|  36| 	}
|  37|  37| 	else
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/loading/loading.js
|  32|  32| 				// Translation: A bullet point used before every item of list of tips displayed on loading screen
|  33|  33| 				return text && sprintf(translate("• %(tiptext)s"), { "tiptext": text });
|  34|  34| 			}).join("\n\n");
|  35|    |-			Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|    |  35|+		Engine.GetGUIObjectByName("tipImage").sprite = "stretched:" + g_TipsImagePath + tipFile + ".png";
|  36|  36| 	}
|  37|  37| 	else
|  38|  38| 		error("Failed to find any matching tips for the loading screen.");

binaries/data/mods/public/gui/loading/loading.js
|  47| »   »   switch·(data.attribs.mapType)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1126/display/redirect

elexis added inline comments.Mar 20 2019, 4:57 PM
binaries/data/mods/public/gui/loading/loading.js
32–35 ↗(On Diff #7558)

Good catch, then you can remove the { return ;} part too (no need to upload a new version just for that I guess, unless you have the diff applied already anyhow)

Imarok accepted this revision.Mar 20 2019, 8:02 PM

Will commit soon.

In D1377#73333, @Angen wrote:

just still dont get this javascript features somehow, there is return text && sprintf("..."), and aside from that the result of this expresion should be true, but it is replaced string

what part don't you get?
the sprintf?
the &&?

should not be result of && operation boolean and not string ? But somehow (well javascript) it is string if first is true else it is nothing

This revision was not accepted when it landed; it landed in state Needs Review.Mar 20 2019, 11:28 PM
This revision was automatically updated to reflect the committed changes.