Refactor conveyor mechanics and action handlers: update spawn count, interval, and delay handling; enhance material management in useMaterialStore; implement spawn action handler; unify action handling across various components.

This commit is contained in:
2025-05-03 18:36:30 +05:30
parent aefa9ec2b2
commit 13af6c2c67
19 changed files with 743 additions and 46 deletions

View File

@@ -103,7 +103,7 @@ function ConveyorMechanics() {
const handleSpawnCountChange = (value: string) => {
if (!selectedEventData || !selectedPointData) return;
const event = updateAction(selectedProduct.productId, selectedPointData.action.actionUuid, {
spawnCount: value === "inherit" ? "inherit" : parseFloat(value),
spawnCount: parseFloat(value),
});
if (event) {
@@ -119,7 +119,7 @@ function ConveyorMechanics() {
const handleSpawnIntervalChange = (value: string) => {
if (!selectedEventData || !selectedPointData) return;
const event = updateAction(selectedProduct.productId, selectedPointData.action.actionUuid, {
spawnInterval: value === "inherit" ? "inherit" : parseFloat(value),
spawnInterval: parseFloat(value),
});
if (event) {
@@ -149,7 +149,7 @@ function ConveyorMechanics() {
const handleDelayChange = (value: string) => {
if (!selectedEventData || !selectedPointData) return;
const event = updateAction(selectedProduct.productId, selectedPointData.action.actionUuid, {
delay: value === "inherit" ? "inherit" : parseFloat(value),
delay: parseFloat(value),
});
if (event) {
@@ -271,7 +271,7 @@ function ConveyorMechanics() {
</div>
</div>
<div className="tirgger">
<Trigger selectedPointData={selectedPointData as any} type= {'Conveyor'}/>
<Trigger selectedPointData={selectedPointData as any} type={'Conveyor'} />
</div>
</section>
</>