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:
@@ -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>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user