Compare commits

..

No commits in common. "66f84a00f308aedc02e82b49b2a102cb50f8fd0c" and "315a57e53de45855d958d210cdb5cdbee8f2d7eb" have entirely different histories.

4 changed files with 0 additions and 57 deletions

View file

@ -12,7 +12,6 @@
<workerClass>Rimworld_Animations.AnimationWorker_KeyframesExtended</workerClass> <workerClass>Rimworld_Animations.AnimationWorker_KeyframesExtended</workerClass>
<keyframes> <keyframes>
<li Class="Rimworld_Animations.ExtendedKeyframe"> <li Class="Rimworld_Animations.ExtendedKeyframe">
<sound>Fuck</sound>
<tick>30</tick> <tick>30</tick>
<angle>0</angle> <angle>0</angle>
<visible>true</visible> <visible>true</visible>

View file

@ -22,23 +22,6 @@ namespace Rimworld_Animations
return base.OffsetAtTick(tick, parms); return base.OffsetAtTick(tick, parms);
} }
public SoundDef soundAtTick(int tick)
{
//Verse.Keyframe keyframe = this.part.keyframes[0];
Verse.Keyframe keyframe2 = this.part.keyframes[this.part.keyframes.Count - 1];
foreach (Verse.Keyframe keyframe in this.part.keyframes)
{
if (tick == keyframe.tick)
{
return (keyframe as ExtendedKeyframe).sound;
}
}
return null;
}
//use extendedkeyframes to determine addon facing //use extendedkeyframes to determine addon facing

View file

@ -93,9 +93,6 @@ namespace Rimworld_Animations {
StopAnimating(); StopAnimating();
} }
} }
CheckAndPlaySounds();
} }
@ -201,42 +198,6 @@ namespace Rimworld_Animations {
} }
public void CheckAndPlaySounds()
{
PawnRenderNode rootNode = pawn.Drawer?.renderer?.renderTree?.rootNode;
//check if the rootnode has sounds; if so play it
if (rootNode?.AnimationWorker is AnimationWorker_KeyframesExtended animWorker)
{
SoundDef sound = animWorker.soundAtTick(rootNode.tree.AnimationTick);
if (sound != null)
{
sound.PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
}
}
if (rootNode?.children != null)
{
foreach (PawnRenderNode node in rootNode?.children)
{
if (node?.AnimationWorker is AnimationWorker_KeyframesExtended childrenAnimWorker)
{
SoundDef sound = childrenAnimWorker.soundAtTick(node.tree.AnimationTick);
if (sound != null)
{
sound.PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
}
}
}
}
//do the same for all the child nodes
}
public bool AnimationMakesUseOfProp(AnimationPropDef animationProp) public bool AnimationMakesUseOfProp(AnimationPropDef animationProp)
{ {
// never true if not animating; anim props shouldn't be attached // never true if not animating; anim props shouldn't be attached