commit
b412b7d14a
@ -0,0 +1,9 @@
|
||||
bin/
|
||||
obj/
|
||||
/packages/
|
||||
riderModule.iml
|
||||
/_ReSharper.Caches/
|
||||
.idea/
|
||||
HarmonyForLogicWorld
|
||||
EccsLogicWorldAPI
|
||||
CameraRoll.sln.DotSettings.user
|
@ -0,0 +1,14 @@
|
||||
# Define two contexts - one for keybindings used during the building state and one for the tool's state
|
||||
CameraRoll.CameraRollBuilding:
|
||||
# This keybinding is used during the game's standard building state - need to inject into the build actions
|
||||
InjectTriggersInto:
|
||||
- MHG.BuildActions
|
||||
Triggers:
|
||||
- CameraRoll.OpenCameraRollTool
|
||||
|
||||
CameraRoll.CameraRollTool:
|
||||
Triggers:
|
||||
- CameraRoll.PlacePoint
|
||||
- CameraRoll.Play
|
||||
- CameraRoll.Stop
|
||||
- CameraRoll.Clear
|
@ -0,0 +1,30 @@
|
||||
# Define all available keybindings of the mod
|
||||
CameraRoll.OpenCameraRollTool:
|
||||
Heading: "CameraRoll"
|
||||
DefaultBinding:
|
||||
Options:
|
||||
- M
|
||||
|
||||
CameraRoll.PlacePoint:
|
||||
Heading: "CameraRoll"
|
||||
DefaultBinding:
|
||||
Options:
|
||||
- P
|
||||
|
||||
CameraRoll.Play:
|
||||
Heading: "CameraRoll"
|
||||
DefaultBinding:
|
||||
Options:
|
||||
- F6
|
||||
|
||||
CameraRoll.Stop:
|
||||
Heading: "CameraRoll"
|
||||
DefaultBinding:
|
||||
Options:
|
||||
- F7
|
||||
|
||||
CameraRoll.Clear:
|
||||
Heading: "CameraRoll"
|
||||
DefaultBinding:
|
||||
Options:
|
||||
- Delete
|
@ -0,0 +1,25 @@
|
||||
MHG.SettingsMenu.Pages.Controls.Headings.CameraRoll: "Mod: Camera Roll"
|
||||
|
||||
FancyInput.Trigger.CameraRoll.OpenCameraRollTool: "Open the camera roll tool"
|
||||
FancyInput.Trigger.CameraRoll.OpenCameraRollTool.Description: """
|
||||
Transitions into the CameraRoll state.
|
||||
"""
|
||||
|
||||
FancyInput.Trigger.CameraRoll.PlacePoint: "Place point"
|
||||
FancyInput.Trigger.CameraRoll.PlacePoint.Description: """
|
||||
Save the current location as a point along the track.
|
||||
"""
|
||||
|
||||
FancyInput.Trigger.CameraRoll.Play: "Play"
|
||||
FancyInput.Trigger.CameraRoll.Play.Description: """
|
||||
Start playing the track.
|
||||
"""
|
||||
|
||||
FancyInput.Trigger.CameraRoll.Stop: "Stop"
|
||||
FancyInput.Trigger.CameraRoll.Stop.Description: """
|
||||
Stop playing the track and return to original position.
|
||||
"""
|
||||
FancyInput.Trigger.CameraRoll.Clear: "Clear placed points"
|
||||
FancyInput.Trigger.CameraRoll.Clear.Description: """
|
||||
Deletes all previously placed points.
|
||||
"""
|
@ -0,0 +1,8 @@
|
||||
ID: D4VID_CameraRoll
|
||||
Name: CameraRoll
|
||||
Author: D4VID
|
||||
Version: 0.0.1
|
||||
Priority: 0
|
||||
ClientOnly: true
|
||||
Dependencies:
|
||||
- EccsLogicWorldAPI
|
@ -0,0 +1,37 @@
|
||||
using CameraRoll.Client.Keybindings;
|
||||
using CameraRoll.Client.Tool;
|
||||
using EccsLogicWorldAPI.Client.Injectors;
|
||||
using FancyInput;
|
||||
using LogicAPI.Client;
|
||||
using LogicLog;
|
||||
using LogicWorld;
|
||||
using LogicWorld.GameStates;
|
||||
|
||||
namespace CameraRoll.Client {
|
||||
public class CameraRollClientMod : ClientMod {
|
||||
public new static ILogicLogger Logger = null!;
|
||||
|
||||
protected override void Initialize() {
|
||||
Logger = base.Logger;
|
||||
Logger.Info("CameraRoll mod loading");
|
||||
CameraRollTool.Init(Logger);
|
||||
|
||||
// Register keybindings in the settings menu
|
||||
CustomInput.Register<CameraRollContext, CameraRollTrigger>("CameraRoll");
|
||||
|
||||
// Inject our own game state
|
||||
GameStateInjector.inject(CameraRollGameState.Id, typeof(CameraRollGameState));
|
||||
|
||||
// Register the keybinding to enter the path analyzer game state
|
||||
FirstPersonInteraction.RegisterBuildingKeybinding(
|
||||
CameraRollTrigger.OpenCameraRollTool,
|
||||
() => {
|
||||
GameStateManager.TransitionTo(CameraRollGameState.Id);
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
Logger.Info("CameraRoll mod loaded");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
using System.Collections.Generic;
|
||||
using CameraRoll.Client.Keybindings;
|
||||
using CameraRoll.Client.Tool;
|
||||
using FancyInput;
|
||||
using LogicUI;
|
||||
using LogicWorld.GameStates;
|
||||
|
||||
namespace CameraRoll.Client {
|
||||
public class CameraRollGameState : GameState {
|
||||
public const string Id = "CameraRollTool";
|
||||
|
||||
public override string TextID => Id;
|
||||
|
||||
/// <summary>
|
||||
/// Locked mouse means you look around when you move it.
|
||||
/// False would display the cursor to be able to click on UI elements.
|
||||
/// </summary>
|
||||
public override bool MouseLocked => true;
|
||||
|
||||
/// <summary>
|
||||
/// This list gets printed on the game's top left UI panel which displays the currently available keybindings
|
||||
/// </summary>
|
||||
public override IEnumerable<InputTrigger> HelpScreenTriggers => new InputTrigger[] {
|
||||
UITrigger.Back,
|
||||
CameraRollTrigger.PlacePoint,
|
||||
CameraRollTrigger.Play,
|
||||
CameraRollTrigger.Stop,
|
||||
CameraRollTrigger.Clear,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Called when the game transitions into this game state i.e. after pressing the configured keybinding
|
||||
/// </summary>
|
||||
public override void OnEnter() {
|
||||
CameraRollClientMod.Logger.Info("CameraRollGameState enter");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ran every frame when inside this game state
|
||||
/// </summary>
|
||||
public override void OnRun() {
|
||||
if (CustomInput.DownThisFrame(UITrigger.Back)) {
|
||||
GameStateManager.TransitionBackToBuildingState();
|
||||
} else if (CustomInput.DownThisFrame(CameraRollTrigger.PlacePoint)) {
|
||||
CameraRollTool.PlacePoint();
|
||||
} else if (CustomInput.DownThisFrame(CameraRollTrigger.Play)) {
|
||||
CameraRollTool.Play();
|
||||
} else if (CustomInput.DownThisFrame(CameraRollTrigger.Stop)) {
|
||||
CameraRollTool.Stop();
|
||||
} else if (CustomInput.DownThisFrame(CameraRollTrigger.Clear)) {
|
||||
CameraRollTool.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the game transitions away from this game state i.e. after pressing the back keybinding
|
||||
/// </summary>
|
||||
public override void OnExit() {
|
||||
CameraRollClientMod.Logger.Info("CameraRollGameState exit");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
namespace CameraRoll.Client.Keybindings {
|
||||
// Define two contexts - one for keybindings used during the building state and one for the tool's state
|
||||
public enum CameraRollContext {
|
||||
CameraRollBuilding,
|
||||
CameraRollTool,
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
namespace CameraRoll.Client.Keybindings {
|
||||
// Define all available keybindings of the mod
|
||||
public enum CameraRollTrigger {
|
||||
None,
|
||||
OpenCameraRollTool,
|
||||
PlacePoint,
|
||||
Play,
|
||||
Stop,
|
||||
Clear,
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
using LogicLog;
|
||||
|
||||
namespace CameraRoll.Client.Tool {
|
||||
|
||||
public class CameraRollTool {
|
||||
private static ILogicLogger _logger = null!;
|
||||
|
||||
public static void Init(ILogicLogger logger) {
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public static void PlacePoint() {
|
||||
_logger.Info("PlacePoint");
|
||||
}
|
||||
|
||||
public static void Play() {
|
||||
_logger.Info("Play");
|
||||
}
|
||||
|
||||
public static void Stop() {
|
||||
_logger.Info("Stop");
|
||||
}
|
||||
|
||||
public static void Clear() {
|
||||
_logger.Info("Clear");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue