grist: make textures generated through a makefile

This commit is contained in:
2025-04-18 15:52:14 +02:00
parent 35bf83cd1d
commit 16c9f50723
14 changed files with 99 additions and 25 deletions

View File

@ -5,8 +5,7 @@ StartupEvents.registry('block', e => {
e.create(grist.id())
.displayName(grist.displayName())
.tagBlock('mineable/pickaxe')
.textureAll(grist.blockTexture())
.color(0, grist.color());
.textureAll(grist.blockTexture());
});
});
@ -18,8 +17,7 @@ StartupEvents.registry('item', e => {
.displayName(grist.displayName())
.rarity('rare')
.fireResistant(true)
.textureJson({layer0: grist.itemTexture()})
.color(0, grist.color());
.textureJson({layer0: grist.itemTexture()});
});
});

View File

@ -218,11 +218,11 @@ Grist.prototype.toJson = function() {
};
Grist.prototype.itemTexture = function() {
return `malloc:item/grist_${this.tier.name}`;
return `malloc:item/grist_${this.tier.name}_${this.element.name}`;
};
Grist.prototype.blockTexture = function() {
return 'malloc:block/grist';
return `malloc:block/grist_${this.tier.name}_${this.element.name}`;
};
global.Grist = Grist;