Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/lab issues #299

Merged
merged 2 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions Assets/GothicVR-Lab/Scenes/Lab.unity
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 7387125324240799344, guid: efebdf03cb1ccd043827e933755e413e, type: 3}
propertyPath: m_AnchoredPosition.x
value: 122
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7387125324240799344, guid: efebdf03cb1ccd043827e933755e413e, type: 3}
propertyPath: m_AnchoredPosition.y
Expand Down Expand Up @@ -3167,7 +3167,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6242851353689079636, guid: f9da24840c60a814295b88e6319d9f9c, type: 3}
propertyPath: m_AnchoredPosition.x
value: 91
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6242851353689079636, guid: f9da24840c60a814295b88e6319d9f9c, type: 3}
propertyPath: m_AnchoredPosition.y
Expand Down Expand Up @@ -3301,6 +3301,7 @@ MonoBehaviour:
arrowMaterial: {fileID: 2100000, guid: dc6ce4e18c065d34f9037b5b60259872, type: 2}
fillerMaterial: {fileID: 2100000, guid: 7f15366450c487344a1e66a13b22a847, type: 2}
skyMaterial: {fileID: 2100000, guid: 39ac659c922b5b1489714aacd9b952e9, type: 2}
mapMaterial: {fileID: 0}
gothicLoadingMenuMaterial: {fileID: 0}
loadingBarBackgroundMaterial: {fileID: 0}
loadingBarMaterial: {fileID: 0}
Expand All @@ -3320,11 +3321,13 @@ MonoBehaviour:
skipMainMenu: 0
useXRDeviceSimulator: 0
createWorldMesh: 0
createWaypoints: 0
vobItemsDynamicAttach: 0
createWayPointMeshes: 0
createWaypointEdgeMeshes: 0
enableDayTime: 0
showBarrier: 0
drawWayPoints: 0
drawWaypointEdges: 0
drawFreePoints: 0
spawnAtSpecificWayNetPoint:
TimeMultiplier: 0
sunMovementPerformanceValue: 0
startHour: 0
startMinute: 0
Expand All @@ -3340,8 +3343,6 @@ MonoBehaviour:
vobCullingLarge:
maxObjectSize: 0
cullingDistance: 0
spawnAtSpecificFreePoint:
drawFreePointMeshes: 0
drawVobCullingGizmos: 0
vobTypeToSpawn:
createOcNpcs: 0
Expand All @@ -3353,8 +3354,8 @@ MonoBehaviour:
enableVobParticles: 0
zenKitLogLevel: 3
showZspyLogs: 1
showZenKitVfsFileNotFoundErrors: 0
showMusicLogs: 0
showBarrierLogs: 0
--- !u!114 &464842616
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4652,15 +4653,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_SizeDelta.x
value: 181.14
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_AnchoredPosition.x
value: 147.05
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_AnchoredPosition.y
Expand Down Expand Up @@ -7843,15 +7844,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8107108474233336363, guid: 49e2fbde9521b4341879174df5a51b64, type: 3}
propertyPath: m_SizeDelta.x
value: 262.09998
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8107108474233336363, guid: 49e2fbde9521b4341879174df5a51b64, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8107108474233336363, guid: 49e2fbde9521b4341879174df5a51b64, type: 3}
propertyPath: m_AnchoredPosition.x
value: 147.04999
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8107108474233336363, guid: 49e2fbde9521b4341879174df5a51b64, type: 3}
propertyPath: m_AnchoredPosition.y
Expand Down Expand Up @@ -8950,15 +8951,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_SizeDelta.x
value: 262.09998
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_AnchoredPosition.x
value: 147.04999
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_AnchoredPosition.y
Expand Down Expand Up @@ -9765,15 +9766,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_SizeDelta.x
value: 262.1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_AnchoredPosition.x
value: 147.05
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_AnchoredPosition.y
Expand Down Expand Up @@ -16344,15 +16345,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_SizeDelta.x
value: 178.94
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_AnchoredPosition.x
value: 147.05
value: 0
objectReference: {fileID: 0}
- target: {fileID: 781630663273105846, guid: fcac0c3f142ea3742a0565751dec41de, type: 3}
propertyPath: m_AnchoredPosition.y
Expand Down Expand Up @@ -17393,9 +17394,9 @@ MonoBehaviour:
bootNpcHandler: 1
bootLockableHandler: 0
bootAttachPointHandler: 0
npcHandler: {fileID: 1791413021}
lockableHandler: {fileID: 1956714045}
vobHandAttachPointsHandler: {fileID: 330949651}
npcLabHandler: {fileID: 1791413021}
lockableLabHandler: {fileID: 1956714045}
vobHandAttachPointsLabHandler: {fileID: 330949651}
--- !u!1001 &2119216504
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace GVR.Lab.Handler
{
public interface IHandler
public interface ILabHandler
{
public void Bootstrap();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace GVR.Lab.Handler
{
public class LockableHandler : MonoBehaviour, IHandler
public class LabLockableLabHandler : MonoBehaviour, ILabHandler
{
public GameObject chestsGo;
public GameObject doorsGo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace GVR.Lab.Handler
{
public class NpcHandler : MonoBehaviour, IHandler
public class LabNpcLabHandler : MonoBehaviour, ILabHandler
{
public TMP_Dropdown animationsDropdown;
public GameObject bloodwynSlotGo;
Expand Down Expand Up @@ -62,11 +62,8 @@ private void BootstrapBloodwyn()
// Hero
{
// Need to be set for later usage (e.g. Bloodwyn checks your inventory if enough nuggets are carried)
var heroGo = PrefabCache.TryGetObject(PrefabCache.PrefabType.Npc);
heroGo.SetParent(bloodwynSlotGo);
var heroInstance = GameData.GothicVm.InitInstance<NpcInstance>("hero");
LookupCache.NpcCache[heroInstance.Index] = properties;
GameData.GothicVm.GlobalOther = heroInstance;
GameData.GothicVm.GlobalHero = heroInstance;
}

var mdmName = "Hum_GRDM_ARMOR.asc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace GVR.Lab.Handler
{
public class VobHandAttachPointsHandler: MonoBehaviour, IHandler
public class LabVobHandAttachPointsLabHandler: MonoBehaviour, ILabHandler
{
public TMP_Dropdown vobCategoryDropdown;
public TMP_Dropdown vobItemDropdown;
Expand Down
12 changes: 6 additions & 6 deletions Assets/GothicVR-Lab/Scripts/LabBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public class LabBootstrapper : MonoBehaviour
public bool bootLockableHandler;
public bool bootAttachPointHandler;

public NpcHandler npcHandler;
public LockableHandler lockableHandler;
public VobHandAttachPointsHandler vobHandAttachPointsHandler;
public LabNpcLabHandler npcLabHandler;
public LabLockableLabHandler lockableLabHandler;
public LabVobHandAttachPointsLabHandler vobHandAttachPointsLabHandler;

private bool isBooted;
/// <summary>
Expand All @@ -31,11 +31,11 @@ private void Update()
GvrBootstrapper.BootGothicVR(SettingsManager.GameSettings.GothicIPath);

if (bootNpcHandler)
npcHandler.Bootstrap();
npcLabHandler.Bootstrap();
if (bootLockableHandler)
lockableHandler.Bootstrap();
lockableLabHandler.Bootstrap();
if (bootAttachPointHandler)
vobHandAttachPointsHandler.Bootstrap();
vobHandAttachPointsLabHandler.Bootstrap();
}

private void OnDestroy()
Expand Down
2 changes: 2 additions & 0 deletions Assets/GothicVR/Scripts/Globals/GvrEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace GVR.Globals
/// </summary>
public static class GvrEvents
{
public static readonly UnityEvent ZenKitBootstrapped = new();

public static readonly UnityEvent MainMenuSceneLoaded = new();
public static readonly UnityEvent MainMenuSceneUnloaded = new();

Expand Down
5 changes: 3 additions & 2 deletions Assets/GothicVR/Scripts/Manager/GvrBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ public static void BootGothicVR(string g1Dir)
LoadDialogs();
LoadSfxVm(g1Dir);
LoadPfxVm(g1Dir);
LoadMusicVv(g1Dir);
LoadMusicVm(g1Dir);
LoadMusic();
LoadFonts();

watch.Stop();
Debug.Log($"Time spent for Bootstrapping ZenKit: {watch.Elapsed}");

GvrEvents.ZenKitBootstrapped.Invoke();
}

public static void ZenKitLoggerCallback(LogLevel level, string name, string message)
Expand Down Expand Up @@ -184,7 +185,7 @@ private static void LoadPfxVm(string g1Dir)
GameData.PfxVm = new DaedalusVm(fullPath);
}

private static void LoadMusicVv(string g1Dir)
private static void LoadMusicVm(string g1Dir)
{
var fullPath = Path.GetFullPath(Path.Join(g1Dir, "/_work/DATA/scripts/_compiled/MUSIC.DAT"));
GameData.MusicVm = new DaedalusVm(fullPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using GVR.Data;
using GVR.Extensions;
using GVR.Globals;
using GVR.GothicVR.Scripts.Manager;
using GVR.Util;
using TMPro;
Expand Down Expand Up @@ -34,10 +35,13 @@ public class ControllerManager : SingletonBehaviour<ControllerManager>
AudioSource mapaudio;
AudioClip scrollsound;

protected override void Awake()
private void Start()
{
base.Awake();
GvrEvents.ZenKitBootstrapped.AddListener(Initialize);
}

private void Initialize()
{
maproll = MapObject.gameObject.GetComponent<Animator>();
mapaudio = MapObject.gameObject.GetComponent<AudioSource>();
scrollsound = VobHelper.GetSoundClip("SCROLLROLL.WAV");
Expand Down