Skip to content

Commit

Permalink
Add male base offset slider
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoooi0 committed Jul 12, 2023
1 parent 6e78597 commit 323d8b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/MotionSource/MaleFemaleMotionSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class MaleFemaleMotionSource : AbstractFemaleMotionSource
private Atom _maleAtom;

private JSONStorableStringChooser MaleChooser;
private JSONStorableFloat PenisBaseOffset;

private SuperController Controller => SuperController.singleton;

Expand All @@ -37,6 +38,7 @@ public class MaleFemaleMotionSource : AbstractFemaleMotionSource
public override void CreateUI(IUIBuilder builder)
{
MaleChooser = builder.CreatePopup("MotionSource:Male", "Select Male", null, null, MaleChooserCallback);
PenisBaseOffset = builder.CreateSlider("MotionSource:PenisBaseOffset", "Penis base offset", 0, -0.05f, 0.05f, true, true);

base.CreateUI(builder);

Expand All @@ -47,18 +49,21 @@ public override void DestroyUI(IUIBuilder builder)
{
base.DestroyUI(builder);
builder.Destroy(MaleChooser);
builder.Destroy(PenisBaseOffset);
}

public override void StoreConfig(JSONNode config)
{
base.StoreConfig(config);
config.Store(MaleChooser);
config.Store(PenisBaseOffset);
}

public override void RestoreConfig(JSONNode config)
{
base.RestoreConfig(config);
config.Restore(MaleChooser);
config.Restore(PenisBaseOffset);

FindMales(MaleChooser.val);
}
Expand All @@ -80,7 +85,7 @@ private bool UpdateMale()
return false;

var gen1Transform = gen1Collider.transform;
var gen1Position = gen1Transform.position - gen1Transform.up * (gen1Collider.height / 2 - gen1Collider.radius);
var gen1Position = gen1Transform.position - gen1Transform.up * (gen1Collider.height / 2 - gen1Collider.radius + PenisBaseOffset.val);
var gen2Position = gen2Collider.transform.position;
var gen3aPosition = gen3aCollider.transform.position;
var gen3bPosition = gen3bCollider.transform.position + gen3bCollider.transform.right * gen3bCollider.radius;
Expand Down

0 comments on commit 323d8b8

Please sign in to comment.