mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
Compare commits
No commits in common. "66f84a00f308aedc02e82b49b2a102cb50f8fd0c" and "315a57e53de45855d958d210cdb5cdbee8f2d7eb" have entirely different histories.
66f84a00f3
...
315a57e53d
4 changed files with 0 additions and 57 deletions
Binary file not shown.
|
@ -12,7 +12,6 @@
|
|||
<workerClass>Rimworld_Animations.AnimationWorker_KeyframesExtended</workerClass>
|
||||
<keyframes>
|
||||
<li Class="Rimworld_Animations.ExtendedKeyframe">
|
||||
<sound>Fuck</sound>
|
||||
<tick>30</tick>
|
||||
<angle>0</angle>
|
||||
<visible>true</visible>
|
||||
|
|
|
@ -22,23 +22,6 @@ namespace Rimworld_Animations
|
|||
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
|
||||
|
|
|
@ -93,9 +93,6 @@ namespace Rimworld_Animations {
|
|||
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)
|
||||
{
|
||||
// never true if not animating; anim props shouldn't be attached
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue