Skip to content

Commit

Permalink
Added forced on/off of debris in addition to the HMD linking of displ…
Browse files Browse the repository at this point in the history
…ay objects.
  • Loading branch information
Snow1226 committed Mar 30, 2020
1 parent c310d30 commit 9142711
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 15 deletions.
9 changes: 8 additions & 1 deletion CameraPlus/CameraPlusBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public enum CursorType
private readonly WaitForSecondsRealtime _waitForSecondsRealtime = new WaitForSecondsRealtime(1f);
protected const int OnlyInThirdPerson = 3;
protected const int OnlyInFirstPerson = 6; //Moved to an empty layer because layer 4 overlapped the floor
protected const int NotesDebriLayer = 9;
protected const int AlwaysVisible = 10; // For BeatSaberCunstomAvatars above v5.0.0
protected const int ParticleLayer = 16;
public bool ThirdPerson {
get { return _thirdPerson; }
set {
Expand Down Expand Up @@ -523,6 +523,13 @@ internal virtual void SetCullingMask()
_cam.cullingMask &= ~(1 << OnlyInFirstPerson);
_cam.cullingMask &= ~(1 << AlwaysVisible);
}
if (Config.debri!="link")
{
if (Config.debri=="show")
_cam.cullingMask |= (1 << NotesDebriLayer);
else
_cam.cullingMask &= ~(1 << NotesDebriLayer);
}
}

public bool IsWithinRenderArea(Vector2 mousePos, Config c)
Expand Down
1 change: 1 addition & 0 deletions CameraPlus/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class Config
public bool transparentWalls = false;
public bool forceFirstPersonUpRight = false;
public bool avatar = true;
public string debri = "link";
public string movementScriptPath = String.Empty;
//public int maxFps = 90;

Expand Down
12 changes: 12 additions & 0 deletions CameraPlus/ContextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,18 @@ void OnGUI()
parentBehaviour.CloseContextMenu();
parentBehaviour.Config.Save();
}
if (GUI.Button(new Rect(menuPos.x + 130, menuPos.y + 185, 170, 30), new GUIContent(parentBehaviour.Config.debri=="link" ? "Forced display Debri" : parentBehaviour.Config.debri == "show" ? "Forced non-display Debri" : "Debri Linked In-Game")))
{
if (parentBehaviour.Config.debri == "link")
parentBehaviour.Config.debri = "show";
else if (parentBehaviour.Config.debri=="show")
parentBehaviour.Config.debri = "hide";
else
parentBehaviour.Config.debri = "link";
parentBehaviour.SetCullingMask();
parentBehaviour.CloseContextMenu();
parentBehaviour.Config.Save();
}
if (GUI.Button(new Rect(menuPos.x, menuPos.y + 430, 300, 30), new GUIContent("Close Menu")))
{
parentBehaviour.CloseContextMenu();
Expand Down
4 changes: 2 additions & 2 deletions CameraPlus/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.2")]
[assembly: AssemblyFileVersion("4.0.2")]
[assembly: AssemblyVersion("4.0.3")]
[assembly: AssemblyFileVersion("4.0.3")]
2 changes: 1 addition & 1 deletion CameraPlus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"gameVersion": "1.8.0",
"id": "CameraPlus",
"name": "CameraPlus",
"version": "4.0.2",
"version": "4.0.3",
"features": [],
"dependsOn": {
}
Expand Down
47 changes: 36 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ CameraPlus is a Beat Saber mod that allows for multiple wide FOV cameras with sm
[Video Comparison](https://youtu.be/MysLXKSXGTY)
[Third Person Preview](https://youtu.be/ltIhpt-n6b8)
### Right Click Menu Recently Renovated, Appearance may differ from what is shown in this video
The video is an old one. The right-click menu has now been changed.
[![How to use CameraPlus](https://i.imgur.com/UbKrHAF.png)](https://www.youtube.com/watch?v=RpYoMiKJygQ)

# Installing
1. Use the Beat Saber Mod Manager installer: https://github.com/beat-saber-modding-group/BeatSaberModInstaller/releases
1. Use the Mod Assistant : https://github.com/Assistant/ModAssistant/releases
It is the easiest method, it will do all these steps below in 1 click.

### To install manually:
Expand Down Expand Up @@ -63,19 +64,43 @@ Edit that file to configure CameraPlus:
| **transparentWalls** | Make Walls appear transparent on the camera |
| **forceFirstPersonUpRight** | Lock rotation of first person camera on Z axis to keep the camera upright |
| **Avatar** | Switch avatar display layer |
| **movementScriptPath** | Full path to the movement script file to associate with the camera |
| **movementScriptPath** | Full path (including file name) to the movement script file to associate with the camera |


## Movement Script
The sample script described in MovementScriptPath is located in the Beat Saber \ UserData \ CameraPlus \ Scripts folder.
```xml
{
"ActiveInPauseMenu": true, "ActiveInPauseMenu": Determines whether the camera pauses when pausing the game.
"Movements": [ "Movements" : Position description section of the moving camera.
{
"StartPos": { "StartPos" : Camera start position (the center of the play area is 0,0,0).
"x": 2,
"y": 1.75,
"z": -2
},
"StartRot": { "StartRot" : The rotation at which the camera starts (0,0,0 looks straight at the main menu).
"x": 15,
"y": -15,
"z": 0
},
"EndPos": { "EndPos" : The position where the camera ends.
"x": 2,
"y": 1,
"z": 9
},
"EndRot": { "EndRot" : The rotation at which the camera ends.
"x": 15,
"y": -40,
"z": 0
},
"Duration": 4, "Duration" : The time it takes for the transition to start / end / rotate.
"Delay": 0, "Delay" : the time to wait before proceeding to the next move.
"EaseTransition": true "EaseTransition" : If false, the transition between start / end will be linear. Otherwise, the transition is slower from the beginning to the end and faster.

The description is as follows.
"ActiveInPauseMenu": Determines whether the camera pauses when pausing the game.
"StartPos": Camera start position (the center of the play area is 0,0,0).
"StartRot": The rotation at which the camera starts (0,0,0 looks straight at the main menu).
"EndPos": The position where the camera ends.
"EndRot": The rotation at which the camera ends.
"Duration": The time it takes for the transition to start / end / rotate.
"Delay": the time to wait before proceeding to the next move.
"EaseTransition": If false, the transition between start / end will be linear. Otherwise, the transition is slower from the beginning to the end and faster.
}]
}
```

If you need help, ask us at the Beat Saber Mod Group Discord Server:
https://discord.gg/BeatSaberMods
Expand Down

0 comments on commit 9142711

Please sign in to comment.