mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-30 12:32:55 +00:00
commit
9a6f82fabb
@ -76,6 +76,7 @@ The template for this file is this :
|
||||
"autoStart": false,
|
||||
"kickEveryone": false,
|
||||
"disableLoopDeath": false,
|
||||
"timeout": 25,
|
||||
"debugMode": false,
|
||||
"drawGui": false,
|
||||
"drawLines": false,
|
||||
@ -91,6 +92,7 @@ The template for this file is this :
|
||||
- autoStart - Host/connect automatically for faster testing.
|
||||
- kickEveryone - Kick anyone who joins a game.
|
||||
- disableLoopDeath - Make it so the loop doesn't end when everyone is dead.
|
||||
- timeout - How many seconds for your connection to timeout, in seconds.
|
||||
- debugMode - Enables debug mode. If this is set to `false`, none of the following settings do anything.
|
||||
- drawGui - Draws a GUI at the top of the screen that gives information on many things.
|
||||
- drawLines - Draws gizmo-esque lines around things. Indicates reference sectors/transforms, triggers, etc. LAGGY.
|
||||
|
@ -67,10 +67,8 @@ public class HelmetAnimator : MonoBehaviour
|
||||
{
|
||||
_fakeHelmetDitheringAnimator.SetVisible(false);
|
||||
FakeHelmet.gameObject.SetActive(false);
|
||||
if (!SuitGroup.activeSelf)
|
||||
{
|
||||
FakeHead.gameObject.SetActive(false);
|
||||
}
|
||||
// If the player is currently wearing their suit but has no helmet on, make sure to make the head visible (#655)
|
||||
FakeHead.gameObject.SetActive(SuitGroup.activeSelf);
|
||||
}
|
||||
}
|
||||
|
||||
|
63
QSB/Menus/PreflightChecklistAdjustment.cs
Normal file
63
QSB/Menus/PreflightChecklistAdjustment.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using QSB.Utility;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace QSB.Menus;
|
||||
|
||||
internal class PreflightChecklistAdjustment : MonoBehaviour, IAddComponentOnStart
|
||||
{
|
||||
private string[] _preflightOptionsToRemove = new string[]
|
||||
{
|
||||
"UIElement-FreezeTimeTranslating",
|
||||
"UIElement-FreezeTimeShipLog",
|
||||
"UIElement-FreezeTimeConversations",
|
||||
"UIElement-FreezeTimeTranslator",
|
||||
"UIElement-FreezeTimeDialogue"
|
||||
};
|
||||
|
||||
private MenuOption[] DestroyFreezeTimeOptions(MenuOption[] options)
|
||||
{
|
||||
var remainingMenuOptions = new List<MenuOption>();
|
||||
foreach (var preflightChecklistOption in options)
|
||||
{
|
||||
if (_preflightOptionsToRemove.Contains(preflightChecklistOption.name))
|
||||
{
|
||||
GameObject.Destroy(preflightChecklistOption.gameObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
remainingMenuOptions.Add(preflightChecklistOption);
|
||||
}
|
||||
}
|
||||
return remainingMenuOptions.ToArray();
|
||||
}
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
QSBSceneManager.OnPostSceneLoad += (_, loadScene) =>
|
||||
{
|
||||
if (QSBCore.IsInMultiplayer && loadScene.IsUniverseScene())
|
||||
{
|
||||
// PREFLIGHT MENU IN THE SHIP
|
||||
var suitMenuManager = GameObject.FindObjectOfType<SuitMenuManager>()._mainMenu;
|
||||
suitMenuManager._menuOptions = DestroyFreezeTimeOptions(suitMenuManager._menuOptions);
|
||||
|
||||
// Remove cosmetic elements from ship preflight checklist
|
||||
var suitOptionsMenu = GameObject.Find("PauseMenu/PreFlightCanvas/OptionsMenu-Panel/SuitOptionsDisplayPanel/SuitOptionsMainMenu/");
|
||||
GameObject.Destroy(suitOptionsMenu.transform.Find("FreezeTimeImage").gameObject);
|
||||
GameObject.Destroy(suitOptionsMenu.transform.Find("Box-FreezeTimeBorder").gameObject);
|
||||
|
||||
|
||||
// PREFLIGHT MENU IN THE OPTIONS MENU
|
||||
var settingsMenuView = GameObject.FindObjectOfType<SettingsMenuView>();
|
||||
settingsMenuView._listSettingsOptions = DestroyFreezeTimeOptions(settingsMenuView._listSettingsOptions);
|
||||
|
||||
// This one also points to the same options, have to remove the destroyed objects from it
|
||||
var menuGameplayPreFlight = GameObject.Find("PauseMenu/OptionsCanvas/OptionsMenu-Panel/OptionsDisplayPanel/GameplayMenu/MenuGameplayPreFl/").GetComponent<Menu>();
|
||||
Delay.RunNextFrame(() => menuGameplayPreFlight._menuOptions = menuGameplayPreFlight._menuOptions.Where(x => x != null).ToArray());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -78,10 +78,14 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart
|
||||
|
||||
{
|
||||
_kcpTransport = gameObject.AddComponent<kcp2k.KcpTransport>();
|
||||
// KCP uses milliseconds
|
||||
_kcpTransport.Timeout = QSBCore.DebugSettings.Timeout * 1000;
|
||||
}
|
||||
|
||||
{
|
||||
_steamTransport = gameObject.AddComponent<FizzySteamworks>();
|
||||
// Steam uses seconds
|
||||
_steamTransport.Timeout = QSBCore.DebugSettings.Timeout;
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -32,6 +32,12 @@ public class DebugSettings
|
||||
[JsonProperty("randomizeSkins")]
|
||||
public bool RandomizeSkins;
|
||||
|
||||
/// <summary>
|
||||
/// Timeout in seconds
|
||||
/// </summary>
|
||||
[JsonProperty("timeout")]
|
||||
public int Timeout = 25;
|
||||
|
||||
[JsonProperty("debugMode")]
|
||||
public bool DebugMode;
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
"body": "- Disable *all* other mods. (Can heavily affect performance)\n- Make sure you are not running any other network-intensive applications."
|
||||
},
|
||||
"uniqueName": "Raicuparta.QuantumSpaceBuddies",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"owmlVersion": "2.9.8",
|
||||
"dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ],
|
||||
"pathsToPreserve": [ "debugsettings.json" ],
|
||||
|
Loading…
x
Reference in New Issue
Block a user