Changeset View
Standalone View
binaries/data/mods/public/gui/common/tooltips.js
Context not available. | |||||
}); | }); | ||||
} | } | ||||
function getCountersTooltip(template) | |||||
{ | |||||
if (!template.attack) | |||||
return ""; | |||||
let result = []; | |||||
for (let attackType in template.attack) | |||||
{ | |||||
if (!template.attack[attackType].bonuses) | |||||
continue; | |||||
let string = headerFont(sprintf(translate("Counters %(attackType)s : "), { | |||||
elexis: -1 space | |||||
Done Inline Actionslet string = headerFont(sprintf(translate("%(attackType)s Counters: "), { Nescio: let string = headerFont(sprintf(translate("%(attackType)s Counters: "), { | |||||
Done Inline ActionsShouldn't that be .every() == 1? lyv: Shouldn't that be .every() == 1?
If something isn't one, they should not be skipped over? | |||||
Done Inline ActionsCould work as well, as I understand it, !some != 1 = every = 1 no ? Stan: Could work as well, as I understand it, !some != 1 = every = 1 no ? | |||||
Done Inline ActionsI did not see that negation. lyv: I did not see that negation.
Why a double negative though?
I didn’t not see a bird
Vs
I saw a… | |||||
Done Inline ActionsYeah I didn't remember the every function. I'll fix it later it makes more sense to me :) Stan: Yeah I didn't remember the every function. I'll fix it later it makes more sense to me :) | |||||
Done Inline Actions(having all quantors in a formula first = https://en.wikipedia.org/wiki/Prenex_normal_form) elexis: (having all quantors in a formula first = https://en.wikipedia.org/wiki/Prenex_normal_form) | |||||
"attackType": translate(attackType) | |||||
})); | |||||
let bonusesBody = []; | |||||
Done Inline ActionsShouldn't there be a s after %(multiplier)? Nescio: Shouldn't there be a `s` after `%(multiplier)`?
Also, `×`. | |||||
Done Inline ActionsRight Stan: Right | |||||
for (let key in template.attack[attackType].bonuses) | |||||
{ | |||||
let bonus = template.attack[attackType].bonuses[key]; | |||||
bonusesBody.push(sprintf("%(multiplier)s %(classes)s", { | |||||
Done Inline ActionsbonusesBody.push(sprintf(translate("%(multiplier)s× vs %(classes)s"), { Nescio: bonusesBody.push(sprintf(translate("%(multiplier)s× vs %(classes)s"), { | |||||
"multiplier": bonus.multiplier, | |||||
"classes": translate(bonus.classes) | |||||
})); | |||||
} | |||||
result.push(string + bodyFont(bonusesBody.join(", "))); | |||||
} | |||||
Done Inline ActionsLooks nicer without the first and other variables, right? let bonusBody = template.attack[attackType].bonuses.map(bonus => bodyFont(...) + " " + ...) (The bonus variable could be ommitted by using template.attack[attackType].bonuses[key] twice and adding a newline. The string variable can be inlined too with some \n and indentation). multiplier + " " + classes should use a sprintf too I think, languages might reverse that or add characters somewhere, or more space or whatever. elexis: Looks nicer without the `first` and other variables, right?
Try `map` https://developer.mozilla. | |||||
Done Inline ActionsIf I try map it fails (it says it's not a function), may it be because template.attack[attackType].bonuses is an object (not array) or i failed the syntax ? Feldfeld: If I try map it fails (it says it's not a function), may it be because `template.attack… | |||||
Done Inline ActionsOh, right, sorry for the wasted time. It is an object, not an array. One could use Object.keys(bonuses).map(bonusType => bonuses[bonusType].bla) but that will mean more objects are created, making this slower than your current function, so screw that array function. elexis: Oh, right, sorry for the wasted time. It is an object, not an array. One could use Object.keys… | |||||
Done Inline Actions", " still needs a translateWithContext, but that can be fixed at committing stage too. elexis: ", " still needs a translateWithContext, but that can be fixed at committing stage too. | |||||
return result.join("\n"); | |||||
} | |||||
Done Inline ActionsThe heck happened here elexis: The heck happened here | |||||
Done Inline Actionsclip.exe not utf8 happens sometimes. Stan: clip.exe not utf8 happens sometimes. | |||||
function showTemplateViewerOnRightClickTooltip() | function showTemplateViewerOnRightClickTooltip() | ||||
{ | { | ||||
// Translation: Appears in a tooltip to indicate that right-clicking the corresponding GUI element will open the Template Details GUI page. | // Translation: Appears in a tooltip to indicate that right-clicking the corresponding GUI element will open the Template Details GUI page. | ||||
Context not available. | |||||
Done Inline ActionsAccidentally left this in wraitii: Accidentally left this in |
-1 space