Skip to content

Commit

Permalink
array3pointeditor
Browse files Browse the repository at this point in the history
  • Loading branch information
pandrr committed Apr 9, 2024
1 parent a9a907a commit 2667bdc
Showing 1 changed file with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,27 @@ inReset.onTriggered = () =>
updateIndex();
};

inPosX.onChange = (p, v) =>
function posChanged()
{
arr[idx + 0] = v;
arr[idx + 0] = inPosX.get();
arr[idx + 1] = inPosY.get();
arr[idx + 2] = inPosZ.get();
changed = true;
};
inPosY.onChange = (p, v) =>
}

function addPosListener()
{
arr[idx + 1] = v;
changed = true;
};
inPosZ.onChange = (p, v) =>
inPosX.onChange = posChanged;
inPosY.onChange = posChanged;
inPosZ.onChange = posChanged;
}

function removePosListener()
{
arr[idx + 2] = v;
changed = true;
};
inPosX.onChange = null;
inPosY.onChange = null;
inPosZ.onChange = null;
}

inEdit.onChange = () =>
{
Expand All @@ -72,9 +78,11 @@ function numChanged()
function updateIndex()
{
idx = Math.min(inNum.get() * 3, Math.abs(inEditIndex.get() * 3));
removePosListener();
inPosX.set(arr[idx + 0]);
inPosY.set(arr[idx + 1]);
inPosZ.set(arr[idx + 2]);
addPosListener();
}

exec.onTriggered = () =>
Expand Down

0 comments on commit 2667bdc

Please sign in to comment.