mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Changes to allow more flexibility
This commit is contained in:
parent
f0cf3a2fda
commit
96c5915660
@ -19,7 +19,7 @@ import { Vector } from "../core/vector";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores a lookup table for all building variants (for better performance)
|
* Stores a lookup table for all building variants (for better performance)
|
||||||
* @type {Object<number, BuildingVariantIdentifier>}
|
* @type {Object<string | number, BuildingVariantIdentifier>}
|
||||||
*/
|
*/
|
||||||
export const gBuildingVariants = {
|
export const gBuildingVariants = {
|
||||||
// Set later
|
// Set later
|
||||||
@ -27,7 +27,7 @@ export const gBuildingVariants = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a new variant
|
* Registers a new variant
|
||||||
* @param {number} id
|
* @param {number | string} id
|
||||||
* @param {typeof MetaBuilding} meta
|
* @param {typeof MetaBuilding} meta
|
||||||
* @param {string} variant
|
* @param {string} variant
|
||||||
* @param {number} rotationVariant
|
* @param {number} rotationVariant
|
||||||
@ -50,7 +50,7 @@ export function registerBuildingVariant(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {number} code
|
* @param {number | string} code
|
||||||
* @returns {BuildingVariantIdentifier}
|
* @returns {BuildingVariantIdentifier}
|
||||||
*/
|
*/
|
||||||
export function getBuildingDataFromCode(code) {
|
export function getBuildingDataFromCode(code) {
|
||||||
@ -72,7 +72,7 @@ export function getCodeFromBuildingData(metaBuilding, variant, rotationVariant)
|
|||||||
data.variant === variant &&
|
data.variant === variant &&
|
||||||
data.rotationVariant === rotationVariant
|
data.rotationVariant === rotationVariant
|
||||||
) {
|
) {
|
||||||
return +key;
|
return key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertAlways(
|
assertAlways(
|
||||||
|
@ -44,7 +44,7 @@ export function initComponentRegistry() {
|
|||||||
|
|
||||||
assert(
|
assert(
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
require.context("./components", false, /.*\.js/i).keys().length ===
|
require.context("./components", false, /.*\.js/i).keys().length >=
|
||||||
gComponentRegistry.getNumEntries(),
|
gComponentRegistry.getNumEntries(),
|
||||||
"Not all components are registered"
|
"Not all components are registered"
|
||||||
);
|
);
|
||||||
|
@ -79,7 +79,7 @@ export class StaticMapEntityComponent extends Component {
|
|||||||
* @param {Vector=} param0.tileSize Size of the entity in tiles
|
* @param {Vector=} param0.tileSize Size of the entity in tiles
|
||||||
* @param {number=} param0.rotation Rotation in degrees. Must be multiple of 90
|
* @param {number=} param0.rotation Rotation in degrees. Must be multiple of 90
|
||||||
* @param {number=} param0.originalRotation Original Rotation in degrees. Must be multiple of 90
|
* @param {number=} param0.originalRotation Original Rotation in degrees. Must be multiple of 90
|
||||||
* @param {number=} param0.code Building code
|
* @param {(number | string)=} param0.code Building code
|
||||||
*/
|
*/
|
||||||
constructor({
|
constructor({
|
||||||
origin = new Vector(),
|
origin = new Vector(),
|
||||||
|
@ -238,8 +238,8 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
|||||||
const items = processorComp.inputSlots;
|
const items = processorComp.inputSlots;
|
||||||
processorComp.inputSlots = [];
|
processorComp.inputSlots = [];
|
||||||
|
|
||||||
/** @type {Object.<string, { item: BaseItem, sourceSlot: number }>} */
|
/** @type {Array<{ item: BaseItem, sourceSlot: number }>} */
|
||||||
const itemsBySlot = {};
|
const itemsBySlot = [];
|
||||||
for (let i = 0; i < items.length; ++i) {
|
for (let i = 0; i < items.length; ++i) {
|
||||||
itemsBySlot[items[i].sourceSlot] = items[i];
|
itemsBySlot[items[i].sourceSlot] = items[i];
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ export class MainMenuState extends GameState {
|
|||||||
|
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<img src="${cachebust("res/logo.png")}" alt="shapez.io Logo">
|
<img src="${cachebust("res/logo.png")}" alt="shapez.io Logo">
|
||||||
<span class="updateLabel">Wires update!</span>
|
<span class="updateLabel">GeoZ!</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ export class MainMenuState extends GameState {
|
|||||||
|
|
||||||
<div class="author">${T.mainMenu.madeBy.replace(
|
<div class="author">${T.mainMenu.madeBy.replace(
|
||||||
"<author-link>",
|
"<author-link>",
|
||||||
'<a class="producerLink" target="_blank">Tobias Springer</a>'
|
'<a class="producerLink" target="_blank">Tobias Springer & modded by Exund</a>'
|
||||||
)}</div>
|
)}</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user