1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-13 18:21:51 +00:00

Minor adjustments

This commit is contained in:
tobspr 2022-01-13 23:16:24 +01:00
parent ebb2f3a1c6
commit 7e2501ea6e
2 changed files with 4 additions and 5 deletions

View File

@ -35,7 +35,7 @@ export class DemoMod extends Mod {
weightComputation: distanceToOriginInChunks =>
Math.round(20 + Math.max(Math.min(distanceToOriginInChunks, 30), 0)),
shapeDrawer: ({ context, quadrantSize, layerScale }) => {
draw: ({ context, quadrantSize, layerScale }) => {
const quadrantHalfSize = quadrantSize / 2;
context.beginPath();
context.moveTo(-quadrantHalfSize, quadrantHalfSize);

View File

@ -5,7 +5,6 @@ import { ModLoader } from "./modloader";
import { createLogger } from "../core/logging";
import { AtlasSprite, SpriteAtlasLink } from "../core/sprites";
import { Mod } from "./mod";
import { enumShortcodeToSubShape, enumSubShape, enumSubShapeToShortcode } from "../game/shape_definition";
import { Loader } from "../core/loader";
import { LANGUAGES } from "../languages";
@ -89,9 +88,9 @@ export class ModInterface {
* @param {string} param0.id
* @param {string} param0.shortCode
* @param {(distanceToOriginInChunks: number) => number} param0.weightComputation
* @param {(options: SubShapeDrawOptions) => void} param0.shapeDrawer
* @param {(options: SubShapeDrawOptions) => void} param0.draw
*/
registerSubShapeType({ id, shortCode, weightComputation, shapeDrawer }) {
registerSubShapeType({ id, shortCode, weightComputation, draw }) {
if (shortCode.length !== 1) {
throw new Error("Bad short code: " + shortCode);
}
@ -100,7 +99,7 @@ export class ModInterface {
enumShortcodeToSubShape[shortCode] = id;
MODS_ADDITIONAL_SHAPE_MAP_WEIGHTS[id] = weightComputation;
MODS_ADDITIONAL_SUB_SHAPE_DRAWERS[id] = shapeDrawer;
MODS_ADDITIONAL_SUB_SHAPE_DRAWERS[id] = draw;
}
registerTranslations(language, translations) {