Skip to content

Commit

Permalink
Partial join screen function
Browse files Browse the repository at this point in the history
  • Loading branch information
Etherpod committed Oct 26, 2023
1 parent 2633420 commit 06a91e3
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 101 deletions.
Binary file modified Assets/qsbfps
Binary file not shown.
21 changes: 16 additions & 5 deletions Assets/qsbfps.manifest
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ManifestFileVersion: 0
CRC: 3373664368
CRC: 3621837169
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: e796a6b7bf0777e10b4fb7f665e89a38
Hash: 7ce287bb3fa77bc25ea4b513e459d05f
TypeTreeHash:
serializedVersion: 2
Hash: 187df04bf3dc213e6613fff963004cbf
Hash: 37909b8f29aa7a9b679671daba82561e
HashAppended: 0
ClassTypes:
- Class: 1
Expand Down Expand Up @@ -39,6 +39,8 @@ ClassTypes:
Script: {instanceID: 0}
- Class: 108
Script: {instanceID: 0}
- Class: 114
Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
- Class: 114
Expand All @@ -47,18 +49,20 @@ ClassTypes:
Script: {fileID: 11500000, guid: 3c40262156d82f34a77fd77af5176011, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: fbb2498122f7e23a2e87544333cb528f, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: dab2fbc1d63988697a57c20e75208116, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: 8c0ac0a2d9d317025f60b61313425f54, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: b916c1d32b4d92e1af466758266b9b36, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: d3e77ae3309b6f323de07b456da83fb0, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: a223d69493f03f4a8e6bda998c52d250, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: f913c288c393f80a7e923fc1c775f4fb, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
- Class: 114
Script: {fileID: 11500000, guid: 6b78346a5a700308ccb7bbeeb31f9d5b, type: 3}
- Class: 114
Expand All @@ -73,6 +77,8 @@ ClassTypes:
Script: {fileID: 11500000, guid: 5e47f4857704e9e479d099179463c3a7, type: 3}
- Class: 115
Script: {instanceID: 0}
- Class: 128
Script: {instanceID: 0}
- Class: 135
Script: {instanceID: 0}
- Class: 198
Expand All @@ -92,6 +98,7 @@ Assets:
- Assets/qsbFPS/Particles Offset Parent.prefab
- Assets/qsbFPS/OW_PvpArena.fbx
- Assets/qsbFPS/OW_PvpArena.prefab
- Assets/qsbFPS/ReadyUpScreen.prefab
- Assets/qsbFPS/GunPlayerHitEffect.prefab
- Assets/qsbFPS/GunPivot.prefab
- Assets/qsbFPS/Gun.controller
Expand All @@ -103,9 +110,13 @@ Assets:
- Assets/qsbFPS/GunFireEffect.prefab
- Assets/qsbFPS/GunGroundHitEffect.prefab
- Assets/qsbFPS/GunHUD.prefab
- Assets/qsbFPS/FilledCheckbox.png
- Assets/qsbFPS/JoinedPlayerName.prefab
- Assets/Low Poly Guns/Models/Guns/assault1/assault1.mat
- Assets/Low Poly Guns/Models/Guns/assault1/assault1.fbx
- Assets/Low Poly Guns/Models/Guns/assault1/assault1_normal.png
- Assets/Spags Assets/Textures/Demo/white_hip.png
- Assets/qsbFPS/Smoke.mat
- Assets/qsbFPS/Asteroid.fbx
- Assets/qsbFPS/EmptyCheckbox.png
Dependencies: []
8 changes: 5 additions & 3 deletions GunController.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using UnityEngine;
using OWML.Common;
using UnityEngine.UI;
using QSB.Player.Messages;
using System.Collections.Generic;
using QSB.Messaging;
using QSB.API;

namespace QSBFPS;

Expand All @@ -31,6 +28,11 @@ public class GunController : MonoBehaviour

private void Update()
{
if (!qsbFPS.Instance.gunHUD.enabled)
{
return;
}

//Detect button press
if (qsbFPS.inSolarSystem && canFire)
{
Expand Down
22 changes: 0 additions & 22 deletions PlayerDamageMessage.cs

This file was deleted.

24 changes: 0 additions & 24 deletions UpdateDictMessage.cs

This file was deleted.

112 changes: 112 additions & 0 deletions WakeUpScreenPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
using HarmonyLib;
using QSB;
using QSB.HUD;
using QSB.Player.Messages;
using QSBFPS;
using System;
using System.Reflection;
using UnityEngine;

[HarmonyPatch]
public class WakeUpScreenPatch : MonoBehaviour
{
/*[HarmonyPrefix]
[HarmonyPatch(typeof(PlayerCameraEffectController), nameof(PlayerCameraEffectController.OnStartOfTimeLoop))]
public static bool PlayerCameraEffectController_OnStartOfTimeLoop_Prefix(PlayerCameraEffectController __instance)
{
if (__instance.gameObject.CompareTag("MainCamera") && LoadManager.GetCurrentScene() != OWScene.EyeOfTheUniverse)
{
if (LoadManager.GetPreviousScene() == OWScene.TitleScreen)
{
qsbFPS.Instance.SpawnReadyUpCanvas();
__instance._owCamera.postProcessingSettings.eyeMask.openness = 0f;
__instance._owCamera.postProcessingSettings.bloom.threshold = 0f;
__instance._owCamera.postProcessingSettings.eyeMaskEnabled = true;
//Wake input is going to be manually called
__instance._waitForWakeInput = false;
__instance._wakePrompt = new ScreenPrompt(InputLibrary.interact, UITextLibrary.GetString(UITextType.WakeUpPrompt), 0, ScreenPrompt.DisplayState.Normal, false);
__instance._wakePrompt.SetVisibility(false);
//Locator.GetPromptManager().AddScreenPrompt(__instance._wakePrompt, PromptPosition.Center, false);
OWTime.Pause(OWTime.PauseType.Sleeping);
//Locator.GetPauseCommandListener().AddPauseCommandLock();
return false;
}
__instance.WakeUp();
}
return false;
}*/

[HarmonyPrefix]
[HarmonyPatch(typeof(CursorManager), nameof(CursorManager.RefreshCursorState))]
public static bool CursorManager_RefreshCursorState_Prefix(CursorManager __instance)
{
if (qsbFPS.Instance.ignoreLockCursor)
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
return false;
}

bool flag = false;

CursorLockMode cursorLockMode = CursorLockMode.Locked;
if (__instance._isPaused || !__instance._hasFocus || (OWInput.IsInputMode(InputMode.Menu | InputMode.Rebinding | InputMode.KeyboardInput) && !OWInput.IsChangePending() && !OWInput.UsingGamepad()))
{
flag = true;
cursorLockMode = CursorLockMode.None;
}
if (Cursor.visible != flag)
{
Cursor.visible = flag;
}
if (Cursor.lockState != cursorLockMode)
{
Cursor.lockState = cursorLockMode;
}
return false;
}

/*[HarmonyPrefix]
[HarmonyPatch(typeof(MultiplayerHUDManager), nameof(MultiplayerHUDManager.WriteSystemMessage))]
public static void MultiplayerHUDManager_WriteSystemMessage_Postfix(MultiplayerHUDManager __instance)
{
FieldInfo[] field;
Type classType = typeof(MultiplayerHUDManager);
field = classType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
for (int i = 0; i < field.Length; i++)
{
if (field[i].Name == "_textChat")
{
qsbFPS.Instance.ModHelper.Console.WriteLine("_textChat: " + (Transform)field[i].GetValue(__instance));
}
}
}*/

[HarmonyPrefix]
[HarmonyPatch(typeof(MultiplayerHUDManager), nameof(MultiplayerHUDManager.WriteMessage))]
public static bool CheckTextChat(MultiplayerHUDManager __instance)
{
FieldInfo[] field;
Type classType = typeof(MultiplayerHUDManager);
field = classType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
Transform textChat = null;

for (int i = 0; i < field.Length; i++)
{
if (field[i].Name == "_textChat")
{
qsbFPS.Instance.ModHelper.Console.WriteLine("_textChat: " + field[i].GetValue(__instance));
textChat = (Transform)field[i].GetValue(__instance);
}
}

if (textChat == null)
{
return false;
}

return true;
}
}
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"$schema": "https://raw.githubusercontent.com/ow-mods/owml/master/schemas/manifest_schema.json",
"filename": "qsb-fps.dll",
"author": "Etherpod",
"name": "QSB First Person Shooter",
"name": "Quantum Space Shooters",
"uniqueName": "Etherpod.qsb-fps",
"version": "0.1.0",
"owmlVersion": "2.9.6",
"dependencies": []
"dependencies": ["Raicuparta.QuantumSpaceBuddies"]
}
Loading

0 comments on commit 06a91e3

Please sign in to comment.