Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Commit

Permalink
1.5.1 - The Christmas Update
Browse files Browse the repository at this point in the history
See CHANGELOG.md for details
  • Loading branch information
KyleTheScientist committed Dec 9, 2023
1 parent f849073 commit 3de171a
Show file tree
Hide file tree
Showing 17 changed files with 320 additions and 159 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# CHANGELOG.md

## 1.5.1 (2023-December-9) - The Christmas Update

### Features
- Added the **Fireflies** mod which allows you to summon a firefly that will track a player in the lobby.
- Added the **Join Bark Code** button which will let you join a private code for Bark users.
- You can now summon Bark using the **B** button on your keyboard.
- Added some Christmas lights to the menu

### Fixed
- Fixed potions and teleport for the new update


## 1.5.0 (2023-November-11) - The Settings Update

### Features
Expand Down
27 changes: 24 additions & 3 deletions GUI/MenuController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using UnityEngine.XR;
using Bark.Modules.Misc;
using Photon.Pun;
using UnityEngine.InputSystem;

namespace Bark.GUI
{
Expand All @@ -36,6 +37,7 @@ public Vector3
public static InputTracker SummonTracker;
public static ConfigEntry<string> SummonInput;
public static ConfigEntry<string> SummonInputHand;
bool docked;

protected override void Awake()
{
Expand Down Expand Up @@ -82,6 +84,9 @@ protected override void Awake()
gameObject.AddComponent<Telekinesis>(),
gameObject.AddComponent<Fireflies>(),
gameObject.AddComponent<XRay>(),

//// Misc
gameObject.AddComponent<Lobby>(),
};

Halo halo = gameObject.AddComponent<Halo>();
Expand Down Expand Up @@ -134,6 +139,20 @@ void Summon()

void FixedUpdate()
{
if (Keyboard.current.bKey.wasPressedThisFrame)
{
if (!docked)
Summon();
else
{
_rigidbody.isKinematic = false;
_rigidbody.useGravity = true;
transform.SetParent(null);
AddBlockerToAllButtons(ButtonController.Blocker.MENU_FALLING);
docked = false;
}
}

// The potions tutorial needs to be updated frequently to keep the current size
// up-to-date, even when the mod is disabled
if (BarkModule.LastEnabled && BarkModule.LastEnabled == Potions.Instance)
Expand All @@ -154,6 +173,7 @@ void ResetPosition()
{
button.RemoveBlocker(ButtonController.Blocker.MENU_FALLING);
}
docked = true;
}

void BuildMenu()
Expand All @@ -174,7 +194,7 @@ void BuildMenu()
SetupInteraction();
SetupModPages();
SetupSettingsPage();

transform.SetParent(Player.Instance.bodyCollider.transform);
ResetPosition();
Logging.Debug("Build successful.");
Expand All @@ -191,7 +211,7 @@ private void SetupSettingsPage()
btnController.OnPressed += (obj, pressed) =>
{
settingsPage.SetActive(pressed);
if(pressed)
if (pressed)
settingsPage.GetComponent<SettingsPage>().UpdateText();
modPage.SetActive(!pressed);
};
Expand Down Expand Up @@ -336,7 +356,7 @@ public void NextPage(ButtonController button, bool isPressed)
{
modPages[i].gameObject.SetActive(i == pageIndex);
}
modPage = modPages[pageIndex].gameObject;
modPage = modPages[pageIndex].gameObject;
}

public void SetupInteraction()
Expand All @@ -346,6 +366,7 @@ public void SetupInteraction()
this.OnSelectExit += (_, __) =>
{
AddBlockerToAllButtons(ButtonController.Blocker.MENU_FALLING);
docked = false;
};
this.OnSelectEnter += (_, __) =>
{
Expand Down
2 changes: 1 addition & 1 deletion Interaction/BarkGrabbable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public override void OnDeselect(BarkInteractor interactor)
rb.useGravity = true;

// Apply the force to the rigidbody
rb.velocity = (velEstimator.linearVelocity + Player.Instance.currentVelocity) * throwForceMultiplier;
rb.velocity = (Player.Instance.currentVelocity) + velEstimator.linearVelocity * throwForceMultiplier;
rb.velocity *= 1 / Player.Instance.scale;
rb.angularVelocity = velEstimator.angularVelocity;
}
Expand Down
30 changes: 30 additions & 0 deletions Modules/Misc/Lobby.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Bark.GUI;
using GorillaNetworking;

namespace Bark.Modules.Misc
{
public class Lobby : BarkModule
{

public static readonly string DisplayName = "Join Bark Code";

protected override void OnEnable()
{
if (!MenuController.Instance.Built) return;
base.OnEnable();
Plugin.Instance.JoinLobby("BARK_MOD", "MODDED_MODDED_CASUALCASUAL");
this.enabled = false;
}
public override string GetDisplayName()
{
return DisplayName;
}

public override string Tutorial()
{
return "Joins the official Bark Mod code";
}

protected override void Cleanup() { }
}
}
11 changes: 0 additions & 11 deletions Modules/Movement/Nailgun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,6 @@ GameObject MakeNail()
return null;
}

void MakeSlideHelper(Transform parent)
{
GameObject slideHelper = new GameObject("SlideHelper");
slideHelper.transform.SetParent(parent, false);
slideHelper.AddComponent<GorillaSurfaceOverride>().overrideIndex = 89;
var climbable = slideHelper.AddComponent<GorillaClimbable>();
climbable.snapX = false;
climbable.snapY = false;
climbable.snapZ = false;
}

Vector3? GetEndpoint(Vector3 origin, Vector3 forward)
{
Ray ray = new Ray(origin, forward);
Expand Down
2 changes: 2 additions & 0 deletions Modules/Movement/Platforms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,15 @@ void OnGripPressed(NetworkedPlayer player, bool isLeft)
platformLeft.SetActive(true);
platformLeft.transform.position = leftHand.TransformPoint(new Vector3(-12, 18, -10) / 200f);
platformLeft.transform.rotation = leftHand.transform.rotation * Quaternion.Euler(215, 0, -15);
platformLeft.transform.localScale = Vector3.one * networkedPlayer.rig.scaleFactor;
}
else
{
var rightHand = networkedPlayer.rig.rightHandTransform;
platformRight.SetActive(true);
platformRight.transform.localPosition = rightHand.TransformPoint(new Vector3(12, 18, 10) / 200f);
platformRight.transform.localRotation = rightHand.transform.rotation * Quaternion.Euler(-45, -25, -190);
platformLeft.transform.localScale = Vector3.one * networkedPlayer.rig.scaleFactor;
}
}

Expand Down
Loading

0 comments on commit 3de171a

Please sign in to comment.