mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-13 10:11:50 +00:00
Replaced concatenated strings with template literals (#1347)
This commit is contained in:
parent
ade7176dba
commit
a3dfe6f5fb
@ -24,7 +24,7 @@ class Mod extends shapez.Mod {
|
||||
if (state instanceof shapez.MainMenuState) {
|
||||
this.dialogs.showInfo(
|
||||
"Welcome back",
|
||||
"You have launched this mod " + this.settings.timesLaunched + " times"
|
||||
`You have launched this mod ${this.settings.timesLaunched} times`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@ -76,7 +76,7 @@ class FluidItem extends shapez.BaseItem {
|
||||
*/
|
||||
drawFullSizeOnCanvas(context, size) {
|
||||
if (!this.cachedSprite) {
|
||||
this.cachedSprite = shapez.Loader.getSprite("sprites/fluids/" + this.fluidType + ".png");
|
||||
this.cachedSprite = shapez.Loader.getSprite(`sprites/fluids/${this.fluidType}.png`);
|
||||
}
|
||||
this.cachedSprite.drawCentered(context, size / 2, size / 2, size);
|
||||
}
|
||||
@ -90,7 +90,7 @@ class FluidItem extends shapez.BaseItem {
|
||||
drawItemCenteredClipped(x, y, parameters, diameter = globalConfig.defaultItemDiameter) {
|
||||
const realDiameter = diameter * 0.6;
|
||||
if (!this.cachedSprite) {
|
||||
this.cachedSprite = shapez.Loader.getSprite("sprites/fluids/" + this.fluidType + ".png");
|
||||
this.cachedSprite = shapez.Loader.getSprite(`sprites/fluids/${this.fluidType}.png`);
|
||||
}
|
||||
this.cachedSprite.drawCachedCentered(parameters, x, y, realDiameter);
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ class Mod extends shapez.Mod {
|
||||
event.preventDefault();
|
||||
|
||||
const data = event.clipboardData.getData("text");
|
||||
this.dialogs.showInfo("Pasted", "You pasted: '" + data + "'");
|
||||
this.dialogs.showInfo("Pasted", `You pasted: '${data}'`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ class Mod extends shapez.Mod {
|
||||
init() {
|
||||
// Replace a builtin sprite
|
||||
["red", "green", "blue", "yellow", "purple", "cyan", "white"].forEach(color => {
|
||||
this.modInterface.registerSprite("sprites/colors/" + color + ".png", RESOURCES[color + ".png"]);
|
||||
this.modInterface.registerSprite(`sprites/colors/${color}.png`, RESOURCES[color + ".png"]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user