Skip to content

Commit

Permalink
Merge pull request #1643 from Azaezel/TriggerTrouble
Browse files Browse the repository at this point in the history
corrects #1273
  • Loading branch information
Areloch committed Jun 18, 2016
2 parents f94c59e + b4dfb9a commit 80dcf3e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
25 changes: 16 additions & 9 deletions Templates/Empty/game/tools/shapeEditor/scripts/shapeEditor.ed.cs
Expand Up @@ -2206,15 +2206,22 @@ function strcapitalise( %str )

function ShapeEdSequences::onAddTrigger( %this )
{
// Can only add triggers if a sequence is selected
%seqName = ShapeEdSequenceList.getSelectedName();
if ( %seqName !$= "" )
{
// Add a new trigger at the current frame
%frame = mRound( ShapeEdSeqSlider.getValue() );
%state = ShapeEdTriggerList.rowCount() % 30;
ShapeEditor.doAddTrigger( %seqName, %frame, %state );
}
// Can only add triggers if a sequence is selected
%seqName = ShapeEdSequenceList.getSelectedName();
if ( %seqName !$= "" )
{
// Add a new trigger at the current frame
%frame = mRound( ShapeEdSeqSlider.getValue() ) - %this-->startFrame.getText();
if ((%frame < 0) || (%frame > %this-->endFrame.getText() - %this-->startFrame.getText()))
{
MessageBoxOK( "Error", "Trigger out of range of the selected animation." );
}
else
{
%state = ShapeEdTriggerList.rowCount() % 30;
ShapeEditor.doAddTrigger( %seqName, %frame, %state );
}
}
}

function ShapeEdTriggerList::onDeleteSelection( %this )
Expand Down
25 changes: 16 additions & 9 deletions Templates/Full/game/tools/shapeEditor/scripts/shapeEditor.ed.cs
Expand Up @@ -2206,15 +2206,22 @@ function strcapitalise( %str )

function ShapeEdSequences::onAddTrigger( %this )
{
// Can only add triggers if a sequence is selected
%seqName = ShapeEdSequenceList.getSelectedName();
if ( %seqName !$= "" )
{
// Add a new trigger at the current frame
%frame = mRound( ShapeEdSeqSlider.getValue() );
%state = ShapeEdTriggerList.rowCount() % 30;
ShapeEditor.doAddTrigger( %seqName, %frame, %state );
}
// Can only add triggers if a sequence is selected
%seqName = ShapeEdSequenceList.getSelectedName();
if ( %seqName !$= "" )
{
// Add a new trigger at the current frame
%frame = mRound( ShapeEdSeqSlider.getValue() ) - %this-->startFrame.getText();
if ((%frame < 0) || (%frame > %this-->endFrame.getText() - %this-->startFrame.getText()))
{
MessageBoxOK( "Error", "Trigger out of range of the selected animation." );
}
else
{
%state = ShapeEdTriggerList.rowCount() % 30;
ShapeEditor.doAddTrigger( %seqName, %frame, %state );
}
}
}

function ShapeEdTriggerList::onDeleteSelection( %this )
Expand Down

0 comments on commit 80dcf3e

Please sign in to comment.