mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 09:39:56 +00:00
Add warp to vessel / insert core debug actions (#82)
* Add warp to vessel / insert core debug actions * Add debug mode config flag * Enable in-game switching of debug flag
This commit is contained in:
parent
494610c0dd
commit
f3ec54f75c
45
QSB/DebugActions.cs
Normal file
45
QSB/DebugActions.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB
|
||||
{
|
||||
class DebugActions : MonoBehaviour
|
||||
{
|
||||
void GoToVessel()
|
||||
{
|
||||
var spawnPoint = GameObject.Find("Spawn_Vessel").GetComponent<SpawnPoint>();
|
||||
|
||||
OWRigidbody playerBody = Locator.GetPlayerBody();
|
||||
playerBody.WarpToPositionRotation(spawnPoint.transform.position, spawnPoint.transform.rotation);
|
||||
playerBody.SetVelocity(spawnPoint.GetPointVelocity());
|
||||
}
|
||||
|
||||
void InsertWarpCore()
|
||||
{
|
||||
var warpCore = GameObject.Find("Prefab_NOM_WarpCoreVessel").GetComponent<WarpCoreItem>();
|
||||
var socket = GameObject.Find("Interactibles_VesselBridge").GetComponentInChildren<WarpCoreSocket>();
|
||||
socket.PlaceIntoSocket(warpCore);
|
||||
|
||||
GetComponent<NomaiCoordinateInterface>().SetPillarRaised(true, true);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (!QSB.DebugMode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.Keypad1))
|
||||
{
|
||||
GoToVessel();
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.Keypad2))
|
||||
{
|
||||
InsertWarpCore();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ namespace QSB
|
||||
{
|
||||
public static IModHelper Helper;
|
||||
public static string DefaultServerIP;
|
||||
public static bool DebugMode;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@ -23,11 +24,13 @@ namespace QSB
|
||||
gameObject.AddComponent<DebugLog>();
|
||||
gameObject.AddComponent<QSBNetworkManager>();
|
||||
gameObject.AddComponent<NetworkManagerHUD>();
|
||||
gameObject.AddComponent<DebugActions>();
|
||||
}
|
||||
|
||||
public override void Configure(IModConfig config)
|
||||
{
|
||||
DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
|
||||
DebugMode = config.GetSettingsValue<bool>("debugMode");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,6 +106,7 @@
|
||||
<Compile Include="Animation\AnimFloatParam.cs" />
|
||||
<Compile Include="Animation\AnimTriggerMessage.cs" />
|
||||
<Compile Include="Animation\AnimTrigger.cs" />
|
||||
<Compile Include="DebugActions.cs" />
|
||||
<Compile Include="Events\Necronomicon.cs" />
|
||||
<Compile Include="Events\JoinMessage.cs" />
|
||||
<Compile Include="Events\LeaveMessage.cs" />
|
||||
|
@ -2,6 +2,7 @@
|
||||
"requireVR": false,
|
||||
"enabled": true,
|
||||
"settings": {
|
||||
"defaultServerIP": "localhost"
|
||||
"defaultServerIP": "localhost",
|
||||
"debugMode": false
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user